Prepartion for SR-IOV PowerVM Enablement
Subsystems (3)
cover Prepartion for SR-IOV PowerVM Enablement
This patch series is to prepare for enabling SR-IOV on pseries. It separates the calls to be machine dependent and does not change any current functionality.
Bryant G. Ly (3):
powerpc/kernel: Split up pci_bus_add_device
pseries: Override pci_bus_match_virtfn_driver
powerpc/kernel: Separate SR-IOV Calls
arch/powerpc/include/asm/machdep.h | 7 ++++ arch/powerpc/include/asm/pci-bridge.h | 4 +-- arch/powerpc/kernel/eeh_driver.c | 4 +-- arch/powerpc/kernel/pci-common.c | 23 +++++++++++++ arch/powerpc/kernel/pci_dn.c | 6 ---- arch/powerpc/platforms/powernv/eeh-powernv.c | 34 ++++++++++--------- arch/powerpc/platforms/powernv/pci-ioda.c | 6 ++-- arch/powerpc/platforms/pseries/pci.c | 17 ++++++++++ drivers/pci/bus.c | 51 +++++++++++++++++++++++----- drivers/pci/iov.c | 2 +- include/linux/pci.h | 3 ++ 11 files changed, 118 insertions(+), 39 deletions(-)
Signature · 1 line
2.11.0 (Apple Git-81)
PATCH 1/3 powerpc/kernel: Split up pci_bus_add_device
When enabling SR-IOV one might want to have their own version of starting device drivers for the VFs. This patch allows for SR-IOV callers to use pci_bus_add_virtfn_device instead of generic pci_bus_add_device.
When enabling SR-IOV in PSeries architecture the dynamic VFs created within the sriov_configure sysfs call will not load the device driver as firmware will load the device node when the VF device is assigned to the logical partition. So we needed a way to overwrite the way device driver matching is done for virtual functions on powervm.
--- drivers/pci/bus.c | 51 ++++++++++++++++++++++++++++++++++++++++++--------- drivers/pci/iov.c | 2 +- include/linux/pci.h | 3 +++ 3 files changed, 46 insertions(+), 10 deletions(-)
drivers/pci/bus.c +42 -9
@@ -302,16 +302,9 @@ void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { }void __weak pcibios_bus_add_device (struct pci_dev *pdev) { } -/** -* pci_bus_add_device - start driver for a single device -* @dev: device to add -* -* This adds add sysfs entries and start device drivers -*/ -void pci_bus_add_device (struct pci_dev *dev) -{ -int retval; +void pci_bus_add_sysfs_entries (struct pci_dev *dev) +{/* * Can not put in pci_device_add yet because resources * are not assigned yet for some devices.
@@ -321,6 +314,11 @@ void pci_bus_add_device(struct pci_dev *dev)pci_create_sysfs_dev_files (dev);pci_proc_attach_device (dev);pci_bridge_d3_update (dev); +} + +void pci_bus_match_device_driver (struct pci_dev *dev) +{ +int retval; dev->match_driver = true; retval =device_attach (&dev->dev);
@@ -333,6 +331,41 @@ void pci_bus_add_device(struct pci_dev *dev) dev->is_added =1 ; } + +#ifdef CONFIG_PCI_IOV +void __weak pci_bus_match_virtfn_driver (struct pci_dev *dev) +{ +pci_bus_match_device_driver (dev); +} + +/** +* pci_bus_add_virtfn_device - start driver for a virtual function device +* @dev: device to add +* +* This adds add sysfs entries and start device drivers for +* virtual function devices +* +*/ +void pci_bus_add_virtfn_device (struct pci_dev *pdev) +{ +pci_bus_add_sysfs_entries (pdev); +pci_bus_match_virtfn_driver (pdev); +} +EXPORT_SYMBOL_GPL (pci_bus_add_virtfn_device); +#endif + +/** +* pci_bus_add_device - start driver for a single device +* @dev: device to add +* +* This adds add sysfs entries and start device drivers +*/ +void pci_bus_add_device (struct pci_dev *dev) +{ +pci_bus_add_sysfs_entries (dev); +pci_bus_match_device_driver (dev); +} +EXPORT_SYMBOL_GPL (pci_bus_add_device);/**
drivers/pci/iov.c +1 -1
@@ -162,7 +162,7 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)pci_device_add (virtfn, virtfn->bus); -pci_bus_add_device (virtfn); +pci_bus_add_virtfn_device (virtfn);sprintf (buf,"virtfn%u" , id); rc =sysfs_create_link (&dev->dev.kobj, &virtfn->dev.kobj, buf);if (rc)
include/linux/pci.h +3 -0
@@ -911,6 +911,9 @@ struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);void pci_device_add (struct pci_dev *dev,struct pci_bus *bus);unsigned int pci_scan_child_bus (struct pci_bus *bus);void pci_bus_add_device (struct pci_dev *dev); +#ifdef CONFIG_PCI_IOV +void pci_bus_add_virtfn_device (struct pci_dev *dev); +#endif void pci_read_bridge_bases (struct pci_bus *child);struct resource *pci_find_parent_resource (const struct pci_dev *dev,struct resource *res);
Signature · 1 line
2.11.0 (Apple Git-81)
PATCH 2/3 pseries: Override pci_bus_match_virtfn_driver
In reply to Bryant G. LyFor Powervm SR-IOV (Pseries) enablement we dont want to match the virtual function's device drivers since firmware plans to load the device node in the device tree dynamically when Novalink assigns the VF to a partition.
--- arch/powerpc/platforms/pseries/pci.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/powerpc/platforms/pseries/pci.c +17 -0
@@ -58,6 +58,23 @@ void pcibios_name_device(struct pci_dev *dev)DECLARE_PCI_FIXUP_HEADER (PCI_ANY_ID ,PCI_ANY_ID , pcibios_name_device);#endif +#ifdef CONFIG_PCI_IOV +void pci_bus_match_virtfn_driver (struct pci_dev *dev) +{ +/* +* Per PSeries SR-IOV requirement there is no need to +* match virtual function device driver as firmware +* will load the device node in the device tree dynamically. +* Since there is no matching of device driver there is +* no failure when attaching driver, therefore there is no +* need to remove sysfs file. Furthermore, the VF platform +* management still needs to exist in sysfs files to be used +* by management. +*/ + dev->is_added =1 ; +} +#endif +static void __init pSeries_request_regions (void ) {if (!isa_io_base)
Signature · 1 line
2.11.0 (Apple Git-81)
PATCH 3/3 powerpc/kernel: Separate SR-IOV Calls
In reply to Bryant G. LySR-IOV can now be enabled in PowerNV platforms and Pseries platforms. Therefore, the appropriate calls were moved to machine dependent code instead of definition at compile time.
--- arch/powerpc/include/asm/machdep.h | 7 ++++++ arch/powerpc/include/asm/pci-bridge.h | 4 +--- arch/powerpc/kernel/eeh_driver.c | 4 ++-- arch/powerpc/kernel/pci-common.c | 23 +++++++++++++++++++ arch/powerpc/kernel/pci_dn.c | 6 ----- arch/powerpc/platforms/powernv/eeh-powernv.c | 34 +++++++++++++++------------- arch/powerpc/platforms/powernv/pci-ioda.c | 6 +++-- 7 files changed, 55 insertions(+), 29 deletions(-)
arch/powerpc/include/asm/machdep.h +7 -0
@@ -172,11 +172,18 @@ struct machdep_calls {/* Called after scan and before resource survey */ void (*pcibios_fixup_phb)(struct pci_controller *hose); +/* Called after device has been added to bus and +* before sysfs has been created +*/ +void (*pcibios_bus_add_device)(struct pci_dev *pdev); +resource_size_t (*pcibios_default_alignment)(void);#ifdef CONFIG_PCI_IOV void (*pcibios_fixup_sriov)(struct pci_dev *pdev);resource_size_t (*pcibios_iov_resource_alignment)(struct pci_dev *,int resno); +int (*pcibios_sriov_enable)(struct pci_dev *pdev,u16 num_vfs); +int (*pcibios_sriov_disable)(struct pci_dev *pdev);#endif /* CONFIG_PCI_IOV */ /* Called to shutdown machine specific hardware not already controlled
arch/powerpc/include/asm/pci-bridge.h +1 -3
@@ -203,10 +203,9 @@ struct pci_dn {struct eeh_dev *edev;/* eeh device */ #endif #define IODA_INVALID_PE 0xFFFFFFFF -#ifdef CONFIG_PPC_POWERNV unsigned int pe_number; -int vf_index;/* VF index in the PF */ #ifdef CONFIG_PCI_IOV +int vf_index;/* VF index in the PF */ u16 vfs_expanded;/* number of VFs IOV BAR expanded */ u16 num_vfs;/* number of VFs enabled*/ unsigned int *pe_num_map;/* PE# for the first VF PE or array */
@@ -215,7 +214,6 @@ struct pci_dn {int (*m64_map)[PCI_SRIOV_NUM_BARS ];#endif /* CONFIG_PCI_IOV */ int mps;/* Maximum Payload Size */ -#endif struct list_head child_list;struct list_head list; };
arch/powerpc/kernel/eeh_driver.c +2 -2
@@ -440,7 +440,7 @@ static void *eeh_add_virt_device(void *data, void *userdata)return NULL ; } -#ifdef CONFIG_PPC_POWERNV +#ifdef CONFIG_PCI_IOV pci_iov_add_virtfn (edev->physfn, pdn->vf_index,0 );#endif return NULL ;
@@ -496,7 +496,7 @@ static void *eeh_rmv_device(void *data, void *userdata) (*removed)++;if (edev->physfn) { -#ifdef CONFIG_PPC_POWERNV +#ifdef CONFIG_PCI_IOV struct pci_dn *pdn =eeh_dev_to_pdn (edev);pci_iov_remove_virtfn (edev->physfn, pdn->vf_index,0 );
arch/powerpc/kernel/pci-common.c +23 -0
@@ -249,8 +249,31 @@ resource_size_t pcibios_iov_resource_alignment(struct pci_dev *pdev, int resno) return pci_iov_resource_size(pdev, resno); } + +int pcibios_sriov_enable (struct pci_dev *pdev,u16 num_vfs) +{ +if (ppc_md.pcibios_sriov_enable) +return ppc_md.pcibios_sriov_enable (pdev, num_vfs); + +return 0 ; +} + +int pcibios_sriov_disable (struct pci_dev *pdev) +{ +if (ppc_md.pcibios_sriov_disable) +return ppc_md.pcibios_sriov_disable (pdev); + +return 0 ; +} +#endif /* CONFIG_PCI_IOV */ +void pcibios_bus_add_device (struct pci_dev *pdev) +{ +if (ppc_md.pcibios_bus_add_device) + ppc_md.pcibios_bus_add_device (pdev); +} +static resource_size_t pcibios_io_size (const struct pci_controller *hose) {#ifdef CONFIG_PPC64
arch/powerpc/kernel/pci_dn.c +0 -6
@@ -156,10 +156,8 @@ static struct pci_dn *add_one_dev_pci_data(struct pci_dn *parent, pdn->parent = parent; pdn->busno = busno; pdn->devfn = devfn; -#ifdef CONFIG_PPC_POWERNV pdn->vf_index = vf_index; pdn->pe_number =IODA_INVALID_PE ; -#endif INIT_LIST_HEAD (&pdn->child_list);INIT_LIST_HEAD (&pdn->list);list_add_tail (&pdn->list, &parent->child_list);
@@ -226,9 +224,7 @@ void remove_dev_pci_data(struct pci_dev *pdev)*/ if (pdev->is_virtfn) { pdn =pci_get_pdn (pdev); -#ifdef CONFIG_PPC_POWERNV pdn->pe_number =IODA_INVALID_PE ; -#endif return ; }
@@ -294,9 +290,7 @@ struct pci_dn *pci_add_device_node_info(struct pci_controller *hose,return NULL ; dn->data = pdn; pdn->phb = hose; -#ifdef CONFIG_PPC_POWERNV pdn->pe_number =IODA_INVALID_PE ; -#endif regs =of_get_property (dn,"reg" ,NULL );if (regs) {u32 addr =of_read_number (regs,1 );
arch/powerpc/platforms/powernv/eeh-powernv.c +18 -16
@@ -44,6 +44,22 @@static bool pnv_eeh_nb_init = false;static int eeh_event_irq = -EINVAL ; +void pnv_pcibios_bus_add_device (struct pci_dev *pdev) +{ +struct pci_dn *pdn =pci_get_pdn (pdev); + +if (!pdev->is_virtfn) +return ; + +/* +* The following operations will fail if VF's sysfs files +* aren't created or its resources aren't finalized. +*/ +eeh_add_device_early (pdn); +eeh_add_device_late (pdev); +eeh_sysfs_add_device (pdev); +} +static int pnv_eeh_init (void ) {struct pci_controller *hose;
@@ -88,6 +104,8 @@ static int pnv_eeh_init(void)eeh_set_pe_aux_size (max_diag_size); + ppc_md.pcibios_bus_add_device = pnv_pcibios_bus_add_device; +return 0 ; }
@@ -1747,22 +1765,6 @@ static struct eeh_ops pnv_eeh_ops = { .restore_config = pnv_eeh_restore_config }; -void pcibios_bus_add_device (struct pci_dev *pdev) -{ -struct pci_dn *pdn =pci_get_pdn (pdev); - -if (!pdev->is_virtfn) -return ; - -/* -* The following operations will fail if VF's sysfs files -* aren't created or its resources aren't finalized. -*/ -eeh_add_device_early (pdn); -eeh_add_device_late (pdev); -eeh_sysfs_add_device (pdev); -} -#ifdef CONFIG_PCI_IOV static void pnv_pci_fixup_vf_mps (struct pci_dev *pdev) {
arch/powerpc/platforms/powernv/pci-ioda.c +4 -2
@@ -1674,7 +1674,7 @@ int pnv_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs)return ret; } -int pcibios_sriov_disable (struct pci_dev *pdev) +int pnv_pcibios_sriov_disable (struct pci_dev *pdev) {pnv_pci_sriov_disable (pdev);
@@ -1683,7 +1683,7 @@ int pcibios_sriov_disable(struct pci_dev *pdev)return 0 ; } -int pcibios_sriov_enable (struct pci_dev *pdev,u16 num_vfs) +int pnv_pcibios_sriov_enable (struct pci_dev *pdev,u16 num_vfs) {/* Allocate PCI data */ add_dev_pci_data (pdev);
@@ -4002,6 +4002,8 @@ static void __init pnv_pci_init_ioda_phb(struct device_node *np,#ifdef CONFIG_PCI_IOV ppc_md.pcibios_fixup_sriov = pnv_pci_ioda_fixup_iov_resources; ppc_md.pcibios_iov_resource_alignment = pnv_pci_iov_resource_alignment; + ppc_md.pcibios_sriov_enable = pnv_pcibios_sriov_enable; + ppc_md.pcibios_sriov_disable = pnv_pcibios_sriov_disable;#endif pci_add_flags (PCI_REASSIGN_ALL_RSRC );
Signature · 1 line
2.11.0 (Apple Git-81)
kbuild test robot
build botRe: [PATCH v1 1/3] powerpc/kernel: Split up pci_bus_add_device
In reply to Bryant G. LyAll warnings (new ones prefixed by >>):
Hi Bryant,
[auto build test WARNING on powerpc/next]
[also build test WARNING on v4.14-rc1 next-20170919]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Bryant-G-Ly/Prepartion-for-SR-IOV-PowerVM-Enablement/20170920-114754 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next reproduce: make htmldocs
All warnings (new ones prefixed by >>):
WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org)
include/linux/init.h:1: warning: no structured comments found
include/linux/mod_devicetable.h:687: warning: Excess struct/union/enum/typedef member 'ver_major' description in 'fsl_mc_device_id' include/linux/mod_devicetable.h:687: warning: Excess struct/union/enum/typedef member 'ver_minor' description in 'fsl_mc_device_id' kernel/sched/core.c:2080: warning: No description found for parameter 'rf'
kernel/sched/core.c:2080: warning: Excess function parameter 'cookie' description in 'try_to_wake_up_local' include/linux/wait.h:555: warning: No description found for parameter 'wq'
include/linux/wait.h:555: warning: Excess function parameter 'wq_head' description in 'wait_event_interruptible_hrtimeout' include/linux/wait.h:759: warning: No description found for parameter 'wq_head'
include/linux/wait.h:759: warning: Excess function parameter 'wq' description in 'wait_event_killable' include/linux/kthread.h:26: warning: Excess function parameter '...' description in 'kthread_create' kernel/sys.c:1: warning: no structured comments found
include/linux/device.h:968: warning: No description found for parameter 'dma_ops' drivers/dma-buf/seqno-fence.c:1: warning: no structured comments found
include/linux/iio/iio.h:603: warning: No description found for parameter 'trig_readonly' include/linux/iio/trigger.h:151: warning: No description found for parameter 'indio_dev' include/linux/iio/trigger.h:151: warning: No description found for parameter 'trig' include/linux/device.h:969: warning: No description found for parameter 'dma_ops' drivers/ata/libata-eh.c:1449: warning: No description found for parameter 'link' drivers/ata/libata-eh.c:1449: warning: Excess function parameter 'ap' description in 'ata_eh_done' drivers/ata/libata-eh.c:1590: warning: No description found for parameter 'qc'
drivers/ata/libata-eh.c:1590: warning: Excess function parameter 'dev' description in 'ata_eh_request_sense' drivers/mtd/nand/nand_base.c:2751: warning: Excess function parameter 'cached' description in 'nand_write_page' drivers/mtd/nand/nand_base.c:2751: warning: Excess function parameter 'cached' description in 'nand_write_page'
>> drivers/pci/bus.c:351: warning: No description found for parameter 'pdev' >> drivers/pci/bus.c:351: warning: Excess function parameter 'dev' description in 'pci_bus_add_virtfn_device'
arch/s390/include/asm/cmb.h:1: warning: no structured comments found drivers/scsi/scsi_lib.c:1116: warning: No description found for parameter 'rq' drivers/scsi/constants.c:1: warning: no structured comments found include/linux/usb/gadget.h:230: warning: No description found for parameter 'claimed' include/linux/usb/gadget.h:230: warning: No description found for parameter 'enabled' include/linux/usb/gadget.h:412: warning: No description found for parameter 'quirk_altset_not_supp' include/linux/usb/gadget.h:412: warning: No description found for parameter 'quirk_stall_not_supp' include/linux/usb/gadget.h:412: warning: No description found for parameter 'quirk_zlp_not_supp' fs/inode.c:1666: warning: No description found for parameter 'rcu'
include/linux/jbd2.h:443: warning: No description found for parameter 'i_transaction' include/linux/jbd2.h:443: warning: No description found for parameter 'i_next_transaction' include/linux/jbd2.h:443: warning: No description found for parameter 'i_list' include/linux/jbd2.h:443: warning: No description found for parameter 'i_vfs_inode' include/linux/jbd2.h:443: warning: No description found for parameter 'i_flags' include/linux/jbd2.h:497: warning: No description found for parameter 'h_rsv_handle' include/linux/jbd2.h:497: warning: No description found for parameter 'h_reserved' include/linux/jbd2.h:497: warning: No description found for parameter 'h_type' include/linux/jbd2.h:497: warning: No description found for parameter 'h_line_no' include/linux/jbd2.h:497: warning: No description found for parameter 'h_start_jiffies' include/linux/jbd2.h:497: warning: No description found for parameter 'h_requested_credits' include/linux/jbd2.h:497: warning: No description found for parameter 'saved_alloc_context' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_chkpt_bhs' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_devname' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_average_commit_time' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_min_batch_time' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_max_batch_time' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_commit_callback' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_failed_commit' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_chksum_driver' include/linux/jbd2.h:1050: warning: No description found for parameter 'j_csum_seed' fs/jbd2/transaction.c:511: warning: No description found for parameter 'type' fs/jbd2/transaction.c:511: warning: No description found for parameter 'line_no' fs/jbd2/transaction.c:641: warning: No description found for parameter 'gfp_mask' include/drm/drm_drv.h:537: warning: No description found for parameter 'set_busid' include/drm/drm_drv.h:537: warning: No description found for parameter 'debugfs_init' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_open_object' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_close_object' include/drm/drm_drv.h:537: warning: No description found for parameter 'prime_handle_to_fd' include/drm/drm_drv.h:537: warning: No description found for parameter 'prime_fd_to_handle' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_export' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_import' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_pin' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_unpin' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_res_obj' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_get_sg_table' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_import_sg_table' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_vmap' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_vunmap' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_prime_mmap' include/drm/drm_drv.h:537: warning: No description found for parameter 'gem_vm_ops' include/drm/drm_drv.h:537: warning: No description found for parameter 'major' include/drm/drm_drv.h:537: warning: No description found for parameter 'minor' include/drm/drm_drv.h:537: warning: No description found for parameter 'patchlevel' include/drm/drm_drv.h:537: warning: No description found for parameter 'name' include/drm/drm_drv.h:537: warning: No description found for parameter 'desc' include/drm/drm_drv.h:537: warning: No description found for parameter 'date' include/drm/drm_drv.h:537: warning: No description found for parameter 'driver_features' include/drm/drm_drv.h:537: warning: No description found for parameter 'ioctls' include/drm/drm_drv.h:537: warning: No description found for parameter 'num_ioctls' include/drm/drm_drv.h:537: warning: No description found for parameter 'fops' include/drm/drm_color_mgmt.h:1: warning: no structured comments found drivers/gpu/drm/drm_syncobj.c:341: warning: Excess function parameter 'dev' description in 'drm_syncobj_open' drivers/gpu/drm/drm_syncobj.c:366: warning: Excess function parameter 'dev' description in 'drm_syncobj_release' include/drm/drm_syncobj.h:1: warning: no structured comments found drivers/gpu/drm/drm_syncobj.c:342: warning: Excess function parameter 'dev' description in 'drm_syncobj_open' drivers/gpu/drm/drm_syncobj.c:367: warning: Excess function parameter 'dev' description in 'drm_syncobj_release' drivers/gpu/host1x/bus.c:50: warning: Excess function parameter 'driver' description in 'host1x_subdev_add' Documentation/doc-guide/sphinx.rst:121: ERROR: Unknown target name: "sphinx c domain". kernel/sched/fair.c:7584: WARNING: Inline emphasis start-string without end-string. kernel/time/timer.c:1200: ERROR: Unexpected indentation.
kernel/time/timer.c:1202: ERROR: Unexpected indentation.
kernel/time/timer.c:1203: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/wait.h:108: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/wait.h:111: ERROR: Unexpected indentation.
include/linux/wait.h:113: WARNING: Block quote ends without a blank line; unexpected unindent. kernel/time/hrtimer.c:991: WARNING: Block quote ends without a blank line; unexpected unindent. kernel/signal.c:323: WARNING: Inline literal start-string without end-string. kernel/rcu/tree.c:3187: ERROR: Unexpected indentation.
kernel/rcu/tree.c:3214: ERROR: Unexpected indentation.
kernel/rcu/tree.c:3215: WARNING: Bullet list ends without a blank line; unexpected unindent. include/linux/iio/iio.h:219: ERROR: Unexpected indentation.
include/linux/iio/iio.h:220: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/iio/iio.h:226: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/iio/industrialio-core.c:633: ERROR: Unknown target name: "iio_val". drivers/iio/industrialio-core.c:640: ERROR: Unknown target name: "iio_val". drivers/ata/libata-core.c:5906: ERROR: Unknown target name: "hw". drivers/message/fusion/mptbase.c:5051: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/tty/serial/serial_core.c:1897: WARNING: Definition list ends without a blank line; unexpected unindent. drivers/pci/pci.c:3470: ERROR: Unexpected indentation.
include/linux/regulator/driver.h:271: ERROR: Unknown target name: "regulator_regmap_x_voltage". include/linux/spi/spi.h:373: ERROR: Unexpected indentation.
drivers/w1/w1_io.c:196: WARNING: Definition list ends without a blank line; unexpected unindent. block/bio.c:404: ERROR: Unknown target name: "gfp".
drivers/gpu/drm/drm_scdc_helper.c:203: ERROR: Unexpected indentation. drivers/gpu/drm/drm_scdc_helper.c:204: WARNING: Block quote ends without a blank line; unexpected unindent. drivers/gpu/drm/drm_ioctl.c:702: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/gpu/todo.rst:111: ERROR: Unknown target name: "drm_fb". sound/soc/soc-core.c:2703: ERROR: Unknown target name: "snd_soc_daifmt". sound/core/jack.c:312: ERROR: Unknown target name: "snd_jack_btn". Documentation/media/v4l-drivers/imx.rst:: WARNING: document isn't included in any toctree
vim +/pdev +351 drivers/pci/bus.c
340
341 /**
342 * pci_bus_add_virtfn_device - start driver for a virtual function device
343 * @dev: device to add
344 *
345 * This adds add sysfs entries and start device drivers for
346 * virtual function devices
347 *
348 */
349 void pci_bus_add_virtfn_device(struct pci_dev *pdev)
350 {
> 351 pci_bus_add_sysfs_entries(pdev);
352 pci_bus_match_virtfn_driver(pdev);
353 }
354 EXPORT_SYMBOL_GPL(pci_bus_add_virtfn_device);
355 #endif
356
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH v1 1/3] powerpc/kernel: Split up pci_bus_add_device
In reply to Bryant G. LyQuoted 72 lines · Bryant G. Ly
When enabling SR-IOV one might want to have their own version of starting device drivers for the VFs. This patch allows for SR-IOV callers to use
pci_bus_add_virtfn_deviceinstead of genericpci_bus_add_device.When enabling SR-IOV in PSeries architecture the dynamic VFs created within the
sriov_configuresysfs call will not load the device driver as firmware will load the device node when the VF device is assigned to the logical partition. So we needed a way to overwrite the way device driver matching is done for virtual functions on powervm.Signed-off-by Bryant G. Ly <[email protected]>Signed-off-by Juan J. Alvarez <[email protected]>--- drivers/pci/bus.c | 51 ++++++++++++++++++++++++++++++++++++++++++--------- drivers/pci/iov.c | 2 +- include/linux/pci.h | 3 +++ 3 files changed, 46 insertions(+), 10 deletions(-)drivers/pci/bus.c +18
-9@@ -302,16 +302,9 @@ void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { }void __weak pcibios_bus_add_device (struct pci_dev *pdev) { } -/** -* pci_bus_add_device - start driver for a single device -* @dev: device to add -* -* This adds add sysfs entries and start device drivers -*/ -void pci_bus_add_device (struct pci_dev *dev) -{ -int retval; +void pci_bus_add_sysfs_entries (struct pci_dev *dev) +{/* * Can not put in pci_device_add yet because resources * are not assigned yet for some devices. @@ -321,6 +314,11 @@ void pci_bus_add_device(struct pci_dev *dev)pci_create_sysfs_dev_files (dev);pci_proc_attach_device (dev);pci_bridge_d3_update (dev); +} + +void pci_bus_match_device_driver (struct pci_dev *dev) +{ +int retval; dev->match_driver = true; retval =device_attach (&dev->dev);@@ -333,6 +331,41 @@ void pci_bus_add_device(struct pci_dev *dev) dev->is_added =1 ; } + +#ifdef CONFIG_PCI_IOV +void __weak pci_bus_match_virtfn_driver (struct pci_dev *dev) +{ +pci_bus_match_device_driver (dev); +} + +/** +* pci_bus_add_virtfn_device - start driver for a virtual function device +* @dev: device to add +*
drivers/pci/bus.c void pci_bus_add_device(struct pci_dev *dev) · line 354
Quoted 10 lines
drivers/pci/bus.c +10
-0+* This adds add sysfs entries and start device drivers for +* virtual function devices +* +*/ +void pci_bus_add_virtfn_device (struct pci_dev *pdev) +{ +pci_bus_add_sysfs_entries (pdev); +pci_bus_match_virtfn_driver (pdev); +} +EXPORT_SYMBOL_GPL (pci_bus_add_virtfn_device);
Is there any way we can avoid adding this new interface? I don't really want a new global exported symbol just to support this highly platform-specific functionality.
If we could figure out a way to set dev->match_driver to false instead of true in pci_bus_add_device(), it *looks* like that would be enough to accomplish what you need. Maybe that could be done via a pcibios hook or a new function pointer in struct pci_host_bridge, similar to the swizzle_irq pointer?
Quoted 47 lines
drivers/pci/bus.c +14
-0+#endif + +/** +* pci_bus_add_device - start driver for a single device +* @dev: device to add +* +* This adds add sysfs entries and start device drivers +*/ +void pci_bus_add_device (struct pci_dev *dev) +{ +pci_bus_add_sysfs_entries (dev); +pci_bus_match_device_driver (dev); +} +EXPORT_SYMBOL_GPL (pci_bus_add_device);/** drivers/pci/iov.c +1
-1@@ -162,7 +162,7 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)pci_device_add (virtfn, virtfn->bus); -pci_bus_add_device (virtfn); +pci_bus_add_virtfn_device (virtfn);sprintf (buf,"virtfn%u" , id); rc =sysfs_create_link (&dev->dev.kobj, &virtfn->dev.kobj, buf);if (rc)include/linux/pci.h +3
-0@@ -911,6 +911,9 @@ struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);void pci_device_add (struct pci_dev *dev,struct pci_bus *bus);unsigned int pci_scan_child_bus (struct pci_bus *bus);void pci_bus_add_device (struct pci_dev *dev); +#ifdef CONFIG_PCI_IOV +void pci_bus_add_virtfn_device (struct pci_dev *dev); +#endif void pci_read_bridge_bases (struct pci_bus *child);struct resource *pci_find_parent_resource (const struct pci_dev *dev,struct resource *res);Signature · 1 line
2.11.0 (Apple Git-81)
Re: [PATCH v1 1/3] powerpc/kernel: Split up pci_bus_add_device
Quoted 87 lines · Bjorn Helgaas
Quoted 72 lines · Bryant G. Ly
When enabling SR-IOV one might want to have their own version of starting device drivers for the VFs. This patch allows for SR-IOV callers to use
pci_bus_add_virtfn_deviceinstead of genericpci_bus_add_device.When enabling SR-IOV in PSeries architecture the dynamic VFs created within the
sriov_configuresysfs call will not load the device driver as firmware will load the device node when the VF device is assigned to the logical partition. So we needed a way to overwrite the way device driver matching is done for virtual functions on powervm.Signed-off-by Bryant G. Ly <[email protected]>Signed-off-by Juan J. Alvarez <[email protected]>--- drivers/pci/bus.c | 51 ++++++++++++++++++++++++++++++++++++++++++--------- drivers/pci/iov.c | 2 +- include/linux/pci.h | 3 +++ 3 files changed, 46 insertions(+), 10 deletions(-)drivers/pci/bus.c +18
-9@@ -302,16 +302,9 @@ void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { }void __weak pcibios_bus_add_device (struct pci_dev *pdev) { } -/** -* pci_bus_add_device - start driver for a single device -* @dev: device to add -* -* This adds add sysfs entries and start device drivers -*/ -void pci_bus_add_device (struct pci_dev *dev) -{ -int retval; +void pci_bus_add_sysfs_entries (struct pci_dev *dev) +{/* * Can not put in pci_device_add yet because resources * are not assigned yet for some devices. @@ -321,6 +314,11 @@ void pci_bus_add_device(struct pci_dev *dev)pci_create_sysfs_dev_files (dev);pci_proc_attach_device (dev);pci_bridge_d3_update (dev); +} + +void pci_bus_match_device_driver (struct pci_dev *dev) +{ +int retval; dev->match_driver = true; retval =device_attach (&dev->dev);@@ -333,6 +331,41 @@ void pci_bus_add_device(struct pci_dev *dev) dev->is_added =1 ; } + +#ifdef CONFIG_PCI_IOV +void __weak pci_bus_match_virtfn_driver (struct pci_dev *dev) +{ +pci_bus_match_device_driver (dev); +} + +/** +* pci_bus_add_virtfn_device - start driver for a virtual function device +* @dev: device to add +* drivers/pci/bus.c void pci_bus_add_device(struct pci_dev *dev) · line 354
Quoted 10 lines
drivers/pci/bus.c +10
-0+* This adds add sysfs entries and start device drivers for +* virtual function devices +* +*/ +void pci_bus_add_virtfn_device (struct pci_dev *pdev) +{ +pci_bus_add_sysfs_entries (pdev); +pci_bus_match_virtfn_driver (pdev); +} +EXPORT_SYMBOL_GPL (pci_bus_add_virtfn_device);Is there any way we can avoid adding this new interface? I don't really want a new global exported symbol just to support this highly platform-specific functionality.
Quoted 5 lines
If we could figure out a way to set
dev->match_driverto false instead of true inpci_bus_add_device(), it *looks* like that would be enough to accomplish what you need. Maybe that could be done via a pcibios hook or a new function pointer in structpci_host_bridge, similar to theswizzle_irqpointer?
Yes! I will remove the first two patches in the series and only utilize the third
patch but addingpdev->match_driver = -1; under pseries_pcibios_bus_add_device, which is a new function I added for machine dependent bus add of a device. The patch will then require https://patchwork.kernel.org/patch/9882915/ which basically allows for match_driver state to not get changed later under the pci_bus_match due to allowing for the match_driver to be a int vs a bool. I will push up another patch removing the first two patches and adding that extra line. -Bryant
Quoted 47 lines
Quoted 47 lines
drivers/pci/bus.c +14
-0+#endif + +/** +* pci_bus_add_device - start driver for a single device +* @dev: device to add +* +* This adds add sysfs entries and start device drivers +*/ +void pci_bus_add_device (struct pci_dev *dev) +{ +pci_bus_add_sysfs_entries (dev); +pci_bus_match_device_driver (dev); +} +EXPORT_SYMBOL_GPL (pci_bus_add_device);/** drivers/pci/iov.c +1
-1@@ -162,7 +162,7 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id, int reset)pci_device_add (virtfn, virtfn->bus); -pci_bus_add_device (virtfn); +pci_bus_add_virtfn_device (virtfn);sprintf (buf,"virtfn%u" , id); rc =sysfs_create_link (&dev->dev.kobj, &virtfn->dev.kobj, buf);if (rc)include/linux/pci.h +3
-0@@ -911,6 +911,9 @@ struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);void pci_device_add (struct pci_dev *dev,struct pci_bus *bus);unsigned int pci_scan_child_bus (struct pci_bus *bus);void pci_bus_add_device (struct pci_dev *dev); +#ifdef CONFIG_PCI_IOV +void pci_bus_add_virtfn_device (struct pci_dev *dev); +#endif void pci_read_bridge_bases (struct pci_bus *child);struct resource *pci_find_parent_resource (const struct pci_dev *dev,struct resource *res);Signature · 1 line
2.11.0 (Apple Git-81)