1. 09 10月, 2015 4 次提交
    • R
      PCI: mvebu: Use for_each_available_child_of_node() to walk child nodes · 2aee2ed2
      Russell King 提交于
      Rather than using for_each_child_of_node() and testing each child's
      availability, use the for_each_available_child_of_node() helper instead.
      
      Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> (Armada XP GP)
      Tested-by: Andrew Lunn <andrew@lunn.ch> (Kirkwood DIR665)
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      2aee2ed2
    • R
      PCI: mvebu: Use of_get_available_child_count() · 7de36cd5
      Russell King 提交于
      Rather than open-coding of_get_available_child_count(), use the provided
      helper instead.
      
      Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> (Armada XP GP)
      Tested-by: Andrew Lunn <andrew@lunn.ch> (Kirkwood DIR665)
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      7de36cd5
    • R
      PCI: mvebu: Use exact config access size; don't read/modify/write · 79e3f6ce
      Russell King 提交于
      The idea that you can arbitarily read 32-bits from PCI configuration space,
      modify a sub-field (like the command register) and write it back without
      consequence is deeply flawed.
      
      Status registers (such as the status register, PCIe device status register,
      etc) contain status bits which are read, write-one-to-clear.
      
      What this means is that reading 32-bits from the command register,
      modifying the command register, and then writing it back has the effect of
      clearing any status bits that were indicating at that time.  Same for the
      PCIe device control register clearing bits in the PCIe device status
      register.
      
      Since the Armada chips support byte, 16-bit and 32-bit accesses to the
      registers (unless otherwise stated) and the PCI configuration data register
      does not specify otherwise, it seems logical that the chip can indeed
      generate the proper configuration access cycles down to byte level.
      
      Testing with an ASM1062 PCIe to SATA mini-PCIe card on Armada 388.  PCIe
      capability at 0x80, DevCtl at 0x88, DevSta at 0x8a.
      
      Before:
        /# setpci -s 1:0.0 0x88.l		- DevSta: CorrErr+
        00012810
        /# setpci -s 1:0.0 0x88.w=0x2810	- Write DevCtl only
        /# setpci -s 1:0.0 0x88.l		- CorrErr cleared - FAIL
        00002810
      
      After:
        /# setpci -s 1:0.0 0x88.l		- DevSta: CorrErr+
        00012810
        /# setpci -s 1:0.0 0x88.w=0x2810	- check DevCtl only write
        /# setpci -s 1:0.0 0x88.l		- CorErr remains set
        00012810
        /# setpci -s 1:0.0 0x88.w=0x281f	- check DevCtl write works
        /# setpci -s 1:0.0 0x88.l		- devctl field updated
        0001281f
        /# setpci -s 1:0.0 0x8a.w=0xffff	- clear DevSta
        /# setpci -s 1:0.0 0x88.l		- CorrErr now cleared
        0000281f
        /# setpci -s 1:0.0 0x88.w=0x2810	- restore DevCtl
        /# setpci -s 1:0.0 0x88.l		- check
        00002810
      
      [bhelgaas: changelog]
      Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> (Armada XP GP)
      Tested-by: Andrew Lunn <andrew@lunn.ch> (Kirkwood DIR665)
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      79e3f6ce
    • R
      PCI: mvebu: Return zero for reserved or unimplemented config space · 58c19a14
      Russell King 提交于
      PCI requires reads to reserved or unimplemented configuration space to
      return zero and complete normally (see PCI r3.0, sec 6.1).  However, the
      root port software implementation was returning 0xfffffff and
      PCIBIOS_BAD_REGISTER_NUMBER.
      
      Return zero when reading reserved or unimplemented config space.
      
      [bhelgaas: changelog]
      Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> (Armada XP GP)
      Tested-by: Andrew Lunn <andrew@lunn.ch> (Kirkwood DIR665)
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      58c19a14
  2. 21 8月, 2015 1 次提交
  3. 27 5月, 2015 1 次提交
  4. 21 3月, 2015 1 次提交
  5. 28 12月, 2014 1 次提交
  6. 22 11月, 2014 1 次提交
  7. 14 11月, 2014 1 次提交
  8. 12 11月, 2014 1 次提交
  9. 20 10月, 2014 1 次提交
  10. 23 9月, 2014 1 次提交
  11. 16 7月, 2014 1 次提交
  12. 11 6月, 2014 1 次提交
  13. 30 4月, 2014 2 次提交
  14. 24 4月, 2014 2 次提交
  15. 19 2月, 2014 1 次提交
  16. 15 2月, 2014 1 次提交
  17. 13 2月, 2014 2 次提交
  18. 03 1月, 2014 2 次提交
    • J
      PCI: mvebu: Use max_t() instead of max(resource_size_t,) · 06489002
      Jingoo Han 提交于
      Use max_t() instead of max(resource_size_t,) in order to fix
      the following checkpatch warning.
      
        WARNING: max() should probably be max_t(resource_size_t, SZ_64K, size)
        WARNING: max() should probably be max_t(resource_size_t, SZ_1M, size)
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NJason Cooper <jason@lakedaemon.net>
      06489002
    • T
      PCI: mvebu: Call pci_ioremap_io() at startup instead of dynamically · 31e45ec3
      Thomas Petazzoni 提交于
      The mvebu PCI host controller driver uses an emulated PCI-to-PCI bridge to
      leverage the core PCI kernel enumeration logic to dynamically create and
      remove the MBus windows needed to access the memory and I/O regions of each
      PCI interface.
      
      In the context of this PCI-to-PCI bridge emulation, the driver emulates
      all reads and writes to the PCI bridge registers.  Upon a write to the
      registers configuring the I/O base and limit, the driver was creating the
      MBus window and calling pci_ioremap_io() to setup the mapping.
      
      However, it turns out that accesses to these registers are made in an IRQ
      disabled context, while pci_ioremap_io() is a potentially sleeping
      function.  Not only this is wrong, but it is causing fairly loud warnings
      at boot time when the appropriate kernel hacking options are enabled.
      
      This patch solves this by moving the pci_ioremap_io() call to the startup
      of the driver.  At this point, we don't know how many PCI interfaces will
      be enabled, so we are simply remapping the entire PCI I/O space to virtual
      addresses.  This is reasonable since this I/O space is limited to 1 MB in
      size, and also because the MBus windows continue to be created in a dynamic
      fashion only when devices need them.
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      31e45ec3
  19. 20 12月, 2013 1 次提交
  20. 10 12月, 2013 1 次提交
  21. 27 11月, 2013 4 次提交
  22. 24 10月, 2013 4 次提交
  23. 09 10月, 2013 3 次提交
  24. 30 9月, 2013 2 次提交