Skip to contentSkip to conversation

Applied "spi: dw: explicitly free IRQ handler in dw_spi_remove_host()" to the spi tree

PATCH Mark Brown 5 participants 5 messages Oct 22, 2015 – Oct 23, 2015 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

The patch

spi: dw: explicitly free IRQ handler in dw_spi_remove_host()

has been applied to the spi tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 9f89566dac9ad776ad4d919922e99d799731e513 Mon Sep 17 00:00:00 2001

From: Andy Shevchenko <[email protected]>
Date: Tue, 20 Oct 2015 11:39:36 +0300
Subject: [PATCH] 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 04f421e7b0b1 (spi: dw: use managed resources)
---
 drivers/spi/spi-dw.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/spi/spi-dw.c +2 -0
index cc2e980..ad66bc5 100644
@@ -542,6 +542,8 @@ void dw_spi_remove_host(struct dw_spi *dws)
 {
 	dw_spi_debugfs_remove(dws);
 
+	free_irq(dws->irq, dws->master);
+
 	if (dws->dma_ops && dws->dma_ops->dma_exit)
 		dws->dma_ops->dma_exit(dws);
 
Signature · 1 line
2.6.1
#1 lore raw
Quoted 3 lines · Mark Brown

The patch

   spi: dw: explicitly free IRQ handler in dw_spi_remove_host()

This one seems incomplete.

Yes, we already have a fix 02f20387e1bc in your tree.

This makes free_irq() call duplicate. Please, remove it from your tree or do the revert.

Quoted 108 lines

has been applied to the spi tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

All being well this means that it will be integrated into the linux- next
tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 9f89566dac9ad776ad4d919922e99d799731e513 Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <[email protected]>
Date: Tue, 20 Oct 2015 11:39:36 +0300
Subject: [PATCH] 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 04f421e7b0b1 (spi: dw: use managed resources)

---
 drivers/spi/spi-dw.c | 2 ++

 1 file changed, 2 insertions(+)
drivers/spi/spi-dw.c +0 -0
index cc2e980..ad66bc5 100644
@@ -542,6 +542,8 @@ void dw_spi_remove_host(struct dw_spi *dws)
  {
  	dw_spi_debugfs_remove(dws);

drivers/spi/spi-dw.c +2 -0
+	free_irq(dws->irq, dws->master);
+

  if (dws->dma_ops && dws->dma_ops->dma_exit) dws->dma_ops->dma_exit(dws);

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#3 lore raw
In reply to a message not in the archive
Quoted 8 lines · Andy Shevchenko
Quoted 3 lines · Mark Brown

The patch

   spi: dw: explicitly free IRQ handler in dw_spi_remove_host()

This one seems incomplete.

Yes, we already have a fix 02f20387e1bc in your tree.

This *appears* to be the same commit you are following up on (please always include human readable descriptions)

Quoted 2 lines

This makes free_irq() call duplicate. Please, remove it from your tree or do the revert.

Are you saying that you have realised that your patch is broken since sending it? I've dropped this commit...

#5 lore raw
In reply to a message not in the archive
Quoted 4 lines · Mark Brown
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Mark Brown

The patch

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

   spi: dw: explicitly free IRQ handler in dw_spi_remove_host()

This one seems incomplete.

Yes, we already have a fix 02f20387e1bc in your tree.

This *appears* to be the same commit you are following up on (please always include human readable descriptions)

This commit (9f89566) is a redundancy made by mistake.

Quoted 2 lines
Quoted 2 lines

This makes free_irq() call duplicate.

Currently in your for-next branch

void dw_spi_remove_host(struct dw_spi *dws)
{
        dw_spi_debugfs_remove(dws);

        free_irq(dws->irq, dws->master);
^^^ (1)

        if (dws->dma_ops && dws->dma_ops->dma_exit) dws->dma_ops->dma_exit(dws);

        spi_shutdown_chip(dws);

        free_irq(dws->irq, dws->master);
^^^ (2)
}
EXPORT_SYMBOL_GPL(dw_spi_remove_host);

Quoted 5 lines
Quoted 2 lines

Please, remove it from your tree
or do the revert.

Are you saying that you have realised that your patch is broken since sending it?  I've dropped this commit...

No, the commit 02f20387e1bc is rightful and should be present in the tree.

P.S. Commit IDs as they appear in your for-next branch of SPI tree.

Signature · 7 lines
Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/[email protected]>
Intel Finland Oy

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#7 lore raw
In reply to a message not in the archive

T24gRnJpLCAyMDE1LTEwLTIzIGF0IDE5OjI1ICswMzAwLCBBbmR5IFNoZXZjaGVua28gd3JvdGU6 DQo+IE9uIFNhdCwgMjAxNS0xMC0yNCBhdCAwMToxOCArMDkwMCwgTWFyayBCcm93biB3cm90ZToN Cj4gPiBPbiBGcmksIE9jdCAyMywgMjAxNSBhdCAxMDo0MDo1OEFNICswMzAwLCBBbmR5IFNoZXZj aGVua28gd3JvdGU6DQo+ID4gPiBPbiB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bnRlbmRlZApyZWNpcGllbnQsIHBsZWFzZSBjb250YWN0IHRo ZSBzZW5kZXIgYW5kIGRlbGV0ZSBhbGwgY29waWVzLgo=

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html