linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Cao jin <caoj.fnst@cn.fujitsu.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Chen Fan <chen.fan.fnst@cn.fujitsu.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Len Brown <lenb@kernel.org>,
	izumi.taku@jp.fujitsu.com, wency@cn.fujitsu.com,
	Bjorn Helgaas <bhelgaas@google.com>,
	Linux PCI <linux-pci@vger.kernel.org>,
	Jiang Liu <jiang.liu@linux.intel.com>
Subject: Re: [PATCH] pci: fix unavailable irq number 255 reported by BIOS
Date: Fri, 22 Jan 2016 11:53:32 -0600	[thread overview]
Message-ID: <20160122175332.GA11004@localhost> (raw)
In-Reply-To: <CAJZ5v0iq29mq_sFzk=mEbjPGJV9vPL9MCgU4WamrGV_fWcpEMA@mail.gmail.com>

On Thu, Jan 21, 2016 at 11:58:26PM +0100, Rafael J. Wysocki wrote:
> On Thu, Jan 21, 2016 at 3:41 PM, Cao jin <caoj.fnst@cn.fujitsu.com> wrote:
> > Hi,
> >
> >     IMHO, I think maybe modification on i801_smbus driver is easier.
> >
> >     Because when i801_smbus request_irq using pci_dev->irq, this
> > pci_dev->irq seems still holds the value read from register(
> > pci_setup_device->pci_read_irq), if the value is 255, it is invalid in
> > register,
> 
> Right.
> 
> Which is why the PCI core should not leak it into the driver's ->probe callback.

Is there a reserved IRQ value we could use to mean "invalid"?

I guess we have NR_IRQS as a ceiling, so the range of valid IRQs would be
[0 .. NR_IRQS - 1].  It looks like irq_desc() and a few drivers already
rely on NR_IRQS being the bound:

  lpc32xx_kscan_probe
  lpc32xx_nand_probe
  pcmcia_setup_isa_irq
  lpc32xx_rtc_probe
  apbuart_verify_port
  ar933x_uart_verify_port
  lqasc_verify_port

So I guess we could use ~0 as "invalid IRQ", and maybe the PCI core could
set dev->irq to ~0 in these cases, and drivers like i801_smbus could check
for that.  Maybe a wrapper like irq_valid() would be useful.

Bjorn

  reply	other threads:[~2016-01-22 17:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19  1:45 [PATCH] pci: fix unavailable irq number 255 reported by BIOS Chen Fan
2016-01-19 13:43 ` Rafael J. Wysocki
2016-01-19 14:20   ` Rafael J. Wysocki
2016-01-19 14:48     ` Sinan Kaya
2016-01-19 15:39       ` Rafael J. Wysocki
2016-01-19 15:51         ` Sinan Kaya
2016-01-19 16:02           ` Rafael J. Wysocki
2016-01-20  4:56         ` Chen Fan
2016-01-20  0:24   ` Bjorn Helgaas
2016-01-20  4:21     ` Chen Fan
2016-01-20 17:12       ` Bjorn Helgaas
2016-01-21  8:02         ` Chen Fan
2016-01-21 14:41     ` Cao jin
2016-01-21 22:58       ` Rafael J. Wysocki
2016-01-22 17:53         ` Bjorn Helgaas [this message]
2016-01-22 19:23           ` David Daney
2016-01-23  2:00             ` Rafael J. Wysocki
2016-01-20  4:56   ` Chen Fan

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=20160122175332.GA11004@localhost \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=chen.fan.fnst@cn.fujitsu.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=jiang.liu@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=wency@cn.fujitsu.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).