Re: [PATCH v1 9/9] staging: android: binder: Add binder compat layer

2013-12-13 Thread Octavian Purdila
On Fri, Dec 13, 2013 at 7:14 AM, Arve Hjønnevåg  wrote:
> On Thu, Dec 12, 2013 at 12:45 AM, Octavian Purdila
>  wrote:
>> On Thu, Dec 12, 2013 at 1:00 AM, Arve Hjønnevåg  wrote:
>>> On Wed, Dec 11, 2013 at 10:10 AM, Octavian Purdila
>>>  wrote:
 On Wed, Dec 11, 2013 at 5:21 AM, Arve Hjønnevåg  wrote:
>
> Assuming you are talking about a kernel compat layer that translates
> the flat_binder_object structs as they pass between 32 bit and 64 bit
> processes, that will not always work. The data portion of the message
> sometimes contain size values that are invisible to the kernel, but
> these values will be wrong if the kernel move data to make room for a
> different size flat_binder_object.
>

 Hi Arve,

 Yes, I was talking about translating flat_binder_objects.

 I understand the potential issue for the user data payload, however,
 since most applications will use libbinder, the only problematic case
 is readIntPtr/writeIntPtr, which we can deprecate and convert
 applications that use it to readInt64. AFAICS there is only one user
 in the AOSP for this API (libmedia).

 If you are referring to data blobs that application parses I don't
 think there is anything we can do, even at libbinder level.

 Can you give me an example of the sort of problems you see?

 Thanks,
 Tavi
>>>
>>> The specific problem I was told about can be found in
>>> frameworks/base/core/java/android/os/Bundle.java, but there could be
>>> other. The size of the bundle is stored in the parcel so the end of
>>> the bundle will be wrong if the bundle contains a flat_binder_object
>>> that the driver changes the size of. However, since the sending
>>> process gets the parcel size from libbinder, changing libbinder to
>>> always use the 64 bit version of flat_binder_object should work with
>>> this code.
>>>
>>
>> AFAICS the bundle size is stored as an int32 so there is no bit width
>> issues between the sending and receiving process.
>>
>> When I mentioned that flat_binder_objects will be translated, I meant
>> the whole transaction will be translated to preserve its user payload
>> intact. Something like this:
>>
>> 32bit64bit
>>   ++++
>>   | o o oo  oxx| -> | oo   oo|
>>   ++++
>>
>> where o are binder objects, spaces are user data and x,y are offsets
>> pointers to binder objects (they are size_t so they need translation
>> as well).
>>
>> As long as the application does not use absolute offsets in the
>> payload and as long as the data types stored in the payload are fixed
>> bit width across the 32bit/64bit ABI (e.g. int32, int64 instead of
>> intptr) doing the translation in kernel should be fine. I checked
>> libbinder and both assumptions seems to be true (except in a few cases
>> for the later which I already mentioned)
>>
>> So, what am I missing?
>
> The bundle size is wrong in the receiving process if the driver change
> the size of a flat_binder_object stored in the bundle.
>
> A simplified example where a flat_binder_object is a single pointer,
> and a bundle only adds a size to the data stored:
> If you send a bundle with an object and an int  followed by an
> int  from a 32 bit process to a 64 bit process you would get
> this transformation of the data (offsets not shown):
> bundle(obj, inta), int(intb) => parcel_32(8,obj,inta,intb) =>
> parcel_64(8,objl,objh,inta,intb) => bundle(obj), int(inta), int(intb)
>
> The first bundle argument is missing an item in the receiving process,
> and the second argument is  instead of .
>

Thanks Arve, I understand the problem now. When I first looked at the
code I thought that the bundle stores the number of objects instead of
its size.

In this case, changing libbinder (and ServiceManager) to use 64bit
structures when talking with 64bit kernels seems the only reasonable
approach.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH net] netvsc: don't flush peers notifying work during setting mtu

2013-12-13 Thread Jason Wang
There's a possible deadlock if we flush the peers notifying work during setting
mtu:

[   22.991149] ==
[   22.991173] [ INFO: possible circular locking dependency detected ]
[   22.991198] 3.10.0-54.0.1.el7.x86_64.debug #1 Not tainted
[   22.991219] ---
[   22.991243] ip/974 is trying to acquire lock:
[   22.991261]  ((&(&net_device_ctx->dwork)->work)){+.+.+.}, at: 
[] flush_work+0x5/0x2e0
[   22.991307]
but task is already holding lock:
[   22.991330]  (rtnl_mutex){+.+.+.}, at: [] 
rtnetlink_rcv+0x1b/0x40
[   22.991367]
which lock already depends on the new lock.

[   22.991398]
the existing dependency chain (in reverse order) is:
[   22.991426]
-> #1 (rtnl_mutex){+.+.+.}:
[   22.991449][] __lock_acquire+0xb19/0x1260
[   22.991477][] lock_acquire+0xa2/0x1f0
[   22.991501][] mutex_lock_nested+0x89/0x4f0
[   22.991529][] rtnl_lock+0x17/0x20
[   22.991552][] netdev_notify_peers+0x12/0x30
[   22.991579][] netvsc_send_garp+0x22/0x30 
[hv_netvsc]
[   22.991610][] process_one_work+0x211/0x6e0
[   22.991637][] worker_thread+0x11b/0x3a0
[   22.991663][] kthread+0xed/0x100
[   22.991686][] ret_from_fork+0x7c/0xb0
[   22.991715]
-> #0 ((&(&net_device_ctx->dwork)->work)){+.+.+.}:
[   22.991715][] check_prevs_add+0x967/0x970
[   22.991715][] __lock_acquire+0xb19/0x1260
[   22.991715][] lock_acquire+0xa2/0x1f0
[   22.991715][] flush_work+0x4e/0x2e0
[   22.991715][] __cancel_work_timer+0x95/0x130
[   22.991715][] cancel_delayed_work_sync+0x13/0x20
[   22.991715][] netvsc_change_mtu+0x84/0x200 
[hv_netvsc]
[   22.991715][] dev_set_mtu+0x34/0x80
[   22.991715][] do_setlink+0x23a/0xa00
[   22.991715][] rtnl_newlink+0x394/0x5e0
[   22.991715][] rtnetlink_rcv_msg+0x9c/0x260
[   22.991715][] netlink_rcv_skb+0xa9/0xc0
[   22.991715][] rtnetlink_rcv+0x2a/0x40
[   22.991715][] netlink_unicast+0xdd/0x190
[   22.991715][] netlink_sendmsg+0x337/0x750
[   22.991715][] sock_sendmsg+0x99/0xd0
[   22.991715][] ___sys_sendmsg+0x39e/0x3b0
[   22.991715][] __sys_sendmsg+0x42/0x80
[   22.991715][] SyS_sendmsg+0x12/0x20
[   22.991715][] system_call_fastpath+0x16/0x1b

This is because we hold the rtnl_lock() before ndo_change_mtu() and try to flush
the work in netvsc_change_mtu(), in the mean time, netdev_notify_peers() may be
called from worker and also trying to hold the rtnl_lock. This will lead the
flush won't succeed forever. Solve this by not canceling and flushing the work,
this is safe because the transmission done by NETDEV_NOTIFY_PEERS was
synchronized with the netif_tx_disable() called by netvsc_change_mtu().

Reported-by: Yaju Cao 
Tested-by: Yaju Cao 
Cc: K. Y. Srinivasan 
Cc: Haiyang Zhang 
Signed-off-by: Jason Wang 
---
The patch is needed for stable.
---
 drivers/net/hyperv/netvsc_drv.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 524f713..f813572 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -327,7 +327,6 @@ static int netvsc_change_mtu(struct net_device *ndev, int 
mtu)
return -EINVAL;
 
nvdev->start_remove = true;
-   cancel_delayed_work_sync(&ndevctx->dwork);
cancel_work_sync(&ndevctx->work);
netif_tx_disable(ndev);
rndis_filter_device_remove(hdev);
-- 
1.8.3.2

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


Re: [PATCH] Staging:bcm:DDRInit: fixed issues w/ indentation

2013-12-13 Thread Greg KH
Care to put a ' ' after your ':'?  Look at how other commit messages
look like, I really don't want to have to hand-edit commits, I just
can't scale when doing that (remember, I get 1000 emails a day...)

On Fri, Dec 13, 2013 at 01:00:21AM -0500, Gary Rookard wrote:
>   restructured the levels of indentation to follow the linux
>   kernel coding style thus fixing checkpatch errors and warnings
>   respectfully.
> 
>   Signed-off-by: Gary Alan Rookard 

Why is this indented?

thanks,

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


[PATCH] staging: comedi: 8255_pci: fix for newer PCI-DIO48H

2013-12-13 Thread Ian Abbott
At some point, Measurement Computing / ComputerBoards redesigned the
PCI-DIO48H to use a PLX PCI interface chip instead of an AMCC chip.
This meant they had to put their hardware registers in the PCI BAR 2
region instead of PCI BAR 1.  Unfortunately, they kept the same PCI
device ID for the new design.  This means the driver recognizes the
newer cards, but doesn't work (and is likely to screw up the local
configuration registers of the PLX chip) because it's using the wrong
region.

Since  the PCI subvendor and subdevice IDs were both zero on the old
design, but are the same as the vendor and device on the new design, we
can tell the old design and new design apart easily enough.  Split the
existing entry for the PCI-DIO48H in `pci_8255_boards[]` into two new
entries, referenced by different entries in the PCI device ID table
`pci_8255_pci_table[]`.  Use the same board name for both entries.

Signed-off-by: Ian Abbott 
---
Cc:  # 3.10.y # 3.11.y # 3.12.y # 3.13.y
---
 drivers/staging/comedi/drivers/8255_pci.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/8255_pci.c 
