linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Sebastian Frias <sf84@laposte.net>,
	Marc Zyngier <marc.zyngier@arm.com>, Mason <slash.tmp@free.fr>,
	Jason Cooper <jason@lakedaemon.net>,
	Thomas Gleixner <tglx@linutronix.de>, Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 3.12 63/72] genirq/generic_chip: Add irq_unmap callback
Date: Mon,  7 Nov 2016 14:30:43 +0100	[thread overview]
Message-ID: <1ebdb8075615f32089ece05fecc8aa9f554e8b84.1478525307.git.jslaby@suse.cz> (raw)
In-Reply-To: <7c0dfa3b2ea712bd2cc6343445f263815b81918f.1478525307.git.jslaby@suse.cz>
In-Reply-To: <cover.1478523828.git.jslaby@suse.cz>

From: Sebastian Frias <sf84@laposte.net>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit ee26c013cdee0b947e29d6cadfb9ff3341c69ff9 upstream.

Without this patch irq_domain_disassociate() cannot properly release the
interrupt. In fact, irq_map_generic_chip() checks a bit on 'gc->installed'
but said bit is never cleared, only set.

Commit 088f40b7b027 ("genirq: Generic chip: Add linear irq domain support")
added irq_map_generic_chip() function and also stated "This lacks a removal
function for now".

This commit provides an implementation of an unmap function that can be
called by irq_domain_disassociate().

[ tglx: Made the function static and removed the export as we have neither
  	a prototype nor a modular user. ]

[js] use irq_get_irq_data, irq_set_chip_and_handler, and
     irq_set_chip_data in 3.12

Fixes: 088f40b7b027 ("genirq: Generic chip: Add linear irq domain support")
Signed-off-by: Sebastian Frias <sf84@laposte.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mason <slash.tmp@free.fr>
Cc: Jason Cooper <jason@lakedaemon.net>
Link: http://lkml.kernel.org/r/579F5C5A.2070507@laposte.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 kernel/irq/generic-chip.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
index 452d6f2ba21d..6733fbf14dbe 100644
--- a/kernel/irq/generic-chip.c
+++ b/kernel/irq/generic-chip.c
@@ -395,8 +395,28 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
 	return 0;
 }
 
+static void irq_unmap_generic_chip(struct irq_domain *d, unsigned int virq)
+{
+	struct irq_data *data = irq_get_irq_data(virq);
+	struct irq_domain_chip_generic *dgc = d->gc;
+	unsigned int hw_irq = data->hwirq;
+	struct irq_chip_generic *gc;
+	int irq_idx;
+
+	gc = irq_get_domain_generic_chip(d, hw_irq);
+	if (!gc)
+		return;
+
+	irq_idx = hw_irq % dgc->irqs_per_chip;
+
+	clear_bit(irq_idx, &gc->installed);
+	irq_set_chip_and_handler(virq, &no_irq_chip, NULL);
+	irq_set_chip_data(virq, NULL);
+}
+
 struct irq_domain_ops irq_generic_chip_ops = {
 	.map	= irq_map_generic_chip,
+	.unmap  = irq_unmap_generic_chip,
 	.xlate	= irq_domain_xlate_onetwocell,
 };
 EXPORT_SYMBOL_GPL(irq_generic_chip_ops);
