Re: [PATCH 2/2] staging: sm750fb: add spaces around operator

2015-11-08 Thread Dan Carpenter
On Sun, Nov 08, 2015 at 08:33:16AM +0100, Othmar Pasteka wrote:
> Should I send a new version or is it a note for next time?

Send a new version.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 9/9] Staging: lustre: llite_internal: Remove function prototype

2015-11-08 Thread Shivani Bhardwaj
On Sun, Nov 8, 2015 at 2:17 AM, Dan Carpenter  wrote:
> Don't resend, it's fine.  I don't like re-reviewing patches and you
> don't like sending them.  It's not like it introduces a bug or generate
> a warning with our current tools.
>
> But it's still important to understand how the one thing per patch rule
> works (don't do half a thing per patch) so I wanted you to be aware of
> it for future patches as you said.
>

I'll take care next time.

Thank you
Shivani

> regards,
> dan carpenter
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: lustre: workitem: Remove cfs_wi_sched_lock wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function cfs_wi_sched_lock() and replace all its
calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/libcfs/workitem.c | 22 --
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c 
b/drivers/staging/lustre/lustre/libcfs/workitem.c
index b57acbf..e8bac9b 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -87,12 +87,6 @@ static struct cfs_workitem_data {
 } cfs_wi_data;
 
 static inline void
-cfs_wi_sched_lock(struct cfs_wi_sched *sched)
-{
-   spin_lock(&sched->ws_lock);
-}
-
-static inline void
 cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
 {
spin_unlock(&sched->ws_lock);
@@ -101,7 +95,7 @@ cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
 static inline int
 cfs_wi_sched_cansleep(struct cfs_wi_sched *sched)
 {
-   cfs_wi_sched_lock(sched);
+   spin_lock(&sched->ws_lock);
if (sched->ws_stopping) {
cfs_wi_sched_unlock(sched);
return 0;
@@ -125,7 +119,7 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
LASSERT(!in_interrupt()); /* because we use plain spinlock */
LASSERT(!sched->ws_stopping);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(&sched->ws_lock);
 
LASSERT(wi->wi_running);
if (wi->wi_scheduled) { /* cancel pending schedules */
@@ -161,7 +155,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, 
cfs_workitem_t *wi)
 * means the workitem will not be scheduled and will not have
 * any race with wi_action.
 */
-   cfs_wi_sched_lock(sched);
+   spin_lock(&sched->ws_lock);
 
rc = !(wi->wi_running);
 
@@ -195,7 +189,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t 
*wi)
LASSERT(!in_interrupt()); /* because we use plain spinlock */
LASSERT(!sched->ws_stopping);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(&sched->ws_lock);
 
if (!wi->wi_scheduled) {
LASSERT (list_empty(&wi->wi_list));
@@ -237,7 +231,7 @@ cfs_wi_scheduler (void *arg)
 
spin_unlock(&cfs_wi_data.wi_glock);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(&sched->ws_lock);
 
while (!sched->ws_stopping) {
int  nloops = 0;
@@ -263,7 +257,7 @@ cfs_wi_scheduler (void *arg)
 
rc = (*wi->wi_action) (wi);
 
-   cfs_wi_sched_lock(sched);
+   spin_lock(&sched->ws_lock);
if (rc != 0) /* WI should be dead, even be freed! */
continue;
 
@@ -282,14 +276,14 @@ cfs_wi_scheduler (void *arg)
/* don't sleep because some workitems still
 * expect me to come back soon */
cond_resched();
-   cfs_wi_sched_lock(sched);
+   spin_lock(&sched->ws_lock);
continue;
}
 
cfs_wi_sched_unlock(sched);
rc = wait_event_interruptible_exclusive(sched->ws_waitq,
!cfs_wi_sched_cansleep(sched));
-   cfs_wi_sched_lock(sched);
+   spin_lock(&sched->ws_lock);
}
 
cfs_wi_sched_unlock(sched);
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/2] Remove wrapper functions from workitem

2015-11-08 Thread Shivani Bhardwaj
This patchset removes unnecessary wrapper functions from the file workitem
and replace all their calls with the function that they wrap.
After applying this patch, code becomes cleaner.

Shivani Bhardwaj (2):
  staging: lustre: workitem: Remove cfs_wi_sched_lock wrapper
  staging: lustre: workitem: Remove cfs_wi_sched_unlock wrapper

 drivers/staging/lustre/lustre/libcfs/workitem.c | 48 ++---
 1 file changed, 18 insertions(+), 30 deletions(-)

-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: lustre: workitem: Remove cfs_wi_sched_unlock wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function cfs_wi_sched_unlock() and replace all its
calls with the function it wrapped.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/libcfs/workitem.c | 26 ++---
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c 
b/drivers/staging/lustre/lustre/libcfs/workitem.c
index e8bac9b..60bb88a 100644
--- a/drivers/staging/lustre/lustre/libcfs/workitem.c
+++ b/drivers/staging/lustre/lustre/libcfs/workitem.c
@@ -86,26 +86,20 @@ static struct cfs_workitem_data {
int wi_stopping;
 } cfs_wi_data;
 
-static inline void
-cfs_wi_sched_unlock(struct cfs_wi_sched *sched)
-{
-   spin_unlock(&sched->ws_lock);
-}
-
 static inline int
 cfs_wi_sched_cansleep(struct cfs_wi_sched *sched)
 {
spin_lock(&sched->ws_lock);
if (sched->ws_stopping) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
return 0;
}
 
if (!list_empty(&sched->ws_runq)) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
return 0;
}
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
return 1;
 }
 
@@ -133,7 +127,7 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi)
LASSERT(list_empty(&wi->wi_list));
 
wi->wi_scheduled = 1; /* LBUG future schedule attempts */
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
 
return;
 }
@@ -171,7 +165,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, 
cfs_workitem_t *wi)
 
LASSERT (list_empty(&wi->wi_list));
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
return rc;
 }
 EXPORT_SYMBOL(cfs_wi_deschedule);
@@ -205,7 +199,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t 
*wi)
}
 
LASSERT (!list_empty(&wi->wi_list));
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
return;
 }
 EXPORT_SYMBOL(cfs_wi_schedule);
@@ -252,7 +246,7 @@ cfs_wi_scheduler (void *arg)
wi->wi_running   = 1;
wi->wi_scheduled = 0;
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
nloops++;
 
rc = (*wi->wi_action) (wi);
@@ -272,7 +266,7 @@ cfs_wi_scheduler (void *arg)
}
 
if (!list_empty(&sched->ws_runq)) {
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
/* don't sleep because some workitems still
 * expect me to come back soon */
cond_resched();
@@ -280,13 +274,13 @@ cfs_wi_scheduler (void *arg)
continue;
}
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
rc = wait_event_interruptible_exclusive(sched->ws_waitq,
!cfs_wi_sched_cansleep(sched));
spin_lock(&sched->ws_lock);
}
 
-   cfs_wi_sched_unlock(sched);
+   spin_unlock(&sched->ws_lock);
 
spin_lock(&cfs_wi_data.wi_glock);
sched->ws_nthreads--;
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 5/7] staging: sm750fb: introduce sm750fb_frambuffer_release

2015-11-08 Thread Mike Rapoport
Use a function to unregister framebuffer info and release its resources.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/sm750.c | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 1b3ab04..88a6405 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1002,6 +1002,18 @@ NO_PARAM:
}
 }
 
+static void sm750fb_frambuffer_release(struct sm750_dev *sm750_dev)
+{
+   struct fb_info *fb_info;
+
+   while (sm750_dev->fb_count) {
+   fb_info = sm750_dev->fbinfo[sm750_dev->fb_count - 1];
+   unregister_framebuffer(fb_info);
+   framebuffer_release(fb_info);
+   sm750_dev->fb_count--;
+   }
+}
+
 static int lynxfb_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
@@ -1138,22 +1150,11 @@ disable_pci:
 
 static void lynxfb_pci_remove(struct pci_dev *pdev)
 {
-   struct fb_info *info;
struct sm750_dev *sm750_dev;
-   int cnt;
 
-   cnt = 2;
sm750_dev = pci_get_drvdata(pdev);
 
-   while (cnt-- > 0) {
-   info = sm750_dev->fbinfo[cnt];
-   if (!info)
-   continue;
-
-   unregister_framebuffer(info);
-   /* release frame buffer */
-   framebuffer_release(info);
-   }
+   sm750fb_frambuffer_release(sm750_dev);
arch_phys_wc_del(sm750_dev->mtrr.vram);
 
iounmap(sm750_dev->pvReg);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 4/7] staging: sm750fb: replace dual member of sm750_dev with fb_count

2015-11-08 Thread Mike Rapoport
Will be used in futher refactoring of driver _probe and _remove methods.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/sm750.c | 24 +---
 drivers/staging/sm750fb/sm750.h |  2 +-
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 6ed4478..1b3ab04 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -189,7 +189,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
 * If not use spin_lock,system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->dual)
+   if (sm750_dev->fb_count > 1)
spin_lock(&sm750_dev->slock);
 
sm750_dev->accel.de_fillrect(&sm750_dev->accel,
@@ -197,7 +197,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
 region->dx, region->dy,
 region->width, region->height,
 color, rop);
-   if (sm750_dev->dual)
+   if (sm750_dev->fb_count > 1)
spin_unlock(&sm750_dev->slock);
 }
 
@@ -223,7 +223,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->dual)
+   if (sm750_dev->fb_count > 1)
spin_lock(&sm750_dev->slock);
 
sm750_dev->accel.de_copyarea(&sm750_dev->accel,
@@ -231,7 +231,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
 base, pitch, Bpp, region->dx, region->dy,
 region->width, region->height,
 HW_ROP2_COPY);
-   if (sm750_dev->dual)
+   if (sm750_dev->fb_count > 1)
spin_unlock(&sm750_dev->slock);
 }
 
@@ -272,7 +272,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->dual)
+   if (sm750_dev->fb_count > 1)
spin_lock(&sm750_dev->slock);
 
sm750_dev->accel.de_imageblit(&sm750_dev->accel,
@@ -281,7 +281,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
  image->dx, image->dy,
  image->width, image->height,
  fgcol, bgcol, HW_ROP2_COPY);
-   if (sm750_dev->dual)
+   if (sm750_dev->fb_count > 1)
spin_unlock(&sm750_dev->slock);
 }
 
@@ -650,8 +650,10 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
output = &par->output;
crtc = &par->crtc;
 
-   crtc->vidmem_size = (sm750_dev->dual) ? sm750_dev->vidmem_size >> 1 :
-sm750_dev->vidmem_size;
+   crtc->vidmem_size = sm750_dev->vidmem_size;
+   if (sm750_dev->fb_count > 1)
+   crtc->vidmem_size >>= 1;
+
/* setup crtc and output member */
sm750_dev->hwCursor = g_hwcursor;
 
@@ -981,7 +983,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char 
*src)
 
 NO_PARAM:
if (sm750_dev->revid != SM750LE_REVISION_ID) {
-   if (sm750_dev->dual) {
+   if (sm750_dev->fb_count > 1) {
if (swap)
sm750_dev->dataflow = sm750_dual_swap;
else
@@ -1027,7 +1029,6 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
sm750_dev->mtrr_off = g_nomtrr;
sm750_dev->mtrr.vram = 0;
sm750_dev->accel_off = g_noaccel;
-   sm750_dev->dual = g_dualview;
spin_lock_init(&sm750_dev->slock);
 
if (!sm750_dev->accel_off) {
@@ -1113,7 +1114,8 @@ ALLOC_FB:
 
/* no dual view by far */
fbidx++;
-   if (sm750_dev->dual && fbidx < 2)
+   sm750_dev->fb_count++;
+   if (g_dualview && fbidx < 2)
goto ALLOC_FB;
 
return 0;
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index b0a93cd..fddffac 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -79,7 +79,7 @@ struct sm750_dev {
struct fb_info *fbinfo[2];
struct lynx_accel accel;
int accel_off;
-   int dual;
+   int fb_count;
int mtrr_off;
struct{
int vram;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 1/7] staging: sm750fb: disable PCI device if lynxfb_pci_probe fails

2015-11-08 Thread Mike Rapoport
In case of error during lynxfb_pci_probe, the function returned without
calling pci_disable_device. Fix it by adding pci_disable_device on the
error cleanup path.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/sm750.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index c78421b..c80b11c 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1132,6 +1132,7 @@ err_info0_alloc:
 err_map:
kfree(sm750_dev);
 err_share:
+   pci_disable_device(pdev);
 err_enable:
return -ENODEV;
 }
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 3/7] staging: sm750fb: lynxfb_pci_remove: remove unused variable

2015-11-08 Thread Mike Rapoport
The par variable in lynxfb_pci_remove is only assigned a value and never
used afterwards. Remove it.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/sm750.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 7eb3868..6ed4478 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1138,7 +1138,6 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
 {
struct fb_info *info;
struct sm750_dev *sm750_dev;
-   struct lynxfb_par *par;
int cnt;
 
cnt = 2;
@@ -1148,7 +1147,6 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
info = sm750_dev->fbinfo[cnt];
if (!info)
continue;
-   par = info->par;
 
unregister_framebuffer(info);
/* release frame buffer */
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 0/7] staging: sm750fb: refactor lynxfb_pci_probe

2015-11-08 Thread Mike Rapoport
Hi,

These patches refactor the lynxfb_pci_probe

v4 changes:
* address Dan's comments

v3 changes:
* rebased on current Greg's staging-testing

v2 changes:
* add pci_disable_device on the cleanup path
* return actual error rather than ENODEV


Mike Rapoport (7):
  staging: sm750fb: disable PCI device if lynxfb_pci_probe fails
  staging: sm750fb: lynxfb_pci_probe: return actual errors
  staging: sm750fb: lynxfb_pci_remove: remove unused variable
  staging: sm750fb: replace dual member of sm750_dev with fb_count
  staging: sm750fb: introduce sm750fb_frambuffer_release
  staging: sm750fb: introduce sm750fb_frambuffer_alloc
  staging: sm750fb: lynxfb_pci_probe: remove some pr_info

 drivers/staging/sm750fb/sm750.c | 183 +---
 drivers/staging/sm750fb/sm750.h |   2 +-
 2 files changed, 80 insertions(+), 105 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 2/7] staging: sm750fb: lynxfb_pci_probe: return actual errors

2015-11-08 Thread Mike Rapoport
The lynxfb_pci_probe always returned -ENODEV in case of error. Modify it
so that actual error code will be propogated to the caller.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/sm750.c | 37 +
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index c80b11c..7eb3868 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1006,18 +1006,17 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
struct fb_info *info[] = {NULL, NULL};
struct sm750_dev *sm750_dev = NULL;
int fbidx;
+   int err;
 
/* enable device */
-   if (pci_enable_device(pdev)) {
-   pr_err("can not enable device.\n");
-   goto err_enable;
-   }
+   err = pci_enable_device(pdev);
+   if (err)
+   return err;
 
+   err = -ENOMEM;
sm750_dev = kzalloc(sizeof(*sm750_dev), GFP_KERNEL);
-   if (!sm750_dev) {
-   pr_err("Could not allocate memory for share.\n");
-   goto err_share;
-   }
+   if (!sm750_dev)
+   goto disable_pci;
 
sm750_dev->fbinfo[0] = sm750_dev->fbinfo[1] = NULL;
sm750_dev->devid = pdev->device;
@@ -1051,10 +1050,9 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
sm750fb_setup(sm750_dev, g_settings);
 
/* call chip specific mmap routine */
-   if (hw_sm750_map(sm750_dev, pdev)) {
-   pr_err("Memory map failed\n");
-   goto err_map;
-   }
+   err = hw_sm750_map(sm750_dev, pdev);
+   if (err)
+   goto free_sm750_dev;
 
if (!sm750_dev->mtrr_off)
sm750_dev->mtrr.vram = arch_phys_wc_add(sm750_dev->vidmem_start,
@@ -1073,6 +1071,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
/* allocate frame buffer info structor according to g_dualview */
fbidx = 0;
 ALLOC_FB:
+   err = -ENOMEM;
info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par), &pdev->dev);
if (!info[fbidx]) {
pr_err("Could not allocate framebuffer #%d.\n", fbidx);
@@ -1082,7 +1081,6 @@ ALLOC_FB:
goto err_info1_alloc;
} else {
struct lynxfb_par *par;
-   int errno;
 
pr_info("framebuffer #%d alloc okay\n", fbidx);
sm750_dev->fbinfo[fbidx] = info[fbidx];
@@ -1100,11 +1098,11 @@ ALLOC_FB:
 
/* register frame buffer */
pr_info("Ready to register framebuffer #%d.\n", fbidx);
-   errno = register_framebuffer(info[fbidx]);
-   if (errno < 0) {
+   err = register_framebuffer(info[fbidx]);
+   if (err < 0) {
pr_err("Failed to register fb_info #%d. err %d\n",
   fbidx,
-  errno);
+  err);
if (fbidx == 0)
goto err_register0;
else
@@ -1129,12 +1127,11 @@ err_register0:
 err_info0_set:
framebuffer_release(info[0]);
 err_info0_alloc:
-err_map:
+free_sm750_dev:
kfree(sm750_dev);
-err_share:
+disable_pci:
pci_disable_device(pdev);
-err_enable:
-   return -ENODEV;
+   return err;
 }
 
 static void lynxfb_pci_remove(struct pci_dev *pdev)
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 6/7] staging: sm750fb: introduce sm750fb_frambuffer_alloc

2015-11-08 Thread Mike Rapoport
Split framebuffer allocation and registration into a dedicated function
to simplify lynxfb_pci_probe

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/sm750.c | 98 +
 1 file changed, 41 insertions(+), 57 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 88a6405..c33c7ff 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1014,11 +1014,43 @@ static void sm750fb_frambuffer_release(struct sm750_dev 
*sm750_dev)
}
 }
 
