1
0
Files
kernel-49/kernel/irq/migration.c
Greg Kroah-Hartman c19ae10e64 Merge 4.9.226 into android-4.9-q
Changes in 4.9.226
	ax25: fix setsockopt(SO_BINDTODEVICE)
	net: ipip: fix wrong address family in init error path
	net: revert "net: get rid of an signed integer overflow in ip_idents_reserve()"
	net sched: fix reporting the first-time use timestamp
	sctp: Start shutdown on association restart if in SHUTDOWN-SENT state and socket is closed
	net/mlx5e: Update netdev txq on completions during closure
	net: qrtr: Fix passing invalid reference to qrtr_local_enqueue()
	net/mlx5: Add command entry handling completion
	net: sun: fix missing release regions in cas_init_one().
	net/mlx4_core: fix a memory leak bug.
	uapi: fix linux/if_pppol2tp.h userspace compilation errors
	IB/cma: Fix reference count leak when no ipv4 addresses are set
	gpio: tegra: mask GPIO IRQs during IRQ shutdown
	net: microchip: encx24j600: add missed kthread_stop
	gfs2: move privileged user check to gfs2_quota_lock_check
	cachefiles: Fix race between read_waiter and read_copier involving op->to_do
	usb: gadget: legacy: fix redundant initialization warnings
	cifs: Fix null pointer check in cifs_read
	Input: usbtouchscreen - add support for BonXeon TP
	Input: evdev - call input_flush_device() on release(), not flush()
	Input: xpad - add custom init packet for Xbox One S controllers
	Input: i8042 - add ThinkPad S230u to i8042 reset list
	Input: synaptics-rmi4 - fix error return code in rmi_driver_probe()
	IB/qib: Call kobject_put() when kobject_init_and_add() fails
	ARM: dts: imx: Correct B850v3 clock assignment
	ARM: dts: imx6q-bx50v3: Add internal switch
	ARM: dts/imx6q-bx50v3: Set display interface clock parents
	ALSA: hwdep: fix a left shifting 1 by 31 UB bug
	ALSA: usb-audio: mixer: volume quirk for ESS Technology Asus USB DAC
	exec: Always set cap_ambient in cap_bprm_set_creds
	libceph: ignore pool overlay and cache logic on redirects
	mm: remove VM_BUG_ON(PageSlab()) from page_mapcount()
	fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
	include/asm-generic/topology.h: guard cpumask_of_node() macro argument
	iommu: Fix reference count leak in iommu_group_alloc.
	parisc: Fix kernel panic in mem_init()
	mac80211: mesh: fix discovery timer re-arming issue / crash
	x86/dma: Fix max PFN arithmetic overflow on 32 bit systems
	xfrm: allow to accept packets with ipv6 NEXTHDR_HOP in xfrm_input
	xfrm: fix a warning in xfrm_policy_insert_list
	xfrm: fix a NULL-ptr deref in xfrm_local_error
	vti4: eliminated some duplicate code.
	ip_vti: receive ipip packet by calling ip_tunnel_rcv
	netfilter: nft_reject_bridge: enable reject with bridge vlan
	netfilter: ipset: Fix subcounter update skip
	netfilter: nf_conntrack_pptp: prevent buffer overflows in debug code
	qlcnic: fix missing release in qlcnic_83xx_interrupt_test.
	bonding: Fix reference count leak in bond_sysfs_slave_add.
	netfilter: nf_conntrack_pptp: fix compilation warning with W=1 build
	genirq/generic_pending: Do not lose pending affinity update
	net: rtnl_configure_link: fix dev flags changes arg to __dev_notify_flags
	mm/vmalloc.c: don't dereference possible NULL pointer in __vunmap()
	sc16is7xx: move label 'err_spi' to correct section
	net: hns: Fixes the missing put_device in positive leg for roce reset
	scsi: zfcp: fix request object use-after-free in send path causing wrong traces
	Linux 4.9.226

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I64b95b6296df8de22f3f7ee64b13140f04215478
2020-06-06 18:02:34 +03:00

92 lines
2.2 KiB
C

#include <linux/irq.h>
#include <linux/interrupt.h>
#include "internals.h"
void irq_move_masked_irq(struct irq_data *idata)
{
struct irq_desc *desc = irq_data_to_desc(idata);
struct irq_data *data = &desc->irq_data;
struct irq_chip *chip = data->chip;
if (likely(!irqd_is_setaffinity_pending(data)))
return;
irqd_clr_move_pending(data);
/*
* Paranoia: cpu-local interrupts shouldn't be calling in here anyway.
*/
if (irqd_is_per_cpu(data)) {
WARN_ON(1);
return;
}
if (unlikely(cpumask_empty(desc->pending_mask)))
return;
if (!chip->irq_set_affinity)
return;
assert_raw_spin_locked(&desc->lock);
/*
* If there was a valid mask to work with, please
* do the disable, re-program, enable sequence.
* This is *not* particularly important for level triggered
* but in a edge trigger case, we might be setting rte
* when an active trigger is coming in. This could
* cause some ioapics to mal-function.
* Being paranoid i guess!
*
* For correct operation this depends on the caller
* masking the irqs.
*/
if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) {
int ret;
ret = irq_do_set_affinity(data, desc->pending_mask, false);
/*
* If the there is a cleanup pending in the underlying
* vector management, reschedule the move for the next
* interrupt. Leave desc->pending_mask intact.
*/
if (ret == -EBUSY) {
irqd_set_move_pending(data);
return;
}
}
cpumask_clear(desc->pending_mask);
}
void irq_move_irq(struct irq_data *idata)
{
bool masked;
/*
* Get top level irq_data when CONFIG_IRQ_DOMAIN_HIERARCHY is enabled,
* and it should be optimized away when CONFIG_IRQ_DOMAIN_HIERARCHY is
* disabled. So we avoid an "#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY" here.
*/
idata = irq_desc_get_irq_data(irq_data_to_desc(idata));
if (likely(!irqd_is_setaffinity_pending(idata)))
return;
if (unlikely(irqd_irq_disabled(idata)))
return;
/*
* Be careful vs. already masked interrupts. If this is a
* threaded interrupt with ONESHOT set, we can end up with an
* interrupt storm.
*/
masked = irqd_irq_masked(idata);
if (!masked)
idata->chip->irq_mask(idata);
irq_move_masked_irq(idata);
if (!masked)
idata->chip->irq_unmask(idata);
}