Skip to content

Commit

Permalink
genirq: Remove the deprecated 'IRQF_DISABLED' request_irq() flag enti…
Browse files Browse the repository at this point in the history
…rely

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

According to commit e58aa3d ("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>
  • Loading branch information
vrothberg authored and Ingo Molnar committed Mar 5, 2015
1 parent 33ca8a5 commit d8bf368
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 49 deletions.
25 changes: 0 additions & 25 deletions Documentation/scsi/ncr53c8xx.txt
Expand Up @@ -786,7 +786,6 @@ port address 0x1400.
irqm:1 same as initial settings (assumed BIOS settings)
irqm:2 always totem pole
irqm:0x10 driver will not use IRQF_SHARED flag when requesting irq
irqm:0x20 driver will not use IRQF_DISABLED flag when requesting irq

(Bits 0x10 and 0x20 can be combined with hardware irq mode option)

Expand Down Expand Up @@ -1231,30 +1230,6 @@ they only refer to system buffers that are well aligned. So, a work around
may only be needed under Linux when a scatter/gather list is not used and
when the SCSI DATA IN phase is reentered after a phase mismatch.

14.5 IRQ sharing problems

When an IRQ is shared by devices that are handled by different drivers, it
may happen that one driver complains about the request of the IRQ having
failed. Inder Linux-2.0, this may be due to one driver having requested the
IRQ using the IRQF_DISABLED flag but some other having requested the same IRQ
without this flag. Under both Linux-2.0 and linux-2.2, this may be caused by
one driver not having requested the IRQ with the IRQF_SHARED flag.

By default, the ncr53c8xx and sym53c8xx drivers request IRQs with both the
IRQF_DISABLED and the IRQF_SHARED flag under Linux-2.0 and with only the IRQF_SHARED
flag under Linux-2.2.

Under Linux-2.0, you can disable use of IRQF_DISABLED flag from the boot
command line by using the following option:

ncr53c8xx=irqm:0x20 (for the generic ncr53c8xx driver)
sym53c8xx=irqm:0x20 (for the sym53c8xx driver)

If this does not fix the problem, then you may want to check how all other
drivers are requesting the IRQ and report the problem. Note that if at least
a single driver does not request the IRQ with the IRQF_SHARED flag (share IRQ),
then the request of the IRQ obviously will not succeed for all the drivers.

15. SCSI problem troubleshooting

15.1 Problem tracking
Expand Down
4 changes: 0 additions & 4 deletions Documentation/scsi/tmscsim.txt
Expand Up @@ -107,10 +107,6 @@ produced errors and started to corrupt my disks. So don't do that! A 37.50
MHz PCI bus works for me, though, but I don't recommend using higher clocks
than the 33.33 MHz being in the PCI spec.

If you want to share the IRQ with another device and the driver refuses to
do so, you might succeed with changing the DC390_IRQ type in tmscsim.c to
IRQF_SHARED | IRQF_DISABLED.


3.Features
----------
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/loongson/loongson-3/hpet.c
Expand Up @@ -162,7 +162,7 @@ static irqreturn_t hpet_irq_handler(int irq, void *data)

static struct irqaction hpet_irq = {
.handler = hpet_irq_handler,
.flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER,
.flags = IRQF_NOBALANCING | IRQF_TIMER,
.name = "hpet",
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/block/cpqarray.c
Expand Up @@ -405,8 +405,8 @@ static int cpqarray_register_ctlr(int i, struct pci_dev *pdev)
goto Enomem4;
}
hba[i]->access.set_intr_mask(hba[i], 0);
if (request_irq(hba[i]->intr, do_ida_intr,
IRQF_DISABLED|IRQF_SHARED, hba[i]->devname, hba[i]))
if (request_irq(hba[i]->intr, do_ida_intr, IRQF_SHARED,
hba[i]->devname, hba[i]))
{
printk(KERN_ERR "cpqarray: Unable to get irq %d for %s\n",
hba[i]->intr, hba[i]->devname);
Expand Down
4 changes: 2 additions & 2 deletions drivers/bus/omap_l3_noc.c
Expand Up @@ -284,7 +284,7 @@ static int omap_l3_probe(struct platform_device *pdev)
*/
l3->debug_irq = platform_get_irq(pdev, 0);
ret = devm_request_irq(l3->dev, l3->debug_irq, l3_interrupt_handler,
IRQF_DISABLED, "l3-dbg-irq", l3);
0x0, "l3-dbg-irq", l3);
if (ret) {
dev_err(l3->dev, "request_irq failed for %d\n",
l3->debug_irq);
Expand All @@ -293,7 +293,7 @@ static int omap_l3_probe(struct platform_device *pdev)

l3->app_irq = platform_get_irq(pdev, 1);
ret = devm_request_irq(l3->dev, l3->app_irq, l3_interrupt_handler,
IRQF_DISABLED, "l3-app-irq", l3);
0x0, "l3-app-irq", l3);
if (ret)
dev_err(l3->dev, "request_irq failed for %d\n", l3->app_irq);

Expand Down
10 changes: 4 additions & 6 deletions drivers/bus/omap_l3_smx.c
Expand Up @@ -251,18 +251,16 @@ static int omap3_l3_probe(struct platform_device *pdev)
}

