* [PATCH] i2c: cadence: make bus recovery optional
@ 2022-10-23 21:51 Michael Grzeschik
2022-11-14 15:57 ` Michael Grzeschik
0 siblings, 1 reply; 6+ messages in thread
From: Michael Grzeschik @ 2022-10-23 21:51 UTC (permalink / raw)
To: linux-i2c; +Cc: michal.simek, linux-arm-kernel, kernel
There is no need for the i2c driver to have functional bus recovery to
probe successfully. We patch this by only adding bus_recovery_info only
if we get usable pinctrl data.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/i2c/busses/i2c-cadence.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index fe0cd205502de9..cf212b8ffd56af 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -1262,10 +1262,10 @@ static int cdns_i2c_probe(struct platform_device *pdev)
}
id->rinfo.pinctrl = devm_pinctrl_get(&pdev->dev);
- if (IS_ERR(id->rinfo.pinctrl)) {
+ if (!IS_ERR(id->rinfo.pinctrl))
+ id->adap.bus_recovery_info = &id->rinfo;
+ else
dev_info(&pdev->dev, "can't get pinctrl, bus recovery not supported\n");
- return PTR_ERR(id->rinfo.pinctrl);
- }
id->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
if (IS_ERR(id->membase))
@@ -1283,7 +1283,6 @@ static int cdns_i2c_probe(struct platform_device *pdev)
id->adap.retries = 3; /* Default retry value. */
id->adap.algo_data = id;
id->adap.dev.parent = &pdev->dev;
- id->adap.bus_recovery_info = &id->rinfo;
init_completion(&id->xfer_done);
snprintf(id->adap.name, sizeof(id->adap.name),
"Cadence I2C at %08lx", (unsigned long)r_mem->start);
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: cadence: make bus recovery optional
2022-10-23 21:51 [PATCH] i2c: cadence: make bus recovery optional Michael Grzeschik
@ 2022-11-14 15:57 ` Michael Grzeschik
2022-11-28 11:58 ` Michael Riesch
0 siblings, 1 reply; 6+ messages in thread
From: Michael Grzeschik @ 2022-11-14 15:57 UTC (permalink / raw)
To: linux-i2c; +Cc: kernel, michal.simek, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1882 bytes --]
On Sun, Oct 23, 2022 at 11:51:21PM +0200, Michael Grzeschik wrote:
>There is no need for the i2c driver to have functional bus recovery to
>probe successfully. We patch this by only adding bus_recovery_info only
>if we get usable pinctrl data.
Gentle Ping!
>Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>---
> drivers/i2c/busses/i2c-cadence.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
>index fe0cd205502de9..cf212b8ffd56af 100644
>--- a/drivers/i2c/busses/i2c-cadence.c
>+++ b/drivers/i2c/busses/i2c-cadence.c
>@@ -1262,10 +1262,10 @@ static int cdns_i2c_probe(struct platform_device *pdev)
> }
>
> id->rinfo.pinctrl = devm_pinctrl_get(&pdev->dev);
>- if (IS_ERR(id->rinfo.pinctrl)) {
>+ if (!IS_ERR(id->rinfo.pinctrl))
>+ id->adap.bus_recovery_info = &id->rinfo;
>+ else
> dev_info(&pdev->dev, "can't get pinctrl, bus recovery not supported\n");
>- return PTR_ERR(id->rinfo.pinctrl);
>- }
>
> id->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
> if (IS_ERR(id->membase))
>@@ -1283,7 +1283,6 @@ static int cdns_i2c_probe(struct platform_device *pdev)
> id->adap.retries = 3; /* Default retry value. */
> id->adap.algo_data = id;
> id->adap.dev.parent = &pdev->dev;
>- id->adap.bus_recovery_info = &id->rinfo;
> init_completion(&id->xfer_done);
> snprintf(id->adap.name, sizeof(id->adap.name),
> "Cadence I2C at %08lx", (unsigned long)r_mem->start);
>--
>2.30.2
>
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: cadence: make bus recovery optional
2022-11-14 15:57 ` Michael Grzeschik
@ 2022-11-28 11:58 ` Michael Riesch
2022-11-28 13:07 ` Michael Grzeschik
0 siblings, 1 reply; 6+ messages in thread
From: Michael Riesch @ 2022-11-28 11:58 UTC (permalink / raw)
To: Michael Grzeschik, linux-i2c; +Cc: kernel, michal.simek, linux-arm-kernel
Hi Michael,
On 11/14/22 16:57, Michael Grzeschik wrote:
> On Sun, Oct 23, 2022 at 11:51:21PM +0200, Michael Grzeschik wrote:
>> There is no need for the i2c driver to have functional bus recovery to
>> probe successfully. We patch this by only adding bus_recovery_info only
>> if we get usable pinctrl data.
>
> Gentle Ping!
Thanks for your efforts. I believe this issue is adressed in a more
recent patch [0], which seems to be on its way to mainline.
Best regards,
Michael
[0]
https://lore.kernel.org/lkml/20221128105158.1536551-1-carsten.haitzler@foss.arm.com/
>
>> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
>> ---
>> drivers/i2c/busses/i2c-cadence.c | 7 +++----
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-cadence.c
>> b/drivers/i2c/busses/i2c-cadence.c
>> index fe0cd205502de9..cf212b8ffd56af 100644
>> --- a/drivers/i2c/busses/i2c-cadence.c
>> +++ b/drivers/i2c/busses/i2c-cadence.c
>> @@ -1262,10 +1262,10 @@ static int cdns_i2c_probe(struct
>> platform_device *pdev)
>> }
>>
>> id->rinfo.pinctrl = devm_pinctrl_get(&pdev->dev);
>> - if (IS_ERR(id->rinfo.pinctrl)) {
>> + if (!IS_ERR(id->rinfo.pinctrl))
>> + id->adap.bus_recovery_info = &id->rinfo;
>> + else
>> dev_info(&pdev->dev, "can't get pinctrl, bus recovery not
>> supported\n");
>> - return PTR_ERR(id->rinfo.pinctrl);
>> - }
>>
>> id->membase = devm_platform_get_and_ioremap_resource(pdev, 0,
>> &r_mem);
>> if (IS_ERR(id->membase))
>> @@ -1283,7 +1283,6 @@ static int cdns_i2c_probe(struct platform_device
>> *pdev)
>> id->adap.retries = 3; /* Default retry value. */
>> id->adap.algo_data = id;
>> id->adap.dev.parent = &pdev->dev;
>> - id->adap.bus_recovery_info = &id->rinfo;
>> init_completion(&id->xfer_done);
>> snprintf(id->adap.name, sizeof(id->adap.name),
>> "Cadence I2C at %08lx", (unsigned long)r_mem->start);
>> --
>> 2.30.2
>>
>>
>>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: cadence: make bus recovery optional
2022-11-28 11:58 ` Michael Riesch
@ 2022-11-28 13:07 ` Michael Grzeschik
2022-11-28 13:24 ` Michael Grzeschik
0 siblings, 1 reply; 6+ messages in thread
From: Michael Grzeschik @ 2022-11-28 13:07 UTC (permalink / raw)
To: Michael Riesch; +Cc: linux-i2c, kernel, michal.simek, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1122 bytes --]
Hi Michael,
On Mon, Nov 28, 2022 at 12:58:20PM +0100, Michael Riesch wrote:
>On 11/14/22 16:57, Michael Grzeschik wrote:
>> On Sun, Oct 23, 2022 at 11:51:21PM +0200, Michael Grzeschik wrote:
>>> There is no need for the i2c driver to have functional bus recovery to
>>> probe successfully. We patch this by only adding bus_recovery_info only
>>> if we get usable pinctrl data.
>>
>> Gentle Ping!
>
>Thanks for your efforts. I believe this issue is adressed in a more
>recent patch [0], which seems to be on its way to mainline.
>
>Best regards,
>Michael
>
>
>[0]
>https://lore.kernel.org/lkml/20221128105158.1536551-1-carsten.haitzler@foss.arm.com/
I like mine better. :) I think I have to comment on that. But why did I
not see that one?
However, thanks for the pointer!
Michael
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: cadence: make bus recovery optional
2022-11-28 13:07 ` Michael Grzeschik
@ 2022-11-28 13:24 ` Michael Grzeschik
2022-12-01 22:54 ` Wolfram Sang
0 siblings, 1 reply; 6+ messages in thread
From: Michael Grzeschik @ 2022-11-28 13:24 UTC (permalink / raw)
To: Michael Riesch; +Cc: linux-i2c, kernel, michal.simek, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1274 bytes --]
On Mon, Nov 28, 2022 at 02:07:23PM +0100, Michael Grzeschik wrote:
>On Mon, Nov 28, 2022 at 12:58:20PM +0100, Michael Riesch wrote:
>>On 11/14/22 16:57, Michael Grzeschik wrote:
>>>On Sun, Oct 23, 2022 at 11:51:21PM +0200, Michael Grzeschik wrote:
>>>>There is no need for the i2c driver to have functional bus recovery to
>>>>probe successfully. We patch this by only adding bus_recovery_info only
>>>>if we get usable pinctrl data.
>>>
>>>Gentle Ping!
>>
>>Thanks for your efforts. I believe this issue is adressed in a more
>>recent patch [0], which seems to be on its way to mainline.
>>
>>Best regards,
>>Michael
>>
>>
>>[0]
>>https://lore.kernel.org/lkml/20221128105158.1536551-1-carsten.haitzler@foss.arm.com/
>
>I like mine better. :) I think I have to comment on that. But why did I
>not see that one?
Ignore my comment. After reviewing again I can say their patch is fine.
Hopefully it get's mainline soon.
Thanks,
Michael
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: cadence: make bus recovery optional
2022-11-28 13:24 ` Michael Grzeschik
@ 2022-12-01 22:54 ` Wolfram Sang
0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2022-12-01 22:54 UTC (permalink / raw)
To: Michael Grzeschik
Cc: Michael Riesch, linux-i2c, kernel, michal.simek, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 110 bytes --]
> Ignore my comment. After reviewing again I can say their patch is fine.
I read that as "Rev-by". Thanks!
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-12-01 23:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-23 21:51 [PATCH] i2c: cadence: make bus recovery optional Michael Grzeschik
2022-11-14 15:57 ` Michael Grzeschik
2022-11-28 11:58 ` Michael Riesch
2022-11-28 13:07 ` Michael Grzeschik
2022-11-28 13:24 ` Michael Grzeschik
2022-12-01 22:54 ` 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).