linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	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:23:34 -0800	[thread overview]
Message-ID: <56A281B6.6070709@gmail.com> (raw)
In-Reply-To: <20160122175332.GA11004@localhost>

On 01/22/2016 09:53 AM, Bjorn Helgaas wrote:
> 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"?

In many (most) cases, zero indicates no irq.




>
> 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 19:23 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
2016-01-22 19:23           ` David Daney [this message]
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=56A281B6.6070709@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=chen.fan.fnst@cn.fujitsu.com \
    --cc=helgaas@kernel.org \
    --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).