l3->debug_irq = platform_get_irq(pdev, 0);
ret = request_irq(l3->debug_irq, omap3_l3_app_irq,
IRQF_DISABLED | IRQF_TRIGGER_RISING,
"l3-debug-irq", l3);
ret = request_irq(l3->debug_irq, omap3_l3_app_irq, IRQF_TRIGGER_RISING,
"l3-debug-irq", l3);
if (ret) {
dev_err(&pdev->dev, "couldn't request debug irq\n");
goto err1;
}

l3->app_irq = platform_get_irq(pdev, 1);
ret = request_irq(l3->app_irq, omap3_l3_app_irq,
IRQF_DISABLED | IRQF_TRIGGER_RISING,
"l3-app-irq", l3);
ret = request_irq(l3->app_irq, omap3_l3_app_irq, IRQF_TRIGGER_RISING,
"l3-app-irq", l3);
if (ret) {
dev_err(&pdev->dev, "couldn't request app irq\n");
goto err2;
Expand Down
3 changes: 1 addition & 2 deletions drivers/mtd/nand/hisi504_nand.c
Expand Up @@ -758,8 +758,7 @@ static int hisi_nfc_probe(struct platform_device *pdev)

hisi_nfc_host_init(host);

ret = devm_request_irq(dev, irq, hinfc_irq_handle, IRQF_DISABLED,
"nandc", host);
ret = devm_request_irq(dev, irq, hinfc_irq_handle, 0x0, "nandc", host);
if (ret) {
dev_err(dev, "failed to request IRQ\n");
goto err_res;
Expand Down
3 changes: 1 addition & 2 deletions drivers/usb/isp1760/isp1760-core.c
Expand Up @@ -151,8 +151,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
}

if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) {
ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED |
IRQF_DISABLED);
ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED);
if (ret < 0) {
isp1760_hcd_unregister(&isp->hcd);
return ret;
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/isp1760/isp1760-udc.c
Expand Up @@ -1451,8 +1451,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq,

sprintf(udc->irqname, "%s (udc)", devname);

ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | IRQF_DISABLED |
irqflags, udc->irqname, udc);
ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags,
udc->irqname, udc);
if (ret < 0)
goto error;

Expand Down
3 changes: 0 additions & 3 deletions include/linux/interrupt.h
Expand Up @@ -39,8 +39,6 @@
* These flags used only by the kernel as part of the
* irq handling routines.
*
* IRQF_DISABLED - keep irqs disabled when calling the action handler.
* DEPRECATED. This flag is a NOOP and scheduled to be removed
* IRQF_SHARED - allow sharing the irq among several devices
* IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
* IRQF_TIMER - Flag to mark this interrupt as timer interrupt
Expand All @@ -58,7 +56,6 @@
* IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
* resume time.
*/
#define IRQF_DISABLED 0x00000020
#define IRQF_SHARED 0x00000080
#define IRQF_PROBE_SHARED 0x00000100
#define __IRQF_TIMER 0x00000200
Expand Down

0 comments on commit d8bf368

Please sign in to comment.