linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] brcmfmac: prohibit ACPI power management for brcmfmac driver
@ 2015-05-11  2:41 Fu, Zhonghui
  2015-05-18  6:26 ` Fu, Zhonghui
  2015-05-26 10:46 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Fu, Zhonghui @ 2015-05-11  2:41 UTC (permalink / raw)
  To: brudley, Arend van Spriel, Franky Lin, meuleman, Kalle Valo,
	pieterpg, hdegoede, linux-wireless, brcm80211-dev-list, netdev,
	linux-kernel

ACPI will manage WiFi chip's power state during suspend/resume
process on some tablet platforms(such as ASUS T100TA). This is
not supported by brcmfmac driver now, and the context of WiFi
chip will be damaged after resume. This patch informs ACPI not
to manage WiFi chip's power state.

Signed-off-by: Zhonghui Fu <zhonghui.fu@linux.intel.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
---
Changes in v3:
- Have the assignment separate for the if statement.

 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index 9b508bd..c960a12 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -33,6 +33,7 @@
 #include <linux/suspend.h>
 #include <linux/errno.h>
 #include <linux/module.h>
+#include <linux/acpi.h>
 #include <net/cfg80211.h>
 
 #include <defs.h>
@@ -1114,6 +1115,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
 	int err;
 	struct brcmf_sdio_dev *sdiodev;
 	struct brcmf_bus *bus_if;
+	struct device *dev;
+	struct acpi_device *adev;
 
 	brcmf_dbg(SDIO, "Enter\n");
 	brcmf_dbg(SDIO, "Class=%x\n", func->class);
@@ -1121,6 +1124,12 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
 	brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device);
 	brcmf_dbg(SDIO, "Function#: %d\n", func->num);
 
+	/* prohibit ACPI power management for this device */
+	dev = &func->dev;
+	adev = ACPI_COMPANION(dev);
+	if (adev)
+		adev->flags.power_manageable = 0;
+
 	/* Consume func num 1 but dont do anything with it. */
 	if (func->num == 1)
 		return 0;
-- 1.7.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] brcmfmac: prohibit ACPI power management for brcmfmac driver
  2015-05-11  2:41 [PATCH v3] brcmfmac: prohibit ACPI power management for brcmfmac driver Fu, Zhonghui
@ 2015-05-18  6:26 ` Fu, Zhonghui
  2015-05-20  9:02   ` Arend van Spriel
  2015-05-26 10:46 ` Kalle Valo
  1 sibling, 1 reply; 5+ messages in thread
From: Fu, Zhonghui @ 2015-05-18  6:26 UTC (permalink / raw)
  To: brudley, Arend van Spriel, Franky Lin, meuleman, Kalle Valo,
	pieterpg, hdegoede, linux-wireless, brcm80211-dev-list, netdev,
	linux-kernel


Hi guys,

Any comments about this patch?



Thanks,
Zhonghui

On 2015/5/11 10:41, Fu, Zhonghui wrote:
> ACPI will manage WiFi chip's power state during suspend/resume
> process on some tablet platforms(such as ASUS T100TA). This is
> not supported by brcmfmac driver now, and the context of WiFi
> chip will be damaged after resume. This patch informs ACPI not
> to manage WiFi chip's power state.
>
> Signed-off-by: Zhonghui Fu <zhonghui.fu@linux.intel.com>
> Acked-by: Arend van Spriel <arend@broadcom.com>
> ---
> Changes in v3:
> - Have the assignment separate for the if statement.
>
>  drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> index 9b508bd..c960a12 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
> @@ -33,6 +33,7 @@
>  #include <linux/suspend.h>
>  #include <linux/errno.h>
>  #include <linux/module.h>
> +#include <linux/acpi.h>
>  #include <net/cfg80211.h>
>  
>  #include <defs.h>
> @@ -1114,6 +1115,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
>  	int err;
>  	struct brcmf_sdio_dev *sdiodev;
>  	struct brcmf_bus *bus_if;
> +	struct device *dev;
> +	struct acpi_device *adev;
>  
>  	brcmf_dbg(SDIO, "Enter\n");
>  	brcmf_dbg(SDIO, "Class=%x\n", func->class);
> @@ -1121,6 +1124,12 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
>  	brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device);
>  	brcmf_dbg(SDIO, "Function#: %d\n", func->num);
>  
> +	/* prohibit ACPI power management for this device */
> +	dev = &func->dev;
> +	adev = ACPI_COMPANION(dev);
> +	if (adev)
> +		adev->flags.power_manageable = 0;
> +
>  	/* Consume func num 1 but dont do anything with it. */
>  	if (func->num == 1)
>  		return 0;
> -- 1.7.1
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] brcmfmac: prohibit ACPI power management for brcmfmac driver
  2015-05-18  6:26 ` Fu, Zhonghui
@ 2015-05-20  9:02   ` Arend van Spriel
  2015-05-26  3:52     ` Fu, Zhonghui
  0 siblings, 1 reply; 5+ messages in thread
From: Arend van Spriel @ 2015-05-20  9:02 UTC (permalink / raw)
  To: Fu, Zhonghui
  Cc: brudley, Franky Lin, meuleman, Kalle Valo, pieterpg, hdegoede,
	linux-wireless, brcm80211-dev-list, netdev, linux-kernel

On 05/18/15 08:26, Fu, Zhonghui wrote:
>
> Hi guys,
>
> Any comments about this patch?

My acked is already there. I have not been able to test it, but I assume 
you did.

Regards,
Arend

> Thanks,
> Zhonghui
>
> On 2015/5/11 10:41, Fu, Zhonghui wrote:
>> ACPI will manage WiFi chip's power state during suspend/resume
>> process on some tablet platforms(such as ASUS T100TA). This is
>> not supported by brcmfmac driver now, and the context of WiFi
>> chip will be damaged after resume. This patch informs ACPI not
>> to manage WiFi chip's power state.
>>
>> Signed-off-by: Zhonghui Fu<zhonghui.fu@linux.intel.com>
>> Acked-by: Arend van Spriel<arend@broadcom.com>
>> ---
>> Changes in v3:
>> - Have the assignment separate for the if statement.
>>
>>   drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |    9 +++++++++
>>   1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>> index 9b508bd..c960a12 100644
>> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>> @@ -33,6 +33,7 @@
>>   #include<linux/suspend.h>
>>   #include<linux/errno.h>
>>   #include<linux/module.h>
>> +#include<linux/acpi.h>
>>   #include<net/cfg80211.h>
>>
>>   #include<defs.h>
>> @@ -1114,6 +1115,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
>>   	int err;
>>   	struct brcmf_sdio_dev *sdiodev;
>>   	struct brcmf_bus *bus_if;
>> +	struct device *dev;
>> +	struct acpi_device *adev;
>>
>>   	brcmf_dbg(SDIO, "Enter\n");
>>   	brcmf_dbg(SDIO, "Class=%x\n", func->class);
>> @@ -1121,6 +1124,12 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
>>   	brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device);
>>   	brcmf_dbg(SDIO, "Function#: %d\n", func->num);
>>
>> +	/* prohibit ACPI power management for this device */
>> +	dev =&func->dev;
>> +	adev = ACPI_COMPANION(dev);
>> +	if (adev)
>> +		adev->flags.power_manageable = 0;
>> +
>>   	/* Consume func num 1 but dont do anything with it. */
>>   	if (func->num == 1)
>>   		return 0;
>> -- 1.7.1
>>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] brcmfmac: prohibit ACPI power management for brcmfmac driver
  2015-05-20  9:02   ` Arend van Spriel
