16 Mar, 2021
1 commit
-
No functional change.
Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Thomas Gleixner
Link: https://lore.kernel.org/r/20210316100205.23492-1-krzysztof.kozlowski@canonical.com
06 Jun, 2018
2 commits
-
The upcoming fix for the -EBUSY return from affinity settings requires to
use the irq_move_irq() functionality even on irq remapped interrupts. To
avoid the out of line call, move the check for the pending bit into an
inline helper.Preparatory change for the real fix. No functional change.
Fixes: dccfe3147b42 ("x86/vector: Simplify vector move cleanup")
Signed-off-by: Thomas Gleixner
Cc: Joerg Roedel
Cc: Peter Zijlstra
Cc: Song Liu
Cc: Dmitry Safonov
Cc: stable@vger.kernel.org
Cc: Mike Travis
Cc: Borislav Petkov
Cc: Tariq Toukan
Cc: Dou Liyang
Link: https://lkml.kernel.org/r/20180604162224.471925894@linutronix.de -
The generic pending interrupt mechanism moves interrupts from the interrupt
handler on the original target CPU to the new destination CPU. This is
required for x86 and ia64 due to the way the interrupt delivery and
acknowledge works if the interrupts are not remapped.However that update can fail for various reasons. Some of them are valid
reasons to discard the pending update, but the case, when the previous move
has not been fully cleaned up is not a legit reason to fail.Check the return value of irq_do_set_affinity() for -EBUSY, which indicates
a pending cleanup, and rearm the pending move in the irq dexcriptor so it's
tried again when the next interrupt arrives.Fixes: 996c591227d9 ("x86/irq: Plug vector cleanup race")
Signed-off-by: Thomas Gleixner
Tested-by: Song Liu
Cc: Joerg Roedel
Cc: Peter Zijlstra
Cc: Song Liu
Cc: Dmitry Safonov
Cc: stable@vger.kernel.org
Cc: Mike Travis
Cc: Borislav Petkov
Cc: Tariq Toukan
Link: https://lkml.kernel.org/r/20180604162224.386544292@linutronix.de
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
23 Jun, 2017
1 commit
-
If an CPU goes offline, the interrupts are migrated away, but a eventually
pending interrupt move, which has not yet been made effective is kept
pending even if the outgoing CPU is the sole target of the pending affinity
mask. What's worse is, that the pending affinity mask is discarded even if
it would contain a valid subset of the online CPUs.Implement a helper function which allows to avoid these issues.
Signed-off-by: Thomas Gleixner
Cc: Jens Axboe
Cc: Marc Zyngier
Cc: Michael Ellerman
Cc: Keith Busch
Cc: Peter Zijlstra
Cc: Christoph Hellwig
Link: http://lkml.kernel.org/r/20170619235444.691345468@linutronix.de
21 Jun, 2015
1 commit
-
If an interrupt is marked with the no balancing flag, we still allow
setting the affinity for such an interrupt from the kernel itself, but
for interrupts which move the affinity from interrupt context via
irq_move_mask_irq() this runs into a check for the no balancing flag,
which in turn ends up with an endless storm of stack dumps because the
move pending flag is not reset.Allow the move for interrupts which have the no balancing flag set and
clear the move pending bit before checking for interrupts with the per
cpu flag set.Reported-by: Sergey Senozhatsky
Cc: Borislav Petkov
Cc: Jiang Liu
Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1506201002570.4107@nanos
Signed-off-by: Thomas Gleixner
12 Jun, 2015
1 commit
-
The functions irq_move_irq() and irq_move_masked_irq() expect that the
caller passes the top-level irq_data to them when hierarchical
irqdomains are enabled. But that's not true when called from
apic_ack_edge(), which results in a null pointer dereference by
idata->chip->irq_mask(idata).Instead of fixing callers to passing top-level irq_data, we rather
change irq_move_irq()/irq_move_masked_irq() to accept any irq_data.Signed-off-by: Jiang Liu
Cc: Konrad Rzeszutek Wilk
Cc: Tony Luck
Cc: Bjorn Helgaas
Cc: Benjamin Herrenschmidt
Cc: Randy Dunlap
Cc: Yinghai Lu
Cc: Borislav Petkov
Link: http://lkml.kernel.org/r/1433145945-789-3-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner
25 May, 2012
1 commit
-
All invocations of chip->irq_set_affinity() are doing the same return
value checks. Let them all use a common function.[ tglx: removed the silly likely while at it ]
Signed-off-by: Jiang Liu
Cc: Jiang Liu
Cc: Keping Chen
Link: http://lkml.kernel.org/r/1333120296-13563-3-git-send-email-jiang.liu@huawei.com
Signed-off-by: Thomas Gleixner
31 Mar, 2012
1 commit
-
irq_move_masked_irq() checks the return code of
chip->irq_set_affinity() only for 0, but IRQ_SET_MASK_OK_NOCOPY is
also a valid return code, which is there to avoid a redundant copy of
the cpumask. But in case of IRQ_SET_MASK_OK_NOCOPY we not only avoid
the redundant copy, we also fail to adjust the thread affinity of an
eventually threaded interrupt handler.Handle IRQ_SET_MASK_OK (==0) and IRQ_SET_MASK_OK_NOCOPY(==1) return
values correctly by checking the valid return values seperately.Signed-off-by: Jiang Liu
Cc: Jiang Liu
Cc: Keping Chen
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1333120296-13563-2-git-send-email-jiang.liu@huawei.com
Signed-off-by: Thomas Gleixner
31 Mar, 2011
1 commit
-
Fixes generated by 'codespell' and manually reviewed.
Signed-off-by: Lucas De Marchi
29 Mar, 2011
2 commits
-
All users converted to new interface.
Signed-off-by: Thomas Gleixner
-
Sigh, I'm overworked.
Signed-off-by: Thomas Gleixner
28 Mar, 2011
1 commit
-
We really need these flags for some of the interrupt chips. Move it
from internal state to irq_data and provide proper accessors.Signed-off-by: Thomas Gleixner
Cc: David Daney
19 Feb, 2011
6 commits
-
No need to lookup the irq descriptor when calling from a chip callback
function which has irq_data already handy.Signed-off-by: Thomas Gleixner
-
That's the right data structure to look at for arch code.
Accessor functions are provided.
irqd_is_per_cpu(irqdata);
irqd_can_balance(irqdata);Coders who access them directly will be tracked down and slapped with
stinking trouts.Signed-off-by: Thomas Gleixner
-
Signed-off-by: Thomas Gleixner
-
chip implementations need to know about it. Keep status in sync until
all users are fixed.Accessor function: irqd_is_setaffinity_pending(irqdata)
Coders who access them directly will be tracked down and slapped with
stinking trouts.Signed-off-by: Thomas Gleixner
-
Keep status in sync until all users are fixed.
Signed-off-by: Thomas Gleixner
-
Keep status in sync until all abusers are fixed.
Signed-off-by: Thomas Gleixner
03 Feb, 2011
1 commit
-
move_native_irq() masks and unmasks the interrupt line
unconditionally, but the interrupt line might be masked due to a
threaded oneshot handler in progress. Unmasking the line in that case
can lead to interrupt storms. Observed on PREEMPT_RT.Originally-from: Ingo Molnar
Signed-off-by: Thomas Gleixner
Cc: stable@kernel.org
04 Oct, 2010
4 commits
-
Wrap the old chip function set_affinity() until the migration is
complete and the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function unmask() until the migration is complete
and the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Wrap the old chip function mask() until the migration is complete and
the old chip functions are removed.Signed-off-by: Thomas Gleixner
Cc: Peter Zijlstra
LKML-Reference:
Reviewed-by: H. Peter Anvin
Reviewed-by: Ingo Molnar -
Convert all references in the core code to orq, chip, handler_data,
chip_data, msi_desc, affinity to irq_data.*Signed-off-by: Thomas Gleixner
Reviewed-by: Ingo Molnar
15 Dec, 2009
1 commit
-
Convert locks which cannot be sleeping locks in preempt-rt to
raw_spinlocks.Signed-off-by: Thomas Gleixner
Acked-by: Peter Zijlstra
Acked-by: Ingo Molnar
21 Jul, 2009
1 commit
-
irq_set_thread_affinity() calls set_cpus_allowed_ptr() which might
sleep, but irq_set_thread_affinity() is called with desc->lock held
and can be called from hard interrupt context as well. The code has
another bug as it does not hold a ref on the task struct as required
by set_cpus_allowed_ptr().Just set the IRQTF_AFFINITY bit in action->thread_flags. The next time
the thread runs it migrates itself. Solves all of the above problems
nicely.Add kerneldoc to irq_set_thread_affinity() while at it.
Signed-off-by: Thomas Gleixner
LKML-Reference:
28 Apr, 2009
1 commit
-
irq_set_affinity() and move_masked_irq() try to assign affinity
before calling chip set_affinity(). Some archs are assigning it
in ->set_affinity() again.We do something like:
cpumask_cpy(desc->affinity, mask);
desc->chip->set_affinity(mask);But in the failure path, affinity should not be touched - otherwise
we'll end up with a different affinity mask despite the failure to
migrate the IRQ.So try to update the afffinity only if set_affinity returns with 0.
Also call irq_set_thread_affinity accordingly.v2: update after "irq, x86: Remove IRQ_DISABLED check in process context IRQ move"
v3: according to Ingo, change set_affinity() in irq_chip should return int.
v4: update comments by removing moving irq_desc code.[ Impact: fix /proc/irq/*/smp_affinity setting corner case bug ]
Signed-off-by: Yinghai Lu
Cc: Andrew Morton
Cc: Suresh Siddha
Cc: "Eric W. Biederman"
Cc: Rusty Russell
LKML-Reference:
Signed-off-by: Ingo Molnar
12 Jan, 2009
1 commit
-
Impact: reduce memory usage, use new cpumask API.
Replace the affinity and pending_masks with cpumask_var_t's. This adds
to the significant size reduction done with the SPARSE_IRQS changes.The added functions (init_alloc_desc_masks & init_copy_desc_masks) are
in the include file so they can be inlined (and optimized out for the
!CONFIG_CPUMASKS_OFFSTACK case.) [Naming chosen to be consistent with
the other init*irq functions, as well as the backwards arg declaration
of "from, to" instead of the more common "to, from" standard.]Includes a slight change to the declaration of struct irq_desc to embed
the pending_mask within ifdef(CONFIG_SMP) to be consistent with other
references, and some small changes to Xen.Tested: sparse/non-sparse/cpumask_offstack/non-cpumask_offstack/nonuma/nosmp on x86_64
Signed-off-by: Mike Travis
Cc: Chris Wright
Cc: Jeremy Fitzhardinge
Cc: KOSAKI Motohiro
Cc: Venkatesh Pallipadi
Cc: virtualization@lists.osdl.org
Cc: xen-devel@lists.xensource.com
Cc: Yinghai Lu
13 Dec, 2008
1 commit
-
Impact: change existing irq_chip API
Not much point with gentle transition here: the struct irq_chip's
setaffinity method signature needs to change.Fortunately, not widely used code, but hits a few architectures.
Note: In irq_select_affinity() I save a temporary in by mangling
irq_desc[irq].affinity directly. Ingo, does this break anything?(Folded in fix from KOSAKI Motohiro)
Signed-off-by: Rusty Russell
Signed-off-by: Mike Travis
Reviewed-by: Grant Grundler
Acked-by: Ingo Molnar
Cc: ralf@linux-mips.org
Cc: grundler@parisc-linux.org
Cc: jeremy@xensource.com
Cc: KOSAKI Motohiro
10 Nov, 2008
1 commit
-
Impact: preserve user-modified affinities on interrupts
Kumar Galak noticed that commit
18404756765c713a0be4eb1082920c04822ce588 (genirq: Expose default irq
affinity mask (take 3))overrides an already set affinity setting across a free /
request_irq(). Happens e.g. with ifdown/ifup of a network device.Change the logic to mark the affinities as set and keep them
intact. This also fixes the unlocked access to irq_desc in
irq_select_affinity() when called from irq_affinity_proc_write()Signed-off-by: Thomas Gleixner
Signed-off-by: Ingo Molnar
16 Oct, 2008
1 commit
-
add CONFIG_HAVE_SPARSE_IRQ to for use condensed array.
Get rid of irq_desc[] array assumptions.Preallocate 32 irq_desc, and irq_desc() will try to get more.
( No change in functionality is expected anywhere, except the odd build
failure where we missed a code site or where a crossing commit itroduces
new irq_desc[] usage. )v2: according to Eric, change get_irq_desc() to irq_desc()
Signed-off-by: Yinghai Lu
Signed-off-by: Ingo Molnar
27 Feb, 2007
1 commit
-
move_native_irqs tries to do the right thing when migrating irqs
by disabling them. However disabling them is a software logical
thing, not a hardware thing. This has always been a little flaky
and after Ingo's latest round of changes it is guaranteed to not
mask the apic.So this patch fixes move_native_irq to directly call the mask and
unmask chip methods to guarantee that we mask the irq when we
are migrating it. We must do this as it is required by
all code that call into the path.Since we don't know the masked status when IRQ_DISABLED is
set so we will not be able to restore it. The patch makes the code
just give up and trying again the next time this routing is called.Signed-off-by: Eric W. Biederman
Acked-by: Suresh Siddha
Signed-off-by: Linus Torvalds
04 Oct, 2006
2 commits
-
Currently move_native_irq disables and renables the irq we are migrating to
ensure we don't take that irq when we are actually doing the migration
operation. Disabling the irq needs to happen but sometimes doing the work is
move_native_irq is too late.On x86 with ioapics the irq move sequences needs to be:
edge_triggered:
mask irq.
move irq.
unmask irq.
ack irq.
level_triggered:
mask irq.
ack irq.
move irq.
unmask irq.We can easily perform the edge triggered sequence, with the current defintion
of move_native_irq. However the level triggered case does not map well. For
that I have added move_masked_irq, to allow me to disable the irqs around both
the ack and the move.Q: Why have we not seen this problem earlier?
A: The only symptom I have been able to reproduce is that if we change
the vector before acknowleding an irq the wrong irq is acknowledged.
Since we currently are not reprogramming the irq vector during
migration no problems show up.We have to mask the irq before we acknowledge the irq or else we could
hit a window where an irq is asserted just before we acknowledge it.Edge triggered irqs do not have this problem because acknowledgements
do not propogate in the same way.Signed-off-by: Eric W. Biederman
Cc: Ingo Molnar
Cc: Thomas Gleixner
Cc: Benjamin Herrenschmidt
Cc: Rajesh Shah
Cc: Andi Kleen
Cc: "Protasevich, Natalie"
Cc: "Luck, Tony"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The primary aim of this patchset is to remove maintenances problems caused by
the irq infrastructure. The two big issues I address are an artificially
small cap on the number of irqs, and that MSI assumes vector == irq. My
primary focus is on x86_64 but I have touched other architectures where
necessary to keep them from breaking.- To increase the number of irqs I modify the code to look at the (cpu,
vector) pair instead of just looking at the vector.With a large number of irqs available systems with a large irq count no
longer need to compress their irq numbers to fit. Removing a lot of brittle
special cases.For acpi guys the result is that irq == gsi.
- Addressing the fact that MSI assumes irq == vector takes a few more
patches. But suffice it to say when I am done none of the generic irq code
even knows what a vector is.In quick testing on a large Unisys x86_64 machine we stumbled over at least
one driver that assumed that NR_IRQS could always fit into an 8 bit number.
This driver is clearly buggy today. But this has become a class of bugs that
it is now much easier to hit.This patch:
This is a minor space optimization. In practice I don't think this has any
affect because of our alignment constraints and the other fields but there is
not point in chewing up an uncessary word and since we already read the flag
field this should improve the cache hit ratio of the irq handler.Signed-off-by: Eric W. Biederman
Cc: Ingo Molnar
Cc: Thomas Gleixner
Cc: Benjamin Herrenschmidt
Cc: Rajesh Shah
Cc: Andi Kleen
Cc: "Protasevich, Natalie"
Cc: "Luck, Tony"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
30 Jun, 2006
4 commits
-
Consolidation: remove the pending_irq_cpumask[NR_IRQS] array and move it into
the irq_desc[NR_IRQS].pending_mask field.Signed-off-by: Ingo Molnar
Signed-off-by: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Cleanup: remove irq_desc_t use from the generic IRQ code, and mark it
obsolete.Signed-off-by: Ingo Molnar
Signed-off-by: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Cleanup: remove irq_descp() - explicit use of irq_desc[] is shorter and more
readable.Signed-off-by: Ingo Molnar
Signed-off-by: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
This patch-queue improves the generic IRQ layer to be truly generic, by adding
various abstractions and features to it, without impacting existing
functionality.While the queue can be best described as "fix and improve everything in the
generic IRQ layer that we could think of", and thus it consists of many
smaller features and lots of cleanups, the one feature that stands out most is
the new 'irq chip' abstraction.The irq-chip abstraction is about describing and coding and IRQ controller
driver by mapping its raw hardware capabilities [and quirks, if needed] in a
straightforward way, without having to think about "IRQ flow"
(level/edge/etc.) type of details.This stands in contrast with the current 'irq-type' model of genirq
architectures, which 'mixes' raw hardware capabilities with 'flow' details.
The patchset supports both types of irq controller designs at once, and
converts i386 and x86_64 to the new irq-chip design.As a bonus side-effect of the irq-chip approach, chained interrupt controllers
(master/slave PIC constructs, etc.) are now supported by design as well.The end result of this patchset intends to be simpler architecture-level code
and more consolidation between architectures.We reused many bits of code and many concepts from Russell King's ARM IRQ
layer, the merging of which was one of the motivations for this patchset.This patch:
rename desc->handler to desc->chip.
Originally i did not want to do this, because it's a big patch. But having
both "desc->handler", "desc->handle_irq" and "action->handler" caused a
large degree of confusion and made the code appear alot less clean than it
truly is.I have also attempted a dual approach as well by introducing a
desc->chip alias - but that just wasnt robust enough and broke
frequently.So lets get over with this quickly. The conversion was done automatically
via scripts and converts all the code in the kernel.This renaming patch is the first one amongst the patches, so that the
remaining patches can stay flexible and can be merged and split up
without having some big monolithic patch act as a merge barrier.[akpm@osdl.org: build fix]
[akpm@osdl.org: another build fix]
Signed-off-by: Ingo Molnar
Signed-off-by: Thomas Gleixner
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
23 Jun, 2006
1 commit
-
If you get to that point in the code it means that desc->move_irq is set,
pending_irq_cpumask[irq] and cpu_online_map should have a value. Still
pretty good chance anding those two you'll still have a value. So these
two branch predictors should be inverted.Signed-off-by: Daniel Walker
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
11 Apr, 2006
1 commit
-
Signed-off-by: Christoph Hellwig
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds