kernel_optimize_test/drivers/spi
Andy Shevchenko 02f20387e1 spi: dw: explicitly free IRQ handler in dw_spi_remove_host()
The following warning occurs when DW SPI is compiled as a module and it's a PCI
device. On the removal stage pcibios_free_irq() is called earlier than
free_irq() due to the latter is called at managed resources free strage.

------------[ cut here ]------------
WARNING: CPU: 1 PID: 1003 at /home/andy/prj/linux/fs/proc/generic.c:575 remove_proc_entry+0x118/0x150()
remove_proc_entry: removing non-empty directory 'irq/38', leaking at least 'dw_spi1'
Modules linked in: spi_dw_midpci(-) spi_dw [last unloaded: dw_dmac_core]
CPU: 1 PID: 1003 Comm: modprobe Not tainted 4.3.0-rc5-next-20151013+ #32
 00000000 00000000 f5535d70 c12dc220 f5535db0 f5535da0 c104e912 c198a6bc
 f5535dcc 000003eb c198a638 0000023f c11b4098 c11b4098 f54f1ec8 f54f1ea0
 f642ba20 f5535db8 c104e96e 00000009 f5535db0 c198a6bc f5535dcc f5535df0
Call Trace:
 [<c12dc220>] dump_stack+0x41/0x61
 [<c104e912>] warn_slowpath_common+0x82/0xb0
 [<c11b4098>] ? remove_proc_entry+0x118/0x150
 [<c11b4098>] ? remove_proc_entry+0x118/0x150
 [<c104e96e>] warn_slowpath_fmt+0x2e/0x30
 [<c11b4098>] remove_proc_entry+0x118/0x150
 [<c109b96a>] unregister_irq_proc+0xaa/0xc0
 [<c109575e>] free_desc+0x1e/0x60
 [<c10957d2>] irq_free_descs+0x32/0x70
 [<c109b1a0>] irq_domain_free_irqs+0x120/0x150
 [<c1039e8c>] mp_unmap_irq+0x5c/0x60
 [<c16277b0>] intel_mid_pci_irq_disable+0x20/0x40
 [<c1627c7f>] pcibios_free_irq+0xf/0x20
 [<c13189f2>] pci_device_remove+0x52/0xb0
 [<c13f6367>] __device_release_driver+0x77/0x100
 [<c13f6da7>] driver_detach+0x87/0x90
 [<c13f5eaa>] bus_remove_driver+0x4a/0xc0
 [<c128bf0d>] ? selinux_capable+0xd/0x10
 [<c13f7483>] driver_unregister+0x23/0x60
 [<c10bad8a>] ? find_module_all+0x5a/0x80
 [<c1317413>] pci_unregister_driver+0x13/0x60
 [<f80ac654>] dw_spi_driver_exit+0xd/0xf [spi_dw_midpci]
 [<c10bce9a>] SyS_delete_module+0x17a/0x210

Explicitly call free_irq() at removal stage of the DW SPI driver.