+static int sm750fb_frambuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
+{
+   struct fb_info *fb_info;
+   struct lynxfb_par *par;
+   int err;
+
+   fb_info = framebuffer_alloc(sizeof(struct lynxfb_par),
+   &sm750_dev->pdev->dev);
+   if (!fb_info)
+   return -ENOMEM;
+
+   sm750_dev->fbinfo[fbidx] = fb_info;
+   par = fb_info->par;
+   par->dev = sm750_dev;
+
+   err = lynxfb_set_fbinfo(fb_info, fbidx);
+   if (err)
+   goto release_fb;
+
+   err = register_framebuffer(fb_info);
+   if (err < 0)
+   goto release_fb;
+
+   sm750_dev->fb_count++;
+
+   return 0;
+
+release_fb:
+   framebuffer_release(fb_info);
+   return err;
+}
+
 static int lynxfb_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
 {
-   struct fb_info *info[] = {NULL, NULL};
struct sm750_dev *sm750_dev = NULL;
+   int max_fb;
int fbidx;
int err;
 
@@ -1081,66 +1113,18 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
/* call chipInit routine */
hw_sm750_inithw(sm750_dev, pdev);
 
-   /* allocate frame buffer info structor according to g_dualview */
-   fbidx = 0;
-ALLOC_FB:
-   err = -ENOMEM;
-   info[fbidx] = framebuffer_alloc(sizeof(struct lynxfb_par), &pdev->dev);
-   if (!info[fbidx]) {
-   pr_err("Could not allocate framebuffer #%d.\n", fbidx);
-   if (fbidx == 0)
-   goto err_info0_alloc;
-   else
-   goto err_info1_alloc;
-   } else {
-   struct lynxfb_par *par;
-
-   pr_info("framebuffer #%d alloc okay\n", fbidx);
-   sm750_dev->fbinfo[fbidx] = info[fbidx];
-   par = info[fbidx]->par;
-   par->dev = sm750_dev;
-
-   /* set fb_info structure */
-   if (lynxfb_set_fbinfo(info[fbidx], fbidx)) {
-   pr_err("Failed to initial fb_info #%d.\n", fbidx);
-   if (fbidx == 0)
-   goto err_info0_set;
-   else
-   goto err_info1_set;
-   }
-
-   /* register frame buffer */
-   pr_info("Ready to register framebuffer #%d.\n", fbidx);
-   err = register_framebuffer(info[fbidx]);
-   if (err < 0) {
-   pr_err("Failed to register fb_info #%d. err %d\n",
-  fbidx,
-  err);
-   if (fbidx == 0)
-   goto err_register0;
-   else
-   goto err_register1;
-   }
-   pr_info("Accomplished register framebuffer #%d.\n", fbidx);
+   /* allocate frame buffer info structures according to g_dualview */
+   max_fb = g_dualview ? 2 : 1;
+   for (fbidx = 0; fbidx < max_fb; fbidx++) {
+   err = sm750fb_frambuffer_alloc(sm750_dev, fbidx);
+   if (err)
+   goto release_fb;
}
 
-   /* no dual view by far */
-   fbidx++;
-   sm750_dev->fb_count++;
-   if (g_dualview && fbidx < 2)
-   goto ALLOC_FB;
-
return 0;
 
-err_register1:
-err_info1_set:
-   framebuffer_release(info[1]);
-err_info1_alloc:
-   unregister_framebuffer(info[0]);
-err_register0:
-err_info0_set:
-   framebuffer_release(info[0]);
-err_info0_alloc:
+release_fb:
+   sm750fb_frambuffer_release(sm750_dev);
 free_sm750_dev:
kfree(sm750_dev);
 disable_pci:
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 7/7] staging: sm750fb: lynxfb_pci_probe: remove some pr_info

2015-11-08 Thread Mike Rapoport
Several pr_info statements in lynxfb_pci_probe seem like debug leftovers
and may be removed.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/sm750.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index c33c7ff..2ae2a52 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1067,8 +1067,6 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
sm750_dev->fbinfo[0] = sm750_dev->fbinfo[1] = NULL;
sm750_dev->devid = pdev->device;
sm750_dev->revid = pdev->revision;
-
-   pr_info("share->revid = %02x\n", sm750_dev->revid);
sm750_dev->pdev = pdev;
sm750_dev->mtrr_off = g_nomtrr;
sm750_dev->mtrr.vram = 0;
@@ -1086,9 +1084,6 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
sm750_dev->accel.de_fillrect = hw_fillrect;
sm750_dev->accel.de_copyarea = hw_copyarea;
sm750_dev->accel.de_imageblit = hw_imageblit;
-   pr_info("enable 2d acceleration\n");
-   } else {
-   pr_info("disable 2d acceleration\n");
}
 
/* call chip specific setup routine  */
@@ -1105,9 +1100,6 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 
memset_io(sm750_dev->pvMem, 0, sm750_dev->vidmem_size);
 
-   pr_info("sm%3x mmio address = %p\n", sm750_dev->devid,
-   sm750_dev->pvReg);
-
pci_set_drvdata(pdev, sm750_dev);
 
/* call chipInit routine */
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 01/13] staging: rtl8188eu: if/else replaced by min_t

2015-11-08 Thread Andy Shevchenko
On Sun, Nov 8, 2015 at 6:29 AM, Ivan Safonov  wrote:
> Duplicated code removed.
>
> Signed-off-by: Ivan Safonov 
> ---
>  drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c 
> b/drivers/staging/rtl8188eu/core/rtw_cmd.c
> index 433b926..69f8744d9 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
> @@ -442,10 +442,8 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct 
> wlan_network *pnetwork)
>
> psecuritypriv->authenticator_ie[0] = (unsigned 
> char)psecnetwork->IELength;
>
> -   if ((psecnetwork->IELength-12) < (256-1))
> -   memcpy(&psecuritypriv->authenticator_ie[1], 
> &psecnetwork->IEs[12], psecnetwork->IELength-12);
> -   else
> -   memcpy(&psecuritypriv->authenticator_ie[1], 
> &psecnetwork->IEs[12], (256-1));
> +   memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12],
> +  min_t(size_t, psecnetwork->IELength - 12, 256 - 1));

256 is a magic number. Like I said earlier, it seems a sizeof of
corresponding member.

>
> psecnetwork->IELength = 0;
> /*  Added by Albert 2009/02/18 */
> --
> 2.4.10
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function

