On Mon, 4 Sep 2023 14:23:29 +0300 Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote: > On Mon, Sep 04, 2023 at 01:15:22PM +0300, Tomas Melin wrote: > > Support deferred probe for cases where communication on > > i2c bus fails. These failures could happen for a variety of > > reasons including bus arbitration error or power failure. > > > +out: > > + if ((ret == -EAGAIN) || (ret == -ENXIO)) > > + return -EPROBE_DEFER; > > + return ret; > > Oh my... This looks so-o hackish. Agreed. This is a non starter. > If anything, it has to be fixed on the level of regmap I2C APIs or so. > > Maybe something like regmap_i2c_try_write()/try_read() new APIs that > will provide the above. Otherwise you want to fix _every single driver_ > in the Linux kernel Any probe ordering dependencies should be described by the firmware and the driver should 'get' the relevant resource. If there is anything not describable today then that is what we need to fix, not paper over the holes. So can we have specifics of what is happening here? If it's arbitration with some other entity then fix the arbitration locking / hand over. If it's power, then make sure the relevant regulator get gotten and turned on + has the right delays etc. Jonathan > > ... > > $ git grep -lw builtin_i2c_driver | wc > 5 5 123 > $ git grep -lw module_i2c_driver | wc > 1164 1164 35240 > > (and more that don't use either of the above macros). >