mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Bui Duc Phuc <phucduc.bui@gmail.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Eric Piel <eric.piel@tremplin-utc.net>,
	Hans de Goede <hansg@kernel.org>,
	ilpo.jarvinen@linux.intel.com, Zha Qipeng <qipeng.zha@intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andy@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] platform/x86: intel: punit_ipc: Propagate errors from optional IRQ lookup
Date: Wed, 12 Aug 2026 09:18:57 +0300	[thread overview]
Message-ID: <anwQUfWEGK2AvsZ9@ashevche-desk.local> (raw)
In-Reply-To: <CAABR9nGwD6Qy7e-XxcamsDFZh0d=06SR=mAHNLGdVt_uEi71gw@mail.gmail.com>

On Tue, Aug 11, 2026 at 10:30:53AM +0700, Bui Duc Phuc wrote:

...

> > >         irq = platform_get_irq_optional(pdev, 0);
> > >         if (irq < 0) {
> > > +               if (irq != -ENXIO)
> > > +                       return irq;
> > >                 dev_warn(&pdev->dev, "Invalid IRQ, using polling mode\n");
> >
> > I can admit that the warning message is not comprehensive, but after
> > this patch it obviously makes a regression. A previously working
> > driver for even some Linux failures (besides deferred probe) now
> > becomes unusable. Have you studied the possible error codes returned
> > by platform_get_irq_optional()? What are they? Perhaps you need to
> > improve the documentation of that API?
> 
> So I understand you'd prefer to keep the current behavior of the function,
> to make sure existing systems keep working fine?

Keeping the current behaviour. Which means that probably only deferred probe is
the error we may return.

> However, I think if this IRQs is truly meant to be optional, then any error
> other than -ENXIO should be captured and returned
> so that developers can actually investigate and fix the underlying issue.
> Silently swallowing an error and falling back to polling doesn't
> really guarantee
> the system is working correctly or safely either, does it?
> 
> That said, if you'd rather keep the current implementation as-is,
> then I think it would make more sense to switch to platform_get_irq() instead.

But then the (additional in this case) warning will be printed each time the
device is probed without proper IRQ.

> That would more accurately reflect that this driver doesn't actually
> treat the IRQ
> as optional, rather than using an "optional" lookup function while implementing
> it as if it weren't optional.

Hmm... It says it will use polling mode, to me it means that IRQ is optional.

> https://elixir.bootlin.com/linux/v7.2-rc6/source/drivers/base/platform.c#L301

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-08-12  6:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10  5:26 [PATCH 1/3] platform/x86: hp: hp_accel: " phucduc.bui
2026-08-10  5:26 ` [PATCH 2/3] platform/x86: intel: punit_ipc: " phucduc.bui
2026-08-10  7:00   ` Andy Shevchenko
2026-08-11  3:30     ` Bui Duc Phuc
2026-08-12  6:18       ` Andy Shevchenko [this message]
2026-08-10  5:26 ` [PATCH 3/3] platform/x86: intel_scu_ipc: Handle " phucduc.bui
2026-08-10  7:04   ` Andy Shevchenko
2026-08-10  6:50 ` [PATCH 1/3] platform/x86: hp: hp_accel: Propagate " 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=anwQUfWEGK2AvsZ9@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=eric.piel@tremplin-utc.net \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=phucduc.bui@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=qipeng.zha@intel.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

all inboxes | Powered by JetHome®