2015-11-08 Thread Andy Shevchenko
On Sun, Nov 8, 2015 at 8:37 AM, Ivan Safonov  wrote:
> Ideally the function should not change the variables outside of its body.
>
> Signed-off-by: Ivan Safonov 
> ---
>  drivers/staging/rtl8188eu/hal/fw.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/fw.c 
> b/drivers/staging/rtl8188eu/hal/fw.c
> index 4d72537..5b569ef 100644
> --- a/drivers/staging/rtl8188eu/hal/fw.c
> +++ b/drivers/staging/rtl8188eu/hal/fw.c
> @@ -75,14 +75,14 @@ static void _rtl88e_fw_block_write(struct adapter *adapt,
> usb_write8(adapt, write_address, byte_buffer[i]);
>  }
>
> -static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen)
> +static u32 _rtl88e_fill_dummy(u8 *pfwbuf, u32 pfwlen)
>  {
> u32 i;
>
> -   for (i = *pfwlen; i < roundup(*pfwlen, 4); i++)
> +   for (i = pfwlen; i < roundup(pfwlen, 4); i++)
> pfwbuf[i] = 0;

memset() ?

>
> -   *pfwlen = i;
> +   return i;
>  }
>
>  static void _rtl88e_fw_page_write(struct adapter *adapt,
> @@ -103,7 +103,7 @@ static void _rtl88e_write_fw(struct adapter *adapt, u8 
> *buffer, u32 size)
> u32 page_no, remain;
> u32 page, offset;
>
> -   _rtl88e_fill_dummy(buf_ptr, &size);
> +   size = _rtl88e_fill_dummy(buf_ptr, size);
>
> page_no = size / FW_8192C_PAGE_SIZE;
> remain = size % FW_8192C_PAGE_SIZE;
> --
> 2.4.10
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: sm750fb: fix style for if clause

2015-11-08 Thread Othmar Pasteka
Fix for checkpatch.pl complaints:
ERROR: that open brace { should be on the previous line
CHECK: spaces preferred around that '+' (ctx:VxV)

Signed-off-by: Othmar Pasteka 
---
 drivers/staging/sm750fb/sm750_cursor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750_cursor.c 
b/drivers/staging/sm750fb/sm750_cursor.c
index 3b7ce92..0a41585 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -143,8 +143,7 @@ void hw_cursor_setData(struct lynx_cursor *cursor,
iowrite16(data, pbuffer);
 
/* assume pitch is 1,2,4,8,...*/
-   if ((i+1) % pitch == 0)
-   {
+   if ((i + 1) % pitch == 0) {
/* need a return */
pstart += offset;
pbuffer = pstart;
-- 
2.5.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function

2015-11-08 Thread Ivan Safonov

On 11/08/2015 05:11 PM, Andy Shevchenko wrote:

On Sun, Nov 8, 2015 at 8:37 AM, Ivan Safonov  wrote:

Ideally the function should not change the variables outside of its body.

Signed-off-by: Ivan Safonov 
---
  drivers/staging/rtl8188eu/hal/fw.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/fw.c 
b/drivers/staging/rtl8188eu/hal/fw.c
index 4d72537..5b569ef 100644
--- a/drivers/staging/rtl8188eu/hal/fw.c
+++ b/drivers/staging/rtl8188eu/hal/fw.c
@@ -75,14 +75,14 @@ static void _rtl88e_fw_block_write(struct adapter *adapt,
 usb_write8(adapt, write_address, byte_buffer[i]);
  }

-static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen)
+static u32 _rtl88e_fill_dummy(u8 *pfwbuf, u32 pfwlen)
  {
 u32 i;

-   for (i = *pfwlen; i < roundup(*pfwlen, 4); i++)
+   for (i = pfwlen; i < roundup(pfwlen, 4); i++)
 pfwbuf[i] = 0;

memset() ?


-   *pfwlen = i;
+   return i;
  }

  static void _rtl88e_fw_page_write(struct adapter *adapt,
@@ -103,7 +103,7 @@ static void _rtl88e_write_fw(struct adapter *adapt, u8 
*buffer, u32 size)
 u32 page_no, remain;
 u32 page, offset;

-   _rtl88e_fill_dummy(buf_ptr, &size);
+   size = _rtl88e_fill_dummy(buf_ptr, size);

 page_no = size / FW_8192C_PAGE_SIZE;
 remain = size % FW_8192C_PAGE_SIZE;
--
2.4.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


memset applied in another patch. Here only replacement of the function type.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: wilc1000: Fix build break due to undeclared *wilc and implicit declaration of init_irq

2015-11-08 Thread punit vara
On Sun, Nov 8, 2015 at 2:21 AM, Dan Carpenter  wrote:
> I haven't looked at it, sorry.  You'll have to figure it out or if you
> complain to the original person who broken the build he can figure it
> out.  You are still missing a Fixes tag.
>
> regards,
> dan carpenter
Here I will remove struct wilc *wilc;
and add
#if (defined WILC_SPI) || (!defined WILC_SDIO)

I have used git tag -l in my git tree and found v4.3-rc7 ..That is the
tag I have to include in this patch description right ?
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/4] staging: comedi: use kmalloc_array instead of kmalloc

2015-11-08 Thread Geliang Tang
Use kmalloc_array instead of kmalloc to allocate memory for an array.

Signed-off-by: Geliang Tang 
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 8 
 drivers/staging/comedi/drivers/ni_670x.c  | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c 
b/drivers/staging/comedi/drivers/amplc_pci224.c
index b2f7679..d39f02d 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1022,14 +1022,14 @@ pci224_auto_attach(struct comedi_device *dev, unsigned 
long context_model)
irq = pci_dev->irq;
 
/* Allocate buffer to hold values for AO channel scan. */
-   devpriv->ao_scan_vals = kmalloc(sizeof(devpriv->ao_scan_vals[0]) *
-   board->ao_chans, GFP_KERNEL);
+   devpriv->ao_scan_vals = kmalloc_array(board->ao_chans,
+   sizeof(devpriv->ao_scan_vals[0]), GFP_KERNEL);
if (!devpriv->ao_scan_vals)
return -ENOMEM;
 
/* Allocate buffer to hold AO channel scan order. */
-   devpriv->ao_scan_order = kmalloc(sizeof(devpriv->ao_scan_order[0]) *
-board->ao_chans, GFP_KERNEL);
+   devpriv->ao_scan_order = kmalloc_array(board->ao_chans,
+   sizeof(devpriv->ao_scan_order[0]), GFP_KERNEL);
if (!devpriv->ao_scan_order)
return -ENOMEM;
 
diff --git a/drivers/staging/comedi/drivers/ni_670x.c 
b/drivers/staging/comedi/drivers/ni_670x.c
index f4c580f..3e7271880 100644
--- a/drivers/staging/comedi/drivers/ni_670x.c
+++ b/drivers/staging/comedi/drivers/ni_670x.c
@@ -214,8 +214,9 @@ static int ni_670x_auto_attach(struct comedi_device *dev,
if (s->n_chan == 32) {
const struct comedi_lrange **range_table_list;
 
-   range_table_list = kmalloc(sizeof(struct comedi_lrange *) * 32,
-  GFP_KERNEL);
+   range_table_list = kmalloc_array(32,
+sizeof(struct comedi_lrange *),
+GFP_KERNEL);
if (!range_table_list)
return -ENOMEM;
s->range_table_list = range_table_list;
-- 
2.5.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/4] staging: rdma: use kmalloc_array instead of kmalloc

2015-11-08 Thread Geliang Tang
Use kmalloc_array instead of kmalloc to allocate memory for an array.

Signed-off-by: Geliang Tang 
---
 drivers/staging/rdma/amso1100/c2.c  | 6 --
 drivers/staging/rdma/ipath/ipath_file_ops.c | 8 
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rdma/amso1100/c2.c 
b/drivers/staging/rdma/amso1100/c2.c
index 35ac536..4e6d24a 100644
--- a/drivers/staging/rdma/amso1100/c2.c
+++ b/drivers/staging/rdma/amso1100/c2.c
@@ -116,7 +116,8 @@ static int c2_tx_ring_alloc(struct c2_ring *tx_ring, void 
*vaddr,
struct c2_element *elem;
int i;
 
-   tx_ring->start = kmalloc(sizeof(*elem) * tx_ring->count, GFP_KERNEL);
+   tx_ring->start = kmalloc_array(tx_ring->count, sizeof(*elem),
+  GFP_KERNEL);
if (!tx_ring->start)
return -ENOMEM;
 
@@ -165,7 +166,8 @@ static int c2_rx_ring_alloc(struct c2_ring *rx_ring, void 
*vaddr,
struct c2_element *elem;
int i;
 
-   rx_ring->start = kmalloc(sizeof(*elem) * rx_ring->count, GFP_KERNEL);
+   rx_ring->start = kmalloc_array(rx_ring->count, sizeof(*elem),
+  GFP_KERNEL);
if (!rx_ring->start)
return -ENOMEM;
 
diff --git a/drivers/staging/rdma/ipath/ipath_file_ops.c 
b/drivers/staging/rdma/ipath/ipath_file_ops.c
index 13c3cd1..6187b84 100644
--- a/drivers/staging/rdma/ipath/ipath_file_ops.c
+++ b/drivers/staging/rdma/ipath/ipath_file_ops.c
@@ -917,15 +917,15 @@ static int ipath_create_user_egr(struct ipath_portdata 
*pd)
chunk = pd->port_rcvegrbuf_chunks;
egrperchunk = pd->port_rcvegrbufs_perchunk;
size = pd->port_rcvegrbuf_size;
-   pd->port_rcvegrbuf = kmalloc(chunk * sizeof(pd->port_rcvegrbuf[0]),
-GFP_KERNEL);
+   pd->port_rcvegrbuf = kmalloc_array(chunk, sizeof(pd->port_rcvegrbuf[0]),
+  GFP_KERNEL);
if (!pd->port_rcvegrbuf) {
ret = -ENOMEM;
goto bail;
}
pd->port_rcvegrbuf_phys =
-   kmalloc(chunk * sizeof(pd->port_rcvegrbuf_phys[0]),
-   GFP_KERNEL);
+   kmalloc_array(chunk, sizeof(pd->port_rcvegrbuf_phys[0]),
+ GFP_KERNEL);
if (!pd->port_rcvegrbuf_phys) {
ret = -ENOMEM;
goto bail_rcvegrbuf;
-- 
2.5.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/4] staging: lustre: libcfs: use kmalloc_array instead of kmalloc

2015-11-08 Thread Geliang Tang
Use kmalloc_array instead of kmalloc to allocate memory for an array.

Signed-off-by: Geliang Tang 
---
 drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index 64a136c..3d3713b 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -60,9 +60,8 @@ int cfs_tracefile_init_arch(void)
/* initialize trace_data */
memset(cfs_trace_data, 0, sizeof(cfs_trace_data));
for (i = 0; i < CFS_TCD_TYPE_MAX; i++) {
-   cfs_trace_data[i] =
-   kmalloc(sizeof(union cfs_trace_data_union) *
-   num_possible_cpus(), GFP_KERNEL);
+   cfs_trace_data[i] = kmalloc_array(num_possible_cpus(),
+   sizeof(union cfs_trace_data_union), GFP_KERNEL);
if (cfs_trace_data[i] == NULL)
goto out;
 
-- 
2.5.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] staging: rtl8192u: r8192U_core: use kmalloc_array instead of kmalloc

2015-11-08 Thread Geliang Tang
Use kmalloc_array instead of kmalloc to allocate memory for an array.

Signed-off-by: Geliang Tang 
---
 drivers/staging/rtl8192u/r8192U_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index e06864f..07a1447 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -1725,8 +1725,8 @@ static short rtl8192_usb_initendpoints(struct net_device 
*dev)
 {
struct r8192_priv *priv = ieee80211_priv(dev);
 
-   priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB + 1),
-  GFP_KERNEL);
+   priv->rx_urb = kmalloc_array(MAX_RX_URB + 1, sizeof(struct urb *),
+GFP_KERNEL);
if (priv->rx_urb == NULL)
return -ENOMEM;
 
-- 
2.5.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: wilc1000: Fix build break due to undeclared *wilc and implicit declaration of init_irq

2015-11-08 Thread punit vara
On Sun, Nov 8, 2015 at 2:21 AM, Dan Carpenter  wrote:
> I haven't looked at it, sorry.  You'll have to figure it out or if you
> complain to the original person who broken the build he can figure it
> out.  You are still missing a Fixes tag.
>
> regards,
> dan carpenter
Actually while building one of my another patch I have found this
broken. Now I understand what tag is . Would you tell me how can I
find that particular commit which create defeat in this file ? Sorry
first time I have encounter this kind of problem so I do not know how
to figure it out.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: enum lu_object_header_flags comma style fix

2015-11-08 Thread James Simmons
From: Fan Yong 

Cleanup the a style issues for the lu_object_header_flags
enum by adding a comma for the last field. This is
broken out of patch http://review.whamcloud.com/6321.

Signed-off-by: Fan Yong 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321
Reviewed-by: Alex Zhuravlev 
Reviewed-by: Andreas Dilger 
---
 drivers/staging/lustre/lustre/include/lu_object.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h 
b/drivers/staging/lustre/lustre/include/lu_object.h
index fa78689..c5a56a8 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -488,7 +488,7 @@ enum lu_object_header_flags {
/**
 * Mark this object has already been taken out of cache.
 */
-   LU_OBJECT_UNHASHED = 1
+   LU_OBJECT_UNHASHED = 1,
 };
 
 enum lu_object_header_attr {
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: Handle nodemask on UMP machines

2015-11-08 Thread James Simmons
For UMP and SMP machines the struct cfs_cpt_table are
defined differently. In the case handled by this patch
nodemask is defined as a integer for the UMP case and
as a pointer for the SMP case. This will cause a problem
for ost_setup which reads the nodemask directly. Instead
we create a UMP version of cfs_cpt_nodemask and use that
in ost_setup.

Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
Reviewed-on: http://review.whamcloud.com/9219
Reviewed-by: Liang Zhen 
Reviewed-by: Li Xi 
Reviewed-by: Andreas Dilger 

Starting in 3.14 kernels nodemask_t was changed from a
a unsigned long to a linux bitmap so more than 32 cores
could be supported. Using set_bit in cfs_cpt_table_alloc
no longer compiles so this patch backports bits of the
node management function that use a linux bitmap back
end. Cleaned up libcfs bitmap.h to use the libcfs layers
memory allocation function. This was pulling in lustre
related code that was not defined.

Signed-off-by: James Simmons 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993
Reviewed-on: http://review.whamcloud.com/10332
Reviewed-by: Liang Zhen 
Reviewed-by: Bob Glossman 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c 
b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
index 933525c..ba97c79 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
@@ -58,6 +58,7 @@ cfs_cpt_table_alloc(unsigned int ncpt)
LIBCFS_ALLOC(cptab, sizeof(*cptab));
if (cptab != NULL) {
cptab->ctb_version = CFS_CPU_VERSION_MAGIC;
+   node_set(0, cptab->ctb_nodemask);
cptab->ctb_nparts  = ncpt;
}
 
@@ -111,6 +112,13 @@ cfs_cpt_online(struct cfs_cpt_table *cptab, int cpt)
 }
 EXPORT_SYMBOL(cfs_cpt_online);
 
+nodemask_t *
+cfs_cpt_nodemask(struct cfs_cpt_table *cptab, int cpt)
+{
+   return &cptab->ctb_nodemask;
+}
+EXPORT_SYMBOL(cfs_cpt_cpumask);
+
 int
 cfs_cpt_set_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu)
 {
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: added debugging ability for LFSCK

2015-11-08 Thread James Simmons
From: Fan Yong 

Add the ability to debug LFSCK to libcfs. This is
broken out of patch http://review.whamcloud.com/6321.

Signed-off-by: Fan Yong 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321
Reviewed-by: Alex Zhuravlev 
Reviewed-by: Andreas Dilger 
---
 .../lustre/include/linux/libcfs/libcfs_debug.h |2 +-
 drivers/staging/lustre/lustre/libcfs/debug.c   |2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index a1787bb..98430e7 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -106,7 +106,7 @@ struct ptldebug_header {
 #define S_LOV  0x0002
 #define S_LQUOTA   0x0004
 #define S_OSD  0x0008
-/* unused */
+#define S_LFSCK0x0010
 /* unused */
 /* unused */
 #define S_LMV  0x0080 /* b_new_cmd */
diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c 
b/drivers/staging/lustre/lustre/libcfs/debug.c
index e56785a..3c914bf 100644
--- a/drivers/staging/lustre/lustre/libcfs/debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/debug.c
@@ -271,6 +271,8 @@ libcfs_debug_subsys2str(int subsys)
return "lquota";
case S_OSD:
return "osd";
+   case S_LFSCK:
+   return "lfsck";
case S_LMV:
return "lmv";
case S_SEC:
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: add sparse locking annotations

2015-11-08 Thread James Simmons
From: frank zago 

Adds __acquires / __releases / __must_hold sparse locking annotations to
several functions.

Fixes sparse warnings such as:

libcfs/libcfs/hash.c:127:1: warning: context imbalance in 'cfs_hash_spin_lock'
- wrong count at exit
libcfs/libcfs/hash.c:133:1: warning: context imbalance in 'cfs_hash_spin_unlock'
- unexpected unlock
libcfs/libcfs/hash.c:141:9: warning: context imbalance in 'cfs_hash_rw_lock'
- wrong count at exit
include/linux/rwlock_api_smp.h:221:9: warning: context imbalance in
'cfs_hash_rw_unlock' - unexpected unlock

Signed-off-by: frank zago 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11295
Reviewed-by: John L. Hammond 
Reviewed-by: Patrick Farrell 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |3 +--
 .../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c |1 +
 drivers/staging/lustre/lustre/libcfs/libcfs_lock.c |2 ++
 drivers/staging/lustre/lustre/osc/osc_cache.c  |3 +++
 drivers/staging/lustre/lustre/ptlrpc/client.c  |1 +
 5 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 8989e36..f43e825 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -750,8 +750,7 @@ kiblnd_setup_rd_kiov(lnet_ni_t *ni, kib_tx_t *tx, 
kib_rdma_desc_t *rd,
 
 static int
 kiblnd_post_tx_locked(kib_conn_t *conn, kib_tx_t *tx, int credit)
-   __releases(conn->ibc_lock)
-   __acquires(conn->ibc_lock)
+   __must_hold(&conn->ibc_lock)
 {
kib_msg_t *msg = tx->tx_msg;
kib_peer_t *peer = conn->ibc_peer;
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c 
b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 477b385..a0955d2 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -2336,6 +2336,7 @@ ksocknal_flush_stale_txs(ksock_peer_t *peer)
 
 static int
 ksocknal_send_keepalive_locked(ksock_peer_t *peer)
+   __must_hold(&ksocknal_data.ksnd_global_lock)
 {
ksock_sched_t *sched;
ksock_conn_t *conn;
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c 
b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
index 94bc007..d37e457 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
@@ -90,6 +90,7 @@ EXPORT_SYMBOL(cfs_percpt_lock_alloc);
  */
 void
 cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index)
+   __acquires(pcl->pcl_locks)
 {
int ncpt = cfs_cpt_number(pcl->pcl_cptab);
int i;
@@ -124,6 +125,7 @@ EXPORT_SYMBOL(cfs_percpt_lock);
 /** unlock a CPU partition */
 void
 cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index)
+   __releases(pcl->pcl_locks)
 {
int ncpt = cfs_cpt_number(pcl->pcl_cptab);
int i;
diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
b/drivers/staging/lustre/lustre/osc/osc_cache.c
index cfb83bc..fb1a60f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1938,6 +1938,7 @@ static int get_write_extents(struct osc_object *obj, 
struct list_head *rpclist)
 static int
 osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
   struct osc_object *osc)
+   __must_hold(osc)
 {
LIST_HEAD(rpclist);
struct osc_extent *ext;
@@ -2010,6 +2011,7 @@ osc_send_write_rpc(const struct lu_env *env, struct 
client_obd *cli,
 static int
 osc_send_read_rpc(const struct lu_env *env, struct client_obd *cli,
  struct osc_object *osc)
+   __must_hold(osc)
 {
struct osc_extent *ext;
struct osc_extent *next;
@@ -2083,6 +2085,7 @@ static struct osc_object *osc_next_obj(struct client_obd 
*cli)
 
 /* called with the loi list lock held */
 static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli)
+   __must_hold(&cli->cl_loi_list_lock)
 {
struct osc_object *osc;
int rc = 0;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
b/drivers/staging/lustre/lustre/ptlrpc/client.c
index a9f1bf5..b6691cc 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -353,6 +353,7 @@ static int unpack_reply(struct ptlrpc_request *req)
  * If anything goes wrong just ignore it - same as if it never happened
  */
 static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
+   __must_hold(&req->rq_lock)
 {
struct ptlrpc_request *early_req;
time64_t olddl;
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driver

[PATCH] staging: lustre: add libcfs version of cfs_strrstr

2015-11-08 Thread James Simmons
From: Fan Yong 

Create a kernel side function that does the same
thing as userland strrstr. This is from patch
http://review.whamcloud.com/7666.

Signed-off-by: Fan Yong 
ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-3951
Reviewed-on: http://review.whamcloud.com/7666
Reviewed-by: Andreas Dilger 
Reviewed-by: Alex Zhuravlev 
Reviewed-by: Oleg Drokin 
---
 .../lustre/include/linux/libcfs/libcfs_string.h|1 +
 .../staging/lustre/lustre/libcfs/libcfs_string.c   |   27 
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
index d8d2e7d..052f684 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
@@ -44,6 +44,7 @@
 #define __LIBCFS_STRING_H__
 
 /* libcfs_string.c */
+char *cfs_strrstr(const char *haystack, const char *needle);
 /* string comparison ignoring case */
 int cfs_strncasecmp(const char *s1, const char *s2, size_t n);
 /* Convert a text string to a bitmask */
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c 
b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index 05630f8..4e399ef 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -42,6 +42,33 @@
 
 #include "../../include/linux/libcfs/libcfs.h"
 
+char *cfs_strrstr(const char *haystack, const char *needle)
+{
+   char *ptr;
+
+   if (unlikely(!haystack || !needle))
+   return NULL;
+
+   if (strlen(needle) == 1)
+   return strrchr(haystack, needle[0]);
+
+   ptr = strstr(haystack, needle);
+   if (ptr) {
+   while (1) {
+   char *tmp;
+
+   tmp = strstr(&ptr[1], needle);
+   if (!tmp)
+   return ptr;
+
+   ptr = tmp;
+   }
+   }
+
+   return NULL;
+}
+EXPORT_SYMBOL(cfs_strrstr);
+
 /* Convert a text string to a bitmask */
 int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
 int *oldmask, int minmask, int allmask)
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl

2015-11-08 Thread James Simmons
The ioctl IOC_LIBCFS_PING_TEST has not been used in
ages. The recent nidstring changes which moved all
the nidstring operations from libcfs to the LNet
layer but this ioctl code was still using an
nidstring operation that was causing an circular
dependency loop between libcfs and LNet.

Signed-off-by: James Simmons 
---
 .../lustre/include/linux/libcfs/libcfs_ioctl.h |1 -
 drivers/staging/lustre/lustre/libcfs/module.c  |   17 -
 2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index f5d741f..485ab26 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -110,7 +110,6 @@ struct libcfs_ioctl_handler {
 #define IOC_LIBCFS_CLEAR_DEBUG  _IOWR('e', 31, long)
 #define IOC_LIBCFS_MARK_DEBUG_IOWR('e', 32, long)
 #define IOC_LIBCFS_MEMHOG_IOWR('e', 36, long)
-#define IOC_LIBCFS_PING_TEST  _IOWR('e', 37, long)
 /* lnet ioctls */
 #define IOC_LIBCFS_GET_NI_IOWR('e', 50, long)
 #define IOC_LIBCFS_FAIL_NID_IOWR('e', 51, long)
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 570f05c..89038ed 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -274,23 +274,6 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, 
unsigned long cmd,
}
break;
 
-   case IOC_LIBCFS_PING_TEST: {
-   extern void (kping_client)(struct libcfs_ioctl_data *);
-   void (*ping)(struct libcfs_ioctl_data *);
-
-   CDEBUG(D_IOCTL, "doing %d pings to nid %s (%s)\n",
-  data->ioc_count, libcfs_nid2str(data->ioc_nid),
-  libcfs_nid2str(data->ioc_nid));
-   ping = symbol_get(kping_client);
-   if (!ping)
-   CERROR("symbol_get failed\n");
-   else {
-   ping(data);
-   symbol_put(kping_client);
-   }
-   return 0;
-   }
-
default: {
struct libcfs_ioctl_handler *hand;
 
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: export cfs_str2mask

2015-11-08 Thread James Simmons
We need cfs_str2mask exported for our server code.
Even with the server code not available upstream
it would be nice to use the upstream code on Lustre
servers.

Signed-off-by: James Simmons 
---
 .../staging/lustre/lustre/libcfs/libcfs_string.c   |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c 
b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index d40be53..05630f8 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -111,6 +111,7 @@ int cfs_str2mask(const char *str, const char 
*(*bit2str)(int bit),
*oldmask = newmask;
return 0;
 }
+EXPORT_SYMBOL(cfs_str2mask);
 
 /* get the first string out of @str */
 char *cfs_firststr(char *str, size_t size)
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: mdc_request: Remove mdc_kuc_reregister wrapper

2015-11-08 Thread Shivani Bhardwaj
Remove the wrapper function mdc_kuc_reregister() and replace its call
with the function it wrapped. Also, comment has been added for clarity.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c 
b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index 294c050..e172be1 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -2037,17 +2037,6 @@ static int mdc_hsm_ct_reregister(__u32 data, void 
*cb_arg)
return ((rc != 0) && (rc != -EEXIST)) ? rc : 0;
 }
 
-/**
- * Re-establish all kuc contexts with MDT
- * after MDT shutdown/recovery.
- */
-static int mdc_kuc_reregister(struct obd_import *imp)
-{
-   /* re-register HSM agents */
-   return libcfs_kkuc_group_foreach(KUC_GRP_HSM, mdc_hsm_ct_reregister,
-(void *)imp);
-}
-
 static int mdc_set_info_async(const struct lu_env *env,
  struct obd_export *exp,
  u32 keylen, void *key,
@@ -2210,7 +2199,10 @@ static int mdc_import_event(struct obd_device *obd, 
struct obd_import *imp,
rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVE, NULL);
/* redo the kuc registration after reconnecting */
if (rc == 0)
-   rc = mdc_kuc_reregister(imp);
+   /* re-register HSM agents */
+   rc = libcfs_kkuc_group_foreach(KUC_GRP_HSM,
+  mdc_hsm_ct_reregister,
+  (void *)imp);
break;
case IMP_EVENT_OCD:
rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD, NULL);
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show

2015-11-08 Thread Shivani Bhardwaj
Remove the function mgc_ir_state_seq_show() as it is not
referenced/called anywhere.

Signed-off-by: Shivani Bhardwaj 
---
 drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c 
b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
index 8d5bc5a..ad6a7d9 100644
--- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
+++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
@@ -48,11 +48,6 @@ LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
 
 LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
 
-static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
-{
-   return lprocfs_mgc_rd_ir_state(m, m->private);
-}
-
 LPROC_SEQ_FOPS_RO(mgc_ir_state);
 
 static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] drivers: staging: android: ion: Added a blank line

2015-11-08 Thread Greg KH
On Sun, Nov 08, 2015 at 01:25:09PM +0530, Anjali Menon wrote:
> Added a blank line after declaration to fix the coding style
> error detected by checkpatch.pl
> 
> WARNING: Missing a blank line after declarations
> 
> Signed-off-by: Anjali Menon 
> ---
>  drivers/staging/android/ion/ion.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/android/ion/ion.c 
> b/drivers/staging/android/ion/ion.c
> index b0b96ab..c3c35d7 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -1106,8 +1106,8 @@ struct dma_buf *ion_share_dma_buf(struct ion_client 
> *client,
>   struct ion_buffer *buffer;
>   struct dma_buf *dmabuf;
>   bool valid_handle;
> - DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
>  
> + DEFINE_DMA_BUF_EXPORT_INFO(exp_info);

Look at the patch, does it look correct?

Don't always trust checkpatch.pl, sometimes it tells you things that
should not be done...

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show

2015-11-08 Thread Shivani Bhardwaj
On Sun, Nov 8, 2015 at 10:33 PM, Shivani Bhardwaj  wrote:
> Remove the function mgc_ir_state_seq_show() as it is not
> referenced/called anywhere.
>
> Signed-off-by: Shivani Bhardwaj 
> ---
>  drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 5 -
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c 
> b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> index 8d5bc5a..ad6a7d9 100644
> --- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> +++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c
> @@ -48,11 +48,6 @@ LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
>
>  LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
>
> -static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
> -{
> -   return lprocfs_mgc_rd_ir_state(m, m->private);
> -}
> -
>  LPROC_SEQ_FOPS_RO(mgc_ir_state);
>
>  static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
> --
> 2.1.0
>

I just found out that this is producing errors. Please do not consider this.
Thank you
Shivani
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 01/12] staging: rtl8188eu: if/else replaced by min_t

2015-11-08 Thread Greg Kroah-Hartman
On Sun, Nov 08, 2015 at 02:07:11PM +0700, Ivan Safonov wrote:
> Duplicated code removed.
> 
> Signed-off-by: Ivan Safonov 
> ---
>  drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)

You sent 3 versions of this patch, is this series the "real" one?  When
you resend, you need to say why you resent things, below the --- line
put the difference between v1 and v2 there so that we know what changed.

So I'm going to assume that the v2 series is the one you want to have
applied, if this isn't correct, please let me know.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show

2015-11-08 Thread kbuild test robot
Hi Shivani,

[auto build test ERROR on: staging/staging-testing]
[also build test ERROR on: next-20151106]
[cannot apply to: v4.3]

url:
https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-lproc_mgc-Remove-unused-function-mgc_ir_state_seq_show/20151109-010718
config: x86_64-allyesconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   In file included from 
drivers/staging/lustre/lustre/mgc/../include/obd_support.h:43:0,
from 
drivers/staging/lustre/lustre/mgc/../include/obd_class.h:39,
from drivers/staging/lustre/lustre/mgc/lproc_mgc.c:39:
   drivers/staging/lustre/lustre/mgc/lproc_mgc.c: In function 
'mgc_ir_state_single_open':
>> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:19: error: 
>> 'mgc_ir_state_seq_show' undeclared (first use in this function)
LPROC_SEQ_FOPS_RO(mgc_ir_state);
  ^
   drivers/staging/lustre/lustre/mgc/../include/lprocfs_status.h:634:27: note: 
in definition of macro '__LPROC_SEQ_FOPS'
 return single_open(file, name##_seq_show, inode->i_private); \
  ^
>> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:1: note: in expansion of 
>> macro 'LPROC_SEQ_FOPS_RO'
LPROC_SEQ_FOPS_RO(mgc_ir_state);
^
   drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:19: note: each undeclared 
identifier is reported only once for each function it appears in
LPROC_SEQ_FOPS_RO(mgc_ir_state);
  ^
   drivers/staging/lustre/lustre/mgc/../include/lprocfs_status.h:634:27: note: 
in definition of macro '__LPROC_SEQ_FOPS'
 return single_open(file, name##_seq_show, inode->i_private); \
  ^
>> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:1: note: in expansion of 
>> macro 'LPROC_SEQ_FOPS_RO'
LPROC_SEQ_FOPS_RO(mgc_ir_state);
^
>> drivers/staging/lustre/lustre/mgc/../include/lprocfs_status.h:632:59: 
>> warning: control reaches end of non-void function [-Wreturn-type]
static int name##_single_open(struct inode *inode, struct file *file) \
  ^
>> drivers/staging/lustre/lustre/mgc/../include/lprocfs_status.h:645:34: note: 
>> in expansion of macro '__LPROC_SEQ_FOPS'
#define LPROC_SEQ_FOPS_RO(name)  __LPROC_SEQ_FOPS(name, NULL)
 ^
>> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:1: note: in expansion of 
>> macro 'LPROC_SEQ_FOPS_RO'
LPROC_SEQ_FOPS_RO(mgc_ir_state);
^

vim +/mgc_ir_state_seq_show +51 drivers/staging/lustre/lustre/mgc/lproc_mgc.c

d7e09d039 Peng Tao   2013-05-02  33   * This file is part of Lustre, 
http://www.lustre.org/
d7e09d039 Peng Tao   2013-05-02  34   * Lustre is a trademark of Sun 
Microsystems, Inc.
d7e09d039 Peng Tao   2013-05-02  35   */
d7e09d039 Peng Tao   2013-05-02  36  #define DEBUG_SUBSYSTEM S_CLASS
d7e09d039 Peng Tao   2013-05-02  37  
d7e09d039 Peng Tao   2013-05-02  38  #include 
73060ed93 Greg Kroah-Hartman 2014-07-11 @39  #include "../include/obd_class.h"
73060ed93 Greg Kroah-Hartman 2014-07-11  40  #include 
"../include/lprocfs_status.h"
d7e09d039 Peng Tao   2013-05-02  41  #include "mgc_internal.h"
d7e09d039 Peng Tao   2013-05-02  42  
73bb1da69 Peng Tao   2013-05-29  43  LPROC_SEQ_FOPS_RO_TYPE(mgc, 
connect_flags);
73bb1da69 Peng Tao   2013-05-29  44  LPROC_SEQ_FOPS_RO_TYPE(mgc, 
server_uuid);
73bb1da69 Peng Tao   2013-05-29  45  LPROC_SEQ_FOPS_RO_TYPE(mgc, 
conn_uuid);
73bb1da69 Peng Tao   2013-05-29  46  LPROC_SEQ_FOPS_RO_TYPE(mgc, 
import);
73bb1da69 Peng Tao   2013-05-29  47  LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
73bb1da69 Peng Tao   2013-05-29  48  
73bb1da69 Peng Tao   2013-05-29  49  LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
73bb1da69 Peng Tao   2013-05-29  50  
73bb1da69 Peng Tao   2013-05-29 @51  LPROC_SEQ_FOPS_RO(mgc_ir_state);
73bb1da69 Peng Tao   2013-05-29  52  
d7e09d039 Peng Tao   2013-05-02  53  static struct lprocfs_vars 
lprocfs_mgc_obd_vars[] = {
35b8dfd41 Greg DeAngelis 2014-05-23  54 { "ping",
&mgc_ping_fops,  NULL, 0222 },

:: The code at line 51 was first introduced by commit
:: 73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6 staging/lustre: adapt 
proc_dir_entry change

:: TO: Peng Tao 
:: CC: Greg Kroah-Hartman 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show

2015-11-08 Thread kbuild test robot
Hi Shivani,

[auto build test WARNING on: staging/staging-testing]
[also build test WARNING on: next-20151106]
[cannot apply to: v4.3]

url:
https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-lproc_mgc-Remove-unused-function-mgc_ir_state_seq_show/20151109-010718
config: i386-allyesconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/staging/lustre/lustre/mgc/lproc_mgc.c: In function 
'mgc_ir_state_single_open':
   drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:104: error: 
'mgc_ir_state_seq_show' undeclared (first use in this function)
   drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:104: note: each undeclared 
identifier is reported only once for each function it appears in
>> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:65: warning: control 
>> reaches end of non-void function [-Wreturn-type]

vim +51 drivers/staging/lustre/lustre/mgc/lproc_mgc.c

d7e09d039 Peng Tao   2013-05-02  35   */
d7e09d039 Peng Tao   2013-05-02  36  #define DEBUG_SUBSYSTEM S_CLASS
d7e09d039 Peng Tao   2013-05-02  37  
d7e09d039 Peng Tao   2013-05-02  38  #include 
73060ed93 Greg Kroah-Hartman 2014-07-11  39  #include "../include/obd_class.h"
73060ed93 Greg Kroah-Hartman 2014-07-11  40  #include 
"../include/lprocfs_status.h"
d7e09d039 Peng Tao   2013-05-02  41  #include "mgc_internal.h"
d7e09d039 Peng Tao   2013-05-02  42  
73bb1da69 Peng Tao   2013-05-29  43  LPROC_SEQ_FOPS_RO_TYPE(mgc, 
connect_flags);
73bb1da69 Peng Tao   2013-05-29  44  LPROC_SEQ_FOPS_RO_TYPE(mgc, 
server_uuid);
73bb1da69 Peng Tao   2013-05-29  45  LPROC_SEQ_FOPS_RO_TYPE(mgc, 
conn_uuid);
73bb1da69 Peng Tao   2013-05-29  46  LPROC_SEQ_FOPS_RO_TYPE(mgc, 
import);
73bb1da69 Peng Tao   2013-05-29  47  LPROC_SEQ_FOPS_RO_TYPE(mgc, state);
73bb1da69 Peng Tao   2013-05-29  48  
73bb1da69 Peng Tao   2013-05-29  49  LPROC_SEQ_FOPS_WR_ONLY(mgc, ping);
73bb1da69 Peng Tao   2013-05-29  50  
73bb1da69 Peng Tao   2013-05-29 @51  LPROC_SEQ_FOPS_RO(mgc_ir_state);
73bb1da69 Peng Tao   2013-05-29  52  
d7e09d039 Peng Tao   2013-05-02  53  static struct lprocfs_vars 
lprocfs_mgc_obd_vars[] = {
35b8dfd41 Greg DeAngelis 2014-05-23  54 { "ping",
&mgc_ping_fops,  NULL, 0222 },
35b8dfd41 Greg DeAngelis 2014-05-23  55 { "connect_flags",   
&mgc_connect_flags_fops, NULL, 0 },
35b8dfd41 Greg DeAngelis 2014-05-23  56 { "mgs_server_uuid", 
&mgc_server_uuid_fops,   NULL, 0 },
35b8dfd41 Greg DeAngelis 2014-05-23  57 { "mgs_conn_uuid",   
&mgc_conn_uuid_fops, NULL, 0 },
35b8dfd41 Greg DeAngelis 2014-05-23  58 { "import",  
&mgc_import_fops,  NULL, 0 },
35b8dfd41 Greg DeAngelis 2014-05-23  59 { "state",   
&mgc_state_fops,NULL, 0 },

:: The code at line 51 was first introduced by commit
:: 73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6 staging/lustre: adapt 
proc_dir_entry change

:: TO: Peng Tao 
:: CC: Greg Kroah-Hartman 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/13] staging: lustre: remove hsm_nl proc file

2015-11-08 Thread James Simmons
From: John L. Hammond 

Remove the file /proc/fs/lustre/mdc/*/hsm_nl which was introduced "for
testing purposes."

Signed-off-by: John L. Hammond 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2489
Reviewed-on: http://review.whamcloud.com/6656
Reviewed-by: jacques-Charles Lafoucriere 
Reviewed-by: Aurelien Degremont 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c |   77 -
 1 files changed, 0 insertions(+), 77 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c 
b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index 1c95f87..84e5862 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -82,82 +82,6 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj,
 }
 LUSTRE_RW_ATTR(max_rpcs_in_flight);
 
-static int mdc_kuc_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, NULL, inode->i_private);
-}
-
-/* temporary for testing */
-static ssize_t mdc_kuc_write(struct file *file,
-   const char __user *buffer,
-   size_t count, loff_t *off)
-{
-   struct obd_device *obd =
-   ((struct seq_file *)file->private_data)->private;
-   struct kuc_hdr  *lh;
-   struct hsm_action_list  *hal;
-   struct hsm_action_item  *hai;
-   int  len;
-   int  fd, rc;
-
-   rc = lprocfs_write_helper(buffer, count, &fd);
-   if (rc)
-   return rc;
-
-   if (fd < 0)
-   return -ERANGE;
-   CWARN("message to fd %d\n", fd);
-
-   len = sizeof(*lh) + sizeof(*hal) + MTI_NAME_MAXLEN +
-   /* for mockup below */ 2 * cfs_size_round(sizeof(*hai));
-
-   lh = kzalloc(len, GFP_NOFS);
-   if (!lh)
-   return -ENOMEM;
-
-   lh->kuc_magic = KUC_MAGIC;
-   lh->kuc_transport = KUC_TRANSPORT_HSM;
-   lh->kuc_msgtype = HMT_ACTION_LIST;
-   lh->kuc_msglen = len;
-
-   hal = (struct hsm_action_list *)(lh + 1);
-   hal->hal_version = HAL_VERSION;
-   hal->hal_archive_id = 1;
-   hal->hal_flags = 0;
-   obd_uuid2fsname(hal->hal_fsname, obd->obd_name, MTI_NAME_MAXLEN);
-
-   /* mock up an action list */
-   hal->hal_count = 2;
-   hai = hai_zero(hal);
-   hai->hai_action = HSMA_ARCHIVE;
-   hai->hai_fid.f_oid = 5;
-   hai->hai_len = sizeof(*hai);
-   hai = hai_next(hai);
-   hai->hai_action = HSMA_RESTORE;
-   hai->hai_fid.f_oid = 10;
-   hai->hai_len = sizeof(*hai);
-
-   /* This works for either broadcast or unicast to a single fd */
-   if (fd == 0) {
-   rc = libcfs_kkuc_group_put(KUC_GRP_HSM, lh);
-   } else {
-   struct file *fp = fget(fd);
-
-   rc = libcfs_kkuc_msg_put(fp, lh);
-   fput(fp);
-   }
-   kfree(lh);
-   if (rc < 0)
-   return rc;
-   return count;
-}
-
-static struct file_operations mdc_kuc_fops = {
-   .open   = mdc_kuc_open,
-   .write  = mdc_kuc_write,
-   .release= single_release,
-};
-
 LPROC_SEQ_FOPS_WR_ONLY(mdc, ping);
 
 LPROC_SEQ_FOPS_RO_TYPE(mdc, connect_flags);
@@ -196,7 +120,6 @@ static struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
{ "timeouts",   &mdc_timeouts_fops, NULL, 0 },
{ "import", &mdc_import_fops,   NULL, 0 },
{ "state",  &mdc_state_fops,NULL, 0 },
-   { "hsm_nl", &mdc_kuc_fops,  NULL, 0200 },
{ "pinger_recov",   &mdc_pinger_recov_fops, NULL, 0 },
{ NULL }
 };
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/13] bring lustre's kernel_comm code up to date

2015-11-08 Thread James Simmons
This patch series brings the kernel_comm code used by Lustre up
to the latest verison with various fixes and style improvements
which makes the code compliant with the linux kernel standard.

Henri Doreau (1):
  staging: lustre: Prevent duplicate CT registrations

Hongchao Zhang (1):
  staging: lustre: embed kr_data into kkuc_reg

James Simmons (8):
  staging: lustre: kg_sem semaphore handling is incorrectly
  staging: lustre: convert kernelcomm group to unsigned int
  staging: lustre: remove unnecessary NULL checks in kernel_comm.c
  staging: lustre: cleanup block comment style in kernel_comm code
  staging: lustre: add space around '+' in kernel_comm code
  staging: lustre: use proper braces in libcfs_kkuc_group_put
  staging: lustre: return proper error code for libcfs_kkuc_msg_put
  staging: lustre: cleanup white space in kernel comm code

John L. Hammond (1):
  staging: lustre: remove hsm_nl proc file

frank zago (2):
  staging: lustre: move kernel_user_comm.c from libcfs to lustre
  staging: lustre: split kernel comm between user and kernel

 .../staging/lustre/include/linux/libcfs/libcfs.h   |1 -
 .../staging/lustre/lustre/include/lustre_export.h  |7 ++
 .../lustre/lustre/include/lustre_kernelcomm.h  |   56 ++
 .../include/uapi_kernelcomm.h} |   72 ++
 drivers/staging/lustre/lustre/libcfs/Makefile  |5 +-
 drivers/staging/lustre/lustre/llite/dir.c  |1 +
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|   30 ++---
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c  |   77 
 drivers/staging/lustre/lustre/mdc/mdc_request.c|   21 --
 drivers/staging/lustre/lustre/obdclass/Makefile|   10 ++--
 drivers/staging/lustre/lustre/obdclass/genops.c|1 +
 .../kernel_user_comm.c => obdclass/kernelcomm.c}   |   76 ++-
 12 files changed, 171 insertions(+), 186 deletions(-)
 create mode 100644 drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
 rename drivers/staging/lustre/{include/linux/libcfs/libcfs_kernelcomm.h => 
lustre/include/uapi_kernelcomm.h} (51%)
 rename drivers/staging/lustre/lustre/{libcfs/kernel_user_comm.c => 
obdclass/kernelcomm.c} (82%)

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/13] staging: lustre: Prevent duplicate CT registrations

2015-11-08 Thread James Simmons
From: Henri Doreau 

Associate copytool registration to a given MDC import so that
multiple mounts of the same filesystem do not lead to having the
copytool registered multiple time.

Signed-off-by: Henri Doreau 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3882
Reviewed-on: http://review.whamcloud.com/7612
Reviewed-by: John L. Hammond 
Reviewed-by: Jinshan Xiong 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---
 .../include/linux/libcfs/libcfs_kernelcomm.h   |6 ++--
 .../staging/lustre/lustre/include/lustre_export.h  |7 
 .../lustre/lustre/libcfs/kernel_user_comm.c|   15 +---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|   39 +++-
 drivers/staging/lustre/lustre/mdc/mdc_request.c|   22 +++
 5 files changed, 62 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h
index 41f3d81..3a89a3b 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h
@@ -77,7 +77,7 @@ enum kuc_generic_message_type {
 };
 
 /* prototype for callback function on kuc groups */
-typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg);
+typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg);
 
 /* KUC Broadcast Groups. This determines which userspace process hears which
  * messages.  Mutliple transports may be used within a group, or multiple
@@ -92,8 +92,8 @@ typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg);
 int libcfs_kkuc_msg_put(struct file *fp, void *payload);
 int libcfs_kkuc_group_put(int group, void *payload);
 int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group,
-__u32 data);
-int libcfs_kkuc_group_rem(int uid, int group);
+ void *data);
+int libcfs_kkuc_group_rem(int uid, int group, void **pdata);
 int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
 void *cb_arg);
 
diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h 
b/drivers/staging/lustre/lustre/include/lustre_export.h
index 1daf4c5..e0a5171 100644
--- a/drivers/staging/lustre/lustre/include/lustre_export.h
+++ b/drivers/staging/lustre/lustre/include/lustre_export.h
@@ -338,6 +338,13 @@ static inline bool imp_connect_disp_stripe(struct 
obd_import *imp)
 
 struct obd_export *class_conn2export(struct lustre_handle *conn);
 
+#define KKUC_CT_DATA_MAGIC 0x092013cea
+struct kkuc_ct_data {
+   __u32   kcd_magic;
+   struct obd_uuid kcd_uuid;
+   __u32   kcd_archive;
+};
+
 /** @} export */
 
 #endif /* __EXPORT_H */
diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c 
b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
index 1a052ac..3b4731a 100644
--- a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
+++ b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
@@ -95,10 +95,10 @@ EXPORT_SYMBOL(libcfs_kkuc_msg_put);
  * group from any fs */
 /** A single group registration has a uid and a file pointer */
 struct kkuc_reg {
-   struct list_headkr_chain;
-   int kr_uid;
+   struct list_head kr_chain;
+   int  kr_uid;
struct file *kr_fp;
-   __u32   kr_data;
+   void*kr_data;
 };
 
 static struct list_head kkuc_groups[KUC_GRP_MAX+1] = {};
@@ -109,9 +109,10 @@ static DECLARE_RWSEM(kg_sem);
  * @param filp pipe to write into
  * @param uid identifier for this receiver
  * @param group group number
+ * @param data user data
  */
 int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group,
- __u32 data)
+ void *data)
 {
struct kkuc_reg *reg;
 
@@ -145,7 +146,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, 
unsigned int group,
 }
 EXPORT_SYMBOL(libcfs_kkuc_group_add);
 
-int libcfs_kkuc_group_rem(int uid, int group)
+int libcfs_kkuc_group_rem(int uid, int group, void **pdata)
 {
struct kkuc_reg *reg, *next;
 
@@ -171,6 +172,8 @@ int libcfs_kkuc_group_rem(int uid, int group)
   reg->kr_uid, reg->kr_fp, group);
if (reg->kr_fp != NULL)
fput(reg->kr_fp);
+   if (pdata)
+   *pdata = reg->kr_data;
kfree(reg);
}
}
@@ -213,7 +216,7 @@ EXPORT_SYMBOL(libcfs_kkuc_group_put);
  * Calls a callback function for each link of the given kuc group.
  * @param group the group to call the function on.
  * @param cb_func the function to be called.
- * @param cb_arg iextra argument to be passed to the callback function.
+ * @param cb_arg extra argument to be passed to the callback function.
  */
 int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb

[PATCH 02/13] staging: lustre: kg_sem semaphore handling is incorrectly

2015-11-08 Thread James Simmons
During the removal of the cfs wrappers the kg_sem semaphore
was handled incorrectly. We need to take a write lock when
writing data to the kkuc_groups. The libcfs_kkuc_group_foreach
needs to only take a read lock. This makes use match the
OpenSFS development branch.

Signed-off-by: James Simmons 
---
 .../lustre/lustre/libcfs/kernel_user_comm.c|8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c 
b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
index d8230ae..1a052ac 100644
--- a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
+++ b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
@@ -186,7 +186,7 @@ int libcfs_kkuc_group_put(int group, void *payload)
int  rc = 0;
int one_success = 0;
 
-   down_read(&kg_sem);
+   down_write(&kg_sem);
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
if (reg->kr_fp != NULL) {
rc = libcfs_kkuc_msg_put(reg->kr_fp, payload);
@@ -198,7 +198,7 @@ int libcfs_kkuc_group_put(int group, void *payload)
}
}
}
-   up_read(&kg_sem);
+   up_write(&kg_sem);
 
