linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] Fix WWAN device disabled issue after S3 deep
@ 2021-11-08  6:06 Slark Xiao
  2021-11-08  6:13 ` Slark Xiao
  2021-11-08 14:32 ` [PATCH " Hans de Goede
  0 siblings, 2 replies; 6+ messages in thread
From: Slark Xiao @ 2021-11-08  6:06 UTC (permalink / raw)
  To: hmh, hdegoede, mgross
  Cc: markpearson, njoshi1, ibm-acpi-devel, platform-driver-x86,
	linux-kernel, Slark Xiao

When WWAN device wake from S3 deep, under thinkpad platform,
WWAN would be disabled. This disable status could be checked
by command 'nmcli r wwan' or 'rfkill list'.

Issue analysis as below:
  When host resume from S3 deep, thinkpad_acpi driver would
call hotkey_resume() function. Finnaly, it will use
wan_get_status to check the current status of WWAN device.
During this resume progress, wan_get_status would always
return off even WWAN boot up completely.
  In patch V2, Hans said 'sw_state should be unchanged
after a suspend/resume. It's better to drop the
tpacpi_rfk_update_swstate call all together from the
resume path'.
  And it's confimed by Lenovo that GWAN is no longer
 available from WHL generation because the design does not
 match with current pin control.

Signed-off-by: Slark Xiao <slark_xiao@163.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 50ff04c84650..f1cbd27282e1 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1178,15 +1178,6 @@ static int tpacpi_rfk_update_swstate(const struct tpacpi_rfk *tp_rfk)
 	return status;
 }
 
-/* Query FW and update rfkill sw state for all rfkill switches */
-static void tpacpi_rfk_update_swstate_all(void)
-{
-	unsigned int i;
-
-	for (i = 0; i < TPACPI_RFK_SW_MAX; i++)
-		tpacpi_rfk_update_swstate(tpacpi_rfkill_switches[i]);
-}
-
 /*
  * Sync the HW-blocking state of all rfkill switches,
  * do notice it causes the rfkill core to schedule uevents
@@ -3129,9 +3120,6 @@ static void tpacpi_send_radiosw_update(void)
 	if (wlsw == TPACPI_RFK_RADIO_OFF)
 		tpacpi_rfk_update_hwblock_state(true);
 
-	/* Sync sw blocking state */
-	tpacpi_rfk_update_swstate_all();
-
 	/* Sync hw blocking state last if it is hw-unblocked */
 	if (wlsw == TPACPI_RFK_RADIO_ON)
 		tpacpi_rfk_update_hwblock_state(false);
-- 
2.25.1


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

* Re:[PATCH v3] Fix WWAN device disabled issue after S3 deep
  2021-11-08  6:06 [PATCH v3] Fix WWAN device disabled issue after S3 deep Slark Xiao
