From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Weifeng Liu <weifeng.liu.z@gmail.com>
Cc: platform-driver-x86@vger.kernel.org,
linux-serial@vger.kernel.org,
Maximilian Luz <luzmaximilian@gmail.com>,
Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH v2 1/2] platform/surface: aggregator: Defer probing when serdev is not ready
Date: Fri, 3 May 2024 20:03:43 +0300 [thread overview]
Message-ID: <ZjUY7xPXszBulKap@smile.fi.intel.com> (raw)
In-Reply-To: <20240503030900.1334763-2-weifeng.liu.z@gmail.com>
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
next prev parent reply other threads:[~2024-05-03 17:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 3:08 [PATCH v2 0/2] Defer probing of SAM if serdev device is not ready Weifeng Liu
2024-05-03 3:08 ` [PATCH v2 1/2] platform/surface: aggregator: Defer probing when serdev " Weifeng Liu
2024-05-03 17:03 ` Andy Shevchenko [this message]
2024-05-04 4:17 ` Weifeng Liu
2024-05-03 3:08 ` [PATCH v2 2/2] platform/surface: aggregator: Log critical errors during SAM probing Weifeng Liu
2024-05-03 16:36 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZjUY7xPXszBulKap@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-serial@vger.kernel.org \
--cc=luzmaximilian@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=weifeng.liu.z@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).