-- 
2.10.2

  parent reply	other threads:[~2016-11-07 13:34 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161107130417epcas3p4869f405f9f73d6336d5dbfd0e118b62b@epcas3p4.samsung.com>
2016-11-07 13:04 ` [PATCH 3.12 00/72] 3.12.67-stable review Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 01/72] i40e: avoid NULL pointer dereference and recursive errors on early PCI error Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 02/72] reiserfs: Unlock superblock before calling reiserfs_quota_on_mount() Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 03/72] scsi: ibmvfc: Fix I/O hang when port is not mapped Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 04/72] ext4: reinforce check of i_dtime when clearing high fields of uid and gid Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 05/72] ext4: allow DAX writeback for hole punch Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 06/72] cfq: fix starvation of asynchronous writes Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 07/72] pstore: Fix buffer overflow while write offset equal to buffer size Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 08/72] ipc: remove use of seq_printf return value Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 09/72] gpio: mpc8xxx: Correct irq handler function Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 10/72] regulator: tps65910: Work around silicon erratum SWCZ010 Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 11/72] mmc: block: don't use CMD23 with very old MMC cards Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 12/72] pstore/core: drop cmpxchg based updates Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 13/72] pstore/ram: Use memcpy_toio instead of memcpy Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 14/72] pstore/ram: Use memcpy_fromio() to save old buffer Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 15/72] dm: mark request_queue dead before destroying the DM device Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 16/72] powerpc/vdso64: Use double word compare on pointers Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 17/72] powerpc/powernv: Use CPU-endian PEST in pnv_pci_dump_p7ioc_diag_data() Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 18/72] powerpc/64: Fix incorrect return value from __copy_tofrom_user Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 19/72] powerpc/pseries: Fix stack corruption in htpe code Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 20/72] zfcp: fix fc_host port_type with NPIV Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 21/72] zfcp: fix ELS/GS request&response length for hardware data router Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 22/72] zfcp: close window with unblocked rport during rport gone Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 23/72] zfcp: retain trace level for SCSI and HBA FSF response records Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 24/72] zfcp: restore: Dont use 0 to indicate invalid LUN in rec trace Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 25/72] zfcp: trace on request for open and close of WKA port Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 26/72] zfcp: restore tracing of handle for port and LUN with HBA records Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 27/72] zfcp: fix D_ID field with actual value on tracing SAN responses Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 28/72] zfcp: fix payload trace length for SAN request&response Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 29/72] zfcp: trace full payload of all SAN records (req,resp,iels) Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 30/72] scsi: zfcp: spin_lock_irqsave() is not nestable Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 31/72] fbdev/efifb: Fix 16 color palette entry calculation Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 32/72] mb86a20s: fix the locking logic Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 33/72] mb86a20s: fix demod settings Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 34/72] cx231xx: don't return error on success Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 35/72] cx231xx: fix GPIOs for Pixelview SBTVD hybrid Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 36/72] MIPS: ptrace: Fix regs_return_value for kernel context Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 37/72] Input: elantech - force needed quirks on Fujitsu H760 Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 38/72] Input: elantech - add Fujitsu Lifebook E556 to force crc_enabled Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 39/72] NFSv4: Open state recovery must account for file permission changes Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 40/72] scsi: Fix use-after-free Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 41/72] metag: Only define atomic_dec_if_positive conditionally Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 42/72] compiler: Allow 1- and 2-byte smp_load_acquire() and smp_store_release() Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 43/72] ipc/sem.c: fix complex_count vs. simple op race Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 44/72] arc: don't leak bits of kernel stack into coredump Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 45/72] fs/super.c: fix race between freeze_super() and thaw_super() Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 46/72] cifs: Limit the overall credit acquired Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 47/72] Clarify locking of cifs file and tcon structures and make more granular Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 48/72] Display number of credits available Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 49/72] Set previous session id correctly on SMB3 reconnect Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 50/72] SMB3: GUIDs should be constructed as random but valid uuids Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 51/72] Do not send SMB3 SET_INFO request if nothing is changing Jiri Slaby
2016-11-07 13:04   ` [PATCH 3.12 52/72] net/mlx4_core: Allow resetting VF admin mac to zero Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 53/72] isofs: Do not return EACCES for unknown filesystems Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 54/72] mmc: core: Annotate cmd_hdr as __le32 Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 55/72] ubifs: Fix xattr_names length in exit paths Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 56/72] drm/radeon: narrow asic_init for virtualization Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 57/72] drm/radeon/si/dpm: fix phase shedding setup Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 58/72] drm/radeon: change vblank_time's calculation method to reduce computational error Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 59/72] mm/hugetlb: fix memory offline with hugepage size > memory block size Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 60/72] introduce NETIF_F_GSO_ENCAP_ALL helper mask Jiri Slaby
2016-11-07 13:05   ` [PATCH 3.12 61/72] tunnels: Remove encapsulation offloads on decap Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 62/72] powerpc/eeh: Null check uses of eeh_pe_bus_get Jiri Slaby
2016-11-07 13:30   ` Jiri Slaby [this message]
2016-11-07 13:30   ` [PATCH 3.12 64/72] uio: fix dmem_region_start computation Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 65/72] crypto: gcm - Fix IV buffer size in crypto_gcm_setkey Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 66/72] hwrng: omap - Only fail if pm_runtime_get_sync returns < 0 Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 67/72] perf symbols: Fixup symbol sizes before picking best ones Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 68/72] powerpc/nvram: Fix an incorrect partition merge Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 69/72] Revert "fix minor infoleak in get_user_ex()" Jiri Slaby
2016-11-07 16:45     ` Linus Torvalds
2016-11-08 10:36       ` Greg KH
2016-11-07 13:30   ` [PATCH 3.12 70/72] i2c: core: fix NULL pointer dereference under race condition Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 71/72] scsi: arcmsr: Buffer overflow in arcmsr_iop_message_xfer() Jiri Slaby
2016-11-07 13:30   ` [PATCH 3.12 72/72] usb: hub: change CLEAR_FEATURE to SET_FEATURE Jiri Slaby
2016-11-07 17:16   ` [PATCH 3.12 00/72] 3.12.67-stable review Guenter Roeck
2016-11-08 15:40     ` Jiri Slaby
2016-11-09  4:14       ` Guenter Roeck
2016-11-10 18:50         ` Jiri Slaby
2016-11-07 18:34   ` Shuah Khan
2016-11-10 18:51     ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ebdb8075615f32089ece05fecc8aa9f554e8b84.1478525307.git.jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=sf84@laposte.net \
    --cc=slash.tmp@free.fr \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).