/* don't return an error if the message has been delivered
 * at least to one agent */
@@ -230,12 +230,12 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t 
cb_func,
if (kkuc_groups[group].next == NULL)
return 0;
 
-   down_write(&kg_sem);
+   down_read(&kg_sem);
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
if (reg->kr_fp != NULL)
rc = cb_func(reg->kr_data, cb_arg);
}
-   up_write(&kg_sem);
+   up_read(&kg_sem);
 
return rc;
 }
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/13] staging: lustre: move kernel_user_comm.c from libcfs to lustre

2015-11-08 Thread James Simmons
From: frank zago 

Move the kernel portion from libcfs to obdclass. This code is
only used by lustre. This is broken out of the original patch
14270. The part covered by this change is as follows:

The original code in kernel_user_comm.c is split into two parts:

  * obdclass/kernelcomm.c for the kernel part. filp_user_write() was
moved there, and linux-fs.c deleted;
  * liblustreapi_kernelconn.c for the user part. The calls to CDEBUG
have been removed, and calls to CERROR have been transformed to
llapi_err_noerrno. The type lustre_kernelcomm has been removed and
replace by struct lustre_kernelcomm.

Various names and filenames have been harmonized to *kernelcomm*.

Signed-off-by: frank zago 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14270
Reviewed-by: Nathan Rutman 
Reviewed-by: James Simmons 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lustre/libcfs/Makefile  |5 ++---
 drivers/staging/lustre/lustre/obdclass/Makefile|   10 +-
 .../kernel_user_comm.c => obdclass/kernelcomm.c}   |0
 3 files changed, 7 insertions(+), 8 deletions(-)
 rename drivers/staging/lustre/lustre/{libcfs/kernel_user_comm.c => 
obdclass/kernelcomm.c} (100%)

diff --git a/drivers/staging/lustre/lustre/libcfs/Makefile 
b/drivers/staging/lustre/lustre/libcfs/Makefile
index 03d3f3d..277c123 100644
--- a/drivers/staging/lustre/lustre/libcfs/Makefile
+++ b/drivers/staging/lustre/lustre/libcfs/Makefile
@@ -11,8 +11,7 @@ libcfs-linux-objs += linux-mem.o
 libcfs-linux-objs := $(addprefix linux/,$(libcfs-linux-objs))
 
 libcfs-all-objs := debug.o fail.o module.o tracefile.o \
-  libcfs_string.o hash.o kernel_user_comm.o \
-  prng.o workitem.o libcfs_cpu.o \
-  libcfs_mem.o libcfs_lock.o
+  libcfs_string.o hash.o prng.o workitem.o \
+  libcfs_cpu.o libcfs_mem.o libcfs_lock.o
 
 libcfs-objs := $(libcfs-linux-objs) $(libcfs-all-objs)
diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile 
b/drivers/staging/lustre/lustre/obdclass/Makefile
index acc6857..c404eb3 100644
--- a/drivers/staging/lustre/lustre/obdclass/Makefile
+++ b/drivers/staging/lustre/lustre/obdclass/Makefile
@@ -2,8 +2,8 @@ obj-$(CONFIG_LUSTRE_FS) += obdclass.o
 
 obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \
  llog.o llog_cat.o llog_obd.o llog_swab.o class_obd.o debug.o \
- genops.o uuid.o lprocfs_status.o \
- lustre_handles.o lustre_peer.o \
- statfs_pack.o obdo.o obd_config.o obd_mount.o \
- lu_object.o cl_object.o   \
- cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o lprocfs_counters.o
+ genops.o uuid.o lprocfs_status.o lprocfs_counters.o \
+ lustre_handles.o lustre_peer.o statfs_pack.o \
+ obdo.o obd_config.o obd_mount.o lu_object.o lu_ref.o \
+ cl_object.o cl_page.o cl_lock.o cl_io.o \
+ acl.o kernelcomm.o
diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
similarity index 100%
rename from drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
rename to drivers/staging/lustre/lustre/obdclass/kernelcomm.c
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/13] staging: lustre: cleanup block comment style in kernel_comm code

2015-11-08 Thread James Simmons
Fixup the comments to the linux kernel style for the source and
headers related to the kernel_comm work.

Signed-off-by: James Simmons 
---
 .../lustre/lustre/include/uapi_kernelcomm.h|   10 ++
 .../staging/lustre/lustre/obdclass/kernelcomm.c|   12 
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h 
b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
index 5e0b8de..a8feab6 100644
--- a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
+++ b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
@@ -45,11 +45,13 @@
  */
 struct kuc_hdr {
__u16 kuc_magic;
-   __u8  kuc_transport;  /* Each new Lustre feature should use a different
-transport */
+   /* Each new Lustre feature should use a different transport */
+   __u8  kuc_transport;
__u8  kuc_flags;
-   __u16 kuc_msgtype;/* Message type or opcode, transport-specific */
-   __u16 kuc_msglen; /* Including header */
+   /* Message type or opcode, transport-specific */
+   __u16 kuc_msgtype;
+   /* Including header */
+   __u16 kuc_msglen;
 } __aligned(sizeof(__u64));
 
 #define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr)+CR_MAXSIZE)
diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index c9405e6..eb5b0be 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -89,9 +89,11 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload)
 }
 EXPORT_SYMBOL(libcfs_kkuc_msg_put);
 
-/* Broadcast groups are global across all mounted filesystems;
+/*
+ * Broadcast groups are global across all mounted filesystems;
  * i.e. registering for a group on 1 fs will get messages for that
- * group from any fs */
+ * group from any fs
+ */
 /** A single group registration has a uid and a file pointer */
 struct kkuc_reg {
struct list_head kr_chain;
@@ -200,8 +202,10 @@ int libcfs_kkuc_group_put(unsigned int group, void 
*payload)
}
up_write(&kg_sem);
 
-   /* don't return an error if the message has been delivered
-* at least to one agent */
+   /*
+* don't return an error if the message has been delivered
+* at least to one agent
+*/
if (one_success)
rc = 0;
 
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/13] staging: lustre: use proper braces in libcfs_kkuc_group_put

2015-11-08 Thread James Simmons
Add in missing braces for libcfs_kkuc_group_put();.

Signed-off-by: James Simmons 
---
 .../staging/lustre/lustre/obdclass/kernelcomm.c|4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index 709b1ab..46cb81a 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -192,9 +192,9 @@ int libcfs_kkuc_group_put(unsigned int group, void *payload)
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
if (reg->kr_fp) {
rc = libcfs_kkuc_msg_put(reg->kr_fp, payload);
-   if (rc == 0)
+   if (rc == 0) {
one_success = 1;
-   else if (rc == -EPIPE) {
+   } else if (rc == -EPIPE) {
fput(reg->kr_fp);
reg->kr_fp = NULL;
}
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/13] staging: lustre: split kernel comm between user and kernel

2015-11-08 Thread James Simmons
From: frank zago 

Split the kernel comm header in libcfs into two new headers
to handle both kernel space and user space for the lustre layer.
This is broken out of the original patch 14270. The part covered
by this change is as follows:

The original libcfs_kernelcomm.h header is split into three parts:
  * lustre_kernelcomm.h, a new header for the kernel parts;
  * uapi_kernelcomm.h, a new header for the data structures shared
between userspace and kernelspace;
  * lustreapi_internal.h receives the private liblustreapi prototypes.

Various names and filenames have been harmonized to *kernelcomm*.

The unused symbol KUC_FL_BLOCK has been removed.

Signed-off-by: frank zago 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/14270
Reviewed-by: Nathan Rutman 
Reviewed-by: James Simmons 
Reviewed-by: Dmitry Eremin 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |1 -
 .../lustre/lustre/include/lustre_kernelcomm.h  |   56 
 .../include/uapi_kernelcomm.h} |   50 -
 drivers/staging/lustre/lustre/llite/dir.c  |1 +
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|1 +
 drivers/staging/lustre/lustre/mdc/mdc_request.c|1 +
 drivers/staging/lustre/lustre/obdclass/genops.c|1 +
 .../staging/lustre/lustre/obdclass/kernelcomm.c|5 +-
 8 files changed, 74 insertions(+), 42 deletions(-)
 create mode 100644 drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
 rename drivers/staging/lustre/{include/linux/libcfs/libcfs_kernelcomm.h => 
lustre/include/uapi_kernelcomm.h} (62%)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 4d74e8a..e35f59f 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -122,7 +122,6 @@ void cfs_get_random_bytes(void *buf, int size);
 #include "libcfs_prim.h"
 #include "libcfs_time.h"
 #include "libcfs_string.h"
-#include "libcfs_kernelcomm.h"
 #include "libcfs_workitem.h"
 #include "libcfs_hash.h"
 #include "libcfs_fail.h"
diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h 
b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
new file mode 100644
index 000..bb305f4
--- /dev/null
+++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
@@ -0,0 +1,56 @@
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (c) 2013, Intel Corporation.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ *
+ * Author: Nathan Rutman 
+ *
+ * Kernel <-> userspace communication routines.
+ * The definitions below are used in the kernel and userspace.
+ */
+
+#ifndef __LUSTRE_KERNELCOMM_H__
+#define __LUSTRE_KERNELCOMM_H__
+
+/* For declarations shared with userspace */
+#include "uapi_kernelcomm.h"
+
+/* prototype for callback function on kuc groups */
+typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg);
+
+/* Kernel methods */
+int libcfs_kkuc_msg_put(struct file *fp, void *payload);
+int libcfs_kkuc_group_put(int group, void *payload);
+int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group,
+ void *data);
+int libcfs_kkuc_group_rem(int uid, int group, void **pdata);
+int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
+ void *cb_arg);
+
+#endif /* __LUSTRE_KERNELCOMM_H__ */
+
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h 
b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
similarity index 62%
rename from drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h
rename to drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
index 3a89a3b..5e0b8de 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h
+++ b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
@@ -15,37 +15,29 @@
  *
  * You should have received a

[PATCH 12/13] staging: lustre: return proper error code for libcfs_kkuc_msg_put

2015-11-08 Thread James Simmons
The functon libcfs_kkuc_msg_put() returns -ENOSYS which is not
correct. Return -ENXIO instead if the kuc header is corrupt.

Signed-off-by: James Simmons 
---
 .../staging/lustre/lustre/obdclass/kernelcomm.c|4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index 46cb81a..281cfd6 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -57,14 +57,14 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload)
ssize_t count = kuch->kuc_msglen;
loff_t offset = 0;
mm_segment_t fs;
-   int rc = -ENOSYS;
+   int rc = -ENXIO;
 
if (!filp || IS_ERR(filp))
return -EBADF;
 
if (kuch->kuc_magic != KUC_MAGIC) {
CERROR("KernelComm: bad magic %x\n", kuch->kuc_magic);
-   return -ENOSYS;
+   return rc;
}
 
fs = get_fs();
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/13] staging: lustre: convert kernelcomm group to unsigned int

2015-11-08 Thread James Simmons
The group variable was converted to an unsigned int in
libcfs_kkuc_group_add() to avoid a potential overflow.
The variable group is used in other kernelcomm functions
so it makes sense to convert the rest of the group
variables to unsigned int.

Signed-off-by: James Simmons 
---
 .../lustre/lustre/include/lustre_kernelcomm.h  |6 +++---
 .../staging/lustre/lustre/obdclass/kernelcomm.c|6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h 
b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
index 235b980..14bad00 100644
--- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
@@ -45,11 +45,11 @@ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg);
 
 /* Kernel methods */
 int libcfs_kkuc_msg_put(struct file *fp, void *payload);
-int libcfs_kkuc_group_put(int group, void *payload);
+int libcfs_kkuc_group_put(unsigned int group, void *payload);
 int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group,
  void *data, size_t data_len);
-int libcfs_kkuc_group_rem(int uid, int group);
-int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
+int libcfs_kkuc_group_rem(int uid, unsigned int group);
+int libcfs_kkuc_group_foreach(unsigned int group, libcfs_kkuc_cb_t cb_func,
  void *cb_arg);
 
 #endif /* __LUSTRE_KERNELCOMM_H__ */
diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index e290246..1081253 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -145,7 +145,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, 
unsigned int group,
 }
 EXPORT_SYMBOL(libcfs_kkuc_group_add);
 
-int libcfs_kkuc_group_rem(int uid, int group)
+int libcfs_kkuc_group_rem(int uid, unsigned int group)
 {
struct kkuc_reg *reg, *next;
 
@@ -180,7 +180,7 @@ int libcfs_kkuc_group_rem(int uid, int group)
 }
 EXPORT_SYMBOL(libcfs_kkuc_group_rem);
 
-int libcfs_kkuc_group_put(int group, void *payload)
+int libcfs_kkuc_group_put(unsigned int group, void *payload)
 {
struct kkuc_reg *reg;
int  rc = 0;
@@ -215,7 +215,7 @@ EXPORT_SYMBOL(libcfs_kkuc_group_put);
  * @param cb_func the function to be called.
  * @param cb_arg extra argument to be passed to the callback function.
  */
-int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
+int libcfs_kkuc_group_foreach(unsigned int group, libcfs_kkuc_cb_t cb_func,
  void *cb_arg)
 {
struct kkuc_reg *reg;
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/13] staging: lustre: embed kr_data into kkuc_reg

2015-11-08 Thread James Simmons
From: Hongchao Zhang 

In struct kkuc_reg, the "kr_data" is difficult to be freed
outside of libcfs, then it's better to change it to be
inline data instead of the data pointer.

Signed-off-by: Hongchao Zhang 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6485
Reviewed-on: http://review.whamcloud.com/14638
Reviewed-by: John L. Hammond 
Reviewed-by: James Simmons 
Reviewed-by: frank zago 
Reviewed-by: Robert Read 
Reviewed-by: Henri Doreau 
Reviewed-by: Oleg Drokin 
---
 .../lustre/lustre/include/lustre_kernelcomm.h  |4 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|   22 ++-
 drivers/staging/lustre/lustre/mdc/mdc_request.c|2 +-
 .../staging/lustre/lustre/obdclass/kernelcomm.c|   12 --
 4 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h 
b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
index bb305f4..235b980 100644
--- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h
@@ -47,8 +47,8 @@ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg);
 int libcfs_kkuc_msg_put(struct file *fp, void *payload);
 int libcfs_kkuc_group_put(int group, void *payload);
 int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group,
- void *data);
-int libcfs_kkuc_group_rem(int uid, int group, void **pdata);
+ void *data, size_t data_len);
+int libcfs_kkuc_group_rem(int uid, int group);
 int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func,
  void *cb_arg);
 
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 2ad2904..c2c8b72 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -795,7 +795,6 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv,
 static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int 
len,
 struct lustre_kernelcomm *lk, void *uarg)
 {
-   struct kkuc_ct_data *kcd = NULL;
int rc = 0;
__u32 i;
 
@@ -810,9 +809,7 @@ static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, 
unsigned int cmd, int len,
 * Unreached coordinators will get EPIPE on next requests
 * and will unregister automatically.
 */
-   rc = libcfs_kkuc_group_rem(lk->lk_uid, lk->lk_group, (void **)&kcd);
-   if (kcd)
-   kfree(kcd);
+   rc = libcfs_kkuc_group_rem(lk->lk_uid, lk->lk_group);
 
return rc;
 }
@@ -824,7 +821,7 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, 
unsigned int cmd, int len,
__u32 i, j;
int err, rc = 0;
bool any_set = false;
-   struct kkuc_ct_data *kcd;
+   struct kkuc_ct_data kcd = { 0 };
 
/* All or nothing: try to register to all MDS.
 * In case of failure, unregister from previous MDS,
@@ -864,20 +861,15 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, 
unsigned int cmd, int len,
if (!filp)
return -EBADF;
 
-   kcd = kzalloc(sizeof(*kcd), GFP_NOFS);
-   if (!kcd) {
-   fput(filp);
-   return -ENOMEM;
-   }
-   kcd->kcd_magic = KKUC_CT_DATA_MAGIC;
-   kcd->kcd_uuid = lmv->cluuid;
-   kcd->kcd_archive = lk->lk_data;
+   kcd.kcd_magic = KKUC_CT_DATA_MAGIC;
+   kcd.kcd_uuid = lmv->cluuid;
+   kcd.kcd_archive = lk->lk_data;
 
-   rc = libcfs_kkuc_group_add(filp, lk->lk_uid, lk->lk_group, kcd);
+   rc = libcfs_kkuc_group_add(filp, lk->lk_uid, lk->lk_group,
+  &kcd, sizeof(kcd));
if (rc) {
if (filp)
fput(filp);
-   kfree(kcd);
}
 
return rc;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c 
b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index a4c543a..ee1c040 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -2391,7 +2391,7 @@ static int mdc_precleanup(struct obd_device *obd, enum 
obd_cleanup_stage stage)
case OBD_CLEANUP_EXPORTS:
/* Failsafe, ok if racy */
if (obd->obd_type->typ_refcnt <= 1)
-   libcfs_kkuc_group_rem(0, KUC_GRP_HSM, NULL);
+   libcfs_kkuc_group_rem(0, KUC_GRP_HSM);
 
obd_cleanup_client_import(obd);
ptlrpc_lprocfs_unregister_obd(obd);
diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index e3f5a3c..e290246 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -97,7 +97,7 @@ struct kkuc_reg {
struct list_head kr_chain;
int  kr_uid;
struct file

[PATCH 10/13] staging: lustre: add space around '+' in kernel_comm code

2015-11-08 Thread James Simmons
Add in missing space arouund '+' in the kernel_comm code.

Signed-off-by: James Simmons 
---
 .../lustre/lustre/include/uapi_kernelcomm.h|2 +-
 .../staging/lustre/lustre/obdclass/kernelcomm.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h 
b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
index a8feab6..5ace9f8 100644
--- a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
+++ b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
@@ -54,7 +54,7 @@ struct kuc_hdr {
__u16 kuc_msglen;
 } __aligned(sizeof(__u64));
 
-#define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr)+CR_MAXSIZE)
+#define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr) + CR_MAXSIZE)
 
 #define KUC_MAGIC  0x191C /*Lustre9etLinC */
 
diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index eb5b0be..709b1ab 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -102,7 +102,7 @@ struct kkuc_reg {
char kr_data[0];
 };
 
-static struct list_head kkuc_groups[KUC_GRP_MAX+1] = {};
+static struct list_head kkuc_groups[KUC_GRP_MAX + 1] = {};
 /* Protect message sending against remove and adds */
 static DECLARE_RWSEM(kg_sem);
 
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/13] staging: lustre: cleanup white space in kernel comm code

2015-11-08 Thread James Simmons
Cleanup the last white space issues in the kernel comm code.

Signed-off-by: James Simmons 
---
 .../lustre/lustre/include/uapi_kernelcomm.h|   10 +-
 .../staging/lustre/lustre/obdclass/kernelcomm.c|2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h 
