dmaengine: move module_/dma_device_put() after route free
Vinod Koul
maintainerPATCH 1/2 dmaengine: move module_/dma_device_put() after route free
We call dma_device_put() and module_put() after invoking .device_free_chan_resources callback, but we should also take care of router devices and invoke this after .route_free callback. So move it after .route_free
Signed-off-by Vinod Koul <[email protected]>
--- drivers/dma/dmaengine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/dma/dmaengine.c +3 -3
@@ -427,15 +427,15 @@ static void dma_chan_put(struct dma_chan *chan) chan->device->device_free_chan_resources (chan); } -dma_device_put (chan->device); -module_put (dma_chan_to_owner (chan)); -/* If the channel is used via a DMA request router, free the mapping */ if (chan->router && chan->router->route_free) { chan->router->route_free (chan->router->dev, chan->route_data); chan->router =NULL ; chan->route_data =NULL ; } + +dma_device_put (chan->device); +module_put (dma_chan_to_owner (chan)); }enum dma_status dma_sync_wait (struct dma_chan *chan,dma_cookie_t cookie)
Signature · 1 line
2.23.0
Vinod Koul
maintainerPATCH 2/2 dmaengine: print more meaningful error message
error log for dma_channel_table_init() failure pointed a mere "initialization failure", which is not very helpful message, so print additional details like function name and error code.
Signed-off-by Vinod Koul <[email protected]>
--- drivers/dma/dmaengine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dmaengine.c +1 -1
@@ -206,7 +206,7 @@ static int __init dma_channel_table_init(void) }if (err) { -pr_err ("initialization failure\n" ); +pr_err ("dmaengine dma_channel_table_init failure: %d\n" , err);for_each_dma_cap_mask (cap, dma_cap_mask_all)free_percpu (channel_table[cap]); }
Signature · 1 line
2.23.0
Quoted 6 lines · Vinod Koul
We call
dma_device_put()andmodule_put()after invoking .device_free_chan_resources callback, but we should also take care of router devices and invoke this after .route_free callback. So move it after .route_freeSigned-off-by Vinod Koul <[email protected]>
Makes sense.
Reviewed-by Logan Gunthorpe <[email protected]>
Quoted 28 lines
--- drivers/dma/dmaengine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/dma/dmaengine.c +3
-3@@ -427,15 +427,15 @@ static void dma_chan_put(struct dma_chan *chan) chan->device->device_free_chan_resources (chan); } -dma_device_put (chan->device); -module_put (dma_chan_to_owner (chan)); -/* If the channel is used via a DMA request router, free the mapping */ if (chan->router && chan->router->route_free) { chan->router->route_free (chan->router->dev, chan->route_data); chan->router =NULL ; chan->route_data =NULL ; } + +dma_device_put (chan->device); +module_put (dma_chan_to_owner (chan)); }enum dma_status dma_sync_wait (struct dma_chan *chan,dma_cookie_t cookie)