From: Hannes Reinecke <hare@suse.de>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Yinghai Lu <yinghai@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-kernel@vger.kernel.org, Frederik Himpe <fhimpe@vub.ac.be>,
Oliver Neukum <oneukum@suse.de>,
linux-usb@vger.kernel.org, linux-pci@vger.kernel.org,
Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] pci: do not try to assign irq 255
Date: Tue, 26 Feb 2013 14:50:00 +0100 [thread overview]
Message-ID: <512CBD88.5020008@suse.de> (raw)
In-Reply-To: <20130226132905.GB24959@hardeman.nu>
On 02/26/2013 02:29 PM, David Härdeman wrote:
> On Thu, Feb 21, 2013 at 07:53:14AM +0100, Hannes Reinecke wrote:
>> On 02/20/2013 05:57 PM, Yinghai Lu wrote:
>>> it seems you mess pin with interrupt line.
>>>
>>> current code:
>>> unsigned char irq;
>>>
>>> pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &irq);
>>> dev->pin = irq;
>>> if (irq)
>>> pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
>>> dev->irq = irq;
>>>
>>> so if the device does not have interrupt pin implemented, pin should be zero.
>>> and pin and irq in dev should
>>> be all 0.
>>>
>> But the device _has_ an interrupt pin implemented.
>> The whole point here is that the interrupt line is _NOT_ zero.
>>
> ...
>>
>> So at one point we have to decide that ->irq is not valid, despite it
>> being not set to zero.
>> An alternative fix would be this:
>>
>> diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
>> index 68a921d..4a480cb 100644
>> --- a/drivers/acpi/pci_irq.c
>> +++ b/drivers/acpi/pci_irq.c
>> @@ -469,6 +469,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
>> } else {
>> dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
>> pin_name(pin));
>> + dev->irq = 0;
>> }
>> return 0;
>> }
>>
>> Which probably is a better solution, as here ->irq is _definitely_
>> not valid, so we should reset it to '0' to avoid confusion on upper
>> layers.
>>
>
> Is there any agreement on how to proceed?
>
I would actually prefer the second solution, as the ACPI code gives
some better guarantees here. With the original solution it _might_
be that on non-ACPI systems an interrupt 255 is valid, so it might
incur unwanted regressions.
However, for an ACPI system we only have the two choices, assigning
an interrupt via ACPI tables or use a default GSI value.
If both failed the interrupt definitely is not valid and can safely
be reset to 0.
But this would need a formal ACK from the ACPI gods ...
Len? Rafael?
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
next prev parent reply other threads:[~2013-02-26 13:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-18 10:09 [PATCH] pci: do not try to assign irq 255 Hannes Reinecke
2013-02-19 1:13 ` David Härdeman
2013-02-19 19:40 ` Yinghai Lu
2013-02-20 7:58 ` Hannes Reinecke
2013-02-20 16:57 ` Yinghai Lu
2013-02-21 6:53 ` Hannes Reinecke
2013-02-26 13:29 ` David Härdeman
2013-02-26 13:50 ` Hannes Reinecke [this message]
2013-02-27 21:13 ` Bjorn Helgaas
2013-02-28 16:13 ` Hannes Reinecke
2013-03-01 7:41 ` Hannes Reinecke
2013-03-05 22:41 ` Sarah Sharp
2013-03-26 21:54 ` Bjorn Helgaas
2013-03-26 23:34 ` Yinghai Lu
2013-09-10 21:53 ` Bjorn Helgaas
2013-02-19 19:47 ` Bjorn Helgaas
2013-02-19 22:36 ` Frederik Himpe
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=512CBD88.5020008@suse.de \
--to=hare@suse.de \
--cc=bhelgaas@google.com \
--cc=fhimpe@vub.ac.be \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=rjw@sisk.pl \
--cc=yinghai@kernel.org \
/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).