linux-sg2042/drivers
Chen Fan e237a55184 x86/ACPI/PCI: Recognize that Interrupt Line 255 means "not connected"
Per the x86-specific footnote to PCI spec r3.0, sec 6.2.4, the value 255 in
the Interrupt Line register means "unknown" or "no connection."
Previously, when we couldn't derive an IRQ from the _PRT, we fell back to
using the value from Interrupt Line as an IRQ.  It's questionable whether
we should do that at all, but the spec clearly suggests we shouldn't do it
for the value 255 on x86.

Calling request_irq() with IRQ 255 may succeed, but the driver won't
receive any interrupts.  Or, if IRQ 255 is shared with another device, it
may succeed, and the driver's ISR will be called at random times when the
*other* device interrupts.  Or it may fail if another device is using IRQ
255 with incompatible flags.  What we *want* is for request_irq() to fail
predictably so the driver can fall back to polling.

On x86, assume 255 in the Interrupt Line means the INTx line is not
connected.  In that case, set dev->irq to IRQ_NOTCONNECTED so request_irq()
will fail gracefully with -ENOTCONN.

We found this problem on a system where Secure Boot firmware assigned
Interrupt Line 255 to an i801_smbus device and another device was already
using MSI-X IRQ 255.  This was in v3.10, where i801_probe() fails if
request_irq() fails:

  i801_smbus 0000:00:1f.3: enabling device (0140 -> 0143)
  i801_smbus 0000:00:1f.3: can't derive routing for PCI INT C
  i801_smbus 0000:00:1f.3: PCI INT C: no GSI
  genirq: Flags mismatch irq 255. 00000080 (i801_smbus) vs. 00000000 (megasa)
  CPU: 0 PID: 2487 Comm: kworker/0:1 Not tainted 3.10.0-229.el7.x86_64 #1
  Hardware name: FUJITSU PRIMEQUEST 2800E2/D3736, BIOS PRIMEQUEST 2000 Serie5
  Call Trace:
    dump_stack+0x19/0x1b
    __setup_irq+0x54a/0x570
    request_threaded_irq+0xcc/0x170
    i801_probe+0x32f/0x508 [i2c_i801]
    local_pci_probe+0x45/0xa0
  i801_smbus 0000:00:1f.3: Failed to allocate irq 255: -16
  i801_smbus: probe of 0000:00:1f.3 failed with error -16