b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
index 5ace9f8..5e99836 100644
--- a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
+++ b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h
@@ -56,17 +56,17 @@ struct kuc_hdr {
 
 #define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr) + CR_MAXSIZE)
 
-#define KUC_MAGIC  0x191C /*Lustre9etLinC */
+#define KUC_MAGIC  0x191C /*Lustre9etLinC */
 
 /* kuc_msgtype values are defined in each transport */
 enum kuc_transport_type {
-   KUC_TRANSPORT_GENERIC   = 1,
-   KUC_TRANSPORT_HSM   = 2,
-   KUC_TRANSPORT_CHANGELOG = 3,
+   KUC_TRANSPORT_GENERIC   = 1,
+   KUC_TRANSPORT_HSM   = 2,
+   KUC_TRANSPORT_CHANGELOG = 3,
 };
 
 enum kuc_generic_message_type {
-   KUC_MSG_SHUTDOWN = 1,
+   KUC_MSG_SHUTDOWN= 1,
 };
 
 /* KUC Broadcast Groups. This determines which userspace process hears which
diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index 281cfd6..a2efb08 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -185,7 +185,7 @@ EXPORT_SYMBOL(libcfs_kkuc_group_rem);
 int libcfs_kkuc_group_put(unsigned int group, void *payload)
 {
struct kkuc_reg *reg;
-   int  rc = 0;
+   int rc = 0;
int one_success = 0;
 
down_write(&kg_sem);
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/13] staging: lustre: remove unnecessary NULL checks in kernel_comm.c

2015-11-08 Thread James Simmons
Fix checkpatch.pl reports of NULL comparison in kernel_comm.c.

Signed-off-by: James Simmons 
---
 .../staging/lustre/lustre/obdclass/kernelcomm.c|   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c 
b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
index 1081253..c9405e6 100644
--- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
+++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
@@ -59,7 +59,7 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload)
mm_segment_t fs;
int rc = -ENOSYS;
 
-   if (filp == NULL || IS_ERR(filp))
+   if (!filp || IS_ERR(filp))
return -EBADF;
 
if (kuch->kuc_magic != KUC_MAGIC) {
@@ -121,12 +121,12 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, 
unsigned int group,
}
 
/* fput in group_rem */
-   if (filp == NULL)
+   if (!filp)
return -EBADF;
 
/* freed in group_rem */
reg = kmalloc(sizeof(*reg) + data_len, 0);
-   if (reg == NULL)
+   if (!reg)
return -ENOMEM;
 
reg->kr_fp = filp;
@@ -134,7 +134,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, 
unsigned int group,
memcpy(reg->kr_data, data, data_len);
 
down_write(&kg_sem);
-   if (kkuc_groups[group].next == NULL)
+   if (!kkuc_groups[group].next)
INIT_LIST_HEAD(&kkuc_groups[group]);
list_add(®->kr_chain, &kkuc_groups[group]);
up_write(&kg_sem);
@@ -149,7 +149,7 @@ int libcfs_kkuc_group_rem(int uid, unsigned int group)
 {
struct kkuc_reg *reg, *next;
 
-   if (kkuc_groups[group].next == NULL)
+   if (!kkuc_groups[group].next)
return 0;
 
if (uid == 0) {
@@ -169,7 +169,7 @@ int libcfs_kkuc_group_rem(int uid, unsigned int group)
list_del(®->kr_chain);
CDEBUG(D_KUC, "Removed uid=%d fp=%p from group %d\n",
   reg->kr_uid, reg->kr_fp, group);
-   if (reg->kr_fp != NULL)
+   if (reg->kr_fp)
fput(reg->kr_fp);
kfree(reg);
}
@@ -188,7 +188,7 @@ int libcfs_kkuc_group_put(unsigned int group, void *payload)
 
down_write(&kg_sem);
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
-   if (reg->kr_fp != NULL) {
+   if (reg->kr_fp) {
rc = libcfs_kkuc_msg_put(reg->kr_fp, payload);
if (rc == 0)
one_success = 1;
@@ -227,12 +227,12 @@ int libcfs_kkuc_group_foreach(unsigned int group, 
libcfs_kkuc_cb_t cb_func,
}
 
/* no link for this group */
-   if (kkuc_groups[group].next == NULL)
+   if (!kkuc_groups[group].next)
return 0;
 
down_read(&kg_sem);
list_for_each_entry(reg, &kkuc_groups[group], kr_chain) {
-   if (reg->kr_fp != NULL)
+   if (reg->kr_fp)
rc = cb_func(reg->kr_data, cb_arg);
}
up_read(&kg_sem);
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 10/12] staging: rtl8188eu: reg_macid variable removed in hw_var_set_macaddr

2015-11-08 Thread Andy Shevchenko
On Sun, Nov 8, 2015 at 8:51 AM, Ivan Safonov  wrote:
> The reg_macid variable used only once. Also idx renamed to i and Adapter to 
> adapter.
>
> Signed-off-by: Ivan Safonov 
> ---
>  drivers/staging/rtl8188eu/hal/usb_halinit.c | 11 ---
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c 
> b/drivers/staging/rtl8188eu/hal/usb_halinit.c
> index 5789e1e..e1d6632 100644
> --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
> +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
> @@ -1253,15 +1253,12 @@ static void hw_var_set_opmode(struct adapter 
> *Adapter, u8 variable, u8 *val)
> }
>  }
>
> -static void hw_var_set_macaddr(struct adapter *Adapter, u8 variable, u8 *val)
> +static void hw_var_set_macaddr(struct adapter *adapter, u8 variable, u8 *val)
>  {
> -   u8 idx = 0;
> -   u32 reg_macid;
> -
> -   reg_macid = REG_MACID;
> +   int i;
>
> -   for (idx = 0; idx < 6; idx++)
> -   usb_write8(Adapter, (reg_macid+idx), val[idx]);
> +   for (i = 0; i < 6; i++)

ETH_ALEN?

> +   usb_write8(adapter, REG_MACID + i, val[i]);
>  }
>
>  static void hw_var_set_bssid(struct adapter *Adapter, u8 variable, u8 *val)
> --
> 2.4.10
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function

2015-11-08 Thread Andy Shevchenko
On Sun, Nov 8, 2015 at 1:26 PM, Ivan Safonov  wrote:
> On 11/08/2015 05:11 PM, Andy Shevchenko wrote:
>>
>> On Sun, Nov 8, 2015 at 8:37 AM, Ivan Safonov  wrote:
>>>
>>> Ideally the function should not change the variables outside of its body.

>>> -static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen)
>>> +static u32 _rtl88e_fill_dummy(u8 *pfwbuf, u32 pfwlen)
>>>   {
>>>  u32 i;
>>>
>>> -   for (i = *pfwlen; i < roundup(*pfwlen, 4); i++)
>>> +   for (i = pfwlen; i < roundup(pfwlen, 4); i++)
>>>  pfwbuf[i] = 0;
>>
>> memset() ?
>>
>>> -   *pfwlen = i;
>>> +   return i;
>>>   }
>>>
>>>   static void _rtl88e_fw_page_write(struct adapter *adapt,
>>> @@ -103,7 +103,7 @@ static void _rtl88e_write_fw(struct adapter *adapt,
>>> u8 *buffer, u32 size)
>>>  u32 page_no, remain;
>>>  u32 page, offset;
>>>
>>> -   _rtl88e_fill_dummy(buf_ptr, &size);
>>> +   size = _rtl88e_fill_dummy(buf_ptr, size);


> memset applied in another patch. Here only replacement of the function type.

Since it's used only once it would be nice to replace it by plain
memset() in one patch.

-- 
With Best Regards,
Andy Shevchenko
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH V2] Staging: wilc1000: Fix build break due to undeclared *wilc and implicit declaration of init_irq

2015-11-08 Thread Punit Vara
This patch is to the linux_wlan.c file that fixes up break found during
make drivers/staging/wilc1000/linux_wlan.o

Patch add following things to file :
-init_irq declaration
-At preprocessor (!defined WILC_SDIO) to defination of init_irq
-At preprocessor (!defined WILC_SDIO) to defination isr_uh_routine
-removes unnecessary lines to declare *wilc

Patch fixes 702c0e50f and 2c1d05d10 tags.

Signed-off-by: Punit Vara 
---
-Fixes tag added suggested by Dan carpenter.
-Remove declaration of autovariable with same type and same name suggested by 
Joe Perches

 drivers/staging/wilc1000/linux_wlan.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 086f1db..5bd14ed 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -208,7 +208,7 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
return NOTIFY_DONE;
 }
 
-#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
+#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO) || (!defined WILC_SDIO)
 static irqreturn_t isr_uh_routine(int irq, void *user_data)
 {
perInterface_wlan_t *nic;
@@ -246,7 +246,7 @@ irqreturn_t isr_bh_routine(int irq, void *userdata)
return IRQ_HANDLED;
 }
 
-#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
+#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO) || (!defined WILC_SDIO)
 static int init_irq(struct net_device *dev)
 {
int ret = 0;
@@ -937,6 +937,10 @@ static void wlan_deinitialize_threads(struct net_device 
*dev)
}
 }
 
