Re: [PATCH v2 1/2] platform/surface: aggregator: Defer probing when serdev is not ready

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

 



On Fri, May 03, 2024 at 11:08:46AM +0800, Weifeng Liu wrote:
> This is an attempt to alleviate race conditions in the SAM driver where
> essential resources like serial device and GPIO pins are not ready at
> the time ssam_serial_hub_probe() is called.  Instead of giving up
> probing, a better way would be to defer the probing by returning
> -EPROBE_DEFER, allowing the kernel try again later.
> 
> However, there is no way of identifying all such cases from other real
> errors in a few days.  So let's take a gradual approach identify and
> address these cases as they arise.  This commit marks the initial step
> in this process.

...

> +	/*
> +	 * The following step can fail when it's called too early before the
> +	 * underlying UART device is ready (in this case -ENXIO is returned).
> +	 * Instead of simply giving up and losing everything, we can defer
> +	 * the probing by returning -EPROBE_DEFER so that the kernel would be
> +	 * able to retry later.
> +	 */

You can add the following to the
serial_core.c (at the top after the headers)

#undef ENXIO
#define ENXIO __LINE__

And I'm pretty much sure it will point out you to the uart_port_activate().
If it's the case you may elaborate this in the comment.
Otherwise you may add the same hack to other files and find the culprit.

Also it might be that we add some error code substitution inside serdev core.
At least there more data is available to make the (better) decision.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux