Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'pci/misc'

- Tidy setup-irq.c comments (Pranay Sanghai)

- Fix misspellings (Krzysztof Wilczyński)

- Fix sprintf(), sscanf() format mismatches (Krzysztof Wilczyński)

- Tidy cpqphp code formatting (Krzysztof Wilczyński)

- Remove unused pci_pool wrappers, which have been replaced by dma_pool
(Cai Huoqing)

- Remove a redundant initialization in __pci_reset_function_locked() (Colin
Ian King)

- Use 'unsigned int' instead of 'unsigned' (Krzysztof Wilczyński)

- Update PCI subsystem information in MAINTAINERS (Krzysztof Wilczyński)

- Include generic <linux/> headers instead of <asm/> for cpqphp and vmd
(Krzysztof Wilczyński)

* pci/misc:
PCI: vmd: Drop redundant includes of <asm/device.h>, <asm/msi.h>
PCI: cpqphp: Use <linux/io.h> instead of <asm/io.h>
MAINTAINERS: Update PCI subsystem information
PCI: Prefer 'unsigned int' over bare 'unsigned'
PCI: Remove redundant 'rc' initialization
PCI: Remove unused pci_pool wrappers
PCI: cpqphp: Format if-statement code block correctly
PCI: Use unsigned to match sscanf("%x") in pci_dev_str_match_path()
PCI: hv: Remove unnecessary use of %hx
PCI: Correct misspelled and remove duplicated words
PCI: Tidy comments