Fixes: 04f421e7b0 (spi: dw: use managed resources)
Cc: stable@vger.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-20 15:45:43 +01:00
..
Kconfig Merge remote-tracking branches 'spi/topic/ti-qspi', 'spi/topic/xcomm' and 'spi/topic/xlp' into spi-next 2015-08-31 14:45:45 +01:00
Makefile Merge remote-tracking branches 'spi/topic/ti-qspi', 'spi/topic/xcomm' and 'spi/topic/xlp' into spi-next 2015-08-31 14:45:45 +01:00
spi-adi-v3.c
spi-altera.c
spi-ath79.c spi: spi-ath79: Set the initial state of CS0 2015-04-27 15:44:57 +01:00
spi-atmel.c spi: atmel: remove useless include 2015-08-10 19:07:04 +01:00
spi-au1550.c
spi-bcm53xx.c Merge remote-tracking branches 'spi/topic/atmel', 'spi/topic/bcm2385', 'spi/topic/bcm2835', 'spi/topic/bcm53xx' and 'spi/topic/bitbang' into spi-next 2015-04-11 23:09:03 +01:00
spi-bcm53xx.h
spi-bcm63xx-hsspi.c spi/bcm63xx-hsspi: add support for dual spi read/write 2015-08-25 17:33:49 +01:00
spi-bcm63xx.c
spi-bcm2835.c spi: bcm2835: set up spi-mode before asserting cs-gpio 2015-08-14 19:09:09 +01:00
spi-bfin-sport.c
spi-bfin5xx.c
spi-bitbang-txrx.h spi: Fix regression in spi-bitbang-txrx.h 2015-07-29 15:01:07 +01:00
spi-bitbang.c spi: bitbang: Make setup_transfer() callback optional 2015-04-18 12:01:03 +01:00
spi-butterfly.c
spi-cadence.c
spi-clps711x.c
spi-coldfire-qspi.c
spi-davinci.c spi: davinci: Choose correct pre-scaler limit based on SOC 2015-07-24 17:35:51 +01:00
spi-dln2.c
spi-dw-mid.c
spi-dw-mmio.c spi: dw-mmio: convert to unified device property API 2015-10-19 20:32:01 +01:00
spi-dw-pci.c spi: dw-pci: remove unused pdev member from struct dw_spi_pci 2015-10-19 20:32:01 +01:00
spi-dw.c spi: dw: explicitly free IRQ handler in dw_spi_remove_host() 2015-10-20 15:45:43 +01:00
spi-dw.h spi: dw: introduce spi_shutdown_chip() 2015-10-19 20:32:01 +01:00
spi-efm32.c
spi-ep93xx.c
spi-falcon.c
spi-fsl-cpm.c spi: fsl-spi: fix devm_ioremap_resource() error case 2015-04-24 13:27:53 +01:00
spi-fsl-cpm.h
spi-fsl-dspi.c spi: fsl-dspi: Use pinctrl PM helpers 2015-06-12 18:28:13 +01:00
spi-fsl-espi.c spi: fsl-(e)spi: Fix checking return value of devm_ioremap_resource 2015-08-30 12:14:36 +01:00
spi-fsl-lib.c spi: fsl-(e)spi: simplify cleanup code 2015-08-28 18:15:18 +01:00
spi-fsl-lib.h spi: fsl-(e)spi: simplify cleanup code 2015-08-28 18:15:18 +01:00
spi-fsl-spi.c spi: fsl-(e)spi: Fix checking return value of devm_ioremap_resource 2015-08-30 12:14:36 +01:00
spi-fsl-spi.h
spi-gpio.c
spi-img-spfi.c Merge remote-tracking branches 'spi/topic/dw', 'spi/topic/fsl-espi', 'spi/topic/img-spfi' and 'spi/topic/mpc512x-psc' into spi-next 2015-08-31 14:45:32 +01:00
spi-imx.c spi: imx: Fix small DMA transfers 2015-07-24 16:08:55 +01:00
spi-lm70llp.c
spi-meson-spifc.c
spi-mpc52xx-psc.c
spi-mpc52xx.c
spi-mpc512x-psc.c spi: mpc512x-psc: fix compiler warning about uninitialized variable 2015-07-21 11:24:42 +01:00
spi-mt65xx.c spi: mediatek: fix SPI_CMD_PAUSE_IE macro error 2015-08-27 20:31:00 +01:00
spi-mxs.c
spi-nuc900.c
spi-oc-tiny.c
spi-octeon.c
spi-omap-100k.c
spi-omap-uwire.c
spi-omap2-mcspi.c spi: omap2-mcspi: add runtime PM to set_cs() 2015-07-24 17:40:40 +01:00
spi-orion.c spi: orion: On a38x, implement "50MHZ SPI AC timing" Erratum No. FE-9144572 2015-08-11 17:21:08 +01:00
spi-pl022.c Merge remote-tracking branches 'spi/topic/omap-100k', 'spi/topic/omap-uwire', 'spi/topic/pl022', 'spi/topic/pm' and 'spi/topic/pxa2xx' into spi-next 2015-04-11 23:09:18 +01:00
spi-ppc4xx.c
spi-pxa2xx-dma.c
spi-pxa2xx-pci.c spi: spi-pxa2xx: Remove clk.h include 2015-07-15 12:35:02 +01:00
spi-pxa2xx.c spi: spi-pxa2xx: Remove unused legacy null dma buffer and allocation for it 2015-08-05 10:27:27 +01:00
spi-pxa2xx.h spi: spi-pxa2xx: Remove unused legacy null dma buffer and allocation for it 2015-08-05 10:27:27 +01:00
spi-qup.c Merge remote-tracking branches 'spi/topic/qup', 'spi/topic/rockchip', 'spi/topic/rspi', 'spi/topic/s3c64xx' and 'spi/topic/sc18is602' into spi-next 2015-04-11 23:09:25 +01:00
spi-rb4xx.c spi: rb4xx: Fix checking return value of devm_ioremap_resource() 2015-05-01 17:35:54 +01:00
spi-rockchip.c spi/rockchip: remove unnecessary memset of rockchip_spi 2015-07-07 13:12:50 +01:00
spi-rspi.c spi: rspi: Make qspi_set_send_trigger() return "unsigned int" 2015-07-03 13:52:10 +01:00
spi-s3c24xx-fiq.h
spi-s3c24xx-fiq.S
spi-s3c24xx.c spi/s3c24xx: remove unnecessary memset of s3c24xx_spi 2015-07-07 13:11:27 +01:00
spi-s3c64xx.c spi: s3c64xx: print fifo size on probe. 2015-07-28 15:50:01 +01:00
spi-sc18is602.c Merge remote-tracking branches 'spi/topic/qup', 'spi/topic/rockchip', 'spi/topic/rspi', 'spi/topic/s3c64xx' and 'spi/topic/sc18is602' into spi-next 2015-04-11 23:09:25 +01:00
spi-sh-hspi.c
spi-sh-msiof.c spi: sh-msiof: Fix FIFO size to 64 word from 256 word 2015-08-31 14:42:40 +01:00
spi-sh-sci.c
spi-sh.c
spi-sirf.c spi: sirf: add the reset for USP-based SPI 2015-05-26 11:39:16 +01:00
spi-st-ssc4.c
spi-sun4i.c
spi-sun6i.c
spi-tegra20-sflash.c
spi-tegra20-slink.c
spi-tegra114.c
spi-ti-qspi.c spi: ti-qspi: use 128 bit transfer mode where possible 2015-08-20 10:56:42 -07:00
spi-tle62x0.c
spi-topcliff-pch.c
spi-txx9.c
spi-xcomm.c spi: xcomm: Export I2C module alias information 2015-07-31 18:14:57 +01:00
spi-xilinx.c spi/spi-xilinx: Fix spurious IRQ ACK on irq mode 2015-08-14 16:35:19 +01:00
spi-xlp.c spi/xlp: SPI controller driver for Netlogic XLP SoCs 2015-08-28 18:22:19 +01:00
spi-xtensa-xtfpga.c
spi-zynqmp-gqspi.c spi: zynq: missing break statement 2015-07-07 19:47:50 +01:00
spi.c Merge remote-tracking branches 'spi/topic/s3c64xx', 'spi/topic/sg', 'spi/topic/sh-msiof', 'spi/topic/spidev' and 'spi/topic/stats' into spi-next 2015-08-31 14:45:41 +01:00
spidev.c Merge remote-tracking branches 'spi/topic/s3c64xx', 'spi/topic/sg', 'spi/topic/sh-msiof', 'spi/topic/spidev' and 'spi/topic/stats' into spi-next 2015-08-31 14:45:41 +01:00