提交 412ee7cd 编写于 作者: B Bjorn Helgaas 提交者: Bjorn Helgaas

Merge branch 'pci/misc' into next

* pci/misc:
  PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build
  PCI: Add wrappers for dev_printk()
  PCI: Remove unnecessary messages for memory allocation failures
  PCI: Add #defines for Completion Timeout Disable feature
  hinic: Replace PCI pool old API
  net: e100: Replace PCI pool old API
  block: DAC960: Replace PCI pool old API
  MAINTAINERS: Include more PCI files
  PCI: Remove unneeded kallsyms include
  powerpc/pci: Unroll two pass loop when scanning bridges
  powerpc/pci: Use for_each_pci_bridge() helper
...@@ -10552,8 +10552,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git ...@@ -10552,8 +10552,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
S: Supported S: Supported
F: Documentation/devicetree/bindings/pci/ F: Documentation/devicetree/bindings/pci/
F: Documentation/PCI/ F: Documentation/PCI/
F: drivers/acpi/pci*
F: drivers/pci/ F: drivers/pci/
F: include/asm-generic/pci*
F: include/linux/pci* F: include/linux/pci*
F: include/uapi/linux/pci*
F: lib/pci*
F: arch/x86/pci/ F: arch/x86/pci/
F: arch/x86/kernel/quirks.c F: arch/x86/kernel/quirks.c
......
...@@ -104,7 +104,7 @@ EXPORT_SYMBOL_GPL(pci_hp_remove_devices); ...@@ -104,7 +104,7 @@ EXPORT_SYMBOL_GPL(pci_hp_remove_devices);
*/ */
void pci_hp_add_devices(struct pci_bus *bus) void pci_hp_add_devices(struct pci_bus *bus)
{ {
int slotno, mode, pass, max; int slotno, mode, max;
struct pci_dev *dev; struct pci_dev *dev;
struct pci_controller *phb; struct pci_controller *phb;
struct device_node *dn = pci_bus_to_OF_node(bus); struct device_node *dn = pci_bus_to_OF_node(bus);
...@@ -133,13 +133,17 @@ void pci_hp_add_devices(struct pci_bus *bus) ...@@ -133,13 +133,17 @@ void pci_hp_add_devices(struct pci_bus *bus)
pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
pcibios_setup_bus_devices(bus); pcibios_setup_bus_devices(bus);
max = bus->busn_res.start; max = bus->busn_res.start;
for (pass = 0; pass < 2; pass++) { /*
list_for_each_entry(dev, &bus->devices, bus_list) { * Scan bridges that are already configured. We don't touch
if (pci_is_bridge(dev)) * them unless they are misconfigured (which will be done in
max = pci_scan_bridge(bus, dev, * the second scan below).
max, pass); */
} for_each_pci_bridge(dev, bus)
} max = pci_scan_bridge(bus, dev, max, 0);
/* Scan bridges that need to be reconfigured */
for_each_pci_bridge(dev, bus)
max = pci_scan_bridge(bus, dev, max, 1);
} }
pcibios_finish_adding_to_bus(bus); pcibios_finish_adding_to_bus(bus);
} }
......
...@@ -369,11 +369,8 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus, ...@@ -369,11 +369,8 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
pcibios_setup_bus_devices(bus); pcibios_setup_bus_devices(bus);
/* Now scan child busses */ /* Now scan child busses */
list_for_each_entry(dev, &bus->devices, bus_list) { for_each_pci_bridge(dev, bus)
if (pci_is_bridge(dev)) { of_scan_pci_bridge(dev);
of_scan_pci_bridge(dev);
}
}
} }
/** /**
......
...@@ -1654,14 +1654,14 @@ static int pnv_eeh_restore_vf_config(struct pci_dn *pdn) ...@@ -1654,14 +1654,14 @@ static int pnv_eeh_restore_vf_config(struct pci_dn *pdn)
eeh_ops->write_config(pdn, edev->pcie_cap + PCI_EXP_DEVCTL, eeh_ops->write_config(pdn, edev->pcie_cap + PCI_EXP_DEVCTL,
2, devctl); 2, devctl);
/* Disable Completion Timeout */ /* Disable Completion Timeout if possible */
eeh_ops->read_config(pdn, edev->pcie_cap + PCI_EXP_DEVCAP2, eeh_ops->read_config(pdn, edev->pcie_cap + PCI_EXP_DEVCAP2,
4, &cap2); 4, &cap2);
if (cap2 & 0x10) { if (cap2 & PCI_EXP_DEVCAP2_COMP_TMOUT_DIS) {
eeh_ops->read_config(pdn, eeh_ops->read_config(pdn,
edev->pcie_cap + PCI_EXP_DEVCTL2, edev->pcie_cap + PCI_EXP_DEVCTL2,
4, &cap2); 4, &cap2);
cap2 |= 0x10; cap2 |= PCI_EXP_DEVCTL2_COMP_TMOUT_DIS;
eeh_ops->write_config(pdn, eeh_ops->write_config(pdn,
edev->pcie_cap + PCI_EXP_DEVCTL2, edev->pcie_cap + PCI_EXP_DEVCTL2,
4, cap2); 4, cap2);
......
...@@ -268,17 +268,17 @@ static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller) ...@@ -268,17 +268,17 @@ static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller)
void *AllocationPointer = NULL; void *AllocationPointer = NULL;
void *ScatterGatherCPU = NULL; void *ScatterGatherCPU = NULL;
dma_addr_t ScatterGatherDMA; dma_addr_t ScatterGatherDMA;
struct pci_pool *ScatterGatherPool; struct dma_pool *ScatterGatherPool;
void *RequestSenseCPU = NULL; void *RequestSenseCPU = NULL;
dma_addr_t RequestSenseDMA; dma_addr_t RequestSenseDMA;
struct pci_pool *RequestSensePool = NULL; struct dma_pool *RequestSensePool = NULL;
if (Controller->FirmwareType == DAC960_V1_Controller) if (Controller->FirmwareType == DAC960_V1_Controller)
{ {
CommandAllocationLength = offsetof(DAC960_Command_T, V1.EndMarker); CommandAllocationLength = offsetof(DAC960_Command_T, V1.EndMarker);
CommandAllocationGroupSize = DAC960_V1_CommandAllocationGroupSize; CommandAllocationGroupSize = DAC960_V1_CommandAllocationGroupSize;
ScatterGatherPool = pci_pool_create("DAC960_V1_ScatterGather", ScatterGatherPool = dma_pool_create("DAC960_V1_ScatterGather",
Controller->PCIDevice, &Controller->PCIDevice->dev,
DAC960_V1_ScatterGatherLimit * sizeof(DAC960_V1_ScatterGatherSegment_T), DAC960_V1_ScatterGatherLimit * sizeof(DAC960_V1_ScatterGatherSegment_T),
sizeof(DAC960_V1_ScatterGatherSegment_T), 0); sizeof(DAC960_V1_ScatterGatherSegment_T), 0);
if (ScatterGatherPool == NULL) if (ScatterGatherPool == NULL)
...@@ -290,18 +290,18 @@ static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller) ...@@ -290,18 +290,18 @@ static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller)
{ {
CommandAllocationLength = offsetof(DAC960_Command_T, V2.EndMarker); CommandAllocationLength = offsetof(DAC960_Command_T, V2.EndMarker);
CommandAllocationGroupSize = DAC960_V2_CommandAllocationGroupSize; CommandAllocationGroupSize = DAC960_V2_CommandAllocationGroupSize;
ScatterGatherPool = pci_pool_create("DAC960_V2_ScatterGather", ScatterGatherPool = dma_pool_create("DAC960_V2_ScatterGather",
Controller->PCIDevice, &Controller->PCIDevice->dev,
DAC960_V2_ScatterGatherLimit * sizeof(DAC960_V2_ScatterGatherSegment_T), DAC960_V2_ScatterGatherLimit * sizeof(DAC960_V2_ScatterGatherSegment_T),
sizeof(DAC960_V2_ScatterGatherSegment_T), 0); sizeof(DAC960_V2_ScatterGatherSegment_T), 0);
if (ScatterGatherPool == NULL) if (ScatterGatherPool == NULL)
return DAC960_Failure(Controller, return DAC960_Failure(Controller,
"AUXILIARY STRUCTURE CREATION (SG)"); "AUXILIARY STRUCTURE CREATION (SG)");
RequestSensePool = pci_pool_create("DAC960_V2_RequestSense", RequestSensePool = dma_pool_create("DAC960_V2_RequestSense",
Controller->PCIDevice, sizeof(DAC960_SCSI_RequestSense_T), &Controller->PCIDevice->dev, sizeof(DAC960_SCSI_RequestSense_T),
sizeof(int), 0); sizeof(int), 0);
if (RequestSensePool == NULL) { if (RequestSensePool == NULL) {
pci_pool_destroy(ScatterGatherPool); dma_pool_destroy(ScatterGatherPool);
return DAC960_Failure(Controller, return DAC960_Failure(Controller,
"AUXILIARY STRUCTURE CREATION (SG)"); "AUXILIARY STRUCTURE CREATION (SG)");
} }
...@@ -335,16 +335,16 @@ static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller) ...@@ -335,16 +335,16 @@ static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller)
Command->Next = Controller->FreeCommands; Command->Next = Controller->FreeCommands;
Controller->FreeCommands = Command; Controller->FreeCommands = Command;
Controller->Commands[CommandIdentifier-1] = Command; Controller->Commands[CommandIdentifier-1] = Command;
ScatterGatherCPU = pci_pool_alloc(ScatterGatherPool, GFP_ATOMIC, ScatterGatherCPU = dma_pool_alloc(ScatterGatherPool, GFP_ATOMIC,
&ScatterGatherDMA); &ScatterGatherDMA);
if (ScatterGatherCPU == NULL) if (ScatterGatherCPU == NULL)
return DAC960_Failure(Controller, "AUXILIARY STRUCTURE CREATION"); return DAC960_Failure(Controller, "AUXILIARY STRUCTURE CREATION");
if (RequestSensePool != NULL) { if (RequestSensePool != NULL) {
RequestSenseCPU = pci_pool_alloc(RequestSensePool, GFP_ATOMIC, RequestSenseCPU = dma_pool_alloc(RequestSensePool, GFP_ATOMIC,
&RequestSenseDMA); &RequestSenseDMA);
if (RequestSenseCPU == NULL) { if (RequestSenseCPU == NULL) {
pci_pool_free(ScatterGatherPool, ScatterGatherCPU, dma_pool_free(ScatterGatherPool, ScatterGatherCPU,
ScatterGatherDMA); ScatterGatherDMA);
return DAC960_Failure(Controller, return DAC960_Failure(Controller,
"AUXILIARY STRUCTURE CREATION"); "AUXILIARY STRUCTURE CREATION");
...@@ -379,8 +379,8 @@ static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller) ...@@ -379,8 +379,8 @@ static bool DAC960_CreateAuxiliaryStructures(DAC960_Controller_T *Controller)
static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller) static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller)
{ {
int i; int i;
struct pci_pool *ScatterGatherPool = Controller->ScatterGatherPool; struct dma_pool *ScatterGatherPool = Controller->ScatterGatherPool;
struct pci_pool *RequestSensePool = NULL; struct dma_pool *RequestSensePool = NULL;
void *ScatterGatherCPU; void *ScatterGatherCPU;
dma_addr_t ScatterGatherDMA; dma_addr_t ScatterGatherDMA;
void *RequestSenseCPU; void *RequestSenseCPU;
...@@ -411,9 +411,9 @@ static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller) ...@@ -411,9 +411,9 @@ static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller)
RequestSenseDMA = Command->V2.RequestSenseDMA; RequestSenseDMA = Command->V2.RequestSenseDMA;
} }
if (ScatterGatherCPU != NULL) if (ScatterGatherCPU != NULL)
pci_pool_free(ScatterGatherPool, ScatterGatherCPU, ScatterGatherDMA); dma_pool_free(ScatterGatherPool, ScatterGatherCPU, ScatterGatherDMA);
if (RequestSenseCPU != NULL) if (RequestSenseCPU != NULL)
pci_pool_free(RequestSensePool, RequestSenseCPU, RequestSenseDMA); dma_pool_free(RequestSensePool, RequestSenseCPU, RequestSenseDMA);
if ((Command->CommandIdentifier if ((Command->CommandIdentifier
% Controller->CommandAllocationGroupSize) == 1) { % Controller->CommandAllocationGroupSize) == 1) {
...@@ -437,13 +437,11 @@ static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller) ...@@ -437,13 +437,11 @@ static void DAC960_DestroyAuxiliaryStructures(DAC960_Controller_T *Controller)
Controller->CurrentStatusBuffer = NULL; Controller->CurrentStatusBuffer = NULL;
} }
if (ScatterGatherPool != NULL) dma_pool_destroy(ScatterGatherPool);
pci_pool_destroy(ScatterGatherPool);
if (Controller->FirmwareType == DAC960_V1_Controller) if (Controller->FirmwareType == DAC960_V1_Controller)
return; return;
if (RequestSensePool != NULL) dma_pool_destroy(RequestSensePool);
pci_pool_destroy(RequestSensePool);
for (i = 0; i < DAC960_MaxLogicalDrives; i++) { for (i = 0; i < DAC960_MaxLogicalDrives; i++) {
kfree(Controller->V2.LogicalDeviceInformation[i]); kfree(Controller->V2.LogicalDeviceInformation[i]);
......
...@@ -2316,7 +2316,7 @@ typedef struct DAC960_Controller ...@@ -2316,7 +2316,7 @@ typedef struct DAC960_Controller
bool SuppressEnclosureMessages; bool SuppressEnclosureMessages;
struct timer_list MonitoringTimer; struct timer_list MonitoringTimer;
struct gendisk *disks[DAC960_MaxLogicalDrives]; struct gendisk *disks[DAC960_MaxLogicalDrives];
struct pci_pool *ScatterGatherPool; struct dma_pool *ScatterGatherPool;
DAC960_Command_T *FreeCommands; DAC960_Command_T *FreeCommands;
unsigned char *CombinedStatusBuffer; unsigned char *CombinedStatusBuffer;
unsigned char *CurrentStatusBuffer; unsigned char *CurrentStatusBuffer;
...@@ -2429,7 +2429,7 @@ typedef struct DAC960_Controller ...@@ -2429,7 +2429,7 @@ typedef struct DAC960_Controller
bool NeedDeviceSerialNumberInformation; bool NeedDeviceSerialNumberInformation;
bool StartLogicalDeviceInformationScan; bool StartLogicalDeviceInformationScan;
bool StartPhysicalDeviceInformationScan; bool StartPhysicalDeviceInformationScan;
struct pci_pool *RequestSensePool; struct dma_pool *RequestSensePool;
dma_addr_t FirstCommandMailboxDMA; dma_addr_t FirstCommandMailboxDMA;
DAC960_V2_CommandMailbox_T *FirstCommandMailbox; DAC960_V2_CommandMailbox_T *FirstCommandMailbox;
......
...@@ -143,7 +143,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs, ...@@ -143,7 +143,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs,
struct hinic_hwif *hwif = cmdqs->hwif; struct hinic_hwif *hwif = cmdqs->hwif;
struct pci_dev *pdev = hwif->pdev; struct pci_dev *pdev = hwif->pdev;
cmdq_buf->buf = pci_pool_alloc(cmdqs->cmdq_buf_pool, GFP_KERNEL, cmdq_buf->buf = dma_pool_alloc(cmdqs->cmdq_buf_pool, GFP_KERNEL,
&cmdq_buf->dma_addr); &cmdq_buf->dma_addr);
if (!cmdq_buf->buf) { if (!cmdq_buf->buf) {
dev_err(&pdev->dev, "Failed to allocate cmd from the pool\n"); dev_err(&pdev->dev, "Failed to allocate cmd from the pool\n");
...@@ -161,7 +161,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs, ...@@ -161,7 +161,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs,
void hinic_free_cmdq_buf(struct hinic_cmdqs *cmdqs, void hinic_free_cmdq_buf(struct hinic_cmdqs *cmdqs,
struct hinic_cmdq_buf *cmdq_buf) struct hinic_cmdq_buf *cmdq_buf)
{ {
pci_pool_free(cmdqs->cmdq_buf_pool, cmdq_buf->buf, cmdq_buf->dma_addr); dma_pool_free(cmdqs->cmdq_buf_pool, cmdq_buf->buf, cmdq_buf->dma_addr);
} }
static unsigned int cmdq_wqe_size_from_bdlen(enum bufdesc_len len) static unsigned int cmdq_wqe_size_from_bdlen(enum bufdesc_len len)
...@@ -875,7 +875,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, ...@@ -875,7 +875,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif,
int err; int err;
cmdqs->hwif = hwif; cmdqs->hwif = hwif;
cmdqs->cmdq_buf_pool = pci_pool_create("hinic_cmdq", pdev, cmdqs->cmdq_buf_pool = dma_pool_create("hinic_cmdq", &pdev->dev,
HINIC_CMDQ_BUF_SIZE, HINIC_CMDQ_BUF_SIZE,
HINIC_CMDQ_BUF_SIZE, 0); HINIC_CMDQ_BUF_SIZE, 0);
if (!cmdqs->cmdq_buf_pool) if (!cmdqs->cmdq_buf_pool)
...@@ -916,7 +916,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, ...@@ -916,7 +916,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif,
devm_kfree(&pdev->dev, cmdqs->saved_wqs); devm_kfree(&pdev->dev, cmdqs->saved_wqs);
err_saved_wqs: err_saved_wqs:
pci_pool_destroy(cmdqs->cmdq_buf_pool); dma_pool_destroy(cmdqs->cmdq_buf_pool);
return err; return err;
} }
...@@ -942,5 +942,5 @@ void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs) ...@@ -942,5 +942,5 @@ void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs)
devm_kfree(&pdev->dev, cmdqs->saved_wqs); devm_kfree(&pdev->dev, cmdqs->saved_wqs);
pci_pool_destroy(cmdqs->cmdq_buf_pool); dma_pool_destroy(cmdqs->cmdq_buf_pool);
} }
...@@ -157,7 +157,7 @@ struct hinic_cmdq { ...@@ -157,7 +157,7 @@ struct hinic_cmdq {
struct hinic_cmdqs { struct hinic_cmdqs {
struct hinic_hwif *hwif; struct hinic_hwif *hwif;
struct pci_pool *cmdq_buf_pool; struct dma_pool *cmdq_buf_pool;
struct hinic_wq *saved_wqs; struct hinic_wq *saved_wqs;
......
...@@ -607,7 +607,7 @@ struct nic { ...@@ -607,7 +607,7 @@ struct nic {
struct mem *mem; struct mem *mem;
dma_addr_t dma_addr; dma_addr_t dma_addr;
struct pci_pool *cbs_pool; struct dma_pool *cbs_pool;
dma_addr_t cbs_dma_addr; dma_addr_t cbs_dma_addr;
u8 adaptive_ifs; u8 adaptive_ifs;
u8 tx_threshold; u8 tx_threshold;
...@@ -1892,7 +1892,7 @@ static void e100_clean_cbs(struct nic *nic) ...@@ -1892,7 +1892,7 @@ static void e100_clean_cbs(struct nic *nic)
nic->cb_to_clean = nic->cb_to_clean->next; nic->cb_to_clean = nic->cb_to_clean->next;
nic->cbs_avail++; nic->cbs_avail++;
} }
pci_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr); dma_pool_free(nic->cbs_pool, nic->cbs, nic->cbs_dma_addr);
nic->cbs = NULL; nic->cbs = NULL;
nic->cbs_avail = 0; nic->cbs_avail = 0;
} }
...@@ -1910,7 +1910,7 @@ static int e100_alloc_cbs(struct nic *nic) ...@@ -1910,7 +1910,7 @@ static int e100_alloc_cbs(struct nic *nic)
nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL; nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = NULL;
nic->cbs_avail = 0; nic->cbs_avail = 0;
nic->cbs = pci_pool_zalloc(nic->cbs_pool, GFP_KERNEL, nic->cbs = dma_pool_zalloc(nic->cbs_pool, GFP_KERNEL,
&nic->cbs_dma_addr); &nic->cbs_dma_addr);
if (!nic->cbs) if (!nic->cbs)
return -ENOMEM; return -ENOMEM;
...@@ -2960,8 +2960,8 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2960,8 +2960,8 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netif_err(nic, probe, nic->netdev, "Cannot register net device, aborting\n"); netif_err(nic, probe, nic->netdev, "Cannot register net device, aborting\n");
goto err_out_free; goto err_out_free;
} }
nic->cbs_pool = pci_pool_create(netdev->name, nic->cbs_pool = dma_pool_create(netdev->name,
nic->pdev, &nic->pdev->dev,
nic->params.cbs.max * sizeof(struct cb), nic->params.cbs.max * sizeof(struct cb),
sizeof(u32), sizeof(u32),
0); 0);
...@@ -3001,7 +3001,7 @@ static void e100_remove(struct pci_dev *pdev) ...@@ -3001,7 +3001,7 @@ static void e100_remove(struct pci_dev *pdev)
unregister_netdev(netdev); unregister_netdev(netdev);
e100_free(nic); e100_free(nic);
pci_iounmap(pdev, nic->csr); pci_iounmap(pdev, nic->csr);
pci_pool_destroy(nic->cbs_pool); dma_pool_destroy(nic->cbs_pool);
free_netdev(netdev); free_netdev(netdev);
pci_release_regions(pdev); pci_release_regions(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
......
...@@ -333,8 +333,7 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size) ...@@ -333,8 +333,7 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size)
(tag == PCI_VPD_LTIN_RW_DATA)) { (tag == PCI_VPD_LTIN_RW_DATA)) {
if (pci_read_vpd(dev, off+1, 2, if (pci_read_vpd(dev, off+1, 2,
&header[1]) != 2) { &header[1]) != 2) {
dev_warn(&dev->dev, pci_warn(dev, "invalid large VPD tag %02x size at offset %zu",
"invalid large VPD tag %02x size at offset %zu",
tag, off + 1); tag, off + 1);
return 0; return 0;
} }
...@@ -354,8 +353,7 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size) ...@@ -354,8 +353,7 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size)
if ((tag != PCI_VPD_LTIN_ID_STRING) && if ((tag != PCI_VPD_LTIN_ID_STRING) &&
(tag != PCI_VPD_LTIN_RO_DATA) && (tag != PCI_VPD_LTIN_RO_DATA) &&
(tag != PCI_VPD_LTIN_RW_DATA)) { (tag != PCI_VPD_LTIN_RW_DATA)) {
dev_warn(&dev->dev, pci_warn(dev, "invalid %s VPD tag %02x at offset %zu",
"invalid %s VPD tag %02x at offset %zu",
(header[0] & PCI_VPD_LRDT) ? "large" : "short", (header[0] & PCI_VPD_LRDT) ? "large" : "short",
tag, off); tag, off);
return 0; return 0;
...@@ -402,7 +400,7 @@ static int pci_vpd_wait(struct pci_dev *dev) ...@@ -402,7 +400,7 @@ static int pci_vpd_wait(struct pci_dev *dev)
max_sleep *= 2; max_sleep *= 2;
} }
dev_warn(&dev->dev, "VPD access failed. This is likely a firmware bug on this device. Contact the card vendor for a firmware update\n"); 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; return -ETIMEDOUT;
} }
......
...@@ -289,7 +289,7 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx) ...@@ -289,7 +289,7 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx)
res->end = end; res->end = end;
res->flags &= ~IORESOURCE_UNSET; res->flags &= ~IORESOURCE_UNSET;
orig_res.flags &= ~IORESOURCE_UNSET; orig_res.flags &= ~IORESOURCE_UNSET;
dev_printk(KERN_DEBUG, &dev->dev, "%pR clipped to %pR\n", pci_printk(KERN_DEBUG, dev, "%pR clipped to %pR\n",
&orig_res, res); &orig_res, res);
return true; return true;
...@@ -325,7 +325,7 @@ void pci_bus_add_device(struct pci_dev *dev) ...@@ -325,7 +325,7 @@ void pci_bus_add_device(struct pci_dev *dev)
dev->match_driver = true; dev->match_driver = true;
retval = device_attach(&dev->dev); retval = device_attach(&dev->dev);
if (retval < 0 && retval != -EPROBE_DEFER) { if (retval < 0 && retval != -EPROBE_DEFER) {
dev_warn(&dev->dev, "device attach failed (%d)\n", retval); pci_warn(dev, "device attach failed (%d)\n", retval);
pci_proc_detach_device(dev); pci_proc_detach_device(dev);
pci_remove_sysfs_dev_files(dev); pci_remove_sysfs_dev_files(dev);
return; return;
......
...@@ -811,10 +811,8 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) ...@@ -811,10 +811,8 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)
handle = adev->handle; handle = adev->handle;
bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL); bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);
if (!bridge) { if (!bridge)
acpi_handle_err(handle, "No memory for bridge object\n");
return; return;
}
INIT_LIST_HEAD(&bridge->slots); INIT_LIST_HEAD(&bridge->slots);
kref_init(&bridge->ref); kref_init(&bridge->ref);
......
...@@ -835,7 +835,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -835,7 +835,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
bus = pdev->subordinate; bus = pdev->subordinate;
if (!bus) { if (!bus) {
dev_notice(&pdev->dev, "the device is not a bridge, skipping\n"); pci_notice(pdev, "the device is not a bridge, skipping\n");
rc = -ENODEV; rc = -ENODEV;
goto err_disable_device; goto err_disable_device;
} }
...@@ -883,7 +883,6 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -883,7 +883,6 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ctrl = kzalloc(sizeof(struct controller), GFP_KERNEL); ctrl = kzalloc(sizeof(struct controller), GFP_KERNEL);
if (!ctrl) { if (!ctrl) {
err("%s : out of memory\n", __func__);
rc = -ENOMEM; rc = -ENOMEM;
goto err_disable_device; goto err_disable_device;
} }
......
...@@ -603,10 +603,8 @@ int ibmphp_update_slot_info(struct slot *slot_cur) ...@@ -603,10 +603,8 @@ int ibmphp_update_slot_info(struct slot *slot_cur)
u8 mode; u8 mode;
info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL); info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);
if (!info) { if (!info)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
info->power_status = SLOT_PWRGD(slot_cur->status); info->power_status = SLOT_PWRGD(slot_cur->status);
info->attention_status = SLOT_ATTN(slot_cur->status, info->attention_status = SLOT_ATTN(slot_cur->status,
...@@ -735,14 +733,12 @@ static u8 bus_structure_fixup(u8 busno) ...@@ -735,14 +733,12 @@ static u8 bus_structure_fixup(u8 busno)
return 1; return 1;
bus = kmalloc(sizeof(*bus), GFP_KERNEL); bus = kmalloc(sizeof(*bus), GFP_KERNEL);
if (!bus) { if (!bus)
err("%s - out of memory\n", __func__);
return 1; return 1;
}
dev = kmalloc(sizeof(*dev), GFP_KERNEL); dev = kmalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) { if (!dev) {
kfree(bus); kfree(bus);
err("%s - out of memory\n", __func__);
return 1; return 1;
} }
...@@ -1102,7 +1098,6 @@ static int enable_slot(struct hotplug_slot *hs) ...@@ -1102,7 +1098,6 @@ static int enable_slot(struct hotplug_slot *hs)
if (!slot_cur->func) { if (!slot_cur->func) {
/* We cannot do update_slot_info here, since no memory for /* We cannot do update_slot_info here, since no memory for
* kmalloc n.e.ways, and update_slot_info allocates some */ * kmalloc n.e.ways, and update_slot_info allocates some */
err("out of system memory\n");
rc = -ENOMEM; rc = -ENOMEM;
goto error_power; goto error_power;
} }
...@@ -1209,7 +1204,6 @@ int ibmphp_do_disable_slot(struct slot *slot_cur) ...@@ -1209,7 +1204,6 @@ int ibmphp_do_disable_slot(struct slot *slot_cur)
/* We need this for functions that were there on bootup */ /* We need this for functions that were there on bootup */
slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL);
if (!slot_cur->func) { if (!slot_cur->func) {
err("out of system memory\n");
rc = -ENOMEM; rc = -ENOMEM;
goto error; goto error;
} }
...@@ -1307,7 +1301,6 @@ static int __init ibmphp_init(void) ...@@ -1307,7 +1301,6 @@ static int __init ibmphp_init(void)
ibmphp_pci_bus = kmalloc(sizeof(*ibmphp_pci_bus), GFP_KERNEL); ibmphp_pci_bus = kmalloc(sizeof(*ibmphp_pci_bus), GFP_KERNEL);
if (!ibmphp_pci_bus) { if (!ibmphp_pci_bus) {
err("out of memory\n");
rc = -ENOMEM; rc = -ENOMEM;
goto exit; goto exit;
} }
......
...@@ -167,10 +167,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) ...@@ -167,10 +167,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
goto error; goto error;
} }
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
if (!newfunc) { if (!newfunc)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
newfunc->busno = cur_func->busno; newfunc->busno = cur_func->busno;
newfunc->device = device; newfunc->device = device;
cur_func->next = newfunc; cur_func->next = newfunc;
...@@ -205,10 +204,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) ...@@ -205,10 +204,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
if (func->devices[i]) { if (func->devices[i]) {
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
if (!newfunc) { if (!newfunc)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
newfunc->busno = sec_number; newfunc->busno = sec_number;
newfunc->device = (u8) i; newfunc->device = (u8) i;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
...@@ -233,10 +231,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) ...@@ -233,10 +231,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
} }
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
if (!newfunc) { if (!newfunc)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
newfunc->busno = cur_func->busno; newfunc->busno = cur_func->busno;
newfunc->device = device; newfunc->device = device;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
...@@ -279,10 +276,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno) ...@@ -279,10 +276,9 @@ int ibmphp_configure_card(struct pci_func *func, u8 slotno)
if (func->devices[i]) { if (func->devices[i]) {
debug("inside for loop, device is %x\n", i); debug("inside for loop, device is %x\n", i);
newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
if (!newfunc) { if (!newfunc)
err(" out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
newfunc->busno = sec_number; newfunc->busno = sec_number;
newfunc->device = (u8) i; newfunc->device = (u8) i;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
...@@ -405,10 +401,9 @@ static int configure_device(struct pci_func *func) ...@@ -405,10 +401,9 @@ static int configure_device(struct pci_func *func)
io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!io[count]) { if (!io[count])
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
io[count]->type = IO; io[count]->type = IO;
io[count]->busno = func->busno; io[count]->busno = func->busno;
io[count]->devfunc = PCI_DEVFN(func->device, func->function); io[count]->devfunc = PCI_DEVFN(func->device, func->function);
...@@ -442,10 +437,9 @@ static int configure_device(struct pci_func *func) ...@@ -442,10 +437,9 @@ static int configure_device(struct pci_func *func)
debug("len[count] in PFMEM %x, count %d\n", len[count], count); debug("len[count] in PFMEM %x, count %d\n", len[count], count);
pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!pfmem[count]) { if (!pfmem[count])
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
pfmem[count]->type = PFMEM; pfmem[count]->type = PFMEM;
pfmem[count]->busno = func->busno; pfmem[count]->busno = func->busno;
pfmem[count]->devfunc = PCI_DEVFN(func->device, pfmem[count]->devfunc = PCI_DEVFN(func->device,
...@@ -458,7 +452,6 @@ static int configure_device(struct pci_func *func) ...@@ -458,7 +452,6 @@ static int configure_device(struct pci_func *func)
} else { } else {
mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL);
if (!mem_tmp) { if (!mem_tmp) {
err("out of system memory\n");
kfree(pfmem[count]); kfree(pfmem[count]);
return -ENOMEM; return -ENOMEM;
} }
...@@ -508,10 +501,9 @@ static int configure_device(struct pci_func *func) ...@@ -508,10 +501,9 @@ static int configure_device(struct pci_func *func)
debug("len[count] in Mem %x, count %d\n", len[count], count); debug("len[count] in Mem %x, count %d\n", len[count], count);
mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!mem[count]) { if (!mem[count])
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
mem[count]->type = MEM; mem[count]->type = MEM;
mem[count]->busno = func->busno; mem[count]->busno = func->busno;
mem[count]->devfunc = PCI_DEVFN(func->device, mem[count]->devfunc = PCI_DEVFN(func->device,
...@@ -674,7 +666,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -674,7 +666,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!bus_io[count]) { if (!bus_io[count]) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -706,7 +697,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -706,7 +697,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
bus_pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); bus_pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!bus_pfmem[count]) { if (!bus_pfmem[count]) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -722,7 +712,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -722,7 +712,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
} else { } else {
mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL);
if (!mem_tmp) { if (!mem_tmp) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -763,7 +752,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -763,7 +752,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
bus_mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); bus_mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!bus_mem[count]) { if (!bus_mem[count]) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -834,7 +822,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -834,7 +822,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
io = kzalloc(sizeof(*io), GFP_KERNEL); io = kzalloc(sizeof(*io), GFP_KERNEL);
if (!io) { if (!io) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -856,7 +843,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -856,7 +843,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
debug("it wants %x memory behind the bridge\n", amount_needed->mem); debug("it wants %x memory behind the bridge\n", amount_needed->mem);
mem = kzalloc(sizeof(*mem), GFP_KERNEL); mem = kzalloc(sizeof(*mem), GFP_KERNEL);
if (!mem) { if (!mem) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -878,7 +864,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -878,7 +864,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
debug("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem); debug("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem);
pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL); pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL);
if (!pfmem) { if (!pfmem) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -893,7 +878,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -893,7 +878,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
} else { } else {
mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL);
if (!mem_tmp) { if (!mem_tmp) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -924,7 +908,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno) ...@@ -924,7 +908,6 @@ static int configure_bridge(struct pci_func **func_passed, u8 slotno)
if (!bus) { if (!bus) {
bus = kzalloc(sizeof(*bus), GFP_KERNEL); bus = kzalloc(sizeof(*bus), GFP_KERNEL);
if (!bus) { if (!bus) {
err("out of system memory\n");
retval = -ENOMEM; retval = -ENOMEM;
goto error; goto error;
} }
...@@ -1652,10 +1635,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re ...@@ -1652,10 +1635,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re
} }
if (io) { if (io) {
io_range = kzalloc(sizeof(*io_range), GFP_KERNEL); io_range = kzalloc(sizeof(*io_range), GFP_KERNEL);
if (!io_range) { if (!io_range)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
io_range->start = io->start; io_range->start = io->start;
io_range->end = io->end; io_range->end = io->end;
io_range->rangeno = 1; io_range->rangeno = 1;
...@@ -1664,10 +1646,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re ...@@ -1664,10 +1646,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re
} }
if (mem) { if (mem) {
mem_range = kzalloc(sizeof(*mem_range), GFP_KERNEL); mem_range = kzalloc(sizeof(*mem_range), GFP_KERNEL);
if (!mem_range) { if (!mem_range)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
mem_range->start = mem->start; mem_range->start = mem->start;
mem_range->end = mem->end; mem_range->end = mem->end;
mem_range->rangeno = 1; mem_range->rangeno = 1;
...@@ -1676,10 +1657,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re ...@@ -1676,10 +1657,9 @@ static int add_new_bus(struct bus_node *bus, struct resource_node *io, struct re
} }
if (pfmem) { if (pfmem) {
pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL); pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL);
if (!pfmem_range) { if (!pfmem_range)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
pfmem_range->start = pfmem->start; pfmem_range->start = pfmem->start;
pfmem_range->end = pfmem->end; pfmem_range->end = pfmem->end;
pfmem_range->rangeno = 1; pfmem_range->rangeno = 1;
......
...@@ -56,10 +56,8 @@ static struct bus_node * __init alloc_error_bus(struct ebda_pci_rsrc *curr, u8 b ...@@ -56,10 +56,8 @@ static struct bus_node * __init alloc_error_bus(struct ebda_pci_rsrc *curr, u8 b
} }
newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL); newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL);
if (!newbus) { if (!newbus)
err("out of system memory\n");
return NULL; return NULL;
}
if (flag) if (flag)
newbus->busno = busno; newbus->busno = busno;
...@@ -79,10 +77,9 @@ static struct resource_node * __init alloc_resources(struct ebda_pci_rsrc *curr) ...@@ -79,10 +77,9 @@ static struct resource_node * __init alloc_resources(struct ebda_pci_rsrc *curr)
} }
rs = kzalloc(sizeof(struct resource_node), GFP_KERNEL); rs = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!rs) { if (!rs)
err("out of system memory\n");
return NULL; return NULL;
}
rs->busno = curr->bus_num; rs->busno = curr->bus_num;
rs->devfunc = curr->dev_fun; rs->devfunc = curr->dev_fun;
rs->start = curr->start_addr; rs->start = curr->start_addr;
...@@ -99,10 +96,9 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node * ...@@ -99,10 +96,9 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node *
if (first_bus) { if (first_bus) {
newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL); newbus = kzalloc(sizeof(struct bus_node), GFP_KERNEL);
if (!newbus) { if (!newbus)
err("out of system memory.\n");
return -ENOMEM; return -ENOMEM;
}
newbus->busno = curr->bus_num; newbus->busno = curr->bus_num;
} else { } else {
newbus = *new_bus; newbus = *new_bus;
...@@ -123,7 +119,6 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node * ...@@ -123,7 +119,6 @@ static int __init alloc_bus_range(struct bus_node **new_bus, struct range_node *
if (!newrange) { if (!newrange) {
if (first_bus) if (first_bus)
kfree(newbus); kfree(newbus);
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
newrange->start = curr->start_addr; newrange->start = curr->start_addr;
...@@ -1707,10 +1702,9 @@ static int __init once_over(void) ...@@ -1707,10 +1702,9 @@ static int __init once_over(void)
bus_cur->firstPFMemFromMem = pfmem_cur; bus_cur->firstPFMemFromMem = pfmem_cur;
mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!mem) { if (!mem)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
mem->type = MEM; mem->type = MEM;
mem->busno = pfmem_cur->busno; mem->busno = pfmem_cur->busno;
mem->devfunc = pfmem_cur->devfunc; mem->devfunc = pfmem_cur->devfunc;
...@@ -1989,10 +1983,9 @@ static int __init update_bridge_ranges(struct bus_node **bus) ...@@ -1989,10 +1983,9 @@ static int __init update_bridge_ranges(struct bus_node **bus)
if ((start_address) && (start_address <= end_address)) { if ((start_address) && (start_address <= end_address)) {
range = kzalloc(sizeof(struct range_node), GFP_KERNEL); range = kzalloc(sizeof(struct range_node), GFP_KERNEL);
if (!range) { if (!range)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
range->start = start_address; range->start = start_address;
range->end = end_address + 0xfff; range->end = end_address + 0xfff;
...@@ -2016,7 +2009,6 @@ static int __init update_bridge_ranges(struct bus_node **bus) ...@@ -2016,7 +2009,6 @@ static int __init update_bridge_ranges(struct bus_node **bus)
io = kzalloc(sizeof(struct resource_node), GFP_KERNEL); io = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!io) { if (!io) {
kfree(range); kfree(range);
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
io->type = IO; io->type = IO;
...@@ -2038,10 +2030,9 @@ static int __init update_bridge_ranges(struct bus_node **bus) ...@@ -2038,10 +2030,9 @@ static int __init update_bridge_ranges(struct bus_node **bus)
if ((start_address) && (start_address <= end_address)) { if ((start_address) && (start_address <= end_address)) {
range = kzalloc(sizeof(struct range_node), GFP_KERNEL); range = kzalloc(sizeof(struct range_node), GFP_KERNEL);
if (!range) { if (!range)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
range->start = start_address; range->start = start_address;
range->end = end_address + 0xfffff; range->end = end_address + 0xfffff;
...@@ -2066,7 +2057,6 @@ static int __init update_bridge_ranges(struct bus_node **bus) ...@@ -2066,7 +2057,6 @@ static int __init update_bridge_ranges(struct bus_node **bus)
mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); mem = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!mem) { if (!mem) {
kfree(range); kfree(range);
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
mem->type = MEM; mem->type = MEM;
...@@ -2092,10 +2082,9 @@ static int __init update_bridge_ranges(struct bus_node **bus) ...@@ -2092,10 +2082,9 @@ static int __init update_bridge_ranges(struct bus_node **bus)
if ((start_address) && (start_address <= end_address)) { if ((start_address) && (start_address <= end_address)) {
range = kzalloc(sizeof(struct range_node), GFP_KERNEL); range = kzalloc(sizeof(struct range_node), GFP_KERNEL);
if (!range) { if (!range)
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
}
range->start = start_address; range->start = start_address;
range->end = end_address + 0xfffff; range->end = end_address + 0xfffff;
...@@ -2119,7 +2108,6 @@ static int __init update_bridge_ranges(struct bus_node **bus) ...@@ -2119,7 +2108,6 @@ static int __init update_bridge_ranges(struct bus_node **bus)
pfmem = kzalloc(sizeof(struct resource_node), GFP_KERNEL); pfmem = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
if (!pfmem) { if (!pfmem) {
kfree(range); kfree(range);
err("out of system memory\n");
return -ENOMEM; return -ENOMEM;
} }
pfmem->type = PFMEM; pfmem->type = PFMEM;
......
...@@ -838,10 +838,9 @@ struct controller *pcie_init(struct pcie_device *dev) ...@@ -838,10 +838,9 @@ struct controller *pcie_init(struct pcie_device *dev)
struct pci_dev *pdev = dev->port; struct pci_dev *pdev = dev->port;
ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
if (!ctrl) { if (!ctrl)
dev_err(&dev->device, "%s: Out of memory\n", __func__);
goto abort; goto abort;
}
ctrl->pcie = dev; ctrl->pcie = dev;
pcie_capability_read_dword(pdev, PCI_EXP_SLTCAP, &slot_cap); pcie_capability_read_dword(pdev, PCI_EXP_SLTCAP, &slot_cap);
......
...@@ -266,22 +266,18 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot) ...@@ -266,22 +266,18 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot)
fdt1 = kzalloc(0x10000, GFP_KERNEL); fdt1 = kzalloc(0x10000, GFP_KERNEL);
if (!fdt1) { if (!fdt1) {
ret = -ENOMEM; ret = -ENOMEM;
dev_warn(&php_slot->pdev->dev, "Cannot alloc FDT blob\n");
goto out; goto out;
} }
ret = pnv_pci_get_device_tree(php_slot->dn->phandle, fdt1, 0x10000); ret = pnv_pci_get_device_tree(php_slot->dn->phandle, fdt1, 0x10000);
if (ret) { if (ret) {
dev_warn(&php_slot->pdev->dev, "Error %d getting FDT blob\n", pci_warn(php_slot->pdev, "Error %d getting FDT blob\n", ret);
ret);
goto free_fdt1; goto free_fdt1;
} }
fdt = kzalloc(fdt_totalsize(fdt1), GFP_KERNEL); fdt = kzalloc(fdt_totalsize(fdt1), GFP_KERNEL);
if (!fdt) { if (!fdt) {
ret = -ENOMEM; ret = -ENOMEM;
dev_warn(&php_slot->pdev->dev, "Cannot %d bytes memory\n",
fdt_totalsize(fdt1));
goto free_fdt1; goto free_fdt1;
} }
...@@ -290,7 +286,7 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot) ...@@ -290,7 +286,7 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot)
dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL); dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL);
if (!dt) { if (!dt) {
ret = -EINVAL; ret = -EINVAL;
dev_warn(&php_slot->pdev->dev, "Cannot unflatten FDT\n"); pci_warn(php_slot->pdev, "Cannot unflatten FDT\n");
goto free_fdt; goto free_fdt;
} }
...@@ -300,7 +296,7 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot) ...@@ -300,7 +296,7 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot)
ret = pnv_php_populate_changeset(&php_slot->ocs, php_slot->dn); ret = pnv_php_populate_changeset(&php_slot->ocs, php_slot->dn);
if (ret) { if (ret) {
pnv_php_reverse_nodes(php_slot->dn); pnv_php_reverse_nodes(php_slot->dn);
dev_warn(&php_slot->pdev->dev, "Error %d populating changeset\n", pci_warn(php_slot->pdev, "Error %d populating changeset\n",
ret); ret);
goto free_dt; goto free_dt;
} }
...@@ -308,8 +304,7 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot) ...@@ -308,8 +304,7 @@ static int pnv_php_add_devtree(struct pnv_php_slot *php_slot)
php_slot->dn->child = NULL; php_slot->dn->child = NULL;
ret = of_changeset_apply(&php_slot->ocs); ret = of_changeset_apply(&php_slot->ocs);
if (ret) { if (ret) {
dev_warn(&php_slot->pdev->dev, "Error %d applying changeset\n", pci_warn(php_slot->pdev, "Error %d applying changeset\n", ret);
ret);
goto destroy_changeset; goto destroy_changeset;
} }
...@@ -345,14 +340,14 @@ int pnv_php_set_slot_power_state(struct hotplug_slot *slot, ...@@ -345,14 +340,14 @@ int pnv_php_set_slot_power_state(struct hotplug_slot *slot,
if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle || if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle ||
be64_to_cpu(msg.params[2]) != state || be64_to_cpu(msg.params[2]) != state ||
be64_to_cpu(msg.params[3]) != OPAL_SUCCESS) { be64_to_cpu(msg.params[3]) != OPAL_SUCCESS) {
dev_warn(&php_slot->pdev->dev, "Wrong msg (%lld, %lld, %lld)\n", pci_warn(php_slot->pdev, "Wrong msg (%lld, %lld, %lld)\n",
be64_to_cpu(msg.params[1]), be64_to_cpu(msg.params[1]),
be64_to_cpu(msg.params[2]), be64_to_cpu(msg.params[2]),
be64_to_cpu(msg.params[3])); be64_to_cpu(msg.params[3]));
return -ENOMSG; return -ENOMSG;
} }
} else if (ret < 0) { } else if (ret < 0) {
dev_warn(&php_slot->pdev->dev, "Error %d powering %s\n", pci_warn(php_slot->pdev, "Error %d powering %s\n",
ret, (state == OPAL_PCI_SLOT_POWER_ON) ? "on" : "off"); ret, (state == OPAL_PCI_SLOT_POWER_ON) ? "on" : "off");
return ret; return ret;
} }
...@@ -379,7 +374,7 @@ static int pnv_php_get_power_state(struct hotplug_slot *slot, u8 *state) ...@@ -379,7 +374,7 @@ static int pnv_php_get_power_state(struct hotplug_slot *slot, u8 *state)
*/ */
ret = pnv_pci_get_power_state(php_slot->id, &power_state); ret = pnv_pci_get_power_state(php_slot->id, &power_state);
if (ret) { if (ret) {
dev_warn(&php_slot->pdev->dev, "Error %d getting power status\n", pci_warn(php_slot->pdev, "Error %d getting power status\n",
ret); ret);
} else { } else {
*state = power_state; *state = power_state;
...@@ -405,8 +400,7 @@ static int pnv_php_get_adapter_state(struct hotplug_slot *slot, u8 *state) ...@@ -405,8 +400,7 @@ static int pnv_php_get_adapter_state(struct hotplug_slot *slot, u8 *state)
slot->info->adapter_status = presence; slot->info->adapter_status = presence;
ret = 0; ret = 0;
} else { } else {
dev_warn(&php_slot->pdev->dev, "Error %d getting presence\n", pci_warn(php_slot->pdev, "Error %d getting presence\n", ret);
ret);
} }
return ret; return ret;
...@@ -629,8 +623,7 @@ static int pnv_php_register_slot(struct pnv_php_slot *php_slot) ...@@ -629,8 +623,7 @@ static int pnv_php_register_slot(struct pnv_php_slot *php_slot)
ret = pci_hp_register(&php_slot->slot, php_slot->bus, ret = pci_hp_register(&php_slot->slot, php_slot->bus,
php_slot->slot_no, php_slot->name); php_slot->slot_no, php_slot->name);
if (ret) { if (ret) {
dev_warn(&php_slot->pdev->dev, "Error %d registering slot\n", pci_warn(php_slot->pdev, "Error %d registering slot\n", ret);
ret);
return ret; return ret;
} }
...@@ -683,7 +676,7 @@ static int pnv_php_enable_msix(struct pnv_php_slot *php_slot) ...@@ -683,7 +676,7 @@ static int pnv_php_enable_msix(struct pnv_php_slot *php_slot)
/* Enable MSIx */ /* Enable MSIx */
ret = pci_enable_msix_exact(pdev, &entry, 1); ret = pci_enable_msix_exact(pdev, &entry, 1);
if (ret) { if (ret) {
dev_warn(&pdev->dev, "Error %d enabling MSIx\n", ret); pci_warn(pdev, "Error %d enabling MSIx\n", ret);
return ret; return ret;
} }
...@@ -727,7 +720,7 @@ static irqreturn_t pnv_php_interrupt(int irq, void *data) ...@@ -727,7 +720,7 @@ static irqreturn_t pnv_php_interrupt(int irq, void *data)
(sts & PCI_EXP_SLTSTA_PDC)) { (sts & PCI_EXP_SLTSTA_PDC)) {
ret = pnv_pci_get_presence_state(php_slot->id, &presence); ret = pnv_pci_get_presence_state(php_slot->id, &presence);
if (ret) { if (ret) {
dev_warn(&pdev->dev, "PCI slot [%s] error %d getting presence (0x%04x), to retry the operation.\n", pci_warn(pdev, "PCI slot [%s] error %d getting presence (0x%04x), to retry the operation.\n",
php_slot->name, ret, sts); php_slot->name, ret, sts);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -757,12 +750,12 @@ static irqreturn_t pnv_php_interrupt(int irq, void *data) ...@@ -757,12 +750,12 @@ static irqreturn_t pnv_php_interrupt(int irq, void *data)
*/ */
event = kzalloc(sizeof(*event), GFP_ATOMIC); event = kzalloc(sizeof(*event), GFP_ATOMIC);
if (!event) { if (!event) {
dev_warn(&pdev->dev, "PCI slot [%s] missed hotplug event 0x%04x\n", pci_warn(pdev, "PCI slot [%s] missed hotplug event 0x%04x\n",
php_slot->name, sts); php_slot->name, sts);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
dev_info(&pdev->dev, "PCI slot [%s] %s (IRQ: %d)\n", pci_info(pdev, "PCI slot [%s] %s (IRQ: %d)\n",
php_slot->name, added ? "added" : "removed", irq); php_slot->name, added ? "added" : "removed", irq);
INIT_WORK(&event->work, pnv_php_event_handler); INIT_WORK(&event->work, pnv_php_event_handler);
event->added = added; event->added = added;
...@@ -782,7 +775,7 @@ static void pnv_php_init_irq(struct pnv_php_slot *php_slot, int irq) ...@@ -782,7 +775,7 @@ static void pnv_php_init_irq(struct pnv_php_slot *php_slot, int irq)
/* Allocate workqueue */ /* Allocate workqueue */
php_slot->wq = alloc_workqueue("pciehp-%s", 0, 0, php_slot->name); php_slot->wq = alloc_workqueue("pciehp-%s", 0, 0, php_slot->name);
if (!php_slot->wq) { if (!php_slot->wq) {
dev_warn(&pdev->dev, "Cannot alloc workqueue\n"); pci_warn(pdev, "Cannot alloc workqueue\n");
pnv_php_disable_irq(php_slot, true); pnv_php_disable_irq(php_slot, true);
return; return;
} }
...@@ -806,7 +799,7 @@ static void pnv_php_init_irq(struct pnv_php_slot *php_slot, int irq) ...@@ -806,7 +799,7 @@ static void pnv_php_init_irq(struct pnv_php_slot *php_slot, int irq)
php_slot->name, php_slot); php_slot->name, php_slot);
if (ret) { if (ret) {
pnv_php_disable_irq(php_slot, true); pnv_php_disable_irq(php_slot, true);
dev_warn(&pdev->dev, "Error %d enabling IRQ %d\n", ret, irq); pci_warn(pdev, "Error %d enabling IRQ %d\n", ret, irq);
return; return;
} }
...@@ -842,7 +835,7 @@ static void pnv_php_enable_irq(struct pnv_php_slot *php_slot) ...@@ -842,7 +835,7 @@ static void pnv_php_enable_irq(struct pnv_php_slot *php_slot)
ret = pci_enable_device(pdev); ret = pci_enable_device(pdev);
if (ret) { if (ret) {
dev_warn(&pdev->dev, "Error %d enabling device\n", ret); pci_warn(pdev, "Error %d enabling device\n", ret);
return; return;
} }
......
...@@ -245,18 +245,18 @@ static int sn_slot_enable(struct hotplug_slot *bss_hotplug_slot, ...@@ -245,18 +245,18 @@ static int sn_slot_enable(struct hotplug_slot *bss_hotplug_slot,
if (rc == PCI_SLOT_ALREADY_UP) { if (rc == PCI_SLOT_ALREADY_UP) {
dev_dbg(&slot->pci_bus->self->dev, "is already active\n"); pci_dbg(slot->pci_bus->self, "is already active\n");
return 1; /* return 1 to user */ return 1; /* return 1 to user */
} }
if (rc == PCI_L1_ERR) { if (rc == PCI_L1_ERR) {
dev_dbg(&slot->pci_bus->self->dev, "L1 failure %d with message: %s", pci_dbg(slot->pci_bus->self, "L1 failure %d with message: %s",
resp.resp_sub_errno, resp.resp_l1_msg); resp.resp_sub_errno, resp.resp_l1_msg);
return -EPERM; return -EPERM;
} }
if (rc) { if (rc) {
dev_dbg(&slot->pci_bus->self->dev, "insert failed with error %d sub-error %d\n", pci_dbg(slot->pci_bus->self, "insert failed with error %d sub-error %d\n",
rc, resp.resp_sub_errno); rc, resp.resp_sub_errno);
return -EIO; return -EIO;
} }
...@@ -281,23 +281,23 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot, ...@@ -281,23 +281,23 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot,
if ((action == PCI_REQ_SLOT_ELIGIBLE) && if ((action == PCI_REQ_SLOT_ELIGIBLE) &&
(rc == PCI_SLOT_ALREADY_DOWN)) { (rc == PCI_SLOT_ALREADY_DOWN)) {
dev_dbg(&slot->pci_bus->self->dev, "Slot %s already inactive\n", slot->physical_path); pci_dbg(slot->pci_bus->self, "Slot %s already inactive\n", slot->physical_path);
return 1; /* return 1 to user */ return 1; /* return 1 to user */
} }
if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_EMPTY_33MHZ)) { if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_EMPTY_33MHZ)) {
dev_dbg(&slot->pci_bus->self->dev, "Cannot remove last 33MHz card\n"); pci_dbg(slot->pci_bus->self, "Cannot remove last 33MHz card\n");
return -EPERM; return -EPERM;
} }
if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_L1_ERR)) { if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_L1_ERR)) {
dev_dbg(&slot->pci_bus->self->dev, "L1 failure %d with message \n%s\n", pci_dbg(slot->pci_bus->self, "L1 failure %d with message \n%s\n",
resp.resp_sub_errno, resp.resp_l1_msg); resp.resp_sub_errno, resp.resp_l1_msg);
return -EPERM; return -EPERM;
} }
if ((action == PCI_REQ_SLOT_ELIGIBLE) && rc) { if ((action == PCI_REQ_SLOT_ELIGIBLE) && rc) {
dev_dbg(&slot->pci_bus->self->dev, "remove failed with error %d sub-error %d\n", pci_dbg(slot->pci_bus->self, "remove failed with error %d sub-error %d\n",
rc, resp.resp_sub_errno); rc, resp.resp_sub_errno);
return -EIO; return -EIO;
} }
...@@ -308,12 +308,12 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot, ...@@ -308,12 +308,12 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot,
if ((action == PCI_REQ_SLOT_DISABLE) && !rc) { if ((action == PCI_REQ_SLOT_DISABLE) && !rc) {
pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus);
pcibus_info->pbi_enabled_devices &= ~(1 << device_num); pcibus_info->pbi_enabled_devices &= ~(1 << device_num);
dev_dbg(&slot->pci_bus->self->dev, "remove successful\n"); pci_dbg(slot->pci_bus->self, "remove successful\n");
return 0; return 0;
} }
if ((action == PCI_REQ_SLOT_DISABLE) && rc) { if ((action == PCI_REQ_SLOT_DISABLE) && rc) {
dev_dbg(&slot->pci_bus->self->dev, "remove failed rc = %d\n", rc); pci_dbg(slot->pci_bus->self, "remove failed rc = %d\n", rc);
} }
return rc; return rc;
...@@ -366,7 +366,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) ...@@ -366,7 +366,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
num_funcs = pci_scan_slot(slot->pci_bus, num_funcs = pci_scan_slot(slot->pci_bus,
PCI_DEVFN(slot->device_num + 1, 0)); PCI_DEVFN(slot->device_num + 1, 0));
if (!num_funcs) { if (!num_funcs) {
dev_dbg(&slot->pci_bus->self->dev, "no device in slot\n"); pci_dbg(slot->pci_bus->self, "no device in slot\n");
mutex_unlock(&sn_hotplug_mutex); mutex_unlock(&sn_hotplug_mutex);
return -ENODEV; return -ENODEV;
} }
...@@ -412,7 +412,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) ...@@ -412,7 +412,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
phandle = acpi_device_handle(PCI_CONTROLLER(slot->pci_bus)->companion); phandle = acpi_device_handle(PCI_CONTROLLER(slot->pci_bus)->companion);
if (acpi_bus_get_device(phandle, &pdevice)) { if (acpi_bus_get_device(phandle, &pdevice)) {
dev_dbg(&slot->pci_bus->self->dev, "no parent device, assuming NULL\n"); pci_dbg(slot->pci_bus->self, "no parent device, assuming NULL\n");
pdevice = NULL; pdevice = NULL;
} }
...@@ -463,9 +463,9 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot) ...@@ -463,9 +463,9 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
mutex_unlock(&sn_hotplug_mutex); mutex_unlock(&sn_hotplug_mutex);
if (rc == 0) if (rc == 0)
dev_dbg(&slot->pci_bus->self->dev, "insert operation successful\n"); pci_dbg(slot->pci_bus->self, "insert operation successful\n");
else else
dev_dbg(&slot->pci_bus->self->dev, "insert operation failed rc = %d\n", rc); pci_dbg(slot->pci_bus->self, "insert operation failed rc = %d\n", rc);
return rc; return rc;
} }
...@@ -643,16 +643,16 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus) ...@@ -643,16 +643,16 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
if (rc) if (rc)
goto register_err; goto register_err;
} }
dev_dbg(&pci_bus->self->dev, "Registered bus with hotplug\n"); pci_dbg(pci_bus->self, "Registered bus with hotplug\n");
return rc; return rc;
register_err: register_err:
dev_dbg(&pci_bus->self->dev, "bus failed to register with err = %d\n", pci_dbg(pci_bus->self, "bus failed to register with err = %d\n",
rc); rc);
alloc_err: alloc_err:
if (rc == -ENOMEM) if (rc == -ENOMEM)
dev_dbg(&pci_bus->self->dev, "Memory allocation error\n"); pci_dbg(pci_bus->self, "Memory allocation error\n");
/* destroy THIS element */ /* destroy THIS element */
if (bss_hotplug_slot) if (bss_hotplug_slot)
...@@ -685,10 +685,10 @@ static int __init sn_pci_hotplug_init(void) ...@@ -685,10 +685,10 @@ static int __init sn_pci_hotplug_init(void)
rc = sn_pci_bus_valid(pci_bus); rc = sn_pci_bus_valid(pci_bus);
if (rc != 1) { if (rc != 1) {
dev_dbg(&pci_bus->self->dev, "not a valid hotplug bus\n"); pci_dbg(pci_bus->self, "not a valid hotplug bus\n");
continue; continue;
} }
dev_dbg(&pci_bus->self->dev, "valid hotplug bus\n"); pci_dbg(pci_bus->self, "valid hotplug bus\n");
rc = sn_hotplug_slot_register(pci_bus); rc = sn_hotplug_slot_register(pci_bus);
if (!rc) { if (!rc) {
......
...@@ -62,15 +62,15 @@ do { \ ...@@ -62,15 +62,15 @@ do { \
#define ctrl_dbg(ctrl, format, arg...) \ #define ctrl_dbg(ctrl, format, arg...) \
do { \ do { \
if (shpchp_debug) \ if (shpchp_debug) \
dev_printk(KERN_DEBUG, &ctrl->pci_dev->dev, \ pci_printk(KERN_DEBUG, ctrl->pci_dev, \
format, ## arg); \ format, ## arg); \
} while (0) } while (0)
#define ctrl_err(ctrl, format, arg...) \ #define ctrl_err(ctrl, format, arg...) \
dev_err(&ctrl->pci_dev->dev, format, ## arg) pci_err(ctrl->pci_dev, format, ## arg)
#define ctrl_info(ctrl, format, arg...) \ #define ctrl_info(ctrl, format, arg...) \
dev_info(&ctrl->pci_dev->dev, format, ## arg) pci_info(ctrl->pci_dev, format, ## arg)
#define ctrl_warn(ctrl, format, arg...) \ #define ctrl_warn(ctrl, format, arg...) \
dev_warn(&ctrl->pci_dev->dev, format, ## arg) pci_warn(ctrl->pci_dev, format, ## arg)
#define SLOT_NAME_SIZE 10 #define SLOT_NAME_SIZE 10
......
...@@ -305,10 +305,9 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -305,10 +305,9 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return -ENODEV; return -ENODEV;
ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
if (!ctrl) { if (!ctrl)
dev_err(&pdev->dev, "%s: Out of memory\n", __func__);
goto err_out_none; goto err_out_none;
}
INIT_LIST_HEAD(&ctrl->slot_list); INIT_LIST_HEAD(&ctrl->slot_list);
rc = shpc_init(ctrl, pdev); rc = shpc_init(ctrl, pdev);
......
...@@ -259,19 +259,19 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) ...@@ -259,19 +259,19 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
nres++; nres++;
} }
if (nres != iov->nres) { if (nres != iov->nres) {
dev_err(&dev->dev, "not enough MMIO resources for SR-IOV\n"); pci_err(dev, "not enough MMIO resources for SR-IOV\n");
return -ENOMEM; return -ENOMEM;
} }
bus = pci_iov_virtfn_bus(dev, nr_virtfn - 1); bus = pci_iov_virtfn_bus(dev, nr_virtfn - 1);
if (bus > dev->bus->busn_res.end) { if (bus > dev->bus->busn_res.end) {
dev_err(&dev->dev, "can't enable %d VFs (bus %02x out of range of %pR)\n", pci_err(dev, "can't enable %d VFs (bus %02x out of range of %pR)\n",
nr_virtfn, bus, &dev->bus->busn_res); nr_virtfn, bus, &dev->bus->busn_res);
return -ENOMEM; return -ENOMEM;
} }
if (pci_enable_resources(dev, bars)) { if (pci_enable_resources(dev, bars)) {
dev_err(&dev->dev, "SR-IOV: IOV BARS not allocated\n"); pci_err(dev, "SR-IOV: IOV BARS not allocated\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -298,7 +298,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) ...@@ -298,7 +298,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
rc = pcibios_sriov_enable(dev, initial); rc = pcibios_sriov_enable(dev, initial);
if (rc) { if (rc) {
dev_err(&dev->dev, "failure %d from pcibios_sriov_enable()\n", rc); pci_err(dev, "failure %d from pcibios_sriov_enable()\n", rc);
goto err_pcibios; goto err_pcibios;
} }
...@@ -432,7 +432,7 @@ static int sriov_init(struct pci_dev *dev, int pos) ...@@ -432,7 +432,7 @@ static int sriov_init(struct pci_dev *dev, int pos)
} }
iov->barsz[i] = resource_size(res); iov->barsz[i] = resource_size(res);
res->end = res->start + resource_size(res) * total - 1; res->end = res->start + resource_size(res) * total - 1;
dev_info(&dev->dev, "VF(n) BAR%d space: %pR (contains BAR%d for %d VFs)\n", pci_info(dev, "VF(n) BAR%d space: %pR (contains BAR%d for %d VFs)\n",
i, res, i, total); i, res, i, total);
i += bar64; i += bar64;
nres++; nres++;
......
...@@ -16,11 +16,10 @@ static void pci_note_irq_problem(struct pci_dev *pdev, const char *reason) ...@@ -16,11 +16,10 @@ static void pci_note_irq_problem(struct pci_dev *pdev, const char *reason)
{ {
struct pci_dev *parent = to_pci_dev(pdev->dev.parent); struct pci_dev *parent = to_pci_dev(pdev->dev.parent);
dev_err(&pdev->dev, pci_err(pdev, "Potentially misrouted IRQ (Bridge %s %04x:%04x)\n",
"Potentially misrouted IRQ (Bridge %s %04x:%04x)\n",
dev_name(&parent->dev), parent->vendor, parent->device); dev_name(&parent->dev), parent->vendor, parent->device);
dev_err(&pdev->dev, "%s\n", reason); pci_err(pdev, "%s\n", reason);
dev_err(&pdev->dev, "Please report to linux-kernel@vger.kernel.org\n"); pci_err(pdev, "Please report to linux-kernel@vger.kernel.org\n");
WARN_ON(1); WARN_ON(1);
} }
......
...@@ -578,7 +578,7 @@ static int msi_verify_entries(struct pci_dev *dev) ...@@ -578,7 +578,7 @@ static int msi_verify_entries(struct pci_dev *dev)
for_each_pci_msi_entry(entry, dev) { for_each_pci_msi_entry(entry, dev) {
if (!dev->no_64bit_msi || !entry->msg.address_hi) if (!dev->no_64bit_msi || !entry->msg.address_hi)
continue; continue;
dev_err(&dev->dev, "Device has broken 64-bit MSI but arch" pci_err(dev, "Device has broken 64-bit MSI but arch"
" tried to assign one above 4G\n"); " tried to assign one above 4G\n");
return -EIO; return -EIO;
} }
...@@ -962,7 +962,7 @@ static int __pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, ...@@ -962,7 +962,7 @@ static int __pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries,
/* Check whether driver already requested for MSI irq */ /* Check whether driver already requested for MSI irq */
if (dev->msi_enabled) { if (dev->msi_enabled) {
dev_info(&dev->dev, "can't enable MSI-X (MSI IRQ already assigned)\n"); pci_info(dev, "can't enable MSI-X (MSI IRQ already assigned)\n");
return -EINVAL; return -EINVAL;
} }
return msix_capability_init(dev, entries, nvec, affd); return msix_capability_init(dev, entries, nvec, affd);
...@@ -1032,8 +1032,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec, ...@@ -1032,8 +1032,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
/* Check whether driver already requested MSI-X irqs */ /* Check whether driver already requested MSI-X irqs */
if (dev->msix_enabled) { if (dev->msix_enabled) {
dev_info(&dev->dev, pci_info(dev, "can't enable MSI (MSI-X already enabled)\n");
"can't enable MSI (MSI-X already enabled)\n");
return -EINVAL; return -EINVAL;
} }
......
...@@ -542,7 +542,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) ...@@ -542,7 +542,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
} }
if (!error) if (!error)
dev_dbg(&dev->dev, "power state changed by ACPI to %s\n", pci_dbg(dev, "power state changed by ACPI to %s\n",
acpi_power_state_string(state_conv[state])); acpi_power_state_string(state_conv[state]));
return error; return error;
......
...@@ -28,7 +28,7 @@ MODULE_PARM_DESC(ids, "Initial PCI IDs to add to the stub driver, format is " ...@@ -28,7 +28,7 @@ MODULE_PARM_DESC(ids, "Initial PCI IDs to add to the stub driver, format is "
static int pci_stub_probe(struct pci_dev *dev, const struct pci_device_id *id) static int pci_stub_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ {
dev_info(&dev->dev, "claimed by stub\n"); pci_info(dev, "claimed by stub\n");
return 0; return 0;
} }
......
...@@ -348,7 +348,7 @@ static ssize_t numa_node_store(struct device *dev, ...@@ -348,7 +348,7 @@ static ssize_t numa_node_store(struct device *dev,
return -EINVAL; return -EINVAL;
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
dev_alert(&pdev->dev, FW_BUG "Overriding NUMA node to %d. Contact your vendor for updates.", pci_alert(pdev, FW_BUG "Overriding NUMA node to %d. Contact your vendor for updates.",
node); node);
dev->numa_node = node; dev->numa_node = node;
...@@ -411,7 +411,7 @@ static ssize_t msi_bus_store(struct device *dev, struct device_attribute *attr, ...@@ -411,7 +411,7 @@ static ssize_t msi_bus_store(struct device *dev, struct device_attribute *attr,
*/ */
if (!subordinate) { if (!subordinate) {
pdev->no_msi = !val; pdev->no_msi = !val;
dev_info(&pdev->dev, "MSI/MSI-X %s for future drivers\n", pci_info(pdev, "MSI/MSI-X %s for future drivers\n",
val ? "allowed" : "disallowed"); val ? "allowed" : "disallowed");
return count; return count;
} }
...@@ -613,7 +613,7 @@ static ssize_t sriov_numvfs_store(struct device *dev, ...@@ -613,7 +613,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,
/* is PF driver loaded w/callback */ /* is PF driver loaded w/callback */
if (!pdev->driver || !pdev->driver->sriov_configure) { if (!pdev->driver || !pdev->driver->sriov_configure) {
dev_info(&pdev->dev, "Driver doesn't support SRIOV configuration via sysfs\n"); pci_info(pdev, "Driver doesn't support SRIOV configuration via sysfs\n");
ret = -ENOENT; ret = -ENOENT;
goto exit; goto exit;
} }
...@@ -626,7 +626,7 @@ static ssize_t sriov_numvfs_store(struct device *dev, ...@@ -626,7 +626,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,
/* enable VFs */ /* enable VFs */
if (pdev->sriov->num_VFs) { if (pdev->sriov->num_VFs) {
dev_warn(&pdev->dev, "%d VFs already enabled. Disable before enabling %d VFs\n", pci_warn(pdev, "%d VFs already enabled. Disable before enabling %d VFs\n",
pdev->sriov->num_VFs, num_vfs); pdev->sriov->num_VFs, num_vfs);
ret = -EBUSY; ret = -EBUSY;
goto exit; goto exit;
...@@ -637,7 +637,7 @@ static ssize_t sriov_numvfs_store(struct device *dev, ...@@ -637,7 +637,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,
goto exit; goto exit;
if (ret != num_vfs) if (ret != num_vfs)
dev_warn(&pdev->dev, "%d VFs requested; only %d enabled\n", pci_warn(pdev, "%d VFs requested; only %d enabled\n",
num_vfs, ret); num_vfs, ret);
exit: exit:
......
...@@ -156,7 +156,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) ...@@ -156,7 +156,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
* Make sure the BAR is actually a memory resource, not an IO resource * Make sure the BAR is actually a memory resource, not an IO resource
*/ */
if (res->flags & IORESOURCE_UNSET || !(res->flags & IORESOURCE_MEM)) { if (res->flags & IORESOURCE_UNSET || !(res->flags & IORESOURCE_MEM)) {
dev_warn(&pdev->dev, "can't ioremap BAR %d: %pR\n", bar, res); pci_warn(pdev, "can't ioremap BAR %d: %pR\n", bar, res);
return NULL; return NULL;
} }
return ioremap_nocache(res->start, resource_size(res)); return ioremap_nocache(res->start, resource_size(res));
...@@ -648,7 +648,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) ...@@ -648,7 +648,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
*/ */
if (state != PCI_D0 && dev->current_state <= PCI_D3cold if (state != PCI_D0 && dev->current_state <= PCI_D3cold
&& dev->current_state > state) { && dev->current_state > state) {
dev_err(&dev->dev, "invalid power transition (from state %d to %d)\n", pci_err(dev, "invalid power transition (from state %d to %d)\n",
dev->current_state, state); dev->current_state, state);
return -EINVAL; return -EINVAL;
} }
...@@ -696,7 +696,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state) ...@@ -696,7 +696,7 @@ static int pci_raw_set_power_state(struct pci_dev *dev, pci_power_t state)
pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK); dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
if (dev->current_state != state && printk_ratelimit()) if (dev->current_state != state && printk_ratelimit())
dev_info(&dev->dev, "Refused to change power state, currently in D%d\n", pci_info(dev, "Refused to change power state, currently in D%d\n",
dev->current_state); dev->current_state);
/* /*
...@@ -970,7 +970,7 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state) ...@@ -970,7 +970,7 @@ pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state)
case PM_EVENT_HIBERNATE: case PM_EVENT_HIBERNATE:
return PCI_D3hot; return PCI_D3hot;
default: default:
dev_info(&dev->dev, "unrecognized suspend event %d\n", pci_info(dev, "unrecognized suspend event %d\n",
state.event); state.event);
BUG(); BUG();
} }
...@@ -1013,7 +1013,7 @@ static int pci_save_pcie_state(struct pci_dev *dev) ...@@ -1013,7 +1013,7 @@ static int pci_save_pcie_state(struct pci_dev *dev)
save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP); save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP);
if (!save_state) { if (!save_state) {
dev_err(&dev->dev, "buffer not found in %s\n", __func__); pci_err(dev, "buffer not found in %s\n", __func__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1061,7 +1061,7 @@ static int pci_save_pcix_state(struct pci_dev *dev) ...@@ -1061,7 +1061,7 @@ static int pci_save_pcix_state(struct pci_dev *dev)
save_state = pci_find_saved_cap(dev, PCI_CAP_ID_PCIX); save_state = pci_find_saved_cap(dev, PCI_CAP_ID_PCIX);
if (!save_state) { if (!save_state) {
dev_err(&dev->dev, "buffer not found in %s\n", __func__); pci_err(dev, "buffer not found in %s\n", __func__);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1121,7 +1121,7 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset, ...@@ -1121,7 +1121,7 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset,
return; return;
for (;;) { for (;;) {
dev_dbg(&pdev->dev, "restoring config space at offset %#x (was %#x, writing %#x)\n", pci_dbg(pdev, "restoring config space at offset %#x (was %#x, writing %#x)\n",
offset, val, saved_val); offset, val, saved_val);
pci_write_config_dword(pdev, offset, saved_val); pci_write_config_dword(pdev, offset, saved_val);
if (retry-- <= 0) if (retry-- <= 0)
...@@ -1358,7 +1358,7 @@ static void pci_enable_bridge(struct pci_dev *dev) ...@@ -1358,7 +1358,7 @@ static void pci_enable_bridge(struct pci_dev *dev)
retval = pci_enable_device(dev); retval = pci_enable_device(dev);
if (retval) if (retval)
dev_err(&dev->dev, "Error enabling bridge (%d), continuing\n", pci_err(dev, "Error enabling bridge (%d), continuing\n",
retval); retval);
pci_set_master(dev); pci_set_master(dev);
} }
...@@ -1863,7 +1863,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable) ...@@ -1863,7 +1863,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable)
pme_dev = kmalloc(sizeof(struct pci_pme_device), pme_dev = kmalloc(sizeof(struct pci_pme_device),
GFP_KERNEL); GFP_KERNEL);
if (!pme_dev) { if (!pme_dev) {
dev_warn(&dev->dev, "can't enable PME#\n"); pci_warn(dev, "can't enable PME#\n");
return; return;
} }
pme_dev->dev = dev; pme_dev->dev = dev;
...@@ -1887,7 +1887,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable) ...@@ -1887,7 +1887,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable)
} }
} }
dev_dbg(&dev->dev, "PME# %s\n", enable ? "enabled" : "disabled"); pci_dbg(dev, "PME# %s\n", enable ? "enabled" : "disabled");
} }
EXPORT_SYMBOL(pci_pme_active); EXPORT_SYMBOL(pci_pme_active);
...@@ -2424,7 +2424,7 @@ void pci_pm_init(struct pci_dev *dev) ...@@ -2424,7 +2424,7 @@ void pci_pm_init(struct pci_dev *dev)
pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc); pci_read_config_word(dev, pm + PCI_PM_PMC, &pmc);
if ((pmc & PCI_PM_CAP_VER_MASK) > 3) { if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
dev_err(&dev->dev, "unsupported PM cap regs version (%u)\n", pci_err(dev, "unsupported PM cap regs version (%u)\n",
pmc & PCI_PM_CAP_VER_MASK); pmc & PCI_PM_CAP_VER_MASK);
return; return;
} }
...@@ -2444,15 +2444,14 @@ void pci_pm_init(struct pci_dev *dev) ...@@ -2444,15 +2444,14 @@ void pci_pm_init(struct pci_dev *dev)
dev->d2_support = true; dev->d2_support = true;
if (dev->d1_support || dev->d2_support) if (dev->d1_support || dev->d2_support)
dev_printk(KERN_DEBUG, &dev->dev, "supports%s%s\n", pci_printk(KERN_DEBUG, dev, "supports%s%s\n",
dev->d1_support ? " D1" : "", dev->d1_support ? " D1" : "",
dev->d2_support ? " D2" : ""); dev->d2_support ? " D2" : "");
} }
pmc &= PCI_PM_CAP_PME_MASK; pmc &= PCI_PM_CAP_PME_MASK;
if (pmc) { if (pmc) {
dev_printk(KERN_DEBUG, &dev->dev, pci_printk(KERN_DEBUG, dev, "PME# supported from%s%s%s%s%s\n",
"PME# supported from%s%s%s%s%s\n",
(pmc & PCI_PM_CAP_PME_D0) ? " D0" : "", (pmc & PCI_PM_CAP_PME_D0) ? " D0" : "",
(pmc & PCI_PM_CAP_PME_D1) ? " D1" : "", (pmc & PCI_PM_CAP_PME_D1) ? " D1" : "",
(pmc & PCI_PM_CAP_PME_D2) ? " D2" : "", (pmc & PCI_PM_CAP_PME_D2) ? " D2" : "",
...@@ -2544,13 +2543,13 @@ static int pci_ea_read(struct pci_dev *dev, int offset) ...@@ -2544,13 +2543,13 @@ static int pci_ea_read(struct pci_dev *dev, int offset)
res = pci_ea_get_resource(dev, bei, prop); res = pci_ea_get_resource(dev, bei, prop);
if (!res) { if (!res) {
dev_err(&dev->dev, "Unsupported EA entry BEI: %u\n", bei); pci_err(dev, "Unsupported EA entry BEI: %u\n", bei);
goto out; goto out;
} }
flags = pci_ea_flags(dev, prop); flags = pci_ea_flags(dev, prop);
if (!flags) { if (!flags) {
dev_err(&dev->dev, "Unsupported EA properties: %#x\n", prop); pci_err(dev, "Unsupported EA properties: %#x\n", prop);
goto out; goto out;
} }
...@@ -2600,13 +2599,12 @@ static int pci_ea_read(struct pci_dev *dev, int offset) ...@@ -2600,13 +2599,12 @@ static int pci_ea_read(struct pci_dev *dev, int offset)
} }
if (end < start) { if (end < start) {
dev_err(&dev->dev, "EA Entry crosses address boundary\n"); pci_err(dev, "EA Entry crosses address boundary\n");
goto out; goto out;
} }
if (ent_size != ent_offset - offset) { if (ent_size != ent_offset - offset) {
dev_err(&dev->dev, pci_err(dev, "EA Entry Size (%d) does not match length read (%d)\n",
"EA Entry Size (%d) does not match length read (%d)\n",
ent_size, ent_offset - offset); ent_size, ent_offset - offset);
goto out; goto out;
} }
...@@ -2617,16 +2615,16 @@ static int pci_ea_read(struct pci_dev *dev, int offset) ...@@ -2617,16 +2615,16 @@ static int pci_ea_read(struct pci_dev *dev, int offset)
res->flags = flags; res->flags = flags;
if (bei <= PCI_EA_BEI_BAR5) if (bei <= PCI_EA_BEI_BAR5)
dev_printk(KERN_DEBUG, &dev->dev, "BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n", pci_printk(KERN_DEBUG, dev, "BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n",
bei, res, prop); bei, res, prop);
else if (bei == PCI_EA_BEI_ROM) else if (bei == PCI_EA_BEI_ROM)
dev_printk(KERN_DEBUG, &dev->dev, "ROM: %pR (from Enhanced Allocation, properties %#02x)\n", pci_printk(KERN_DEBUG, dev, "ROM: %pR (from Enhanced Allocation, properties %#02x)\n",
res, prop); res, prop);
else if (bei >= PCI_EA_BEI_VF_BAR0 && bei <= PCI_EA_BEI_VF_BAR5) else if (bei >= PCI_EA_BEI_VF_BAR0 && bei <= PCI_EA_BEI_VF_BAR5)
dev_printk(KERN_DEBUG, &dev->dev, "VF BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n", pci_printk(KERN_DEBUG, dev, "VF BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n",
bei - PCI_EA_BEI_VF_BAR0, res, prop); bei - PCI_EA_BEI_VF_BAR0, res, prop);
else else
dev_printk(KERN_DEBUG, &dev->dev, "BEI %d res: %pR (from Enhanced Allocation, properties %#02x)\n", pci_printk(KERN_DEBUG, dev, "BEI %d res: %pR (from Enhanced Allocation, properties %#02x)\n",
bei, res, prop); bei, res, prop);
out: out:
...@@ -2723,13 +2721,11 @@ void pci_allocate_cap_save_buffers(struct pci_dev *dev) ...@@ -2723,13 +2721,11 @@ void pci_allocate_cap_save_buffers(struct pci_dev *dev)
error = pci_add_cap_save_buffer(dev, PCI_CAP_ID_EXP, error = pci_add_cap_save_buffer(dev, PCI_CAP_ID_EXP,
PCI_EXP_SAVE_REGS * sizeof(u16)); PCI_EXP_SAVE_REGS * sizeof(u16));
if (error) if (error)
dev_err(&dev->dev, pci_err(dev, "unable to preallocate PCI Express save buffer\n");
"unable to preallocate PCI Express save buffer\n");
error = pci_add_cap_save_buffer(dev, PCI_CAP_ID_PCIX, sizeof(u16)); error = pci_add_cap_save_buffer(dev, PCI_CAP_ID_PCIX, sizeof(u16));
if (error) if (error)
dev_err(&dev->dev, pci_err(dev, "unable to preallocate PCI-X save buffer\n");
"unable to preallocate PCI-X save buffer\n");
pci_allocate_vc_save_buffers(dev); pci_allocate_vc_save_buffers(dev);
} }
...@@ -3273,7 +3269,7 @@ static int __pci_request_region(struct pci_dev *pdev, int bar, ...@@ -3273,7 +3269,7 @@ static int __pci_request_region(struct pci_dev *pdev, int bar,
return 0; return 0;
err_out: err_out:
dev_warn(&pdev->dev, "BAR %d: can't reserve %pR\n", bar, pci_warn(pdev, "BAR %d: can't reserve %pR\n", bar,
&pdev->resource[bar]); &pdev->resource[bar]);
return -EBUSY; return -EBUSY;
} }
...@@ -3696,7 +3692,7 @@ static void __pci_set_master(struct pci_dev *dev, bool enable) ...@@ -3696,7 +3692,7 @@ static void __pci_set_master(struct pci_dev *dev, bool enable)
else else
cmd = old_cmd & ~PCI_COMMAND_MASTER; cmd = old_cmd & ~PCI_COMMAND_MASTER;
if (cmd != old_cmd) { if (cmd != old_cmd) {
dev_dbg(&dev->dev, "%s bus mastering\n", pci_dbg(dev, "%s bus mastering\n",
enable ? "enabling" : "disabling"); enable ? "enabling" : "disabling");
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
} }
...@@ -3797,7 +3793,7 @@ int pci_set_cacheline_size(struct pci_dev *dev) ...@@ -3797,7 +3793,7 @@ int pci_set_cacheline_size(struct pci_dev *dev)
if (cacheline_size == pci_cache_line_size) if (cacheline_size == pci_cache_line_size)
return 0; return 0;
dev_printk(KERN_DEBUG, &dev->dev, "cache line size of %d is not supported\n", pci_printk(KERN_DEBUG, dev, "cache line size of %d is not supported\n",
pci_cache_line_size << 2); pci_cache_line_size << 2);
return -EINVAL; return -EINVAL;
...@@ -3826,7 +3822,7 @@ int pci_set_mwi(struct pci_dev *dev) ...@@ -3826,7 +3822,7 @@ int pci_set_mwi(struct pci_dev *dev)
pci_read_config_word(dev, PCI_COMMAND, &cmd); pci_read_config_word(dev, PCI_COMMAND, &cmd);
if (!(cmd & PCI_COMMAND_INVALIDATE)) { if (!(cmd & PCI_COMMAND_INVALIDATE)) {
dev_dbg(&dev->dev, "enabling Mem-Wr-Inval\n"); pci_dbg(dev, "enabling Mem-Wr-Inval\n");
cmd |= PCI_COMMAND_INVALIDATE; cmd |= PCI_COMMAND_INVALIDATE;
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
} }
...@@ -4022,13 +4018,13 @@ static void pci_flr_wait(struct pci_dev *dev) ...@@ -4022,13 +4018,13 @@ static void pci_flr_wait(struct pci_dev *dev)
pci_read_config_dword(dev, PCI_COMMAND, &id); pci_read_config_dword(dev, PCI_COMMAND, &id);
while (id == ~0) { while (id == ~0) {
if (delay > timeout) { if (delay > timeout) {
dev_warn(&dev->dev, "not ready %dms after FLR; giving up\n", pci_warn(dev, "not ready %dms after FLR; giving up\n",
100 + delay - 1); 100 + delay - 1);
return; return;
} }
if (delay > 1000) if (delay > 1000)
dev_info(&dev->dev, "not ready %dms after FLR; waiting\n", pci_info(dev, "not ready %dms after FLR; waiting\n",
100 + delay - 1); 100 + delay - 1);
msleep(delay); msleep(delay);
...@@ -4037,7 +4033,7 @@ static void pci_flr_wait(struct pci_dev *dev) ...@@ -4037,7 +4033,7 @@ static void pci_flr_wait(struct pci_dev *dev)
} }
if (delay > 1000) if (delay > 1000)
dev_info(&dev->dev, "ready %dms after FLR\n", 100 + delay - 1); pci_info(dev, "ready %dms after FLR\n", 100 + delay - 1);
} }
/** /**
...@@ -4069,7 +4065,7 @@ static bool pcie_has_flr(struct pci_dev *dev) ...@@ -4069,7 +4065,7 @@ static bool pcie_has_flr(struct pci_dev *dev)
void pcie_flr(struct pci_dev *dev) void pcie_flr(struct pci_dev *dev)
{ {
if (!pci_wait_for_pending_transaction(dev)) if (!pci_wait_for_pending_transaction(dev))
dev_err(&dev->dev, "timed out waiting for pending transaction; performing function level reset anyway\n"); pci_err(dev, "timed out waiting for pending transaction; performing function level reset anyway\n");
pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
pci_flr_wait(dev); pci_flr_wait(dev);
...@@ -4102,7 +4098,7 @@ static int pci_af_flr(struct pci_dev *dev, int probe) ...@@ -4102,7 +4098,7 @@ static int pci_af_flr(struct pci_dev *dev, int probe)
*/ */
if (!pci_wait_for_pending(dev, pos + PCI_AF_CTRL, if (!pci_wait_for_pending(dev, pos + PCI_AF_CTRL,
PCI_AF_STATUS_TP << 8)) PCI_AF_STATUS_TP << 8))
dev_err(&dev->dev, "timed out waiting for pending transaction; performing AF function level reset anyway\n"); pci_err(dev, "timed out waiting for pending transaction; performing AF function level reset anyway\n");
pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR); pci_write_config_byte(dev, pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR);
pci_flr_wait(dev); pci_flr_wait(dev);
...@@ -5225,12 +5221,12 @@ void pci_add_dma_alias(struct pci_dev *dev, u8 devfn) ...@@ -5225,12 +5221,12 @@ void pci_add_dma_alias(struct pci_dev *dev, u8 devfn)
dev->dma_alias_mask = kcalloc(BITS_TO_LONGS(U8_MAX), dev->dma_alias_mask = kcalloc(BITS_TO_LONGS(U8_MAX),
sizeof(long), GFP_KERNEL); sizeof(long), GFP_KERNEL);
if (!dev->dma_alias_mask) { if (!dev->dma_alias_mask) {
dev_warn(&dev->dev, "Unable to allocate DMA alias mask\n"); pci_warn(dev, "Unable to allocate DMA alias mask\n");
return; return;
} }
set_bit(devfn, dev->dma_alias_mask); set_bit(devfn, dev->dma_alias_mask);
dev_info(&dev->dev, "Enabling fixed DMA alias to %02x.%d\n", pci_info(dev, "Enabling fixed DMA alias to %02x.%d\n",
PCI_SLOT(devfn), PCI_FUNC(devfn)); PCI_SLOT(devfn), PCI_FUNC(devfn));
} }
...@@ -5379,7 +5375,7 @@ static void pci_request_resource_alignment(struct pci_dev *dev, int bar, ...@@ -5379,7 +5375,7 @@ static void pci_request_resource_alignment(struct pci_dev *dev, int bar,
return; return;
if (r->flags & IORESOURCE_PCI_FIXED) { if (r->flags & IORESOURCE_PCI_FIXED) {
dev_info(&dev->dev, "BAR%d %pR: ignoring requested alignment %#llx\n", pci_info(dev, "BAR%d %pR: ignoring requested alignment %#llx\n",
bar, r, (unsigned long long)align); bar, r, (unsigned long long)align);
return; return;
} }
...@@ -5416,7 +5412,7 @@ static void pci_request_resource_alignment(struct pci_dev *dev, int bar, ...@@ -5416,7 +5412,7 @@ static void pci_request_resource_alignment(struct pci_dev *dev, int bar,
* devices and we use the second. * devices and we use the second.
*/ */
dev_info(&dev->dev, "BAR%d %pR: requesting alignment to %#llx\n", pci_info(dev, "BAR%d %pR: requesting alignment to %#llx\n",
bar, r, (unsigned long long)align); bar, r, (unsigned long long)align);
if (resize) { if (resize) {
...@@ -5462,13 +5458,11 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev) ...@@ -5462,13 +5458,11 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev)
if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL && if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL &&
(dev->class >> 8) == PCI_CLASS_BRIDGE_HOST) { (dev->class >> 8) == PCI_CLASS_BRIDGE_HOST) {
dev_warn(&dev->dev, pci_warn(dev, "Can't reassign resources to host bridge\n");
"Can't reassign resources to host bridge.\n");
return; return;
} }
dev_info(&dev->dev, pci_info(dev, "Disabling memory decoding and releasing memory resources\n");
"Disabling memory decoding and releasing memory resources.\n");
pci_read_config_word(dev, PCI_COMMAND, &command); pci_read_config_word(dev, PCI_COMMAND, &command);
command &= ~PCI_COMMAND_MEMORY; command &= ~PCI_COMMAND_MEMORY;
pci_write_config_word(dev, PCI_COMMAND, command); pci_write_config_word(dev, PCI_COMMAND, command);
......
...@@ -344,14 +344,14 @@ static int aer_inject(struct aer_error_inj *einj) ...@@ -344,14 +344,14 @@ static int aer_inject(struct aer_error_inj *einj)
return -ENODEV; return -ENODEV;
rpdev = pcie_find_root_port(dev); rpdev = pcie_find_root_port(dev);
if (!rpdev) { if (!rpdev) {
dev_err(&dev->dev, "aer_inject: Root port not found\n"); pci_err(dev, "aer_inject: Root port not found\n");
ret = -ENODEV; ret = -ENODEV;
goto out_put; goto out_put;
} }
pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); pos_cap_err = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
if (!pos_cap_err) { if (!pos_cap_err) {
dev_err(&dev->dev, "aer_inject: Device doesn't support AER\n"); pci_err(dev, "aer_inject: Device doesn't support AER\n");
ret = -EPROTONOSUPPORT; ret = -EPROTONOSUPPORT;
goto out_put; goto out_put;
} }
...@@ -362,8 +362,7 @@ static int aer_inject(struct aer_error_inj *einj) ...@@ -362,8 +362,7 @@ static int aer_inject(struct aer_error_inj *einj)
rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR); rp_pos_cap_err = pci_find_ext_capability(rpdev, PCI_EXT_CAP_ID_ERR);
if (!rp_pos_cap_err) { if (!rp_pos_cap_err) {
dev_err(&rpdev->dev, pci_err(rpdev, "aer_inject: Root port doesn't support AER\n");
"aer_inject: Root port doesn't support AER\n");
ret = -EPROTONOSUPPORT; ret = -EPROTONOSUPPORT;
goto out_put; goto out_put;
} }
...@@ -411,16 +410,14 @@ static int aer_inject(struct aer_error_inj *einj) ...@@ -411,16 +410,14 @@ static int aer_inject(struct aer_error_inj *einj)
if (!aer_mask_override && einj->cor_status && if (!aer_mask_override && einj->cor_status &&
!(einj->cor_status & ~cor_mask)) { !(einj->cor_status & ~cor_mask)) {
ret = -EINVAL; ret = -EINVAL;
dev_warn(&dev->dev, pci_warn(dev, "aer_inject: The correctable error(s) is masked by device\n");
"aer_inject: The correctable error(s) is masked by device\n");
spin_unlock_irqrestore(&inject_lock, flags); spin_unlock_irqrestore(&inject_lock, flags);
goto out_put; goto out_put;
} }
if (!aer_mask_override && einj->uncor_status && if (!aer_mask_override && einj->uncor_status &&
!(einj->uncor_status & ~uncor_mask)) { !(einj->uncor_status & ~uncor_mask)) {
ret = -EINVAL; ret = -EINVAL;
dev_warn(&dev->dev, pci_warn(dev, "aer_inject: The uncorrectable error(s) is masked by device\n");
"aer_inject: The uncorrectable error(s) is masked by device\n");
spin_unlock_irqrestore(&inject_lock, flags); spin_unlock_irqrestore(&inject_lock, flags);
goto out_put; goto out_put;
} }
...@@ -483,7 +480,7 @@ static int aer_inject(struct aer_error_inj *einj) ...@@ -483,7 +480,7 @@ static int aer_inject(struct aer_error_inj *einj)
einj->cor_status, einj->uncor_status, pci_name(dev)); einj->cor_status, einj->uncor_status, pci_name(dev));
aer_irq(-1, edev); aer_irq(-1, edev);
} else { } else {
dev_err(&rpdev->dev, "aer_inject: AER device not found\n"); pci_err(rpdev, "aer_inject: AER device not found\n");
ret = -ENODEV; ret = -ENODEV;
} }
out_put: out_put:
......
...@@ -326,7 +326,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev) ...@@ -326,7 +326,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND, reg32); pci_write_config_dword(dev, pos + PCI_ERR_ROOT_COMMAND, reg32);
pci_reset_bridge_secondary_bus(dev); pci_reset_bridge_secondary_bus(dev);
dev_printk(KERN_DEBUG, &dev->dev, "Root Port link has been reset\n"); pci_printk(KERN_DEBUG, dev, "Root Port link has been reset\n");
/* Clear Root Error Status */ /* Clear Root Error Status */
pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &reg32); pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &reg32);
......
...@@ -226,9 +226,8 @@ static bool find_source_device(struct pci_dev *parent, ...@@ -226,9 +226,8 @@ static bool find_source_device(struct pci_dev *parent,
pci_walk_bus(parent->subordinate, find_device_iter, e_info); pci_walk_bus(parent->subordinate, find_device_iter, e_info);
if (!e_info->error_dev_num) { if (!e_info->error_dev_num) {
dev_printk(KERN_DEBUG, &parent->dev, pci_printk(KERN_DEBUG, parent, "can't find device of ID%04x\n",
"can't find device of ID%04x\n", e_info->id);
e_info->id);
return false; return false;
} }
return true; return true;
...@@ -256,7 +255,7 @@ static int report_error_detected(struct pci_dev *dev, void *data) ...@@ -256,7 +255,7 @@ static int report_error_detected(struct pci_dev *dev, void *data)
* of a driver for this device is unaware of * of a driver for this device is unaware of
* its hw state. * its hw state.
*/ */
dev_printk(KERN_DEBUG, &dev->dev, "device has %s\n", pci_printk(KERN_DEBUG, dev, "device has %s\n",
dev->driver ? dev->driver ?
"no AER-aware driver" : "no driver"); "no AER-aware driver" : "no driver");
} }
...@@ -364,7 +363,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev, ...@@ -364,7 +363,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev,
{ {
struct aer_broadcast_data result_data; struct aer_broadcast_data result_data;
dev_printk(KERN_DEBUG, &dev->dev, "broadcast %s message\n", error_mesg); pci_printk(KERN_DEBUG, dev, "broadcast %s message\n", error_mesg);
result_data.state = state; result_data.state = state;
if (cb == report_error_detected) if (cb == report_error_detected)
result_data.result = PCI_ERS_RESULT_CAN_RECOVER; result_data.result = PCI_ERS_RESULT_CAN_RECOVER;
...@@ -413,7 +412,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev, ...@@ -413,7 +412,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev,
static pci_ers_result_t default_reset_link(struct pci_dev *dev) static pci_ers_result_t default_reset_link(struct pci_dev *dev)
{ {
pci_reset_bridge_secondary_bus(dev); pci_reset_bridge_secondary_bus(dev);
dev_printk(KERN_DEBUG, &dev->dev, "downstream link has been reset\n"); pci_printk(KERN_DEBUG, dev, "downstream link has been reset\n");
return PCI_ERS_RESULT_RECOVERED; return PCI_ERS_RESULT_RECOVERED;
} }
...@@ -465,15 +464,13 @@ static pci_ers_result_t reset_link(struct pci_dev *dev) ...@@ -465,15 +464,13 @@ static pci_ers_result_t reset_link(struct pci_dev *dev)
} else if (udev->has_secondary_link) { } else if (udev->has_secondary_link) {
status = default_reset_link(udev); status = default_reset_link(udev);
} else { } else {
dev_printk(KERN_DEBUG, &dev->dev, pci_printk(KERN_DEBUG, dev, "no link-reset support at upstream device %s\n",
"no link-reset support at upstream device %s\n",
pci_name(udev)); pci_name(udev));
return PCI_ERS_RESULT_DISCONNECT; return PCI_ERS_RESULT_DISCONNECT;
} }
if (status != PCI_ERS_RESULT_RECOVERED) { if (status != PCI_ERS_RESULT_RECOVERED) {
dev_printk(KERN_DEBUG, &dev->dev, pci_printk(KERN_DEBUG, dev, "link reset at upstream device %s failed\n",
"link reset at upstream device %s failed\n",
pci_name(udev)); pci_name(udev));
return PCI_ERS_RESULT_DISCONNECT; return PCI_ERS_RESULT_DISCONNECT;
} }
...@@ -537,12 +534,12 @@ static void do_recovery(struct pci_dev *dev, int severity) ...@@ -537,12 +534,12 @@ static void do_recovery(struct pci_dev *dev, int severity)
"resume", "resume",
report_resume); report_resume);
dev_info(&dev->dev, "AER: Device recovery successful\n"); pci_info(dev, "AER: Device recovery successful\n");
return; return;
failed: failed:
/* TODO: Should kernel panic here? */ /* TODO: Should kernel panic here? */
dev_info(&dev->dev, "AER: Device recovery failed\n"); pci_info(dev, "AER: Device recovery failed\n");
} }
/** /**
......
...@@ -132,7 +132,7 @@ static const char *aer_agent_string[] = { ...@@ -132,7 +132,7 @@ static const char *aer_agent_string[] = {
static void __print_tlp_header(struct pci_dev *dev, static void __print_tlp_header(struct pci_dev *dev,
struct aer_header_log_regs *t) struct aer_header_log_regs *t)
{ {
dev_err(&dev->dev, " TLP Header: %08x %08x %08x %08x\n", pci_err(dev, " TLP Header: %08x %08x %08x %08x\n",
t->dw0, t->dw1, t->dw2, t->dw3); t->dw0, t->dw1, t->dw2, t->dw3);
} }
...@@ -155,10 +155,10 @@ static void __aer_print_error(struct pci_dev *dev, ...@@ -155,10 +155,10 @@ static void __aer_print_error(struct pci_dev *dev,
aer_uncorrectable_error_string[i] : NULL; aer_uncorrectable_error_string[i] : NULL;
if (errmsg) if (errmsg)
dev_err(&dev->dev, " [%2d] %-22s%s\n", i, errmsg, pci_err(dev, " [%2d] %-22s%s\n", i, errmsg,
info->first_error == i ? " (First)" : ""); info->first_error == i ? " (First)" : "");
else else
dev_err(&dev->dev, " [%2d] Unknown Error Bit%s\n", pci_err(dev, " [%2d] Unknown Error Bit%s\n",
i, info->first_error == i ? " (First)" : ""); i, info->first_error == i ? " (First)" : "");
} }
} }
...@@ -169,7 +169,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) ...@@ -169,7 +169,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
int id = ((dev->bus->number << 8) | dev->devfn); int id = ((dev->bus->number << 8) | dev->devfn);
if (!info->status) { if (!info->status) {
dev_err(&dev->dev, "PCIe Bus Error: severity=%s, type=Unaccessible, id=%04x(Unregistered Agent ID)\n", pci_err(dev, "PCIe Bus Error: severity=%s, type=Unaccessible, id=%04x(Unregistered Agent ID)\n",
aer_error_severity_string[info->severity], id); aer_error_severity_string[info->severity], id);
goto out; goto out;
} }
...@@ -177,11 +177,11 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) ...@@ -177,11 +177,11 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
layer = AER_GET_LAYER_ERROR(info->severity, info->status); layer = AER_GET_LAYER_ERROR(info->severity, info->status);
agent = AER_GET_AGENT(info->severity, info->status); agent = AER_GET_AGENT(info->severity, info->status);
dev_err(&dev->dev, "PCIe Bus Error: severity=%s, type=%s, id=%04x(%s)\n", pci_err(dev, "PCIe Bus Error: severity=%s, type=%s, id=%04x(%s)\n",
aer_error_severity_string[info->severity], aer_error_severity_string[info->severity],
aer_error_layer[layer], id, aer_agent_string[agent]); aer_error_layer[layer], id, aer_agent_string[agent]);
dev_err(&dev->dev, " device [%04x:%04x] error status/mask=%08x/%08x\n", pci_err(dev, " device [%04x:%04x] error status/mask=%08x/%08x\n",
dev->vendor, dev->device, dev->vendor, dev->device,
info->status, info->mask); info->status, info->mask);
...@@ -192,7 +192,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) ...@@ -192,7 +192,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
out: out:
if (info->id && info->error_dev_num > 1 && info->id == id) if (info->id && info->error_dev_num > 1 && info->id == id)
dev_err(&dev->dev, " Error of this Agent(%04x) is reported first\n", id); pci_err(dev, " Error of this Agent(%04x) is reported first\n", id);
trace_aer_event(dev_name(&dev->dev), (info->status & ~info->mask), trace_aer_event(dev_name(&dev->dev), (info->status & ~info->mask),
info->severity); info->severity);
...@@ -200,7 +200,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info) ...@@ -200,7 +200,7 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info) void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info)
{ {
dev_info(&dev->dev, "AER: %s%s error received: id=%04x\n", pci_info(dev, "AER: %s%s error received: id=%04x\n",
info->multi_error_valid ? "Multiple " : "", info->multi_error_valid ? "Multiple " : "",
aer_error_severity_string[info->severity], info->id); aer_error_severity_string[info->severity], info->id);
} }
...@@ -242,13 +242,13 @@ void cper_print_aer(struct pci_dev *dev, int aer_severity, ...@@ -242,13 +242,13 @@ void cper_print_aer(struct pci_dev *dev, int aer_severity,
layer = AER_GET_LAYER_ERROR(aer_severity, status); layer = AER_GET_LAYER_ERROR(aer_severity, status);
agent = AER_GET_AGENT(aer_severity, status); agent = AER_GET_AGENT(aer_severity, status);
dev_err(&dev->dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n", status, mask); pci_err(dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n", status, mask);
cper_print_bits("", status, status_strs, status_strs_size); cper_print_bits("", status, status_strs, status_strs_size);
dev_err(&dev->dev, "aer_layer=%s, aer_agent=%s\n", pci_err(dev, "aer_layer=%s, aer_agent=%s\n",
aer_error_layer[layer], aer_agent_string[agent]); aer_error_layer[layer], aer_agent_string[agent]);
if (aer_severity != AER_CORRECTABLE) if (aer_severity != AER_CORRECTABLE)
dev_err(&dev->dev, "aer_uncor_severity: 0x%08x\n", pci_err(dev, "aer_uncor_severity: 0x%08x\n",
aer->uncor_severity); aer->uncor_severity);
if (tlp_header_valid) if (tlp_header_valid)
......
...@@ -266,7 +266,7 @@ static void pcie_aspm_configure_common_clock(struct pcie_link_state *link) ...@@ -266,7 +266,7 @@ static void pcie_aspm_configure_common_clock(struct pcie_link_state *link)
return; return;
/* Training failed. Restore common clock configurations */ /* Training failed. Restore common clock configurations */
dev_err(&parent->dev, "ASPM: Could not configure common clock\n"); pci_err(parent, "ASPM: Could not configure common clock\n");
list_for_each_entry(child, &linkbus->devices, bus_list) list_for_each_entry(child, &linkbus->devices, bus_list)
pcie_capability_write_word(child, PCI_EXP_LNKCTL, pcie_capability_write_word(child, PCI_EXP_LNKCTL,
child_reg[PCI_FUNC(child->devfn)]); child_reg[PCI_FUNC(child->devfn)]);
...@@ -316,8 +316,7 @@ static u32 calc_l1ss_pwron(struct pci_dev *pdev, u32 scale, u32 val) ...@@ -316,8 +316,7 @@ static u32 calc_l1ss_pwron(struct pci_dev *pdev, u32 scale, u32 val)
case 2: case 2:
return val * 100; return val * 100;
} }
dev_err(&pdev->dev, "%s: Invalid T_PwrOn scale: %u\n", pci_err(pdev, "%s: Invalid T_PwrOn scale: %u\n", __func__, scale);
__func__, scale);
return 0; return 0;
} }
...@@ -809,7 +808,7 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev) ...@@ -809,7 +808,7 @@ static int pcie_aspm_sanity_check(struct pci_dev *pdev)
*/ */
pcie_capability_read_dword(child, PCI_EXP_DEVCAP, &reg32); pcie_capability_read_dword(child, PCI_EXP_DEVCAP, &reg32);
if (!(reg32 & PCI_EXP_DEVCAP_RBER) && !aspm_force) { if (!(reg32 & PCI_EXP_DEVCAP_RBER) && !aspm_force) {
dev_info(&child->dev, "disabling ASPM on pre-1.1 PCIe device. You can enable it with 'pcie_aspm=force'\n"); pci_info(child, "disabling ASPM on pre-1.1 PCIe device. You can enable it with 'pcie_aspm=force'\n");
return -EINVAL; return -EINVAL;
} }
} }
...@@ -1050,7 +1049,7 @@ static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem) ...@@ -1050,7 +1049,7 @@ static void __pci_disable_link_state(struct pci_dev *pdev, int state, bool sem)
* ignored in this situation. * ignored in this situation.
*/ */
if (aspm_disabled) { if (aspm_disabled) {
dev_warn(&pdev->dev, "can't disable ASPM; OS doesn't have ASPM control\n"); pci_warn(pdev, "can't disable ASPM; OS doesn't have ASPM control\n");
return; return;
} }
......
...@@ -198,14 +198,14 @@ static void pcie_pme_handle_request(struct pci_dev *port, u16 req_id) ...@@ -198,14 +198,14 @@ static void pcie_pme_handle_request(struct pci_dev *port, u16 req_id)
* assuming that the PME was reported by a PCIe-PCI bridge that * assuming that the PME was reported by a PCIe-PCI bridge that
* used devfn different from zero. * used devfn different from zero.
*/ */
dev_dbg(&port->dev, "PME interrupt generated for non-existent device %02x:%02x.%d\n", pci_dbg(port, "PME interrupt generated for non-existent device %02x:%02x.%d\n",
busnr, PCI_SLOT(devfn), PCI_FUNC(devfn)); busnr, PCI_SLOT(devfn), PCI_FUNC(devfn));
found = pcie_pme_from_pci_bridge(bus, 0); found = pcie_pme_from_pci_bridge(bus, 0);
} }
out: out:
if (!found) if (!found)
dev_dbg(&port->dev, "Spurious native PME interrupt!\n"); pci_dbg(port, "Spurious native PME interrupt!\n");
} }
/** /**
...@@ -345,7 +345,7 @@ static int pcie_pme_probe(struct pcie_device *srv) ...@@ -345,7 +345,7 @@ static int pcie_pme_probe(struct pcie_device *srv)
return ret; return ret;
} }
dev_info(&port->dev, "Signaling PME with IRQ %d\n", srv->irq); pci_info(port, "Signaling PME with IRQ %d\n", srv->irq);
pcie_pme_mark_devices(port); pcie_pme_mark_devices(port);
pcie_pme_interrupt_enable(port, true); pcie_pme_interrupt_enable(port, true);
......
...@@ -33,7 +33,7 @@ static void pci_ptm_info(struct pci_dev *dev) ...@@ -33,7 +33,7 @@ static void pci_ptm_info(struct pci_dev *dev)
dev->ptm_granularity); dev->ptm_granularity);
break; break;
} }
dev_info(&dev->dev, "PTM enabled%s, %s granularity\n", pci_info(dev, "PTM enabled%s, %s granularity\n",
dev->ptm_root ? " (root)" : "", clock_desc); dev->ptm_root ? " (root)" : "", clock_desc);
} }
......
...@@ -253,7 +253,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, ...@@ -253,7 +253,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
sz64 = pci_size(l64, sz64, mask64); sz64 = pci_size(l64, sz64, mask64);
if (!sz64) { if (!sz64) {
dev_info(&dev->dev, FW_BUG "reg 0x%x: invalid BAR (can't size)\n", pci_info(dev, FW_BUG "reg 0x%x: invalid BAR (can't size)\n",
pos); pos);
goto fail; goto fail;
} }
...@@ -264,7 +264,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, ...@@ -264,7 +264,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED; res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED;
res->start = 0; res->start = 0;
res->end = 0; res->end = 0;
dev_err(&dev->dev, "reg 0x%x: can't handle BAR larger than 4GB (size %#010llx)\n", pci_err(dev, "reg 0x%x: can't handle BAR larger than 4GB (size %#010llx)\n",
pos, (unsigned long long)sz64); pos, (unsigned long long)sz64);
goto out; goto out;
} }
...@@ -274,7 +274,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, ...@@ -274,7 +274,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
res->start = 0; res->start = 0;
res->end = sz64; res->end = sz64;
dev_info(&dev->dev, "reg 0x%x: can't handle BAR above 4GB (bus address %#010llx)\n", pci_info(dev, "reg 0x%x: can't handle BAR above 4GB (bus address %#010llx)\n",
pos, (unsigned long long)l64); pos, (unsigned long long)l64);
goto out; goto out;
} }
...@@ -301,7 +301,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, ...@@ -301,7 +301,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
res->start = 0; res->start = 0;
res->end = region.end - region.start; res->end = region.end - region.start;
dev_info(&dev->dev, "reg 0x%x: initial BAR value %#010llx invalid\n", pci_info(dev, "reg 0x%x: initial BAR value %#010llx invalid\n",
pos, (unsigned long long)region.start); pos, (unsigned long long)region.start);
} }
...@@ -312,7 +312,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, ...@@ -312,7 +312,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
res->flags = 0; res->flags = 0;
out: out:
if (res->flags) if (res->flags)
dev_printk(KERN_DEBUG, &dev->dev, "reg 0x%x: %pR\n", pos, res); pci_printk(KERN_DEBUG, dev, "reg 0x%x: %pR\n", pos, res);
return (res->flags & IORESOURCE_MEM_64) ? 1 : 0; return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
} }
...@@ -375,7 +375,7 @@ static void pci_read_bridge_io(struct pci_bus *child) ...@@ -375,7 +375,7 @@ static void pci_read_bridge_io(struct pci_bus *child)
region.start = base; region.start = base;
region.end = limit + io_granularity - 1; region.end = limit + io_granularity - 1;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res);
} }
} }
...@@ -397,7 +397,7 @@ static void pci_read_bridge_mmio(struct pci_bus *child) ...@@ -397,7 +397,7 @@ static void pci_read_bridge_mmio(struct pci_bus *child)
region.start = base; region.start = base;
region.end = limit + 0xfffff; region.end = limit + 0xfffff;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res);
} }
} }
...@@ -437,7 +437,7 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child) ...@@ -437,7 +437,7 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child)
limit = (pci_bus_addr_t) limit64; limit = (pci_bus_addr_t) limit64;
if (base != base64) { if (base != base64) {
dev_err(&dev->dev, "can't handle bridge window above 4GB (bus address %#010llx)\n", pci_err(dev, "can't handle bridge window above 4GB (bus address %#010llx)\n",
(unsigned long long) base64); (unsigned long long) base64);
return; return;
} }
...@@ -450,7 +450,7 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child) ...@@ -450,7 +450,7 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child)
region.start = base; region.start = base;
region.end = limit + 0xfffff; region.end = limit + 0xfffff;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
dev_printk(KERN_DEBUG, &dev->dev, " bridge window %pR\n", res); pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res);
} }
} }
...@@ -463,7 +463,7 @@ void pci_read_bridge_bases(struct pci_bus *child) ...@@ -463,7 +463,7 @@ void pci_read_bridge_bases(struct pci_bus *child)
if (pci_is_root_bus(child)) /* It's a host bus, nothing to read */ if (pci_is_root_bus(child)) /* It's a host bus, nothing to read */
return; return;
dev_info(&dev->dev, "PCI bridge to %pR%s\n", pci_info(dev, "PCI bridge to %pR%s\n",
&child->busn_res, &child->busn_res,
dev->transparent ? " (subtractive decode)" : ""); dev->transparent ? " (subtractive decode)" : "");
...@@ -480,7 +480,7 @@ void pci_read_bridge_bases(struct pci_bus *child) ...@@ -480,7 +480,7 @@ void pci_read_bridge_bases(struct pci_bus *child)
if (res && res->flags) { if (res && res->flags) {
pci_bus_add_resource(child, res, pci_bus_add_resource(child, res,
PCI_SUBTRACTIVE_DECODE); PCI_SUBTRACTIVE_DECODE);
dev_printk(KERN_DEBUG, &dev->dev, pci_printk(KERN_DEBUG, dev,
" bridge window %pR (subtractive decode)\n", " bridge window %pR (subtractive decode)\n",
res); res);
} }
...@@ -1005,11 +1005,11 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev, ...@@ -1005,11 +1005,11 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev,
secondary = (buses >> 8) & 0xFF; secondary = (buses >> 8) & 0xFF;
subordinate = (buses >> 16) & 0xFF; subordinate = (buses >> 16) & 0xFF;
dev_dbg(&dev->dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n", pci_dbg(dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n",
secondary, subordinate, pass); secondary, subordinate, pass);
if (!primary && (primary != bus->number) && secondary && subordinate) { if (!primary && (primary != bus->number) && secondary && subordinate) {
dev_warn(&dev->dev, "Primary bus is hard wired to 0\n"); pci_warn(dev, "Primary bus is hard wired to 0\n");
primary = bus->number; primary = bus->number;
} }
...@@ -1017,7 +1017,7 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev, ...@@ -1017,7 +1017,7 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev,
if (!pass && if (!pass &&
(primary != bus->number || secondary <= bus->number || (primary != bus->number || secondary <= bus->number ||
secondary > subordinate)) { secondary > subordinate)) {
dev_info(&dev->dev, "bridge configuration invalid ([bus %02x-%02x]), reconfiguring\n", pci_info(dev, "bridge configuration invalid ([bus %02x-%02x]), reconfiguring\n",
secondary, subordinate); secondary, subordinate);
broken = 1; broken = 1;
} }
...@@ -1058,7 +1058,7 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev, ...@@ -1058,7 +1058,7 @@ static int pci_scan_bridge_extend(struct pci_bus *bus, struct pci_dev *dev,
cmax = pci_scan_child_bus(child); cmax = pci_scan_child_bus(child);
if (cmax > subordinate) if (cmax > subordinate)
dev_warn(&dev->dev, "bridge has subordinate %02x but max busn %02x\n", pci_warn(dev, "bridge has subordinate %02x but max busn %02x\n",
subordinate, cmax); subordinate, cmax);
/* subordinate should equal child->busn_res.end */ /* subordinate should equal child->busn_res.end */
if (subordinate > max) if (subordinate > max)
...@@ -1468,7 +1468,7 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1468,7 +1468,7 @@ int pci_setup_device(struct pci_dev *dev)
dev->revision = class & 0xff; dev->revision = class & 0xff;
dev->class = class >> 8; /* upper 3 bytes */ dev->class = class >> 8; /* upper 3 bytes */
dev_printk(KERN_DEBUG, &dev->dev, "[%04x:%04x] type %02x class %#08x\n", pci_printk(KERN_DEBUG, dev, "[%04x:%04x] type %02x class %#08x\n",
dev->vendor, dev->device, dev->hdr_type, dev->class); dev->vendor, dev->device, dev->hdr_type, dev->class);
/* need to have dev->class ready */ /* need to have dev->class ready */
...@@ -1488,7 +1488,7 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1488,7 +1488,7 @@ int pci_setup_device(struct pci_dev *dev)
if (dev->non_compliant_bars) { if (dev->non_compliant_bars) {
pci_read_config_word(dev, PCI_COMMAND, &cmd); pci_read_config_word(dev, PCI_COMMAND, &cmd);
if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) {
dev_info(&dev->dev, "device has non-compliant BARs; disabling IO/MEM decoding\n"); pci_info(dev, "device has non-compliant BARs; disabling IO/MEM decoding\n");
cmd &= ~PCI_COMMAND_IO; cmd &= ~PCI_COMMAND_IO;
cmd &= ~PCI_COMMAND_MEMORY; cmd &= ~PCI_COMMAND_MEMORY;
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
...@@ -1521,14 +1521,14 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1521,14 +1521,14 @@ int pci_setup_device(struct pci_dev *dev)
res = &dev->resource[0]; res = &dev->resource[0];
res->flags = LEGACY_IO_RESOURCE; res->flags = LEGACY_IO_RESOURCE;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
dev_info(&dev->dev, "legacy IDE quirk: reg 0x10: %pR\n", pci_info(dev, "legacy IDE quirk: reg 0x10: %pR\n",
res); res);
region.start = 0x3F6; region.start = 0x3F6;
region.end = 0x3F6; region.end = 0x3F6;
res = &dev->resource[1]; res = &dev->resource[1];
res->flags = LEGACY_IO_RESOURCE; res->flags = LEGACY_IO_RESOURCE;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
dev_info(&dev->dev, "legacy IDE quirk: reg 0x14: %pR\n", pci_info(dev, "legacy IDE quirk: reg 0x14: %pR\n",
res); res);
} }
if ((progif & 4) == 0) { if ((progif & 4) == 0) {
...@@ -1537,14 +1537,14 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1537,14 +1537,14 @@ int pci_setup_device(struct pci_dev *dev)
res = &dev->resource[2]; res = &dev->resource[2];
res->flags = LEGACY_IO_RESOURCE; res->flags = LEGACY_IO_RESOURCE;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
dev_info(&dev->dev, "legacy IDE quirk: reg 0x18: %pR\n", pci_info(dev, "legacy IDE quirk: reg 0x18: %pR\n",
res); res);
region.start = 0x376; region.start = 0x376;
region.end = 0x376; region.end = 0x376;
res = &dev->resource[3]; res = &dev->resource[3];
res->flags = LEGACY_IO_RESOURCE; res->flags = LEGACY_IO_RESOURCE;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
dev_info(&dev->dev, "legacy IDE quirk: reg 0x1c: %pR\n", pci_info(dev, "legacy IDE quirk: reg 0x1c: %pR\n",
res); res);
} }
} }
...@@ -1577,12 +1577,12 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1577,12 +1577,12 @@ int pci_setup_device(struct pci_dev *dev)
break; break;
default: /* unknown header */ default: /* unknown header */
dev_err(&dev->dev, "unknown header type %02x, ignoring device\n", pci_err(dev, "unknown header type %02x, ignoring device\n",
dev->hdr_type); dev->hdr_type);
return -EIO; return -EIO;
bad: bad:
dev_err(&dev->dev, "ignoring class %#08x (doesn't match header type %02x)\n", pci_err(dev, "ignoring class %#08x (doesn't match header type %02x)\n",
dev->class, dev->hdr_type); dev->class, dev->hdr_type);
dev->class = PCI_CLASS_NOT_DEFINED << 8; dev->class = PCI_CLASS_NOT_DEFINED << 8;
} }
...@@ -1606,7 +1606,7 @@ static void pci_configure_mps(struct pci_dev *dev) ...@@ -1606,7 +1606,7 @@ static void pci_configure_mps(struct pci_dev *dev)
return; return;
if (pcie_bus_config == PCIE_BUS_TUNE_OFF) { if (pcie_bus_config == PCIE_BUS_TUNE_OFF) {
dev_warn(&dev->dev, "Max Payload Size %d, but upstream %s set to %d; if necessary, use \"pci=pcie_bus_safe\" and report a bug\n", pci_warn(dev, "Max Payload Size %d, but upstream %s set to %d; if necessary, use \"pci=pcie_bus_safe\" and report a bug\n",
mps, pci_name(bridge), p_mps); mps, pci_name(bridge), p_mps);
return; return;
} }
...@@ -1620,12 +1620,12 @@ static void pci_configure_mps(struct pci_dev *dev) ...@@ -1620,12 +1620,12 @@ static void pci_configure_mps(struct pci_dev *dev)
rc = pcie_set_mps(dev, p_mps); rc = pcie_set_mps(dev, p_mps);
if (rc) { if (rc) {
dev_warn(&dev->dev, "can't set Max Payload Size to %d; if necessary, use \"pci=pcie_bus_safe\" and report a bug\n", pci_warn(dev, "can't set Max Payload Size to %d; if necessary, use \"pci=pcie_bus_safe\" and report a bug\n",
p_mps); p_mps);
return; return;
} }
dev_info(&dev->dev, "Max Payload Size set to %d (was %d, max %d)\n", pci_info(dev, "Max Payload Size set to %d (was %d, max %d)\n",
p_mps, mps, 128 << dev->pcie_mpss); p_mps, mps, 128 << dev->pcie_mpss);
} }
...@@ -1645,8 +1645,7 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp) ...@@ -1645,8 +1645,7 @@ static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp)
hpp = &pci_default_type0; hpp = &pci_default_type0;
if (hpp->revision > 1) { if (hpp->revision > 1) {
dev_warn(&dev->dev, pci_warn(dev, "PCI settings rev %d not supported; using defaults\n",
"PCI settings rev %d not supported; using defaults\n",
hpp->revision); hpp->revision);
hpp = &pci_default_type0; hpp = &pci_default_type0;
} }
...@@ -1684,7 +1683,7 @@ static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp) ...@@ -1684,7 +1683,7 @@ static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
if (!pos) if (!pos)
return; return;
dev_warn(&dev->dev, "PCI-X settings not supported\n"); pci_warn(dev, "PCI-X settings not supported\n");
} }
static bool pcie_root_rcb_set(struct pci_dev *dev) static bool pcie_root_rcb_set(struct pci_dev *dev)
...@@ -1714,7 +1713,7 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp) ...@@ -1714,7 +1713,7 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
return; return;
if (hpp->revision > 1) { if (hpp->revision > 1) {
dev_warn(&dev->dev, "PCIe settings rev %d not supported\n", pci_warn(dev, "PCIe settings rev %d not supported\n",
hpp->revision); hpp->revision);
return; return;
} }
...@@ -1818,7 +1817,7 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign) ...@@ -1818,7 +1817,7 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
*/ */
if (host->no_ext_tags) { if (host->no_ext_tags) {
if (ctl & PCI_EXP_DEVCTL_EXT_TAG) { if (ctl & PCI_EXP_DEVCTL_EXT_TAG) {
dev_info(&dev->dev, "disabling Extended Tags\n"); pci_info(dev, "disabling Extended Tags\n");
pcie_capability_clear_word(dev, PCI_EXP_DEVCTL, pcie_capability_clear_word(dev, PCI_EXP_DEVCTL,
PCI_EXP_DEVCTL_EXT_TAG); PCI_EXP_DEVCTL_EXT_TAG);
} }
...@@ -1826,7 +1825,7 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign) ...@@ -1826,7 +1825,7 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
} }
if (!(ctl & PCI_EXP_DEVCTL_EXT_TAG)) { if (!(ctl & PCI_EXP_DEVCTL_EXT_TAG)) {
dev_info(&dev->dev, "enabling Extended Tags\n"); pci_info(dev, "enabling Extended Tags\n");
pcie_capability_set_word(dev, PCI_EXP_DEVCTL, pcie_capability_set_word(dev, PCI_EXP_DEVCTL,
PCI_EXP_DEVCTL_EXT_TAG); PCI_EXP_DEVCTL_EXT_TAG);
} }
...@@ -1871,7 +1870,7 @@ static void pci_configure_relaxed_ordering(struct pci_dev *dev) ...@@ -1871,7 +1870,7 @@ static void pci_configure_relaxed_ordering(struct pci_dev *dev)
if (root->dev_flags & PCI_DEV_FLAGS_NO_RELAXED_ORDERING) { if (root->dev_flags & PCI_DEV_FLAGS_NO_RELAXED_ORDERING) {
pcie_capability_clear_word(dev, PCI_EXP_DEVCTL, pcie_capability_clear_word(dev, PCI_EXP_DEVCTL,
PCI_EXP_DEVCTL_RELAX_EN); PCI_EXP_DEVCTL_RELAX_EN);
dev_info(&dev->dev, "Disable Relaxed Ordering because the Root Port didn't support it\n"); pci_info(dev, "Relaxed Ordering disabled because the Root Port didn't support it\n");
} }
} }
...@@ -2372,7 +2371,7 @@ static void pcie_write_mps(struct pci_dev *dev, int mps) ...@@ -2372,7 +2371,7 @@ static void pcie_write_mps(struct pci_dev *dev, int mps)
rc = pcie_set_mps(dev, mps); rc = pcie_set_mps(dev, mps);
if (rc) if (rc)
dev_err(&dev->dev, "Failed attempting to set the MPS\n"); pci_err(dev, "Failed attempting to set the MPS\n");
} }
static void pcie_write_mrrs(struct pci_dev *dev) static void pcie_write_mrrs(struct pci_dev *dev)
...@@ -2402,12 +2401,12 @@ static void pcie_write_mrrs(struct pci_dev *dev) ...@@ -2402,12 +2401,12 @@ static void pcie_write_mrrs(struct pci_dev *dev)
if (!rc) if (!rc)
break; break;
dev_warn(&dev->dev, "Failed attempting to set the MRRS\n"); pci_warn(dev, "Failed attempting to set the MRRS\n");
mrrs /= 2; mrrs /= 2;
} }
if (mrrs < 128) if (mrrs < 128)
dev_err(&dev->dev, "MRRS was unable to be configured with a safe value. If problems are experienced, try running with pci=pcie_bus_safe\n"); pci_err(dev, "MRRS was unable to be configured with a safe value. If problems are experienced, try running with pci=pcie_bus_safe\n");
} }
static int pcie_bus_configure_set(struct pci_dev *dev, void *data) static int pcie_bus_configure_set(struct pci_dev *dev, void *data)
...@@ -2427,7 +2426,7 @@ static int pcie_bus_configure_set(struct pci_dev *dev, void *data) ...@@ -2427,7 +2426,7 @@ static int pcie_bus_configure_set(struct pci_dev *dev, void *data)
pcie_write_mps(dev, mps); pcie_write_mps(dev, mps);
pcie_write_mrrs(dev); pcie_write_mrrs(dev);
dev_info(&dev->dev, "Max Payload Size set to %4d/%4d (was %4d), Max Read Rq %4d\n", pci_info(dev, "Max Payload Size set to %4d/%4d (was %4d), Max Read Rq %4d\n",
pcie_get_mps(dev), 128 << dev->pcie_mpss, pcie_get_mps(dev), 128 << dev->pcie_mpss,
orig_mps, pcie_get_readrq(dev)); orig_mps, pcie_get_readrq(dev));
...@@ -2912,7 +2911,7 @@ int pci_hp_add_bridge(struct pci_dev *dev) ...@@ -2912,7 +2911,7 @@ int pci_hp_add_bridge(struct pci_dev *dev)
break; break;
} }
if (busnr-- > end) { if (busnr-- > end) {
dev_err(&dev->dev, "No bus number available for hot-added bridge\n"); pci_err(dev, "No bus number available for hot-added bridge\n");
return -1; return -1;
} }
......
此差异已折叠。
...@@ -92,14 +92,14 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size) ...@@ -92,14 +92,14 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size)
void __iomem *pds; void __iomem *pds;
/* Standard PCI ROMs start out with these bytes 55 AA */ /* Standard PCI ROMs start out with these bytes 55 AA */
if (readw(image) != 0xAA55) { if (readw(image) != 0xAA55) {
dev_err(&pdev->dev, "Invalid PCI ROM header signature: expecting 0xaa55, got %#06x\n", pci_err(pdev, "Invalid PCI ROM header signature: expecting 0xaa55, got %#06x\n",
readw(image)); readw(image));
break; break;
} }
/* get the PCI data structure and check its "PCIR" signature */ /* get the PCI data structure and check its "PCIR" signature */
pds = image + readw(image + 24); pds = image + readw(image + 24);
if (readl(pds) != 0x52494350) { if (readl(pds) != 0x52494350) {
dev_err(&pdev->dev, "Invalid PCI ROM data signature: expecting 0x52494350, got %#010x\n", pci_err(pdev, "Invalid PCI ROM data signature: expecting 0x52494350, got %#010x\n",
readl(pds)); readl(pds));
break; break;
} }
......
...@@ -67,10 +67,8 @@ static int add_to_list(struct list_head *head, ...@@ -67,10 +67,8 @@ static int add_to_list(struct list_head *head,
struct pci_dev_resource *tmp; struct pci_dev_resource *tmp;
tmp = kzalloc(sizeof(*tmp), GFP_KERNEL); tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
if (!tmp) { if (!tmp)
pr_warn("add_to_list: kmalloc() failed!\n");
return -ENOMEM; return -ENOMEM;
}
tmp->res = res; tmp->res = res;
tmp->dev = dev; tmp->dev = dev;
...@@ -152,7 +150,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head) ...@@ -152,7 +150,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
r_align = pci_resource_alignment(dev, r); r_align = pci_resource_alignment(dev, r);
if (!r_align) { if (!r_align) {
dev_warn(&dev->dev, "BAR %d: %pR has bogus alignment\n", pci_warn(dev, "BAR %d: %pR has bogus alignment\n",
i, r); i, r);
continue; continue;
} }
...@@ -260,7 +258,7 @@ static void reassign_resources_sorted(struct list_head *realloc_head, ...@@ -260,7 +258,7 @@ static void reassign_resources_sorted(struct list_head *realloc_head,
(IORESOURCE_STARTALIGN|IORESOURCE_SIZEALIGN); (IORESOURCE_STARTALIGN|IORESOURCE_SIZEALIGN);
if (pci_reassign_resource(add_res->dev, idx, if (pci_reassign_resource(add_res->dev, idx,
add_size, align)) add_size, align))
dev_printk(KERN_DEBUG, &add_res->dev->dev, pci_printk(KERN_DEBUG, add_res->dev,
"failed to add %llx res[%d]=%pR\n", "failed to add %llx res[%d]=%pR\n",
(unsigned long long)add_size, (unsigned long long)add_size,
idx, res); idx, res);
...@@ -519,7 +517,7 @@ void pci_setup_cardbus(struct pci_bus *bus) ...@@ -519,7 +517,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
struct resource *res; struct resource *res;
struct pci_bus_region region; struct pci_bus_region region;
dev_info(&bridge->dev, "CardBus bridge to %pR\n", pci_info(bridge, "CardBus bridge to %pR\n",
&bus->busn_res); &bus->busn_res);
res = bus->resource[0]; res = bus->resource[0];
...@@ -529,7 +527,7 @@ void pci_setup_cardbus(struct pci_bus *bus) ...@@ -529,7 +527,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
* The IO resource is allocated a range twice as large as it * The IO resource is allocated a range twice as large as it
* would normally need. This allows us to set both IO regs. * would normally need. This allows us to set both IO regs.
*/ */
dev_info(&bridge->dev, " bridge window %pR\n", res); pci_info(bridge, " bridge window %pR\n", res);
pci_write_config_dword(bridge, PCI_CB_IO_BASE_0, pci_write_config_dword(bridge, PCI_CB_IO_BASE_0,
region.start); region.start);
pci_write_config_dword(bridge, PCI_CB_IO_LIMIT_0, pci_write_config_dword(bridge, PCI_CB_IO_LIMIT_0,
...@@ -539,7 +537,7 @@ void pci_setup_cardbus(struct pci_bus *bus) ...@@ -539,7 +537,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
res = bus->resource[1]; res = bus->resource[1];
pcibios_resource_to_bus(bridge->bus, &region, res); pcibios_resource_to_bus(bridge->bus, &region, res);
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
dev_info(&bridge->dev, " bridge window %pR\n", res); pci_info(bridge, " bridge window %pR\n", res);
pci_write_config_dword(bridge, PCI_CB_IO_BASE_1, pci_write_config_dword(bridge, PCI_CB_IO_BASE_1,
region.start); region.start);
pci_write_config_dword(bridge, PCI_CB_IO_LIMIT_1, pci_write_config_dword(bridge, PCI_CB_IO_LIMIT_1,
...@@ -549,7 +547,7 @@ void pci_setup_cardbus(struct pci_bus *bus) ...@@ -549,7 +547,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
res = bus->resource[2]; res = bus->resource[2];
pcibios_resource_to_bus(bridge->bus, &region, res); pcibios_resource_to_bus(bridge->bus, &region, res);
if (res->flags & IORESOURCE_MEM) { if (res->flags & IORESOURCE_MEM) {
dev_info(&bridge->dev, " bridge window %pR\n", res); pci_info(bridge, " bridge window %pR\n", res);
pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_0, pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_0,
region.start); region.start);
pci_write_config_dword(bridge, PCI_CB_MEMORY_LIMIT_0, pci_write_config_dword(bridge, PCI_CB_MEMORY_LIMIT_0,
...@@ -559,7 +557,7 @@ void pci_setup_cardbus(struct pci_bus *bus) ...@@ -559,7 +557,7 @@ void pci_setup_cardbus(struct pci_bus *bus)
res = bus->resource[3]; res = bus->resource[3];
pcibios_resource_to_bus(bridge->bus, &region, res); pcibios_resource_to_bus(bridge->bus, &region, res);
if (res->flags & IORESOURCE_MEM) { if (res->flags & IORESOURCE_MEM) {
dev_info(&bridge->dev, " bridge window %pR\n", res); pci_info(bridge, " bridge window %pR\n", res);
pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_1, pci_write_config_dword(bridge, PCI_CB_MEMORY_BASE_1,
region.start); region.start);
pci_write_config_dword(bridge, PCI_CB_MEMORY_LIMIT_1, pci_write_config_dword(bridge, PCI_CB_MEMORY_LIMIT_1,
...@@ -602,7 +600,7 @@ static void pci_setup_bridge_io(struct pci_dev *bridge) ...@@ -602,7 +600,7 @@ static void pci_setup_bridge_io(struct pci_dev *bridge)
l = ((u16) io_limit_lo << 8) | io_base_lo; l = ((u16) io_limit_lo << 8) | io_base_lo;
/* Set up upper 16 bits of I/O base/limit. */ /* Set up upper 16 bits of I/O base/limit. */
io_upper16 = (region.end & 0xffff0000) | (region.start >> 16); io_upper16 = (region.end & 0xffff0000) | (region.start >> 16);
dev_info(&bridge->dev, " bridge window %pR\n", res); pci_info(bridge, " bridge window %pR\n", res);
} else { } else {
/* Clear upper 16 bits of I/O base/limit. */ /* Clear upper 16 bits of I/O base/limit. */
io_upper16 = 0; io_upper16 = 0;
...@@ -628,7 +626,7 @@ static void pci_setup_bridge_mmio(struct pci_dev *bridge) ...@@ -628,7 +626,7 @@ static void pci_setup_bridge_mmio(struct pci_dev *bridge)
if (res->flags & IORESOURCE_MEM) { if (res->flags & IORESOURCE_MEM) {
l = (region.start >> 16) & 0xfff0; l = (region.start >> 16) & 0xfff0;
l |= region.end & 0xfff00000; l |= region.end & 0xfff00000;
dev_info(&bridge->dev, " bridge window %pR\n", res); pci_info(bridge, " bridge window %pR\n", res);
} else { } else {
l = 0x0000fff0; l = 0x0000fff0;
} }
...@@ -657,7 +655,7 @@ static void pci_setup_bridge_mmio_pref(struct pci_dev *bridge) ...@@ -657,7 +655,7 @@ static void pci_setup_bridge_mmio_pref(struct pci_dev *bridge)
bu = upper_32_bits(region.start); bu = upper_32_bits(region.start);
lu = upper_32_bits(region.end); lu = upper_32_bits(region.end);
} }
dev_info(&bridge->dev, " bridge window %pR\n", res); pci_info(bridge, " bridge window %pR\n", res);
} else { } else {
l = 0x0000fff0; l = 0x0000fff0;
} }
...@@ -672,7 +670,7 @@ static void __pci_setup_bridge(struct pci_bus *bus, unsigned long type) ...@@ -672,7 +670,7 @@ static void __pci_setup_bridge(struct pci_bus *bus, unsigned long type)
{ {
struct pci_dev *bridge = bus->self; struct pci_dev *bridge = bus->self;
dev_info(&bridge->dev, "PCI bridge to %pR\n", pci_info(bridge, "PCI bridge to %pR\n",
&bus->busn_res); &bus->busn_res);
if (type & IORESOURCE_IO) if (type & IORESOURCE_IO)
...@@ -944,7 +942,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size, ...@@ -944,7 +942,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
resource_size(b_res), min_align); resource_size(b_res), min_align);
if (!size0 && !size1) { if (!size0 && !size1) {
if (b_res->start || b_res->end) if (b_res->start || b_res->end)
dev_info(&bus->self->dev, "disabling bridge window %pR to %pR (unused)\n", pci_info(bus->self, "disabling bridge window %pR to %pR (unused)\n",
b_res, &bus->busn_res); b_res, &bus->busn_res);
b_res->flags = 0; b_res->flags = 0;
return; return;
...@@ -956,7 +954,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size, ...@@ -956,7 +954,7 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
if (size1 > size0 && realloc_head) { if (size1 > size0 && realloc_head) {
add_to_list(realloc_head, bus->self, b_res, size1-size0, add_to_list(realloc_head, bus->self, b_res, size1-size0,
min_align); min_align);
dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window %pR to %pR add_size %llx\n", pci_printk(KERN_DEBUG, bus->self, "bridge window %pR to %pR add_size %llx\n",
b_res, &bus->busn_res, b_res, &bus->busn_res,
(unsigned long long)size1-size0); (unsigned long long)size1-size0);
} }
...@@ -1061,7 +1059,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, ...@@ -1061,7 +1059,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
if (order < 0) if (order < 0)
order = 0; order = 0;
if (order >= ARRAY_SIZE(aligns)) { if (order >= ARRAY_SIZE(aligns)) {
dev_warn(&dev->dev, "disabling BAR %d: %pR (bad alignment %#llx)\n", pci_warn(dev, "disabling BAR %d: %pR (bad alignment %#llx)\n",
i, r, (unsigned long long) align); i, r, (unsigned long long) align);
r->flags = 0; r->flags = 0;
continue; continue;
...@@ -1093,7 +1091,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, ...@@ -1093,7 +1091,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
resource_size(b_res), add_align); resource_size(b_res), add_align);
if (!size0 && !size1) { if (!size0 && !size1) {
if (b_res->start || b_res->end) if (b_res->start || b_res->end)
dev_info(&bus->self->dev, "disabling bridge window %pR to %pR (unused)\n", pci_info(bus->self, "disabling bridge window %pR to %pR (unused)\n",
b_res, &bus->busn_res); b_res, &bus->busn_res);
b_res->flags = 0; b_res->flags = 0;
return 0; return 0;
...@@ -1103,7 +1101,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, ...@@ -1103,7 +1101,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
b_res->flags |= IORESOURCE_STARTALIGN; b_res->flags |= IORESOURCE_STARTALIGN;
if (size1 > size0 && realloc_head) { if (size1 > size0 && realloc_head) {
add_to_list(realloc_head, bus->self, b_res, size1-size0, add_align); add_to_list(realloc_head, bus->self, b_res, size1-size0, add_align);
dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window %pR to %pR add_size %llx add_align %llx\n", pci_printk(KERN_DEBUG, bus->self, "bridge window %pR to %pR add_size %llx add_align %llx\n",
b_res, &bus->busn_res, b_res, &bus->busn_res,
(unsigned long long) (size1 - size0), (unsigned long long) (size1 - size0),
(unsigned long long) add_align); (unsigned long long) add_align);
...@@ -1407,7 +1405,7 @@ void __pci_bus_assign_resources(const struct pci_bus *bus, ...@@ -1407,7 +1405,7 @@ void __pci_bus_assign_resources(const struct pci_bus *bus,
break; break;
default: default:
dev_info(&dev->dev, "not setting up bridge for bus %04x:%02x\n", pci_info(dev, "not setting up bridge for bus %04x:%02x\n",
pci_domain_nr(b), b->number); pci_domain_nr(b), b->number);
break; break;
} }
...@@ -1513,7 +1511,7 @@ static void __pci_bridge_assign_resources(const struct pci_dev *bridge, ...@@ -1513,7 +1511,7 @@ static void __pci_bridge_assign_resources(const struct pci_dev *bridge,
break; break;
default: default:
dev_info(&bridge->dev, "not setting up bridge for bus %04x:%02x\n", pci_info(bridge, "not setting up bridge for bus %04x:%02x\n",
pci_domain_nr(b), b->number); pci_domain_nr(b), b->number);
break; break;
} }
...@@ -1571,7 +1569,7 @@ static void pci_bridge_release_resources(struct pci_bus *bus, ...@@ -1571,7 +1569,7 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
release_child_resources(r); release_child_resources(r);
if (!release_resource(r)) { if (!release_resource(r)) {
type = old_flags = r->flags & PCI_RES_TYPE_MASK; type = old_flags = r->flags & PCI_RES_TYPE_MASK;
dev_printk(KERN_DEBUG, &dev->dev, "resource %d %pR released\n", pci_printk(KERN_DEBUG, dev, "resource %d %pR released\n",
PCI_BRIDGE_RESOURCES + idx, r); PCI_BRIDGE_RESOURCES + idx, r);
/* keep the old size */ /* keep the old size */
r->end = resource_size(r) - 1; r->end = resource_size(r) - 1;
...@@ -1874,7 +1872,7 @@ static void extend_bridge_window(struct pci_dev *bridge, struct resource *res, ...@@ -1874,7 +1872,7 @@ static void extend_bridge_window(struct pci_dev *bridge, struct resource *res,
return; return;
dev_res->add_size = available - resource_size(res); dev_res->add_size = available - resource_size(res);
dev_dbg(&bridge->dev, "bridge window %pR extended by %pa\n", res, pci_dbg(bridge, "bridge window %pR extended by %pa\n", res,
&dev_res->add_size); &dev_res->add_size);
} }
...@@ -2085,7 +2083,7 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge) ...@@ -2085,7 +2083,7 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
enable_all: enable_all:
retval = pci_reenable_device(bridge); retval = pci_reenable_device(bridge);
if (retval) if (retval)
dev_err(&bridge->dev, "Error reenabling bridge (%d)\n", retval); pci_err(bridge, "Error reenabling bridge (%d)\n", retval);
pci_set_master(bridge); pci_set_master(bridge);
} }
EXPORT_SYMBOL_GPL(pci_assign_unassigned_bridge_resources); EXPORT_SYMBOL_GPL(pci_assign_unassigned_bridge_resources);
...@@ -2119,7 +2117,7 @@ int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long type) ...@@ -2119,7 +2117,7 @@ int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long type)
if (ret) if (ret)
goto cleanup; goto cleanup;
dev_info(&bridge->dev, "BAR %d: releasing %pR\n", pci_info(bridge, "BAR %d: releasing %pR\n",
i, res); i, res);
if (res->parent) if (res->parent)
......
...@@ -25,7 +25,7 @@ void pci_assign_irq(struct pci_dev *dev) ...@@ -25,7 +25,7 @@ void pci_assign_irq(struct pci_dev *dev)
struct pci_host_bridge *hbrg = pci_find_host_bridge(dev->bus); struct pci_host_bridge *hbrg = pci_find_host_bridge(dev->bus);
if (!(hbrg->map_irq)) { if (!(hbrg->map_irq)) {
dev_dbg(&dev->dev, "runtime IRQ mapping not provided by arch\n"); pci_dbg(dev, "runtime IRQ mapping not provided by arch\n");
return; return;
} }
...@@ -55,7 +55,7 @@ void pci_assign_irq(struct pci_dev *dev) ...@@ -55,7 +55,7 @@ void pci_assign_irq(struct pci_dev *dev)
} }
dev->irq = irq; dev->irq = irq;
dev_dbg(&dev->dev, "assign IRQ: got %d\n", dev->irq); pci_dbg(dev, "assign IRQ: got %d\n", dev->irq);
/* Always tell the device, so the driver knows what is /* Always tell the device, so the driver knows what is
the real IRQ to use; the device does not use it. */ the real IRQ to use; the device does not use it. */
......
...@@ -103,7 +103,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno) ...@@ -103,7 +103,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
pci_read_config_dword(dev, reg, &check); pci_read_config_dword(dev, reg, &check);
if ((new ^ check) & mask) { if ((new ^ check) & mask) {
dev_err(&dev->dev, "BAR %d: error updating (%#08x != %#08x)\n", pci_err(dev, "BAR %d: error updating (%#08x != %#08x)\n",
resno, new, check); resno, new, check);
} }
...@@ -112,7 +112,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno) ...@@ -112,7 +112,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)
pci_write_config_dword(dev, reg + 4, new); pci_write_config_dword(dev, reg + 4, new);
pci_read_config_dword(dev, reg + 4, &check); pci_read_config_dword(dev, reg + 4, &check);
if (check != new) { if (check != new) {
dev_err(&dev->dev, "BAR %d: error updating (high %#08x != %#08x)\n", pci_err(dev, "BAR %d: error updating (high %#08x != %#08x)\n",
resno, new, check); resno, new, check);
} }
} }
...@@ -137,7 +137,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) ...@@ -137,7 +137,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
struct resource *root, *conflict; struct resource *root, *conflict;
if (res->flags & IORESOURCE_UNSET) { if (res->flags & IORESOURCE_UNSET) {
dev_info(&dev->dev, "can't claim BAR %d %pR: no address assigned\n", pci_info(dev, "can't claim BAR %d %pR: no address assigned\n",
resource, res); resource, res);
return -EINVAL; return -EINVAL;
} }
...@@ -152,7 +152,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) ...@@ -152,7 +152,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
root = pci_find_parent_resource(dev, res); root = pci_find_parent_resource(dev, res);
if (!root) { if (!root) {
dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", pci_info(dev, "can't claim BAR %d %pR: no compatible bridge window\n",
resource, res); resource, res);
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
return -EINVAL; return -EINVAL;
...@@ -160,7 +160,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) ...@@ -160,7 +160,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
conflict = request_resource_conflict(root, res); conflict = request_resource_conflict(root, res);
if (conflict) { if (conflict) {
dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", pci_info(dev, "can't claim BAR %d %pR: address conflict with %s %pR\n",
resource, res, conflict->name, conflict); resource, res, conflict->name, conflict);
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
return -EBUSY; return -EBUSY;
...@@ -172,7 +172,7 @@ EXPORT_SYMBOL(pci_claim_resource); ...@@ -172,7 +172,7 @@ EXPORT_SYMBOL(pci_claim_resource);
void pci_disable_bridge_window(struct pci_dev *dev) void pci_disable_bridge_window(struct pci_dev *dev)
{ {
dev_info(&dev->dev, "disabling bridge mem windows\n"); pci_info(dev, "disabling bridge mem windows\n");
/* MMIO Base/Limit */ /* MMIO Base/Limit */
pci_write_config_dword(dev, PCI_MEMORY_BASE, 0x0000fff0); pci_write_config_dword(dev, PCI_MEMORY_BASE, 0x0000fff0);
...@@ -221,11 +221,11 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, ...@@ -221,11 +221,11 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
root = &iomem_resource; root = &iomem_resource;
} }
dev_info(&dev->dev, "BAR %d: trying firmware assignment %pR\n", pci_info(dev, "BAR %d: trying firmware assignment %pR\n",
resno, res); resno, res);
conflict = request_resource_conflict(root, res); conflict = request_resource_conflict(root, res);
if (conflict) { if (conflict) {
dev_info(&dev->dev, "BAR %d: %pR conflicts with %s %pR\n", pci_info(dev, "BAR %d: %pR conflicts with %s %pR\n",
resno, res, conflict->name, conflict); resno, res, conflict->name, conflict);
res->start = start; res->start = start;
res->end = end; res->end = end;
...@@ -324,7 +324,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno) ...@@ -324,7 +324,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
align = pci_resource_alignment(dev, res); align = pci_resource_alignment(dev, res);
if (!align) { if (!align) {
dev_info(&dev->dev, "BAR %d: can't assign %pR (bogus alignment)\n", pci_info(dev, "BAR %d: can't assign %pR (bogus alignment)\n",
resno, res); resno, res);
return -EINVAL; return -EINVAL;
} }
...@@ -338,19 +338,18 @@ int pci_assign_resource(struct pci_dev *dev, int resno) ...@@ -338,19 +338,18 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
* working, which is better than just leaving it disabled. * working, which is better than just leaving it disabled.
*/ */
if (ret < 0) { if (ret < 0) {
dev_info(&dev->dev, "BAR %d: no space for %pR\n", resno, res); pci_info(dev, "BAR %d: no space for %pR\n", resno, res);
ret = pci_revert_fw_address(res, dev, resno, size); ret = pci_revert_fw_address(res, dev, resno, size);
} }
if (ret < 0) { if (ret < 0) {
dev_info(&dev->dev, "BAR %d: failed to assign %pR\n", resno, pci_info(dev, "BAR %d: failed to assign %pR\n", resno, res);
res);
return ret; return ret;
} }
res->flags &= ~IORESOURCE_UNSET; res->flags &= ~IORESOURCE_UNSET;
res->flags &= ~IORESOURCE_STARTALIGN; res->flags &= ~IORESOURCE_STARTALIGN;
dev_info(&dev->dev, "BAR %d: assigned %pR\n", resno, res); pci_info(dev, "BAR %d: assigned %pR\n", resno, res);
if (resno < PCI_BRIDGE_RESOURCES) if (resno < PCI_BRIDGE_RESOURCES)
pci_update_resource(dev, resno); pci_update_resource(dev, resno);
...@@ -372,7 +371,7 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz ...@@ -372,7 +371,7 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
flags = res->flags; flags = res->flags;
res->flags |= IORESOURCE_UNSET; res->flags |= IORESOURCE_UNSET;
if (!res->parent) { if (!res->parent) {
dev_info(&dev->dev, "BAR %d: can't reassign an unassigned resource %pR\n", pci_info(dev, "BAR %d: can't reassign an unassigned resource %pR\n",
resno, res); resno, res);
return -EINVAL; return -EINVAL;
} }
...@@ -382,14 +381,14 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz ...@@ -382,14 +381,14 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz
ret = _pci_assign_resource(dev, resno, new_size, min_align); ret = _pci_assign_resource(dev, resno, new_size, min_align);
if (ret) { if (ret) {
res->flags = flags; res->flags = flags;
dev_info(&dev->dev, "BAR %d: %pR (failed to expand by %#llx)\n", pci_info(dev, "BAR %d: %pR (failed to expand by %#llx)\n",
resno, res, (unsigned long long) addsize); resno, res, (unsigned long long) addsize);
return ret; return ret;
} }
res->flags &= ~IORESOURCE_UNSET; res->flags &= ~IORESOURCE_UNSET;
res->flags &= ~IORESOURCE_STARTALIGN; res->flags &= ~IORESOURCE_STARTALIGN;
dev_info(&dev->dev, "BAR %d: reassigned %pR (expanded by %#llx)\n", pci_info(dev, "BAR %d: reassigned %pR (expanded by %#llx)\n",
resno, res, (unsigned long long) addsize); resno, res, (unsigned long long) addsize);
if (resno < PCI_BRIDGE_RESOURCES) if (resno < PCI_BRIDGE_RESOURCES)
pci_update_resource(dev, resno); pci_update_resource(dev, resno);
...@@ -401,7 +400,7 @@ void pci_release_resource(struct pci_dev *dev, int resno) ...@@ -401,7 +400,7 @@ void pci_release_resource(struct pci_dev *dev, int resno)
{ {
struct resource *res = dev->resource + resno; struct resource *res = dev->resource + resno;
dev_info(&dev->dev, "BAR %d: releasing %pR\n", resno, res); pci_info(dev, "BAR %d: releasing %pR\n", resno, res);
release_resource(res); release_resource(res);
res->end = resource_size(res) - 1; res->end = resource_size(res) - 1;
res->start = 0; res->start = 0;
...@@ -477,13 +476,13 @@ int pci_enable_resources(struct pci_dev *dev, int mask) ...@@ -477,13 +476,13 @@ int pci_enable_resources(struct pci_dev *dev, int mask)
continue; continue;
if (r->flags & IORESOURCE_UNSET) { if (r->flags & IORESOURCE_UNSET) {
dev_err(&dev->dev, "can't enable device: BAR %d %pR not assigned\n", pci_err(dev, "can't enable device: BAR %d %pR not assigned\n",
i, r); i, r);
return -EINVAL; return -EINVAL;
} }
if (!r->parent) { if (!r->parent) {
dev_err(&dev->dev, "can't enable device: BAR %d %pR not claimed\n", pci_err(dev, "can't enable device: BAR %d %pR not claimed\n",
i, r); i, r);
return -EINVAL; return -EINVAL;
} }
...@@ -495,8 +494,7 @@ int pci_enable_resources(struct pci_dev *dev, int mask) ...@@ -495,8 +494,7 @@ int pci_enable_resources(struct pci_dev *dev, int mask)
} }
if (cmd != old_cmd) { if (cmd != old_cmd) {
dev_info(&dev->dev, "enabling device (%04x -> %04x)\n", pci_info(dev, "enabling device (%04x -> %04x)\n", old_cmd, cmd);
old_cmd, cmd);
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
} }
return 0; return 0;
......
...@@ -57,7 +57,7 @@ static void pci_vc_load_arb_table(struct pci_dev *dev, int pos) ...@@ -57,7 +57,7 @@ static void pci_vc_load_arb_table(struct pci_dev *dev, int pos)
PCI_VC_PORT_STATUS_TABLE)) PCI_VC_PORT_STATUS_TABLE))
return; return;
dev_err(&dev->dev, "VC arbitration table failed to load\n"); pci_err(dev, "VC arbitration table failed to load\n");
} }
/** /**
...@@ -85,7 +85,7 @@ static void pci_vc_load_port_arb_table(struct pci_dev *dev, int pos, int res) ...@@ -85,7 +85,7 @@ static void pci_vc_load_port_arb_table(struct pci_dev *dev, int pos, int res)
if (pci_wait_for_pending(dev, status_pos, PCI_VC_RES_STATUS_TABLE)) if (pci_wait_for_pending(dev, status_pos, PCI_VC_RES_STATUS_TABLE))
return; return;
dev_err(&dev->dev, "VC%d port arbitration table failed to load\n", res); pci_err(dev, "VC%d port arbitration table failed to load\n", res);
} }
/** /**
...@@ -161,11 +161,11 @@ static void pci_vc_enable(struct pci_dev *dev, int pos, int res) ...@@ -161,11 +161,11 @@ static void pci_vc_enable(struct pci_dev *dev, int pos, int res)
pci_write_config_dword(dev, ctrl_pos, ctrl); pci_write_config_dword(dev, ctrl_pos, ctrl);
if (!pci_wait_for_pending(dev, status_pos, PCI_VC_RES_STATUS_NEGO)) if (!pci_wait_for_pending(dev, status_pos, PCI_VC_RES_STATUS_NEGO))
dev_err(&dev->dev, "VC%d negotiation stuck pending\n", id); pci_err(dev, "VC%d negotiation stuck pending\n", id);
if (link && !pci_wait_for_pending(link, status_pos2, if (link && !pci_wait_for_pending(link, status_pos2,
PCI_VC_RES_STATUS_NEGO)) PCI_VC_RES_STATUS_NEGO))
dev_err(&link->dev, "VC%d negotiation stuck pending\n", id); pci_err(link, "VC%d negotiation stuck pending\n", id);
} }
/** /**
...@@ -195,8 +195,7 @@ static int pci_vc_do_save_buffer(struct pci_dev *dev, int pos, ...@@ -195,8 +195,7 @@ static int pci_vc_do_save_buffer(struct pci_dev *dev, int pos,
/* Sanity check buffer size for save/restore */ /* Sanity check buffer size for save/restore */
if (buf && save_state->cap.size != if (buf && save_state->cap.size !=
pci_vc_do_save_buffer(dev, pos, NULL, save)) { pci_vc_do_save_buffer(dev, pos, NULL, save)) {
dev_err(&dev->dev, pci_err(dev, "VC save buffer size does not match @0x%x\n", pos);
"VC save buffer size does not match @0x%x\n", pos);
return -ENOMEM; return -ENOMEM;
} }
...@@ -366,14 +365,14 @@ int pci_save_vc_state(struct pci_dev *dev) ...@@ -366,14 +365,14 @@ int pci_save_vc_state(struct pci_dev *dev)
save_state = pci_find_saved_ext_cap(dev, vc_caps[i].id); save_state = pci_find_saved_ext_cap(dev, vc_caps[i].id);
if (!save_state) { if (!save_state) {
dev_err(&dev->dev, "%s buffer not found in %s\n", pci_err(dev, "%s buffer not found in %s\n",
vc_caps[i].name, __func__); vc_caps[i].name, __func__);
return -ENOMEM; return -ENOMEM;
} }
ret = pci_vc_do_save_buffer(dev, pos, save_state, true); ret = pci_vc_do_save_buffer(dev, pos, save_state, true);
if (ret) { if (ret) {
dev_err(&dev->dev, "%s save unsuccessful %s\n", pci_err(dev, "%s save unsuccessful %s\n",
vc_caps[i].name, __func__); vc_caps[i].name, __func__);
return ret; return ret;
} }
...@@ -426,8 +425,7 @@ void pci_allocate_vc_save_buffers(struct pci_dev *dev) ...@@ -426,8 +425,7 @@ void pci_allocate_vc_save_buffers(struct pci_dev *dev)
len = pci_vc_do_save_buffer(dev, pos, NULL, false); len = pci_vc_do_save_buffer(dev, pos, NULL, false);
if (pci_add_ext_cap_save_buffer(dev, vc_caps[i].id, len)) if (pci_add_ext_cap_save_buffer(dev, vc_caps[i].id, len))
dev_err(&dev->dev, pci_err(dev, "unable to preallocate %s save buffer\n",
"unable to preallocate %s save buffer\n",
vc_caps[i].name); vc_caps[i].name);
} }
} }
...@@ -261,8 +261,8 @@ static int pci_frontend_enable_msix(struct pci_dev *dev, ...@@ -261,8 +261,8 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,
struct msi_desc *entry; struct msi_desc *entry;
if (nvec > SH_INFO_MAX_VEC) { if (nvec > SH_INFO_MAX_VEC) {
dev_err(&dev->dev, "too much vector for pci frontend: %x." pci_err(dev, "too many vectors (0x%x) for PCI frontend:"
" Increase SH_INFO_MAX_VEC.\n", nvec); " Increase SH_INFO_MAX_VEC\n", nvec);
return -EINVAL; return -EINVAL;
} }
...@@ -281,7 +281,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev, ...@@ -281,7 +281,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,
/* we get the result */ /* we get the result */
for (i = 0; i < nvec; i++) { for (i = 0; i < nvec; i++) {
if (op.msix_entries[i].vector <= 0) { if (op.msix_entries[i].vector <= 0) {
dev_warn(&dev->dev, "MSI-X entry %d is invalid: %d!\n", pci_warn(dev, "MSI-X entry %d is invalid: %d!\n",
i, op.msix_entries[i].vector); i, op.msix_entries[i].vector);
err = -EINVAL; err = -EINVAL;
vector[i] = -1; vector[i] = -1;
...@@ -295,7 +295,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev, ...@@ -295,7 +295,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,
err = op.value; err = op.value;
} }
} else { } else {
dev_err(&dev->dev, "enable msix get err %x\n", err); pci_err(dev, "enable msix get err %x\n", err);
} }
return err; return err;
} }
...@@ -316,7 +316,7 @@ static void pci_frontend_disable_msix(struct pci_dev *dev) ...@@ -316,7 +316,7 @@ static void pci_frontend_disable_msix(struct pci_dev *dev)
/* What should do for error ? */ /* What should do for error ? */
if (err) if (err)
dev_err(&dev->dev, "pci_disable_msix get err %x\n", err); pci_err(dev, "pci_disable_msix get err %x\n", err);
} }
static int pci_frontend_enable_msi(struct pci_dev *dev, int vector[]) static int pci_frontend_enable_msi(struct pci_dev *dev, int vector[])
...@@ -335,13 +335,13 @@ static int pci_frontend_enable_msi(struct pci_dev *dev, int vector[]) ...@@ -335,13 +335,13 @@ static int pci_frontend_enable_msi(struct pci_dev *dev, int vector[])
if (likely(!err)) { if (likely(!err)) {
vector[0] = op.value; vector[0] = op.value;
if (op.value <= 0) { if (op.value <= 0) {
dev_warn(&dev->dev, "MSI entry is invalid: %d!\n", pci_warn(dev, "MSI entry is invalid: %d!\n",
op.value); op.value);
err = -EINVAL; err = -EINVAL;
vector[0] = -1; vector[0] = -1;
} }
} else { } else {
dev_err(&dev->dev, "pci frontend enable msi failed for dev " pci_err(dev, "pci frontend enable msi failed for dev "
"%x:%x\n", op.bus, op.devfn); "%x:%x\n", op.bus, op.devfn);
err = -EINVAL; err = -EINVAL;
} }
...@@ -560,7 +560,7 @@ static void free_root_bus_devs(struct pci_bus *bus) ...@@ -560,7 +560,7 @@ static void free_root_bus_devs(struct pci_bus *bus)
while (!list_empty(&bus->devices)) { while (!list_empty(&bus->devices)) {
dev = container_of(bus->devices.next, struct pci_dev, dev = container_of(bus->devices.next, struct pci_dev,
bus_list); bus_list);
dev_dbg(&dev->dev, "removing device\n"); pci_dbg(dev, "removing device\n");
pci_stop_and_remove_bus_device(dev); pci_stop_and_remove_bus_device(dev);
} }
} }
...@@ -614,8 +614,7 @@ static pci_ers_result_t pcifront_common_process(int cmd, ...@@ -614,8 +614,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
if (pdrv) { if (pdrv) {
if (pdrv->err_handler && pdrv->err_handler->error_detected) { if (pdrv->err_handler && pdrv->err_handler->error_detected) {
dev_dbg(&pcidev->dev, pci_dbg(pcidev, "trying to call AER service\n");
"trying to call AER service\n");
if (pcidev) { if (pcidev) {
flag = 1; flag = 1;
switch (cmd) { switch (cmd) {
......
...@@ -1688,6 +1688,13 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; } ...@@ -1688,6 +1688,13 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
#define dev_is_pf(d) (false) #define dev_is_pf(d) (false)
static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags)
{ return false; } { return false; }
static inline int pci_irqd_intx_xlate(struct irq_domain *d,
struct device_node *node,
const u32 *intspec,
unsigned int intsize,
unsigned long *out_hwirq,
unsigned int *out_type)
{ return -EINVAL; }
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
/* Include architecture-dependent settings and functions */ /* Include architecture-dependent settings and functions */
...@@ -2284,4 +2291,16 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev) ...@@ -2284,4 +2291,16 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev)
/* provide the legacy pci_dma_* API */ /* provide the legacy pci_dma_* API */
#include <linux/pci-dma-compat.h> #include <linux/pci-dma-compat.h>
#define pci_printk(level, pdev, fmt, arg...) \
dev_printk(level, &(pdev)->dev, fmt, ##arg)
#define pci_emerg(pdev, fmt, arg...) dev_emerg(&(pdev)->dev, fmt, ##arg)
#define pci_alert(pdev, fmt, arg...) dev_alert(&(pdev)->dev, fmt, ##arg)
#define pci_crit(pdev, fmt, arg...) dev_crit(&(pdev)->dev, fmt, ##arg)
#define pci_err(pdev, fmt, arg...) dev_err(&(pdev)->dev, fmt, ##arg)
#define pci_warn(pdev, fmt, arg...) dev_warn(&(pdev)->dev, fmt, ##arg)
#define pci_notice(pdev, fmt, arg...) dev_notice(&(pdev)->dev, fmt, ##arg)
#define pci_info(pdev, fmt, arg...) dev_info(&(pdev)->dev, fmt, ##arg)
#define pci_dbg(pdev, fmt, arg...) dev_dbg(&(pdev)->dev, fmt, ##arg)
#endif /* LINUX_PCI_H */ #endif /* LINUX_PCI_H */
...@@ -622,6 +622,7 @@ ...@@ -622,6 +622,7 @@
* safely. * safely.
*/ */
#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ #define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
#define PCI_EXP_DEVCAP2_COMP_TMOUT_DIS 0x00000010 /* Completion Timeout Disable supported */
#define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */ #define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */
#define PCI_EXP_DEVCAP2_ATOMIC_ROUTE 0x00000040 /* Atomic Op routing */ #define PCI_EXP_DEVCAP2_ATOMIC_ROUTE 0x00000040 /* Atomic Op routing */
#define PCI_EXP_DEVCAP2_ATOMIC_COMP32 0x00000080 /* 32b AtomicOp completion */ #define PCI_EXP_DEVCAP2_ATOMIC_COMP32 0x00000080 /* 32b AtomicOp completion */
...@@ -633,6 +634,7 @@ ...@@ -633,6 +634,7 @@
#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */ #define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */
#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ #define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
#define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */ #define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */
#define PCI_EXP_DEVCTL2_COMP_TMOUT_DIS 0x0010 /* Completion Timeout Disable */
#define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */ #define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */
#define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 /* Set Atomic requests */ #define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 /* Set Atomic requests */
#define PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK 0x0080 /* Block atomic egress */ #define PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK 0x0080 /* Block atomic egress */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册