All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ahci: imx: Handle increased read failures for IMX53 temperature sensor in low frequency mode.
@ 2017-11-13 10:31 Martyn Welch
  2017-11-13 20:18 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Martyn Welch @ 2017-11-13 10:31 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, linux-kernel, Egor Starkov, Martyn Welch

From: Egor Starkov <egor.starkov@ge.com>

Extended testing has shown that the imx ahci driver sometimes requires
more than the 100 attempts currently alotted in the driver to perform a
successful temperature reading when running at minimum (throttled) CPU
frequency.

Debugging suggests that the read cycle can take 160 attempts (which given
that the driver averages 80 readings from the ADC equates to one failure
on each read).

Increase the attempt limit to 200 in order to greatly reduce the
likelihood of the driver failing to perform a temperature reading,
especially at low CPU frequency.

Signed-off-by: Egor Starkov <egor.starkov@ge.com>
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
---

v2: - Correct spelling issues in cover letter.

 drivers/ata/ahci_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index 787567e..a58bcc0 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -230,7 +230,7 @@ static int read_adc_sum(void *dev, u16 rtune_ctl_reg, void __iomem * mmio)
 {
 	u16 adc_out_reg, read_sum;
 	u32 index, read_attempt;
-	const u32 attempt_limit = 100;
+	const u32 attempt_limit = 200;
 
 	imx_phy_reg_addressing(SATA_PHY_CR_CLOCK_RTUNE_CTL, mmio);
 	imx_phy_reg_write(rtune_ctl_reg, mmio);
-- 
1.8.3.1


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

* Re: [PATCH v2] ahci: imx: Handle increased read failures for IMX53 temperature sensor in low frequency mode.
  2017-11-13 10:31 [PATCH v2] ahci: imx: Handle increased read failures for IMX53 temperature sensor in low frequency mode Martyn Welch
@ 2017-11-13 20:18 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2017-11-13 20:18 UTC (permalink / raw)
  To: Martyn Welch; +Cc: linux-ide, linux-kernel, Egor Starkov

On Mon, Nov 13, 2017 at 10:31:01AM +0000, Martyn Welch wrote:
> From: Egor Starkov <egor.starkov@ge.com>
> 
> Extended testing has shown that the imx ahci driver sometimes requires
> more than the 100 attempts currently alotted in the driver to perform a
> successful temperature reading when running at minimum (throttled) CPU
> frequency.
> 
> Debugging suggests that the read cycle can take 160 attempts (which given
> that the driver averages 80 readings from the ADC equates to one failure
> on each read).
> 
> Increase the attempt limit to 200 in order to greatly reduce the
> likelihood of the driver failing to perform a temperature reading,
> especially at low CPU frequency.
> 
> Signed-off-by: Egor Starkov <egor.starkov@ge.com>
> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>

Applied to libata/for-4.15.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2017-11-13 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-13 10:31 [PATCH v2] ahci: imx: Handle increased read failures for IMX53 temperature sensor in low frequency mode Martyn Welch
2017-11-13 20:18 ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.