diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2021-09-02 14:56:44 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-09-02 14:56:44 -0500 |
commit | 739c4747a25af3a2571f69e4709f2b476a17d5d4 (patch) | |
tree | 6eb232ecbe51c0d5156804e211b6cd25dd3cbcf0 | |
parent | 74797618e2022dfcd923f1ea8903ba4959f746a4 (diff) | |
parent | 0da14a19493da0f9b4c5ee5930ab05a4c61f5883 (diff) | |
download | lwn-739c4747a25af3a2571f69e4709f2b476a17d5d4.tar.gz lwn-739c4747a25af3a2571f69e4709f2b476a17d5d4.zip |
Merge branch 'pci/misc'
- Add pci_numachip_init() declaration (Krzysztof Wilczyński)
- Allocate pci_dev_str_match_path() string atomically (Dan Carpenter)
- Drop error message when Precision Time Measurement supported but not
enabled (Jakub Kicinski)
- Correct the pci_iomap.h header guard #endif comment (Jonathan Cameron)
- Add schedule point in proc_bus_pci_read() (Krzysztof Wilczyński)
- Make saved capability state private to core (Bjorn Helgaas)
- Sync __pci_register_driver() stub for CONFIG_PCI=n (Andy Shevchenko)
- Convert sta2x11 from PCI-DMA-API to generic DMA-API (Christophe JAILLET)
* pci/misc:
x86/PCI: sta2x11: switch from 'pci_' to 'dma_' API
PCI: Sync __pci_register_driver() stub for CONFIG_PCI=n
PCI: Make saved capability state private to core
PCI: Add schedule point in proc_bus_pci_read()
PCI: Correct the pci_iomap.h header guard #endif comment
PCI/PTM: Remove error message at boot
PCI: Fix pci_dev_str_match_path() alloc while atomic bug
x86/PCI: Add pci_numachip_init() declaration
# Conflicts:
# include/linux/pci.h
-rw-r--r-- | arch/x86/pci/numachip.c | 1 | ||||
-rw-r--r-- | arch/x86/pci/sta2x11-fixup.c | 3 | ||||
-rw-r--r-- | drivers/pci/pci.c | 2 | ||||
-rw-r--r-- | drivers/pci/pci.h | 23 | ||||
-rw-r--r-- | drivers/pci/pcie/ptm.c | 4 | ||||
-rw-r--r-- | drivers/pci/proc.c | 1 | ||||
-rw-r--r-- | include/asm-generic/pci_iomap.h | 2 | ||||
-rw-r--r-- | include/linux/pci.h | 23 |
8 files changed, 30 insertions, 29 deletions
diff --git a/arch/x86/pci/numachip.c b/arch/x86/pci/numachip.c index 01a085d9135a..4f0147d4e225 100644 --- a/arch/x86/pci/numachip.c +++ b/arch/x86/pci/numachip.c @@ -12,6 +12,7 @@ #include <linux/pci.h> #include <asm/pci_x86.h> +#include <asm/numachip/numachip.h> static u8 limit __read_mostly; diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c index 7d2525691854..101081ad64b6 100644 --- a/arch/x86/pci/sta2x11-fixup.c +++ b/arch/x86/pci/sta2x11-fixup.c @@ -146,8 +146,7 @@ static void sta2x11_map_ep(struct pci_dev *pdev) dev_err(dev, "sta2x11: could not set DMA offset\n"); dev->bus_dma_limit = max_amba_addr; - pci_set_consistent_dma_mask(pdev, max_amba_addr); - pci_set_dma_mask(pdev, max_amba_addr); + dma_set_mask_and_coherent(&pdev->dev, max_amba_addr); /* Configure AHB mapping */ pci_write_config_dword(pdev, AHB_PEXLBASE(0), 0); diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index c3f6ff3bd2af..292dadd49d7b 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -275,7 +275,7 @@ static int pci_dev_str_match_path(struct pci_dev *dev, const char *path, *endptr = strchrnul(path, ';'); - wpath = kmemdup_nul(path, *endptr - path, GFP_KERNEL); + wpath = kmemdup_nul(path, *endptr - path, GFP_ATOMIC); if (!wpath) return -ENOMEM; diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 05b7e7e04246..78557d2c6612 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -38,6 +38,27 @@ void pci_init_reset_methods(struct pci_dev *dev); int pci_bridge_secondary_bus_reset(struct pci_dev *dev); int pci_bus_error_reset(struct pci_dev *dev); +struct pci_cap_saved_data { + u16 cap_nr; + bool cap_extended; + unsigned int size; + u32 data[]; +}; + +struct pci_cap_saved_state { + struct hlist_node next; + struct pci_cap_saved_data cap; +}; + +void pci_allocate_cap_save_buffers(struct pci_dev *dev); +void pci_free_cap_save_buffers(struct pci_dev *dev); +int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size); +int pci_add_ext_cap_save_buffer(struct pci_dev *dev, + u16 cap, unsigned int size); +struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap); +struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, + u16 cap); + #define PCI_PM_D2_DELAY 200 /* usec; see PCIe r4.0, sec 5.9.1 */ #define PCI_PM_D3HOT_WAIT 10 /* msec */ #define PCI_PM_D3COLD_WAIT 100 /* msec */ @@ -101,8 +122,6 @@ void pci_pm_init(struct pci_dev *dev); void pci_ea_init(struct pci_dev *dev); void pci_msi_init(struct pci_dev *dev); void pci_msix_init(struct pci_dev *dev); -void pci_allocate_cap_save_buffers(struct pci_dev *dev); -void pci_free_cap_save_buffers(struct pci_dev *dev); bool pci_bridge_d3_possible(struct pci_dev *dev); void pci_bridge_d3_update(struct pci_dev *dev); void pci_bridge_wait_for_secondary_bus(struct pci_dev *dev); diff --git a/drivers/pci/pcie/ptm.c b/drivers/pci/pcie/ptm.c index 95d4eef2c9e8..4810faa67f52 100644 --- a/drivers/pci/pcie/ptm.c +++ b/drivers/pci/pcie/ptm.c @@ -60,10 +60,8 @@ void pci_save_ptm_state(struct pci_dev *dev) return; save_state = pci_find_saved_ext_cap(dev, PCI_EXT_CAP_ID_PTM); - if (!save_state) { - pci_err(dev, "no suspend buffer for PTM\n"); + if (!save_state) return; - } cap = (u16 *)&save_state->cap.data[0]; pci_read_config_word(dev, ptm + PCI_PTM_CTRL, cap); diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c index 9bab07302bbf..535076eff5f6 100644 --- a/drivers/pci/proc.c +++ b/drivers/pci/proc.c @@ -83,6 +83,7 @@ static ssize_t proc_bus_pci_read(struct file *file, char __user *buf, buf += 4; pos += 4; cnt -= 4; + cond_resched(); } if (cnt >= 2) { diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h index d4f16dcc2ed7..df636c6d8e6c 100644 --- a/include/asm-generic/pci_iomap.h +++ b/include/asm-generic/pci_iomap.h @@ -52,4 +52,4 @@ static inline void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar, } #endif -#endif /* __ASM_GENERIC_IO_H */ +#endif /* __ASM_GENERIC_PCI_IOMAP_H */ diff --git a/include/linux/pci.h b/include/linux/pci.h index bd310ea53f3b..0e29a36accb6 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -294,18 +294,6 @@ enum pci_bus_speed { enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev); enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev); -struct pci_cap_saved_data { - u16 cap_nr; - bool cap_extended; - unsigned int size; - u32 data[]; -}; - -struct pci_cap_saved_state { - struct hlist_node next; - struct pci_cap_saved_data cap; -}; - struct pci_vpd { struct mutex lock; unsigned int len; @@ -1293,12 +1281,6 @@ int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state); int pci_load_and_free_saved_state(struct pci_dev *dev, struct pci_saved_state **state); -struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap); -struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, - u16 cap); -int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size); -int pci_add_ext_cap_save_buffer(struct pci_dev *dev, - u16 cap, unsigned int size); int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state); int pci_set_power_state(struct pci_dev *dev, pci_power_t state); pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); @@ -1755,8 +1737,9 @@ static inline void pci_disable_device(struct pci_dev *dev) { } static inline int pcim_enable_device(struct pci_dev *pdev) { return -EIO; } static inline int pci_assign_resource(struct pci_dev *dev, int i) { return -EBUSY; } -static inline int __pci_register_driver(struct pci_driver *drv, - struct module *owner) +static inline int __must_check __pci_register_driver(struct pci_driver *drv, + struct module *owner, + const char *mod_name) { return 0; } static inline int pci_register_driver(struct pci_driver *drv) { return 0; } |