b/drivers/staging/comedi/drivers/8255_pci.c
index ec14acb..8a57c3c 100644
--- a/drivers/staging/comedi/drivers/8255_pci.c
+++ b/drivers/staging/comedi/drivers/8255_pci.c
@@ -63,7 +63,8 @@ enum pci_8255_boardid {
BOARD_ADLINK_PCI7296,
BOARD_CB_PCIDIO24,
BOARD_CB_PCIDIO24H,
-   BOARD_CB_PCIDIO48H,
+   BOARD_CB_PCIDIO48H_OLD,
+   BOARD_CB_PCIDIO48H_NEW,
BOARD_CB_PCIDIO96H,
BOARD_NI_PCIDIO96,
BOARD_NI_PCIDIO96B,
@@ -106,11 +107,16 @@ static const struct pci_8255_boardinfo pci_8255_boards[] 
= {
.dio_badr   = 2,
.n_8255 = 1,
},
-   [BOARD_CB_PCIDIO48H] = {
+   [BOARD_CB_PCIDIO48H_OLD] = {
.name   = "cb_pci-dio48h",
.dio_badr   = 1,
.n_8255 = 2,
},
+   [BOARD_CB_PCIDIO48H_NEW] = {
+   .name   = "cb_pci-dio48h",
+   .dio_badr   = 2,
+   .n_8255 = 2,
+   },
[BOARD_CB_PCIDIO96H] = {
.name   = "cb_pci-dio96h",
.dio_badr   = 2,
@@ -263,7 +269,10 @@ static const struct pci_device_id pci_8255_pci_table[] = {
{ PCI_VDEVICE(ADLINK, 0x7296), BOARD_ADLINK_PCI7296 },
{ PCI_VDEVICE(CB, 0x0028), BOARD_CB_PCIDIO24 },
{ PCI_VDEVICE(CB, 0x0014), BOARD_CB_PCIDIO24H },
-   { PCI_VDEVICE(CB, 0x000b), BOARD_CB_PCIDIO48H },
+   { PCI_DEVICE_SUB(PCI_VENDOR_ID_CB, 0x000b, 0x, 0x),
+ .driver_data = BOARD_CB_PCIDIO48H_OLD },
+   { PCI_DEVICE_SUB(PCI_VENDOR_ID_CB, 0x000b, PCI_VENDOR_ID_CB, 0x000b),
+ .driver_data = BOARD_CB_PCIDIO48H_NEW },
{ PCI_VDEVICE(CB, 0x0017), BOARD_CB_PCIDIO96H },
{ PCI_VDEVICE(NI, 0x0160), BOARD_NI_PCIDIO96 },
{ PCI_VDEVICE(NI, 0x1630), BOARD_NI_PCIDIO96B },
-- 
1.8.4.4

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


Re: [PATCH 1/2] staging: et131x: improve code consistency: access struct rx_ring

2013-12-13 Thread Mark Einon
On Sun, Dec 08, 2013 at 11:01:06AM +0800, ZHAO Gang wrote:
> Let all the code use a pointer called rx_ring to access struct rx_ring
> members.
> 
> Signed-off-by: ZHAO Gang 

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


Re: [PATCH 2/2] staging: et131x: improve code consistency: access struct tx_ring

2013-12-13 Thread Mark Einon
On Sun, Dec 08, 2013 at 11:01:07AM +0800, ZHAO Gang wrote:
> Let all the code use a pointer called tx_ring to access struct tx_ring
> members.
> 
> Signed-off-by: ZHAO Gang 

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


[PATCH] Staging: bcm: DDRInit: fixed comment issues.

2013-12-13 Thread Gary Rookard
replaced C99 style with C89 standard style comments
to follow the linux kernel coding style thus fixing
checkpatch errors respectfully.
also, in some instances changed comments from inline
to side-bar style.

Signed-off-by: Gary Alan Rookard 
---
On branch staging-next
 drivers/staging/bcm/DDRInit.c | 315 ++
 1 file changed, 137 insertions(+), 178 deletions(-)

diff --git a/drivers/staging/bcm/DDRInit.c b/drivers/staging/bcm/DDRInit.c
index 939fe73..41132b5 100644
--- a/drivers/staging/bcm/DDRInit.c
+++ b/drivers/staging/bcm/DDRInit.c
@@ -5,41 +5,39 @@
 #define DDR_DUMP_INTERNAL_DEVICE_MEMORY 0xBFC02B00
 #define MIPS_CLOCK_REG 0x0f000820
 
-//DDR INIT-133Mhz
-#define T3_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 12  //index for 0x0F007000
-static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = {//  # DPLL Clock 
Setting
+/* DDR INIT-133Mhz */
+#define T3_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 12  /* index for 0x0F007000 */
+static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = { /* DPLL Clock 
Setting */
{0x0F000800, 0x7212},
{0x0f000820, 0x07F13FFF},
{0x0f000810, 0x0F95},
{0x0f000860, 0x},
{0x0f000880, 0x03DD},
-   // Changed source for X-bar and MIPS clock to APLL
-   {0x0f000840, 0x0FFF1B00},
+   {0x0f000840, 0x0FFF1B00},  /* Changed source for X-bar and MIPS clock 
to APLL */
{0x0f000870, 0x0002},
{0x0F00a044, 0x1fff},
{0x0F00a040, 0x1f00},
{0x0F00a084, 0x1Cff},
{0x0F00a080, 0x1C00},
{0x0F00a04C, 0x000C},
-   //Memcontroller Default values
-   {0x0F007000, 0x00010001},
+   {0x0F007000, 0x00010001},  /* Memcontroller Default values */
{0x0F007004, 0x01010100},
{0x0F007008, 0x0101},
{0x0F00700c, 0x},
{0x0F007010, 0x0100},
{0x0F007014, 0x01000100},
{0x0F007018, 0x0100},
-   {0x0F00701c, 0x01020001},// POP - 0x00020001 Normal 0x01020001
-   {0x0F007020, 0x04030107}, //Normal - 0x04030107 POP - 0x05030107
+   {0x0F00701c, 0x01020001},  /* POP - 0x00020001 Normal - 0x01020001 */
+   {0x0F007020, 0x04030107},  /* Normal - 0x04030107 POP - 0x05030107 */
{0x0F007024, 0x0207},
{0x0F007028, 0x02020202},
-   {0x0F00702c, 0x0206060a},//ROB- 0x0205050a,//0x0206060a
+   {0x0F00702c, 0x0206060a},  /* ROB - 0x0205050a,0x0206060a */
{0x0F007030, 0x0500},
{0x0F007034, 0x0003},
-   {0x0F007038, 0x110a0200},//ROB - 0x110a0200,//0x180a0200,// 0x1f0a0200
-   {0x0F00703C, 0x02101010},//ROB - 0x02101010,//0x02101018},
-   {0x0F007040, 0x45751200},//ROB - 0x45751200,//0x450f1200},
-   {0x0F007044, 0x110a0d00},//ROB - 0x110a0d00//0x111f0d00
+   {0x0F007038, 0x110a0200},  /* ROB - 0x110a0200,0x180a0200, 0x1f0a0200 */
+   {0x0F00703C, 0x02101010},  /* ROB - 0x02101010,0x02101018}, */
+   {0x0F007040, 0x45751200},  /* ROB - 0x45751200,0x450f1200}, */
+   {0x0F007044, 0x110a0d00},  /* ROB - 0x110a0d00//0x111f0d00 */
{0x0F007048, 0x081b0306},
{0x0F00704c, 0x},
{0x0F007050, 0x001c},
@@ -56,16 +54,13 @@ static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = {// 
 # DPLL Clock Se
{0x0F00707C, 0x},
{0x0F007080, 0x},
{0x0F007084, 0x},
-   //# Enable BW improvement within memory controller
-   {0x0F007094, 0x0104},
-   //# Enable 2 ports within X-bar
-   {0x0F00A000, 0x0016},
-   //# Enable start bit within memory controller
-   {0x0F007018, 0x0101}
+   {0x0F007094, 0x0104},  /* Enable BW improvement within memory 
controller */
+   {0x0F00A000, 0x0016},  /* Enable 2 ports within X-bar */
+   {0x0F007018, 0x0101}   /* Enable start bit within memory controller 
*/
 };
-//80Mhz
-#define T3_SKIP_CLOCK_PROGRAM_DUMP_80MHZ 10  //index for 0x0F007000
-static struct bcm_ddr_setting asT3_DDRSetting80MHz[] = {//   # DPLL Clock 
Setting
+/* 80Mhz-T3 */
+#define T3_SKIP_CLOCK_PROGRAM_DUMP_80MHZ 10  /* index for 0x0F007000 */
+static struct bcm_ddr_setting asT3_DDRSetting80MHz[] = {  /* DPLL Clock 
Setting */
{0x0f000810, 0x0F95},
{0x0f000820, 0x07f1},
{0x0f000860, 0x},
@@ -76,8 +71,7 @@ static struct bcm_ddr_setting asT3_DDRSetting80MHz[] = {//   
# DPLL Clock Settin
{0x0F00a080, 0x1C00},
{0x0F00a000, 0x0016},
{0x0F00a04C, 0x000C},
-   //Memcontroller Default values
-   {0x0F007000, 0x00010001},
+   {0x0F007000, 0x00010001},  /* Memcontroller Default values */
{0x0F007004, 0x0100},
{0x0F007008, 0x0101},
{0x0F00700c, 0x},
@@ -112,38 +106,34 @@ static struct bcm_ddr_setting asT3_DDRSetting80MHz[] = 
{//   # DPLL Clock Settin
{0x0F007080, 0x},
{0x0F007084, 0x},
{0x0F007094, 0x0104},

RE: [PATCH] staging: comedi: 8255_pci: fix for newer PCI-DIO48H

2013-12-13 Thread Hartley Sweeten
On Friday, December 13, 2013 5:01 AM, Ian Abbott wrote:
> 
> At some point, Measurement Computing / ComputerBoards redesigned the
> PCI-DIO48H to use a PLX PCI interface chip instead of an AMCC chip.
> This meant they had to put their hardware registers in the PCI BAR 2
> region instead of PCI BAR 1.  Unfortunately, they kept the same PCI
> device ID for the new design.  This means the driver recognizes the
> newer cards, but doesn't work (and is likely to screw up the local
> configuration registers of the PLX chip) because it's using the wrong
> region.
>
> Since  the PCI subvendor and subdevice IDs were both zero on the old
> design, but are the same as the vendor and device on the new design, we
> can tell the old design and new design apart easily enough.  Split the
> existing entry for the PCI-DIO48H in `pci_8255_boards[]` into two new
> entries, referenced by different entries in the PCI device ID table
> `pci_8255_pci_table[]`.  Use the same board name for both entries.
>
> Signed-off-by: Ian Abbott 
> ---
> Cc:  # 3.10.y # 3.11.y # 3.12.y # 3.13.y
> ---
>  drivers/staging/comedi/drivers/8255_pci.c | 15 ---
>  1 file changed, 12 insertions(+), 3 deletions(-)

Thanks,

Acked-by: H Hartley Sweeten 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] staging: lustre: Fix typo in lustre/lnet/selftest

2013-12-13 Thread Masanari Iida
Correct spelling typo in lustre/lnet/selftest

Signed-off-by: Masanari Iida 
---
 drivers/staging/lustre/lnet/selftest/conctl.c| 8 
 drivers/staging/lustre/lnet/selftest/console.c   | 2 +-
 drivers/staging/lustre/lnet/selftest/console.h   | 2 +-
 drivers/staging/lustre/lnet/selftest/ping_test.c | 2 +-
 drivers/staging/lustre/lnet/selftest/rpc.c   | 2 +-
 drivers/staging/lustre/lnet/selftest/selftest.h  | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c 
b/drivers/staging/lustre/lnet/selftest/conctl.c
index cbc416d..68e1a17 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -96,11 +96,11 @@ lst_session_info_ioctl(lstio_session_info_args_t *args)
 {
/* no checking of key */
 
-   if (args->lstio_ses_idp   == NULL || /* address for ouput sid */
-   args->lstio_ses_keyp  == NULL || /* address for ouput key */
-   args->lstio_ses_featp  == NULL || /* address for ouput features */
+   if (args->lstio_ses_idp   == NULL || /* address for output sid */
+   args->lstio_ses_keyp  == NULL || /* address for output key */
+   args->lstio_ses_featp  == NULL || /* address for output features */
args->lstio_ses_ndinfo == NULL || /* address for output ndinfo */
-   args->lstio_ses_namep == NULL || /* address for ouput name */
+   args->lstio_ses_namep == NULL || /* address for output name */
args->lstio_ses_nmlen <= 0 ||
args->lstio_ses_nmlen > LST_NAME_SIZE)
return -EINVAL;
diff --git a/drivers/staging/lustre/lnet/selftest/console.c 
b/drivers/staging/lustre/lnet/selftest/console.c
index 9556bc0..2a8eddc 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -614,7 +614,7 @@ lstcon_group_del(char *name)
 
lstcon_group_put(grp);
/* -ref for session, it's destroyed,
-* status can't be rolled back, destroy group anway */
+* status can't be rolled back, destroy group anyway */
lstcon_group_put(grp);
 
return rc;
diff --git a/drivers/staging/lustre/lnet/selftest/console.h 
b/drivers/staging/lustre/lnet/selftest/console.h
index b57dbd8..393dc0f 100644
--- a/drivers/staging/lustre/lnet/selftest/console.h
+++ b/drivers/staging/lustre/lnet/selftest/console.h
@@ -100,7 +100,7 @@ typedef struct {
struct list_head *bat_cli_hash;   /* hash table of client 
nodes */
struct list_head  bat_srv_list;   /* list head of server 
nodes */
struct list_head *bat_srv_hash;   /* hash table of server 
nodes */
-} lstcon_batch_t;   /*** (tests ) batch descritptor */
+} lstcon_batch_t;   /*** (tests ) batch descriptor */
 
 typedef struct lstcon_test {
lstcon_tsb_hdr_t  tes_hdr;  /* test batch header */
diff --git a/drivers/staging/lustre/lnet/selftest/ping_test.c 
b/drivers/staging/lustre/lnet/selftest/ping_test.c
index a37c3ff..750cac4 100644
--- a/drivers/staging/lustre/lnet/selftest/ping_test.c
+++ b/drivers/staging/lustre/lnet/selftest/ping_test.c
@@ -190,7 +190,7 @@ ping_server_handle(struct srpc_server_rpc *rpc)
LASSERT (reqstmsg->msg_type == srpc_service2request(sv->sv_id));
 
if (req->pnr_magic != LST_PING_TEST_MAGIC) {
-   CERROR ("Unexpect magic %08x from %s\n",
+   CERROR ("Unexpected magic %08x from %s\n",
req->pnr_magic, libcfs_id2str(rpc->srpc_peer));
return -EINVAL;
}
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c 
b/drivers/staging/lustre/lnet/selftest/rpc.c
index 5ae59d2..d838985 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -716,7 +716,7 @@ srpc_service_recycle_buffer(struct srpc_service_cd *scd, 
srpc_buffer_t *buf)
if (scd->scd_buf_adjust < 0 &&
scd->scd_buf_total == 0 && scd->scd_buf_posting == 0) {
CDEBUG(D_INFO,
-  "Try to recyle %d buffers but nothing left\n",
+  "Try to recycle %d buffers but nothing left\n",
   scd->scd_buf_adjust);
scd->scd_buf_adjust = 0;
}
diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h 
b/drivers/staging/lustre/lnet/selftest/selftest.h
index cd53926..228927e 100644
--- a/drivers/staging/lustre/lnet/selftest/selftest.h
+++ b/drivers/staging/lustre/lnet/selftest/selftest.h
@@ -350,7 +350,7 @@ typedef struct {
 } sfw_batch_t;
 
 typedef struct {
-   int  (*tso_init)(struct sfw_test_instance *tsi); /* intialize test 
client */
+   int  (*tso_init)(struct sfw_test_instance *tsi); /* initialize test 
client */
void (*tso_fini)(struct sfw_test_instance *tsi); /* fi

[PATCH 2/6] staging: lustre: Fix typo in lustre/lustre/lov

2013-12-13 Thread Masanari Iida
Correct spelling typo in lustre/lustre/lov

Signed-off-by: Masanari Iida 
---
 drivers/staging/lustre/lustre/lov/lov_lock.c|  2 +-
 drivers/staging/lustre/lustre/lov/lov_merge.c   |  2 +-
 drivers/staging/lustre/lustre/lov/lov_obd.c |  2 +-
 drivers/staging/lustre/lustre/lov/lov_pool.c|  2 +-
 drivers/staging/lustre/lustre/lov/lov_request.c | 14 +++---
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_lock.c 
b/drivers/staging/lustre/lustre/lov/lov_lock.c
index 26bc719..ed2726e 100644
--- a/drivers/staging/lustre/lustre/lov/lov_lock.c
+++ b/drivers/staging/lustre/lustre/lov/lov_lock.c
@@ -71,7 +71,7 @@ static struct lov_sublock_env *lov_sublock_env_get(const 
struct lu_env *env,
/*
 * FIXME: We tend to use the subio's env & io to call the sublock
 * lock operations because osc lock sometimes stores some control
-* variables in thread's IO infomation(Now only lockless information).
+* variables in thread's IO information(Now only lockless information).
 * However, if the lock's host(object) is different from the object
 * for current IO, we have no way to get the subenv and subio because
 * they are not initialized at all. As a temp fix, in this case,
diff --git a/drivers/staging/lustre/lustre/lov/lov_merge.c 
b/drivers/staging/lustre/lustre/lov/lov_merge.c
index d204fed..9defa55 100644
--- a/drivers/staging/lustre/lustre/lov/lov_merge.c
+++ b/drivers/staging/lustre/lustre/lov/lov_merge.c
@@ -156,7 +156,7 @@ int lov_adjust_kms(struct obd_export *exp, struct 
lov_stripe_md *lsm,
kms = lov_size_to_stripe(lsm, size, stripe);
CDEBUG(D_INODE,
   "stripe %d KMS %sing "LPU64"->"LPU64"\n",
-  stripe, kms > loi->loi_kms ? "increas":"shrink",
+  stripe, kms > loi->loi_kms ? "increase":"shrink",
   loi->loi_kms, kms);
loi_kms_set(loi, loi->loi_lvb.lvb_size = kms);
}
diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c 
b/drivers/staging/lustre/lustre/lov/lov_obd.c
index 4783450..50a77c5 100644
--- a/drivers/staging/lustre/lustre/lov/lov_obd.c
+++ b/drivers/staging/lustre/lustre/lov/lov_obd.c
@@ -1174,7 +1174,7 @@ static int lov_getattr_interpret(struct 
ptlrpc_request_set *rqset,
struct lov_request_set *lovset = (struct lov_request_set *)data;
int err;
 
-   /* don't do attribute merge if this aysnc op failed */
+   /* don't do attribute merge if this async op failed */
if (rc)
atomic_set(&lovset->set_completes, 0);
err = lov_fini_getattr_set(lovset);
diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c 
b/drivers/staging/lustre/lustre/lov/lov_pool.c
index a1701df..3bda0c1 100644
--- a/drivers/staging/lustre/lustre/lov/lov_pool.c
+++ b/drivers/staging/lustre/lustre/lov/lov_pool.c
@@ -453,7 +453,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
INIT_HLIST_NODE(&new_pool->pool_hash);
 
 #ifdef LPROCFS
-   /* we need this assert seq_file is not implementated for liblustre */
+   /* we need this assert seq_file is not implemented for liblustre */
/* get ref for /proc file */
lov_pool_getref(new_pool);
new_pool->pool_proc_entry = lprocfs_add_simple(lov->lov_pool_proc_entry,
diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c 
b/drivers/staging/lustre/lustre/lov/lov_request.c
index bf324ae..ca81cac 100644
--- a/drivers/staging/lustre/lustre/lov/lov_request.c
+++ b/drivers/staging/lustre/lustre/lov/lov_request.c
@@ -835,7 +835,7 @@ int lov_fini_getattr_set(struct lov_request_set *set)
return rc;
 }
 
-/* The callback for osc_getattr_async that finilizes a request info when a
+/* The callback for osc_getattr_async that finalizes a request info when a
  * response is received. */
 static int cb_getattr_update(void *cookie, int rc)
 {
@@ -1017,7 +1017,7 @@ int lov_update_setattr_set(struct lov_request_set *set,
return rc;
 }
 
-/* The callback for osc_setattr_async that finilizes a request info when a
+/* The callback for osc_setattr_async that finalizes a request info when a
  * response is received. */
 static int cb_setattr_update(void *cookie, int rc)
 {
@@ -1140,7 +1140,7 @@ int lov_update_punch_set(struct lov_request_set *set,
return rc;
 }
 
-/* The callback for osc_punch that finilizes a request info when a response
+/* The callback for osc_punch that finalizes a request info when a response
  * is received. */
 static int cb_update_punch(void *cookie, int rc)
 {
@@ -1236,8 +1236,8 @@ int lov_fini_sync_set(struct lov_request_set *set)
return rc;
 }
 
-/* The callback for osc_sync that finilizes a request info when a
- * response is recieved. */
+/* The callback for osc_sync that finalizes a request info when a
+ * response is receive

[PATCH 3/6] staging: lustre: Fix typo in lustre/lustre/lmv

2013-12-13 Thread Masanari Iida
Fix spelling typo in lustre/lustre/lmv

Signed-off-by: Masanari Iida 
---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index c286604..1bddd8f 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -628,7 +628,7 @@ static int lmv_disconnect_mdc(struct obd_device *obd, 
struct lmv_tgt_desc *tgt)
 
rc = obd_fid_fini(tgt->ltd_exp->exp_obd);
if (rc)
-   CERROR("Can't finanize fids factory\n");
+   CERROR("Can't finalize fids factory\n");
 
CDEBUG(D_INFO, "Disconnected from %s(%s) successfully\n",
   tgt->ltd_exp->exp_obd->obd_name,
@@ -712,7 +712,7 @@ repeat_fid2path:
GOTO(out_fid2path, rc);
 
/* If remote_gf != NULL, it means just building the
-* path on the remote MDT, copy this path segement to gf */
+* path on the remote MDT, copy this path segment to gf */
if (remote_gf != NULL) {
struct getinfo_fid2path *ori_gf;
char *ptr;
@@ -1212,7 +1212,7 @@ static int lmv_placement_policy(struct obd_device *obd,
 
/**
 * If stripe_offset is provided during setdirstripe
-* (setdirstripe -i xx), xx MDS will be choosen.
+* (setdirstripe -i xx), xx MDS will be chosen.
 */
if (op_data->op_cli_flags & CLI_SET_MEA) {
struct lmv_user_md *lum;
-- 
1.8.5.rc1.28.g7061504

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


[PATCH 6/6] staging: lustre: Fix typo in lustre/lustre/libcfs

2013-12-13 Thread Masanari Iida
Correct spelling typo in lustre/lustre/libcfs

Signed-off-by: Masanari Iida 
---
 drivers/staging/lustre/lustre/libcfs/hash.c | 8 
 drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c | 4 ++--
 drivers/staging/lustre/lustre/libcfs/module.c   | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c 
b/drivers/staging/lustre/lustre/libcfs/hash.c
index 85cbe91..6d2b455 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -51,11 +51,11 @@
  * - move all stuff to libcfs
  * - don't allow cur_bits != max_bits without setting of CFS_HASH_REHASH
  * - ignore hs_rwlock if without CFS_HASH_REHASH setting
- * - buckets are allocated one by one(intead of contiguous memory),
+ * - buckets are allocated one by one(instead of contiguous memory),
  *   to avoid unnecessary cacheline conflict
  *
  * 2010-03-01: Liang Zhen 
- * - "bucket" is a group of hlist_head now, user can speicify bucket size
+ * - "bucket" is a group of hlist_head now, user can specify bucket size
  *   by bkt_bits of cfs_hash_create(), all hlist_heads in a bucket share
  *   one lock for reducing memory overhead.
  *
@@ -1386,7 +1386,7 @@ cfs_hash_for_each_enter(struct cfs_hash *hs)
/*
 * NB: it's race on cfs_has_t::hs_iterating, but doesn't matter
 * because it's just an unreliable signal to rehash-thread,
-* rehash-thread will try to finsih rehash ASAP when seeing this.
+* rehash-thread will try to finish rehash ASAP when seeing this.
 */
hs->hs_iterating = 1;
 
@@ -1394,7 +1394,7 @@ cfs_hash_for_each_enter(struct cfs_hash *hs)
hs->hs_iterators++;
 
/* NB: iteration is mostly called by service thread,
-* we tend to cancel pending rehash-requst, instead of
+* we tend to cancel pending rehash-request, instead of
 * blocking service thread, we will relaunch rehash request
 * after iteration */
if (cfs_hash_is_rehashing(hs))
diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c 
b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
index 74a0db5..1a423a2 100644
--- a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
+++ b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c
@@ -193,7 +193,7 @@ EXPORT_SYMBOL(libcfs_kkuc_msg_put);
 /* 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 */
-/** A single group reigstration has a uid and a file pointer */
+/** A single group registration has a uid and a file pointer */
 struct kkuc_reg {
struct list_headkr_chain;
int kr_uid;
@@ -206,7 +206,7 @@ static DECLARE_RWSEM(kg_sem);
 
 /** Add a receiver to a broadcast group
  * @param filp pipe to write into
- * @param uid identidier for this receiver
+ * @param uid identifier for this receiver
  * @param group group number
  */
 int libcfs_kkuc_group_add(struct file *filp, int uid, int group, __u32 data)
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 463b3e17..24ae26d 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -380,7 +380,7 @@ static int init_libcfs_module(void)
 
rc = cfs_crypto_register();
if (rc) {
-   CERROR("cfs_crypto_regster: error %d\n", rc);
+   CERROR("cfs_crypto_register: error %d\n", rc);
goto cleanup_wi;
}
 
-- 
1.8.5.rc1.28.g7061504

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


[PATCH 5/6] staging: lustre: Fix typo in lustre/lustre/fld and ldlm

2013-12-13 Thread Masanari Iida
Correct spelling typo in luster/lustre/fld and ldlm.

Signed-off-by: Masanari Iida 
---
 drivers/staging/lustre/lustre/fld/fld_cache.c  | 2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 8 
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 6 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_cache.c 
b/drivers/staging/lustre/lustre/fld/fld_cache.c
index 4531510..6c37930 100644
--- a/drivers/staging/lustre/lustre/fld/fld_cache.c
+++ b/drivers/staging/lustre/lustre/fld/fld_cache.c
@@ -307,7 +307,7 @@ static void fld_cache_overlap_handle(struct fld_cache 
*cache,
const mdsno_t mdt = range->lsr_index;
 
/* this is overlap case, these case are checking overlapping with
-* prev range only. fixup will handle overlaping with next range. */
+* prev range only. fixup will handle overlapping with next range. */
 
if (f_curr->fce_range.lsr_index == mdt) {
f_curr->fce_range.lsr_start = min(f_curr->fce_range.lsr_start,
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 95eff79..692623b 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -801,7 +801,7 @@ void ldlm_lock_addref_internal(struct ldlm_lock *lock, 
__u32 mode)
  * Removes reader/writer reference for LDLM lock \a lock.
  * Assumes LDLM lock is already locked.
  * only called in ldlm_flock_destroy and for local locks.
- * Does NOT add lock to LRU if no r/w references left to accomodate flock locks
+ * Does NOT add lock to LRU if no r/w references left to accommodate flock 
locks
  * that cannot be placed in LRU.
  */
 void ldlm_lock_decref_internal_nolock(struct ldlm_lock *lock, __u32 mode)
@@ -1254,7 +1254,7 @@ EXPORT_SYMBOL(ldlm_lock_allow_match);
  * list will be considered
  * If 'flags' contains LDLM_FL_CBPENDING, then locks that have been marked
  * to be canceled can still be matched as long as they still have reader
- * or writer refernces
+ * or writer referneces
  * If 'flags' contains LDLM_FL_TEST_LOCK, then don't actually reference a lock,
  * just tell us if we would have matched.
  *
@@ -2097,8 +2097,8 @@ void ldlm_cancel_locks_for_export(struct obd_export *exp)
 /**
  * Downgrade an exclusive lock.
  *
- * A fast variant of ldlm_lock_convert for convertion of exclusive
- * locks. The convertion is always successful.
+ * A fast variant of ldlm_lock_convert for conversion of exclusive
+ * locks. The conversion is always successful.
  * Used by Commit on Sharing (COS) code.
  *
  * \param lock A lock to convert
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index a8f8c1c..c0e54ae 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -781,7 +781,7 @@ int ldlm_prep_elc_req(struct obd_export *exp, struct 
ptlrpc_request *req,
dlm = req_capsule_client_get(pill, &RMF_DLM_REQ);
LASSERT(dlm);
/* Skip first lock handler in ldlm_request_pack(),
-* this method will incrment @lock_count according
+* this method will increment @lock_count according
 * to the lock handle amount actually written to
 * the buffer. */
dlm->lock_count = canceloff;
@@ -1584,7 +1584,7 @@ ldlm_cancel_lru_policy(struct ldlm_namespace *ns, int 
flags)
  *   the beginning of LRU list);
  *
  * flags & LDLM_CANCEL_SHRINK - cancel not more than \a count locks according 
to
- *   memory pressre policy function;
+ *   memory pressure policy function;
  *
  * flags & LDLM_CANCEL_AGED - cancel \a count locks according to "aged policy".
  *
@@ -2076,7 +2076,7 @@ static int ldlm_chain_lock_for_replay(struct ldlm_lock 
*lock, void *closure)
 lock, &lock->l_pending_chain.next,&lock->l_pending_chain.prev);
/* bug 9573: don't replay locks left after eviction, or
 * bug 17614: locks being actively cancelled. Get a reference
-* on a lock so that it does not disapear under us (e.g. due to cancel)
+* on a lock so that it does not disappear under us (e.g. due to cancel)
 */
if (!(lock->l_flags & (LDLM_FL_FAILED|LDLM_FL_CANCELING))) {
list_add(&lock->l_pending_chain, list);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 25e14e1..5f89864 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -162,7 +162,7 @@ static int lprocfs_ns_resources_seq_show

[PATCH 4/6] staging: lustre: Fix typo in lustre/lustre/osc

2013-12-13 Thread Masanari Iida
Correct spelling typo in lustre/lustre/osc

Signed-off-by: Masanari Iida 
---
 drivers/staging/lustre/lustre/osc/osc_cache.c   | 6 +++---
 drivers/staging/lustre/lustre/osc/osc_cl_internal.h | 2 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c| 2 +-
 drivers/staging/lustre/lustre/osc/osc_page.c| 4 ++--
 drivers/staging/lustre/lustre/osc/osc_request.c | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 00295da..be4511e 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1703,7 +1703,7 @@ static int osc_list_maint(struct client_obd *cli, struct 
osc_object *osc)
return is_ready;
 }
 
-/* this is trying to propogate async writeback errors back up to the
+/* this is trying to propagate async writeback errors back up to the
  * application.  As an async write fails we record the error code for later if
  * the app does an fsync.  As long as errors persist we force future rpcs to be
  * sync so that the app can get a sync error and break the cycle of queueing
@@ -2006,7 +2006,7 @@ static struct osc_object *osc_next_obj(struct client_obd 
*cli)
/* then if we have cache waiters, return all objects with queued
 * writes.  This is especially important when many small files
 * have filled up the cache and not been fired into rpcs because
-* they don't pass the nr_pending/object threshhold */
+* they don't pass the nr_pending/object threshold */
if (!list_empty(&cli->cl_cache_waiters) &&
!list_empty(&cli->cl_loi_write_list))
return list_to_obj(&cli->cl_loi_write_list, write_item);
@@ -2226,7 +2226,7 @@ int osc_queue_async_io(const struct lu_env *env, struct 
cl_io *io,
/* Add this page into extent by the following steps:
 * 1. if there exists an active extent for this IO, mostly this page
 *can be added to the active extent and sometimes we need to
-*expand extent to accomodate this page;
+*expand extent to accommodate this page;
 * 2. otherwise, a new extent will be allocated. */
 
ext = oio->oi_active;
diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h 
b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
index a3aa9b6..9e7899f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
+++ b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
@@ -299,7 +299,7 @@ struct osc_lock {
 ols_flush:1,
/**
 * if set, the osc_lock is a glimpse lock. For glimpse locks, we treat
-* the EVAVAIL error as torerable, this will make upper logic happy
+* the EVAVAIL error as tolerable, this will make upper logic happy
 * to wait all glimpse locks to each OSTs to be completed.
 * Glimpse lock converts to normal lock if the server lock is
 * granted.
diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c 
b/drivers/staging/lustre/lustre/osc/osc_lock.c
index c90abfb..ef7b9c2 100644
--- a/drivers/staging/lustre/lustre/osc/osc_lock.c
+++ b/drivers/staging/lustre/lustre/osc/osc_lock.c
@@ -929,7 +929,7 @@ static void osc_lock_build_einfo(const struct lu_env *env,
  * Determine if the lock should be converted into a lockless lock.
  *
  * Steps to check:
- * - if the lock has an explicite requirment for a non-lockless lock;
+ * - if the lock has an explicit requirement for a non-lockless lock;
  * - if the io lock request type ci_lockreq;
  * - send the enqueue rpc to ost to make the further decision;
  * - special treat to truncate lockless lock
diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
b/drivers/staging/lustre/lustre/osc/osc_page.c
index 6c20b8e..4909e486 100644
--- a/drivers/staging/lustre/lustre/osc/osc_page.c
+++ b/drivers/staging/lustre/lustre/osc/osc_page.c
@@ -587,7 +587,7 @@ static atomic_t osc_lru_waiters = ATOMIC_INIT(0);
 /* LRU pages are freed in batch mode. OSC should at least free this
  * number of pages to avoid running out of LRU budget, and.. */
 static const int lru_shrink_min = 2 << (20 - PAGE_CACHE_SHIFT);  /* 2M */
-/* free this number at most otherwise it will take too long time to finsih. */
+/* free this number at most otherwise it will take too long time to finish. */
 static const int lru_shrink_max = 32 << (20 - PAGE_CACHE_SHIFT); /* 32M */
 
 /* Check if we can free LRU slots from this OSC. If there exists LRU waiters,
@@ -606,7 +606,7 @@ static int osc_cache_too_much(struct client_obd *cli)
return min(pages, lru_shrink_max);
 
/* if it's going to run out LRU slots, we should free some, but not
-* too much to maintain faireness among OSCs. */
+* too much to maintain fairness among OSCs. */
if (atomic_read(cli->cl_lru_left) < cache->ccc_lru_max >> 4) {
unsigned long tmp;

[PATCH] staging: dgap: Fixed trailing white space from dgap_conf.h

2013-12-13 Thread Masanari Iida
This patch fixes "ERROR: trailing whitespace" found by
checkpatch.pl.

Signed-off-by: Masanari Iida 
---
 drivers/staging/dgap/dgap_conf.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/dgap/dgap_conf.h b/drivers/staging/dgap/dgap_conf.h
index 8809701..484ed72 100644
--- a/drivers/staging/dgap/dgap_conf.h
+++ b/drivers/staging/dgap/dgap_conf.h
@@ -138,7 +138,7 @@
 #defineCU  91
 #definePRINT   92
 #defineXPRINT  93
-#define CMAJOR   94 
+#define CMAJOR   94
 #define ALTPIN  95
 #define STARTO 96
 #define USEINTR  97
@@ -262,9 +262,9 @@ struct cnode {
} module;
 
char *ttyname;
-   
+
char *cuname;
-   
+
char *printname;
 
int  majornumber;
-- 
1.8.5.rc1.28.g7061504

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


[PATCH] staging: gdm72xx: Fix WARNING space prohibited before semicolon in gdm_qos.c

2013-12-13 Thread Masanari Iida
Fixed WARNING: space prohibited before semicolon
found by checkpatch.pl in gdm_qos.c

Signed-off-by: Masanari Iida 
---
 drivers/staging/gdm72xx/gdm_qos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gdm72xx/gdm_qos.c 
b/drivers/staging/gdm72xx/gdm_qos.c
index cc36924..50d43ad 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -97,7 +97,7 @@ void gdm_qos_init(void *nic_ptr)
struct qos_cb_s *qcb = &nic->qos;
int i;
 
-   for (i = 0 ; i < QOS_MAX; i++) {
+   for (i = 0; i < QOS_MAX; i++) {
INIT_LIST_HEAD(&qcb->qos_list[i]);
qcb->csr[i].qos_buf_count = 0;
qcb->csr[i].enabled = 0;
-- 
1.8.5.rc1.28.g7061504

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


[PATCH 2/8] staging:bcm:InterfaceIdleMode: fix checkpatch error

2013-12-13 Thread Gokulnath A
fixed all the errors found by checkpatch.pl

Signed-off-by: Gokulnath A 
---
 drivers/staging/bcm/InterfaceIdleMode.c | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceIdleMode.c 
b/drivers/staging/bcm/InterfaceIdleMode.c
index 5959fbd..8bf225a 100644
--- a/drivers/staging/bcm/InterfaceIdleMode.c
+++ b/drivers/staging/bcm/InterfaceIdleMode.c
@@ -52,7 +52,7 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter 
*Adapter, unsigned int *pui
 
if (ntohl(*puiBuffer) == GO_TO_IDLE_MODE_PAYLOAD) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, 
DBG_LVL_ALL, " Got GO_TO_IDLE_MODE_PAYLOAD(210) Msg Subtype");
-   if (ntohl(*(puiBuffer+1)) == 0 ) {
+   if (ntohl(*(puiBuffer+1)) == 0) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, 
DBG_LVL_ALL, "Got IDLE MODE WAKE UP Response From F/W");
 
status = wrmalt (Adapter, SW_ABORT_IDLEMODE_LOC, 
&uiRegRead, sizeof(uiRegRead));
@@ -95,8 +95,7 @@ int InterfaceIdleModeRespond(struct bcm_mini_adapter 
*Adapter, unsigned int *pui
wake_up(&Adapter->lowpower_mode_wait_queue);
 
} else {
-   if (TRUE == Adapter->IdleMode)
-   {
+   if (TRUE == Adapter->IdleMode) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, 
IDLE_MODE, DBG_LVL_ALL, "Device is already in Idle mode");
return status ;
}
@@ -168,8 +167,7 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter 
*Adapter, unsigned int
if (Adapter->ulPowerSaveMode == 
DEVICE_POWERSAVE_MODE_AS_MANUAL_CLOCK_GATING) {
value = 0x8000;
status = wrmalt(Adapter, DEBUG_INTERRUPT_GENERATOR_REGISTOR, 
&value, sizeof(value));
-   if (status)
-   {
+   if (status) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, 
DBG_LVL_ALL, "WRM to DEBUG_INTERRUPT_GENERATOR_REGISTOR Register failed");
return status;
}
@@ -196,15 +194,15 @@ static int InterfaceAbortIdlemode(struct bcm_mini_adapter 
*Adapter, unsigned int
/* mdelay(25); */
 
timeout = jiffies +  msecs_to_jiffies(50) ;
-   while ( timeout > jiffies ) {
+   while (timeout > jiffies) {
itr++ ;
rdmalt(Adapter, CHIP_ID_REG, &chip_id, sizeof(UINT));
if (0xbece3200 == (chip_id&~(0xF0)))
-   chip_id = chip_id&~(0xF0);
+   chip_id = chip_id&~(0xF01);
if (chip_id == Adapter->chip_id)
break;
}
-   if (timeout < jiffies )
+   if (timeout < jiffies)
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, 
DBG_LVL_ALL, "Not able to read chip-id even after 25 msec");
else
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, IDLE_MODE, 
DBG_LVL_ALL, "Number of completed iteration to read chip-id :%lu", itr);
@@ -242,14 +240,13 @@ void InterfaceHandleShutdownModeWakeup(struct 
bcm_mini_adapter *Adapter)
uiRegVal = 0;
Status = wrmalt(Adapter, DEBUG_INTERRUPT_GENERATOR_REGISTOR, 
&uiRegVal, sizeof(uiRegVal));
if (Status) {
-   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0,"WRM to 
DEBUG_INTERRUPT_GENERATOR_REGISTOR Failed with err :%d", Status);
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "WRM to 
DEBUG_INTERRUPT_GENERATOR_REGISTOR Failed with err :%d", Status);
return;
}
}
 
 else {
-
-/* clear Interrupt EP registers. */
+   /* clear Interrupt EP registers. */
bytes = rdmalt(Adapter, DEVICE_INT_OUT_EP_REG0, &uiRegVal, 
sizeof(uiRegVal));
if (bytes < 0) {
Status = bytes;
-- 
1.8.1.2

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


[PATCH 1/8] staging:bcm:InterfaceDld: fix checkpatch error

2013-12-13 Thread Gokulnath A
fixed all the errors found by checkpatch.pl

Signed-off-by: Gokulnath A 
---
 drivers/staging/bcm/InterfaceDld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/bcm/InterfaceDld.c 
b/drivers/staging/bcm/InterfaceDld.c
index 463bdee..a8d0063 100644
--- a/drivers/staging/bcm/InterfaceDld.c
+++ b/drivers/staging/bcm/InterfaceDld.c
@@ -115,7 +115,7 @@ int InterfaceFileReadbackFromChip(PVOID arg, struct file 
*flp, unsigned int on_c
while (len) {
if (*(unsigned int *)&buff_readback[len] != 
*(unsigned int *)&buff[len]) {

BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, MP_INIT, 
DBG_LVL_ALL, "Firmware Download is not proper %d", fw_down);
-   
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, MP_INIT, 
DBG_LVL_ALL, "Val from Binary %x, Val From Read Back %x ", *(unsigned int 
*)&buff[len], *(unsigned int*)&buff_readback[len]);
+   
BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, MP_INIT, 
DBG_LVL_ALL, "Val from Binary %x, Val From Read Back %x ", *(unsigned int 
*)&buff[len], *(unsigned int *)&buff_readback[len]);

BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, MP_INIT, 
DBG_LVL_ALL, "len =%x!!!", len);
Status = -EIO;
goto exit;
-- 
1.8.1.2

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


[PATCH 6/8] staging:bcm:InterfaceTx: fix checkpatch error

2013-12-13 Thread Gokulnath A
fixed all the errors found by checkpatch.pl

Signed-off-by: Gokulnath A 
---
 drivers/staging/bcm/InterfaceTx.c | 123 --
 1 file changed, 51 insertions(+), 72 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceTx.c 
b/drivers/staging/bcm/InterfaceTx.c
index b9c2784..682a7ac 100644
--- a/drivers/staging/bcm/InterfaceTx.c
+++ b/drivers/staging/bcm/InterfaceTx.c
@@ -3,7 +3,7 @@
 /*this is transmit call-back(BULK OUT)*/
 static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)
 {
-   struct bcm_usb_tcb *pTcb= (struct bcm_usb_tcb *)urb->context;
+   struct bcm_usb_tcb *pTcb = (struct bcm_usb_tcb *)urb->context;
struct bcm_interface_adapter *psIntfAdapter = pTcb->psIntfAdapter;
struct bcm_link_request *pControlMsg = (struct bcm_link_request 
*)urb->transfer_buffer;
struct bcm_mini_adapter *psAdapter = psIntfAdapter->psAdapter ;
@@ -13,16 +13,12 @@ static void write_bulk_callback(struct urb *urb/*, struct 
pt_regs *regs*/)
 if (unlikely(netif_msg_tx_done(Adapter)))
pr_info(PFX "%s: transmit status %d\n", Adapter->dev->name, 
urb->status);
 
-   if(urb->status != STATUS_SUCCESS)
-   {
-   if(urb->status == -EPIPE)
-   {
+   if (urb->status != STATUS_SUCCESS) {
+   if (urb->status == -EPIPE) {
psIntfAdapter->psAdapter->bEndPointHalted = TRUE ;

wake_up(&psIntfAdapter->psAdapter->tx_packet_wait_queue);
-   }
-   else
-   {
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, 
DBG_LVL_ALL,"Tx URB has got cancelled. status :%d", urb->status);
+   } else {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, NEXT_SEND, 
DBG_LVL_ALL, "Tx URB has got cancelled. status :%d", urb->status);
}
}
 
@@ -31,69 +27,61 @@ static void write_bulk_callback(struct urb *urb/*, struct 
pt_regs *regs*/)
 
 
 
-   if(TRUE == psAdapter->bPreparingForLowPowerMode)
-   {
+   if (TRUE == psAdapter->bPreparingForLowPowerMode) {
 
-   if(((pControlMsg->szData[0] == GO_TO_IDLE_MODE_PAYLOAD) &&
+   if (((pControlMsg->szData[0] == GO_TO_IDLE_MODE_PAYLOAD) &&
(pControlMsg->szData[1] == TARGET_CAN_GO_TO_IDLE_MODE)))
 
{
bpowerDownMsg = TRUE ;
-   //This covers the bus err while Idle Request msg sent 
down.
-   if(urb->status != STATUS_SUCCESS)
-   {
+   /* This covers the bus err while Idle Request msg sent 
down. */
+   if (urb->status != STATUS_SUCCESS) {
psAdapter->bPreparingForLowPowerMode = false ;
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, 
DBG_LVL_ALL,"Idle Mode Request msg failed to reach to Modem");
-   //Signalling the cntrl pkt path in Ioctl
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, 
NEXT_SEND, DBG_LVL_ALL, "Idle Mode Request msg failed to reach to Modem");
+   /* Signalling the cntrl pkt path in Ioctl */
wake_up(&psAdapter->lowpower_mode_wait_queue);
StartInterruptUrb(psIntfAdapter);
goto err_exit;
}
 
-   if(psAdapter->bDoSuspend == false)
-   {
+   if (psAdapter->bDoSuspend == false) {
psAdapter->IdleMode = TRUE;
-   //since going in Idle mode completed hence 
making this var false;
+   /* since going in Idle mode completed hence 
making this var false; */
psAdapter->bPreparingForLowPowerMode = false ;
 
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, 
DBG_LVL_ALL, "Host Entered in Idle Mode State...");
-   //Signalling the cntrl pkt path in Ioctl
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, 
NEXT_SEND, DBG_LVL_ALL, "Host Entered in Idle Mode State...");
+   /* Signalling the cntrl pkt path in Ioctl */
wake_up(&psAdapter->lowpower_mode_wait_queue);
}
 
-   }
-   else if((pControlMsg->Leader.Status == LINK_UP_CONTROL_REQ) &&
+   } else if ((pControlMsg->Leader.Status == LINK_UP_CONTROL_REQ) 
&&
(pControlMsg->szData[0] == LINK_UP_ACK) &&
(pControlMsg->szData[1] == 
LINK_SHUTDOWN_REQ_FROM_FIRMWARE)  &&
-   (pControlMsg->szData[2] == SHUTDOWN_ACK_FROM_DRIVER))
-   {
-   //This covers the bus err while 

[PATCH 5/8] staging:bcm:InterfaceRx: fix checkpatch error

2013-12-13 Thread Gokulnath A
fixed all the errors found by checkpatch.pl

Signed-off-by: Gokulnath A 
---
 drivers/staging/bcm/InterfaceRx.c | 154 +++---
 1 file changed, 62 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceRx.c 
b/drivers/staging/bcm/InterfaceRx.c
index f2973f5..6c070ee 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -1,11 +1,11 @@
 #include "headers.h"
 
-static int SearchVcid(struct bcm_mini_adapter *Adapter,unsigned short usVcid)
+static int SearchVcid(struct bcm_mini_adapter *Adapter, unsigned short usVcid)
 {
-   int iIndex=0;
+   int iIndex = 0;
 
-   for(iIndex=(NO_OF_QUEUES-1);iIndex>=0;iIndex--)
-   if(Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
+   for (iIndex = (NO_OF_QUEUES-1); iIndex >= 0; iIndex--)
+   if (Adapter->PackInfo[iIndex].usVCID_Value == usVcid)
return iIndex;
return NO_OF_QUEUES+1;
 
@@ -18,14 +18,13 @@ GetBulkInRcb(struct bcm_interface_adapter *psIntfAdapter)
struct bcm_usb_rcb *pRcb = NULL;
UINT index = 0;
 
-   if((atomic_read(&psIntfAdapter->uNumRcbUsed) < MAXIMUM_USB_RCB) &&
-   (psIntfAdapter->psAdapter->StopAllXaction == false))
-   {
+   if ((atomic_read(&psIntfAdapter->uNumRcbUsed) < MAXIMUM_USB_RCB) &&
+   (psIntfAdapter->psAdapter->StopAllXaction == false)) {
index = atomic_read(&psIntfAdapter->uCurrRcb);
pRcb = &psIntfAdapter->asUsbRcb[index];
pRcb->bUsed = TRUE;
-   pRcb->psIntfAdapter= psIntfAdapter;
-   BCM_DEBUG_PRINT(psIntfAdapter->psAdapter,DBG_TYPE_RX, RX_DPC, 
DBG_LVL_ALL, "Got Rx desc %d used %d",
+   pRcb->psIntfAdapter = psIntfAdapter;
+   BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_RX, RX_DPC, 
DBG_LVL_ALL, "Got Rx desc %d used %d",
index, atomic_read(&psIntfAdapter->uNumRcbUsed));
index = (index + 1) % MAXIMUM_USB_RCB;
atomic_set(&psIntfAdapter->uCurrRcb, index);
@@ -40,9 +39,8 @@ static void read_bulk_callback(struct urb *urb)
struct sk_buff *skb = NULL;
bool bHeaderSupressionEnabled = false;
int QueueIndex = NO_OF_QUEUES + 1;
-   UINT uiIndex=0;
+   UINT uiIndex = 0;
int process_done = 1;
-   //int idleflag = 0 ;
struct bcm_usb_rcb *pRcb = (struct bcm_usb_rcb *)urb->context;
struct bcm_interface_adapter *psIntfAdapter = pRcb->psIntfAdapter;
struct bcm_mini_adapter *Adapter = psIntfAdapter->psAdapter;
@@ -52,49 +50,40 @@ static void read_bulk_callback(struct urb *urb)
pr_info(PFX "%s: rx urb status %d length %d\n",
Adapter->dev->name, urb->status, urb->actual_length);
 
-   if((Adapter->device_removed == TRUE)  ||
+   if ((Adapter->device_removed == TRUE)  ||
(TRUE == Adapter->bEndPointHalted) ||
-   (0 == urb->actual_length)
-   )
-   {
-   pRcb->bUsed = false;
-   atomic_dec(&psIntfAdapter->uNumRcbUsed);
+   (0 == urb->actual_length)) {
+   pRcb->bUsed = false;
+   atomic_dec(&psIntfAdapter->uNumRcbUsed);
return;
}
 
-   if(urb->status != STATUS_SUCCESS)
-   {
-   if(urb->status == -EPIPE)
-   {
+   if (urb->status != STATUS_SUCCESS) {
+   if (urb->status == -EPIPE) {
Adapter->bEndPointHalted = TRUE ;
wake_up(&Adapter->tx_packet_wait_queue);
-   }
-   else
-   {
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, 
DBG_LVL_ALL,"Rx URB has got cancelled. status :%d", urb->status);
+   } else {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, 
DBG_LVL_ALL, "Rx URB has got cancelled. status :%d", urb->status);
}
pRcb->bUsed = false;
-   atomic_dec(&psIntfAdapter->uNumRcbUsed);
+   atomic_dec(&psIntfAdapter->uNumRcbUsed);
urb->status = STATUS_SUCCESS ;
return ;
}
 
-   if(Adapter->bDoSuspend && (Adapter->bPreparingForLowPowerMode))
-   {
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, 
DBG_LVL_ALL,"device is going in low power mode while PMU option selected..hence 
rx packet should not be process");
+   if (Adapter->bDoSuspend && (Adapter->bPreparingForLowPowerMode)) {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, 
"device is going in low power mode while PMU option selected..hence rx packet 
should not be process");
return ;
}
 
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Read back 
done len %d\n", pLeader->PLength);
-   if(!pLeader->PLength)
-   {
-   BCM_DE

[PATCH 4/8] staging:bcm:InterfaceIsr: fix checkpatch error

2013-12-13 Thread Gokulnath A
fixed all the errors found by checkpatch.pl

Signed-off-by: Gokulnath A 
---
 drivers/staging/bcm/InterfaceIsr.c | 107 -
 1 file changed, 45 insertions(+), 62 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceIsr.c 
b/drivers/staging/bcm/InterfaceIsr.c
index 7b39f4f..6a59949 100644
--- a/drivers/staging/bcm/InterfaceIsr.c
+++ b/drivers/staging/bcm/InterfaceIsr.c
@@ -11,101 +11,89 @@ static void read_int_callback(struct urb *urb/*, struct 
pt_regs *regs*/)
pr_info(PFX "%s: interrupt status %d\n",
Adapter->dev->name, status);
 
-   if(Adapter->device_removed == TRUE)
-   {
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, 
DBG_LVL_ALL,"Device has Got Removed.");
+   if (Adapter->device_removed == TRUE) {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT, 
DBG_LVL_ALL, "Device has Got Removed.");
return ;
}
 
-   if(((Adapter->bPreparingForLowPowerMode == TRUE) && 
(Adapter->bDoSuspend == TRUE)) ||
+   if (((Adapter->bPreparingForLowPowerMode == TRUE) && 
(Adapter->bDoSuspend == TRUE)) ||
psIntfAdapter->bSuspended ||
-   psIntfAdapter->bPreparingForBusSuspend)
-   {
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, 
DBG_LVL_ALL,"Interrupt call back is called while suspending the device");
+   psIntfAdapter->bPreparingForBusSuspend) {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT, 
DBG_LVL_ALL,
+   "Interrupt call back is called while suspending the 
device");
return ;
}
 
-   //BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL, 
"interrupt urb status %d", status);
switch (status) {
-   /* success */
-   case STATUS_SUCCESS:
-   if ( urb->actual_length )
-   {
+   case STATUS_SUCCESS:
+   if (urb->actual_length) {
 
-   if(psIntfAdapter->ulInterruptData[1] & 0xFF)
-   {
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, 
INTF_INIT, DBG_LVL_ALL, "Got USIM interrupt");
+   if (psIntfAdapter->ulInterruptData[1] & 0xFF) {
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, 
INTF_INIT, DBG_LVL_ALL,  "Got USIM interrupt");
}
 
-   if(psIntfAdapter->ulInterruptData[1] & 0xFF00)
-   {
+   if (psIntfAdapter->ulInterruptData[1] & 0xFF00) {
atomic_set(&Adapter->CurrNumFreeTxDesc,
(psIntfAdapter->ulInterruptData[1] & 
0xFF00) >> 8);
atomic_set (&Adapter->uiMBupdate, TRUE);
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, 
INTF_INIT, DBG_LVL_ALL, "TX mailbox contains %d",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, 
INTF_INIT, DBG_LVL_ALL, "TX mailbox contains %d",

atomic_read(&Adapter->CurrNumFreeTxDesc));
}
-   if(psIntfAdapter->ulInterruptData[1] >> 16)
-   {
-   Adapter->CurrNumRecvDescs=
+   if (psIntfAdapter->ulInterruptData[1] >> 16) {
+   Adapter->CurrNumRecvDescs =
(psIntfAdapter->ulInterruptData[1]  >> 
16);
-   BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, 
INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d",
+   BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, 
INTF_INIT, DBG_LVL_ALL, "RX mailbox contains %d",
Adapter->CurrNumRecvDescs);
InterfaceRx(psIntfAdapter);
}
-   if(Adapter->fw_download_done &&
+   if (Adapter->fw_download_done &&
!Adapter->downloadDDR &&
-   atomic_read(&Adapter->CurrNumFreeTxDesc))
-   {
-   psIntfAdapter->psAdapter->downloadDDR +=1;
+   atomic_read(&Adapter->CurrNumFreeTxDesc)) {
+   psIntfAdapter->psAdapter->downloadDDR += 1;
wake_up(&Adapter->tx_packet_wait_queue);
}
-   if(false == Adapter->waiting_to_fw_download_done)
-   {
+   if (false == Adapter->waiting_to_fw_download_done) {
Adapter->waiting_to_fw_download_done = TRUE;
wake_up(&Adapter->ioctl_fw_dnld_wait_queue);
}
-   if(!atomic_r

[PATCH 8/8] staging:bcm:Qos: fix checkpatch error

2013-12-13 Thread Gokulnath A
fixed all the errors found by checkpatch.pl

Signed-off-by: Gokulnath A 
---
 drivers/staging/bcm/Qos.c | 255 +-
 1 file changed, 95 insertions(+), 160 deletions(-)

diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c
index 1609a2b..417dedf 100644
--- a/drivers/staging/bcm/Qos.c
+++ b/drivers/staging/bcm/Qos.c
@@ -5,7 +5,7 @@ This file contains the routines related to Quality of Service.
 #include "headers.h"
 
 static void EThCSGetPktInfo(struct bcm_mini_adapter *Adapter, PVOID 
pvEthPayload, struct bcm_eth_packet_info *pstEthCsPktInfo);
-static bool EThCSClassifyPkt(struct bcm_mini_adapter *Adapter, struct sk_buff* 
skb, struct bcm_eth_packet_info *pstEthCsPktInfo, struct bcm_classifier_rule 
*pstClassifierRule, B_UINT8 EthCSCupport);
+static bool EThCSClassifyPkt(struct bcm_mini_adapter *Adapter, struct sk_buff 
*skb, struct bcm_eth_packet_info *pstEthCsPktInfo, struct bcm_classifier_rule 
*pstClassifierRule, B_UINT8 EthCSCupport);
 
 static USHORT  IpVersion4(struct bcm_mini_adapter *Adapter, struct iphdr *iphd,
   struct bcm_classifier_rule *pstClassifierRule);
@@ -33,12 +33,10 @@ bool MatchSrcIpAddress(struct bcm_classifier_rule 
*pstClassifierRule, ULONG ulSr
ulSrcIP = ntohl(ulSrcIP);
if (0 == pstClassifierRule->ucIPSourceAddressLength)
return TRUE;
-   for (ucLoopIndex = 0; ucLoopIndex < 
(pstClassifierRule->ucIPSourceAddressLength); ucLoopIndex++)
-   {
+   for (ucLoopIndex = 0; ucLoopIndex < 
(pstClassifierRule->ucIPSourceAddressLength); ucLoopIndex++) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, 
"Src Ip Address Mask:0x%x PacketIp:0x%x and Classification:0x%x", 
(UINT)pstClassifierRule->stSrcIpAddress.ulIpv4Mask[ucLoopIndex], (UINT)ulSrcIP, 
(UINT)pstClassifierRule->stSrcIpAddress.ulIpv6Addr[ucLoopIndex]);
if ((pstClassifierRule->stSrcIpAddress.ulIpv4Mask[ucLoopIndex] 
& ulSrcIP) ==
-   
(pstClassifierRule->stSrcIpAddress.ulIpv4Addr[ucLoopIndex] & 
pstClassifierRule->stSrcIpAddress.ulIpv4Mask[ucLoopIndex]))
-   {
+   
(pstClassifierRule->stSrcIpAddress.ulIpv4Addr[ucLoopIndex] & 
pstClassifierRule->stSrcIpAddress.ulIpv4Mask[ucLoopIndex])) {
return TRUE;
}
}
@@ -68,11 +66,9 @@ bool MatchDestIpAddress(struct bcm_classifier_rule 
*pstClassifierRule, ULONG ulD
return TRUE;
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, 
"Destination Ip Address 0x%x 0x%x 0x%x  ", (UINT)ulDestIP, 
(UINT)pstClassifierRule->stDestIpAddress.ulIpv4Mask[ucLoopIndex], 
(UINT)pstClassifierRule->stDestIpAddress.ulIpv4Addr[ucLoopIndex]);
 
-   for (ucLoopIndex = 0; ucLoopIndex < 
(pstClassifierRule->ucIPDestinationAddressLength); ucLoopIndex++)
-   {
+   for (ucLoopIndex = 0; ucLoopIndex < 
(pstClassifierRule->ucIPDestinationAddressLength); ucLoopIndex++) {
if ((pstClassifierRule->stDestIpAddress.ulIpv4Mask[ucLoopIndex] 
& ulDestIP) ==
-   
(pstClassifierRule->stDestIpAddress.ulIpv4Addr[ucLoopIndex] & 
pstClassifierRule->stDestIpAddress.ulIpv4Mask[ucLoopIndex]))
-   {
+   
(pstClassifierRule->stDestIpAddress.ulIpv4Addr[ucLoopIndex] & 
pstClassifierRule->stDestIpAddress.ulIpv4Mask[ucLoopIndex])) {
return TRUE;
}
}
@@ -98,8 +94,7 @@ bool MatchTos(struct bcm_classifier_rule *pstClassifierRule, 
UCHAR ucTypeOfServi
if (3 != pstClassifierRule->ucIPTypeOfServiceLength)
return TRUE;
 
-   if (((pstClassifierRule->ucTosMask & ucTypeOfService) <= 
pstClassifierRule->ucTosHigh) && ((pstClassifierRule->ucTosMask & 
ucTypeOfService) >= pstClassifierRule->ucTosLow))
-   {
+   if (((pstClassifierRule->ucTosMask & ucTypeOfService) <= 
pstClassifierRule->ucTosHigh) && ((pstClassifierRule->ucTosMask & 
ucTypeOfService) >= pstClassifierRule->ucTosLow)) {
return TRUE;
}
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Type Of 
Service Not Matched");
@@ -123,11 +118,9 @@ bool MatchProtocol(struct bcm_classifier_rule 
*pstClassifierRule, UCHAR ucProtoc
struct bcm_mini_adapter *Adapter = GET_BCM_ADAPTER(gblpnetdev);
if (0 == pstClassifierRule->ucProtocolLength)
return TRUE;
-   for (ucLoopIndex = 0; ucLoopIndex < 
pstClassifierRule->ucProtocolLength; ucLoopIndex++)
-   {
+   for (ucLoopIndex = 0; ucLoopIndex < 
pstClassifierRule->ucProtocolLength; ucLoopIndex++) {
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, 
"Protocol:0x%X Classification Protocol:0x%X", ucProtocol, 
pstClassifierRule->ucProtocol[ucLoopIndex]);
-   if (pstClassifierRule->ucProtocol[ucLoopIndex] == ucProtocol)
-   {
+   if (pstC

[PATCH 7/8] staging:bcm:hostmibs: fix checkpatch error

2013-12-13 Thread Gokulnath A
fixed all the errors found by checkpatch.pl

Signed-off-by: Gokulnath A 
---
 drivers/staging/bcm/hostmibs.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/bcm/hostmibs.c b/drivers/staging/bcm/hostmibs.c
index f55300d..38acfe3 100644
--- a/drivers/staging/bcm/hostmibs.c
+++ b/drivers/staging/bcm/hostmibs.c
@@ -27,9 +27,9 @@ INT ProcessGetHostMibs(struct bcm_mini_adapter *Adapter, 
struct bcm_host_stats_m
/* Copy the classifier Table */
for (nClassifierIndex = 0; nClassifierIndex < MAX_CLASSIFIERS; 
nClassifierIndex++) {
if (Adapter->astClassifierTable[nClassifierIndex].bUsed == TRUE)
-   memcpy((PVOID) & pstHostMibs->
+   memcpy((PVOID)&pstHostMibs->
   astClassifierTable[nClassifierIndex],
-  (PVOID) & Adapter->
+  (PVOID)&Adapter->
   astClassifierTable[nClassifierIndex],
   sizeof(struct bcm_mibs_classifier_rule));
}
@@ -37,8 +37,8 @@ INT ProcessGetHostMibs(struct bcm_mini_adapter *Adapter, 
struct bcm_host_stats_m
/* Copy the SF Table */
for (nSfIndex = 0; nSfIndex < NO_OF_QUEUES; nSfIndex++) {
if (Adapter->PackInfo[nSfIndex].bValid) {
-   memcpy((PVOID) & pstHostMibs->astSFtable[nSfIndex],
-  (PVOID) & Adapter->PackInfo[nSfIndex],
+   memcpy((PVOID)&pstHostMibs->astSFtable[nSfIndex],
+  (PVOID)&Adapter->PackInfo[nSfIndex],
sizeof(struct bcm_mibs_table));
} else {
/* If index in not valid,
-- 
1.8.1.2

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


[PATCH 3/8] staging:bcm:InterfaceInit: fix checkpatch error

2013-12-13 Thread Gokulnath A
fixed all the errors found by checkpatch.pl

Signed-off-by: Gokulnath A 
---
 drivers/staging/bcm/InterfaceInit.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/bcm/InterfaceInit.c 
b/drivers/staging/bcm/InterfaceInit.c
index 3acdb58..eaecb5b 100644
--- a/drivers/staging/bcm/InterfaceInit.c
+++ b/drivers/staging/bcm/InterfaceInit.c
@@ -360,36 +360,36 @@ static inline int bcm_usb_endpoint_type(const struct 
usb_endpoint_descriptor *ep
 
 static inline int bcm_usb_endpoint_dir_in(const struct usb_endpoint_descriptor 
*epd)
 {
-   return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
+   return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN;
 }
 
 static inline int bcm_usb_endpoint_dir_out(const struct 
usb_endpoint_descriptor *epd)
 {
-   return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
+   return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT;
 }
 
 static inline int bcm_usb_endpoint_xfer_bulk(const struct 
usb_endpoint_descriptor *epd)
 {
-   return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-   USB_ENDPOINT_XFER_BULK);
+   return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+   USB_ENDPOINT_XFER_BULK;
 }
 
 static inline int bcm_usb_endpoint_xfer_control(const struct 
usb_endpoint_descriptor *epd)
 {
-   return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-   USB_ENDPOINT_XFER_CONTROL);
+   return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+   USB_ENDPOINT_XFER_CONTROL;
 }
 
 static inline int bcm_usb_endpoint_xfer_int(const struct 
usb_endpoint_descriptor *epd)
 {
-   return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-   USB_ENDPOINT_XFER_INT);
+   return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+   USB_ENDPOINT_XFER_INT;
 }
 
 static inline int bcm_usb_endpoint_xfer_isoc(const struct 
usb_endpoint_descriptor *epd)
 {
-   return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
-   USB_ENDPOINT_XFER_ISOC);
+   return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+   USB_ENDPOINT_XFER_ISOC;
 }
 
 static inline int bcm_usb_endpoint_is_bulk_in(const struct 
usb_endpoint_descriptor *epd)
-- 
1.8.1.2

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


RE: [PATCH net] netvsc: don't flush peers notifying work during setting mtu

2013-12-13 Thread Haiyang Zhang


> -Original Message-
> From: Jason Wang [mailto:jasow...@redhat.com]
> Sent: Friday, December 13, 2013 4:21 AM
> To: KY Srinivasan; Haiyang Zhang; de...@linuxdriverproject.org;
> net...@vger.kernel.org; linux-ker...@vger.kernel.org
> Cc: Jason Wang
> Subject: [PATCH net] netvsc: don't flush peers notifying work during setting
> mtu
> 
> There's a possible deadlock if we flush the peers notifying work during
> setting
> mtu:
> 
> [   22.991149]
> ==
> [   22.991173] [ INFO: possible circular locking dependency detected ]
> [   22.991198] 3.10.0-54.0.1.el7.x86_64.debug #1 Not tainted
> [   22.991219] ---
> [   22.991243] ip/974 is trying to acquire lock:
> [   22.991261]  ((&(&net_device_ctx->dwork)->work)){+.+.+.}, at:
> [] flush_work+0x5/0x2e0
> [   22.991307]
> but task is already holding lock:
> [   22.991330]  (rtnl_mutex){+.+.+.}, at: []
> rtnetlink_rcv+0x1b/0x40
> [   22.991367]
> which lock already depends on the new lock.
> 
> [   22.991398]
> the existing dependency chain (in reverse order) is:
> [   22.991426]
> -> #1 (rtnl_mutex){+.+.+.}:
> [   22.991449][] __lock_acquire+0xb19/0x1260
> [   22.991477][] lock_acquire+0xa2/0x1f0
> [   22.991501][] mutex_lock_nested+0x89/0x4f0
> [   22.991529][] rtnl_lock+0x17/0x20
> [   22.991552][] netdev_notify_peers+0x12/0x30
> [   22.991579][] netvsc_send_garp+0x22/0x30
> [hv_netvsc]
> [   22.991610][] process_one_work+0x211/0x6e0
> [   22.991637][] worker_thread+0x11b/0x3a0
> [   22.991663][] kthread+0xed/0x100
> [   22.991686][] ret_from_fork+0x7c/0xb0
> [   22.991715]
> -> #0 ((&(&net_device_ctx->dwork)->work)){+.+.+.}:
> [   22.991715][] check_prevs_add+0x967/0x970
> [   22.991715][] __lock_acquire+0xb19/0x1260
> [   22.991715][] lock_acquire+0xa2/0x1f0
> [   22.991715][] flush_work+0x4e/0x2e0
> [   22.991715][] __cancel_work_timer+0x95/0x130
> [   22.991715][] cancel_delayed_work_sync+0x13/0x20
> [   22.991715][] netvsc_change_mtu+0x84/0x200
> [hv_netvsc]
> [   22.991715][] dev_set_mtu+0x34/0x80
> [   22.991715][] do_setlink+0x23a/0xa00
> [   22.991715][] rtnl_newlink+0x394/0x5e0
> [   22.991715][] rtnetlink_rcv_msg+0x9c/0x260
> [   22.991715][] netlink_rcv_skb+0xa9/0xc0
> [   22.991715][] rtnetlink_rcv+0x2a/0x40
> [   22.991715][] netlink_unicast+0xdd/0x190
> [   22.991715][] netlink_sendmsg+0x337/0x750
> [   22.991715][] sock_sendmsg+0x99/0xd0
> [   22.991715][] ___sys_sendmsg+0x39e/0x3b0
> [   22.991715][] __sys_sendmsg+0x42/0x80
> [   22.991715][] SyS_sendmsg+0x12/0x20
> [   22.991715][] system_call_fastpath+0x16/0x1b
> 
> This is because we hold the rtnl_lock() before ndo_change_mtu() and try to
> flush the work in netvsc_change_mtu(), in the mean time,
> netdev_notify_peers() may be called from worker and also trying to hold the
> rtnl_lock. This will lead the flush won't succeed forever. Solve this by not
> canceling and flushing the work, this is safe because the transmission done
> by NETDEV_NOTIFY_PEERS was synchronized with the netif_tx_disable()
> called by netvsc_change_mtu().
> 
> Reported-by: Yaju Cao 
> Tested-by: Yaju Cao 
> Cc: K. Y. Srinivasan 
> Cc: Haiyang Zhang 
> Signed-off-by: Jason Wang 

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


Re: [PATCH 2/8] staging:bcm:InterfaceIdleMode: fix checkpatch error

2013-12-13 Thread Dan Carpenter
On Sat, Dec 14, 2013 at 01:05:30AM +0530, Gokulnath A wrote:
>   if (0xbece3200 == (chip_id&~(0xF0)))
> - chip_id = chip_id&~(0xF0);
> + chip_id = chip_id&~(0xF01);
>   if (chip_id == Adapter->chip_id)
>   break;

You have introduced a bug here.

regards,
dan carpenter

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


Re: [PATCH 1/8] staging:bcm:InterfaceDld: fix checkpatch error

2013-12-13 Thread Dan Carpenter
On Sat, Dec 14, 2013 at 01:05:29AM +0530, Gokulnath A wrote:
> fixed all the errors found by checkpatch.pl
> 

This is not very useful.  The subjects of this patch series could be
improved as well.

> Signed-off-by: Gokulnath A 
> ---
>  drivers/staging/bcm/InterfaceDld.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/bcm/InterfaceDld.c 
> b/drivers/staging/bcm/InterfaceDld.c
> index 463bdee..a8d0063 100644
> --- a/drivers/staging/bcm/InterfaceDld.c
> +++ b/drivers/staging/bcm/InterfaceDld.c
> @@ -115,7 +115,7 @@ int InterfaceFileReadbackFromChip(PVOID arg, struct file 
> *flp, unsigned int on_c
>   while (len) {
>   if (*(unsigned int *)&buff_readback[len] != 
> *(unsigned int *)&buff[len]) {
>   
> BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, MP_INIT, 
> DBG_LVL_ALL, "Firmware Download is not proper %d", fw_down);
> - 
> BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, MP_INIT, 
> DBG_LVL_ALL, "Val from Binary %x, Val From Read Back %x ", *(unsigned int 
> *)&buff[len], *(unsigned int*)&buff_readback[len]);
> + 
> BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, MP_INIT, 
> DBG_LVL_ALL, "Val from Binary %x, Val From Read Back %x ", *(unsigned int 
> *)&buff[len], *(unsigned int *)&buff_readback[len]);
>   
> BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, MP_INIT, 
> DBG_LVL_ALL, "len =%x!!!", len);

Really this whole block of text is garbage.  I'm not sure it makes sense
to worry about a tiny missing space when the whole block is so rubbish.
Fixing it up properly is a bit difficult, but it's really what we need.

regards,
dan carpenter


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


[PATCH] Staging: rts5139: fix parantheses coding style issue in ms.c

2013-12-13 Thread Preetam D'Souza
This patch fixes an unnecessary return statement parantheses error
found in ms.c by the checkpatch.pl tool.

Signed-off-by: Preetam D'Souza 
---
 drivers/staging/rts5139/ms.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rts5139/ms.c b/drivers/staging/rts5139/ms.c
index a27f7e2..9253f6a 100644
--- a/drivers/staging/rts5139/ms.c
+++ b/drivers/staging/rts5139/ms.c
@@ -48,7 +48,7 @@ static inline int ms_check_err_code(struct rts51x_chip *chip, 
u8 err_code)
 {
struct ms_info *ms_card = &(chip->ms_card);
 
-   return (ms_card->err_code == err_code);
+   return ms_card->err_code == err_code;
 }
 
 static int ms_parse_err_code(struct rts51x_chip *chip)
-- 
1.7.10.4

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