+#if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
+static int init_irq(struct net_device *dev);
+#endif
+
 int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
 {
wilc_wlan_inp_t nwi;
@@ -1578,9 +1582,7 @@ int wilc_netdev_init(struct wilc **wilc)
 
 static int __init init_wilc_driver(void)
 {
-#ifdef WILC_SPI
struct wilc *wilc;
-#endif
 
 #if defined(WILC_DEBUGFS)
if (wilc_debugfs_init() < 0) {
-- 
2.6.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V2] Staging: wilc1000: Fix build break due to undeclared *wilc and implicit declaration of init_irq

2015-11-08 Thread Dan Carpenter
Top posting beucase I am a bad person.  Punit, you should have CC'd Glen
since this is his code.

The fix is still not right.  It will cause an unused variable warning on
some configs.

To be honest, this code makes no sense.  Why do we even have the wilc
variable in this function when we never use it?  Just declare move it to
wilc_netdev_init().  Also there are too many ifdefs in this code.

regards,
dan carpenter

On Mon, Nov 09, 2015 at 03:01:50AM +0530, Punit Vara wrote:
> This patch is to the linux_wlan.c file that fixes up break found during
> make drivers/staging/wilc1000/linux_wlan.o
> 
> Patch add following things to file :
> -init_irq declaration
> -At preprocessor (!defined WILC_SDIO) to defination of init_irq
> -At preprocessor (!defined WILC_SDIO) to defination isr_uh_routine
> -removes unnecessary lines to declare *wilc
> 
> Patch fixes 702c0e50f and 2c1d05d10 tags.
> 
> Signed-off-by: Punit Vara 
> ---
> -Fixes tag added suggested by Dan carpenter.
> -Remove declaration of autovariable with same type and same name suggested by 
> Joe Perches
> 
>  drivers/staging/wilc1000/linux_wlan.c | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/linux_wlan.c 
> b/drivers/staging/wilc1000/linux_wlan.c
> index 086f1db..5bd14ed 100644
> --- a/drivers/staging/wilc1000/linux_wlan.c
> +++ b/drivers/staging/wilc1000/linux_wlan.c
> @@ -208,7 +208,7 @@ static int dev_state_ev_handler(struct notifier_block 
> *this, unsigned long event
>   return NOTIFY_DONE;
>  }
>  
> -#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
> +#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO) || (!defined 
> WILC_SDIO)
>  static irqreturn_t isr_uh_routine(int irq, void *user_data)
>  {
>   perInterface_wlan_t *nic;
> @@ -246,7 +246,7 @@ irqreturn_t isr_bh_routine(int irq, void *userdata)
>   return IRQ_HANDLED;
>  }
>  
> -#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
> +#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO) || (!defined 
> WILC_SDIO)
>  static int init_irq(struct net_device *dev)
>  {
>   int ret = 0;
> @@ -937,6 +937,10 @@ static void wlan_deinitialize_threads(struct net_device 
> *dev)
>   }
>  }
>  
> +#if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
> +static int init_irq(struct net_device *dev);
> +#endif
> +
>  int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
>  {
>   wilc_wlan_inp_t nwi;
> @@ -1578,9 +1582,7 @@ int wilc_netdev_init(struct wilc **wilc)
>  
>  static int __init init_wilc_driver(void)
>  {
> -#ifdef WILC_SPI
>   struct wilc *wilc;
> -#endif
>  
>  #if defined(WILC_DEBUGFS)
>   if (wilc_debugfs_init() < 0) {
> -- 
> 2.6.2
> 
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: update Intel copyright messages 2015

2015-11-08 Thread James Simmons
From: Andreas Dilger 

Update copyright messages in files modified by Intel employees
in 2015 by non-trivial patches.  Exclude patches that are only
deleting code, renaming functions, or adding or removing whitespace.

Signed-off-by: Andreas Dilger 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7243
Reviewed-on: http://review.whamcloud.com/16758
Reviewed-by: James Nunez 
Reviewed-by: James Simmons 
Reviewed-by: Dmitry Eremin 
Reviewed-by: Oleg Drokin 
---
 .../staging/lustre/include/linux/libcfs/libcfs.h   |2 +-
 .../lustre/include/linux/libcfs/libcfs_cpu.h   |3 ++-
 .../lustre/include/linux/libcfs/libcfs_hash.h  |2 +-
 .../staging/lustre/include/linux/lnet/lib-lnet.h   |2 +-
 .../staging/lustre/include/linux/lnet/lib-types.h  |2 +-
 drivers/staging/lustre/include/linux/lnet/nidstr.h |2 +-
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c|2 +-
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h|2 +-
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |2 +-
 .../staging/lustre/lnet/klnds/socklnd/socklnd.c|2 +-
 drivers/staging/lustre/lnet/lnet/acceptor.c|2 +-
 drivers/staging/lustre/lnet/lnet/api-ni.c  |2 +-
 drivers/staging/lustre/lnet/lnet/config.c  |2 +-
 drivers/staging/lustre/lnet/lnet/lib-move.c|2 +-
 drivers/staging/lustre/lnet/lnet/lib-ptl.c |2 +-
 drivers/staging/lustre/lnet/lnet/lib-socket.c  |2 +-
 drivers/staging/lustre/lnet/lnet/module.c  |2 +-
 drivers/staging/lustre/lnet/lnet/router.c  |2 +-
 drivers/staging/lustre/lnet/selftest/brw_test.c|2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c |2 +-
 drivers/staging/lustre/lustre/fid/fid_request.c|2 +-
 drivers/staging/lustre/lustre/fid/lproc_fid.c  |2 +-
 drivers/staging/lustre/lustre/fld/fld_internal.h   |2 +-
 drivers/staging/lustre/lustre/fld/fld_request.c|2 +-
 drivers/staging/lustre/lustre/fld/lproc_fld.c  |2 +-
 drivers/staging/lustre/lustre/include/cl_object.h  |2 +-
 .../staging/lustre/lustre/include/lprocfs_status.h |2 +-
 drivers/staging/lustre/lustre/include/lu_object.h  |2 +-
 .../lustre/lustre/include/lustre/ll_fiemap.h   |2 ++
 .../lustre/lustre/include/lustre/lustre_idl.h  |2 +-
 .../lustre/lustre/include/lustre/lustre_user.h |2 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |2 +-
 .../staging/lustre/lustre/include/lustre_export.h  |2 +-
 drivers/staging/lustre/lustre/include/lustre_fid.h |2 +-
 drivers/staging/lustre/lustre/include/lustre_fld.h |2 +-
 drivers/staging/lustre/lustre/include/lustre_ha.h  |2 +-
 drivers/staging/lustre/lustre/include/lustre_log.h |2 +-
 drivers/staging/lustre/lustre/include/lustre_net.h |2 +-
 .../staging/lustre/lustre/include/lustre_param.h   |2 +-
 .../lustre/lustre/include/lustre_req_layout.h  |2 +-
 drivers/staging/lustre/lustre/include/obd.h|2 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |2 +-
 .../staging/lustre/lustre/include/obd_support.h|2 +-
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c |2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_internal.h |2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  |2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c|2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |2 +-
 drivers/staging/lustre/lustre/libcfs/fail.c|2 +-
 drivers/staging/lustre/lustre/libcfs/libcfs_lock.c |2 +-
 .../staging/lustre/lustre/libcfs/libcfs_string.c   |2 +-
 .../staging/lustre/lustre/libcfs/linux/linux-cpu.c |3 ++-
 .../lustre/lustre/libcfs/linux/linux-curproc.c |2 +-
 drivers/staging/lustre/lustre/libcfs/module.c  |2 +-
 drivers/staging/lustre/lustre/llite/dcache.c   |2 +-
 drivers/staging/lustre/lustre/llite/dir.c  |2 +-
 drivers/staging/lustre/lustre/llite/file.c |2 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c|2 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |2 +-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |2 +-
 drivers/staging/lustre/lustre/llite/namei.c|2 +-
 drivers/staging/lustre/lustre/llite/rw.c   |2 +-
 drivers/staging/lustre/lustre/llite/statahead.c|2 +-
 drivers/staging/lustre/lustre/llite/vvp_dev.c  |2 +-
 drivers/staging/lustre/lustre/llite/vvp_internal.h |2 ++
 drivers/staging/lustre/lustre/llite/vvp_io.c   |2 +-
 drivers/staging/lustre/lustre/llite/vvp_lock.c |2 ++
 drivers/staging/lustre/lustre/llite/vvp_object.c   |2 +-
 drivers/staging/lustre/lustre/llite/vvp_page.c |2 +-
 driv

[PATCH] staging: lustre: remove unnecessary EXPORT_SYMBOL for lnet layer

2015-11-08 Thread James Simmons
From: frank zago 

A lot of symbols don't need to be exported at all because they are
only used in the module they belong to.

Signed-off-by: frank zago 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5829
Reviewed-on: http://review.whamcloud.com/13320
Reviewed-by: James Simmons 
Reviewed-by: Isaac Huang 
Reviewed-by: John L. Hammond 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/lnet/api-ni.c |3 ---
 drivers/staging/lustre/lnet/lnet/lib-move.c   |1 -
 drivers/staging/lustre/lnet/selftest/conctl.c |2 --
 3 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c 
b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 284150f..9f78dc8 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -354,7 +354,6 @@ lnet_counters_reset(void)
 
lnet_net_unlock(LNET_LOCK_EX);
 }
-EXPORT_SYMBOL(lnet_counters_reset);
 
 static char *
 lnet_res_type2str(int type)
@@ -1153,7 +1152,6 @@ lnet_init(void)
lnet_register_lnd(&the_lolnd);
return 0;
 }
-EXPORT_SYMBOL(lnet_init);
 
 /**
  * Finalize LNet library.
@@ -1177,7 +1175,6 @@ lnet_fini(void)
 
the_lnet.ln_init = 0;
 }
-EXPORT_SYMBOL(lnet_fini);
 
 /**
  * Set LNet PID and start LNet interfaces, routing, and forwarding.
diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c 
b/drivers/staging/lustre/lnet/lnet/lib-move.c
index 5631f60..03a721e 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-move.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-move.c
@@ -1645,7 +1645,6 @@ lnet_msgtyp2str(int type)
return "";
}
 }
-EXPORT_SYMBOL(lnet_msgtyp2str);
 
 void
 lnet_print_hdr(lnet_hdr_t *hdr)
diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c 
b/drivers/staging/lustre/lnet/selftest/conctl.c
index 556c837..a534665 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -925,5 +925,3 @@ out:
 
return rc;
 }
-
-EXPORT_SYMBOL(lstcon_ioctl_entry);
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH V2] Staging: wilc1000: Fix build break due to undeclared *wilc and implicit declaration of init_irq

2015-11-08 Thread glen lee

I just check the email, I will get back here after I check the patches related 
with this issue.

regards,
glen lee.


On 2015년 11월 09일 06:59, Dan Carpenter wrote:

Top posting beucase I am a bad person.  Punit, you should have CC'd Glen
since this is his code.

The fix is still not right.  It will cause an unused variable warning on
some configs.

To be honest, this code makes no sense.  Why do we even have the wilc
variable in this function when we never use it?  Just declare move it to
wilc_netdev_init().  Also there are too many ifdefs in this code.

regards,
dan carpenter

On Mon, Nov 09, 2015 at 03:01:50AM +0530, Punit Vara wrote:

This patch is to the linux_wlan.c file that fixes up break found during
make drivers/staging/wilc1000/linux_wlan.o

Patch add following things to file :
-init_irq declaration
-At preprocessor (!defined WILC_SDIO) to defination of init_irq
-At preprocessor (!defined WILC_SDIO) to defination isr_uh_routine
-removes unnecessary lines to declare *wilc

Patch fixes 702c0e50f and 2c1d05d10 tags.

Signed-off-by: Punit Vara 
---
-Fixes tag added suggested by Dan carpenter.
-Remove declaration of autovariable with same type and same name suggested by 
Joe Perches

  drivers/staging/wilc1000/linux_wlan.c | 10 ++
  1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 086f1db..5bd14ed 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -208,7 +208,7 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
return NOTIFY_DONE;
  }
  
-#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)

+#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO) || (!defined WILC_SDIO)
  static irqreturn_t isr_uh_routine(int irq, void *user_data)
  {
perInterface_wlan_t *nic;
@@ -246,7 +246,7 @@ irqreturn_t isr_bh_routine(int irq, void *userdata)
return IRQ_HANDLED;
  }
  
-#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)

+#if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO) || (!defined WILC_SDIO)
  static int init_irq(struct net_device *dev)
  {
int ret = 0;
@@ -937,6 +937,10 @@ static void wlan_deinitialize_threads(struct net_device 
*dev)
}
  }
  
+#if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)

+static int init_irq(struct net_device *dev);
+#endif
+
  int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
  {
wilc_wlan_inp_t nwi;
@@ -1578,9 +1582,7 @@ int wilc_netdev_init(struct wilc **wilc)
  
  static int __init init_wilc_driver(void)

  {
-#ifdef WILC_SPI
struct wilc *wilc;
-#endif
  
  #if defined(WILC_DEBUGFS)

if (wilc_debugfs_init() < 0) {
--
2.6.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: linux-next network throughput performance regression

2015-11-08 Thread Dexuan Cui
> From: devel [mailto:driverdev-devel-boun...@linuxdriverproject.org] On Behalf
> Of Eric Dumazet
> Sent: Sunday, November 8, 2015 3:36
> To: David Ahern 
> Cc: net...@vger.kernel.org; Haiyang Zhang ; linux-
> ker...@vger.kernel.org; de...@linuxdriverproject.org; David Miller
> 
> Subject: Re: linux-next network throughput performance regression
> 
> On Fri, 2015-11-06 at 14:30 -0700, David Ahern wrote:
> > On 11/6/15 2:18 PM, Simon Xiao wrote:
> > > The .config file used to build linux-next kernel is attached to this mail.
> >
> > Thanks.
> >
> > Failed to notice this on the first response; my brain filled in. Why
> > linux-next tree? Can you try net-next which is more relevant for this
> > mailing list, post the top commit id and config file used?
> 
> Throughput on a single TCP flow for a 40G NIC can be tricky to tune.
Why is a single TCP flow trickier than multiple TCP flows?
IMO it should be easier to analyze the issue of a single TCP flow?

Here the perf drop in Simon's test is very obvious -- 50%, but it looks Eric
can't reproduce it, so I suppose some net-related kernel config options may
do the magic?

Maybe Simon can narrow the regression down by bisecting. :-)
 
> Make sure IRQ are properly setup/balanced, as I know that IRQ names were
> changed recently and your scripts might have not noticed...
> 
> Also "ethtool -c eth0" might show very different interrupt coalescing
> params ?
> 
> I too have a Mellanox 40Gb in my lab and saw no difference in
> performance with recent kernels.
> 
> Of course, a simple "perf record -a -g sleep 4 ; perf report" might
> point to some obvious issue. Like unexpected segmentation in case of
> forwarding...
> 

Thanks,
-- Dexuan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: linux-next network throughput performance regression

2015-11-08 Thread David Miller
From: Dexuan Cui 
Date: Mon, 9 Nov 2015 02:39:24 +

>> Throughput on a single TCP flow for a 40G NIC can be tricky to tune.
> Why is a single TCP flow trickier than multiple TCP flows?
> IMO it should be easier to analyze the issue of a single TCP flow?

Because a single TCP flow can only use one of the many TX queues
that such modern NICs have.

The single TX queue becomes the bottleneck.

Whereas if you have several TCP flows, all of them can use independant
TX queues on the NIC in parallel to fill the link with traffic.

That's why.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: linux-next network throughput performance regression

2015-11-08 Thread Dexuan Cui
> -Original Message-
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Monday, November 9, 2015 10:53
> To: Dexuan Cui 
> Cc: eric.duma...@gmail.com; d...@cumulusnetworks.com; Simon Xiao
> ; net...@vger.kernel.org; Haiyang Zhang
> ; linux-ker...@vger.kernel.org;
> de...@linuxdriverproject.org
> Subject: Re: linux-next network throughput performance regression
> 
> From: Dexuan Cui 
> Date: Mon, 9 Nov 2015 02:39:24 +
> 
> >> Throughput on a single TCP flow for a 40G NIC can be tricky to tune.
> > Why is a single TCP flow trickier than multiple TCP flows?
> > IMO it should be easier to analyze the issue of a single TCP flow?
> 
> Because a single TCP flow can only use one of the many TX queues
> that such modern NICs have.
> 
> The single TX queue becomes the bottleneck.
> 
> Whereas if you have several TCP flows, all of them can use independant
> TX queues on the NIC in parallel to fill the link with traffic.
> 
> That's why.

Thanks, David!
I understand 1 TX queue is the bottleneck (however in Simon's
test, TX=1 => 36.7Gb/s, TX=8 => 37.7 Gb/s, so it looks the TX=1 bottleneck
is not so obvious).
I'm just wondering how the bottleneck became much narrower with
recent linux-next in Simon's result (36.7 Gb/s vs. 18.2 Gb/s). IMO there
must be some latency somewhere.

Thanks,
-- Dexuan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: linux-next network throughput performance regression

2015-11-08 Thread David Miller
From: Dexuan Cui 
Date: Mon, 9 Nov 2015 03:11:35 +

>> -Original Message-
>> From: David Miller [mailto:da...@davemloft.net]
>> Sent: Monday, November 9, 2015 10:53
>> To: Dexuan Cui 
>> Cc: eric.duma...@gmail.com; d...@cumulusnetworks.com; Simon Xiao
>> ; net...@vger.kernel.org; Haiyang Zhang
>> ; linux-ker...@vger.kernel.org;
>> de...@linuxdriverproject.org
>> Subject: Re: linux-next network throughput performance regression
>> 
>> From: Dexuan Cui 
>> Date: Mon, 9 Nov 2015 02:39:24 +
>> 
>> >> Throughput on a single TCP flow for a 40G NIC can be tricky to tune.
>> > Why is a single TCP flow trickier than multiple TCP flows?
>> > IMO it should be easier to analyze the issue of a single TCP flow?
>> 
>> Because a single TCP flow can only use one of the many TX queues
>> that such modern NICs have.
>> 
>> The single TX queue becomes the bottleneck.
>> 
>> Whereas if you have several TCP flows, all of them can use independant
>> TX queues on the NIC in parallel to fill the link with traffic.
>> 
>> That's why.
> 
> Thanks, David!
> I understand 1 TX queue is the bottleneck (however in Simon's
> test, TX=1 => 36.7Gb/s, TX=8 => 37.7 Gb/s, so it looks the TX=1 bottleneck
> is not so obvious).
> I'm just wondering how the bottleneck became much narrower with
> recent linux-next in Simon's result (36.7 Gb/s vs. 18.2 Gb/s). IMO there
> must be some latency somewhere.

I think the whole thing here is that you misinterpreted what Eric said.

He is not arguing that some regression did, or did not, happen.

He instead was making the basic statement about the fact that due to
the lack of paralellness a single stream TCP case is harder to
optimize for high speed NICs.

That is all.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: linux-next network throughput performance regression

2015-11-08 Thread Dexuan Cui
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Monday, November 9, 2015 11:24
> ...
> > Thanks, David!
> > I understand 1 TX queue is the bottleneck (however in Simon's
> > test, TX=1 => 36.7Gb/s, TX=8 => 37.7 Gb/s, so it looks the TX=1 bottleneck
> > is not so obvious).
> > I'm just wondering how the bottleneck became much narrower with
> > recent linux-next in Simon's result (36.7 Gb/s vs. 18.2 Gb/s). IMO there
> > must be some latency somewhere.
> 
> I think the whole thing here is that you misinterpreted what Eric said.
> 
> He is not arguing that some regression did, or did not, happen.
> 
> He instead was making the basic statement about the fact that due to
> the lack of paralellness a single stream TCP case is harder to
> optimize for high speed NICs.
> 
> That is all.
Thanks, I got it. 
I'm actually new to network performance tuning, trying to understand
all the related details. :-)

Thanks,
-- Dexuan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: linux-next network throughput performance regression

2015-11-08 Thread Dave Airlie
On 9 November 2015 at 13:23, David Miller  wrote:
> From: Dexuan Cui 
> Date: Mon, 9 Nov 2015 03:11:35 +
>
>>> -Original Message-
>>> From: David Miller [mailto:da...@davemloft.net]
>>> Sent: Monday, November 9, 2015 10:53
>>> To: Dexuan Cui 
>>> Cc: eric.duma...@gmail.com; d...@cumulusnetworks.com; Simon Xiao
>>> ; net...@vger.kernel.org; Haiyang Zhang
>>> ; linux-ker...@vger.kernel.org;
>>> de...@linuxdriverproject.org
>>> Subject: Re: linux-next network throughput performance regression
>>>
>>> From: Dexuan Cui 
>>> Date: Mon, 9 Nov 2015 02:39:24 +
>>>
>>> >> Throughput on a single TCP flow for a 40G NIC can be tricky to tune.
>>> > Why is a single TCP flow trickier than multiple TCP flows?
>>> > IMO it should be easier to analyze the issue of a single TCP flow?
>>>
>>> Because a single TCP flow can only use one of the many TX queues
>>> that such modern NICs have.
>>>
>>> The single TX queue becomes the bottleneck.
>>>
>>> Whereas if you have several TCP flows, all of them can use independant
>>> TX queues on the NIC in parallel to fill the link with traffic.
>>>
>>> That's why.
>>
>> Thanks, David!
>> I understand 1 TX queue is the bottleneck (however in Simon's
>> test, TX=1 => 36.7Gb/s, TX=8 => 37.7 Gb/s, so it looks the TX=1 bottleneck
>> is not so obvious).
>> I'm just wondering how the bottleneck became much narrower with
>> recent linux-next in Simon's result (36.7 Gb/s vs. 18.2 Gb/s). IMO there
>> must be some latency somewhere.
>
> I think the whole thing here is that you misinterpreted what Eric said.
>
> He is not arguing that some regression did, or did not, happen.
>
> He instead was making the basic statement about the fact that due to
> the lack of paralellness a single stream TCP case is harder to
> optimize for high speed NICs.
>
> That is all.

We recently had a regression tracked down in a similiar area that was
because of link order.

Dave.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: remove {linux,posix}-tracefile.h

2015-11-08 Thread James Simmons
From: John L. Hammond 

Move the definition of the trace buffer type enum in
libcfs/libcfs/tracefile.h.  Remove the then unneeded headers
libcfs/libcfs/linux/linux-tracefile.h and
libcfs/libcfs/posix/posix-tracefile.h.

Signed-off-by: John L. Hammond 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/11983
Reviewed-by: Bob Glossman 
Reviewed-by: James Simmons 
Reviewed-by: Dmitry Eremin 
Reviewed-by: Oleg Drokin 
---
 .../lustre/lustre/libcfs/linux/linux-tracefile.h   |   48 
 drivers/staging/lustre/lustre/libcfs/tracefile.h   |7 +++-
 2 files changed, 6 insertions(+), 49 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.h

diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.h 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.h
deleted file mode 100644
index ba84e4f..000
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- */
-
-#ifndef __LIBCFS_LINUX_TRACEFILE_H__
-#define __LIBCFS_LINUX_TRACEFILE_H__
-
-/**
- * three types of trace_data in linux
- */
-typedef enum {
-   CFS_TCD_TYPE_PROC = 0,
-   CFS_TCD_TYPE_SOFTIRQ,
-   CFS_TCD_TYPE_IRQ,
-   CFS_TCD_TYPE_MAX
-} cfs_trace_buf_type_t;
-
-#endif
diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h 
b/drivers/staging/lustre/lustre/libcfs/tracefile.h
index 6b37798..b71b94f 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
@@ -39,7 +39,12 @@
 
 #include "../../include/linux/libcfs/libcfs.h"
 
-#include "linux/linux-tracefile.h"
+typedef enum {
+   CFS_TCD_TYPE_PROC = 0,
+   CFS_TCD_TYPE_SOFTIRQ,
+   CFS_TCD_TYPE_IRQ,
+   CFS_TCD_TYPE_MAX
+} cfs_trace_buf_type_t;
 
 /* trace file lock routines */
 
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: remove obsolete comment in tracefile.h

2015-11-08 Thread James Simmons
From: John L. Hammond 

Remove comment about tracefile handling for user land
version of libcfs that no longer exist. Broken out of
patch http://review.whamcloud.com/11983.

Signed-off-by: John L. Hammond 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675
Reviewed-on: http://review.whamcloud.com/11983
Reviewed-by: Bob Glossman 
Reviewed-by: James Simmons 
Reviewed-by: Dmitry Eremin 
Reviewed-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/libcfs/tracefile.h |7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h 
b/drivers/staging/lustre/lustre/libcfs/tracefile.h
index 6b37798..fd8086b 100644
--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h
+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h
@@ -251,13 +251,6 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int 
mask,
 int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking);
 void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking);
 
-/**
- * trace_buf_type_t, trace_buf_idx_get() and trace_console_buffers[][]
- * are not public libcfs API; they should be defined in
- * platform-specific tracefile include files
- * (see, for example, linux-tracefile.h).
- */
-
 extern char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX];
 cfs_trace_buf_type_t cfs_trace_buf_idx_get(void);
 
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: linux-next network throughput performance regression

2015-11-08 Thread Tom Herbert
On Sun, Nov 8, 2015 at 7:31 PM, Dexuan Cui  wrote:
>> From: David Miller [mailto:da...@davemloft.net]
>> Sent: Monday, November 9, 2015 11:24
>> ...
>> > Thanks, David!
>> > I understand 1 TX queue is the bottleneck (however in Simon's
>> > test, TX=1 => 36.7Gb/s, TX=8 => 37.7 Gb/s, so it looks the TX=1 bottleneck
>> > is not so obvious).
>> > I'm just wondering how the bottleneck became much narrower with
>> > recent linux-next in Simon's result (36.7 Gb/s vs. 18.2 Gb/s). IMO there
>> > must be some latency somewhere.
>>
>> I think the whole thing here is that you misinterpreted what Eric said.
>>
>> He is not arguing that some regression did, or did not, happen.
>>
>> He instead was making the basic statement about the fact that due to
>> the lack of paralellness a single stream TCP case is harder to
>> optimize for high speed NICs.
>>
>> That is all.
> Thanks, I got it.
> I'm actually new to network performance tuning, trying to understand
> all the related details. :-)
>

You might want to look at
https://www.kernel.org/doc/Documentation/networking/scaling.txt as an
introduction to the scaling capabilities of the stack.

Tom

> Thanks,
> -- Dexuan
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel