Commit 02fd4e76 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-pci', 'acpi-soc' and 'pnp'

* acpi-pci:
  x86/ACPI/PCI: Recognize that Interrupt Line 255 means "not connected"

* acpi-soc:
  i2c: designware: Add device HID for future AMD I2C controller

* pnp:
  PNP / ACPI: add ACPI_RESOURCE_TYPE_SERIAL_BUS as a valid type
...@@ -143,6 +143,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = { ...@@ -143,6 +143,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
/* Generic apd devices */ /* Generic apd devices */
#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE #ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
{ "AMD0010", APD_ADDR(cz_i2c_desc) }, { "AMD0010", APD_ADDR(cz_i2c_desc) },
{ "AMDI0010", APD_ADDR(cz_i2c_desc) },
{ "AMD0020", APD_ADDR(cz_uart_desc) }, { "AMD0020", APD_ADDR(cz_uart_desc) },
{ "AMD0030", }, { "AMD0030", },
#endif #endif
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/interrupt.h>
#define PREFIX "ACPI: " #define PREFIX "ACPI: "
...@@ -387,6 +388,23 @@ static inline int acpi_isa_register_gsi(struct pci_dev *dev) ...@@ -387,6 +388,23 @@ static inline int acpi_isa_register_gsi(struct pci_dev *dev)
} }
#endif #endif
static inline bool acpi_pci_irq_valid(struct pci_dev *dev, u8 pin)
{
#ifdef CONFIG_X86
/*
* On x86 irq line 0xff means "unknown" or "no connection"
* (PCI 3.0, Section 6.2.4, footnote on page 223).
*/
if (dev->irq == 0xff) {
dev->irq = IRQ_NOTCONNECTED;
dev_warn(&dev->dev, "PCI INT %c: not connected\n",
pin_name(pin));
return false;
}
#endif
return true;
}
int acpi_pci_irq_enable(struct pci_dev *dev) int acpi_pci_irq_enable(struct pci_dev *dev)
{ {
struct acpi_prt_entry *entry; struct acpi_prt_entry *entry;
...@@ -431,11 +449,14 @@ int acpi_pci_irq_enable(struct pci_dev *dev) ...@@ -431,11 +449,14 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
} else } else
gsi = -1; gsi = -1;
if (gsi < 0) {
/* /*
* No IRQ known to the ACPI subsystem - maybe the BIOS / * No IRQ known to the ACPI subsystem - maybe the BIOS /
* driver reported one, then use it. Exit in any case. * driver reported one, then use it. Exit in any case.
*/ */
if (gsi < 0) { if (!acpi_pci_irq_valid(dev, pin))
return 0;
if (acpi_isa_register_gsi(dev)) if (acpi_isa_register_gsi(dev))
dev_warn(&dev->dev, "PCI INT %c: no GSI\n", dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
pin_name(pin)); pin_name(pin));
......
...@@ -123,6 +123,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = { ...@@ -123,6 +123,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
{ "80860F41", 0 }, { "80860F41", 0 },
{ "808622C1", 0 }, { "808622C1", 0 },
{ "AMD0010", ACCESS_INTR_MASK }, { "AMD0010", ACCESS_INTR_MASK },
{ "AMDI0010", ACCESS_INTR_MASK },
{ "AMDI0510", 0 }, { "AMDI0510", 0 },
{ "APMC0D0F", 0 }, { "APMC0D0F", 0 },
{ } { }
......
...@@ -252,6 +252,10 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, ...@@ -252,6 +252,10 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
case ACPI_RESOURCE_TYPE_GENERIC_REGISTER: case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
break; break;
case ACPI_RESOURCE_TYPE_SERIAL_BUS:
/* serial bus connections (I2C/SPI/UART) are not pnp */
break;
default: default:
dev_warn(&dev->dev, "unknown resource type %d in _CRS\n", dev_warn(&dev->dev, "unknown resource type %d in _CRS\n",
res->type); res->type);
......
...@@ -125,6 +125,16 @@ struct irqaction { ...@@ -125,6 +125,16 @@ struct irqaction {
extern irqreturn_t no_action(int cpl, void *dev_id); extern irqreturn_t no_action(int cpl, void *dev_id);
/*
* If a (PCI) device interrupt is not connected we set dev->irq to
* IRQ_NOTCONNECTED. This causes request_irq() to fail with -ENOTCONN, so we
* can distingiush that case from other error returns.
*
* 0x80000000 is guaranteed to be outside the available range of interrupts
* and easy to distinguish from other possible incorrect values.
*/
#define IRQ_NOTCONNECTED (1U << 31)
extern int __must_check extern int __must_check
request_threaded_irq(unsigned int irq, irq_handler_t handler, request_threaded_irq(unsigned int irq, irq_handler_t handler,
irq_handler_t thread_fn, irq_handler_t thread_fn,
......
...@@ -1609,6 +1609,9 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler, ...@@ -1609,6 +1609,9 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
struct irq_desc *desc; struct irq_desc *desc;
int retval; int retval;
if (irq == IRQ_NOTCONNECTED)
return -ENOTCONN;
/* /*
* Sanity-check: shared interrupts must pass in a real dev-ID, * Sanity-check: shared interrupts must pass in a real dev-ID,
* otherwise we'll have trouble later trying to figure out * otherwise we'll have trouble later trying to figure out
...@@ -1699,9 +1702,13 @@ EXPORT_SYMBOL(request_threaded_irq); ...@@ -1699,9 +1702,13 @@ EXPORT_SYMBOL(request_threaded_irq);
int request_any_context_irq(unsigned int irq, irq_handler_t handler, int request_any_context_irq(unsigned int irq, irq_handler_t handler,
unsigned long flags, const char *name, void *dev_id) unsigned long flags, const char *name, void *dev_id)
{ {
struct irq_desc *desc = irq_to_desc(irq); struct irq_desc *desc;
int ret; int ret;
if (irq == IRQ_NOTCONNECTED)
return -ENOTCONN;
desc = irq_to_desc(irq);
if (!desc) if (!desc)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment