1. 18 11月, 2020 1 次提交
  2. 14 9月, 2020 4 次提交
    • N
      s390/pci: remove unused function zpci_rescan() · 2bce60b5
      Niklas Schnelle 提交于
      the only caller of this was removed as part of the suspend/resume
      removal so no need to keep this function around.
      Reviewed-by: NMatthew Rosato <mjrosato@linux.ibm.com>
      Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      2bce60b5
    • N
      s390/pci: consolidate SR-IOV specific code · abb95b75
      Niklas Schnelle 提交于
      currently we have multiple #ifdef CONFIG_PCI_IOV blocks spread over
      different compliation units and headers, all dealing with SR-IOV
      specific behavior.
      This violates the style guide which discourages conditionally compiled
      code blocks and hinders maintainability by speading SR-IOV functionality
      over many files.
      
      Let's move all of this into a conditionally compiled pci_iov.c file and
      local header and prefix SR-IOV specific functions with zpci_iov_*.
      Reviewed-by: NMatthew Rosato <mjrosato@linux.ibm.com>
      Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      abb95b75
    • N
      s390/pci: Implement ioremap_wc/prot() with MIO · b02002cc
      Niklas Schnelle 提交于
      With our current support for the new MIO PCI instructions, write
      combining/write back MMIO memory can be obtained via the pci_iomap_wc()
      and pci_iomap_wc_range() functions.
      This is achieved by using the write back address for a specific bar
      as provided in clp_store_query_pci_fn()
      
      These functions are however not widely used and instead drivers often
      rely on ioremap_wc() and ioremap_prot(), which on other platforms enable
      write combining using a PTE flag set through the pgrprot value.
      
      While we do not have a write combining flag in the low order flag bits
      of the PTE like x86_64 does, with MIO support, there is a write back bit
      in the physical address (bit 1 on z15) and thus also the PTE.
      Which bit is used to toggle write back and whether it is available at
      all, is however not fixed in the architecture. Instead we get this
      information from the CLP Store Logical Processor Characteristics for PCI
      command. When the write back bit is not provided we fall back to the
      existing behavior.
      Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Reviewed-by: NPierre Morel <pmorel@linux.ibm.com>
      Reviewed-by: NGerald Schaefer <gerald.schaefer@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      b02002cc
    • N
      s390/pci: fix leak of DMA tables on hard unplug · afdf9550
      Niklas Schnelle 提交于
      commit f606b3ef ("s390/pci: adapt events for zbus") removed the
      zpci_disable_device() call for a zPCI event with PEC 0x0304 because
      the device is already deconfigured by the platform.
      This however skips the Linux side of the disable in particular it leads
      to leaking the DMA tables and bitmaps because zpci_dma_exit_device() is
      never called on the device.
      
      If the device transitions to the Reserved state we call zpci_zdev_put()
      but zpci_release_device() will not call zpci_disable_device() because
      the state of the zPCI function is already ZPCI_FN_STATE_STANDBY.
      
      If the device is put into the Standby state, zpci_disable_device() is
      not called and the device is assumed to have been put in Standby through
      platform action.
      At this point the device may be removed by a subsequent event with PEC
      0x0308 or 0x0306 which calls zpci_zdev_put() with the same problem
      as above or the device may be configured again in which case
      zpci_disable_device() is also not called.
      
      Fix this by calling zpci_disable_device() explicitly for PEC 0x0304 as
      before. To make it more clear that zpci_disable_device() may be called,
      even if the lower level device has already been disabled by the
      platform, add a comment to zpci_disable_device().
      
      Cc: <stable@vger.kernel.org> # 5.8
      Fixes: f606b3ef ("s390/pci: adapt events for zbus")
      Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      afdf9550
  3. 17 8月, 2020 2 次提交
    • N
      s390/pci: fix PF/VF linking on hot plug · b97bf44f
      Niklas Schnelle 提交于
      Currently there are four places in which a PCI function is scanned
      and made available to drivers:
       1. In pci_scan_root_bus() as part of the initial zbus
          creation.
       2. In zpci_bus_add_devices() when registering
          a device in configured state on a zbus that has already been
          scanned.
       3. When a function is already known to zPCI (in reserved/standby state)
          and configuration is triggered through firmware by PEC 0x301.
       4. When a device is already known to zPCI (in standby/reserved state)
          and configuration is triggered from within Linux using
          enable_slot().
      
      The PF/VF linking step and setting of pdev->is_virtfn introduced with
      commit e5794cf1 ("s390/pci: create links between PFs and VFs") was
      only triggered for the second case, which is where VFs created through
      sriov_numvfs usually land. However unlike some other platforms but like
      POWER VFs can be individually enabled/disabled through
      /sys/bus/pci/slots.
      
      Fix this by doing VF setup as part of pcibios_bus_add_device() which is
      called in all of the above cases.
      
      Finally to remove the PF/VF links call the common code
      pci_iov_remove_virtfn() function to remove linked VFs.
      This takes care of the necessary sysfs cleanup.
      
      Fixes: e5794cf1 ("s390/pci: create links between PFs and VFs")
      Cc: <stable@vger.kernel.org> # 5.8: 2f0230b2: s390/pci: re-introduce zpci_remove_device()
      Cc: <stable@vger.kernel.org> # 5.8
      Acked-by: NPierre Morel <pmorel@linux.ibm.com>
      Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
      b97bf44f
    • N
      s390/pci: re-introduce zpci_remove_device() · 2f0230b2
      Niklas Schnelle 提交于
      For fixing the PF to VF link removal we need to perform some action on
      every removal of a zdev from the common PCI subsystem.
      So in preparation re-introduce zpci_remove_device() and use that instead
      of directly calling the common code functions. This  was actually still
      declared from earlier code but no longer implemented.
      Reviewed-by: NPierre Morel <pmorel@linux.ibm.com>
      Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
      2f0230b2
  4. 20 5月, 2020 1 次提交
  5. 28 4月, 2020 3 次提交
    • P
      s390/pci: Handling multifunctions · 44510d6f
      Pierre Morel 提交于
      We allow multiple functions on a single bus.
      We suppress the ZPCI_DEVFN definition and replace its
      occurences with zpci->devfn.
      
      We verify the number of device during the registration.
      
      There can never be more domains in use than existing
      devices, so we do not need to verify the count of domain
      after having verified the count of devices.
      Signed-off-by: NPierre Morel <pmorel@linux.ibm.com>
      Reviewed-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      44510d6f
    • P
      s390/pci: create zPCI bus · 05bc1be6
      Pierre Morel 提交于
      The zPCI bus is in charge to handle common zPCI resources for
      zPCI devices.
      
      Creating the zPCI bus, the PCI bus, the zPCI devices and the
      PCI devices and hotplug slots
      done in a specific order:
      - PCI hotplug slot creation needs a PCI bus
      - PCI bus needs a PCI domain
        which is reported by the pci_domain_nr() when setting up the
        host bridge
      - PCI domain is set from the zPCI with devfn 0
        this is necessary to have a reproducible enumeration
      
      Therefore we can not create devices or hotplug slots for any PCI
      device associated with a zPCI device before having discovered
      the function zero of the bus.
      
      The discovery and initialization of devices can be done at several
      points in the code:
      - On Events, serialized in a thread context
      - On initialization, in the kernel init thread context
      - When powering on the hotplug slot, in a user thread context
      
      The removal of devices and their parent bus may also be done on
      events or for devices when powering down the slot.
      
      To guarantee the existence of the bus and devices until they are
      no more needed we use kref in zPCI bus and introduce a reference
      count in the zPCI devices.
      
      In this patch the zPCI bus still only accept a device with
      a devfn 0.
      Signed-off-by: NPierre Morel <pmorel@linux.ibm.com>
      Reviewed-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      05bc1be6
    • P
      s390/pci: define kernel parameters for PCI multifunction · 6cf17f9a
      Pierre Morel 提交于
      Using PCI multifunctions in S390 is a new feature we may want
      to ignore to continue provide the same topology as in the past
      to userland even if the configuration supports exposing the
      topology of a multi-Function device.
      
      A new boolean parameters allows to overwrite the kernel
      pci configuration:
      
      - pci=norid when on, disallow the use a new firmware field,
        RID, which provides the PCI <bus>:<device>.<function> part
        of the PCI address.
      
      To be used in the following patches and satisfy the checkpatch.pl
      the variable is exposed in pci.h
      Signed-off-by: NPierre Morel <pmorel@linux.ibm.com>
      Reviewed-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      6cf17f9a
  6. 23 3月, 2020 3 次提交
  7. 04 3月, 2020 1 次提交
  8. 22 1月, 2020 1 次提交
    • N
      s390/pci: Recover handle in clp_set_pci_fn() · 17cdec96
      Niklas Schnelle 提交于
      When we try to recover a PCI function using
      
          echo 1 > /sys/bus/pci/devices/<id>/recover
      
      or manually with
      
          echo 1 > /sys/bus/pci/devices/<id>/remove
          echo 0 > /sys/bus/pci/slots/<slot>/power
          echo 1 > /sys/bus/pci/slots/<slot>/power
      
      clp_disable_fn() / clp_enable_fn() call clp_set_pci_fn() to first
      disable and then reenable the function.
      
      When the function is already in the requested state we may be left with
      an invalid function handle.
      
      To get a new valid handle we do a clp_list_pci() call. For this we need
      both the function ID and function handle in clp_set_pci_fn() so pass the
      zdev and get both.
      
      To simplify things also pull setting the refreshed function handle into
      clp_set_pci_fn()
      Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      17cdec96
  9. 30 11月, 2019 2 次提交
  10. 14 10月, 2019 1 次提交
  11. 21 8月, 2019 1 次提交
  12. 12 7月, 2019 1 次提交
  13. 04 7月, 2019 1 次提交
  14. 28 5月, 2019 1 次提交
  15. 29 4月, 2019 7 次提交
  16. 07 2月, 2019 3 次提交
  17. 02 1月, 2019 1 次提交
  18. 13 12月, 2018 1 次提交
  19. 16 8月, 2018 2 次提交
  20. 24 11月, 2017 1 次提交
    • G
      s390: pci: add SPDX identifiers to the remaining files · adbb3901
      Greg Kroah-Hartman 提交于
      It's good to have SPDX identifiers in all files to make it easier to
      audit the kernel tree for correct licenses.
      
      Update the arch/s390/pci/ files with the correct SPDX license
      identifier based on the license text in the file itself.  The SPDX
      identifier is a legally binding shorthand, which can be used instead of
      the full boiler plate text.
      
      This work is based on a script and data from Thomas Gleixner, Philippe
      Ombredanne, and Kate Stewart.
      
      Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
      Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      adbb3901
  21. 08 11月, 2017 1 次提交
  22. 16 8月, 2017 1 次提交