On Fri, 2024-02-16 at 17:52 +0530, Vinod Koul wrote: > On 14-02-24, 13:29, Nuno Sa wrote: > > In axi_dmac_probe(), there's a mix in using device managed APIs and > > explicitly cleaning things in the driver .remove() hook. Move to use > > device managed APIs and thus drop the .remove() hook. > > > > While doing this move request_irq() before of_dma_controller_register() > > so the previous cleanup order in the .remove() hook is preserved. > > It is good that we are doing this, but moving irq to devm doesnt help a > lot, there exists a race > > I would suggest you use the axi_dmac_free_dma_controller() to all free > up irq explicitly, that will ensure things no chance of irq firing and > scheduling tasklet when we are removing > Hi Vinod, Hmm wait... Before the patch we had: static void axi_dmac_remove(struct platform_device *pdev) { struct axi_dmac *dmac = platform_get_drvdata(pdev); of_dma_controller_free(pdev->dev.of_node); free_irq(dmac->irq, dmac); So, you mean that there's actually a possible bug/race in the above? The irq is only being released after of_dma_controller_free(). So, I guess I should not move request_irq() at all and then I can still use devm_request_irq(). If I do it after registering the device then it will be released before of_dma_controller_free(). Am I missing something? Thanks for the feedback! - Nuno Sá >