@ 2015-05-26  3:52     ` Fu, Zhonghui
  0 siblings, 0 replies; 5+ messages in thread
From: Fu, Zhonghui @ 2015-05-26  3:52 UTC (permalink / raw)
  To: Arend van Spriel, Kalle Valo
  Cc: brudley, Franky Lin, meuleman, pieterpg, hdegoede,
	linux-wireless, brcm80211-dev-list, netdev, linux-kernel



On 2015/5/20 17:02, Arend van Spriel wrote:
> On 05/18/15 08:26, Fu, Zhonghui wrote:
>>
>> Hi guys,
>>
>> Any comments about this patch?
>
> My acked is already there. I have not been able to test it, but I assume you did.

Yes, I have verified this patch on ASUS T100TA.

Thanks,
Zhonghui
>
> Regards,
> Arend
>
>> Thanks,
>> Zhonghui
>>
>> On 2015/5/11 10:41, Fu, Zhonghui wrote:
>>> ACPI will manage WiFi chip's power state during suspend/resume
>>> process on some tablet platforms(such as ASUS T100TA). This is
>>> not supported by brcmfmac driver now, and the context of WiFi
>>> chip will be damaged after resume. This patch informs ACPI not
>>> to manage WiFi chip's power state.
>>>
>>> Signed-off-by: Zhonghui Fu<zhonghui.fu@linux.intel.com>
>>> Acked-by: Arend van Spriel<arend@broadcom.com>
>>> ---
>>> Changes in v3:
>>> - Have the assignment separate for the if statement.
>>>
>>>   drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |    9 +++++++++
>>>   1 files changed, 9 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>>> index 9b508bd..c960a12 100644
>>> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>>> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
>>> @@ -33,6 +33,7 @@
>>>   #include<linux/suspend.h>
>>>   #include<linux/errno.h>
>>>   #include<linux/module.h>
>>> +#include<linux/acpi.h>
>>>   #include<net/cfg80211.h>
>>>
>>>   #include<defs.h>
>>> @@ -1114,6 +1115,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
>>>       int err;
>>>       struct brcmf_sdio_dev *sdiodev;
>>>       struct brcmf_bus *bus_if;
>>> +    struct device *dev;
>>> +    struct acpi_device *adev;
>>>
>>>       brcmf_dbg(SDIO, "Enter\n");
>>>       brcmf_dbg(SDIO, "Class=%x\n", func->class);
>>> @@ -1121,6 +1124,12 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
>>>       brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device);
>>>       brcmf_dbg(SDIO, "Function#: %d\n", func->num);
>>>
>>> +    /* prohibit ACPI power management for this device */
>>> +    dev =&func->dev;
>>> +    adev = ACPI_COMPANION(dev);
>>> +    if (adev)
>>> +        adev->flags.power_manageable = 0;
>>> +
>>>       /* Consume func num 1 but dont do anything with it. */
>>>       if (func->num == 1)
>>>           return 0;
>>> -- 1.7.1
>>>
>>
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] brcmfmac: prohibit ACPI power management for brcmfmac driver
  2015-05-11  2:41 [PATCH v3] brcmfmac: prohibit ACPI power management for brcmfmac driver Fu, Zhonghui
  2015-05-18  6:26 ` Fu, Zhonghui
@ 2015-05-26 10:46 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2015-05-26 10:46 UTC (permalink / raw)
  To: Fu, Zhonghui
  Cc: brudley, Arend van Spriel, Franky Lin, meuleman, pieterpg,
	hdegoede, linux-wireless, brcm80211-dev-list, netdev,
	linux-kernel

"Fu, Zhonghui" <zhonghui.fu@linux.intel.com> writes:

> ACPI will manage WiFi chip's power state during suspend/resume
> process on some tablet platforms(such as ASUS T100TA). This is
> not supported by brcmfmac driver now, and the context of WiFi
> chip will be damaged after resume. This patch informs ACPI not
> to manage WiFi chip's power state.
>
> Signed-off-by: Zhonghui Fu <zhonghui.fu@linux.intel.com>
> Acked-by: Arend van Spriel <arend@broadcom.com>

Thanks, applied to wireless-drivers-next.git.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-26 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11  2:41 [PATCH v3] brcmfmac: prohibit ACPI power management for brcmfmac driver Fu, Zhonghui
2015-05-18  6:26 ` Fu, Zhonghui
2015-05-20  9:02   ` Arend van Spriel
2015-05-26  3:52     ` Fu, Zhonghui
2015-05-26 10:46 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).