+70 -67
+13 -4
MAINTAINERS
··· 14440 14440 R: Krzysztof Wilczyński <kw@linux.com> 14441 14441 L: linux-pci@vger.kernel.org 14442 14442 S: Supported 14443 + Q: https://patchwork.kernel.org/project/linux-pci/list/ 14444 + B: https://bugzilla.kernel.org 14445 + C: irc://irc.oftc.net/linux-pci 14446 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git 14443 14447 F: Documentation/PCI/endpoint/* 14444 14448 F: Documentation/misc-devices/pci-endpoint-test.rst 14445 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/pci-endpoint.git 14446 14449 F: drivers/misc/pci_endpoint_test.c 14447 14450 F: drivers/pci/endpoint/ 14448 14451 F: tools/pci/ ··· 14491 14488 R: Krzysztof Wilczyński <kw@linux.com> 14492 14489 L: linux-pci@vger.kernel.org 14493 14490 S: Supported 14494 - Q: http://patchwork.ozlabs.org/project/linux-pci/list/ 14495 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/ 14491 + Q: https://patchwork.kernel.org/project/linux-pci/list/ 14492 + B: https://bugzilla.kernel.org 14493 + C: irc://irc.oftc.net/linux-pci 14494 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git 14496 14495 F: drivers/pci/controller/ 14496 + F: drivers/pci/pci-bridge-emul.c 14497 + F: drivers/pci/pci-bridge-emul.h 14497 14498 14498 14499 PCI SUBSYSTEM 14499 14500 M: Bjorn Helgaas <bhelgaas@google.com> 14500 14501 L: linux-pci@vger.kernel.org 14501 14502 S: Supported 14502 - Q: http://patchwork.ozlabs.org/project/linux-pci/list/ 14503 + Q: https://patchwork.kernel.org/project/linux-pci/list/ 14504 + B: https://bugzilla.kernel.org 14505 + C: irc://irc.oftc.net/linux-pci 14503 14506 T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git 14504 14507 F: Documentation/PCI/ 14505 14508 F: Documentation/devicetree/bindings/pci/
+2 -2
drivers/pci/controller/pci-hyperv.c
··· 3126 3126 3127 3127 if (dom == HVPCI_DOM_INVALID) { 3128 3128 dev_err(&hdev->device, 3129 - "Unable to use dom# 0x%hx or other numbers", dom_req); 3129 + "Unable to use dom# 0x%x or other numbers", dom_req); 3130 3130 ret = -EINVAL; 3131 3131 goto free_bus; 3132 3132 } 3133 3133 3134 3134 if (dom != dom_req) 3135 3135 dev_info(&hdev->device, 3136 - "PCI dom# 0x%hx has collision, using 0x%hx", 3136 + "PCI dom# 0x%x has collision, using 0x%x", 3137 3137 dom_req, dom); 3138 3138 3139 3139 hbus->bridge->domain_nr = dom;
+2 -2
drivers/pci/controller/pci-thunder-ecam.c
··· 17 17 { 18 18 int shift = (where & 3) * 8; 19 19 20 - pr_debug("set_val %04x: %08x\n", (unsigned)(where & ~3), v); 20 + pr_debug("set_val %04x: %08x\n", (unsigned int)(where & ~3), v); 21 21 v >>= shift; 22 22 if (size == 1) 23 23 v &= 0xff; ··· 187 187 188 188 pr_debug("%04x:%04x - Fix pass#: %08x, where: %03x, devfn: %03x\n", 189 189 vendor_device & 0xffff, vendor_device >> 16, class_rev, 190 - (unsigned) where, devfn); 190 + (unsigned int)where, devfn); 191 191 192 192 /* Check for non type-00 header */ 193 193 if (cfg_type == 0) {
+1 -1
drivers/pci/controller/pci-xgene-msi.c
··· 302 302 303 303 /* 304 304 * MSIINTn (n is 0..F) indicates if there is a pending MSI interrupt 305 - * If bit x of this register is set (x is 0..7), one or more interupts 305 + * If bit x of this register is set (x is 0..7), one or more interrupts 306 306 * corresponding to MSInIRx is set. 307 307 */ 308 308 grp_select = xgene_msi_int_read(xgene_msi, msi_grp);
+1 -1
drivers/pci/controller/pcie-brcmstb.c
··· 145 145 #define BRCM_INT_PCI_MSI_LEGACY_NR 8 146 146 #define BRCM_INT_PCI_MSI_SHIFT 0 147 147 148 - /* MSI target adresses */ 148 + /* MSI target addresses */ 149 149 #define BRCM_MSI_TARGET_ADDR_LT_4GB 0x0fffffffcULL 150 150 #define BRCM_MSI_TARGET_ADDR_GT_4GB 0xffffffffcULL 151 151
+1 -1
drivers/pci/controller/pcie-iproc.c
··· 249 249 250 250 /* 251 251 * To hold the address of the register where the MSI writes are 252 - * programed. When ARM GICv3 ITS is used, this should be programmed 252 + * programmed. When ARM GICv3 ITS is used, this should be programmed 253 253 * with the address of the GITS_TRANSLATER register. 254 254 */ 255 255 IPROC_PCIE_MSI_ADDR_LO,
-2
drivers/pci/controller/vmd.c
··· 18 18 #include <linux/rcupdate.h> 19 19 20 20 #include <asm/irqdomain.h> 21 - #include <asm/device.h> 22 - #include <asm/msi.h> 23 21 24 22 #define VMD_CFGBAR 0 25 23 #define VMD_MEMBAR1 2
+1 -1
drivers/pci/endpoint/pci-epc-core.c
··· 700 700 /** 701 701 * pci_epc_init_notify() - Notify the EPF device that EPC device's core 702 702 * initialization is completed. 703 - * @epc: the EPC device whose core initialization is completeds 703 + * @epc: the EPC device whose core initialization is completed 704 704 * 705 705 * Invoke to Notify the EPF device that the EPC device's initialization 706 706 * is completed.
+2 -2
drivers/pci/endpoint/pci-epf-core.c
··· 224 224 * be removed 225 225 * @epf_vf: the virtual EP function to be removed 226 226 * 227 - * Invoke to remove a virtual endpoint function from the physcial endpoint 227 + * Invoke to remove a virtual endpoint function from the physical endpoint 228 228 * function. 229 229 */ 230 230 void pci_epf_remove_vepf(struct pci_epf *epf_pf, struct pci_epf *epf_vf) ··· 432 432 /** 433 433 * pci_epf_create() - create a new PCI EPF device 434 434 * @name: the name of the PCI EPF device. This name will be used to bind the 435 - * the EPF device to a EPF driver 435 + * EPF device to a EPF driver 436 436 * 437 437 * Invoke to create a new PCI EPF device by providing the name of the function 438 438 * device.
+1 -1
drivers/pci/hotplug/acpiphp_glue.c
··· 22 22 * when the bridge is scanned and it loses a refcount when the bridge 23 23 * is removed. 24 24 * - When a P2P bridge is present, we elevate the refcount on the subordinate 25 - * bus. It loses the refcount when the the driver unloads. 25 + * bus. It loses the refcount when the driver unloads. 26 26 */ 27 27 28 28 #define pr_fmt(fmt) "acpiphp_glue: " fmt
+1 -1
drivers/pci/hotplug/cpqphp.h
··· 15 15 #define _CPQPHP_H 16 16 17 17 #include <linux/interrupt.h> 18 - #include <asm/io.h> /* for read? and write? functions */ 18 + #include <linux/io.h> /* for read? and write? functions */ 19 19 #include <linux/delay.h> /* for delays */ 20 20 #include <linux/mutex.h> 21 21 #include <linux/sched/signal.h> /* for signal_pending() */
+2 -2
drivers/pci/hotplug/cpqphp_ctrl.c
··· 519 519 * @head: list to search 520 520 * @size: size of node to find, must be a power of two. 521 521 * 522 - * Description: This function sorts the resource list by size and then returns 522 + * Description: This function sorts the resource list by size and then 523 523 * returns the first node of "size" length that is not in the ISA aliasing 524 524 * window. If it finds a node larger than "size" it will split it up. 525 525 */ ··· 1202 1202 1203 1203 mdelay(5); 1204 1204 1205 - /* Reenable interrupts */ 1205 + /* Re-enable interrupts */ 1206 1206 writel(0, ctrl->hpc_reg + INT_MASK); 1207 1207 1208 1208 pci_write_config_byte(ctrl->pci_dev, 0x41, reg);
+4 -2
drivers/pci/hotplug/cpqphp_pci.c
··· 189 189 /* This should only be for x86 as it sets the Edge Level 190 190 * Control Register 191 191 */ 192 - outb((u8) (temp_word & 0xFF), 0x4d0); outb((u8) ((temp_word & 193 - 0xFF00) >> 8), 0x4d1); rc = 0; } 192 + outb((u8)(temp_word & 0xFF), 0x4d0); 193 + outb((u8)((temp_word & 0xFF00) >> 8), 0x4d1); 194 + rc = 0; 195 + } 194 196 195 197 return rc; 196 198 }
+2 -2
drivers/pci/hotplug/ibmphp.h
··· 352 352 u32 len; 353 353 int type; /* MEM, IO, PFMEM */ 354 354 u8 fromMem; /* this is to indicate that the range is from 355 - * from the Memory bucket rather than from PFMem */ 355 + * the Memory bucket rather than from PFMem */ 356 356 struct resource_node *next; 357 357 struct resource_node *nextRange; /* for the other mem range on bus */ 358 358 }; ··· 736 736 737 737 int ibmphp_init_devno(struct slot **); /* This function is called from EBDA, so we need it not be static */ 738 738 int ibmphp_do_disable_slot(struct slot *slot_cur); 739 - int ibmphp_update_slot_info(struct slot *); /* This function is called from HPC, so we need it to not be be static */ 739 + int ibmphp_update_slot_info(struct slot *); /* This function is called from HPC, so we need it to not be static */ 740 740 int ibmphp_configure_card(struct pci_func *, u8); 741 741 int ibmphp_unconfigure_card(struct slot **, int); 742 742 extern const struct hotplug_slot_ops ibmphp_hotplug_slot_ops;
+1 -1
drivers/pci/hotplug/shpchp_hpc.c
··· 295 295 mutex_lock(&slot->ctrl->cmd_lock); 296 296 297 297 if (!shpc_poll_ctrl_busy(ctrl)) { 298 - /* After 1 sec and and the controller is still busy */ 298 + /* After 1 sec and the controller is still busy */ 299 299 ctrl_err(ctrl, "Controller is still busy after 1 sec\n"); 300 300 retval = -EBUSY; 301 301 goto out;
+2 -1
drivers/pci/msi.c
··· 579 579 return ret; 580 580 } 581 581 582 - static void __iomem *msix_map_region(struct pci_dev *dev, unsigned nr_entries) 582 + static void __iomem *msix_map_region(struct pci_dev *dev, 583 + unsigned int nr_entries) 583 584 { 584 585 resource_size_t phys_addr; 585 586 u32 table_offset;
+1 -1
drivers/pci/pci-driver.c
··· 570 570 { 571 571 int retval; 572 572 573 - /* if the device was enabled before suspend, reenable */ 573 + /* if the device was enabled before suspend, re-enable */ 574 574 retval = pci_reenable_device(pci_dev); 575 575 /* 576 576 * if the device was busmaster before the suspend, make it busmaster
+5 -4
drivers/pci/pci.c
··· 269 269 const char **endptr) 270 270 { 271 271 int ret; 272 - int seg, bus, slot, func; 272 + unsigned int seg, bus, slot, func; 273 273 char *wpath, *p; 274 274 char end; 275 275 ··· 5324 5324 */ 5325 5325 int __pci_reset_function_locked(struct pci_dev *dev) 5326 5326 { 5327 - int i, m, rc = -ENOTTY; 5327 + int i, m, rc; 5328 5328 5329 5329 might_sleep(); 5330 5330 ··· 6360 6360 * cannot be left as a userspace activity). DMA aliases should therefore 6361 6361 * be configured via quirks, such as the PCI fixup header quirk. 6362 6362 */ 6363 - void pci_add_dma_alias(struct pci_dev *dev, u8 devfn_from, unsigned nr_devfns) 6363 + void pci_add_dma_alias(struct pci_dev *dev, u8 devfn_from, 6364 + unsigned int nr_devfns) 6364 6365 { 6365 6366 int devfn_to; 6366 6367 6367 - nr_devfns = min(nr_devfns, (unsigned) MAX_NR_DEVFNS - devfn_from); 6368 + nr_devfns = min(nr_devfns, (unsigned int)MAX_NR_DEVFNS - devfn_from); 6368 6369 devfn_to = devfn_from + nr_devfns - 1; 6369 6370 6370 6371 if (!dev->dma_alias_mask)
+1 -1
drivers/pci/pcie/aer.c
··· 57 57 * "as seen by this device". Note that this may mean that if an 58 58 * end point is causing problems, the AER counters may increment 59 59 * at its link partner (e.g. root port) because the errors will be 60 - * "seen" by the link partner and not the the problematic end point 60 + * "seen" by the link partner and not the problematic end point 61 61 * itself (which may report all counters as 0 as it never saw any 62 62 * problems). 63 63 */
+4 -3
drivers/pci/probe.c
··· 2585 2585 } 2586 2586 EXPORT_SYMBOL(pci_scan_single_device); 2587 2587 2588 - static unsigned next_fn(struct pci_bus *bus, struct pci_dev *dev, unsigned fn) 2588 + static unsigned int next_fn(struct pci_bus *bus, struct pci_dev *dev, 2589 + unsigned int fn) 2589 2590 { 2590 2591 int pos; 2591 2592 u16 cap = 0; 2592 - unsigned next_fn; 2593 + unsigned int next_fn; 2593 2594 2594 2595 if (pci_ari_enabled(bus)) { 2595 2596 if (!dev) ··· 2649 2648 */ 2650 2649 int pci_scan_slot(struct pci_bus *bus, int devfn) 2651 2650 { 2652 - unsigned fn, nr = 0; 2651 + unsigned int fn, nr = 0; 2653 2652 struct pci_dev *dev; 2654 2653 2655 2654 if (only_one_child(bus) && (devfn > 0))
+7 -7
drivers/pci/quirks.c
··· 501 501 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_868, quirk_s3_64M); 502 502 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_968, quirk_s3_64M); 503 503 504 - static void quirk_io(struct pci_dev *dev, int pos, unsigned size, 504 + static void quirk_io(struct pci_dev *dev, int pos, unsigned int size, 505 505 const char *name) 506 506 { 507 507 u32 region; ··· 552 552 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, quirk_cs5536_vsa); 553 553 554 554 static void quirk_io_region(struct pci_dev *dev, int port, 555 - unsigned size, int nr, const char *name) 555 + unsigned int size, int nr, const char *name) 556 556 { 557 557 u16 region; 558 558 struct pci_bus_region bus_region; ··· 666 666 base = devres & 0xffff; 667 667 size = 16; 668 668 for (;;) { 669 - unsigned bit = size >> 1; 669 + unsigned int bit = size >> 1; 670 670 if ((bit & mask) == bit) 671 671 break; 672 672 size = bit; ··· 692 692 mask = (devres & 0x3f) << 16; 693 693 size = 128 << 16; 694 694 for (;;) { 695 - unsigned bit = size >> 1; 695 + unsigned int bit = size >> 1; 696 696 if ((bit & mask) == bit) 697 697 break; 698 698 size = bit; ··· 806 806 "ICH6 GPIO"); 807 807 } 808 808 809 - static void ich6_lpc_generic_decode(struct pci_dev *dev, unsigned reg, 809 + static void ich6_lpc_generic_decode(struct pci_dev *dev, unsigned int reg, 810 810 const char *name, int dynsize) 811 811 { 812 812 u32 val; ··· 850 850 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, quirk_ich6_lpc); 851 851 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, quirk_ich6_lpc); 852 852 853 - static void ich7_lpc_generic_decode(struct pci_dev *dev, unsigned reg, 853 + static void ich7_lpc_generic_decode(struct pci_dev *dev, unsigned int reg, 854 854 const char *name) 855 855 { 856 856 u32 val; ··· 2700 2700 * then the device can't use INTx interrupts. Tegra's PCIe root ports don't 2701 2701 * generate MSI interrupts for PME and AER events instead only INTx interrupts 2702 2702 * are generated. Though Tegra's PCIe root ports can generate MSI interrupts 2703 - * for other events, since PCIe specificiation doesn't support using a mix of 2703 + * for other events, since PCIe specification doesn't support using a mix of 2704 2704 * INTx and MSI/MSI-X, it is required to disable MSI interrupts to avoid port 2705 2705 * service drivers registering their respective ISRs for MSIs. 2706 2706 */
+1 -1
drivers/pci/rom.c
··· 85 85 { 86 86 void __iomem *image; 87 87 int last_image; 88 - unsigned length; 88 + unsigned int length; 89 89 90 90 image = rom; 91 91 do {
+1 -1
drivers/pci/setup-bus.c
··· 1525 1525 { 1526 1526 struct pci_dev *dev = bus->self; 1527 1527 struct resource *r; 1528 - unsigned old_flags = 0; 1528 + unsigned int old_flags = 0; 1529 1529 struct resource *b_res; 1530 1530 int idx = 1; 1531 1531
+14 -12
drivers/pci/setup-irq.c
··· 8 8 * David Miller (davem@redhat.com) 9 9 */ 10 10 11 - 12 11 #include <linux/kernel.h> 13 12 #include <linux/pci.h> 14 13 #include <linux/errno.h> ··· 27 28 return; 28 29 } 29 30 30 - /* If this device is not on the primary bus, we need to figure out 31 - which interrupt pin it will come in on. We know which slot it 32 - will come in on 'cos that slot is where the bridge is. Each 33 - time the interrupt line passes through a PCI-PCI bridge we must 34 - apply the swizzle function. */ 35 - 31 + /* 32 + * If this device is not on the primary bus, we need to figure out 33 + * which interrupt pin it will come in on. We know which slot it 34 + * will come in on because that slot is where the bridge is. Each 35 + * time the interrupt line passes through a PCI-PCI bridge we must 36 + * apply the swizzle function. 37 + */ 36 38 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); 37 39 /* Cope with illegal. */ 38 40 if (pin > 4) 39 41 pin = 1; 40 42 41 43 if (pin) { 42 - /* Follow the chain of bridges, swizzling as we go. */ 44 + /* Follow the chain of bridges, swizzling as we go. */ 43 45 if (hbrg->swizzle_irq) 44 46 slot = (*(hbrg->swizzle_irq))(dev, &pin); 45 47 46 48 /* 47 - * If a swizzling function is not used map_irq must 48 - * ignore slot 49 + * If a swizzling function is not used, map_irq() must 50 + * ignore slot. 49 51 */ 50 52 irq = (*(hbrg->map_irq))(dev, slot, pin); 51 53 if (irq == -1) ··· 56 56 57 57 pci_dbg(dev, "assign IRQ: got %d\n", dev->irq); 58 58 59 - /* Always tell the device, so the driver knows what is 60 - the real IRQ to use; the device does not use it. */ 59 + /* 60 + * Always tell the device, so the driver knows what is the real IRQ 61 + * to use; the device does not use it. 62 + */ 61 63 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); 62 64 }
-11
include/linux/pci.h
··· 1502 1502 #define PCI_IRQ_ALL_TYPES \ 1503 1503 (PCI_IRQ_LEGACY | PCI_IRQ_MSI | PCI_IRQ_MSIX) 1504 1504 1505 - /* kmem_cache style wrapper around pci_alloc_consistent() */ 1506 - 1507 1505 #include <linux/dmapool.h> 1508 - 1509 - #define pci_pool dma_pool 1510 - #define pci_pool_create(name, pdev, size, align, allocation) \ 1511 - dma_pool_create(name, &pdev->dev, size, align, allocation) 1512 - #define pci_pool_destroy(pool) dma_pool_destroy(pool) 1513 - #define pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle) 1514 - #define pci_pool_zalloc(pool, flags, handle) \ 1515 - dma_pool_zalloc(pool, flags, handle) 1516 - #define pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr) 1517 1506 1518 1507 struct msix_entry { 1519 1508 u32 vector; /* Kernel uses to write allocated vector */