@ 2021-11-08  6:13 ` Slark Xiao
  2021-11-08 14:32 ` [PATCH " Hans de Goede
  1 sibling, 0 replies; 6+ messages in thread
From: Slark Xiao @ 2021-11-08  6:13 UTC (permalink / raw)
  To: hmh, hdegoede, mgross
  Cc: markpearson, njoshi1, ibm-acpi-devel, platform-driver-x86, linux-kernel

Correct address for platform-driver-x86.

At 2021-11-08 14:06:48, "Slark Xiao" <slark_xiao@163.com> wrote:
>When WWAN device wake from S3 deep, under thinkpad platform,
>WWAN would be disabled. This disable status could be checked
>by command 'nmcli r wwan' or 'rfkill list'.
>
>Issue analysis as below:
>  When host resume from S3 deep, thinkpad_acpi driver would
>call hotkey_resume() function. Finnaly, it will use
>wan_get_status to check the current status of WWAN device.
>During this resume progress, wan_get_status would always
>return off even WWAN boot up completely.
>  In patch V2, Hans said 'sw_state should be unchanged
>after a suspend/resume. It's better to drop the
>tpacpi_rfk_update_swstate call all together from the
>resume path'.
>  And it's confimed by Lenovo that GWAN is no longer
> available from WHL generation because the design does not
> match with current pin control.
>
>Signed-off-by: Slark Xiao <slark_xiao@163.com>
>---
> drivers/platform/x86/thinkpad_acpi.c | 12 ------------
> 1 file changed, 12 deletions(-)
>
>diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
>index 50ff04c84650..f1cbd27282e1 100644
>--- a/drivers/platform/x86/thinkpad_acpi.c
>+++ b/drivers/platform/x86/thinkpad_acpi.c
>@@ -1178,15 +1178,6 @@ static int tpacpi_rfk_update_swstate(const struct tpacpi_rfk *tp_rfk)
> 	return status;
> }
> 
>-/* Query FW and update rfkill sw state for all rfkill switches */
>-static void tpacpi_rfk_update_swstate_all(void)
>-{
>-	unsigned int i;
>-
>-	for (i = 0; i < TPACPI_RFK_SW_MAX; i++)
>-		tpacpi_rfk_update_swstate(tpacpi_rfkill_switches[i]);
>-}
>-
> /*
>  * Sync the HW-blocking state of all rfkill switches,
>  * do notice it causes the rfkill core to schedule uevents
>@@ -3129,9 +3120,6 @@ static void tpacpi_send_radiosw_update(void)
> 	if (wlsw == TPACPI_RFK_RADIO_OFF)
> 		tpacpi_rfk_update_hwblock_state(true);
> 
>-	/* Sync sw blocking state */
>-	tpacpi_rfk_update_swstate_all();
>-
> 	/* Sync hw blocking state last if it is hw-unblocked */
> 	if (wlsw == TPACPI_RFK_RADIO_ON)
> 		tpacpi_rfk_update_hwblock_state(false);
>-- 
>2.25.1

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

* Re: [PATCH v3] Fix WWAN device disabled issue after S3 deep
  2021-11-08  6:06 [PATCH v3] Fix WWAN device disabled issue after S3 deep Slark Xiao
  2021-11-08  6:13 ` Slark Xiao
@ 2021-11-08 14:32 ` Hans de Goede
  2021-11-09  2:06   ` Slark Xiao
  1 sibling, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2021-11-08 14:32 UTC (permalink / raw)
  To: Slark Xiao, hmh, mgross
  Cc: markpearson, njoshi1, ibm-acpi-devel, platform-driver-x86, linux-kernel

Hi,

On 11/8/21 07:06, Slark Xiao wrote:
> When WWAN device wake from S3 deep, under thinkpad platform,
> WWAN would be disabled. This disable status could be checked
> by command 'nmcli r wwan' or 'rfkill list'.
> 
> Issue analysis as below:
>   When host resume from S3 deep, thinkpad_acpi driver would
> call hotkey_resume() function. Finnaly, it will use
> wan_get_status to check the current status of WWAN device.
> During this resume progress, wan_get_status would always
> return off even WWAN boot up completely.
>   In patch V2, Hans said 'sw_state should be unchanged
> after a suspend/resume. It's better to drop the
> tpacpi_rfk_update_swstate call all together from the
> resume path'.
>   And it's confimed by Lenovo that GWAN is no longer
>  available from WHL generation because the design does not
>  match with current pin control.
> 
> Signed-off-by: Slark Xiao <slark_xiao@163.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

I will merge this once 5.16-rc1 is out.

Regards,

Hans

> ---
>  drivers/platform/x86/thinkpad_acpi.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 50ff04c84650..f1cbd27282e1 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -1178,15 +1178,6 @@ static int tpacpi_rfk_update_swstate(const struct tpacpi_rfk *tp_rfk)
>  	return status;
>  }
>  
> -/* Query FW and update rfkill sw state for all rfkill switches */
> -static void tpacpi_rfk_update_swstate_all(void)
> -{
> -	unsigned int i;
> -
> -	for (i = 0; i < TPACPI_RFK_SW_MAX; i++)
> -		tpacpi_rfk_update_swstate(tpacpi_rfkill_switches[i]);
> -}
> -
>  /*
>   * Sync the HW-blocking state of all rfkill switches,
>   * do notice it causes the rfkill core to schedule uevents
> @@ -3129,9 +3120,6 @@ static void tpacpi_send_radiosw_update(void)
>  	if (wlsw == TPACPI_RFK_RADIO_OFF)
>  		tpacpi_rfk_update_hwblock_state(true);
>  
> -	/* Sync sw blocking state */
> -	tpacpi_rfk_update_swstate_all();
> -
>  	/* Sync hw blocking state last if it is hw-unblocked */
>  	if (wlsw == TPACPI_RFK_RADIO_ON)
>  		tpacpi_rfk_update_hwblock_state(false);
> 


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

* Re:Re: [PATCH v3] Fix WWAN device disabled issue after S3 deep
  2021-11-08 14:32 ` [PATCH " Hans de Goede
@ 2021-11-09  2:06   ` Slark Xiao
  2021-11-16  6:40     ` Slark Xiao
  0 siblings, 1 reply; 6+ messages in thread
From: Slark Xiao @ 2021-11-09  2:06 UTC (permalink / raw)
  To: Hans de Goede
  Cc: hmh, mgross, markpearson, njoshi1, ibm-acpi-devel,
	platform-driver-x86, linux-kernel



At 2021-11-08 22:32:56, "Hans de Goede" <hdegoede@redhat.com> wrote:
>Hi,
>
>On 11/8/21 07:06, Slark Xiao wrote:
>> When WWAN device wake from S3 deep, under thinkpad platform,
>> WWAN would be disabled. This disable status could be checked
>> by command 'nmcli r wwan' or 'rfkill list'.
>> 
>> Issue analysis as below:
>>   When host resume from S3 deep, thinkpad_acpi driver would
>> call hotkey_resume() function. Finnaly, it will use
>> wan_get_status to check the current status of WWAN device.
>> During this resume progress, wan_get_status would always
>> return off even WWAN boot up completely.
>>   In patch V2, Hans said 'sw_state should be unchanged
>> after a suspend/resume. It's better to drop the
>> tpacpi_rfk_update_swstate call all together from the
>> resume path'.
>>   And it's confimed by Lenovo that GWAN is no longer
>>  available from WHL generation because the design does not
>>  match with current pin control.
>> 
>> Signed-off-by: Slark Xiao <slark_xiao@163.com>
>
>Thanks, patch looks good to me:
>
>Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>
>I will merge this once 5.16-rc1 is out.
>
>Regards,
>
>Hans
Hi Hans,
   Thanks for that!

Regards,
Slark
>
>> ---
>>  drivers/platform/x86/thinkpad_acpi.c | 12 ------------
>>  1 file changed, 12 deletions(-)
>> 
>> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
>> index 50ff04c84650..f1cbd27282e1 100644
>> --- a/drivers/platform/x86/thinkpad_acpi.c
>> +++ b/drivers/platform/x86/thinkpad_acpi.c
>> @@ -1178,15 +1178,6 @@ static int tpacpi_rfk_update_swstate(const struct tpacpi_rfk *tp_rfk)
>>  	return status;
>>  }
>>  
>> -/* Query FW and update rfkill sw state for all rfkill switches */
>> -static void tpacpi_rfk_update_swstate_all(void)
>> -{
>> -	unsigned int i;
>> -
>> -	for (i = 0; i < TPACPI_RFK_SW_MAX; i++)
>> -		tpacpi_rfk_update_swstate(tpacpi_rfkill_switches[i]);
>> -}
>> -
>>  /*
>>   * Sync the HW-blocking state of all rfkill switches,
>>   * do notice it causes the rfkill core to schedule uevents
>> @@ -3129,9 +3120,6 @@ static void tpacpi_send_radiosw_update(void)
>>  	if (wlsw == TPACPI_RFK_RADIO_OFF)
>>  		tpacpi_rfk_update_hwblock_state(true);
>>  
>> -	/* Sync sw blocking state */
>> -	tpacpi_rfk_update_swstate_all();
>> -
>>  	/* Sync hw blocking state last if it is hw-unblocked */
>>  	if (wlsw == TPACPI_RFK_RADIO_ON)
>>  		tpacpi_rfk_update_hwblock_state(false);
>> 

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

* Re:Re:Re: [PATCH v3] Fix WWAN device disabled issue after S3 deep
  2021-11-09  2:06   ` Slark Xiao
@ 2021-11-16  6:40     ` Slark Xiao
  2021-11-16 10:02       ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Slark Xiao @ 2021-11-16  6:40 UTC (permalink / raw)
  To: Hans de Goede
  Cc: hmh, mgross, markpearson, njoshi1, ibm-acpi-devel, linux-kernel,
	platform-driver-x86




At 2021-11-09 10:06:21, "Slark Xiao" <slark_xiao@163.com> wrote:
>
>
>At 2021-11-08 22:32:56, "Hans de Goede" <hdegoede@redhat.com> wrote:
>>Hi,
>>
>>On 11/8/21 07:06, Slark Xiao wrote:
>>> When WWAN device wake from S3 deep, under thinkpad platform,
>>> WWAN would be disabled. This disable status could be checked
>>> by command 'nmcli r wwan' or 'rfkill list'.
>>> 
>>> Issue analysis as below:
>>>   When host resume from S3 deep, thinkpad_acpi driver would
>>> call hotkey_resume() function. Finnaly, it will use
>>> wan_get_status to check the current status of WWAN device.
>>> During this resume progress, wan_get_status would always
>>> return off even WWAN boot up completely.
>>>   In patch V2, Hans said 'sw_state should be unchanged
>>> after a suspend/resume. It's better to drop the
>>> tpacpi_rfk_update_swstate call all together from the
>>> resume path'.
>>>   And it's confimed by Lenovo that GWAN is no longer
>>>  available from WHL generation because the design does not
>>>  match with current pin control.
>>> 
>>> Signed-off-by: Slark Xiao <slark_xiao@163.com>
>>
>>Thanks, patch looks good to me:
>>
>>Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>
>>I will merge this once 5.16-rc1 is out.
>>
>>Regards,
>>
Hi Hans,
  5.16-rc1 is already out. Could you help merge this patch into baseline now?

Thanks!
Slark Xiao
>>
>>> ---
>>>  drivers/platform/x86/thinkpad_acpi.c | 12 ------------
>>>  1 file changed, 12 deletions(-)
>>> 
>>> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
>>> index 50ff04c84650..f1cbd27282e1 100644
>>> --- a/drivers/platform/x86/thinkpad_acpi.c
>>> +++ b/drivers/platform/x86/thinkpad_acpi.c
>>> @@ -1178,15 +1178,6 @@ static int tpacpi_rfk_update_swstate(const struct tpacpi_rfk *tp_rfk)
>>>  	return status;
>>>  }
>>>  
>>> -/* Query FW and update rfkill sw state for all rfkill switches */
>>> -static void tpacpi_rfk_update_swstate_all(void)
>>> -{
>>> -	unsigned int i;
>>> -
>>> -	for (i = 0; i < TPACPI_RFK_SW_MAX; i++)
>>> -		tpacpi_rfk_update_swstate(tpacpi_rfkill_switches[i]);
>>> -}
>>> -
>>>  /*
>>>   * Sync the HW-blocking state of all rfkill switches,
>>>   * do notice it causes the rfkill core to schedule uevents
>>> @@ -3129,9 +3120,6 @@ static void tpacpi_send_radiosw_update(void)
>>>  	if (wlsw == TPACPI_RFK_RADIO_OFF)
>>>  		tpacpi_rfk_update_hwblock_state(true);
>>>  
>>> -	/* Sync sw blocking state */
>>> -	tpacpi_rfk_update_swstate_all();
>>> -
>>>  	/* Sync hw blocking state last if it is hw-unblocked */
>>>  	if (wlsw == TPACPI_RFK_RADIO_ON)
>>>  		tpacpi_rfk_update_hwblock_state(false);
>>> 

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

* Re: [PATCH v3] Fix WWAN device disabled issue after S3 deep
  2021-11-16  6:40     ` Slark Xiao
@ 2021-11-16 10:02       ` Hans de Goede
  0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2021-11-16 10:02 UTC (permalink / raw)
  To: Slark Xiao
  Cc: hmh, mgross, markpearson, njoshi1, ibm-acpi-devel, linux-kernel,
	platform-driver-x86

Hi,

On 11/16/21 07:40, Slark Xiao wrote:
> 
> 
> 
> At 2021-11-09 10:06:21, "Slark Xiao" <slark_xiao@163.com> wrote:
>>
>>
>> At 2021-11-08 22:32:56, "Hans de Goede" <hdegoede@redhat.com> wrote:
>>> Hi,
>>>
>>> On 11/8/21 07:06, Slark Xiao wrote:
>>>> When WWAN device wake from S3 deep, under thinkpad platform,
>>>> WWAN would be disabled. This disable status could be checked
>>>> by command 'nmcli r wwan' or 'rfkill list'.
>>>>
>>>> Issue analysis as below:
>>>>   When host resume from S3 deep, thinkpad_acpi driver would
>>>> call hotkey_resume() function. Finnaly, it will use
>>>> wan_get_status to check the current status of WWAN device.
>>>> During this resume progress, wan_get_status would always
>>>> return off even WWAN boot up completely.
>>>>   In patch V2, Hans said 'sw_state should be unchanged
>>>> after a suspend/resume. It's better to drop the
>>>> tpacpi_rfk_update_swstate call all together from the
>>>> resume path'.
>>>>   And it's confimed by Lenovo that GWAN is no longer
>>>>  available from WHL generation because the design does not
>>>>  match with current pin control.
>>>>
>>>> Signed-off-by: Slark Xiao <slark_xiao@163.com>
>>>
>>> Thanks, patch looks good to me:
>>>
>>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>>
>>> I will merge this once 5.16-rc1 is out.
>>>
>>> Regards,
>>>
> Hi Hans,
>   5.16-rc1 is already out. Could you help merge this patch into baseline now?

5.16-rc1 has only been out for 1 day, some patience please!

But yes I plan to send a fixes pull-req to Linus later today
including this fix.

Regards,

Hans




>>>> ---
>>>>  drivers/platform/x86/thinkpad_acpi.c | 12 ------------
>>>>  1 file changed, 12 deletions(-)
>>>>
>>>> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
>>>> index 50ff04c84650..f1cbd27282e1 100644
>>>> --- a/drivers/platform/x86/thinkpad_acpi.c
>>>> +++ b/drivers/platform/x86/thinkpad_acpi.c
>>>> @@ -1178,15 +1178,6 @@ static int tpacpi_rfk_update_swstate(const struct tpacpi_rfk *tp_rfk)
>>>>  	return status;
>>>>  }
>>>>  
>>>> -/* Query FW and update rfkill sw state for all rfkill switches */
>>>> -static void tpacpi_rfk_update_swstate_all(void)
>>>> -{
>>>> -	unsigned int i;
>>>> -
>>>> -	for (i = 0; i < TPACPI_RFK_SW_MAX; i++)
>>>> -		tpacpi_rfk_update_swstate(tpacpi_rfkill_switches[i]);
>>>> -}
>>>> -
>>>>  /*
>>>>   * Sync the HW-blocking state of all rfkill switches,
>>>>   * do notice it causes the rfkill core to schedule uevents
>>>> @@ -3129,9 +3120,6 @@ static void tpacpi_send_radiosw_update(void)
>>>>  	if (wlsw == TPACPI_RFK_RADIO_OFF)
>>>>  		tpacpi_rfk_update_hwblock_state(true);
>>>>  
>>>> -	/* Sync sw blocking state */
>>>> -	tpacpi_rfk_update_swstate_all();
>>>> -
>>>>  	/* Sync hw blocking state last if it is hw-unblocked */
>>>>  	if (wlsw == TPACPI_RFK_RADIO_ON)
>>>>  		tpacpi_rfk_update_hwblock_state(false);
>>>>


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

end of thread, other threads:[~2021-11-16 10:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  6:06 [PATCH v3] Fix WWAN device disabled issue after S3 deep Slark Xiao
2021-11-08  6:13 ` Slark Xiao
2021-11-08 14:32 ` [PATCH " Hans de Goede
2021-11-09  2:06   ` Slark Xiao
2021-11-16  6:40     ` Slark Xiao
2021-11-16 10:02       ` Hans de Goede

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).