* [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error
@ 2017-07-13 13:45 Hans de Goede
2017-07-13 13:45 ` [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz Hans de Goede
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Hans de Goede @ 2017-07-13 13:45 UTC (permalink / raw)
To: Jarkko Nikula, Wolfram Sang, Andy Shevchenko, Mika Westerberg
Cc: Hans de Goede, linux-i2c
When we refuse to probe due to an invalid clock frequency, log
the frequency which is causing this error.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Also fix the message missing a \n at the end
Changes in v3:
-Rebase on latest upstream master (adjust for s/r/ret/)
---
drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 2ea6d0d25a01..d139b156f9c9 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -319,7 +319,8 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
if (dev->clk_freq != 100000 && dev->clk_freq != 400000
&& dev->clk_freq != 1000000 && dev->clk_freq != 3400000) {
dev_err(&pdev->dev,
- "Only 100kHz, 400kHz, 1MHz and 3.4MHz supported");
+ "%d Hz is unsupported, only 100kHz, 400kHz, 1MHz and 3.4MHz are supported\n",
+ dev->clk_freq);
ret = -EINVAL;
goto exit_reset;
}
--
2.13.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
2017-07-13 13:45 [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error Hans de Goede
@ 2017-07-13 13:45 ` Hans de Goede
2017-07-16 14:04 ` Andy Shevchenko
2017-07-31 13:56 ` Wolfram Sang
2017-07-16 14:02 ` [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error Andy Shevchenko
2017-07-31 13:56 ` Wolfram Sang
2 siblings, 2 replies; 8+ messages in thread
From: Hans de Goede @ 2017-07-13 13:45 UTC (permalink / raw)
To: Jarkko Nikula, Wolfram Sang, Andy Shevchenko, Mika Westerberg
Cc: Hans de Goede, linux-i2c, stable
At least the Acer Iconia Tab8 / aka W1-810 uses 1MiHz instead of
1MHz for one of its busses, fix this up to 1MHz instead of failing
the probe of that bus.
This fixes the accelerometer on the Acer Iconia Tab8 not working.
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/i2c/busses/i2c-designware-platdrv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index d139b156f9c9..143a8fd582b4 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -298,6 +298,9 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
}
acpi_speed = i2c_acpi_find_bus_speed(&pdev->dev);
+ /* Some broken DSTDs use 1MiHz instead of 1MHz */
+ if (acpi_speed == 1048576)
+ acpi_speed = 1000000;
/*
* Find bus speed from the "clock-frequency" device property, ACPI
* or by using fast mode if neither is set.
--
2.13.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
2017-07-13 13:45 ` [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz Hans de Goede
@ 2017-07-16 14:04 ` Andy Shevchenko
2017-07-21 22:15 ` Hans de Goede
2017-07-31 13:57 ` Wolfram Sang
2017-07-31 13:56 ` Wolfram Sang
1 sibling, 2 replies; 8+ messages in thread
From: Andy Shevchenko @ 2017-07-16 14:04 UTC (permalink / raw)
To: Hans de Goede, Jarkko Nikula, Wolfram Sang, Mika Westerberg
Cc: linux-i2c, stable
On Thu, 2017-07-13 at 15:45 +0200, Hans de Goede wrote:
> At least the Acer Iconia Tab8 / aka W1-810 uses 1MiHz instead of
> 1MHz for one of its busses, fix this up to 1MHz instead of failing
> the probe of that bus.
>
> This fixes the accelerometer on the Acer Iconia Tab8 not working.
>
Should it have a Fixes tag?
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
(on condition Jarkko and Wolfram are okay with this; in the future it
would be better to have a list of possible speeds and algo that chooses
one based on FW configuration)
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/i2c/busses/i2c-designware-platdrv.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
> b/drivers/i2c/busses/i2c-designware-platdrv.c
> index d139b156f9c9..143a8fd582b4 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -298,6 +298,9 @@ static int dw_i2c_plat_probe(struct
> platform_device *pdev)
> }
>
> acpi_speed = i2c_acpi_find_bus_speed(&pdev->dev);
> + /* Some broken DSTDs use 1MiHz instead of 1MHz */
> + if (acpi_speed == 1048576)
> + acpi_speed = 1000000;
> /*
> * Find bus speed from the "clock-frequency" device property,
> ACPI
> * or by using fast mode if neither is set.
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
2017-07-16 14:04 ` Andy Shevchenko
@ 2017-07-21 22:15 ` Hans de Goede
2017-07-31 13:57 ` Wolfram Sang
1 sibling, 0 replies; 8+ messages in thread
From: Hans de Goede @ 2017-07-21 22:15 UTC (permalink / raw)
To: Andy Shevchenko, Jarkko Nikula, Wolfram Sang, Mika Westerberg
Cc: linux-i2c, stable
Hi,
On 16-07-17 16:04, Andy Shevchenko wrote:
> On Thu, 2017-07-13 at 15:45 +0200, Hans de Goede wrote:
>> At least the Acer Iconia Tab8 / aka W1-810 uses 1MiHz instead of
>> 1MHz for one of its busses, fix this up to 1MHz instead of failing
>> the probe of that bus.
>>
>> This fixes the accelerometer on the Acer Iconia Tab8 not working.
>>
>
> Should it have a Fixes tag?
No I don't think so, as this worksaround a firmware bug the original
commit introducing the check is not really fixed by this, as the
original commit is fine really.
Regards,
Hans
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> (on condition Jarkko and Wolfram are okay with this; in the future it
> would be better to have a list of possible speeds and algo that chooses
> one based on FW configuration)
>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> drivers/i2c/busses/i2c-designware-platdrv.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
>> b/drivers/i2c/busses/i2c-designware-platdrv.c
>> index d139b156f9c9..143a8fd582b4 100644
>> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
>> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
>> @@ -298,6 +298,9 @@ static int dw_i2c_plat_probe(struct
>> platform_device *pdev)
>> }
>>
>> acpi_speed = i2c_acpi_find_bus_speed(&pdev->dev);
>> + /* Some broken DSTDs use 1MiHz instead of 1MHz */
>> + if (acpi_speed == 1048576)
>> + acpi_speed = 1000000;
>> /*
>> * Find bus speed from the "clock-frequency" device property,
>> ACPI
>> * or by using fast mode if neither is set.
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
2017-07-16 14:04 ` Andy Shevchenko
2017-07-21 22:15 ` Hans de Goede
@ 2017-07-31 13:57 ` Wolfram Sang
1 sibling, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2017-07-31 13:57 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans de Goede, Jarkko Nikula, Mika Westerberg, linux-i2c, stable
[-- Attachment #1: Type: text/plain, Size: 246 bytes --]
> (on condition Jarkko and Wolfram are okay with this; in the future it
> would be better to have a list of possible speeds and algo that chooses
> one based on FW configuration)
In deed, that sounds feasible if more broken firmware shows up.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz
2017-07-13 13:45 ` [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz Hans de Goede
2017-07-16 14:04 ` Andy Shevchenko
@ 2017-07-31 13:56 ` Wolfram Sang
1 sibling, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2017-07-31 13:56 UTC (permalink / raw)
To: Hans de Goede
Cc: Jarkko Nikula, Andy Shevchenko, Mika Westerberg, linux-i2c,
stable
[-- Attachment #1: Type: text/plain, Size: 426 bytes --]
On Thu, Jul 13, 2017 at 03:45:02PM +0200, Hans de Goede wrote:
> At least the Acer Iconia Tab8 / aka W1-810 uses 1MiHz instead of
> 1MHz for one of its busses, fix this up to 1MHz instead of failing
> the probe of that bus.
>
> This fixes the accelerometer on the Acer Iconia Tab8 not working.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error
2017-07-13 13:45 [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error Hans de Goede
2017-07-13 13:45 ` [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz Hans de Goede
@ 2017-07-16 14:02 ` Andy Shevchenko
2017-07-31 13:56 ` Wolfram Sang
2 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2017-07-16 14:02 UTC (permalink / raw)
To: Hans de Goede, Jarkko Nikula, Wolfram Sang, Mika Westerberg; +Cc: linux-i2c
On Thu, 2017-07-13 at 15:45 +0200, Hans de Goede wrote:
> When we refuse to probe due to an invalid clock frequency, log
> the frequency which is causing this error.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> Changes in v2:
> -Also fix the message missing a \n at the end
> Changes in v3:
> -Rebase on latest upstream master (adjust for s/r/ret/)
> ---
> drivers/i2c/busses/i2c-designware-platdrv.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
> b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 2ea6d0d25a01..d139b156f9c9 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -319,7 +319,8 @@ static int dw_i2c_plat_probe(struct
> platform_device *pdev)
> if (dev->clk_freq != 100000 && dev->clk_freq != 400000
> && dev->clk_freq != 1000000 && dev->clk_freq != 3400000)
> {
> dev_err(&pdev->dev,
> - "Only 100kHz, 400kHz, 1MHz and 3.4MHz
> supported");
> + "%d Hz is unsupported, only 100kHz, 400kHz,
> 1MHz and 3.4MHz are supported\n",
> + dev->clk_freq);
> ret = -EINVAL;
> goto exit_reset;
> }
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error
2017-07-13 13:45 [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error Hans de Goede
2017-07-13 13:45 ` [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz Hans de Goede
2017-07-16 14:02 ` [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error Andy Shevchenko
@ 2017-07-31 13:56 ` Wolfram Sang
2 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2017-07-31 13:56 UTC (permalink / raw)
To: Hans de Goede; +Cc: Jarkko Nikula, Andy Shevchenko, Mika Westerberg, linux-i2c
[-- Attachment #1: Type: text/plain, Size: 271 bytes --]
On Thu, Jul 13, 2017 at 03:45:01PM +0200, Hans de Goede wrote:
> When we refuse to probe due to an invalid clock frequency, log
> the frequency which is causing this error.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-07-31 13:57 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-13 13:45 [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error Hans de Goede
2017-07-13 13:45 ` [PATCH v3 2/2] i2c: designware: Some broken DSTDs use 1MiHz instead of 1MHz Hans de Goede
2017-07-16 14:04 ` Andy Shevchenko
2017-07-21 22:15 ` Hans de Goede
2017-07-31 13:57 ` Wolfram Sang
2017-07-31 13:56 ` Wolfram Sang
2017-07-16 14:02 ` [PATCH v3 1/2] i2c: designware: Print clock freq on invalid clock freq error Andy Shevchenko
2017-07-31 13:56 ` Wolfram Sang
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).