]> git.baikalelectronics.ru Git - kernel.git/commit
ufs: ensure clk gating work is finished before module unloading
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 24 Nov 2014 05:24:18 +0000 (14:24 +0900)
committerChristoph Hellwig <hch@lst.de>
Wed, 26 Nov 2014 10:32:32 +0000 (11:32 +0100)
commit30c88cb9b8b6613754d32f0742f1c0a959c1788c
treeeb9984611dcdf7f751c24479d8f88d740de4ba45
parent6ed84f08dc61dba361847b68724da562a4aa88b4
ufs: ensure clk gating work is finished before module unloading

When dynamic clk gating feature is enabled, delayed workqueue machanism
is used in order to detect certain period of inactivity.  But there is no
guarantee that scheduled gating work is completed before module unloading.
So it can cause kernel crash by accessing memory after it was freed.

Fix it by cancelling clk gating and ungating works and ensure that its
execution is finished before module unloading.

Signed-off-by: Akinobu Mita <mita@fixstars.com>
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/ufs/ufshcd.c