Re: [PATCH 0/4] staging: mt7621-gpio: fix problem using one node in DT

2018-07-04 Thread Sergio Paracuellos
On Thu, Jul 05, 2018 at 04:27:31PM +1000, NeilBrown wrote:
> On Thu, Jul 05 2018, Sergio Paracuellos wrote:
> 
> > This series fix problem related with the last changes included
> > to use only one node in the device tree and some gpio banks
> > naming issues.
> >
> > Hope this helps.
> 
> It sure does.  Everything looks and works as expected now.
> all:
>   Reviewed-by: NeilBrown 
> 
> Thanks a lot!

Thanks to you for your effort and support reviewing this.

I think we are ready for a new try to get this mainlined.

I'll try to do that tonight.

Best regards,
Sergio Paracuellos
> 
> NeilBrown
> 
> 
> >
> > Best regards,
> > Sergio Paracuellos
> >
> > Sergio Paracuellos (4):
> >   staging: mt7621-gpio: set irq chip name only once
> >   staging: mt7621-gpio: use custom xlate function
> >   staging: mt7621-gpio: assign gpio chip custom changes after bgpio_init
> >   staging: mt7621-gpio: use devm_kasprintf to set gpio banks labels
> >
> >  drivers/staging/mt7621-gpio/gpio-mt7621.c | 25 ++---
> >  1 file changed, 18 insertions(+), 7 deletions(-)
> >
> > -- 
> > 2.7.4


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


Re: [PATCH 0/4] staging: mt7621-gpio: fix problem using one node in DT

2018-07-04 Thread NeilBrown
On Thu, Jul 05 2018, Sergio Paracuellos wrote:

> This series fix problem related with the last changes included
> to use only one node in the device tree and some gpio banks
> naming issues.
>
> Hope this helps.

It sure does.  Everything looks and works as expected now.
all:
  Reviewed-by: NeilBrown 

Thanks a lot!

NeilBrown


>
> Best regards,
> Sergio Paracuellos
>
> Sergio Paracuellos (4):
>   staging: mt7621-gpio: set irq chip name only once
>   staging: mt7621-gpio: use custom xlate function
>   staging: mt7621-gpio: assign gpio chip custom changes after bgpio_init
>   staging: mt7621-gpio: use devm_kasprintf to set gpio banks labels
>
>  drivers/staging/mt7621-gpio/gpio-mt7621.c | 25 ++---
>  1 file changed, 18 insertions(+), 7 deletions(-)
>
> -- 
> 2.7.4


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


[PATCH 4/4] staging: mt7621-gpio: use devm_kasprintf to set gpio banks labels

2018-07-04 Thread Sergio Paracuellos
Instead of using a custom function to return desired name for gpio
use the default assigned one and concat it '-bankN' suffix using
devm_kasprintf kernel function.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/mt7621-gpio/gpio-mt7621.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c 
b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index 1b4588a..d7256b5 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -196,15 +196,6 @@ static struct irq_chip mediatek_gpio_irq_chip = {
.irq_set_type   = mediatek_gpio_irq_type,
 };
 
-static inline const char * const mediatek_gpio_bank_name(int bank)
-{
-   static const char * const bank_names[] = {
-   "mt7621-bank0", "mt7621-bank1", "mt7621-bank2",
-   };
-
-   return bank_names[bank];
-}
-
 static int
 mediatek_gpio_xlate(struct gpio_chip *chip,
const struct of_phandle_args *spec, u32 *flags)
@@ -251,7 +242,8 @@ mediatek_gpio_bank_probe(struct platform_device *pdev,
 
rg->chip.of_gpio_n_cells = 2;
rg->chip.of_xlate = mediatek_gpio_xlate;
-   rg->chip.label = mediatek_gpio_bank_name(rg->bank);
+   rg->chip.label = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s-bank%d",
+   dev_name(&pdev->dev), bank);
 
ret = devm_gpiochip_add_data(&pdev->dev, &rg->chip, gpio);
if (ret < 0) {
-- 
2.7.4

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


[PATCH 2/4] staging: mt7621-gpio: use custom xlate function

2018-07-04 Thread Sergio Paracuellos
The default gpio.of_xlate function assumes there is one gpio chip
for each devicetree node. Device tree had changed to only use one node,
which corresponds to 3 different gpio chips now. For that approach
to work we need a custom xlate function.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/mt7621-gpio/gpio-mt7621.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c 
b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index 06024a3..ccf2aa8 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -206,6 +206,22 @@ static inline const char * const 
mediatek_gpio_bank_name(int bank)
 }
 
 static int
