All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH v2 1/1] serial: sh-sci: Respect deferred probe when getting IRQ
Date: Wed, 7 Apr 2021 16:39:01 +0300	[thread overview]
Message-ID: <YG219ZnbCDZFmpiB@smile.fi.intel.com> (raw)
In-Reply-To: <33a5ee25-d4c9-b5c2-b5f9-05316b1139c0@roeck-us.net>

On Wed, Apr 07, 2021 at 06:11:46AM -0700, Guenter Roeck wrote:
> On 4/7/21 3:17 AM, Andy Shevchenko wrote:
> > With platform_get_irq() and its optional variant it's possible to get
> > a deferred probe error code. Since the commit ed7027fdf4ec ("driver core:
> > platform: Make platform_get_irq_optional() optional") the error code
> > can be distinguished from no IRQ case. With this, rewrite IRQ resource
> > handling in sh-sci driver to follow above and allow to respect deferred
> > probe.
> > 
> > Fixes: ed7027fdf4ec ("driver core: platform: Make platform_get_irq_optional() optional")
> > Reported-by: Guenter Roeck <linux@roeck-us.net>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> This patch alone causes a hard hang early during boot. It works if applied
> together with ed7027fdf4ec. Ultimately that means that ed7027fdf4ec introduces
> a functional change, and will need to be applied very carefully. A cursory
> glance through callers of platform_get_irq_optional() shows that many
> do not handle this correctly: various drivers handle a return value of 0
> as valid interrupt, and others treat errors other than -ENXIO as fatal.
> 
> Also, each patch on its own causes failures on sh, which is problematic
> when applying them even as series. See below for an idea how to
> address that.

Right, that's why I think I have to slow down with it (as I answered to Greg).

> Since sh never gets -EPROBE_DEFER, the following code can be applied
> on its own and does not depend on ed7027fdf4ec.
> 
> 	sci_port->irqs[i] = platform_get_irq_optional(dev, i);
> 	if (sci_port->irqs[i] <= 0)
> 		sci_port->irqs[i] = sci_port->irqs[0];
> 
> With this change, sh images boot in qemu both with and without ed7027fdf4ec.

Yeah, thanks! But I think we still can avoid double loops there.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-04-07 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 10:17 [PATCH v2 1/1] serial: sh-sci: Respect deferred probe when getting IRQ Andy Shevchenko
2021-04-07 10:23 ` Greg Kroah-Hartman
2021-04-07 11:19   ` Andy Shevchenko
2021-04-07 13:11 ` Guenter Roeck
2021-04-07 13:39   ` Andy Shevchenko [this message]
2021-04-12 10:11   ` Geert Uytterhoeven

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=YG219ZnbCDZFmpiB@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.