diff mbox series

[v3] misc: rtsx: Add short delay after exit from ASPM

Message ID 4434eaa7-2ee3-a560-faee-6cee63ebd6d4@doth.eu
State New
Headers show
Series [v3] misc: rtsx: Add short delay after exit from ASPM | expand

Commit Message

Klaus Doth May 22, 2020, 10:56 a.m. UTC
From: Klaus Doth <kdlnx@doth.eu>

DMA transfers to and from the SD card stall for 10 seconds and run into
timeout on RTS5260 card readers after ASPM was enabled.

Adding a short msleep after disabling ASPM fixes the issue on several
Dell Precision 7530/7540 systems I tested.

This function is only called when waking up after the chip went into
power-save after not transferring data for a few seconds. The added
msleep does therefore not change anything in data transfer speed or
induce any excessive waiting while data transfers are running, or the
chip is sleeping. Only the transition from sleep to active is affected.

Signed-off-by: Klaus Doth <kdlnx@doth.eu>
---
Changes from v2:
  - Added this changelog. Tabs should now be tabs instead of spaces.

Changes from v1:
  - Added comment explaining why the msleep is required

 drivers/misc/cardreader/rtsx_pcr.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Greg KH May 22, 2020, 11:27 a.m. UTC | #1
On Fri, May 22, 2020 at 12:56:04PM +0200, Klaus Doth wrote:
> From: Klaus Doth <kdlnx@doth.eu>
> 
> DMA transfers to and from the SD card stall for 10 seconds and run into
> timeout on RTS5260 card readers after ASPM was enabled.
> 
> Adding a short msleep after disabling ASPM fixes the issue on several
> Dell Precision 7530/7540 systems I tested.
> 
> This function is only called when waking up after the chip went into
> power-save after not transferring data for a few seconds. The added
> msleep does therefore not change anything in data transfer speed or
> induce any excessive waiting while data transfers are running, or the
> chip is sleeping. Only the transition from sleep to active is affected.
> 
> Signed-off-by: Klaus Doth <kdlnx@doth.eu>
> Cc: stable <stable@vger.kernel.org>
> ---
> Changes from v2:
>   - Added this changelog. Tabs should now be tabs instead of spaces.
> 
> Changes from v1:
>   - Added comment explaining why the msleep is required
> 
>  drivers/misc/cardreader/rtsx_pcr.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c
> index 06038b325b02..3a6a6988cf80 100644
> --- a/drivers/misc/cardreader/rtsx_pcr.c
> +++ b/drivers/misc/cardreader/rtsx_pcr.c
> @@ -141,6 +141,9 @@ static void rtsx_comm_pm_full_on(struct rtsx_pcr *pcr)
>  	struct rtsx_cr_option *option = &pcr->option;
>  
>  	rtsx_disable_aspm(pcr);
> +	

That's trailing whitespace :(

I'll fix it up by hand, but next time, always run your patches through
scripts/checkpatch.pl to catch these things.

thanks,

greg k-h
diff mbox series

Patch

diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c
index 06038b325b02..3a6a6988cf80 100644
--- a/drivers/misc/cardreader/rtsx_pcr.c
+++ b/drivers/misc/cardreader/rtsx_pcr.c
@@ -141,6 +141,9 @@  static void rtsx_comm_pm_full_on(struct rtsx_pcr *pcr)
 	struct rtsx_cr_option *option = &pcr->option;
 
 	rtsx_disable_aspm(pcr);
+	
+	/* Fixes DMA transfer timout issue after disabling ASPM on RTS5260 */
+	msleep(1);
 
 	if (option->ltr_enabled)
 		rtsx_set_ltr_latency(pcr, option->ltr_active_latency);