1. 28 12月, 2017 1 次提交
  2. 23 8月, 2017 1 次提交
  3. 20 9月, 2016 1 次提交
    • M
      powerpc: Remove all usages of NO_IRQ · ef24ba70
      Michael Ellerman 提交于
      NO_IRQ has been == 0 on powerpc for just over ten years (since commit
      0ebfff14 ("[POWERPC] Add new interrupt mapping core and change
      platforms to use it")). It's also 0 on most other arches.
      
      Although it's fairly harmless, every now and then it causes confusion
      when a driver is built on powerpc and another arch which doesn't define
      NO_IRQ. There's at least 6 definitions of NO_IRQ in drivers/, at least
      some of which are to work around that problem.
      
      So we'd like to remove it. This is fairly trivial in the arch code, we
      just convert:
      
          if (irq == NO_IRQ)	to	if (!irq)
          if (irq != NO_IRQ)	to	if (irq)
          irq = NO_IRQ;	to	irq = 0;
          return NO_IRQ;	to	return 0;
      
      And a few other odd cases as well.
      
      At least for now we keep the #define NO_IRQ, because there is driver
      code that uses NO_IRQ and the fixes to remove those will go via other
      trees.
      
      Note we also change some occurrences in PPC sound drivers, drivers/ps3,
      and drivers/macintosh.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      ef24ba70
  4. 14 10月, 2015 1 次提交
  5. 10 9月, 2015 1 次提交
    • P
      powerpc/MSI: Fix race condition in tearing down MSI interrupts · e297c939
      Paul Mackerras 提交于
      This fixes a race which can result in the same virtual IRQ number
      being assigned to two different MSI interrupts.  The most visible
      consequence of that is usually a warning and stack trace from the
      sysfs code about an attempt to create a duplicate entry in sysfs.
      
      The race happens when one CPU (say CPU 0) is disposing of an MSI
      while another CPU (say CPU 1) is setting up an MSI.  CPU 0 calls
      (for example) pnv_teardown_msi_irqs(), which calls
      msi_bitmap_free_hwirqs() to indicate that the MSI (i.e. its
      hardware IRQ number) is no longer in use.  Then, before CPU 0 gets
      to calling irq_dispose_mapping() to free up the virtal IRQ number,
      CPU 1 comes in and calls msi_bitmap_alloc_hwirqs() to allocate an
      MSI, and gets the same hardware IRQ number that CPU 0 just freed.
      CPU 1 then calls irq_create_mapping() to get a virtual IRQ number,
      which sees that there is currently a mapping for that hardware IRQ
      number and returns the corresponding virtual IRQ number (which is
      the same virtual IRQ number that CPU 0 was using).  CPU 0 then
      calls irq_dispose_mapping() and frees that virtual IRQ number.
      Now, if another CPU comes along and calls irq_create_mapping(), it
      is likely to get the virtual IRQ number that was just freed,
      resulting in the same virtual IRQ number apparently being used for
      two different hardware interrupts.
      
      To fix this race, we just move the call to msi_bitmap_free_hwirqs()
      to after the call to irq_dispose_mapping().  Since virq_to_hw()
      doesn't work for the virtual IRQ number after irq_dispose_mapping()
      has been called, we need to call it before irq_dispose_mapping() and
      remember the result for the msi_bitmap_free_hwirqs() call.
      
      The pattern of calling msi_bitmap_free_hwirqs() before
      irq_dispose_mapping() appears in 5 places under arch/powerpc, and
      appears to have originated in commit 05af7bd2 ("[POWERPC] MPIC
      U3/U4 MSI backend") from 2007.
      
      Fixes: 05af7bd2 ("[POWERPC] MPIC U3/U4 MSI backend")
      Cc: stable@vger.kernel.org # v2.6.22+
      Reported-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      e297c939
  6. 23 7月, 2015 1 次提交
    • J
      powerpc/PCI: Use for_pci_msi_entry() to access MSI device list · 2921d179
      Jiang Liu 提交于
      Use accessor for_each_pci_msi_entry() to access MSI device list, so we
      could easily move msi_list from struct pci_dev into struct device
      later.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Stuart Yoder <stuart.yoder@freescale.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>
      Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Daniel Axtens <dja@axtens.net>
      Cc: Wei Yang <weiyang@linux.vnet.ibm.com>
      Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
      Cc: Alexander Gordeev <agordeev@redhat.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Laurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Tudor Laurentiu <b10716@freescale.com>
      Cc: Hongtao Jia <hongtao.jia@freescale.com>
      Link: http://lkml.kernel.org/r/1436428847-8886-4-git-send-email-jiang.liu@linux.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      2921d179
  7. 02 6月, 2015 1 次提交
    • D
      powerpc/fsl_msi: Move MSI-related ops to pci_controller_ops · 00e25397
      Daniel Axtens 提交于
      Move the fsl_msi subsystem to use the pci_controller_ops structure
      rather than ppc_md for MSI related PCI controller operations.
      
      Previously, MSI ops were added to ppc_md at the subsys level. However,
      in fsl_pci.c, PCI controllers are created at the at arch level. So,
      unlike in e.g. PowerNV/pSeries/Cell, we can't simply populate a
      platform-level controller ops structure and have it copied into the
      controllers when they are created.
      
      Instead, walk every phb, and attempt to populate it with the MSI ops.
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      00e25397
  8. 24 3月, 2015 1 次提交
  9. 23 11月, 2014 2 次提交
    • T
      PCI/MSI: Rename mask/unmask_msi_irq treewide · 280510f1
      Thomas Gleixner 提交于
      The PCI/MSI irq chip callbacks mask/unmask_msi_irq have been renamed
      to pci_msi_mask/unmask_irq to mark them PCI specific. Rename all usage
      sites. The conversion helper functions are kept around to avoid
      conflicts in next and will be removed after merging into mainline.
      
      Coccinelle assisted conversion. No functional change.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: x86@kernel.org
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Murali Karicheri <m-karicheri2@ti.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Mohit Kumar <mohit.kumar@st.com>
      Cc: Simon Horman <horms@verge.net.au>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      280510f1
    • J
      PCI/MSI: Rename write_msi_msg() to pci_write_msi_msg() · 83a18912
      Jiang Liu 提交于
      Rename write_msi_msg() to pci_write_msi_msg() to mark it as PCI
      specific.
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Yingjoe Chen <yingjoe.chen@mediatek.com>
      Cc: Yijing Wang <wangyijing@huawei.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      83a18912
  10. 18 11月, 2014 1 次提交
  11. 10 11月, 2014 1 次提交
  12. 20 10月, 2014 1 次提交
  13. 02 10月, 2014 1 次提交
  14. 20 9月, 2014 1 次提交
  15. 05 9月, 2014 4 次提交
    • T
      powerpc/fsl_msi: spread msi ints across different MSIRs · c822e737
      Tudor Laurentiu 提交于
      Allocate msis such that each time a new interrupt is requested,
      the SRS (MSIR register select) to be used is allocated in a
      round-robin fashion.
      The end result is that the msi interrupts will be spread across
      distinct MSIRs with the main benefit that now users can set
      affinity to each msi int through the mpic irq backing up the
      MSIR register.
      This is achieved with the help of a newly introduced msi bitmap
      api that allows specifying the starting point when searching
      for a free msi interrupt.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      c822e737
    • T
      powerpc/fsl_msi: show more meaningful names in /proc/interrupts · de99f53d
      Tudor Laurentiu 提交于
      Rename the irq controller associated with a MSI
      interrupt to fsl-msi-<V>, where <V> is the virq
      of the cascade irq backing up this MSI interrupt.
      This way, one can set the affinity of a MSI
      through the cascade irq associated with said MSI
      interrupt.
      Given this example /proc/interrupts snippet:
      
                 CPU0       CPU1       CPU2       CPU3
       16:          0          0          0          0   OpenPIC    16 Edge      mpic-error-int
       17:          0          4          0          0  fsl-msi-224   0 Edge      eth0-rx-0
       18:          0          5          0          0  fsl-msi-225   1 Edge      eth0-tx-0
       19:          0          2          0          0  fsl-msi-226   2 Edge      eth0
       [...]
      224:          0         11          0          0   OpenPIC   224 Edge      fsl-msi-cascade
      225:          0          0          0          0   OpenPIC   225 Edge      fsl-msi-cascade
      226:          0          0          0          0   OpenPIC   226 Edge      fsl-msi-cascade
       [...]
      
      To change the affinity of MSI interrupt 17
      (having the irq controller named "fsl-msi-224")
      instead of writing /proc/irq/17/smp_affinity, use
      the associated MSI cascade irq, in this case,
      interrupt 224, e.g.:
      
         echo 6 > /proc/irq/224/smp_affinity
      
      Note that a MSI cascade irq covers several MSI
      interrupts, so changing the affinity on the
      cascade will impact all of the associated MSI
      interrupts.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      de99f53d
    • T
      powerpc/fsl_msi: change the irq handler from chained to normal · 543c043c
      Tudor Laurentiu 提交于
      As we do for other fsl-mpic related cascaded irqchips
      (e.g. error ints, mpic timers), use a normal irq handler
      for msi irqs too.
      This brings some advantages such as mask/unmask/ack/eoi
      and irq state taken care behind the scenes, kstats
      updates a.s.o plus access to features provided by mpic,
      such as affinity.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      543c043c
    • T
      powerpc/fsl_msi: reorganize structs to improve clarity and flexibility · 83495231
      Tudor Laurentiu 提交于
      Store cascade_data in an array inside the driver
      data for later use.
      Get rid of the msi_virq array since now we can
      encapsulate the virqs in the cascade_data
      directly and access them through the array
      mentioned earlier.
      Signed-off-by: NLaurentiu Tudor <Laurentiu.Tudor@freescale.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      83495231
  16. 04 9月, 2014 1 次提交
  17. 08 8月, 2013 1 次提交
    • M
      powerpc/fsl_msi: add MSIIR1 support for MPIC v4.3 · f31dd944
      Minghuan Lian 提交于
      The original MPIC MSI bank contains 8 registers, MPIC v4.3 MSI bank
      contains 16 registers, and this patch adds NR_MSI_REG_MAX and
      NR_MSI_IRQS_MAX to describe the maximum capability of MSI bank.
      MPIC v4.3 provides MSIIR1 to index these 16 MSI registers. MSIIR1
      uses different bits definition than MSIIR. This patch adds
      ibs_shift and srs_shift to indicate the bits definition of the
      MSIIR and MSIIR1, so the same code can handle the MSIIR and MSIIR1
      simultaneously.
      Signed-off-by: NMinghuan Lian <Minghuan.Lian@freescale.com>
      [scottwood@freescale.com: reinstated static on all_avail]
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      f31dd944
  18. 31 7月, 2013 1 次提交
  19. 04 4月, 2013 1 次提交
  20. 13 2月, 2013 1 次提交
    • K
      powerpc/fsl: msi: sparse fixes · 6cce76dc
      Kim Phillips 提交于
      arch/powerpc/sysdev/fsl_msi.c:31:1: warning: symbol 'msi_head' was not declared. Should it be static?
      arch/powerpc/sysdev/fsl_msi.c:138:40: warning: incorrect type in argument 1 (different base types)
      arch/powerpc/sysdev/fsl_msi.c:138:40:    expected restricted __be64 const [usertype] *p
      arch/powerpc/sysdev/fsl_msi.c:138:40:    got unsigned long long const [usertype] *[assigned] reg
      Signed-off-by: NKim Phillips <kim.phillips@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      6cce76dc
  21. 04 1月, 2013 1 次提交
    • G
      POWERPC: drivers: remove __dev* attributes. · cad5cef6
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      __devinitconst, and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cad5cef6
  22. 06 10月, 2012 1 次提交
  23. 11 9月, 2012 2 次提交
  24. 16 3月, 2012 1 次提交
  25. 16 2月, 2012 2 次提交
    • G
      irq_domain/powerpc: constify irq_domain_ops · 9f70b8eb
      Grant Likely 提交于
      Make all the irq_domain_ops structures in powerpc 'static const'
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      9f70b8eb
    • G
      irq_domain: Replace irq_alloc_host() with revmap-specific initializers · a8db8cf0
      Grant Likely 提交于
      Each revmap type has different arguments for setting up the revmap.
      This patch splits up the generator functions so that each revmap type
      can do its own setup and the user doesn't need to keep track of how
      each revmap type handles the arguments.
      
      This patch also adds a host_data argument to the generators.  There are
      cases where the host_data pointer will be needed before the function returns.
      ie. the legacy map calls the .map callback for each irq before returning.
      
      v2: - Add void *host_data argument to irq_domain_add_*() functions
          - fixed failure to compile
          - Moved IRQ_DOMAIN_MAP_* defines into irqdomain.c
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      a8db8cf0
  26. 15 2月, 2012 1 次提交
    • G
      irq_domain/powerpc: Use common irq_domain structure instead of irq_host · bae1d8f1
      Grant Likely 提交于
      This patch drops the powerpc-specific irq_host structures and uses the common
      irq_domain strucutres defined in linux/irqdomain.h.  It also fixes all
      the users to use the new structure names.
      
      Renaming irq_host to irq_domain has been discussed for a long time, and this
      patch is a step in the process of generalizing the powerpc virq code to be
      usable by all architecture.
      
      An astute reader will notice that this patch actually removes the irq_host
      structure instead of renaming it.  This is because the irq_domain structure
      already exists in include/linux/irqdomain.h and has the needed data members.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      Tested-by: NOlof Johansson <olof@lixom.net>
      bae1d8f1
  27. 05 1月, 2012 1 次提交
    • T
      powerpc/fsl: add MSI support for the Freescale hypervisor · 446bc1ff
      Timur Tabi 提交于
      Add support for vmpic-msi nodes to the fsl_msi driver.  The MSI is
      virtualized by the hypervisor, so the vmpic-msi does not contain a 'reg'
      property.  Instead, the driver uses hcalls.
      
      Add support for the "msi-address-64" property to the fsl_pci driver.
      The Freescale hypervisor typically puts the virtualized MSIIR register
      in the page after the end of DDR, so we extend the DDR ATMU to cover it.
      Any other location for MSIIR is not supported, for now.
      Signed-off-by: NTimur Tabi <timur@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      446bc1ff
  28. 24 11月, 2011 1 次提交
    • T
      powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes · 895d603f
      Timur Tabi 提交于
      On Freescale parts with multiple MSI controllers, the controllers are
      combined into one "pool" of interrupts.  Whenever a device requests an MSI
      interrupt, the next available interrupt from the pool is selected,
      regardless of which MSI controller the interrupt is from.  This works
      because each PCI bus has an ATMU to all of CCSR, so any PCI device can
      access any MSI interrupt register.
      
      The fsl,msi property is used to specify that a given PCI bus should only
      use a specific MSI device.  This is necessary, for example, with the
      Freescale hypervisor, because the MSI devices are assigned to specific
      partitions.
      
      Ideally, we'd like to be able to assign MSI devices to PCI busses within
      the MSI or PCI layers.  However, there does not appear to be a mechanism
      to do that.  Whenever the MSI layer wants to allocate an MSI interrupt to
      a PCI device, it just calls arch_setup_msi_irqs().  It would be nice if we
      could register an MSI device with a specific PCI bus.
      
      So instead we remember the phandles of each MSI device, and we use that to
      limit our search for an available interrupt.  Whenever we are asked to
      allocate a new interrupt for a PCI device, we check the fsl,msi property
      of the PCI bus for that device.  If it exists, then as we are looping over
      all MSI devices, we skip the ones that don't have a matching phandle.
      Signed-off-by: NTimur Tabi <timur@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      895d603f
  29. 14 10月, 2011 1 次提交
  30. 12 10月, 2011 1 次提交
  31. 10 6月, 2011 1 次提交
  32. 19 5月, 2011 3 次提交
    • M
      powerpc/fsl_msi: Use chip_data not handler_data · d1921bcd
      Milton Miller 提交于
      handler_data should be reserved for flow handlers on the dependent
      irq, not consumed by the parent irq code that is part of the irq_chip
      code.  The msi_data pointer was already set in msidesc->irqhost->hostdata
      and being copied to irq_data->chipdata in the msidesc->irqhost->map()
      method called via create_irq_mapping, so we can obtain the pointer
      from there and free the instance it in teardown_msi_irqs.
      
      Also remove the unnecessary cast of irq_get_handler_data in the
      cascade handler, which is the demux flow handler of the parent
      msi interrupt.  (This is the expected usage for handler_data).
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d1921bcd
    • M
      powerpc/fsl_msi: Don't abuse platform_data for driver_data · 6c4c82e2
      Milton Miller 提交于
      The msi platform device driver was abusing dev.platform_data for its
      platform_driver_data.  Use the correct pointer for storage.
      
      Platform_data is supposed to be for platforms to communicate to drivers
      parameters that are not otherwise discoverable.  Its lifetime matches
      the platform_device not the platform device driver.  It is generally
      not needed for drivers that only support systems with device trees.
      Signed-off-by: NMilton Miller <miltonm@bga.com>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6c4c82e2
    • G
      drivercore: revert addition of of_match to struct device · b1608d69
      Grant Likely 提交于
      Commit b826291c, "drivercore/dt: add a match table pointer to struct
      device" added an of_match pointer to struct device to cache the
      of_match_table entry discovered at driver match time.  This was unsafe
      because matching is not an atomic operation with probing a driver.  If
      two or more drivers are attempted to be matched to a driver at the
      same time, then the cached matching entry pointer could get
      overwritten.
      
      This patch reverts the of_match cache pointer and reworks all users to
      call of_match_device() directly instead.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      b1608d69