mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Merge branch 'pci/misc'
- Mark fall-through switch cases before enabling -Wimplicit-fallthrough
(Gustavo A. R. Silva)
- Move DMA-debug PCI init from arch code to PCI core (Christoph Hellwig)
- Fix pci_request_irq() usage of IRQF_ONESHOT when no handler is supplied
(Heiner Kallweit)
- Unify PCI and DMA direction #defines (Shunyong Yang)
- Add PCI_DEVICE_DATA() macro (Andy Shevchenko)
- Check for VPD completion before checking for timeout (Bert Kenward)
- Limit Netronome NFP5000 config space size to work around erratum (Jakub
Kicinski)
* pci/misc:
PCI: Limit config space size for Netronome NFP5000
PCI/VPD: Check for VPD access completion before checking for timeout
PCI: Add PCI_DEVICE_DATA() macro to fully describe device ID entry
PCI: Unify PCI and normal DMA direction definitions
PCI: Use IRQF_ONESHOT if pci_request_irq() called with no handler
PCI: Call dma_debug_add_bus() for pci_bus_type from PCI core
PCI: Mark fall-through switch cases before enabling -Wimplicit-fallthrough
# Conflicts:
# drivers/pci/hotplug/pciehp_ctrl.c
This commit is contained in:
commit
a40f72db8a
14 changed files with 38 additions and 26 deletions
|
|
@ -654,6 +654,7 @@ int shpchp_sysfs_enable_slot(struct slot *p_slot)
|
|||
switch (p_slot->state) {
|
||||
case BLINKINGON_STATE:
|
||||
cancel_delayed_work(&p_slot->work);
|
||||
/* fall through */
|
||||
case STATIC_STATE:
|
||||
p_slot->state = POWERON_STATE;
|
||||
mutex_unlock(&p_slot->lock);
|
||||
|
|
@ -689,6 +690,7 @@ int shpchp_sysfs_disable_slot(struct slot *p_slot)
|
|||
switch (p_slot->state) {
|
||||
case BLINKINGOFF_STATE:
|
||||
cancel_delayed_work(&p_slot->work);
|
||||
/* fall through */
|
||||
case STATIC_STATE:
|
||||
p_slot->state = POWEROFF_STATE;
|
||||
mutex_unlock(&p_slot->lock);
|
||||
|
|
|
|||
|
|
@ -86,13 +86,17 @@ int pci_request_irq(struct pci_dev *dev, unsigned int nr, irq_handler_t handler,
|
|||
va_list ap;
|
||||
int ret;
|
||||
char *devname;
|
||||
unsigned long irqflags = IRQF_SHARED;
|
||||
|
||||
if (!handler)
|
||||
irqflags |= IRQF_ONESHOT;
|
||||
|
||||
va_start(ap, fmt);
|
||||
devname = kvasprintf(GFP_KERNEL, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
ret = request_threaded_irq(pci_irq_vector(dev, nr), handler, thread_fn,
|
||||
IRQF_SHARED, devname, dev_id);
|
||||
irqflags, devname, dev_id);
|
||||
if (ret)
|
||||
kfree(devname);
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -1668,7 +1668,7 @@ static int __init pci_driver_init(void)
|
|||
if (ret)
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
dma_debug_add_bus(&pci_bus_type);
|
||||
return 0;
|
||||
}
|
||||
postcore_initcall(pci_driver_init);
|
||||
|
|
|
|||
|
|
@ -2044,6 +2044,7 @@ static pci_power_t pci_target_state(struct pci_dev *dev, bool wakeup)
|
|||
case PCI_D2:
|
||||
if (pci_no_d1d2(dev))
|
||||
break;
|
||||
/* else: fall through */
|
||||
default:
|
||||
target_state = state;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -460,6 +460,7 @@ static void quirk_nfp6000(struct pci_dev *dev)
|
|||
}
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP4000, quirk_nfp6000);
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000, quirk_nfp6000);
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP5000, quirk_nfp6000);
|
||||
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETRONOME, PCI_DEVICE_ID_NETRONOME_NFP6000_VF, quirk_nfp6000);
|
||||
|
||||
/* On IBM Crocodile ipr SAS adapters, expand BAR to system page size */
|
||||
|
|
@ -2105,6 +2106,7 @@ static void quirk_netmos(struct pci_dev *dev)
|
|||
if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM &&
|
||||
dev->subsystem_device == 0x0299)
|
||||
return;
|
||||
/* else: fall through */
|
||||
case PCI_DEVICE_ID_NETMOS_9735:
|
||||
case PCI_DEVICE_ID_NETMOS_9745:
|
||||
case PCI_DEVICE_ID_NETMOS_9845:
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ static int pci_vpd_wait(struct pci_dev *dev)
|
|||
if (!vpd->busy)
|
||||
return 0;
|
||||
|
||||
while (time_before(jiffies, timeout)) {
|
||||
do {
|
||||
ret = pci_user_read_config_word(dev, vpd->cap + PCI_VPD_ADDR,
|
||||
&status);
|
||||
if (ret < 0)
|
||||
|
|
@ -160,10 +160,13 @@ static int pci_vpd_wait(struct pci_dev *dev)
|
|||
if (fatal_signal_pending(current))
|
||||
return -EINTR;
|
||||
|
||||
if (time_after(jiffies, timeout))
|
||||
break;
|
||||
|
||||
usleep_range(10, max_sleep);
|
||||
if (max_sleep < 1024)
|
||||
max_sleep *= 2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
pci_warn(dev, "VPD access failed. This is likely a firmware bug on this device. Contact the card vendor for a firmware update\n");
|
||||
return -ETIMEDOUT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue