Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

genirq: Remove the deprecated 'IRQF_DISABLED' request_irq() flag entirely

The IRQF_DISABLED flag is a NOOP and has been scheduled for removal
since Linux v2.6.36 by commit 6932bf37bed4 ("genirq: Remove
IRQF_DISABLED from core code").

According to commit e58aa3d2d0cc ("genirq: Run irq handlers with
interrupts disabled"), running IRQ handlers with interrupts
enabled can cause stack overflows when the interrupt line of the
issuing device is still active.

This patch ends the grace period for IRQF_DISABLED (i.e.,
SA_INTERRUPT in older versions of Linux) and removes the
definition and all remaining usages of this flag.

There's still a few non-functional references left in the kernel
source:

- The bigger hunk in Documentation/scsi/ncr53c8xx.txt is removed entirely
as IRQF_DISABLED is gone now; the usage in older kernel versions
(including the old SA_INTERRUPT flag) should be discouraged. The
trouble of using IRQF_SHARED is a general problem and not specific to
any driver.

- I left the reference in Documentation/PCI/MSI-HOWTO.txt untouched since
it has already been removed in linux-next.

- All remaining references are changelogs that I suggest to keep.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Cc: Afzal Mohammed <afzal@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Ewan Milne <emilne@redhat.com>
Cc: Eyal Perry <eyalpe@mellanox.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Hongliang Tao <taohl@lemote.com>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nishanth Menon <nm@ti.com>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Lambert <lambert.quentin@gmail.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Sricharan R <r.sricharan@ti.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
Cc: iss_storagedev@hp.com
Cc: linux-mips@linux-mips.org
Cc: linux-mtd@lists.infradead.org
Link: http://lkml.kernel.org/r/1425565425-12604-1-git-send-email-valentinrothberg@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Valentin Rothberg and committed by
Ingo Molnar
d8bf368d 33ca8a53

+13 -49
-25
Documentation/scsi/ncr53c8xx.txt
··· 786 786 irqm:1 same as initial settings (assumed BIOS settings) 787 787 irqm:2 always totem pole 788 788 irqm:0x10 driver will not use IRQF_SHARED flag when requesting irq 789 - irqm:0x20 driver will not use IRQF_DISABLED flag when requesting irq 790 789 791 790 (Bits 0x10 and 0x20 can be combined with hardware irq mode option) 792 791 ··· 1229 1230 they only refer to system buffers that are well aligned. So, a work around 1230 1231 may only be needed under Linux when a scatter/gather list is not used and 1231 1232 when the SCSI DATA IN phase is reentered after a phase mismatch. 1232 - 1233 - 14.5 IRQ sharing problems 1234 - 1235 - When an IRQ is shared by devices that are handled by different drivers, it 1236 - may happen that one driver complains about the request of the IRQ having 1237 - failed. Inder Linux-2.0, this may be due to one driver having requested the 1238 - IRQ using the IRQF_DISABLED flag but some other having requested the same IRQ 1239 - without this flag. Under both Linux-2.0 and linux-2.2, this may be caused by 1240 - one driver not having requested the IRQ with the IRQF_SHARED flag. 1241 - 1242 - By default, the ncr53c8xx and sym53c8xx drivers request IRQs with both the 1243 - IRQF_DISABLED and the IRQF_SHARED flag under Linux-2.0 and with only the IRQF_SHARED 1244 - flag under Linux-2.2. 1245 - 1246 - Under Linux-2.0, you can disable use of IRQF_DISABLED flag from the boot 1247 - command line by using the following option: 1248 - 1249 - ncr53c8xx=irqm:0x20 (for the generic ncr53c8xx driver) 1250 - sym53c8xx=irqm:0x20 (for the sym53c8xx driver) 1251 - 1252 - If this does not fix the problem, then you may want to check how all other 1253 - drivers are requesting the IRQ and report the problem. Note that if at least 1254 - a single driver does not request the IRQ with the IRQF_SHARED flag (share IRQ), 1255 - then the request of the IRQ obviously will not succeed for all the drivers. 1256 1233 1257 1234 15. SCSI problem troubleshooting 1258 1235
-4
Documentation/scsi/tmscsim.txt
··· 107 107 MHz PCI bus works for me, though, but I don't recommend using higher clocks 108 108 than the 33.33 MHz being in the PCI spec. 109 109 110 - If you want to share the IRQ with another device and the driver refuses to 111 - do so, you might succeed with changing the DC390_IRQ type in tmscsim.c to 112 - IRQF_SHARED | IRQF_DISABLED. 113 - 114 110 115 111 3.Features 116 112 ----------
+1 -1
arch/mips/loongson/loongson-3/hpet.c
··· 162 162 163 163 static struct irqaction hpet_irq = { 164 164 .handler = hpet_irq_handler, 165 - .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER, 165 + .flags = IRQF_NOBALANCING | IRQF_TIMER, 166 166 .name = "hpet", 167 167 }; 168 168
+2 -2
drivers/block/cpqarray.c
··· 405 405 goto Enomem4; 406 406 } 407 407 hba[i]->access.set_intr_mask(hba[i], 0); 408 - if (request_irq(hba[i]->intr, do_ida_intr, 409 - IRQF_DISABLED|IRQF_SHARED, hba[i]->devname, hba[i])) 408 + if (request_irq(hba[i]->intr, do_ida_intr, IRQF_SHARED, 409 + hba[i]->devname, hba[i])) 410 410 { 411 411 printk(KERN_ERR "cpqarray: Unable to get irq %d for %s\n", 412 412 hba[i]->intr, hba[i]->devname);
+2 -2
drivers/bus/omap_l3_noc.c
··· 284 284 */ 285 285 l3->debug_irq = platform_get_irq(pdev, 0); 286 286 ret = devm_request_irq(l3->dev, l3->debug_irq, l3_interrupt_handler, 287 - IRQF_DISABLED, "l3-dbg-irq", l3); 287 + 0x0, "l3-dbg-irq", l3); 288 288 if (ret) { 289 289 dev_err(l3->dev, "request_irq failed for %d\n", 290 290 l3->debug_irq); ··· 293 293 294 294 l3->app_irq = platform_get_irq(pdev, 1); 295 295 ret = devm_request_irq(l3->dev, l3->app_irq, l3_interrupt_handler, 296 - IRQF_DISABLED, "l3-app-irq", l3); 296 + 0x0, "l3-app-irq", l3); 297 297 if (ret) 298 298 dev_err(l3->dev, "request_irq failed for %d\n", l3->app_irq); 299 299
+4 -6
drivers/bus/omap_l3_smx.c
··· 251 251 } 252 252 253 253 l3->debug_irq = platform_get_irq(pdev, 0); 254 - ret = request_irq(l3->debug_irq, omap3_l3_app_irq, 255 - IRQF_DISABLED | IRQF_TRIGGER_RISING, 256 - "l3-debug-irq", l3); 254 + ret = request_irq(l3->debug_irq, omap3_l3_app_irq, IRQF_TRIGGER_RISING, 255 + "l3-debug-irq", l3); 257 256 if (ret) { 258 257 dev_err(&pdev->dev, "couldn't request debug irq\n"); 259 258 goto err1; 260 259 } 261 260 262 261 l3->app_irq = platform_get_irq(pdev, 1); 263 - ret = request_irq(l3->app_irq, omap3_l3_app_irq, 264 - IRQF_DISABLED | IRQF_TRIGGER_RISING, 265 - "l3-app-irq", l3); 262 + ret = request_irq(l3->app_irq, omap3_l3_app_irq, IRQF_TRIGGER_RISING, 263 + "l3-app-irq", l3); 266 264 if (ret) { 267 265 dev_err(&pdev->dev, "couldn't request app irq\n"); 268 266 goto err2;
+1 -2
drivers/mtd/nand/hisi504_nand.c
··· 758 758 759 759 hisi_nfc_host_init(host); 760 760 761 - ret = devm_request_irq(dev, irq, hinfc_irq_handle, IRQF_DISABLED, 762 - "nandc", host); 761 + ret = devm_request_irq(dev, irq, hinfc_irq_handle, 0x0, "nandc", host); 763 762 if (ret) { 764 763 dev_err(dev, "failed to request IRQ\n"); 765 764 goto err_res;
+1 -2
drivers/usb/isp1760/isp1760-core.c
··· 151 151 } 152 152 153 153 if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) { 154 - ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED | 155 - IRQF_DISABLED); 154 + ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED); 156 155 if (ret < 0) { 157 156 isp1760_hcd_unregister(&isp->hcd); 158 157 return ret;
+2 -2
drivers/usb/isp1760/isp1760-udc.c
··· 1451 1451 1452 1452 sprintf(udc->irqname, "%s (udc)", devname); 1453 1453 1454 - ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | IRQF_DISABLED | 1455 - irqflags, udc->irqname, udc); 1454 + ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags, 1455 + udc->irqname, udc); 1456 1456 if (ret < 0) 1457 1457 goto error; 1458 1458
-3
include/linux/interrupt.h
··· 39 39 * These flags used only by the kernel as part of the 40 40 * irq handling routines. 41 41 * 42 - * IRQF_DISABLED - keep irqs disabled when calling the action handler. 43 - * DEPRECATED. This flag is a NOOP and scheduled to be removed 44 42 * IRQF_SHARED - allow sharing the irq among several devices 45 43 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur 46 44 * IRQF_TIMER - Flag to mark this interrupt as timer interrupt ··· 56 58 * IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device 57 59 * resume time. 58 60 */ 59 - #define IRQF_DISABLED 0x00000020 60 61 #define IRQF_SHARED 0x00000080 61 62 #define IRQF_PROBE_SHARED 0x00000100 62 63 #define __IRQF_TIMER 0x00000200