diff mbox

[1/2] ACPI / PCI: don't allow PCI devices without irq to be enabled

Message ID 1375965314-24232-2-git-send-email-heikki.krogerus@linux.intel.com (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Heikki Krogerus Aug. 8, 2013, 12:35 p.m. UTC
If there is no ACPI entry for the irq, returning error from
acpi_pci_enable_irq() if the irq is 0.

Prarit Bhargava reported an issue where he noticed that his
Dell PowerEdge 840 has buggy BIOS that does not supply ACPI
entries for irq with some devices. That lead into kernel
generating a warning "genirq: Flags mismatch irq 0...". This
will fix that issue.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/acpi/pci_irq.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Rafael Wysocki Aug. 8, 2013, 1:57 p.m. UTC | #1
On Thursday, August 08, 2013 03:35:13 PM Heikki Krogerus wrote:
> If there is no ACPI entry for the irq, returning error from
> acpi_pci_enable_irq() if the irq is 0.
> 
> Prarit Bhargava reported an issue where he noticed that his
> Dell PowerEdge 840 has buggy BIOS that does not supply ACPI
> entries for irq with some devices. That lead into kernel
> generating a warning "genirq: Flags mismatch irq 0...". This
> will fix that issue.
> 
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Tested-by: Prarit Bhargava <prarit@redhat.com>

Hi Bjorn,

Any objections to this?

Rafael


> ---
>  drivers/acpi/pci_irq.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
> index 41c5e1b..902ed1c 100644
> --- a/drivers/acpi/pci_irq.c
> +++ b/drivers/acpi/pci_irq.c
> @@ -419,8 +419,16 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
>  	 */
>  	if (gsi < 0) {
>  		u32 dev_gsi;
> +
> +		/* Not accepting 0 as valid PCI IRQ. */
> +		if (!dev->irq) {
> +			dev_err(&dev->dev, "PCI INT %c: no IRQ\n",
> +				pin_name(pin));
> +			return -ENOENT;
> +		}
> +
>  		/* Interrupt Line values above 0xF are forbidden */
> -		if (dev->irq > 0 && (dev->irq <= 0xF) &&
> +		if ((dev->irq <= 0xF) &&
>  		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
>  			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
>  				 pin_name(pin), dev->irq);
>
Bjorn Helgaas Aug. 12, 2013, 9:14 p.m. UTC | #2
On Thu, Aug 8, 2013 at 7:57 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Thursday, August 08, 2013 03:35:13 PM Heikki Krogerus wrote:
>> If there is no ACPI entry for the irq, returning error from
>> acpi_pci_enable_irq() if the irq is 0.
>>
>> Prarit Bhargava reported an issue where he noticed that his
>> Dell PowerEdge 840 has buggy BIOS that does not supply ACPI
>> entries for irq with some devices. That lead into kernel
>> generating a warning "genirq: Flags mismatch irq 0...". This
>> will fix that issue.
>>
>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>> Tested-by: Prarit Bhargava <prarit@redhat.com>
>
> Hi Bjorn,
>
> Any objections to this?

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

>> ---
>>  drivers/acpi/pci_irq.c | 10 +++++++++-
>>  1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
>> index 41c5e1b..902ed1c 100644
>> --- a/drivers/acpi/pci_irq.c
>> +++ b/drivers/acpi/pci_irq.c
>> @@ -419,8 +419,16 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
>>        */
>>       if (gsi < 0) {
>>               u32 dev_gsi;
>> +
>> +             /* Not accepting 0 as valid PCI IRQ. */
>> +             if (!dev->irq) {
>> +                     dev_err(&dev->dev, "PCI INT %c: no IRQ\n",
>> +                             pin_name(pin));
>> +                     return -ENOENT;
>> +             }
>> +
>>               /* Interrupt Line values above 0xF are forbidden */
>> -             if (dev->irq > 0 && (dev->irq <= 0xF) &&
>> +             if ((dev->irq <= 0xF) &&
>>                   (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
>>                       dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
>>                                pin_name(pin), dev->irq);
>>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yinghai Lu Aug. 12, 2013, 9:32 p.m. UTC | #3
On Mon, Aug 12, 2013 at 2:14 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Thu, Aug 8, 2013 at 7:57 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> On Thursday, August 08, 2013 03:35:13 PM Heikki Krogerus wrote:
>>> If there is no ACPI entry for the irq, returning error from
>>> acpi_pci_enable_irq() if the irq is 0.
>>>
>>> Prarit Bhargava reported an issue where he noticed that his
>>> Dell PowerEdge 840 has buggy BIOS that does not supply ACPI
>>> entries for irq with some devices. That lead into kernel
>>> generating a warning "genirq: Flags mismatch irq 0...". This
>>> will fix that issue.
>>>
>>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>> Tested-by: Prarit Bhargava <prarit@redhat.com>
>>
>> Hi Bjorn,
>>
>> Any objections to this?
>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

some USB3 host controller does not have intx configured, but still
work with MSI?

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Aug. 12, 2013, 10:32 p.m. UTC | #4
On Mon, Aug 12, 2013 at 3:32 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> On Mon, Aug 12, 2013 at 2:14 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On Thu, Aug 8, 2013 at 7:57 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>>> On Thursday, August 08, 2013 03:35:13 PM Heikki Krogerus wrote:
>>>> If there is no ACPI entry for the irq, returning error from
>>>> acpi_pci_enable_irq() if the irq is 0.
>>>>
>>>> Prarit Bhargava reported an issue where he noticed that his
>>>> Dell PowerEdge 840 has buggy BIOS that does not supply ACPI
>>>> entries for irq with some devices. That lead into kernel
>>>> generating a warning "genirq: Flags mismatch irq 0...". This
>>>> will fix that issue.
>>>>
>>>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>>> Tested-by: Prarit Bhargava <prarit@redhat.com>
>>>
>>> Hi Bjorn,
>>>
>>> Any objections to this?
>>
>> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
>
> some USB3 host controller does not have intx configured, but still
> work with MSI?

Huh, OK, I take back my ack, at least while we investigate this.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Aug. 23, 2013, 5 p.m. UTC | #5
On Mon, Aug 12, 2013 at 4:32 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Mon, Aug 12, 2013 at 3:32 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>> On Mon, Aug 12, 2013 at 2:14 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>>> On Thu, Aug 8, 2013 at 7:57 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>>>> On Thursday, August 08, 2013 03:35:13 PM Heikki Krogerus wrote:
>>>>> If there is no ACPI entry for the irq, returning error from
>>>>> acpi_pci_enable_irq() if the irq is 0.
>>>>>
>>>>> Prarit Bhargava reported an issue where he noticed that his
>>>>> Dell PowerEdge 840 has buggy BIOS that does not supply ACPI
>>>>> entries for irq with some devices. That lead into kernel
>>>>> generating a warning "genirq: Flags mismatch irq 0...". This
>>>>> will fix that issue.
>>>>>
>>>>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>>>> Tested-by: Prarit Bhargava <prarit@redhat.com>
>>>>
>>>> Hi Bjorn,
>>>>
>>>> Any objections to this?
>>>
>>> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
>>
>> some USB3 host controller does not have intx configured, but still
>> work with MSI?
>
> Huh, OK, I take back my ack, at least while we investigate this.

Is anybody looking into this?  I'm afraid I gave the impression that
*I* would investigate this.  But I don't really have enough
information, and it would be better if the patch author and the
reporter could investigate it first.

It would help if there were a bugzilla with complete dmesg log, acpidump, etc.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Prarit Bhargava Oct. 3, 2013, 11:58 p.m. UTC | #6
On 08/12/2013 06:32 PM, Bjorn Helgaas wrote:
> On Mon, Aug 12, 2013 at 3:32 PM, Yinghai Lu <yinghai@kernel.org> wrote:
>> On Mon, Aug 12, 2013 at 2:14 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>>> On Thu, Aug 8, 2013 at 7:57 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>>>> On Thursday, August 08, 2013 03:35:13 PM Heikki Krogerus wrote:
>>>>> If there is no ACPI entry for the irq, returning error from
>>>>> acpi_pci_enable_irq() if the irq is 0.
>>>>>
>>>>> Prarit Bhargava reported an issue where he noticed that his
>>>>> Dell PowerEdge 840 has buggy BIOS that does not supply ACPI
>>>>> entries for irq with some devices. That lead into kernel
>>>>> generating a warning "genirq: Flags mismatch irq 0...". This
>>>>> will fix that issue.
>>>>>
>>>>> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>>>> Tested-by: Prarit Bhargava <prarit@redhat.com>
>>>>
>>>> Hi Bjorn,
>>>>
>>>> Any objections to this?
>>>
>>> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
>>
>> some USB3 host controller does not have intx configured, but still
>> work with MSI?
> 
> Huh, OK, I take back my ack, at least while we investigate this.
> 

Bjorn, as suggested I've opened up a BZ here:

https://bugzilla.kernel.org/show_bug.cgi?id=62521

I've only cc'd yourself and Rafael.  Heikki -- I didn't find an account under
your intel.com address ...

P.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 41c5e1b..902ed1c 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -419,8 +419,16 @@  int acpi_pci_irq_enable(struct pci_dev *dev)
 	 */
 	if (gsi < 0) {
 		u32 dev_gsi;
+
+		/* Not accepting 0 as valid PCI IRQ. */
+		if (!dev->irq) {
+			dev_err(&dev->dev, "PCI INT %c: no IRQ\n",
+				pin_name(pin));
+			return -ENOENT;
+		}
+
 		/* Interrupt Line values above 0xF are forbidden */
-		if (dev->irq > 0 && (dev->irq <= 0xF) &&
+		if ((dev->irq <= 0xF) &&
 		    (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
 			dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
 				 pin_name(pin), dev->irq);