Re: Linux 5.11: i2c: Confusing error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2021-03-15 at 07:58 +0100, Klaus Kudielka wrote:
> Hello,
> 
> I recently upgraded my Turris Omnia (Marvell Armada 385) to 5.11, and 
> now get the following error message during boot:
> 
>      i2c i2c-0: Not using recovery: no recover_bus() found
> 
> Is this the intended behaviour?
> Personally, I believe an "error" message is quite strong for this common 
> scenario, and a bit misleading.
> 
> Thanks, Klaus
> 

I admit that I added a "gpio" state to pinctrl for our board, so didn't
see this error message. I think the easiest fix for this is to check that
the gpio pinctrl state exists. e.g. something like:

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index c590d36b5fd1..55c366f402f2 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -894,6 +894,9 @@ static int mv64xxx_i2c_init_recovery_info(struct mv64xxx_i2c_data *drv_data,
                return PTR_ERR(rinfo->pinctrl);
        } else if (!rinfo->pinctrl) {
                return -ENODEV;
+       } else if (IS_ERR(pinctrl_lookup_state(rinfo->pinctrl, "gpio"))) {
+               dev_info(dev, "pinctrl states incomplete for recovery\n");
+               return -ENODEV;
        }
 
        drv_data->adapter.bus_recovery_info = rinfo;





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux