Subject: Re: [PATCH 01/13] i2c: bcm2835: Use devm_request_irq()
Date: Wednesday 18th December 2013 02:21:05 UTC (over 4 years ago)
On 12/16/2013 11:46 PM, Jingoo Han wrote: > Use devm_request_irq() to make cleanup paths simpler. This may not be safe. The interrupt used by the I2C controllers on the BCM2835 chip is shared between two controllers. In theory, you could run into a condition where you're remove()ing the driver for one of the controller (a), while the driver for controller (b) is still active, yet the HW for controller (a) comes along and triggers an interrupt after remove() but before the devm IRQ cleanup. That would result in the IRQ handler for controller (a) executing after the remove() of the associated device, which could cause a variety of problems. You might be able to make this safe by explicitly clearing any IRQ enable registers in remove(), but leaving the code using plain request_irq() might be simpler.