Skip to content

ata: pata_mpc52xx: fix cleanup ordering and modernize

Rosen Penev linux-ide lkml 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 0 repliesNew
  2. v25 patches 1 replySuperseded
  3. v14 patches 4 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6ata: pata_mpc52xx: fix NULL pointer dereference in IRQ handlerdrivers/ata/pata_mpc52xx.c+2 -10 replies
2/6ata: pata_mpc52xx: synchronize with task IRQ before resetting DMA statedrivers/ata/pata_mpc52xx.c+3 -00 replies
3/6ata: pata_mpc52xx: reset cached DMA direction on resumedrivers/ata/pata_mpc52xx.c+1 -10 replies
4/6ata: pata_mpc52xx: remove redundant irq_dispose_mapping callsdrivers/ata/pata_mpc52xx.c+0 -40 replies
5/6ata: pata_mpc52xx: convert to platform_get_irq()drivers/ata/pata_mpc52xx.c+7 -180 replies
6/6ata: pata_mpc52xx: convert to full devm resource managementdrivers/ata/pata_mpc52xx.c+20 -440 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCHv3 0/6] ata: pata_mpc52xx: fix cleanup ordering and modernize

Fix several lifecycle bugs in the MPC52xx ATA driver:

- The BestComm task IRQ was managed by devm, creating a use-after-free and teardown inversion. Switch to non-devm request_irq/free_irq so the interrupt is unregistered before the task is freed.

- The error and remove paths called irq_dispose_mapping() explicitly, duplicating the one in bcom_task_free(). Remove the redundant calls.

- Replace irq_of_parse_and_map() with platform_get_irq() for proper error handling and integration with the platform device model.

- Replace the open-coded of_address_to_resource()/devm_request_mem_region() /devm_ioremap() sequence with the standard helper.

v3: extra sashiko fix and platform_get_irq moved.
v2: add extra patch from sashiko review.

Rosen Penev (6):
ata: pata_mpc52xx: fix NULL pointer dereference in IRQ handler
ata: pata_mpc52xx: synchronize with task IRQ before resetting DMA
state
ata: pata_mpc52xx: reset cached DMA direction on resume
ata: pata_mpc52xx: remove redundant irq_dispose_mapping calls
ata: pata_mpc52xx: convert to platform_get_irq()
ata: pata_mpc52xx: convert to full devm resource management

 drivers/ata/pata_mpc52xx.c | 101 ++++++++++++-------------------------
 1 file changed, 33 insertions(+), 68 deletions(-)

--
2.54.0