Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b54ed94 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz
Browse files

ide: ide_unregister() locking bugfix



Holding ide_lock for ide_release_dma_engine() call is unnecessary
and triggers WARN_ON(irqs_disabled()) in dma_free_coherent().

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent bd8a59e2
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -352,15 +352,15 @@ void ide_unregister(ide_hwif_t *hwif)
	blk_unregister_region(MKDEV(hwif->major, 0), MAX_DRIVES<<PARTN_BITS);
	blk_unregister_region(MKDEV(hwif->major, 0), MAX_DRIVES<<PARTN_BITS);
	kfree(hwif->sg_table);
	kfree(hwif->sg_table);
	unregister_blkdev(hwif->major, hwif->name);
	unregister_blkdev(hwif->major, hwif->name);
	spin_lock_irq(&ide_lock);


	if (hwif->dma_base)
	if (hwif->dma_base)
		ide_release_dma_engine(hwif);
		ide_release_dma_engine(hwif);


	spin_lock_irq(&ide_lock);
	/* restore hwif data to pristine status */
	/* restore hwif data to pristine status */
	ide_init_port_data(hwif, hwif->index);
	ide_init_port_data(hwif, hwif->index);

	spin_unlock_irq(&ide_lock);
	spin_unlock_irq(&ide_lock);

	mutex_unlock(&ide_cfg_mtx);
	mutex_unlock(&ide_cfg_mtx);
}
}