1. 28 4月, 2017 4 次提交
  2. 26 4月, 2017 1 次提交
  3. 18 4月, 2017 1 次提交
  4. 12 4月, 2017 4 次提交
  5. 05 4月, 2017 6 次提交
  6. 04 4月, 2017 12 次提交
  7. 24 3月, 2017 5 次提交
    • L
      PCI: faraday: Add Faraday Technology FTPCI100 PCI Host Bridge driver · d3c68e0a
      Linus Walleij 提交于
      Add a host bridge driver for the Faraday Technology FPPCI100 host bridge,
      used for Cortina Systems Gemini SoC (SL3516) PCI Host Bridge.
      
      This code is inspired by the out-of-tree OpenWRT patch and then extensively
      rewritten for device tree and using the modern helpers to cut down and
      modernize the code to all new PCI frameworks.  A driver exists in U-Boot as
      well.
      
      Tested on the ITian Square One SQ201 NAS with the following result in the
      boot log (trimmed to relevant parts):
      
        OF: PCI: host bridge /soc/pci@50000000 ranges:
        OF: PCI:    IO 0x50000000..0x500fffff -> 0x00000000
        OF: PCI:   MEM 0x58000000..0x5fffffff -> 0x58000000
        ftpci100 50000000.pci: PCI host bridge to bus 0000:00
        pci_bus 0000:00: root bus resource [bus 00-ff]
        pci_bus 0000:00: root bus resource [io  0x0000-0xfffff]
        pci_bus 0000:00: root bus resource [mem 0x58000000-0x5fffffff]
        ftpci100 50000000.pci:
          DMA MEM1 BASE: 0x0000000000000000 -> 0x0000000007ffffff config 00070000
        ftpci100 50000000.pci:
          DMA MEM2 BASE: 0x0000000000000000 -> 0x0000000003ffffff config 00060000
        ftpci100 50000000.pci:
          DMA MEM3 BASE: 0x0000000000000000 -> 0x0000000003ffffff config 00060000
        PCI: bus0: Fast back to back transfers disabled
        pci 0000:00:00.0: of_irq_parse_pci() failed with rc=-22
        pci 0000:00:0c.0: BAR 0: assigned [mem 0x58000000-0x58007fff]
        pci 0000:00:09.2: BAR 0: assigned [mem 0x58008000-0x580080ff]
        pci 0000:00:09.0: BAR 4: assigned [io  0x1000-0x101f]
        pci 0000:00:09.1: BAR 4: assigned [io  0x1020-0x103f]
        pci 0000:00:09.0: enabling device (0140 -> 0141)
        pci 0000:00:09.0: HCRESET not completed yet!
        pci 0000:00:09.1: enabling device (0140 -> 0141)
        pci 0000:00:09.1: HCRESET not completed yet!
        pci 0000:00:09.2: enabling device (0140 -> 0142)
        rt61pci 0000:00:0c.0: enabling device (0140 -> 0142)
        ieee80211 phy0: rt2x00_set_chip: Info - Chipset detected -
           rt: 2561, rf: 0003, rev: 000c
        ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
        ehci-pci: EHCI PCI platform driver
        ehci-pci 0000:00:09.2: EHCI Host Controller
        ehci-pci 0000:00:09.2: new USB bus registered, assigned bus number 1
        ehci-pci 0000:00:09.2: irq 125, io mem 0x58008000
        ehci-pci 0000:00:09.2: USB 2.0 started, EHCI 1.00
        hub 1-0:1.0: USB hub found
        hub 1-0:1.0: 4 ports detected
        uhci_hcd: USB Universal Host Controller Interface driver
        uhci_hcd 0000:00:09.0: UHCI Host Controller
        uhci_hcd 0000:00:09.0: new USB bus registered, assigned bus number 2
        uhci_hcd 0000:00:09.0: HCRESET not completed yet!
        uhci_hcd 0000:00:09.0: irq 123, io base 0x00001000
        hub 2-0:1.0: USB hub found
        hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
        uhci_hcd 0000:00:09.1: UHCI Host Controller
        uhci_hcd 0000:00:09.1: new USB bus registered, assigned bus number 3
        uhci_hcd 0000:00:09.1: HCRESET not completed yet!
        uhci_hcd 0000:00:09.1: irq 124, io base 0x00001020
        hub 3-0:1.0: USB hub found
        hub 3-0:1.0: config failed, hub doesn't have any ports! (err -19)
        scsi 0:0:0:0: Direct-Access     USB      Flash Disk       1.00 PQ: 0 ANSI: 2
        sd 0:0:0:0: [sda] 7900336 512-byte logical blocks: (4.04 GB/3.77 GiB)
        sd 0:0:0:0: [sda] Write Protect is off
        sd 0:0:0:0: [sda] No Caching mode page found
        sd 0:0:0:0: [sda] Assuming drive cache: write through
         sda: sda1 sda2 sda3
        sd 0:0:0:0: [sda] Attached SCSI removable disk
        ieee80211 phy0: rt2x00lib_request_firmware: Info -
           Loading firmware file 'rt2561s.bin'
        ieee80211 phy0: rt2x00lib_request_firmware: Info -
           Firmware detected - version: 0.8
        IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
      
        $ lspci
        00:00.0 Class 0600: 159b:4321
        00:09.2 Class 0c03: 1106:3104
        00:09.0 Class 0c03: 1106:3038
        00:09.1 Class 0c03: 1106:3038
        00:0c.0 Class 0280: 1814:0301
      
        $ cat /proc/interrupts
      	     CPU0
        123:          0       PCI   0 Edge      uhci_hcd:usb2
        124:          0       PCI   1 Edge      uhci_hcd:usb3
        125:        159       PCI   2 Edge      ehci_hcd:usb1
        126:       1082       PCI   3 Edge      rt61pci
      
        $ cat /proc/iomem
        50000000-500000ff : /soc/pci@50000000
        58000000-5fffffff : Gemini PCI MEM
          58000000-58007fff : 0000:00:0c.0
            58000000-58007fff : 0000:00:0c.0
          58008000-580080ff : 0000:00:09.2
            58008000-580080ff : ehci_hcd
      
      The EHCI USB hub works fine; I can mount and manage files and the IRQs just
      keep ticking up.  I can issue iwlist wlan0 scanning and see all the WLANs
      here.  I don't have wpa_supplicant so have not tried connecting to them.
      
      [bhelgaas: fold in %pap change from Arnd Bergmann <arnd@arndb.de>]
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: Janos Laube <janos.dev@gmail.com>
      CC: Paulius Zaleckas <paulius.zaleckas@gmail.com>
      CC: Hans Ulli Kroll <ulli.kroll@googlemail.com>
      CC: Florian Fainelli <f.fainelli@gmail.com>
      CC: Feng-Hsin Chiang <john453@faraday-tech.com>
      CC: Greentime Hu <green.hu@gmail.com>
      d3c68e0a
    • L
      PCI: hv: Lock PCI bus on device eject · 414428c5
      Long Li 提交于
      A PCI_EJECT message can arrive at the same time we are calling
      pci_scan_child_bus() in the workqueue for the previous PCI_BUS_RELATIONS
      message or in create_root_hv_pci_bus().  In this case we could potentially
      modify the bus from multiple places.
      
      Properly lock the bus access.
      
      Thanks Dexuan Cui <decui@microsoft.com> for pointing out the race condition
      in create_root_hv_pci_bus().
      Reported-by: NXiaofeng Wang <xiaofwan@redhat.com>
      Signed-off-by: NLong Li <longli@microsoft.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NK. Y. Srinivasan <kys@microsoft.com>
      414428c5
    • L
      PCI: hv: Properly handle PCI bus remove · d3a78d8b
      Long Li 提交于
      hv_pci_devices_present() is called in hv_pci_remove() when we remove a PCI
      device from the host, e.g., by disabling SR-IOV on a device.  In
      hv_pci_remove(), the bus is already removed before the call, so we don't
      need to rescan the bus in the workqueue scheduled from
      hv_pci_devices_present().
      
      By introducing bus state hv_pcibus_removed, we can avoid this situation.
      Reported-by: NXiaofeng Wang <xiaofwan@redhat.com>
      Signed-off-by: NLong Li <longli@microsoft.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NK. Y. Srinivasan <kys@microsoft.com>
      d3a78d8b
    • T
      PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller · 9abb27c7
      Tomasz Nowicki 提交于
      During early days of PCI quirks support, ThunderX firmware did not provide
      PNP0c02 node with PCI configuration space and PEM-specific register ranges.
      This means that for legacy FW we are not reserving these resources and
      cannot gather PEM-specific resources for further PEM initialization.
      
      To support already deployed legacy FW, calculate PEM-specific ranges and
      provide resources reservation as fallback scenario into PEM driver when we
      could not gather PEM reg base from ACPI tables.
      Tested-by: NRobert Richter <rrichter@cavium.com>
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Signed-off-by: NVadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRobert Richter <rrichter@cavium.com>
      CC: stable@vger.kernel.org	# v4.10+
      9abb27c7
    • T
      PCI: thunder-pem: Use Cavium assigned hardware ID for ThunderX host controller · 81caa91b
      Tomasz Nowicki 提交于
      "CAV" is the only PNP/ACPI hardware ID vendor prefix assigned to Cavium so
      fix this as it should be from day one.
      
      Fixes: 44f22bd9 ("PCI: Add MCFG quirks for Cavium ThunderX pass2.x host controller")
      Tested-by: NRobert Richter <rrichter@cavium.com>
      Signed-off-by: NTomasz Nowicki <tn@semihalf.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRobert Richter <rrichter@cavium.com>
      CC: stable@vger.kernel.org	# v4.10+
      81caa91b
  8. 10 3月, 2017 1 次提交
    • B
      PCI: iproc: Save host bridge window resource in struct iproc_pcie · 6e347b5e
      Bjorn Helgaas 提交于
      The host bridge memory window resource is inserted into the iomem_resource
      tree and cannot be deallocated until the host bridge itself is removed.
      
      Previously, the window was on the stack, which meant the iomem_resource
      entry pointed into the stack and was corrupted as soon as the probe
      function returned, which caused memory corruption and errors like this:
      
        pcie_iproc_bcma bcma0:8: resource collision: [mem 0x40000000-0x47ffffff] conflicts with PCIe MEM space [mem 0x40000000-0x47ffffff]
      
      Move the memory window resource from the stack into struct iproc_pcie so
      its lifetime matches that of the host bridge.
      
      Fixes: c3245a56 ("PCI: iproc: Request host bridge window resources")
      Reported-and-tested-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: stable@vger.kernel.org	# v4.8+
      6e347b5e
  9. 08 3月, 2017 3 次提交
    • Y
      PCI/ASPM: Always set link->downstream to avoid NULL dereference on remove · 3bd7db63
      Yinghai Lu 提交于
      We call pcie_aspm_exit_link_state() when we remove a device.  If the device
      is the last PCIe function to be removed below a bridge and the bridge has
      an ASPM link_state struct, we disable ASPM on the link.  Disabling ASPM
      requires link->downstream (used in pcie_config_aspm_link()).
      
      We previously set link->downstream in pcie_aspm_cap_init(), but only if the
      device was not blacklisted.  Removing the blacklisted device caused a NULL
      pointer dereference in the pcie_aspm_exit_link_state() ->
      pcie_config_aspm_link() path:
      
        # echo 1 > /sys/bus/pci/devices/0000\:0b\:00.0/remove
        ...
         BUG: unable to handle kernel NULL pointer dereference at 0000000000000080
         IP: pcie_config_aspm_link+0x5d/0x2b0
         Call Trace:
          pcie_aspm_exit_link_state+0x75/0x130
          pci_stop_bus_device+0xa4/0xb0
          pci_stop_and_remove_bus_device_locked+0x1a/0x30
          remove_store+0x50/0x70
          dev_attr_store+0x18/0x30
          sysfs_kf_write+0x44/0x60
          kernfs_fop_write+0x10e/0x190
          __vfs_write+0x28/0x110
          ? rcu_read_lock_sched_held+0x5d/0x80
          ? rcu_sync_lockdep_assert+0x2c/0x60
          ? __sb_start_write+0x173/0x1a0
          ? vfs_write+0xb3/0x180
          vfs_write+0xc4/0x180
          SyS_write+0x49/0xa0
          do_syscall_64+0xa6/0x1c0
          entry_SYSCALL64_slow_path+0x25/0x25
         ---[ end trace bd187ee0267df5d9 ]---
      
      To avoid this, set link->downstream in alloc_pcie_link_state(), so every
      pcie_link_state structure has a valid link->downstream pointer.
      
      [bhelgaas: changelog]
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NRajat Jain <rajatja@google.com>
      CC: stable@vger.kernel.org
      3bd7db63
    • E
      PCI: Prevent VPD access for QLogic ISP2722 · 0d5370d1
      Ethan Zhao 提交于
      QLogic ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter has the VPD
      access issue too, while read the common pci-sysfs access interface shown as
      
       /sys/devices/pci0000:00/0000:00:03.2/0000:0b:00.0/vpd
      
      with simple 'cat' could cause system hang and panic:
      
        Kernel panic - not syncing: An NMI occurred. Depending on your system the reason for the NMI is logged in any one of the following resources:
        1. Integrated Management Log (IML)
        2. OA Syslog
        3. OA Forward Progress Log
        4. iLO Event Log
        CPU: 0 PID: 15070 Comm: udevadm Not tainted 4.1.12
        Hardware name: HP ProLiant DL380 Gen9/ProLiant DL380 Gen9, BIOS P89 12/27/2015
         0000000000000086 000000007f0cdf51 ffff880c4fa05d58 ffffffff817193de
         ffffffffa00b42d8 0000000000000075 ffff880c4fa05dd8 ffffffff81714072
         0000000000000008 ffff880c4fa05de8 ffff880c4fa05d88 000000007f0cdf51
        Call Trace:
         <NMI>  [<ffffffff817193de>] dump_stack+0x63/0x81
         [<ffffffff81714072>] panic+0xd0/0x20e
         [<ffffffffa00b390d>] hpwdt_pretimeout+0xdd/0xe0 [hpwdt]
         [<ffffffff81021fc9>] ? sched_clock+0x9/0x10
         [<ffffffff8101c101>] nmi_handle+0x91/0x170
         [<ffffffff8101c10c>] ? nmi_handle+0x9c/0x170
         [<ffffffff8101c5fe>] io_check_error+0x1e/0xa0
         [<ffffffff8101c719>] default_do_nmi+0x99/0x140
         [<ffffffff8101c8b4>] do_nmi+0xf4/0x170
         [<ffffffff817232c5>] end_repeat_nmi+0x1a/0x1e
         [<ffffffff815d724b>] ? pci_conf1_read+0xeb/0x120
         [<ffffffff815d724b>] ? pci_conf1_read+0xeb/0x120
         [<ffffffff815d724b>] ? pci_conf1_read+0xeb/0x120
         <<EOE>>  [<ffffffff815db4b3>] raw_pci_read+0x23/0x40
         [<ffffffff815db4fc>] pci_read+0x2c/0x30
         [<ffffffff8136f612>] pci_user_read_config_word+0x72/0x110
         [<ffffffff8136f746>] pci_vpd_pci22_wait+0x96/0x130
         [<ffffffff8136ff9b>] pci_vpd_pci22_read+0xdb/0x1a0
         [<ffffffff8136ea30>] pci_read_vpd+0x20/0x30
         [<ffffffff8137d590>] read_vpd_attr+0x30/0x40
         [<ffffffff8128e037>] sysfs_kf_bin_read+0x47/0x70
         [<ffffffff8128d24e>] kernfs_fop_read+0xae/0x180
         [<ffffffff8120dd97>] __vfs_read+0x37/0x100
         [<ffffffff812ba7e4>] ? security_file_permission+0x84/0xa0
         [<ffffffff8120e366>] ? rw_verify_area+0x56/0xe0
         [<ffffffff8120e476>] vfs_read+0x86/0x140
         [<ffffffff8120f3f5>] SyS_read+0x55/0xd0
         [<ffffffff81720f2e>] system_call_fastpath+0x12/0x71
        Shutting down cpus with NMI
        Kernel Offset: disabled
        drm_kms_helper: panic occurred, switching back to text console
      
      So blacklist the access to its VPD.
      Signed-off-by: NEthan Zhao <ethan.zhao@oracle.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: stable@vger.kernel.org	# v4.6+
      0d5370d1
    • J
      PCI: exynos: Initialize elbi_base even when using PHY framework · 544714d8
      Jaehoon Chung 提交于
      Even when using the PHY framework, we need the elbi_base.  Before this
      patch, we didn't initialize elbi_base, which caused NULL pointer
      dereferences later.
      
      Fixes: e7cd7ef5 ("PCI: exynos: Support the PHY generic framework")
      Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      544714d8
  10. 02 3月, 2017 2 次提交
  11. 01 3月, 2017 1 次提交