lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Dec 2022 11:41:08 +0100
From:   Primoz Fiser <primoz.fiser@...ik.com>
To:     Marco Felsch <m.felsch@...gutronix.de>
Cc:     Oleksij Rempel <linux@...pel-privat.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        linux-i2c@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, upstream@...ts.phytec.de
Subject: Re: [PATCH] i2c: imx: increase retries on arbitration loss

Hi Marco,

On 16. 12. 22 10:45, Marco Felsch wrote:
> Hi Primoz,
> 
> On 22-12-16, Primoz Fiser wrote:
>> By default, retries value is set to 0 (no retries). Set retries to more
>> sensible value of 3 to allow i2c core to re-attempt transfer in case of
>> i2c arbitration loss (i2c-imx returns -EAGAIN errno is such case).
> 
> apart the fact that the number of retries vary a lot and so the client
> driver behaviour can vary a lot which is not good IMHO, why do you think
> that 3 is a sufficient number?

IMHO it is better than leaving it at 0 (no retries)?

Setting it to sensible value like 3 will at least attempt to make 
transfer in case arbitration-loss occurs.

> 
> If an arbitration loss happen, why do you think that retrying it 3 times
> changes that?

I our case, setting retries to non-zero value solves issues with PMIC 
shutdown on phyboard-mira which in some rare cases fails with "Failed to
shutdown (err =  -11)" (-EAGAIN).

To me it makes common sense retries is set to non-zero value especially 
for such rare conditions/situations.

BR,
Primoz

> 
> Regards,
>    Marco
> 
> 
>>
>> Signed-off-by: Primoz Fiser <primoz.fiser@...ik.com>
>> ---
>>   drivers/i2c/busses/i2c-imx.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
>> index cf5bacf3a488..6a5694cfe1cc 100644
>> --- a/drivers/i2c/busses/i2c-imx.c
>> +++ b/drivers/i2c/busses/i2c-imx.c
>> @@ -1478,6 +1478,7 @@ static int i2c_imx_probe(struct platform_device *pdev)
>>   	i2c_imx->adapter.dev.parent	= &pdev->dev;
>>   	i2c_imx->adapter.nr		= pdev->id;
>>   	i2c_imx->adapter.dev.of_node	= pdev->dev.of_node;
>> +	i2c_imx->adapter.retries	= 3;
>>   	i2c_imx->base			= base;
>>   	ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev));
>>   
>> -- 
>> 2.25.1
>>
>>
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