+mediatek_gpio_xlate(struct gpio_chip *chip,
+   const struct of_phandle_args *spec, u32 *flags)
+{
+   int gpio = spec->args[0];
+   struct mtk_gc *rg = to_mediatek_gpio(chip);
+
+   if (rg->bank != gpio / MTK_BANK_WIDTH)
+   return -EINVAL;
+
+   if (flags)
+   *flags = spec->args[1];
+
+   return gpio % MTK_BANK_WIDTH;
+}
+
+static int
 mediatek_gpio_bank_probe(struct platform_device *pdev,
 struct device_node *node, int bank)
 {
@@ -220,6 +236,8 @@ mediatek_gpio_bank_probe(struct platform_device *pdev,
spin_lock_init(&rg->lock);
rg->chip.of_node = node;
rg->bank = bank;
+   rg->chip.of_gpio_n_cells = 2;
+   rg->chip.of_xlate = mediatek_gpio_xlate;
rg->chip.label = mediatek_gpio_bank_name(rg->bank);
 
dat = gpio->gpio_membase + GPIO_REG_DATA + (rg->bank * GPIO_BANK_WIDE);
-- 
2.7.4

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


[PATCH 1/4] staging: mt7621-gpio: set irq chip name only once

2018-07-04 Thread Sergio Paracuellos
There is only one irq chip so set its name only once
in driver probe function.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/mt7621-gpio/gpio-mt7621.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c 
b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index 281e621..06024a3 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -257,7 +257,6 @@ mediatek_gpio_bank_probe(struct platform_device *pdev,
return ret;
}
 
-   mediatek_gpio_irq_chip.name = rg->chip.label;
ret = gpiochip_irqchip_add(&rg->chip, &mediatek_gpio_irq_chip,
   0, handle_simple_irq, IRQ_TYPE_NONE);
if (ret) {
@@ -296,6 +295,7 @@ mediatek_gpio_probe(struct platform_device *pdev)
gpio_data->gpio_irq = irq_of_parse_and_map(np, 0);
gpio_data->dev = &pdev->dev;
platform_set_drvdata(pdev, gpio_data);
+   mediatek_gpio_irq_chip.name = dev_name(&pdev->dev);
 
for (i = 0; i < MTK_BANK_CNT; i++)
mediatek_gpio_bank_probe(pdev, np, i);
-- 
2.7.4

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


[PATCH 3/4] staging: mt7621-gpio: assign gpio chip custom changes after bgpio_init

2018-07-04 Thread Sergio Paracuellos
bgpio_init function set different data of the gpio chip, like the name.
We want specific name for each bank so to get that not overwritten
move all custom changes after the bgpio_init function call.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/mt7621-gpio/gpio-mt7621.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c 
b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index ccf2aa8..1b4588a 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -236,9 +236,6 @@ mediatek_gpio_bank_probe(struct platform_device *pdev,
spin_lock_init(&rg->lock);
rg->chip.of_node = node;
rg->bank = bank;
-   rg->chip.of_gpio_n_cells = 2;
-   rg->chip.of_xlate = mediatek_gpio_xlate;
-   rg->chip.label = mediatek_gpio_bank_name(rg->bank);
 
dat = gpio->gpio_membase + GPIO_REG_DATA + (rg->bank * GPIO_BANK_WIDE);
set = gpio->gpio_membase + GPIO_REG_DSET + (rg->bank * GPIO_BANK_WIDE);
@@ -252,6 +249,10 @@ mediatek_gpio_bank_probe(struct platform_device *pdev,
return ret;
}
 
+   rg->chip.of_gpio_n_cells = 2;
+   rg->chip.of_xlate = mediatek_gpio_xlate;
+   rg->chip.label = mediatek_gpio_bank_name(rg->bank);
+
ret = devm_gpiochip_add_data(&pdev->dev, &rg->chip, gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpio %d, ret=%d\n",
-- 
2.7.4

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


[PATCH 0/4] staging: mt7621-gpio: fix problem using one node in DT

2018-07-04 Thread Sergio Paracuellos
This series fix problem related with the last changes included
to use only one node in the device tree and some gpio banks
naming issues.

Hope this helps.

Best regards,
Sergio Paracuellos

Sergio Paracuellos (4):
  staging: mt7621-gpio: set irq chip name only once
  staging: mt7621-gpio: use custom xlate function
  staging: mt7621-gpio: assign gpio chip custom changes after bgpio_init
  staging: mt7621-gpio: use devm_kasprintf to set gpio banks labels

 drivers/staging/mt7621-gpio/gpio-mt7621.c | 25 ++---
 1 file changed, 18 insertions(+), 7 deletions(-)

-- 
2.7.4

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


[PATCH] staging: wilc1000: fix static checker warning to unlock mutex in wilc_deinit()

2018-07-04 Thread Ajay Singh
Fix for static checker warning inconsistent returns of
'hif_deinit_lock'(more details [1]).

"drivers/staging/wilc1000/host_interface.c:3390 wilc_deinit()
  warn: inconsistent returns 'hif_deinit_lock'."

Introduced in "ff52a57a7a42: staging: wilc1000: move the allocation of
cmd out of wilc_enqueue_cmd()".

[1]. https://www.spinics.net/lists/linux-driver-devel/msg114216.html

Reported-by: Dan Carpenter 
Signed-off-by: Ajay Singh 
---
 drivers/staging/wilc1000/host_interface.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 52c0c10..918d06e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3370,15 +3370,15 @@ int wilc_deinit(struct wilc_vif *vif)
struct host_if_msg *msg;
 
msg = wilc_alloc_work(vif, handle_hif_exit_work, true);
-   if (IS_ERR(msg))
-   return PTR_ERR(msg);
-
-   result = wilc_enqueue_work(msg);
-   if (result)
-   netdev_err(vif->ndev, "deinit : Error(%d)\n", result);
-   else
-   wait_for_completion(&msg->work_comp);
-   kfree(msg);
+   if (!IS_ERR(msg)) {
+   result = wilc_enqueue_work(msg);
+   if (result)
+   netdev_err(vif->ndev, "deinit : Error(%d)\n",
+  result);
+   else
+   wait_for_completion(&msg->work_comp);
+   kfree(msg);
+   }
destroy_workqueue(hif_workqueue);
}
 
-- 
2.7.4

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


Re: [PATCH v5 18/18] staging: mt7621-gpio: avoid use banks in device tree

2018-07-04 Thread Sergio Paracuellos
On Thu, Jul 05, 2018 at 10:51:39AM +1000, NeilBrown wrote:
> On Sat, Jun 30 2018, Sergio Paracuellos wrote:
> 
> > On Sat, Jun 30, 2018 at 7:47 AM, NeilBrown  wrote:
> >> On Mon, Jun 18 2018, Sergio Paracuellos wrote:
> >>
> >>> Banks shouldn't be defined in DT if number of resources
> >>> per bank is not variable. We actually know that this SoC
> >>> has three banks so take that into account in order to don't
> >>> overspecify the device tree. Device tree will only have one
> >>> node making it simple. Update device tree, binding doc and
> >>> code accordly.
> >>>
> >>> Signed-off-by: Sergio Paracuellos 
> >>
> >> I'm sorry that I've been silent one these for a while - busy any all
> >> that.
> >>
> >> This last patch doesn't work.  My test case works with all but this one
> >> applied, but this breaks it.  I haven't had a chance to look into why
> >> yet.  Sorry.
> >
> > Thanks for pointing this out. All of them were applied so I though
> > there were no problem at all with any of them.
> > We should revert the last one or wait to your feedback about what is
> > breaking it and send a new patch fixing the problem.
> >
> 
> OK, I finally made time to dig into this.
> The problem is that the default gpio.of_xlate function assumes there is
> one gpio chip for each devicetree node.  With this patch applied, the
> one device tree node corresponds to 3 different gpio chips.  For that to
> work we need an xlate function.
> See below for what I wrote to get it working.
> With this in place:
>  /sys/class/gpio still contains:
> exportgpiochip416  gpiochip448  gpiochip480  unexport
> 
> which is a little annoying, but unavoidable I guess.
> The labels on these are:
> 
> # grep . /sys/class/gpio/gpiochip4*/label
> /sys/class/gpio/gpiochip416/label:1e000600.gpio
> /sys/class/gpio/gpiochip448/label:1e000600.gpio
> /sys/class/gpio/gpiochip480/label:1e000600.gpio
> 
> .. all the same, which is not ideal.
> 
> Your attempt to change the names doesn't work because bgpio_init() sets
> the names itself.  If you move the assignment to rg->chip.label to
> *after* the call to bgpio_init(), the new names work:
> 
> #  grep . /sys/class/gpio/gpiochip4*/label
> /sys/class/gpio/gpiochip416/label:mt7621-bank2
> /sys/class/gpio/gpiochip448/label:mt7621-bank1
> /sys/class/gpio/gpiochip480/label:mt7621-bank0
> 
> Also with that change /proc/interrupts contains:
> 
>  17:  0  0  0  0  MIPS GIC  19  mt7621-bank0, 
> mt7621-bank1, mt7621-bank2
> 
> and
> 
>  26:  0  0  0  0  mt7621-bank2  18  reset
> 
> The first line looks good - though having "gpio" in the name might be
> good. Should they be 1e000600.gpio-bankN" ??
> 
> The second is a bit weird, as this isn't bank2.
> It probably makes sense to have "1e000600.gpio  18  reset" there...
> 
> There is only 1 irq chip, compared with 3 gpio chips, so a different
> name is appropriate.  I changed the irq chip name:
> 
>   mediatek_gpio_irq_chip.name = dev_name(&pdev->dev);
> 
> though maybe that assignment should go elsewhere - maybe in
> mediatek_gpio_probe() as it is only needed once.
> 
> 
> Thanks,
> NeilBrown
> 

Thanks for your time in looking into this and the explanation about
what is happening there, Neil.

I will send a new patch series including all the stuff pointed out here.

Best regards,
Sergio Paracuellos
> 
> 
> 
> 
> diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c 
> b/drivers/staging/mt7621-gpio/gpio-mt7621.c
> index 281e6214d543..814af9342d25 100644
> --- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
> +++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
> @@ -205,6 +205,22 @@ static inline const char * const 
> mediatek_gpio_bank_name(int bank)
>   return bank_names[bank];
>  }
>  
> +static int mediatek_gpio_xlate(struct gpio_chip *chip,
> +const struct of_phandle_args *spec,
> +u32 *flags)
> +{
> + int gpio = spec->args[0];
> + struct mtk_gc *rq = container_of(chip, struct mtk_gc, chip);
> +
> + if (rq->bank != gpio / MTK_BANK_WIDTH)
> + return -EINVAL;
> +
> + if (flags)
> + *flags = spec->args[1];
> +
> + return gpio % MTK_BANK_WIDTH;
> +}
> +
>  static int
>  mediatek_gpio_bank_probe(struct platform_device *pdev,
>struct device_node *node, int bank)
> @@ -221,6 +237,8 @@ mediatek_gpio_bank_probe(struct platform_device *pdev,
>   rg->chip.of_node = node;
>   rg->bank = bank;
>   rg->chip.label = mediatek_gpio_bank_name(rg->bank);
> + rg->chip.of_gpio_n_cells = 2;
> + rg->chip.of_xlate = mediatek_gpio_xlate;
>  
>   dat = gpio->gpio_membase + GPIO_REG_DATA + (rg->bank * GPIO_BANK_WIDE);
>   set = gpio->gpio_membase + GPIO_REG_DSET + (rg->bank * GPIO_BANK_WIDE);


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

[PATCH 3/3] drivers/speakup: kobjects : Fixed Coding issues -Debugging

2018-07-04 Thread Tamir Suliman
Updated printk() of i18n messages to include KERN_INFO facility level to 
improve debuggin.
then later noticed that I forgot to add a space on printk.

Signed-off-by: Tamir Suliman 
---
 drivers/staging/speakup/kobjects.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index 7e79f99..af664f0 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -740,7 +740,7 @@ static void report_msg_status(int reset, int received, int 
used,
snprintf(buf + (len - 1), sizeof(buf) - (len - 1),
 " with %d reject%s\n",
 rejected, rejected > 1 ? "s" : "");
-   printk(KERN_INFO "i18n messages rejected\n",buf);
+   printk(KERN_INFO "i18n messages rejected\n", buf);
}
 }
 
-- 
1.8.3.1

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


Re: [PATCH v5 18/18] staging: mt7621-gpio: avoid use banks in device tree

2018-07-04 Thread NeilBrown
On Sat, Jun 30 2018, Sergio Paracuellos wrote:

> On Sat, Jun 30, 2018 at 7:47 AM, NeilBrown  wrote:
>> On Mon, Jun 18 2018, Sergio Paracuellos wrote:
>>
>>> Banks shouldn't be defined in DT if number of resources
>>> per bank is not variable. We actually know that this SoC
>>> has three banks so take that into account in order to don't
>>> overspecify the device tree. Device tree will only have one
>>> node making it simple. Update device tree, binding doc and
>>> code accordly.
>>>
>>> Signed-off-by: Sergio Paracuellos 
>>
>> I'm sorry that I've been silent one these for a while - busy any all
>> that.
>>
>> This last patch doesn't work.  My test case works with all but this one
>> applied, but this breaks it.  I haven't had a chance to look into why
>> yet.  Sorry.
>
> Thanks for pointing this out. All of them were applied so I though
> there were no problem at all with any of them.
> We should revert the last one or wait to your feedback about what is
> breaking it and send a new patch fixing the problem.
>

OK, I finally made time to dig into this.
The problem is that the default gpio.of_xlate function assumes there is
one gpio chip for each devicetree node.  With this patch applied, the
one device tree node corresponds to 3 different gpio chips.  For that to
work we need an xlate function.
See below for what I wrote to get it working.
With this in place:
 /sys/class/gpio still contains:
export  gpiochip416  gpiochip448  gpiochip480  unexport

which is a little annoying, but unavoidable I guess.
The labels on these are:

# grep . /sys/class/gpio/gpiochip4*/label
/sys/class/gpio/gpiochip416/label:1e000600.gpio
/sys/class/gpio/gpiochip448/label:1e000600.gpio
/sys/class/gpio/gpiochip480/label:1e000600.gpio

.. all the same, which is not ideal.

Your attempt to change the names doesn't work because bgpio_init() sets
the names itself.  If you move the assignment to rg->chip.label to
*after* the call to bgpio_init(), the new names work:

#  grep . /sys/class/gpio/gpiochip4*/label
/sys/class/gpio/gpiochip416/label:mt7621-bank2
/sys/class/gpio/gpiochip448/label:mt7621-bank1
/sys/class/gpio/gpiochip480/label:mt7621-bank0

Also with that change /proc/interrupts contains:

 17:  0  0  0  0  MIPS GIC  19  mt7621-bank0, 
mt7621-bank1, mt7621-bank2

and

 26:  0  0  0  0  mt7621-bank2  18  reset

The first line looks good - though having "gpio" in the name might be
good. Should they be 1e000600.gpio-bankN" ??

The second is a bit weird, as this isn't bank2.
It probably makes sense to have "1e000600.gpio  18  reset" there...

There is only 1 irq chip, compared with 3 gpio chips, so a different
name is appropriate.  I changed the irq chip name:

mediatek_gpio_irq_chip.name = dev_name(&pdev->dev);

though maybe that assignment should go elsewhere - maybe in
mediatek_gpio_probe() as it is only needed once.


Thanks,
NeilBrown





diff --git a/drivers/staging/mt7621-gpio/gpio-mt7621.c 
b/drivers/staging/mt7621-gpio/gpio-mt7621.c
index 281e6214d543..814af9342d25 100644
--- a/drivers/staging/mt7621-gpio/gpio-mt7621.c
+++ b/drivers/staging/mt7621-gpio/gpio-mt7621.c
@@ -205,6 +205,22 @@ static inline const char * const 
mediatek_gpio_bank_name(int bank)
return bank_names[bank];
 }
 
+static int mediatek_gpio_xlate(struct gpio_chip *chip,
+  const struct of_phandle_args *spec,
+  u32 *flags)
+{
+   int gpio = spec->args[0];
+   struct mtk_gc *rq = container_of(chip, struct mtk_gc, chip);
+
+   if (rq->bank != gpio / MTK_BANK_WIDTH)
+   return -EINVAL;
+
+   if (flags)
+   *flags = spec->args[1];
+
+   return gpio % MTK_BANK_WIDTH;
+}
+
 static int
 mediatek_gpio_bank_probe(struct platform_device *pdev,
 struct device_node *node, int bank)
@@ -221,6 +237,8 @@ mediatek_gpio_bank_probe(struct platform_device *pdev,
rg->chip.of_node = node;
rg->bank = bank;
rg->chip.label = mediatek_gpio_bank_name(rg->bank);
+   rg->chip.of_gpio_n_cells = 2;
+   rg->chip.of_xlate = mediatek_gpio_xlate;
 
dat = gpio->gpio_membase + GPIO_REG_DATA + (rg->bank * GPIO_BANK_WIDE);
set = gpio->gpio_membase + GPIO_REG_DSET + (rg->bank * GPIO_BANK_WIDE);


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


Re: [PATCH 1/2] FBTFT: fb_sh: Fix alignment and style problems Fixed Coding style issues Signed-off-by: Tamir Suliman

2018-07-04 Thread Tamir Suliman
Yes I did ..the misalignment and indentations were not intentional 
forgot to fix that but It was added to the patch.. will fix that on v 2  
my first patch still working on how to do things properly :(


On a different note , I made some changes to the function.

Thanks for your message.


On 6/30/2018 7:20 PM, Joe Perches wrote:

On Sat, 2018-06-30 at 14:32 +, Tamir Suliman wrote:

---
  drivers/staging/fbtft/fb_sh1106.c | 26 +-
  1 file changed, 13 insertions(+), 13 deletions(-)

Adding to what Greg's patchbot already wrote:


diff --git a/drivers/staging/fbtft/fb_sh1106.c 
b/drivers/staging/fbtft/fb_sh1106.c

[]

@@ -36,27 +36,27 @@ static int init_display(struct fbtft_par *par)
par->fbtftops.reset(par);
  
  	/* Set Display OFF */

-   write_reg(par, 0xAE);
+   write_reg(par, 0xAE);


Nope.

You are overly indenting already correctly indented code.
Statements start in the same column unless following an
if/for/do/while/else/case.


@@ -89,8 +89,8 @@ static void set_addr_win(struct fbtft_par *par, int xs, int 
ys, int xe, int ye)
  
  static int blank(struct fbtft_par *par, bool on)

  {
-   fbtft_par_dbg(DEBUG_BLANK, par, "%s(blank=%s)\n",
- __func__, on ? "true" : "false");
+   fbtft_par_dbg(DEBUG_BLANK, par, "%s(_func_=%s)\n",
+   __func__, on ? "true" : "false");

Again, nope.

Here you are misaligning a multi-line continuation
which is correctly aligned to the open parenthesis.



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


Re: [PATCH 3/3] drivers/speakup: Fix style and coding warnings

2018-07-04 Thread Tamir Suliman


Interesting construct...  Yeah I'm little bit rusty on my C 
/programming  . I understand  proper coding style may be should end with 
else so I wasn't sure .. however this resolved the warnings. :)



Did you compile this?


Yes I did compile  however the only issue i found when I'm compiling is  
modules symvers missing messages researched online and found couple of 
articles that recommended  to  run full kernel build . Please bear with 
me I'm new to this and very excited about learning and contributing.




On 7/3/2018 11:10 AM, Justin Skists wrote:

On 03 July 2018 at 08:31 Tamir Suliman  wrote:
+++ b/drivers/staging/speakup/keyhelp.c
@@ -167,7 +167,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char 
ch, u_short key)
synth_printf("%s\n", spk_msg_get(MSG_HELP_INFO));
build_key_data(); /* rebuild each time in case new mapping */
return 1;
-   } else {
+   } else if {

Interesting construct...



@@ -787,7 +787,7 @@ static ssize_t message_store_helper(const char *buf, size_t 
count,
continue;
}
  
-		index = simple_strtoul(cp, &temp, 10);

+   index = simple_ktrtoul(cp, &temp, 10);

Did you compile this?


Justin.


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


[PATCH] drivers/staging/gasket: Use 2-factor allocator calls

2018-07-04 Thread Kees Cook
As already done treewide, switch from open-coded multiplication to using
2-factor allocator helpers.

Signed-off-by: Kees Cook 
---
 drivers/staging/gasket/gasket_core.c   |  6 +++---
 drivers/staging/gasket/gasket_interrupt.c  | 15 +--
 drivers/staging/gasket/gasket_page_table.c |  6 +++---
 drivers/staging/gasket/gasket_sysfs.c  | 12 ++--
 4 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/gasket/gasket_core.c 
b/drivers/staging/gasket/gasket_core.c
index 6511a33eb658..82b3eca7774e 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -1697,9 +1697,9 @@ static int gasket_mmap(struct file *filp, struct 
vm_area_struct *vma)
return -EPERM;
}
num_map_regions = bar_desc->num_mappable_regions;
-   map_regions = kzalloc(
-   num_map_regions * sizeof(*bar_desc->mappable_regions),
-   GFP_KERNEL);
+   map_regions = kcalloc(num_map_regions,
+ sizeof(*bar_desc->mappable_regions),
+ GFP_KERNEL);
if (map_regions) {
memcpy(map_regions, bar_desc->mappable_regions,
   num_map_regions *
diff --git a/drivers/staging/gasket/gasket_interrupt.c 
b/drivers/staging/gasket/gasket_interrupt.c
index b74eefe41d72..1fd7bee5db2f 100644
--- a/drivers/staging/gasket/gasket_interrupt.c
+++ b/drivers/staging/gasket/gasket_interrupt.c
@@ -136,23 +136,26 @@ int gasket_interrupt_init(
interrupt_data->wire_interrupt_offsets = wire_int_offsets;
 
/* Allocate all dynamic structures. */
-   interrupt_data->msix_entries = kzalloc(
-   sizeof(struct msix_entry) * num_interrupts, GFP_KERNEL);
+   interrupt_data->msix_entries = kcalloc(num_interrupts,
+  sizeof(struct msix_entry),
+  GFP_KERNEL);
if (!interrupt_data->msix_entries) {
kfree(interrupt_data);
return -ENOMEM;
}
 
-   interrupt_data->eventfd_ctxs = kzalloc(
-   sizeof(struct eventfd_ctx *) * num_interrupts, GFP_KERNEL);
+   interrupt_data->eventfd_ctxs = kcalloc(num_interrupts,
+  sizeof(struct eventfd_ctx *),
+  GFP_KERNEL);
if (!interrupt_data->eventfd_ctxs) {
kfree(interrupt_data->msix_entries);
kfree(interrupt_data);
return -ENOMEM;
}
 
-   interrupt_data->interrupt_counts = kzalloc(
-   sizeof(ulong) * num_interrupts, GFP_KERNEL);
+   interrupt_data->interrupt_counts = kcalloc(num_interrupts,
+  sizeof(ulong),
+  GFP_KERNEL);
if (!interrupt_data->interrupt_counts) {
kfree(interrupt_data->eventfd_ctxs);
kfree(interrupt_data->msix_entries);
diff --git a/drivers/staging/gasket/gasket_page_table.c 
b/drivers/staging/gasket/gasket_page_table.c
index 6dc10508b15e..c5390a860f86 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -1674,9 +1674,9 @@ int gasket_alloc_coherent_memory(struct gasket_dev 
*gasket_dev, u64 size,
gasket_dev->page_table[index]->num_coherent_pages = num_pages;
 
/* allocate the physical memory block */
-   gasket_dev->page_table[index]->coherent_pages = kzalloc(
-   num_pages * sizeof(struct gasket_coherent_page_entry),
-   GFP_KERNEL);
+   gasket_dev->page_table[index]->coherent_pages =
+   kcalloc(num_pages, sizeof(struct gasket_coherent_page_entry),
+   GFP_KERNEL);
if (!gasket_dev->page_table[index]->coherent_pages)
goto nomem;
*dma_address = 0;
diff --git a/drivers/staging/gasket/gasket_sysfs.c 
b/drivers/staging/gasket/gasket_sysfs.c
index d45098c90b4b..40268fb50fc3 100644
--- a/drivers/staging/gasket/gasket_sysfs.c
+++ b/drivers/staging/gasket/gasket_sysfs.c
@@ -137,9 +137,9 @@ static void put_mapping(struct gasket_sysfs_mapping 
*mapping)
device = mapping->device;
legacy_device = mapping->legacy_device;
num_files_to_remove = mapping->attribute_count;
-   files_to_remove = kzalloc(
-   num_files_to_remove * sizeof(*files_to_remove),
-   GFP_KERNEL);
+   files_to_remove = kcalloc(num_files_to_remove,
+ sizeof(*files_to_remove),
+ GFP_KERNEL);
for (i = 0; i < num_files_to_remove; i++)
files_to_remove[i] = mapping->attributes

Re: [PATCH v6 2/4] resource: Use list_head to link sibling resource

2018-07-04 Thread kbuild test robot
Hi Baoquan,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.18-rc3 next-20180704]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Baoquan-He/resource-Use-list_head-to-link-sibling-resource/20180704-121402
config: mips-rb532_defconfig (attached as .config)
compiler: mipsel-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=mips 

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

>> arch/mips/pci/pci-rc32434.c:57:11: error: initialization from incompatible 
>> pointer type [-Werror=incompatible-pointer-types]
 .child = &rc32434_res_pci_mem2
  ^
   arch/mips/pci/pci-rc32434.c:57:11: note: (near initialization for 
'rc32434_res_pci_mem1.child.next')
>> arch/mips/pci/pci-rc32434.c:51:47: warning: missing braces around 
>> initializer [-Wmissing-braces]
static struct resource rc32434_res_pci_mem1 = {
  ^
   arch/mips/pci/pci-rc32434.c:60:47: warning: missing braces around 
initializer [-Wmissing-braces]
static struct resource rc32434_res_pci_mem2 = {
  ^
   cc1: some warnings being treated as errors

vim +57 arch/mips/pci/pci-rc32434.c

73b4390f Ralf Baechle 2008-07-16  50  
73b4390f Ralf Baechle 2008-07-16 @51  static struct resource 
rc32434_res_pci_mem1 = {
73b4390f Ralf Baechle 2008-07-16  52.name = "PCI MEM1",
73b4390f Ralf Baechle 2008-07-16  53.start = 0x5000,
73b4390f Ralf Baechle 2008-07-16  54.end = 0x5FFF,
73b4390f Ralf Baechle 2008-07-16  55.flags = IORESOURCE_MEM,
73b4390f Ralf Baechle 2008-07-16  56.sibling = NULL,
73b4390f Ralf Baechle 2008-07-16 @57.child = &rc32434_res_pci_mem2
73b4390f Ralf Baechle 2008-07-16  58  };
73b4390f Ralf Baechle 2008-07-16  59  

:: The code at line 57 was first introduced by commit
:: 73b4390fb23456964201abda79f1210fe337d01a [MIPS] Routerboard 532: Support 
for base system

:: TO: Ralf Baechle 
:: CC: Ralf Baechle 

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


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


Re: [PATCH v6 2/4] resource: Use list_head to link sibling resource

2018-07-04 Thread kbuild test robot
Hi Baoquan,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.18-rc3 next-20180704]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Baoquan-He/resource-Use-list_head-to-link-sibling-resource/20180704-121402
config: ia64-allnoconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 8.1.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.1.0 make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

   arch/ia64/sn/kernel/io_init.c: In function 'sn_io_slot_fixup':
>> arch/ia64/sn/kernel/io_init.c:195:19: error: invalid operands to binary && 
>> (have 'int' and 'struct list_head')
  if (res->parent && res->parent->child)
  ~~~ ^~ ~~

vim +195 arch/ia64/sn/kernel/io_init.c

^1da177e Linus Torvalds  2005-04-16  142  
3ec829b6 John Keller 2005-11-29  143  /*
6f09a925 John Keller 2007-01-30  144   * sn_io_slot_fixup() -   We are not 
running with an ACPI capable PROM,
8ea6091f John Keller 2006-10-04  145   *  and need to 
convert the pci_dev->resource
8ea6091f John Keller 2006-10-04  146   *  'start' and 
'end' addresses to mapped addresses,
8ea6091f John Keller 2006-10-04  147   *  and setup the 
pci_controller->window array entries.
^1da177e Linus Torvalds  2005-04-16  148   */
8ea6091f John Keller 2006-10-04  149  void
6f09a925 John Keller 2007-01-30  150  sn_io_slot_fixup(struct pci_dev *dev)
^1da177e Linus Torvalds  2005-04-16  151  {
^1da177e Linus Torvalds  2005-04-16  152int idx;
ab97b8cc Bjorn Helgaas   2016-03-02  153struct resource *res;
18c25526 Matt Fleming2016-05-04  154unsigned long size;
6f09a925 John Keller 2007-01-30  155struct pcidev_info *pcidev_info;
6f09a925 John Keller 2007-01-30  156struct sn_irq_info *sn_irq_info;
6f09a925 John Keller 2007-01-30  157int status;
6f09a925 John Keller 2007-01-30  158  
6f09a925 John Keller 2007-01-30  159pcidev_info = 
kzalloc(sizeof(struct pcidev_info), GFP_KERNEL);
6f09a925 John Keller 2007-01-30  160if (!pcidev_info)
d4ed8084 Harvey Harrison 2008-03-04  161panic("%s: Unable to 
alloc memory for pcidev_info", __func__);
6f09a925 John Keller 2007-01-30  162  
6f09a925 John Keller 2007-01-30  163sn_irq_info = 
kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL);
6f09a925 John Keller 2007-01-30  164if (!sn_irq_info)
d4ed8084 Harvey Harrison 2008-03-04  165panic("%s: Unable to 
alloc memory for sn_irq_info", __func__);
6f09a925 John Keller 2007-01-30  166  
6f09a925 John Keller 2007-01-30  167/* Call to retrieve pci device 
information needed by kernel. */
6f09a925 John Keller 2007-01-30  168status = 
sal_get_pcidev_info((u64) pci_domain_nr(dev),
6f09a925 John Keller 2007-01-30  169(u64) dev->bus->number,
6f09a925 John Keller 2007-01-30  170dev->devfn,
6f09a925 John Keller 2007-01-30  171(u64) __pa(pcidev_info),
6f09a925 John Keller 2007-01-30  172(u64) 
__pa(sn_irq_info));
6f09a925 John Keller 2007-01-30  173  
80a03e29 Stoyan Gaydarov 2009-03-10  174BUG_ON(status); /* Cannot get 
platform pci device information */
6f09a925 John Keller 2007-01-30  175  
3ec829b6 John Keller 2005-11-29  176  
^1da177e Linus Torvalds  2005-04-16  177/* Copy over PIO Mapped 
Addresses */
^1da177e Linus Torvalds  2005-04-16  178for (idx = 0; idx <= 
PCI_ROM_RESOURCE; idx++) {
ab97b8cc Bjorn Helgaas   2016-03-02  179if 
(!pcidev_info->pdi_pio_mapped_addr[idx])
^1da177e Linus Torvalds  2005-04-16  180continue;
^1da177e Linus Torvalds  2005-04-16  181  
ab97b8cc Bjorn Helgaas   2016-03-02  182res = 
&dev->resource[idx];
ab97b8cc Bjorn Helgaas   2016-03-02  183  
ab97b8cc Bjorn Helgaas   2016-03-02  184size = res->end - 
res->start;
ab97b8cc Bjorn Helgaas   2016-03-02  185if (size == 0)
3ec829b6 John Keller 2005-11-29  186continue;
ab97b8cc Bjorn Helgaas   2016-03-02  187  
240504ad Bjorn Helgaas   2016-03-02  188res->start = 
pcidev_info->pdi_pio_mapped_addr[idx];
18c25526 Matt Fleming2016-05-04  189res->end = res->start + 
size;
64715725 Bernhard Walle  2007-03-18  190  
64715725 Bernhard Walle  2007-03-18  191   

Re: [PATCH v6 1/4] resource: Move reparent_resources() to kernel/resource.c and make it public

2018-07-04 Thread Andy Shevchenko
On Wed, Jul 4, 2018 at 7:10 AM, Baoquan He  wrote:
> reparent_resources() is duplicated in arch/microblaze/pci/pci-common.c
> and arch/powerpc/kernel/pci-common.c, so move it to kernel/resource.c
> so that it's shared.

With couple of comments below,

Reviewed-by: Andy Shevchenko 

P.S. In some commit message in this series you used 'likt' instead of 'like'.

>
> Signed-off-by: Baoquan He 
> ---
>  arch/microblaze/pci/pci-common.c | 37 -
>  arch/powerpc/kernel/pci-common.c | 35 ---
>  include/linux/ioport.h   |  1 +
>  kernel/resource.c| 39 +++
>  4 files changed, 40 insertions(+), 72 deletions(-)
>
> diff --git a/arch/microblaze/pci/pci-common.c 
> b/arch/microblaze/pci/pci-common.c
> index f34346d56095..7899bafab064 100644
> --- a/arch/microblaze/pci/pci-common.c
> +++ b/arch/microblaze/pci/pci-common.c
> @@ -619,43 +619,6 @@ int pcibios_add_device(struct pci_dev *dev)
>  EXPORT_SYMBOL(pcibios_add_device);
>
>  /*
> - * Reparent resource children of pr that conflict with res
> - * under res, and make res replace those children.
> - */
> -static int __init reparent_resources(struct resource *parent,
> -struct resource *res)
> -{
> -   struct resource *p, **pp;
> -   struct resource **firstpp = NULL;
> -
> -   for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
> -   if (p->end < res->start)
> -   continue;
> -   if (res->end < p->start)
> -   break;
> -   if (p->start < res->start || p->end > res->end)
> -   return -1;  /* not completely contained */
> -   if (firstpp == NULL)
> -   firstpp = pp;
> -   }
> -   if (firstpp == NULL)
> -   return -1;  /* didn't find any conflicting entries? */
> -   res->parent = parent;
> -   res->child = *firstpp;
> -   res->sibling = *pp;
> -   *firstpp = res;
> -   *pp = NULL;
> -   for (p = res->child; p != NULL; p = p->sibling) {
> -   p->parent = res;
> -   pr_debug("PCI: Reparented %s [%llx..%llx] under %s\n",
> -p->name,
> -(unsigned long long)p->start,
> -(unsigned long long)p->end, res->name);
> -   }
> -   return 0;
> -}
> -
> -/*
>   *  Handle resources of PCI devices.  If the world were perfect, we could
>   *  just allocate all the resource regions and do nothing more.  It isn't.
>   *  On the other hand, we cannot just re-allocate all devices, as it would
> diff --git a/arch/powerpc/kernel/pci-common.c 
> b/arch/powerpc/kernel/pci-common.c
> index fe9733aa..926035bb378d 100644
> --- a/arch/powerpc/kernel/pci-common.c
> +++ b/arch/powerpc/kernel/pci-common.c
> @@ -1088,41 +1088,6 @@ resource_size_t pcibios_align_resource(void *data, 
> const struct resource *res,
>  EXPORT_SYMBOL(pcibios_align_resource);
>
>  /*
> - * Reparent resource children of pr that conflict with res
> - * under res, and make res replace those children.
> - */
> -static int reparent_resources(struct resource *parent,
> -struct resource *res)
> -{
> -   struct resource *p, **pp;
> -   struct resource **firstpp = NULL;
> -
> -   for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
> -   if (p->end < res->start)
> -   continue;
> -   if (res->end < p->start)
> -   break;
> -   if (p->start < res->start || p->end > res->end)
> -   return -1;  /* not completely contained */
> -   if (firstpp == NULL)
> -   firstpp = pp;
> -   }
> -   if (firstpp == NULL)
> -   return -1;  /* didn't find any conflicting entries? */
> -   res->parent = parent;
> -   res->child = *firstpp;
> -   res->sibling = *pp;
> -   *firstpp = res;
> -   *pp = NULL;
> -   for (p = res->child; p != NULL; p = p->sibling) {
> -   p->parent = res;
> -   pr_debug("PCI: Reparented %s %pR under %s\n",
> -p->name, p, res->name);
> -   }
> -   return 0;
> -}
> -
> -/*
>   *  Handle resources of PCI devices.  If the world were perfect, we could
>   *  just allocate all the resource regions and do nothing more.  It isn't.
>   *  On the other hand, we cannot just re-allocate all devices, as it would
> diff --git a/include/linux/ioport.h b/include/linux/ioport.h
> index da0ebaec25f0..dfdcd0bfe54e 100644
> --- a/include/linux/ioport.h
> +++ b/include/linux/ioport.h
> @@ -192,6 +192,7 @@ extern int allocate_resource(struct resource *root, 
> struct resource *new,
>  struct resource *lookup_resource(struct resource *root, resource_size_t 
> start);
>  int adjust_resource(struct res

Re: [PATCH 1/1] X86/Hyper-V:: Fix the circular dependency in IPI enlightenment.

2018-07-04 Thread Ingo Molnar

* k...@linuxonhyperv.com  wrote:

> From: "K. Y. Srinivasan" 
> 
> The IPI hypercalls depend on being able to map the Linux notion of CPU ID
> to the hypervisor's notion of the CPU ID. The array hv_vp_index[] provides
> this mapping. Code for populating this array depends on the IPI functionality.
> Break this circular dependency.
> 
> Fixes: 68bb7bfb7985 ("X86/Hyper-V: Enable IPI enlightenments")
> 
> Signed-off-by: K. Y. Srinivasan 
> Tested-by: Michael Kelley 
> ---
>  arch/x86/hyperv/hv_apic.c   | 5 +
>  arch/x86/hyperv/hv_init.c   | 5 -
>  arch/x86/include/asm/mshyperv.h | 2 ++
>  3 files changed, 11 insertions(+), 1 deletion(-)

Ugh, this patch wasn't even build tested, on 64-bit allyes/allmodconfig:

 arch/x86/hyperv/hv_apic.c: In function ‘__send_ipi_mask’:
 arch/x86/hyperv/hv_apic.c:171:4: error: label ‘ipi_mask_done’ used but not 
defined
 scripts/Makefile.build:317: recipe for target 'arch/x86/hyperv/hv_apic.o' 
failed
 make[2]: *** [arch/x86/hyperv/hv_apic.o] Error 1

Thanks,

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


Re: [BUG] staging: r8822be: RTL8822be can't find any wireless AP

2018-07-04 Thread Daniel Drake
On Wed, Jul 4, 2018 at 10:13 AM, Larry Finger  wrote:
> We will have to agree to disagree.
>
> I have no idea what the vendors are doing that cause some motherboards to
> need a different aspm value. What I do know is that we have had to live with
> the idiocy of some vendors saving a few pennies by only including a single
> antenna, rather than two, and then making a problem by miscoding the EFUSE
> bit that indicates which connector is actually in use. As we have no means
> that I know about to detect which boxes have the problem, a module parameter
> was created, just as in this case.
>
> I agree that drivers should work "out of the box", but finite resources and
> lack of vendor cooperation make this a goal that may not be attainable.

As you touched on, the ideal situation is that Realtek solve the
issue. Ping-Ke Shih is on CC and I am adding a few more contacts from
the commit log. The context is that the r8822 driver fails on several
platforms unless setting aspm=0 (the default is 1).

https://gist.github.com/dsd/20c05f0c6d66ee2ef9bfbb17f93f18ba
https://bugzilla.kernel.org/show_bug.cgi?id=199651


If we don't get a timely fix from Realtek though, I think there is a
key difference between the antenna selection headache and this one. In
the antenna case, there isn't a good value that you can set that will
work on all systems. If you change the default behaviour you will
solve the issue for some users while simultanously introducing the
problem on other systems that were previously fine.

However in this case, it's highly likely that setting aspm=0 (off) by
default would work for everyone. It has the disadvantage of using a
bit more power, but especially with the indications that this issue
affects a significant number of systems, I think that having the
driver working out of the box everywhere is more important. The module
parameter can be left in place so that unaffected users that want to
save power can set aspm=1.

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


Re: [BUG] staging: r8822be: RTL8822be can't find any wireless AP

2018-07-04 Thread Larry Finger

On 07/04/2018 09:09 AM, Dan Carpenter wrote:

On Wed, Jul 04, 2018 at 08:55:00AM -0500, Larry Finger wrote:

I do not think this is a bug.


It's obviously a bug.  The driver should just work by default.

As a last resort, we would do something like add quirk or something.  I
haven't looked at how quirks would be handled for this driver but grep
for quirk to see how other drivers do it.


We will have to agree to disagree.

I have no idea what the vendors are doing that cause some motherboards to need a 
different aspm value. What I do know is that we have had to live with the idiocy 
of some vendors saving a few pennies by only including a single antenna, rather 
than two, and then making a problem by miscoding the EFUSE bit that indicates 
which connector is actually in use. As we have no means that I know about to 
detect which boxes have the problem, a module parameter was created, just as in 
this case.


I agree that drivers should work "out of the box", but finite resources and lack 
of vendor cooperation make this a goal that may not be attainable.


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


[PATCH v2 9/9] staging: rtl8192u: Add space after ', ' character - Coding Style

2018-07-04 Thread John Whitmore
checkpatch requires a space after ',' - Added.

Signed-off-by: John Whitmore 
---
 .../rtl8192u/ieee80211/ieee80211_softmac.c| 57 ++-
 1 file changed, 31 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index c7c391b1077e..5895d6e5eb67 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -248,7 +248,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee
 
/* avoid watchdog triggers */
netif_trans_update(ieee->dev);
-   
ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate);
+   ieee->softmac_data_hard_start_xmit(skb, ieee->dev, 
ieee->basic_rate);
//dev_kfree_skb_any(skb);//edit by thomas
}
 
@@ -265,14 +265,14 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee
ieee->seq_ctrl[0]++;
 
/* check whether the managed packet queued greater than 5 */
-   
if(!ieee->check_nic_enough_desc(ieee->dev,tcb_desc->queue_index) ||\
+   if(!ieee->check_nic_enough_desc(ieee->dev, 
tcb_desc->queue_index) ||\

(skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) != 0) ||\
(ieee->queue_stop) ) {
/* insert the skb packet to the management queue */
/* as for the completion function, it does not need
 * to check it any more.
 * */
-   printk("%s():insert to waitqueue!\n",__func__);
+   printk("%s():insert to waitqueue!\n", __func__);
skb_queue_tail(&ieee->skb_waitQ[tcb_desc->queue_index], 
skb);
} else {
ieee->softmac_hard_start_xmit(skb, ieee->dev);
@@ -299,7 +299,7 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee)
 
/* avoid watchdog triggers */
netif_trans_update(ieee->dev);
-   
ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate);
+   ieee->softmac_data_hard_start_xmit(skb, ieee->dev, 
ieee->basic_rate);
}else{
 
header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
@@ -347,8 +347,8 @@ static inline struct sk_buff *ieee80211_probe_req(struct 
ieee80211_device *ieee)
memcpy(tag, ieee->current_network.ssid, len);
tag += len;
 
-   ieee80211_MFIE_Brate(ieee,&tag);
-   ieee80211_MFIE_Grate(ieee,&tag);
+   ieee80211_MFIE_Brate(ieee, &tag);
+   ieee80211_MFIE_Grate(ieee, &tag);
return skb;
 }
 
@@ -523,7 +523,7 @@ static void ieee80211_softmac_scan_wq(struct work_struct 
*work)
 static void ieee80211_beacons_start(struct ieee80211_device *ieee)
 {
unsigned long flags;
-   spin_lock_irqsave(&ieee->beacon_lock,flags);
+   spin_lock_irqsave(&ieee->beacon_lock, flags);
 
ieee->beacon_txing = 1;
ieee80211_send_beacon(ieee);
@@ -659,7 +659,7 @@ ieee80211_authentication_req(struct ieee80211_network 
*beacon,
auth->algorithm = cpu_to_le16(WLAN_AUTH_SHARED_KEY);
else if(ieee->auth_mode == 2)
auth->algorithm = WLAN_AUTH_OPEN; /* 0x80; */
-   printk("=>%s():auth->algorithm is 
%d\n",__func__,auth->algorithm);
+   printk("=>%s():auth->algorithm is %d\n", __func__, 
auth->algorithm);
auth->transaction = cpu_to_le16(ieee->associate_seq);
ieee->associate_seq++;
 
@@ -714,8 +714,8 @@ static struct sk_buff *ieee80211_probe_resp(struct 
ieee80211_device *ieee, u8 *d
tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
tmp_ht_info_buf = (u8 *)&(ieee->pHTInfo->SelfHTInfo);
tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo);
-   HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, 
&tmp_ht_cap_len,encrypt);
-   HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt);
+   HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, &tmp_ht_cap_len, 
encrypt);
+   HTConstructInfoElement(ieee, tmp_ht_info_buf, &tmp_ht_info_len, 
encrypt);
 
if (pHTInfo->bRegRT2RTAggregation)
{
@@ -742,7 +742,7 @@ static struct sk_buff *ieee80211_probe_resp(struct 
ieee80211_device *ieee, u8 *d
return NULL;
skb_reserve(skb, ieee->tx_headroom);
beacon_buf = skb_put(skb, (beacon_size - ieee->tx_headroom));
-   memcpy (beacon_buf->header.addr1, dest,ETH_ALEN);
+   memcpy (beacon_buf->header.addr1, dest, ETH_ALEN);
memcpy (beacon_buf->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
memcpy (beacon_buf->header.addr3, ieee->current_network.bssid, 
ETH_A

[PATCH v2 3/9] staging: rtl8192u: Remove redundant definitions in header

2018-07-04 Thread John Whitmore
Truncated header file removing definitions which aren't used.

Signed-off-by: John Whitmore 
---
 .../staging/rtl8192u/ieee80211/rtl819x_HT.h   | 117 --
 1 file changed, 117 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index a85036022aa8..6abf32b142ef 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -7,21 +7,10 @@
 // reassociation request and probe response frames
 //
 
-//
-// Operation mode value
-//
-#define HT_OPMODE_NO_PROTECT   0
-#define HT_OPMODE_OPTIONAL 1
-#define HT_OPMODE_40MHZ_PROTECT2
-#define HT_OPMODE_MIXED3
-
 //
 // MIMO Power Save Settings
 //
 #define MIMO_PS_STATIC 0
-#define MIMO_PS_DYNAMIC1
-#define MIMO_PS_NOLIMIT3
-
 
 //
 // There should be 128 bits to cover all of the MCS rates. However, since
@@ -35,27 +24,6 @@
 #define HT_SUPPORTED_MCS_2SS_BITMAP
0xff00
 #define HT_SUPPORTED_MCS_1SS_2SS_BITMAP
HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP
 
-
-typedef enum _HT_MCS_RATE {
-   HT_MCS0   = 0x0001,
-   HT_MCS1   = 0x0002,
-   HT_MCS2   = 0x0004,
-   HT_MCS3   = 0x0008,
-   HT_MCS4   = 0x0010,
-   HT_MCS5   = 0x0020,
-   HT_MCS6   = 0x0040,
-   HT_MCS7   = 0x0080,
-   HT_MCS8   = 0x0100,
-   HT_MCS9   = 0x0200,
-   HT_MCS10 = 0x0400,
-   HT_MCS11 = 0x0800,
-   HT_MCS12 = 0x1000,
-   HT_MCS13 = 0x2000,
-   HT_MCS14 = 0x4000,
-   HT_MCS15 = 0x8000,
-   // Do not define MCS32 here although 8190 support MCS32
-} HT_MCS_RATE, *PHT_MCS_RATE;
-
 //
 // Represent Channel Width in HT Capabilities
 //
@@ -120,28 +88,6 @@ typedef union _HT_CAPABILITY_MACPARA{
 }HT_CAPABILITY_MACPARA, *PHT_CAPABILITY_MACPARA;
 */
 
-typedef enum _HT_ACTION {
-   ACT_RECOMMAND_WIDTH = 0,
-   ACT_MIMO_PWR_SAVE   = 1,
-   ACT_PSMP= 2,
-   ACT_SET_PCO_PHASE   = 3,
-   ACT_MIMO_CHL_MEASURE= 4,
-   ACT_RECIPROCITY_CORRECT = 5,
-   ACT_MIMO_CSI_MATRICS= 6,
-   ACT_MIMO_NOCOMPR_STEER  = 7,
-   ACT_MIMO_COMPR_STEER= 8,
-   ACT_ANTENNA_SELECT  = 9,
-} HT_ACTION, *PHT_ACTION;
-
-
-/* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */
-typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier {
-   SC_MODE_DUPLICATE = 0,
-   SC_MODE_LOWER = 1,
-   SC_MODE_UPPER = 2,
-   SC_MODE_FULL40MHZ = 3,
-}HT_BW40_SC_E;
-
 typedefstruct _HT_CAPABILITY_ELE {
 
//HT capability info
@@ -212,16 +158,6 @@ typedef struct _HT_INFORMATION_ELE {
u8  BasicMSC[16];
 } __attribute__ ((packed)) HT_INFORMATION_ELE, *PHT_INFORMATION_ELE;
 
-//
-// MIMO Power Save control field.
-// This is appear in MIMO Power Save Action Frame
-//
-typedef struct _MIMOPS_CTRL {
-   u8  MimoPsEnable:1;
-   u8  MimoPsMode:1;
-   u8  Reserved:6;
-} MIMOPS_CTRL, *PMIMOPS_CTRL;
-
 typedef enum _HT_SPEC_VER {
HT_SPEC_VER_IEEE = 0,
HT_SPEC_VER_EWC = 1,
@@ -342,37 +278,6 @@ typedef struct _RT_HIGH_THROUGHPUT {
u32 IOTAction;
 } __attribute__ ((packed)) RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT;
 
-
-//
-// The Data structure is used to keep HT related variable for "each Sta"
-// when card is configured as "AP mode"
-//
-
-typedef struct _RT_HTINFO_STA_ENTRY {
-   u8  bEnableHT;
-
-   u8  bSupportCck;
-
-   u16 AMSDU_MaxSize;
-
-   u8  AMPDU_Factor;
-   u8  MPDU_Density;
-
-   u8  HTHighestOperaRate;
-
-   u8  bBw40MHz;
-
-   u8  MimoPs;
-
-   u8  McsRateSet[16];
-
-
-}RT_HTINFO_STA_ENTRY, *PRT_HTINFO_STA_ENTRY;
-
-
-
-
-
 //
 // The Data structure is used to keep HT related variable for "each AP"
 // when card is configured as "STA mode"
@@ -396,28 +301,6 @@ typedef struct _BSS_HT {
u8  bdRT2RTLongSlotTime;
 } __attribute__ ((packed)) BSS_HT, *PBSS_HT;
 
-typedef struct _MIMO_RSSI {
-   u32 EnableAntenna;
-   u32 AntennaA;
-   u32 AntennaB;
-   u32 AntennaC;
-   u32 AntennaD;
-   u32 Average;
-}MIMO_RSSI, *PMIMO_RSSI;
-
-typedef struct _MIMO_EVM {
-   u32 EVM1;
-   u32EVM2;
-}MI

[PATCH v2 6/9] staging: rtl8192u: Add required spaces around '||' operator - Sytle

2018-07-04 Thread John Whitmore
Additon of the coding style required spaces around the '||' operator.

Signed-off-by: John Whitmore 
---
 .../staging/rtl8192u/ieee80211/ieee80211_softmac.c   | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 0e4d1febd958..337d86effa69 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -192,8 +192,8 @@ static u8 MgntQuery_MgntFrameTxRate(struct ieee80211_device 
*ieee)
 
if (rate == 0) {
/* 2005.01.26, by rcnjko. */
-   if(ieee->mode == IEEE_A||
-  ieee->mode == IEEE_N_5G||
+   if(ieee->mode == IEEE_A ||
+  ieee->mode == IEEE_N_5G ||
   (ieee->mode == IEEE_N_24G&&!pHTInfo->bCurSuppCCK))
rate = 0x0c;
else
@@ -265,8 +265,8 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee
ieee->seq_ctrl[0]++;
 
/* check whether the managed packet queued greater than 5 */
-   
if(!ieee->check_nic_enough_desc(ieee->dev,tcb_desc->queue_index)||\
-   
(skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) != 0)||\
+   
if(!ieee->check_nic_enough_desc(ieee->dev,tcb_desc->queue_index) ||\
+   
(skb_queue_len(&ieee->skb_waitQ[tcb_desc->queue_index]) != 0) ||\
(ieee->queue_stop) ) {
/* insert the skb packet to the management queue */
/* as for the completion function, it does not need
@@ -1315,7 +1315,7 @@ static void ieee80211_associate_complete_wq(struct 
work_struct *work)
}
ieee->LinkDetectInfo.SlotNum = 2 * (1 + 
ieee->current_network.beacon_interval/500);
// To prevent the immediately calling watch_dog after association.
-   if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 
0||ieee->LinkDetectInfo.NumRecvDataInPeriod == 0 )
+   if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || 
ieee->LinkDetectInfo.NumRecvDataInPeriod == 0 )
{
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
@@ -2088,7 +2088,7 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, 
struct ieee80211_device *
 #else
if ((skb_queue_len(&ieee->skb_waitQ[queue_index]) != 0) ||
 #endif
-   (!ieee->check_nic_enough_desc(ieee->dev,queue_index))||\
+   (!ieee->check_nic_enough_desc(ieee->dev,queue_index)) || \
 (ieee->queue_stop)) {
/* insert the skb packet to the wait queue */
/* as for the completion function, it does not need
-- 
2.17.1

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


[PATCH v2 8/9] staging: rtl8192u: Add required space around '=' operator - Style

2018-07-04 Thread John Whitmore
checkpatch requires spaces around '=' operator so added.

Signed-off-by: John Whitmore 
---
 .../rtl8192u/ieee80211/ieee80211_softmac.c| 50 +--
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index e7b5cd896f02..c7c391b1077e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -219,7 +219,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee
 {
unsigned long flags;
short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
-   struct rtl_80211_hdr_3addr  *header=
+   struct rtl_80211_hdr_3addr  *header =
(struct rtl_80211_hdr_3addr  *)skb->data;
 
struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 8);
@@ -686,12 +686,12 @@ static struct sk_buff *ieee80211_probe_resp(struct 
ieee80211_device *ieee, u8 *d
u8 erpinfo_content = 0;
 
u8 *tmp_ht_cap_buf;
-   u8 tmp_ht_cap_len=0;
+   u8 tmp_ht_cap_len = 0;
u8 *tmp_ht_info_buf;
-   u8 tmp_ht_info_len=0;
+   u8 tmp_ht_info_len = 0;
PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
-   u8 *tmp_generic_ie_buf=NULL;
-   u8 tmp_generic_ie_len=0;
+   u8 *tmp_generic_ie_buf = NULL;
+   u8 tmp_generic_ie_len = 0;
 
if(rate_ex_len > 0) rate_ex_len+=2;
 
@@ -710,9 +710,9 @@ static struct sk_buff *ieee80211_probe_resp(struct 
ieee80211_device *ieee, u8 *d
encrypt = ieee->host_encrypt && crypt && crypt->ops &&
((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len));
/* HT ralated element */
-   tmp_ht_cap_buf =(u8 *)&(ieee->pHTInfo->SelfHTCap);
+   tmp_ht_cap_buf = (u8 *)&(ieee->pHTInfo->SelfHTCap);
tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
-   tmp_ht_info_buf =(u8 *)&(ieee->pHTInfo->SelfHTInfo);
+   tmp_ht_info_buf = (u8 *)&(ieee->pHTInfo->SelfHTInfo);
tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo);
HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, 
&tmp_ht_cap_len,encrypt);
HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt);
@@ -858,7 +858,7 @@ static struct sk_buff *ieee80211_assoc_resp(struct 
ieee80211_device *ieee,
 
assoc->status = 0;
assoc->aid = cpu_to_le16(ieee->assoc_id);
-   if (ieee->assoc_id == 0x2007) ieee->assoc_id=0;
+   if (ieee->assoc_id == 0x2007) ieee->assoc_id = 0;
else ieee->assoc_id++;
 
tag = skb_put(skb, rate_len);
@@ -960,13 +960,13 @@ ieee80211_association_req(struct ieee80211_network 
*beacon,
//unsigned int wpa_len = beacon->wpa_ie_len;
//for HT
u8 *ht_cap_buf = NULL;
-   u8 ht_cap_len=0;
-   u8 *realtek_ie_buf=NULL;
-   u8 realtek_ie_len=0;
-   int wpa_ie_len= ieee->wpa_ie_len;
-   unsigned int ckip_ie_len=0;
-   unsigned int ccxrm_ie_len=0;
-   unsigned int cxvernum_ie_len=0;
+   u8 ht_cap_len = 0;
+   u8 *realtek_ie_buf = NULL;
+   u8 realtek_ie_len = 0;
+   int wpa_ie_len = ieee->wpa_ie_len;
+   unsigned int ckip_ie_len = 0;
+   unsigned int ccxrm_ie_len = 0;
+   unsigned int cxvernum_ie_len = 0;
struct ieee80211_crypt_data *crypt;
int encrypt;
 
@@ -1221,7 +1221,7 @@ static void ieee80211_associate_step1(struct 
ieee80211_device *ieee)
IEEE80211_DEBUG_MGMT("Stopping scan\n");
 
ieee->softmac_stats.tx_auth_rq++;
-   skb=ieee80211_authentication_req(beacon, ieee, 0);
+   skb = ieee80211_authentication_req(beacon, ieee, 0);
 
if (!skb)
ieee80211_associate_abort(ieee);
@@ -1280,7 +1280,7 @@ static void ieee80211_associate_step2(struct 
ieee80211_device *ieee)
IEEE80211_DEBUG_MGMT("Sending association request\n");
 
ieee->softmac_stats.tx_ass_rq++;
-   skb=ieee80211_association_req(beacon, ieee);
+   skb = ieee80211_association_req(beacon, ieee);
if (!skb)
ieee80211_associate_abort(ieee);
else{
@@ -1318,7 +1318,7 @@ static void ieee80211_associate_complete_wq(struct 
work_struct *work)
if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 0 || 
ieee->LinkDetectInfo.NumRecvDataInPeriod == 0 )
{
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
-   ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
+   ieee->LinkDetectInfo.NumRecvDataInPeriod = 1;
}
ieee->link_change(ieee->dev);
if (!ieee->is_silent_reset) {
@@ -1530,7 +1530,7 @@ static short probe_rq_parse(struct ieee80211_device 
*ieee, struct sk_buff *skb,
 {
u8 *tag;
u8 *skbend;
-   u8 *ssid=NULL;
+   u8 *ssid = NULL;
u8 ssidlen = 0;
 
struct rtl_80211_hdr_3addr   *header =
@@ -1945,7 +1945,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, 
struct 

[PATCH v2 7/9] staging: rtl8192u: Remove space after cast - Coding Style

2018-07-04 Thread John Whitmore
According to checkpatch - No space is necessary after a cast.

Signed-off-by: John Whitmore 
---
 .../rtl8192u/ieee80211/ieee80211_softmac.c| 30 +--
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 337d86effa69..e7b5cd896f02 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -220,7 +220,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee
unsigned long flags;
short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
struct rtl_80211_hdr_3addr  *header=
-   (struct rtl_80211_hdr_3addr  *) skb->data;
+   (struct rtl_80211_hdr_3addr  *)skb->data;
 
struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 8);
 
@@ -287,7 +287,7 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee)
 {
short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
struct rtl_80211_hdr_3addr  *header =
-   (struct rtl_80211_hdr_3addr  *) skb->data;
+   (struct rtl_80211_hdr_3addr  *)skb->data;
 
if(single){
header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
@@ -710,9 +710,9 @@ static struct sk_buff *ieee80211_probe_resp(struct 
ieee80211_device *ieee, u8 *d
encrypt = ieee->host_encrypt && crypt && crypt->ops &&
((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len));
/* HT ralated element */
-   tmp_ht_cap_buf =(u8 *) &(ieee->pHTInfo->SelfHTCap);
+   tmp_ht_cap_buf =(u8 *)&(ieee->pHTInfo->SelfHTCap);
tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
-   tmp_ht_info_buf =(u8 *) &(ieee->pHTInfo->SelfHTInfo);
+   tmp_ht_info_buf =(u8 *)&(ieee->pHTInfo->SelfHTInfo);
tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo);
HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, 
&tmp_ht_cap_len,encrypt);
HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt);
@@ -765,7 +765,7 @@ static struct sk_buff *ieee80211_probe_resp(struct 
ieee80211_device *ieee, u8 *d
beacon_buf->info_element[0].id = MFIE_TYPE_SSID;
beacon_buf->info_element[0].len = ssid_len;
 
-   tag = (u8 *) beacon_buf->info_element[0].data;
+   tag = (u8 *)beacon_buf->info_element[0].data;
 
memcpy(tag, ssid, ssid_len);
 
@@ -1493,7 +1493,7 @@ static inline u16 auth_parse(struct sk_buff *skb, u8 
**challenge, int *chlen)
return 0xcafe;
}
*challenge = NULL;
-   a = (struct ieee80211_authentication *) skb->data;
+   a = (struct ieee80211_authentication *)skb->data;
if (skb->len > (sizeof(struct ieee80211_authentication) + 3)) {
t = skb->data + sizeof(struct ieee80211_authentication);
 
@@ -1516,7 +1516,7 @@ static int auth_rq_parse(struct sk_buff *skb, u8 *dest)
IEEE80211_DEBUG_MGMT("invalid len in auth request: 
%d\n",skb->len);
return -1;
}
-   a = (struct ieee80211_authentication *) skb->data;
+   a = (struct ieee80211_authentication *)skb->data;
 
memcpy(dest,a->header.addr2, ETH_ALEN);
 
@@ -1534,7 +1534,7 @@ static short probe_rq_parse(struct ieee80211_device 
*ieee, struct sk_buff *skb,
u8 ssidlen = 0;
 
struct rtl_80211_hdr_3addr   *header =
-   (struct rtl_80211_hdr_3addr   *) skb->data;
+   (struct rtl_80211_hdr_3addr   *)skb->data;
 
if (skb->len < sizeof (struct rtl_80211_hdr_3addr  ))
return -1; /* corrupted */
@@ -1574,7 +1574,7 @@ static int assoc_rq_parse(struct sk_buff *skb, u8 *dest)
return -1;
}
 
-   a = (struct ieee80211_assoc_request_frame *) skb->data;
+   a = (struct ieee80211_assoc_request_frame *)skb->data;
 
memcpy(dest,a->header.addr2,ETH_ALEN);
 
@@ -1591,7 +1591,7 @@ static inline u16 assoc_parse(struct ieee80211_device 
*ieee, struct sk_buff *skb
return 0xcafe;
}
 
-   response_head = (struct ieee80211_assoc_response_frame *) skb->data;
+   response_head = (struct ieee80211_assoc_response_frame *)skb->data;
*aid = le16_to_cpu(response_head->aid) & 0x3fff;
 
status_code = le16_to_cpu(response_head->status);
@@ -1913,7 +1913,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, 
struct sk_buff *skb,
struct ieee80211_rx_stats *rx_stats, u16 type,
u16 stype)
 {
-   struct rtl_80211_hdr_3addr *header = (struct rtl_80211_hdr_3addr *) 
skb->data;
+   struct rtl_80211_hdr_3addr *header = (struct rtl_80211_hdr_3addr 
*)skb->data;
u16 errcode;
int aid;
struct ieee80211_assoc_response_frame *assoc_resp;
@@ -2171,7 +2171,7 @@ void ieee80211_wake_queue(struct ieee80

[PATCH v2 5/9] staging: rtl8192u: Add space required around '==' opeartor - Style

2018-07-04 Thread John Whitmore
Simple addition of the coding style required spaces around '==' operator.

Signed-off-by: John Whitmore 
---
 .../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 7ef761632629..0e4d1febd958 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -193,8 +193,8 @@ static u8 MgntQuery_MgntFrameTxRate(struct ieee80211_device 
*ieee)
if (rate == 0) {
/* 2005.01.26, by rcnjko. */
if(ieee->mode == IEEE_A||
-  ieee->mode== IEEE_N_5G||
-  (ieee->mode== IEEE_N_24G&&!pHTInfo->bCurSuppCCK))
+  ieee->mode == IEEE_N_5G||
+  (ieee->mode == IEEE_N_24G&&!pHTInfo->bCurSuppCCK))
rate = 0x0c;
else
rate = 0x02;
@@ -1315,7 +1315,7 @@ static void ieee80211_associate_complete_wq(struct 
work_struct *work)
}
ieee->LinkDetectInfo.SlotNum = 2 * (1 + 
ieee->current_network.beacon_interval/500);
// To prevent the immediately calling watch_dog after association.
-   if 
(ieee->LinkDetectInfo.NumRecvBcnInPeriod==0||ieee->LinkDetectInfo.NumRecvDataInPeriod==0
 )
+   if (ieee->LinkDetectInfo.NumRecvBcnInPeriod == 
0||ieee->LinkDetectInfo.NumRecvDataInPeriod == 0 )
{
ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
ieee->LinkDetectInfo.NumRecvDataInPeriod= 1;
@@ -1391,8 +1391,8 @@ inline void ieee80211_softmac_new_net(struct 
ieee80211_device *ieee, struct ieee
 */
apset = ieee->wap_set;//(memcmp(ieee->current_network.bssid, 
zero,ETH_ALEN)!=0 );
ssidset = ieee->ssid_set;//ieee->current_network.ssid[0] != 
'\0';
-   ssidbroad =  !(net->ssid_len == 0 || net->ssid[0]== '\0');
-   apmatch = (memcmp(ieee->current_network.bssid, net->bssid, 
ETH_ALEN)==0);
+   ssidbroad =  !(net->ssid_len == 0 || net->ssid[0] == '\0');
+   apmatch = (memcmp(ieee->current_network.bssid, net->bssid, 
ETH_ALEN) == 0);
ssidmatch = (ieee->current_network.ssid_len == net->ssid_len)&&\
(!strncmp(ieee->current_network.ssid, 
net->ssid, net->ssid_len));
 
@@ -1595,8 +1595,8 @@ static inline u16 assoc_parse(struct ieee80211_device 
*ieee, struct sk_buff *skb
*aid = le16_to_cpu(response_head->aid) & 0x3fff;
 
status_code = le16_to_cpu(response_head->status);
-   if((status_code==WLAN_STATUS_ASSOC_DENIED_RATES || \
-  status_code==WLAN_STATUS_CAPS_UNSUPPORTED)&&
+   if((status_code == WLAN_STATUS_ASSOC_DENIED_RATES || \
+  status_code == WLAN_STATUS_CAPS_UNSUPPORTED)&&
   ((ieee->mode == IEEE_G) &&
(ieee->current_network.mode == IEEE_N_24G) &&
(ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1 {
-- 
2.17.1

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


[PATCH v2 2/9] staging: rtl8192u: Use memset to initialize memory, instead of loop.

2018-07-04 Thread John Whitmore
Replaced memory initialising loop with memset instead.

Suggested-by: Andy Shevchenko
Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index a549d9678214..abf55877331e 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -761,8 +761,6 @@ void HTConstructRT2RTAggElement(struct ieee80211_device 
*ieee, u8 *posRT2RTAgg,
  */
 static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 *pOperateMCS)
 {
-   u8  i;
-
if (!pOperateMCS) {
IEEE80211_DEBUG(IEEE80211_DL_ERR,
"pOperateMCS can't be null in %s\n",
@@ -777,8 +775,7 @@ static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 
*pOperateMCS)
//legacy rate routine handled at selectedrate
 
//no MCS rate
-   for (i = 0; i <= 15; i++)
-   pOperateMCS[i] = 0;
+   memset(pOperateMCS, 0, 16);
break;
 
case IEEE_N_24G://assume CCK rate ok
-- 
2.17.1

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


[PATCH v2 4/9] staging: rtl8192u: Remove superfluous blank lines - Coding Style

2018-07-04 Thread John Whitmore
Removal of extra blank lines from the ieee80211_softmac.c file

Signed-off-by: John Whitmore 
---
 .../rtl8192u/ieee80211/ieee80211_softmac.c| 105 --
 1 file changed, 105 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 9d9a9e102bb8..7ef761632629 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -12,8 +12,6 @@
  *
  * released under the GPL
  */
-
-
 #include "ieee80211.h"
 
 #include 
@@ -98,7 +96,6 @@ static void ieee80211_MFIE_Grate(struct ieee80211_device 
*ieee, u8 **tag_p)
*tag_p = tag;
 }
 
-
 static void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p)
 {
u8 *tag = *tag_p;
@@ -216,7 +213,6 @@ static u8 MgntQuery_MgntFrameTxRate(struct ieee80211_device 
*ieee)
return rate;
 }
 
-
 void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl);
 
 inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device 
*ieee)
@@ -289,14 +285,11 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee
 static inline void
 softmac_ps_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee)
 {
-
short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
struct rtl_80211_hdr_3addr  *header =
(struct rtl_80211_hdr_3addr  *) skb->data;
 
-
if(single){
-
header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
 
if (ieee->seq_ctrl[0] == 0xFFF)
@@ -307,7 +300,6 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee)
/* avoid watchdog triggers */
netif_trans_update(ieee->dev);

ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate);
-
}else{
 
header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
@@ -318,7 +310,6 @@ softmac_ps_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee)
ieee->seq_ctrl[0]++;
 
ieee->softmac_hard_start_xmit(skb, ieee->dev);
-
}
//dev_kfree_skb_any(skb);//edit by thomas
 }
@@ -390,7 +381,6 @@ static void ieee80211_send_beacon(struct ieee80211_device 
*ieee)
//spin_unlock_irqrestore(&ieee->beacon_lock,flags);
 }
 
-
 static void ieee80211_send_beacon_cb(struct timer_list *t)
 {
struct ieee80211_device *ieee =
@@ -402,7 +392,6 @@ static void ieee80211_send_beacon_cb(struct timer_list *t)
spin_unlock_irqrestore(&ieee->beacon_lock, flags);
 }
 
-
 static void ieee80211_send_probe(struct ieee80211_device *ieee)
 {
struct sk_buff *skb;
@@ -436,7 +425,6 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device 
*ieee)
 
while(1)
{
-
do{
ch++;
if (ch > MAX_CHANNEL_NUMBER)
@@ -475,7 +463,6 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device 
*ieee)
goto out;
 
msleep_interruptible(IEEE80211_SOFTMAC_SCAN_TIME);
-
}
 out:
if(ieee->state < IEEE80211_LINKED){
@@ -520,7 +507,6 @@ static void ieee80211_softmac_scan_wq(struct work_struct 
*work)
if(channel_map[ieee->current_network.channel] == 1)
ieee80211_send_probe_requests(ieee);
 
-
schedule_delayed_work(&ieee->softmac_scan_wq, 
IEEE80211_SOFTMAC_SCAN_TIME);
 
mutex_unlock(&ieee->scan_mutex);
@@ -534,8 +520,6 @@ static void ieee80211_softmac_scan_wq(struct work_struct 
*work)
mutex_unlock(&ieee->scan_mutex);
 }
 
-
-
 static void ieee80211_beacons_start(struct ieee80211_device *ieee)
 {
unsigned long flags;
@@ -557,10 +541,8 @@ static void ieee80211_beacons_stop(struct ieee80211_device 
*ieee)
del_timer_sync(&ieee->beacon_timer);
 
spin_unlock_irqrestore(&ieee->beacon_lock, flags);
-
 }
 
-
 void ieee80211_stop_send_beacons(struct ieee80211_device *ieee)
 {
if(ieee->stop_send_beacons)
@@ -624,7 +606,6 @@ static void ieee80211_start_scan(struct ieee80211_device 
*ieee)
}
}else
ieee->start_scan(ieee->dev);
-
 }
 
 /* called with wx_mutex held */
@@ -642,7 +623,6 @@ void ieee80211_start_scan_syncro(struct ieee80211_device 
*ieee)
ieee80211_softmac_scan_syncro(ieee);
else
ieee->scan_syncro(ieee->dev);
-
 }
 EXPORT_SYMBOL(ieee80211_start_scan_syncro);
 
@@ -654,7 +634,6 @@ ieee80211_authentication_req(struct ieee80211_network 
*beacon,
struct ieee80211_authentication *auth;
int len = sizeof(struct ieee80211_authentication) + challengelen + 
ieee->tx_headroom;
 
-
skb = dev_alloc_skb(len);
if (!skb) return NULL;
 
@@ -687,10 +666,8 @@ ieee80211_authentication_req(struct ieee80211_network 
*beacon,
auth->status = cpu_to_le16(WLAN_STATUS_SUCCESS);
 
return s

[PATCH v2 1/9] staging: rtl8192u: Use __func__ instead of hardcoded string - Style

2018-07-04 Thread John Whitmore
Changed logging statements to use %s and __func__ instead of hard coding the
function name in a string.

Signed-off-by: John Whitmore 
---
 .../rtl8192u/ieee80211/rtl819x_HTProc.c   | 24 ++-
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 98d74d87bf11..a549d9678214 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -534,7 +534,9 @@ void HTConstructCapabilityElement(struct ieee80211_device 
*ieee, u8 *posHTCap, u
//u8 bIsDeclareMCS13;
 
if (!posHTCap || !pHT) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTCap or pHTInfo can't be 
null in HTConstructCapabilityElement()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "posHTCap or pHTInfo can't be null in %s\n",
+   __func__);
return;
}
memset(posHTCap, 0, *len);
@@ -645,7 +647,9 @@ void HTConstructInfoElement(struct ieee80211_device *ieee, 
u8 *posHTInfo, u8 *le
PHT_INFORMATION_ELE pHTInfoEle = 
(PHT_INFORMATION_ELE)posHTInfo;
 
if (!posHTInfo || !pHTInfoEle) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTInfo or pHTInfoEle 
can't be null in HTConstructInfoElement()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "posHTInfo or pHTInfoEle can't be null in %s\n",
+   __func__);
return;
}
 
@@ -709,7 +713,9 @@ void HTConstructInfoElement(struct ieee80211_device *ieee, 
u8 *posHTInfo, u8 *le
 void HTConstructRT2RTAggElement(struct ieee80211_device *ieee, u8 
*posRT2RTAgg, u8 *len)
 {
if (!posRT2RTAgg) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "posRT2RTAgg can't be null in 
HTConstructRT2RTAggElement()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "posRT2RTAgg can't be null in %s\n",
+   __func__);
return;
}
memset(posRT2RTAgg, 0, *len);
@@ -758,7 +764,9 @@ static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 
*pOperateMCS)
u8  i;
 
if (!pOperateMCS) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "pOperateMCS can't be null in 
HT_PickMCSRate()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "pOperateMCS can't be null in %s\n",
+   __func__);
return false;
}
 
@@ -820,7 +828,9 @@ u8 HTGetHighestMCSRate(struct ieee80211_device *ieee, u8 
*pMCSRateSet, u8 *pMCSF
u8  availableMcsRate[16];
 
if (!pMCSRateSet || !pMCSFilter) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "pMCSRateSet or pMCSFilter 
can't be null in HTGetHighestMCSRate()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "pMCSRateSet or pMCSFilter can't be null in 
%s\n",
+   __func__);
return false;
}
for (i = 0; i < 16; i++)
@@ -900,7 +910,9 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
static u8   EWC11NHTInfo[] = {0x00, 0x90, 
0x4c, 0x34};  // For 11n EWC definition, 2007.07.17, by Emily
 
if (!pHTInfo->bCurrentHTSupport) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "<=== HTOnAssocRsp(): 
HT_DISABLE\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "<=== %s: HT_DISABLE\n",
+   __func__);
return;
}
IEEE80211_DEBUG(IEEE80211_DL_HT, "===> HTOnAssocRsp_wq(): HT_ENABLE\n");
-- 
2.17.1

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


Re: [BUG] staging: r8822be: RTL8822be can't find any wireless AP

2018-07-04 Thread Dan Carpenter
On Wed, Jul 04, 2018 at 08:55:00AM -0500, Larry Finger wrote:
> I do not think this is a bug.

It's obviously a bug.  The driver should just work by default.

As a last resort, we would do something like add quirk or something.  I
haven't looked at how quirks would be handled for this driver but grep
for quirk to see how other drivers do it.

regards,
dan carpenter

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


Re: [PATCH v2] PCI: hv: Disable/enable irq rather than bh in hv_compose_msi_msg()

2018-07-04 Thread Lorenzo Pieralisi
On Sun, Jul 01, 2018 at 06:22:23PM +, Dexuan Cui wrote:
> 
> Commit de0aa7b2f97d ("PCI: hv: Fix 2 hang issues in hv_compose_msi_msg()")
> uses local_bh_disable()/enable(), because hv_pci_onchannelcallback() can
> also run in tasklet context as the channel event callback, and here we
> want to avoid the race.
> 
> With CONFIG_PROVE_LOCKING=y in the recent mainline, or old kernels that
> don't have commit f71b74bca637 ("irq/softirqs: Use lockdep to assert IRQs
> are disabled/enabled"), when the upper layer irq code calls
> hv_compose_msi_msg() with local irq DISABLED, we'll see a warning at the
> beginning of __local_bh_enable_ip():
> 
> IRQs not enabled as expected
>   WARNING: CPU: 0 PID: 408 at kernel/softirq.c:162 __local_bh_enable_ip
> 
> The warning exposes an issue in de0aa7b2f97d: local_bh_enable() can
> potentially call do_softirq(), which is not supposed to run when local
> irq is DISABLED. Let's fix this by using local_irq_save()/restore()
> instead.
> 
> Note: hv_pci_onchannelcallback() is not a hot path because it's only
> called when the PCI device is hot added and removed, which is infrequent.
> 
> Fixes: de0aa7b2f97d ("PCI: hv: Fix 2 hang issues in hv_compose_msi_msg()")
> Signed-off-by: Dexuan Cui 
> Reviewed-by: Haiyang Zhang 
> Cc: 
> Cc: Stephen Hemminger 
> Cc: K. Y. Srinivasan 
> ---
> 
> A trimmed version of the warning is:
> 
> IRQs not enabled as expected
> WARNING: CPU: 0 PID: 408 at kernel/softirq.c:162 
> __local_bh_enable_ip+0xb0/0xe0
> Call Trace:
>  hv_compose_msi_msg+0x209/0x462 [pci_hyperv]
>  irq_chip_compose_msi_msg+0x41/0x50
>  msi_domain_activate+0x1a/0x40
>  __irq_domain_activate_irq+0x59/0x90
>  irq_domain_activate_irq+0x25/0x40
>  __setup_irq+0x3ec/0x730
> request_threaded_irq+0xfa/0x1a0
> mlx4_init_eq_table+0x3c3/0x5f0 [mlx4_core]
> mlx4_setup_hca+0x1db/0x750 [mlx4_core]
> mlx4_load_one+0xad2/0x13b0 [mlx4_core]
> mlx4_init_one+0x578/0x710 [mlx4_core]
> local_pci_probe+0x1e/0x50
> work_for_cpu_fn+0x10/0x20
> process_one_work+0x1d4/0x5a0
> worker_thread+0x1cb/0x3d0
> kthread+0xf5/0x130
> 
> 
> Changes since v1:
>   Updated the changelog only (fixed typos and some inaccuracy)
> 
> 
>  drivers/pci/controller/pci-hyperv.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Applied to pci/controller-fixes, to be tentatively sent for an
upcoming -rc, thanks.

Lorenzo

> diff --git a/drivers/pci/controller/pci-hyperv.c 
> b/drivers/pci/controller/pci-hyperv.c
> index ba1d4b5..eb20296 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -1073,6 +1073,7 @@ static void hv_compose_msi_msg(struct irq_data *data, 
> struct msi_msg *msg)
>   struct pci_bus *pbus;
>   struct pci_dev *pdev;
>   struct cpumask *dest;
> + unsigned long flags;
>   struct compose_comp_ctxt comp;
>   struct tran_int_desc *int_desc;
>   struct {
> @@ -1164,14 +1165,15 @@ static void hv_compose_msi_msg(struct irq_data *data, 
> struct msi_msg *msg)
>* the channel callback directly when channel->target_cpu is
>* the current CPU. When the higher level interrupt code
>* calls us with interrupt enabled, let's add the
> -  * local_bh_disable()/enable() to avoid race.
> +  * local_irq_save()/restore() to avoid race:
> +  * hv_pci_onchannelcallback() can also run in tasklet.
>*/
> - local_bh_disable();
> + local_irq_save(flags);
>  
>   if (hbus->hdev->channel->target_cpu == smp_processor_id())
>   hv_pci_onchannelcallback(hbus);
>  
> - local_bh_enable();
> + local_irq_restore(flags);
>  
>   if (hpdev->state == hv_pcichild_ejecting) {
>   dev_err_once(&hbus->hdev->device,
> -- 
> 2.7.4
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [BUG] staging: r8822be: RTL8822be can't find any wireless AP

2018-07-04 Thread Larry Finger

On 07/04/2018 03:03 AM, Jian-Hong Pan wrote:

Hi,

We have an ASUS X530UN (Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz)
laptop equipped with Realtek rtl8822be wireless which cannot find any
access point after WiFi is launched.

Realtek rtl8822be wireless' information:
dev@endless:~/linux-eos$ sudo lspci -nnvs 02:00.0
02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd.
Device [10ec:b822] (rev ff) (prog-if ff)
!!! Unknown header type 7f
Kernel driver in use: r8822be
Kernel modules: r8822be

System always hits the error: "halmac_init_hal failed" in dmesg after
WiFi is launched.

[ 8.591333] r8822be: module is from the staging directory, the quality
is unknown, you have been warned.
[ 8.593122] r8822be :02:00.0: enabling device ( -> 0003)
[ 8.669163] r8822be: Using firmware rtlwifi/rtl8822befw.bin
[ 9.289939] r8822be: rtlwifi: wireless switch is on
[ 10.056426] r8822be :02:00.0 wlp2s0: renamed from wlan0
...
[ 11.952534] r8822be: halmac_init_hal failed
[ 11.955933] r8822be: halmac_init_hal failed
[ 11.956227] r8822be: halmac_init_hal failed
[ 22.007942] r8822be: halmac_init_hal failed

We noticed the r8822be module parameter "aspm"'s default value is 1.
Here is the parameter list of r8822be:
dev@endless:~$ sudo grep "" /sys/module/r8822be/parameters/*
/sys/module/r8822be/parameters/aspm:1
/sys/module/r8822be/parameters/debug_level:0
/sys/module/r8822be/parameters/debug_mask:0
/sys/module/r8822be/parameters/disable_watchdog:N
/sys/module/r8822be/parameters/dma64:N
/sys/module/r8822be/parameters/fwlps:Y
/sys/module/r8822be/parameters/ips:Y
/sys/module/r8822be/parameters/msi:Y
/sys/module/r8822be/parameters/swenc:N
/sys/module/r8822be/parameters/swlps:N

If I make a module options like "options r8822be aspm=0" which
disables ASPM and reboot, the WiFi works correctly.  It can find the
access points, then connects.
Here is the parameter list of r8822be:
dev@endless:~$ sudo grep "" /sys/module/r8822be/parameters/*
/sys/module/r8822be/parameters/aspm:0
/sys/module/r8822be/parameters/debug_level:0
/sys/module/r8822be/parameters/debug_mask:0
/sys/module/r8822be/parameters/disable_watchdog:N
/sys/module/r8822be/parameters/dma64:N
/sys/module/r8822be/parameters/fwlps:Y
/sys/module/r8822be/parameters/ips:Y
/sys/module/r8822be/parameters/msi:Y
/sys/module/r8822be/parameters/swenc:N
/sys/module/r8822be/parameters/swlps:N

This issue can be reproduced on Linux stable 4.16.17, 4.17.2 and
4.18.0-rc3. (I list versions that we have tried)

Besides, I also notice there is a comment in
drivers/staging/rtlwifi/rtl8822be/sw.c rtl8822be_init_aspm_vars
function.

/*
  * This setting works for those device with
  * backdoor ASPM setting such as EPHY setting.
  * 0 - Not support ASPM,
  * 1 - Support ASPM,
  * 2 - According to chipset.
  */

The value 2 for ASPM interests me.  It says "Enable or disable ASPM
according to chipset."
I tried the setting value 2 for ASPM.  Here is the parameter list of r8822be:
dev@endless:~$ sudo grep "" /sys/module/r8822be/parameters/*
/sys/module/r8822be/parameters/aspm:2
/sys/module/r8822be/parameters/debug_level:0
/sys/module/r8822be/parameters/debug_mask:0
/sys/module/r8822be/parameters/disable_watchdog:N
/sys/module/r8822be/parameters/dma64:N
/sys/module/r8822be/parameters/fwlps:Y
/sys/module/r8822be/parameters/ips:Y
/sys/module/r8822be/parameters/msi:Y
/sys/module/r8822be/parameters/swenc:N
/sys/module/r8822be/parameters/swlps:N

The value 2 for ASPM also works correctly on ASUS X530UN.


I do not think this is a bug. Most motherboards work with the default value of 1 
for aspm. A few, such as yours need a value of 0. This reason is why the module 
parameter exists. You need to create the options file that you mention, and you 
will be fine. If we were to change the default in the driver to 0, we would 
break many more devices than would be fixed.


For anyone that might read this, the options file should be named 
/etc/modprobe.d/50-rtl8822be.conf and contain a single line "options rtl8822be 
aspm=0".


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


Re: [BUG] staging: r8822be: RTL8822be can't find any wireless AP

2018-07-04 Thread Daniel Drake
On Wed, Jul 4, 2018 at 8:04 AM, Dan Carpenter  wrote:
> I really prefer to see the whole dmesg instead of an edited ... in the
> middle.

Full log:
https://gist.github.com/dsd/20c05f0c6d66ee2ef9bfbb17f93f18ba

> I agree that it feels like the default aspm setting should be 2 (use
> what the chip says).  Although I don't know the device well enough to
> say if that will break anyone's system.  Perhaps someone who knows
> better will be able to respond.

Looking at the code for _rtl_pci_update_default_setting(), the meaning
of value 2 actually seems to be "enable ASPM on Intel platforms, and
disable on others".

But I suspect that code is not working right, because the system we
are using here is Intel-based and so my expectation would be that
value 2 leaves ASPM on and we would continue seeing the issue.
However, Jian-Hong reports it as working.

There are also some other reports that this driver doesn't work until
aspm is disabled:
https://bugzilla.redhat.com/show_bug.cgi?id=1464731#c21
https://ubuntuforums.org/showthread.php?t=2364383&page=4&p=13748721#post13748721
https://bugzilla.kernel.org/show_bug.cgi?id=199651

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


Re: [BUG] staging: r8822be: RTL8822be can't find any wireless AP

2018-07-04 Thread Dan Carpenter
On Wed, Jul 04, 2018 at 04:03:33PM +0800, Jian-Hong Pan wrote:
> Hi,
> 
> We have an ASUS X530UN (Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz)
> laptop equipped with Realtek rtl8822be wireless which cannot find any
> access point after WiFi is launched.
> 
> Realtek rtl8822be wireless' information:
> dev@endless:~/linux-eos$ sudo lspci -nnvs 02:00.0
> 02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd.
> Device [10ec:b822] (rev ff) (prog-if ff)
> !!! Unknown header type 7f
> Kernel driver in use: r8822be
> Kernel modules: r8822be
> 
> System always hits the error: "halmac_init_hal failed" in dmesg after
> WiFi is launched.
> 
> [ 8.591333] r8822be: module is from the staging directory, the quality
> is unknown, you have been warned.
> [ 8.593122] r8822be :02:00.0: enabling device ( -> 0003)
> [ 8.669163] r8822be: Using firmware rtlwifi/rtl8822befw.bin
> [ 9.289939] r8822be: rtlwifi: wireless switch is on
> [ 10.056426] r8822be :02:00.0 wlp2s0: renamed from wlan0
> ...
> [ 11.952534] r8822be: halmac_init_hal failed
> [ 11.955933] r8822be: halmac_init_hal failed
> [ 11.956227] r8822be: halmac_init_hal failed
> [ 22.007942] r8822be: halmac_init_hal failed

I really prefer to see the whole dmesg instead of an edited ... in the
middle.

I agree that it feels like the default aspm setting should be 2 (use
what the chip says).  Although I don't know the device well enough to
say if that will break anyone's system.  Perhaps someone who knows
better will be able to respond.

regards,
dan carpenter

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


Re: [PATCH 5/5] staging: rtl8192u: Refactor for coding style

2018-07-04 Thread Dan Carpenter
On Wed, Jul 04, 2018 at 12:59:25PM +0100, John Whitmore wrote:
> Changes to indentation and witespace issues in the ieee80211_softmac.c file.
> 

You're doing too much stuff in one patch.

regards,
dan carpenter

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


Re: [PATCH 3/5] staging: rtl8192u: Remove unused variable.

2018-07-04 Thread Dan Carpenter
On Wed, Jul 04, 2018 at 12:59:23PM +0100, John Whitmore wrote:
> Removed the unused variable from previously removed loop.
> 
> Signed-off-by: John Whitmore 

This is fixing a warning that was introduced in a previous patch in this
series.  That's not allowed.  Just fix the original patch instead.

regards,
dan carpenter

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


photo retouching you need

2018-07-04 Thread Julie

Hope you are doing well.

We provide you below imaging services today:
Such as ecommerce photos retouching, jewelry photos retouching, beauty and
skin image retouching,
and wedding photo editing, image cut out and clipping path, masking.

Our strength:
Quality is good
Turnaround time fast
7/24/365 available

You may send us a test photo to judge our quality.
Have a good day.

Thanks and Regards,
Julie

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


[PATCH 5/5] staging: rtl8192u: Refactor for coding style

2018-07-04 Thread John Whitmore
Changes to indentation and witespace issues in the ieee80211_softmac.c file.

Signed-off-by: John Whitmore 
---
 .../rtl8192u/ieee80211/ieee80211_softmac.c| 1015 +++--
 1 file changed, 443 insertions(+), 572 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 9d9a9e102bb8..b8e9322b72a1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -13,7 +13,6 @@
  * released under the GPL
  */
 
-
 #include "ieee80211.h"
 
 #include 
@@ -79,8 +78,7 @@ static void ieee80211_MFIE_Grate(struct ieee80211_device 
*ieee, u8 **tag_p)
 {
u8 *tag = *tag_p;
 
-   if (ieee->modulation & IEEE80211_OFDM_MODULATION) {
-
+   if (ieee->modulation & IEEE80211_OFDM_MODULATION) {
*tag++ = MFIE_TYPE_RATES_EX;
*tag++ = 8;
*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_6MB;
@@ -91,14 +89,12 @@ static void ieee80211_MFIE_Grate(struct ieee80211_device 
*ieee, u8 **tag_p)
*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_36MB;
*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_48MB;
*tag++ = IEEE80211_BASIC_RATE_MASK | IEEE80211_OFDM_RATE_54MB;
-
}
 
/* We may add an option for custom rates that specific HW might support 
*/
*tag_p = tag;
 }
 
-
 static void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p)
 {
u8 *tag = *tag_p;
@@ -112,11 +108,10 @@ static void ieee80211_WMM_Info(struct ieee80211_device 
*ieee, u8 **tag_p)
*tag++ = 0x00;
*tag++ = 0x01;
 #ifdef SUPPORT_USPD
-   if(ieee->current_network.wmm_info & 0x80) {
-   *tag++ = 0x0f|MAX_SP_Len;
-   } else {
+   if (ieee->current_network.wmm_info & 0x80)
+   *tag++ = 0x0f | MAX_SP_Len;
+   else
*tag++ = MAX_SP_Len;
-   }
 #else
*tag++ = MAX_SP_Len;
 #endif
@@ -147,7 +142,7 @@ static void enqueue_mgmt(struct ieee80211_device *ieee, 
struct sk_buff *skb)
 {
int nh;
 
-   nh = (ieee->mgmt_queue_head +1) % MGMT_QUEUE_NUM;
+   nh = (ieee->mgmt_queue_head + 1) % MGMT_QUEUE_NUM;
 
 /*
  * if the queue is full but we have newer frames then
@@ -166,13 +161,13 @@ static struct sk_buff *dequeue_mgmt(struct 
ieee80211_device *ieee)
 {
struct sk_buff *ret;
 
-   if(ieee->mgmt_queue_tail == ieee->mgmt_queue_head)
+   if (ieee->mgmt_queue_tail == ieee->mgmt_queue_head)
return NULL;
 
ret = ieee->mgmt_queue_ring[ieee->mgmt_queue_tail];
 
ieee->mgmt_queue_tail =
-   (ieee->mgmt_queue_tail+1) % MGMT_QUEUE_NUM;
+   (ieee->mgmt_queue_tail + 1) % MGMT_QUEUE_NUM;
 
return ret;
 }
@@ -188,16 +183,16 @@ static u8 MgntQuery_MgntFrameTxRate(struct 
ieee80211_device *ieee)
u8 rate;
 
/* 2008/01/25 MH For broadcom, MGNT frame set as OFDM 6M. */
-   if(pHTInfo->IOTAction & HT_IOT_ACT_MGNT_USE_CCK_6M)
+   if (pHTInfo->IOTAction & HT_IOT_ACT_MGNT_USE_CCK_6M)
rate = 0x0c;
else
rate = ieee->basic_rate & 0x7f;
 
if (rate == 0) {
/* 2005.01.26, by rcnjko. */
-   if(ieee->mode == IEEE_A||
-  ieee->mode== IEEE_N_5G||
-  (ieee->mode== IEEE_N_24G&&!pHTInfo->bCurSuppCCK))
+   if (ieee->mode == IEEE_A ||
+   ieee->mode == IEEE_N_5G ||
+   (ieee->mode == IEEE_N_24G && !pHTInfo->bCurSuppCCK))
rate = 0x0c;
else
rate = 0x02;
@@ -216,15 +211,14 @@ static u8 MgntQuery_MgntFrameTxRate(struct 
ieee80211_device *ieee)
return rate;
 }
 
-
 void ieee80211_sta_wakeup(struct ieee80211_device *ieee, short nl);
 
 inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device 
*ieee)
 {
unsigned long flags;
short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
-   struct rtl_80211_hdr_3addr  *header=
-   (struct rtl_80211_hdr_3addr  *) skb->data;
+   struct rtl_80211_hdr_3addr  *header =
+   (struct rtl_80211_hdr_3addr  *)skb->data;
 
struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 8);
 
@@ -239,11 +233,11 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee
tcb_desc->bTxDisableRateFallBack = 1;
tcb_desc->bTxUseDriverAssingedRate = 1;
 
-   if(single){
-   if(ieee->queue_stop){
+   if (single) {
+   if (ieee->queue_stop) {
enqueue_mgmt(ieee, skb);
-   }else{
-   header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0]<<4);
+   } else {
+   header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
 
  

[PATCH 2/5] staging: rtl8192u: Use memset to initialize memory, instead of loop.

2018-07-04 Thread John Whitmore
Replaced memory initialising loop with memset instead.

Suggested-by: Andy Shevchenko
Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index a549d9678214..327557176625 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -777,8 +777,7 @@ static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 
*pOperateMCS)
//legacy rate routine handled at selectedrate
 
//no MCS rate
-   for (i = 0; i <= 15; i++)
-   pOperateMCS[i] = 0;
+   memset(pOperateMCS, 0, 16);
break;
 
case IEEE_N_24G://assume CCK rate ok
-- 
2.17.1

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


[PATCH 1/5] staging: rtl8192u: Use __func__ instead of hardcoded string - Style

2018-07-04 Thread John Whitmore
Changed logging statements to use %s and __func__ instead of hard coding the
function name in a string.

Signed-off-by: John Whitmore 
---
 .../rtl8192u/ieee80211/rtl819x_HTProc.c   | 24 ++-
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 98d74d87bf11..a549d9678214 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -534,7 +534,9 @@ void HTConstructCapabilityElement(struct ieee80211_device 
*ieee, u8 *posHTCap, u
//u8 bIsDeclareMCS13;
 
if (!posHTCap || !pHT) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTCap or pHTInfo can't be 
null in HTConstructCapabilityElement()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "posHTCap or pHTInfo can't be null in %s\n",
+   __func__);
return;
}
memset(posHTCap, 0, *len);
@@ -645,7 +647,9 @@ void HTConstructInfoElement(struct ieee80211_device *ieee, 
u8 *posHTInfo, u8 *le
PHT_INFORMATION_ELE pHTInfoEle = 
(PHT_INFORMATION_ELE)posHTInfo;
 
if (!posHTInfo || !pHTInfoEle) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTInfo or pHTInfoEle 
can't be null in HTConstructInfoElement()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "posHTInfo or pHTInfoEle can't be null in %s\n",
+   __func__);
return;
}
 
@@ -709,7 +713,9 @@ void HTConstructInfoElement(struct ieee80211_device *ieee, 
u8 *posHTInfo, u8 *le
 void HTConstructRT2RTAggElement(struct ieee80211_device *ieee, u8 
*posRT2RTAgg, u8 *len)
 {
if (!posRT2RTAgg) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "posRT2RTAgg can't be null in 
HTConstructRT2RTAggElement()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "posRT2RTAgg can't be null in %s\n",
+   __func__);
return;
}
memset(posRT2RTAgg, 0, *len);
@@ -758,7 +764,9 @@ static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 
*pOperateMCS)
u8  i;
 
if (!pOperateMCS) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "pOperateMCS can't be null in 
HT_PickMCSRate()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "pOperateMCS can't be null in %s\n",
+   __func__);
return false;
}
 
@@ -820,7 +828,9 @@ u8 HTGetHighestMCSRate(struct ieee80211_device *ieee, u8 
*pMCSRateSet, u8 *pMCSF
u8  availableMcsRate[16];
 
if (!pMCSRateSet || !pMCSFilter) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "pMCSRateSet or pMCSFilter 
can't be null in HTGetHighestMCSRate()\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "pMCSRateSet or pMCSFilter can't be null in 
%s\n",
+   __func__);
return false;
}
for (i = 0; i < 16; i++)
@@ -900,7 +910,9 @@ void HTOnAssocRsp(struct ieee80211_device *ieee)
static u8   EWC11NHTInfo[] = {0x00, 0x90, 
0x4c, 0x34};  // For 11n EWC definition, 2007.07.17, by Emily
 
if (!pHTInfo->bCurrentHTSupport) {
-   IEEE80211_DEBUG(IEEE80211_DL_ERR, "<=== HTOnAssocRsp(): 
HT_DISABLE\n");
+   IEEE80211_DEBUG(IEEE80211_DL_ERR,
+   "<=== %s: HT_DISABLE\n",
+   __func__);
return;
}
IEEE80211_DEBUG(IEEE80211_DL_HT, "===> HTOnAssocRsp_wq(): HT_ENABLE\n");
-- 
2.17.1

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


[PATCH 4/5] staging: rtl8192u: Remove redundant definitions in header

2018-07-04 Thread John Whitmore
Truncated header file removing definitions which aren't used.

Signed-off-by: John Whitmore 
---
 .../staging/rtl8192u/ieee80211/rtl819x_HT.h   | 117 --
 1 file changed, 117 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index a85036022aa8..6abf32b142ef 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -7,21 +7,10 @@
 // reassociation request and probe response frames
 //
 
-//
-// Operation mode value
-//
-#define HT_OPMODE_NO_PROTECT   0
-#define HT_OPMODE_OPTIONAL 1
-#define HT_OPMODE_40MHZ_PROTECT2
-#define HT_OPMODE_MIXED3
-
 //
 // MIMO Power Save Settings
 //
 #define MIMO_PS_STATIC 0
-#define MIMO_PS_DYNAMIC1
-#define MIMO_PS_NOLIMIT3
-
 
 //
 // There should be 128 bits to cover all of the MCS rates. However, since
@@ -35,27 +24,6 @@
 #define HT_SUPPORTED_MCS_2SS_BITMAP
0xff00
 #define HT_SUPPORTED_MCS_1SS_2SS_BITMAP
HT_MCS_1SS_BITMAP|HT_MCS_1SS_2SS_BITMAP
 
-
-typedef enum _HT_MCS_RATE {
-   HT_MCS0   = 0x0001,
-   HT_MCS1   = 0x0002,
-   HT_MCS2   = 0x0004,
-   HT_MCS3   = 0x0008,
-   HT_MCS4   = 0x0010,
-   HT_MCS5   = 0x0020,
-   HT_MCS6   = 0x0040,
-   HT_MCS7   = 0x0080,
-   HT_MCS8   = 0x0100,
-   HT_MCS9   = 0x0200,
-   HT_MCS10 = 0x0400,
-   HT_MCS11 = 0x0800,
-   HT_MCS12 = 0x1000,
-   HT_MCS13 = 0x2000,
-   HT_MCS14 = 0x4000,
-   HT_MCS15 = 0x8000,
-   // Do not define MCS32 here although 8190 support MCS32
-} HT_MCS_RATE, *PHT_MCS_RATE;
-
 //
 // Represent Channel Width in HT Capabilities
 //
@@ -120,28 +88,6 @@ typedef union _HT_CAPABILITY_MACPARA{
 }HT_CAPABILITY_MACPARA, *PHT_CAPABILITY_MACPARA;
 */
 
-typedef enum _HT_ACTION {
-   ACT_RECOMMAND_WIDTH = 0,
-   ACT_MIMO_PWR_SAVE   = 1,
-   ACT_PSMP= 2,
-   ACT_SET_PCO_PHASE   = 3,
-   ACT_MIMO_CHL_MEASURE= 4,
-   ACT_RECIPROCITY_CORRECT = 5,
-   ACT_MIMO_CSI_MATRICS= 6,
-   ACT_MIMO_NOCOMPR_STEER  = 7,
-   ACT_MIMO_COMPR_STEER= 8,
-   ACT_ANTENNA_SELECT  = 9,
-} HT_ACTION, *PHT_ACTION;
-
-
-/* 2007/06/07 MH Define sub-carrier mode for 40MHZ. */
-typedef enum _HT_Bandwidth_40MHZ_Sub_Carrier {
-   SC_MODE_DUPLICATE = 0,
-   SC_MODE_LOWER = 1,
-   SC_MODE_UPPER = 2,
-   SC_MODE_FULL40MHZ = 3,
-}HT_BW40_SC_E;
-
 typedefstruct _HT_CAPABILITY_ELE {
 
//HT capability info
@@ -212,16 +158,6 @@ typedef struct _HT_INFORMATION_ELE {
u8  BasicMSC[16];
 } __attribute__ ((packed)) HT_INFORMATION_ELE, *PHT_INFORMATION_ELE;
 
-//
-// MIMO Power Save control field.
-// This is appear in MIMO Power Save Action Frame
-//
-typedef struct _MIMOPS_CTRL {
-   u8  MimoPsEnable:1;
-   u8  MimoPsMode:1;
-   u8  Reserved:6;
-} MIMOPS_CTRL, *PMIMOPS_CTRL;
-
 typedef enum _HT_SPEC_VER {
HT_SPEC_VER_IEEE = 0,
HT_SPEC_VER_EWC = 1,
@@ -342,37 +278,6 @@ typedef struct _RT_HIGH_THROUGHPUT {
u32 IOTAction;
 } __attribute__ ((packed)) RT_HIGH_THROUGHPUT, *PRT_HIGH_THROUGHPUT;
 
-
-//
-// The Data structure is used to keep HT related variable for "each Sta"
-// when card is configured as "AP mode"
-//
-
-typedef struct _RT_HTINFO_STA_ENTRY {
-   u8  bEnableHT;
-
-   u8  bSupportCck;
-
-   u16 AMSDU_MaxSize;
-
-   u8  AMPDU_Factor;
-   u8  MPDU_Density;
-
-   u8  HTHighestOperaRate;
-
-   u8  bBw40MHz;
-
-   u8  MimoPs;
-
-   u8  McsRateSet[16];
-
-
-}RT_HTINFO_STA_ENTRY, *PRT_HTINFO_STA_ENTRY;
-
-
-
-
-
 //
 // The Data structure is used to keep HT related variable for "each AP"
 // when card is configured as "STA mode"
@@ -396,28 +301,6 @@ typedef struct _BSS_HT {
u8  bdRT2RTLongSlotTime;
 } __attribute__ ((packed)) BSS_HT, *PBSS_HT;
 
-typedef struct _MIMO_RSSI {
-   u32 EnableAntenna;
-   u32 AntennaA;
-   u32 AntennaB;
-   u32 AntennaC;
-   u32 AntennaD;
-   u32 Average;
-}MIMO_RSSI, *PMIMO_RSSI;
-
-typedef struct _MIMO_EVM {
-   u32 EVM1;
-   u32EVM2;
-}MI

[PATCH 3/5] staging: rtl8192u: Remove unused variable.

2018-07-04 Thread John Whitmore
Removed the unused variable from previously removed loop.

Signed-off-by: John Whitmore 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 327557176625..abf55877331e 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -761,8 +761,6 @@ void HTConstructRT2RTAggElement(struct ieee80211_device 
*ieee, u8 *posRT2RTAgg,
  */
 static u8 HT_PickMCSRate(struct ieee80211_device *ieee, u8 *pOperateMCS)
 {
-   u8  i;
-
if (!pOperateMCS) {
IEEE80211_DEBUG(IEEE80211_DL_ERR,
"pOperateMCS can't be null in %s\n",
-- 
2.17.1

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


[PATCH 1/3] staging: rtl8188eu: rename Hal8188EPhyCfg.h

2018-07-04 Thread Michael Straube
Rename header file to avoid CamelCase.

Hal8188EPhyCfg.h -> hal8188e_phy_cfg.h

Signed-off-by: Michael Straube 
---
 .../rtl8188eu/include/{Hal8188EPhyCfg.h => hal8188e_phy_cfg.h}  | 0
 drivers/staging/rtl8188eu/include/hal_intf.h| 2 +-
 drivers/staging/rtl8188eu/include/rtl8188e_hal.h| 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename drivers/staging/rtl8188eu/include/{Hal8188EPhyCfg.h => 
hal8188e_phy_cfg.h} (100%)

diff --git a/drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h 
b/drivers/staging/rtl8188eu/include/hal8188e_phy_cfg.h
similarity index 100%
rename from drivers/staging/rtl8188eu/include/Hal8188EPhyCfg.h
rename to drivers/staging/rtl8188eu/include/hal8188e_phy_cfg.h
diff --git a/drivers/staging/rtl8188eu/include/hal_intf.h 
b/drivers/staging/rtl8188eu/include/hal_intf.h
index 5a706818d079..e5be27af7bf5 100644
--- a/drivers/staging/rtl8188eu/include/hal_intf.h
+++ b/drivers/staging/rtl8188eu/include/hal_intf.h
@@ -9,7 +9,7 @@
 
 #include 
 #include 
-#include 
+#include 
 
 enum RTL871X_HCI_TYPE {
RTW_PCIE= BIT(0),
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index 54d34976c721..e04e97e98ab7 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -11,7 +11,7 @@
 /* include HAL Related header after HAL Related compiling flags */
 #include "rtl8188e_spec.h"
 #include "Hal8188EPhyReg.h"
-#include "Hal8188EPhyCfg.h"
+#include "hal8188e_phy_cfg.h"
 #include "rtl8188e_dm.h"
 #include "rtl8188e_recv.h"
 #include "rtl8188e_xmit.h"
-- 
2.18.0

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


[PATCH 2/3] staging: rtl8188eu: rename Hal8188EPhyReg.h

2018-07-04 Thread Michael Straube
Rename header file to avoid CamelCase.

Hal8188EPhyReg.h -> hal8188e_phy_reg.h

Signed-off-by: Michael Straube 
---
 .../rtl8188eu/include/{Hal8188EPhyReg.h => hal8188e_phy_reg.h}  | 0
 drivers/staging/rtl8188eu/include/rtl8188e_hal.h| 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename drivers/staging/rtl8188eu/include/{Hal8188EPhyReg.h => 
hal8188e_phy_reg.h} (100%)

diff --git a/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h 
b/drivers/staging/rtl8188eu/include/hal8188e_phy_reg.h
similarity index 100%
rename from drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
rename to drivers/staging/rtl8188eu/include/hal8188e_phy_reg.h
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
index e04e97e98ab7..a86b07d3c82a 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_hal.h
@@ -10,7 +10,7 @@
 
 /* include HAL Related header after HAL Related compiling flags */
 #include "rtl8188e_spec.h"
-#include "Hal8188EPhyReg.h"
+#include "hal8188e_phy_reg.h"
 #include "hal8188e_phy_cfg.h"
 #include "rtl8188e_dm.h"
 #include "rtl8188e_recv.h"
-- 
2.18.0

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


[PATCH 3/3] staging: rtl8188eu: rename Hal8188ERateAdaptive

2018-07-04 Thread Michael Straube
Rename header and source file to avoid CamelCase.

Hal8188ERateAdaptive.h -> hal8188e_rate_adaptive.h
Hal8188ERateAdaptive.c -> hal8188e_rate_adaptive.c

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/Makefile  | 2 +-
 .../hal/{Hal8188ERateAdaptive.c => hal8188e_rate_adaptive.c}| 0
 .../{Hal8188ERateAdaptive.h => hal8188e_rate_adaptive.h}| 0
 drivers/staging/rtl8188eu/include/odm_precomp.h | 2 +-
 4 files changed, 2 insertions(+), 2 deletions(-)
 rename drivers/staging/rtl8188eu/hal/{Hal8188ERateAdaptive.c => 
hal8188e_rate_adaptive.c} (100%)
 rename drivers/staging/rtl8188eu/include/{Hal8188ERateAdaptive.h => 
hal8188e_rate_adaptive.h} (100%)

diff --git a/drivers/staging/rtl8188eu/Makefile 
b/drivers/staging/rtl8188eu/Makefile
index 033fb2e6950d..aa6ea65d05fe 100644
--- a/drivers/staging/rtl8188eu/Makefile
+++ b/drivers/staging/rtl8188eu/Makefile
@@ -24,7 +24,7 @@ r8188eu-y :=  \
hal/rf_cfg.o \
hal/pwrseqcmd.o \
hal/pwrseq.o \
-   hal/Hal8188ERateAdaptive.o\
+   hal/hal8188e_rate_adaptive.o \
hal/hal_intf.o  \
hal/hal_com.o   \
hal/odm.o   \
diff --git a/drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c 
b/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
similarity index 100%
rename from drivers/staging/rtl8188eu/hal/Hal8188ERateAdaptive.c
rename to drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
diff --git a/drivers/staging/rtl8188eu/include/Hal8188ERateAdaptive.h 
b/drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h
similarity index 100%
rename from drivers/staging/rtl8188eu/include/Hal8188ERateAdaptive.h
rename to drivers/staging/rtl8188eu/include/hal8188e_rate_adaptive.h
diff --git a/drivers/staging/rtl8188eu/include/odm_precomp.h 
b/drivers/staging/rtl8188eu/include/odm_precomp.h
index c01714be141f..f00967fd9599 100644
--- a/drivers/staging/rtl8188eu/include/odm_precomp.h
+++ b/drivers/staging/rtl8188eu/include/odm_precomp.h
@@ -26,7 +26,7 @@
 #include "odm_debug.h"
 #include "odm_RegDefine11N.h"
 
-#include "Hal8188ERateAdaptive.h"/* for  RA,Power training */
+#include "hal8188e_rate_adaptive.h" /* for RA,Power training */
 #include "rtl8188e_hal.h"
 
 #include "odm_reg.h"
-- 
2.18.0

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


Re: [PATCH 1/1] X86/Hyper-V:: Fix the circular dependency in IPI enlightenment.

2018-07-04 Thread Vitaly Kuznetsov
k...@linuxonhyperv.com writes:

> From: "K. Y. Srinivasan" 
>
> The IPI hypercalls depend on being able to map the Linux notion of CPU ID
> to the hypervisor's notion of the CPU ID. The array hv_vp_index[] provides
> this mapping. Code for populating this array depends on the IPI functionality.
> Break this circular dependency.
>
> Fixes: 68bb7bfb7985 ("X86/Hyper-V: Enable IPI enlightenments")
>
> Signed-off-by: K. Y. Srinivasan 
> Tested-by: Michael Kelley 
> ---
>  arch/x86/hyperv/hv_apic.c   | 5 +
>  arch/x86/hyperv/hv_init.c   | 5 -
>  arch/x86/include/asm/mshyperv.h | 2 ++
>  3 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/hyperv/hv_apic.c b/arch/x86/hyperv/hv_apic.c
> index f68855499391..63d7c196739f 100644
> --- a/arch/x86/hyperv/hv_apic.c
> +++ b/arch/x86/hyperv/hv_apic.c
> @@ -114,6 +114,8 @@ static bool __send_ipi_mask_ex(const struct cpumask 
> *mask, int vector)
>   ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K;
>   nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);
>   }
> + if (nr_bank == -1)
> + goto ipi_mask_ex_done;
>   if (!nr_bank)
>   ipi_arg->vp_set.format = HV_GENERIC_SET_ALL;
>
> @@ -158,6 +160,9 @@ static bool __send_ipi_mask(const struct cpumask *mask, 
> int vector)
>
>   for_each_cpu(cur_cpu, mask) {
>   vcpu = hv_cpu_number_to_vp_number(cur_cpu);
> + if (vcpu == -1)
> + goto ipi_mask_done;
> +

Nit: hv_vp_index is u32 *, it would make sense to use U32_MAX instead of
'-1' everywhere in this patch.

>   /*
>* This particular version of the IPI hypercall can
>* only target upto 64 CPUs.
> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
> index 4c431e1c1eff..04159893702e 100644
> --- a/arch/x86/hyperv/hv_init.c
> +++ b/arch/x86/hyperv/hv_init.c
> @@ -265,7 +265,7 @@ void __init hyperv_init(void)
>  {
>   u64 guest_id, required_msrs;
>   union hv_x64_msr_hypercall_contents hypercall_msr;
> - int cpuhp;
> + int cpuhp, i;
>
>   if (x86_hyper_type != X86_HYPER_MS_HYPERV)
>   return;
> @@ -293,6 +293,9 @@ void __init hyperv_init(void)
>   if (!hv_vp_index)
>   return;
>
> + for (i = 0; i < num_possible_cpus(); i++)
> + hv_vp_index[i] = -1;
> +
>   hv_vp_assist_page = kcalloc(num_possible_cpus(),
>   sizeof(*hv_vp_assist_page), GFP_KERNEL);
>   if (!hv_vp_assist_page) {
> diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
> index 3cd14311edfa..dee3f7347253 100644
> --- a/arch/x86/include/asm/mshyperv.h
> +++ b/arch/x86/include/asm/mshyperv.h
> @@ -281,6 +281,8 @@ static inline int cpumask_to_vpset(struct hv_vpset *vpset,
>*/
>   for_each_cpu(cpu, cpus) {
>   vcpu = hv_cpu_number_to_vp_number(cpu);
> + if (vcpu == -1)
> + return -1;
>   vcpu_bank = vcpu / 64;
>   vcpu_offset = vcpu % 64;
>   __set_bit(vcpu_offset, (unsigned long *)

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


Re: [bug report] staging: wilc1000: move the allocation of cmd out of wilc_enqueue_cmd()

2018-07-04 Thread Ajay Singh
Hi Dan,


On Tue, 3 Jul 2018 14:56:55 +0300
Dan Carpenter  wrote:

> Hello Ajay Singh,
> 
> The patch ff52a57a7a42: "staging: wilc1000: move the allocation of
> cmd out of wilc_enqueue_cmd()" from Jun 26, 2018, leads to the
> following static checker warning:
> 
>   drivers/staging/wilc1000/host_interface.c:3390 wilc_deinit()
>   warn: inconsistent returns 'hif_deinit_lock'.

Thanks for reporting the static check warning.

> 
> drivers/staging/wilc1000/host_interface.c
>   3348  mutex_lock(&hif_deinit_lock);
>   3349  
>   3350  terminated_handle = hif_drv;
>   3351  
>   3352  del_timer_sync(&hif_drv->scan_timer);
>   3353  del_timer_sync(&hif_drv->connect_timer);
>   3354  del_timer_sync(&periodic_rssi);
>   3355  del_timer_sync(&hif_drv->remain_on_ch_timer);
>   3356  
>   3357  wilc_set_wfi_drv_handler(vif, 0, 0, 0);
>   3358  wait_for_completion(&hif_driver_comp);
>   3359  
>   3360  if (hif_drv->usr_scan_req.scan_result) {
>   3361
> hif_drv->usr_scan_req.scan_result(SCAN_EVENT_ABORTED, NULL,
> 3362
> hif_drv->usr_scan_req.arg,
> 3363NULL);
> 3364  hif_drv->usr_scan_req.scan_result = NULL;
> 3365  } 3366 3367  hif_drv->hif_state = HOST_IF_IDLE;
>   3368  
>   3369  if (clients_count == 1) {
>   3370  struct host_if_msg *msg;
>   3371  
>   3372  msg = wilc_alloc_work(vif,
> handle_hif_exit_work, true); 3373  if (IS_ERR(msg))
>   3374  return PTR_ERR(msg);
>
> We should unlock.  Probably set terminated_handle to NULL as well?
> 

Sure, I will add the code to unlock and set the terminated_handle to
NULL and cleanup other variables.

As its error path during the cleanup flow, so i think we should
only avoid the posting of work_queue and rest of the cleanup code should
be executed to cleanup.

Something like below i.e instead of using direct return only block
code which depends on 'msg' under if condition and execute the rest of
cleanup code for all scenario.

if (!IS_ERR(msg)) {
result = wilc_enqueue_work(msg);
if (result)
netdev_err(vif->ndev, "deinit : Error(%d)\n",result);
else
wait_for_completion(&msg->work_comp);
kfree(msg);
}
destroy_workqueue(hif_workqueue);


I will include these changes and submit the patch. 

>   3375  
>   3376  result = wilc_enqueue_work(msg);
>   3377  if (result)
>   3378  netdev_err(vif->ndev, "deinit :
> Error(%d)\n", result); 3379  else
>   3380  wait_for_completion(&msg->work_comp);
>   3381  kfree(msg);
>   3382  destroy_workqueue(hif_workqueue);
>   3383  }
>   3384  
>   3385  kfree(hif_drv);
>   3386  
>   3387  clients_count--;
>   3388  terminated_handle = NULL;
>   3389  mutex_unlock(&hif_deinit_lock);
>   3390  return result;
>   3391  }
> 
> regards,
> dan carpenter
> ___
> 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 v2] staging: fsl-dpaa2/ethsw: Update maintainers for Ethernet Switch driver

2018-07-04 Thread Razvan Stefanescu
Removing myself as the maintainer for this driver and adding Ioana R.
and Ioana C.

Signed-off-by: Razvan Stefanescu 
Acked-by: Ioana Radulescu 
Acked-by: Ioana Ciornei 
---
Changelog
 v2
- add commit message and ack lines

 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index b6d0cc0..0d36546 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4434,7 +4434,8 @@ S:Maintained
 F: drivers/staging/fsl-dpaa2/ethernet
 
 DPAA2 ETHERNET SWITCH DRIVER
-M: Razvan Stefanescu 
+M: Ioana Radulescu 
+M: Ioana Ciornei 
 L: linux-ker...@vger.kernel.org
 S: Maintained
 F: drivers/staging/fsl-dpaa2/ethsw
-- 
1.9.1

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


[BUG] staging: r8822be: RTL8822be can't find any wireless AP

2018-07-04 Thread Jian-Hong Pan
Hi,

We have an ASUS X530UN (Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz)
laptop equipped with Realtek rtl8822be wireless which cannot find any
access point after WiFi is launched.

Realtek rtl8822be wireless' information:
dev@endless:~/linux-eos$ sudo lspci -nnvs 02:00.0
02:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd.
Device [10ec:b822] (rev ff) (prog-if ff)
!!! Unknown header type 7f
Kernel driver in use: r8822be
Kernel modules: r8822be

System always hits the error: "halmac_init_hal failed" in dmesg after
WiFi is launched.

[ 8.591333] r8822be: module is from the staging directory, the quality
is unknown, you have been warned.
[ 8.593122] r8822be :02:00.0: enabling device ( -> 0003)
[ 8.669163] r8822be: Using firmware rtlwifi/rtl8822befw.bin
[ 9.289939] r8822be: rtlwifi: wireless switch is on
[ 10.056426] r8822be :02:00.0 wlp2s0: renamed from wlan0
...
[ 11.952534] r8822be: halmac_init_hal failed
[ 11.955933] r8822be: halmac_init_hal failed
[ 11.956227] r8822be: halmac_init_hal failed
[ 22.007942] r8822be: halmac_init_hal failed

We noticed the r8822be module parameter "aspm"'s default value is 1.
Here is the parameter list of r8822be:
dev@endless:~$ sudo grep "" /sys/module/r8822be/parameters/*
/sys/module/r8822be/parameters/aspm:1
/sys/module/r8822be/parameters/debug_level:0
/sys/module/r8822be/parameters/debug_mask:0
/sys/module/r8822be/parameters/disable_watchdog:N
/sys/module/r8822be/parameters/dma64:N
/sys/module/r8822be/parameters/fwlps:Y
/sys/module/r8822be/parameters/ips:Y
/sys/module/r8822be/parameters/msi:Y
/sys/module/r8822be/parameters/swenc:N
/sys/module/r8822be/parameters/swlps:N

If I make a module options like "options r8822be aspm=0" which
disables ASPM and reboot, the WiFi works correctly.  It can find the
access points, then connects.
Here is the parameter list of r8822be:
dev@endless:~$ sudo grep "" /sys/module/r8822be/parameters/*
/sys/module/r8822be/parameters/aspm:0
/sys/module/r8822be/parameters/debug_level:0
/sys/module/r8822be/parameters/debug_mask:0
/sys/module/r8822be/parameters/disable_watchdog:N
/sys/module/r8822be/parameters/dma64:N
/sys/module/r8822be/parameters/fwlps:Y
/sys/module/r8822be/parameters/ips:Y
/sys/module/r8822be/parameters/msi:Y
/sys/module/r8822be/parameters/swenc:N
/sys/module/r8822be/parameters/swlps:N

This issue can be reproduced on Linux stable 4.16.17, 4.17.2 and
4.18.0-rc3. (I list versions that we have tried)

Besides, I also notice there is a comment in
drivers/staging/rtlwifi/rtl8822be/sw.c rtl8822be_init_aspm_vars
function.

/*
 * This setting works for those device with
 * backdoor ASPM setting such as EPHY setting.
 * 0 - Not support ASPM,
 * 1 - Support ASPM,
 * 2 - According to chipset.
 */

The value 2 for ASPM interests me.  It says "Enable or disable ASPM
according to chipset."
I tried the setting value 2 for ASPM.  Here is the parameter list of r8822be:
dev@endless:~$ sudo grep "" /sys/module/r8822be/parameters/*
/sys/module/r8822be/parameters/aspm:2
/sys/module/r8822be/parameters/debug_level:0
/sys/module/r8822be/parameters/debug_mask:0
/sys/module/r8822be/parameters/disable_watchdog:N
/sys/module/r8822be/parameters/dma64:N
/sys/module/r8822be/parameters/fwlps:Y
/sys/module/r8822be/parameters/ips:Y
/sys/module/r8822be/parameters/msi:Y
/sys/module/r8822be/parameters/swenc:N
/sys/module/r8822be/parameters/swlps:N

The value 2 for ASPM also works correctly on ASUS X530UN.

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