After aeb8a3d16a ("i2c: i801: Check if interrupts are disabled"),
i801_probe() will fall back to polling if request_irq() fails.  But we
still need this patch because request_irq() may succeed or fail depending
on other devices in the system.  If request_irq() fails, i801_smbus will
work by falling back to polling, but if it succeeds, i801_smbus won't work
because it expects interrupts that it may not receive.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-03-09 01:23:35 +01:00
..
accessibility
acpi x86/ACPI/PCI: Recognize that Interrupt Line 255 means "not connected" 2016-03-09 01:23:35 +01:00
amba
android drivers: android: correct the size of struct binder_uintptr_t for BC_DEAD_BINDER_DONE 2016-02-20 15:43:56 -08:00
ata ata: ahci: don't mark HotPlugCapable Ports as external/removable 2016-02-29 16:17:57 -05:00
atm
auxdisplay
base Merge branch 'component' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2016-02-14 10:40:21 -08:00
bcma GPIO bulk updates for the v4.5 kernel cycle: 2016-01-17 12:32:01 -08:00
block null_blk: oops when initializing without lightnvm 2016-02-11 08:56:09 -07:00
bluetooth
bus vexpress fixes for v4.5 2016-02-01 12:27:18 -08:00
cdrom
char drivers: char: random: add get_random_long() 2016-02-27 10:28:52 -08:00
clk clk: ti: omap3+: dpll: use non-locking version of clk_get_rate 2016-02-22 14:03:02 -08:00
clocksource Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-01-31 15:49:06 -08:00
connector
cpufreq cpufreq: mediatek: allow building as a module 2016-03-01 02:43:05 +01:00
cpuidle Merge branches 'pm-cpuidle', 'pm-cpufreq', 'pm-domains' and 'pm-sleep' 2016-01-29 21:45:17 +01:00
crypto crypto: marvell/cesa - fix test in mv_cesa_dev_dma_init() 2016-02-06 15:23:56 +08:00
dca
devfreq PM / devfreq: tegra: Set freq in rate callback 2016-02-23 14:27:42 +09:00
dio
dma dmaengine: pxa_dma: fix cyclic transfers 2016-03-03 21:06:45 +05:30
dma-buf
edac
eisa
extcon
firewire
firmware efi: Add pstore variables to the deletion whitelist 2016-02-16 12:48:18 +00:00
fmc
fpga
gpio gpio: rcar: Add Runtime PM handling for interrupts 2016-02-25 15:46:27 +01:00
gpu drm/tegra: Fixes for v4.5-rc7 2016-03-05 07:53:25 +10:00
hid asm-generic changes for 4.5 2016-01-20 17:30:20 -08:00
hsi
hv char/misc patches for 4.5-rc1 2016-01-13 10:23:36 -08:00
hwmon hwmon: (gpio-fan) Remove un-necessary speed_index lookup for thermal hook 2016-02-19 17:14:25 -08:00
hwspinlock drivers/hwspinlock: fix race between radix tree insertion and lookup 2016-02-03 08:28:43 -08:00
hwtracing
i2c i2c: brcmstb: allocate correct amount of memory for regmap 2016-03-01 19:16:45 +01:00
ide drivers/ide: make ide-scan-pci.c driver explicitly non-modular 2016-01-18 14:12:33 -05:00
idle
iio Second set of IIO fixes for the 4.5 cycle. These ones are mostly 2016-02-01 13:08:26 -08:00
infiniband Additional 4.5-rc6 fixes 2016-03-04 18:06:49 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2016-02-10 12:21:57 -08:00
iommu iommu/vt-d: Use BUS_NOTIFY_REMOVED_DEVICE in hotplug path 2016-02-29 23:55:16 +01:00
ipack
irqchip irqchip/gicv3-its: Avoid cache flush beyond ITS_BASERn memory size 2016-02-17 17:39:05 +00:00
isdn ser_gigaset: use container_of() instead of detour 2016-02-19 15:52:41 -05:00
leds GPIO bulk updates for the v4.5 kernel cycle: 2016-01-17 12:32:01 -08:00
lguest lguest: Map switcher text R/O 2016-01-12 12:17:28 +01:00
lightnvm lightnvm: allow to force mm initialization 2016-02-04 09:19:45 -07:00
macintosh
mailbox mailbox: Fix dependencies for !HAS_IOMEM archs 2016-02-02 16:47:14 +05:30
mcb
md dm: fix dm_rq_target_io leak on faults with .request_fn DM w/ blk-mq paths 2016-02-21 20:27:50 -05:00
media [media] adv7604: fix tx 5v detect regression 2016-02-16 09:38:51 -02:00
memory ARM: SoC driver updates for v4.5 2016-01-20 18:42:30 -08:00
memstick memstick: use sector_div instead of do_div 2016-01-20 17:09:18 -08:00
message
mfd thermal: allow u8500-thermal driver to be a module 2016-02-09 14:18:23 -08:00
misc powerpc fixes for 4.5 #4 2016-03-06 11:08:06 -08:00
mmc mmc: omap_hsmmc: Fix PM regression with deferred probe for pm_runtime_reinit 2016-02-15 14:10:48 +01:00
mtd ubi: Fix out of bounds write in volume update code 2016-03-05 21:56:23 +01:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-02-22 12:18:07 -08:00
nfc
ntb NTB: Fix macro parameter conflict with field name 2016-01-21 19:53:10 -05:00
nubus
nvdimm nvdimm: use 'u64' for pfn flags 2016-02-23 17:17:20 -08:00
nvme nvme: fix max_segments integer truncation 2016-03-03 14:43:10 -07:00
nvmem nvmem: qfprom: Specify LE device endianness 2016-02-07 23:09:13 -08:00
of DeviceTree fixes for 4.5-rc5: 2016-02-17 11:50:53 -08:00
oprofile wrappers for ->i_mutex access 2016-01-22 18:04:28 -05:00
parisc parisc: convert to dma_map_ops 2016-01-20 17:09:18 -08:00
parport
pci PCI updates for v4.5: 2016-03-03 12:54:39 -08:00
pcmcia
perf
phy phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload 2016-02-10 11:46:01 +05:30
pinctrl pinctrl: samsung: fix SMP race condition 2016-02-15 20:45:50 +01:00
platform intel_scu_ipcutil: underflow in scu_reg_access() 2016-01-30 09:40:35 -08:00
pnp PNP: Add Haswell-ULT to Intel MCH size workaround 2016-02-03 01:00:29 +01:00
power power: bq27xxx_battery: Restore device name 2016-02-21 20:49:34 +01:00
powercap Merge branch 'powercap' 2016-01-12 01:12:40 +01:00
pps
ps3
ptp ptp: ixp46x: use helpers for converting ns to timespec 2016-01-29 12:38:59 -08:00
pwm pwm: Mark all devices as "might sleep" 2016-01-21 15:04:59 +01:00
rapidio rapidio: use kobj_to_dev() 2016-01-20 17:09:18 -08:00
ras
regulator regulator: Update for v4.5 2016-01-15 12:14:47 -08:00
remoteproc virtio: make find_vqs() checkpatch.pl-friendly 2016-01-12 20:47:06 +02:00
reset
rpmsg virtio: make find_vqs() checkpatch.pl-friendly 2016-01-12 20:47:06 +02:00
rtc RTC for 4.5 2016-01-18 12:10:45 -08:00
s390 s390/dasd: fix performance drop 2016-02-17 09:24:07 +01:00
sbus
scsi ipr: Fix regression when loading firmware 2016-02-26 17:26:02 -05:00
sfi
sh drivers: sh: Restore legacy clock domain on SuperH platforms 2016-02-25 09:05:19 +09:00
sn
soc ARM: SoC support for Tegra platforms for v4.5 2016-01-22 17:30:52 -08:00
spi Merge remote-tracking branches 'spi/fix/atmel', 'spi/fix/bcm2835aux', 'spi/fix/fsl-espi', 'spi/fix/imx', 'spi/fix/loopback' and 'spi/fix/omap2-mcspi' into spi-linus 2016-02-12 23:04:41 +00:00
spmi
ssb ssb: mark ssb_bus_register as __maybe_unused 2016-01-19 21:25:57 +02:00
staging media fixes for v4.5-rc7 2016-03-05 12:32:34 -08:00
target target/transport: add flag to indicate CPU Affinity is observed 2016-02-10 23:08:55 -08:00
tc
thermal thermal: cpu_cooling: fix out of bounds access in time_in_idle 2016-02-11 07:13:29 -08:00
thunderbolt
tty Revert "8250: uniphier: allow modular build with 8250 console" 2016-02-07 18:22:54 -08:00
uio
usb USB-serial fixes for v4.5-rc7 2016-03-03 12:37:21 -08:00
uwb
vfio vfio: fix ioctl error handling 2016-02-28 07:38:52 -07:00
vhost vhost: fix error path in vhost_init_used() 2016-03-02 17:01:49 +02:00
video fbcon: set a default value to blink interval 2016-02-26 13:19:55 +02:00
virt
virtio virtio-pci: read the right virtio_pci_notify_cap field 2016-03-02 17:01:49 +02:00
vlynq
vme
w1
watchdog Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2016-03-01 08:57:34 -08:00
xen Xen bug fixes for 4.5-rc5 2016-02-22 13:57:01 -08:00
zorro
Kconfig
Makefile