mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] i2c: designware: Fix bogus sda_hold_time due to uninitialized vars
       [not found] ` <CAKv+Gu9x_KCdEGBBOw9yaYOcYBcYtxJX-xTX=4kQuWqY=VK0PA@mail.gmail.com>
@ 2017-05-22  5:46   ` Jan Kiszka
  2017-05-22  6:02     ` Ard Biesheuvel
                       ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Kiszka @ 2017-05-22  5:46 UTC (permalink / raw)
  To: Ard Biesheuvel, Jarkko Nikula, Andy Shevchenko, mika.westerberg,
	wsa, linux-i2c, Lorenzo Pieralisi
  Cc: linux-arm-kernel, Linux Kernel Mailing List

We need to initializes those variables to 0 for platforms that do not
provide ACPI parameters. Otherwise, we set sda_hold_time to random
values, breaking e.g. Galileo and IOT2000 boards.

Fixes: 9d6408433019 ("i2c: designware: don't infer timings described by ACPI from clock rate")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Affects 4.12-rc2.

 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 6283b99d2b17..d1263b82d646 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -94,9 +94,9 @@ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
 static int dw_i2c_acpi_configure(struct platform_device *pdev)
 {
 	struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
+	u32 ss_ht = 0, fp_ht = 0, hs_ht = 0, fs_ht = 0;
 	acpi_handle handle = ACPI_HANDLE(&pdev->dev);
 	const struct acpi_device_id *id;
-	u32 ss_ht, fp_ht, hs_ht, fs_ht;
 	struct acpi_device *adev;
 	const char *uid;
 

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

* Re: [PATCH] i2c: designware: Fix bogus sda_hold_time due to uninitialized vars
  2017-05-22  5:46   ` [PATCH] i2c: designware: Fix bogus sda_hold_time due to uninitialized vars Jan Kiszka
@ 2017-05-22  6:02     ` Ard Biesheuvel
  2017-05-22  6:37     ` Jarkko Nikula
  2017-05-22  8:36     ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2017-05-22  6:02 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Jarkko Nikula, Andy Shevchenko, mika.westerberg, wsa, linux-i2c,
	Lorenzo Pieralisi, linux-arm-kernel, Linux Kernel Mailing List



> On 22 May 2017, at 07:46, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> 
> We need to initializes those variables to 0 for platforms that do not
> provide ACPI parameters. Otherwise, we set sda_hold_time to random
> values, breaking e.g. Galileo and IOT2000 boards.
> 
> Fixes: 9d6408433019 ("i2c: designware: don't infer timings described by ACPI from clock rate")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
> 
> Affects 4.12-rc2.
> 
> drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 6283b99d2b17..d1263b82d646 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -94,9 +94,9 @@ static void dw_i2c_acpi_params(struct platform_device *pdev, char method[],
> static int dw_i2c_acpi_configure(struct platform_device *pdev)
> {
>    struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
> +    u32 ss_ht = 0, fp_ht = 0, hs_ht = 0, fs_ht = 0;
>    acpi_handle handle = ACPI_HANDLE(&pdev->dev);
>    const struct acpi_device_id *id;
> -    u32 ss_ht, fp_ht, hs_ht, fs_ht;
>    struct acpi_device *adev;
>    const char *uid;
> 

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

* Re: [PATCH] i2c: designware: Fix bogus sda_hold_time due to uninitialized vars
  2017-05-22  5:46   ` [PATCH] i2c: designware: Fix bogus sda_hold_time due to uninitialized vars Jan Kiszka
  2017-05-22  6:02     ` Ard Biesheuvel
@ 2017-05-22  6:37     ` Jarkko Nikula
  2017-05-22  8:36     ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Jarkko Nikula @ 2017-05-22  6:37 UTC (permalink / raw)
  To: Jan Kiszka, Ard Biesheuvel, Andy Shevchenko, mika.westerberg,
	wsa, linux-i2c, Lorenzo Pieralisi
  Cc: linux-arm-kernel, Linux Kernel Mailing List

On 05/22/2017 08:46 AM, Jan Kiszka wrote:
> We need to initializes those variables to 0 for platforms that do not
> provide ACPI parameters. Otherwise, we set sda_hold_time to random
> values, breaking e.g. Galileo and IOT2000 boards.
>
> Fixes: 9d6408433019 ("i2c: designware: don't infer timings described by ACPI from clock rate")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> Affects 4.12-rc2.
>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

* Re: [PATCH] i2c: designware: Fix bogus sda_hold_time due to uninitialized vars
  2017-05-22  5:46   ` [PATCH] i2c: designware: Fix bogus sda_hold_time due to uninitialized vars Jan Kiszka
  2017-05-22  6:02     ` Ard Biesheuvel
  2017-05-22  6:37     ` Jarkko Nikula
@ 2017-05-22  8:36     ` Wolfram Sang
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2017-05-22  8:36 UTC (permalink / raw)
  To: Jan Kiszka
  Cc: Ard Biesheuvel, Jarkko Nikula, Andy Shevchenko, mika.westerberg,
	linux-i2c, Lorenzo Pieralisi, linux-arm-kernel,
	Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On Mon, May 22, 2017 at 07:46:55AM +0200, Jan Kiszka wrote:
> We need to initializes those variables to 0 for platforms that do not
> provide ACPI parameters. Otherwise, we set sda_hold_time to random
> values, breaking e.g. Galileo and IOT2000 boards.
> 
> Fixes: 9d6408433019 ("i2c: designware: don't infer timings described by ACPI from clock rate")
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2017-05-22  8:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20170519085640.15111-1-ard.biesheuvel@linaro.org>
     [not found] ` <CAKv+Gu9x_KCdEGBBOw9yaYOcYBcYtxJX-xTX=4kQuWqY=VK0PA@mail.gmail.com>
2017-05-22  5:46   ` [PATCH] i2c: designware: Fix bogus sda_hold_time due to uninitialized vars Jan Kiszka
2017-05-22  6:02     ` Ard Biesheuvel
2017-05-22  6:37     ` Jarkko Nikula
2017-05-22  8:36     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®