atm: he: kill tasklet before releasing queues
Subsystems (3)
RFC PATCH 1/1 atm: he: kill tasklet before releasing queues
The interrupt handler schedules a tasklet which accesses the device queues. tasklet_disable() waits for a running instance, but leaves a scheduled instance pending while he_stop() releases those queues and the device.
After masking device interrupts, unregister the IRQ so the handler can no longer schedule the tasklet, then kill the tasklet before releasing any of its data.
The affected driver was removed upstream by commit 6deb53595092 ("net:
remove unused ATM protocols and legacy ATM device drivers"). This change is intended for maintained stable kernels which still carry the driver.
--- drivers/atm/he.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/atm/he.c +5 -4
@@ -1536,9 +1536,13 @@ he_stop(struct he_dev *he_dev)pci_read_config_dword (pci_dev,GEN_CNTL_0 , &gen_cntl_0); gen_cntl_0 &= ~(INT_PROC_ENBL |INIT_ENB );pci_write_config_dword (pci_dev,GEN_CNTL_0 , gen_cntl_0); + } -tasklet_disable (&he_dev->tasklet); +if (he_dev->irq) +free_irq (he_dev->irq, he_dev); +tasklet_kill (&he_dev->tasklet); +if (he_dev->membase) {/* disable recv and transmit */ reg =he_readl_mbox (he_dev,CS_ERCTL0 );
@@ -1555,9 +1559,6 @@ he_stop(struct he_dev *he_dev) he_dev->atm_dev->phy->stop (he_dev->atm_dev);#endif /* CONFIG_ATM_HE_USE_SUNI */ -if (he_dev->irq) -free_irq (he_dev->irq, he_dev); -if (he_dev->irq_base)dma_free_coherent (&he_dev->pci_dev->dev, (CONFIG_IRQ_SIZE +1 ) *sizeof (struct he_irq ), he_dev->irq_base, he_dev->irq_phys);
Signature · 1 line
2.50.1.windows.1
Greg KH
maintainerQuoted 11 lines · Hongyan Xu
The interrupt handler schedules a tasklet which accesses the device queues.
tasklet_disable()waits for a running instance, but leaves a scheduled instance pending whilehe_stop()releases those queues and the device.After masking device interrupts, unregister the IRQ so the handler can no longer schedule the tasklet, then kill the tasklet before releasing any of its data.
The affected driver was removed upstream by commit
6deb53595092("net:
remove unused ATM protocols and legacy ATM device drivers"). This change is intended for maintained stable kernels which still carry the driver.
Why don't we just delete the driver instead as obviously no one uses this. Unless you have the hardware to test these changes?
thanks,
greg k-h
A message that is not in the archive (sent off-list or not yet received): AIYAKgAhKje-OvrUBw*[email protected]
Greg KH
maintainerQuoted 5 lines · 许红岩
Thanks greg k-h
I do not have the HE hardware, so the patch has only been build-tested and reviewed against the teardown path.
Then why create these patches at all? What is driving the need for them?
Quoted 4 lines
Given that the driver has already been removed upstream, I agree that deleting it from maintained stable trees would be cleaner if that is acceptable for stable. I sent the small fix only because the driver is still present there and I did not want to backport the much larger ATM removal commit.
But if you don't have the hardware, and don't use this driver, why do this at all? Why even look at older kernel versions for stuff that is not used?
Quoted 3 lines
I can prepare a stable-only removal patch for
the HE driver instead, or backport the relevant upstream removal pieces if that is preferred.
As no one uses these drivers, due to lack of hardware and the like, they can't be abused at all, so just leave them alone for older kernels, no need to delete them as they do not cause any additional burden there at all.
thanks,
greg k-h