Re: [PATCH RFC net 1/2] nfc: nxp-nci: Fix i2c read on ThinkPad hardware

From: Krzysztof Kozlowski
Date: Mon Jun 12 2023 - 03:34:49 EST


On 11/06/2023 18:25, Marco Giorgi wrote:
> Hi Krzysztof,
>
> On Wed, 7 Jun 2023 19:45:25 +0200
> Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> wrote:
>
>> On 07/06/2023 19:00, Marco Giorgi wrote:
>>> Add the IRQ GPIO configuration.
>>
>> Why? Please include reasons in commit msg. What you are doing is quite
>> easy to see.
>
> This is my fault, I only put the patch reason in patch [0/2].
>
> Basically, I found out that the mainline driver is not working on my
> machine (Lenovo ThinkPad T590).
>
> I suspect that the I2C read IRQ is somehow misconfigured, and it
> triggers even when the NFC chip is not ready to be read, resulting in
> an error.

Isn't this then a problem of your I2C controller?

>
> In this patch [1/2], I'm adding the "IRQ" GPIO to the driver so its
> value can be directly read from the IRQ thread.

What is IRQ GPIO? If this is interrupt line, you are not handling it
correctly. This is quite surprising code.

>
> In patch [2/2], I'm safely returning from the IRQ thread when the IRQ
> GPIO is not active.
>


Best regards,
Krzysztof