2019-06-01 10:08:55 +02:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.
percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.
http://userweb.kernel.org/~tj/misc/slabh-sweep.py
The script does the followings.
* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.
* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.
* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.
The conversion was done in the following steps.
1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.
2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.
3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.
4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.
5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.
6. percpu.h was updated not to include slab.h.
7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).
* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig
8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.
Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-24 17:04:11 +09:00
|
|
|
|
2023-10-06 16:45:16 -05:00
|
|
|
|
2022-03-08 20:20:25 +01:00
|
|
|
|
|
|
|
|
|
2023-10-06 16:45:16 -05:00
|
|
|
|
|
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
2022-03-08 20:20:25 +01:00
|
|
|
|
2014-08-19 14:25:05 +03:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:35 +08:00
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2010-08-05 02:45:08 -05:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-30 17:34:59 -06:00
|
|
|
|
2010-04-22 16:31:36 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2011-09-23 12:41:35 -05:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-19 14:25:01 +03:00
|
|
|
|
2010-04-22 16:31:35 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-07 13:59:54 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-19 14:25:05 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-05 15:22:56 +01:00
|
|
|
|
2014-08-19 14:25:05 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2014-11-23 12:23:20 +01:00
|
|
|
|
|
|
|
|
|
2011-03-07 13:59:54 +00:00
|
|
|
|
2014-08-19 14:25:05 +03:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2012-02-14 14:06:50 -07:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2011-03-25 15:43:57 +01:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2011-03-25 16:45:20 +01:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-26 12:24:34 -07:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
2015-10-13 12:51:29 +01:00
|
|
|
|
2008-08-06 09:10:02 +10:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
powerpc/MSI: Fix race condition in tearing down MSI interrupts
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 05af7bd2d75e ("[POWERPC] MPIC
U3/U4 MSI backend") from 2007.
Fixes: 05af7bd2d75e ("[POWERPC] MPIC U3/U4 MSI backend")
Cc: stable@vger.kernel.org # v2.6.22+
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-09-10 14:36:21 +10:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2021-12-06 23:51:29 +01:00
|
|
|
|
powerpc/MSI: Fix race condition in tearing down MSI interrupts
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 05af7bd2d75e ("[POWERPC] MPIC
U3/U4 MSI backend") from 2007.
Fixes: 05af7bd2d75e ("[POWERPC] MPIC U3/U4 MSI backend")
Cc: stable@vger.kernel.org # v2.6.22+
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-09-10 14:36:21 +10:00
|
|
|
|
2011-05-10 19:30:11 +00:00
|
|
|
|
2011-03-25 16:45:20 +01:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2022-12-17 10:46:44 +00:00
|
|
|
|
powerpc/MSI: Fix race condition in tearing down MSI interrupts
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 05af7bd2d75e ("[POWERPC] MPIC
U3/U4 MSI backend") from 2007.
Fixes: 05af7bd2d75e ("[POWERPC] MPIC U3/U4 MSI backend")
Cc: stable@vger.kernel.org # v2.6.22+
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2015-09-10 14:36:21 +10:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
2009-05-12 15:51:56 -05:00
|
|
|
|
2011-09-23 12:41:35 -05:00
|
|
|
|
|
|
|
|
|
2012-11-30 17:34:59 -06:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2011-09-23 12:41:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-05-12 15:51:56 -05:00
|
|
|
|
2015-02-26 15:23:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-10-31 17:06:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:36 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2015-02-26 15:23:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-07 20:57:53 +02:00
|
|
|
|
powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-10-31 17:06:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
2014-08-13 16:55:13 +03:00
|
|
|
|
|
|
|
|
|
powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-10-31 17:06:35 -05:00
|
|
|
|
|
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
2017-08-21 10:16:47 -05:00
|
|
|
|
|
|
|
|
|
2022-07-04 22:52:33 +08:00
|
|
|
|
powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-10-31 17:06:35 -05:00
|
|
|
|
|
|
|
|
|
2022-07-04 22:52:33 +08:00
|
|
|
|
powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-10-31 17:06:35 -05:00
|
|
|
|
|
|
|
|
|
2021-12-06 23:51:29 +01:00
|
|
|
|
powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-10-31 17:06:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:36 +08:00
|
|
|
|
powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-10-31 17:06:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-06 21:53:24 +10:00
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
2008-08-06 09:10:02 +10:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-10 19:30:11 +00:00
|
|
|
|
2011-03-25 16:45:20 +01:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
2014-11-09 23:10:34 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:36 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2010-04-22 16:31:35 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:35 +08:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2010-04-22 16:31:35 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 05:48:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2012-07-03 05:48:55 +00:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2021-05-04 17:42:18 +01:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2021-05-04 17:42:18 +01:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
2021-05-04 17:42:18 +01:00
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
2021-05-04 17:42:18 +01:00
|
|
|
|
2008-05-23 17:41:02 +04:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2024-02-21 16:40:19 +01:00
|
|
|
|
2010-04-22 16:31:39 +08:00
|
|
|
|
2011-05-10 19:30:07 +00:00
|
|
|
|
2010-04-22 16:31:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
2014-08-19 14:25:01 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-06 21:53:24 +10:00
|
|
|
|
2014-08-19 14:25:01 +03:00
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
2014-08-19 14:25:01 +03:00
|
|
|
|
2010-04-22 16:31:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-02 15:33:36 +02:00
|
|
|
|
2017-12-02 18:11:04 +01:00
|
|
|
|
2013-04-02 15:33:36 +02:00
|
|
|
|
2012-12-21 14:04:10 -08:00
|
|
|
|
|
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
|
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
|
|
|
|
|
2016-09-06 21:53:24 +10:00
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-02 18:11:04 +01:00
|
|
|
|
|
|
|
|
|
2011-09-13 16:17:00 -05:00
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
2014-08-19 14:25:01 +03:00
|
|
|
|
|
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
2014-11-14 13:51:22 +08:00
|
|
|
|
2014-08-19 14:25:03 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-18 11:19:24 -06:00
|
|
|
|
2012-12-21 14:04:10 -08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2012-05-21 21:57:39 +02:00
|
|
|
|
2010-04-22 16:31:37 +08:00
|
|
|
|
|
|
|
|
|
2015-04-14 14:27:58 +10:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2023-10-06 16:45:16 -05:00
|
|
|
|
2011-02-22 19:59:54 -07:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:39 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2011-05-10 19:30:07 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2025-07-23 08:28:42 +02:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-21 10:16:47 -05:00
|
|
|
|
|
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
2012-03-08 14:47:37 -08:00
|
|
|
|
2017-08-21 10:16:47 -05:00
|
|
|
|
|
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2008-05-23 17:41:02 +04:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2015-02-26 15:23:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
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: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2011-10-31 17:06:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-07 21:46:36 +08:00
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2014-08-13 16:55:13 +03:00
|
|
|
|
|
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-17 14:25:28 -06:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-21 10:16:47 -05:00
|
|
|
|
|
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:35 +08:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:36 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2015-04-14 14:27:58 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-15 06:38:33 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2010-04-22 16:31:39 +08:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-03 10:06:19 +02:00
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-03 10:06:19 +02:00
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-13 16:24:26 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2013-06-21 18:59:14 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
2012-07-13 16:24:26 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2012-07-03 05:48:55 +00:00
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
|
|
|
|
|
2012-07-13 16:24:26 +00:00
|
|
|
|
2011-12-13 14:51:59 -06:00
|
|
|
|
2014-08-13 16:55:13 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-03 05:48:55 +00:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-22 19:59:54 -07:00
|
|
|
|
2010-04-13 16:13:02 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
2024-09-09 15:09:02 +02:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-22 19:59:54 -07:00
|
|
|
|
2008-05-23 16:32:46 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|