[RACE] between rescan thread and clock-gate work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all

I'm observing re-entry into driver's (tmio) .set_ios() method, caused by a 
race between the card-detect rescan thread along the lines of

[kworker/u:0 worker-thread]
mmc_claim_host()
mmc_rescan()
mmc_rescan_try_freq() /* yes, there are also other paths to call 
			.set_ios() from here */
mmc_go_idle()
mmc_set_chip_select()
mmc_set_ios()
host->ops->set_ios()

and the clock-gate work, scheduled from a command completion:

mmc_request_done()
mmc_host_clk_gate()
schedule_work()
[kworker/0:1 worker-thread] - after mmc_release_host()
mmc_host_clk_gate_delayed()
mutex_lock(&host->clk_gate_mutex)
mmc_gate_clock()
mmc_set_ios()
host->ops->set_ios()

Replacing the clk_gate_mutex mutex with claiming and releasing the host 
fixes the problem for me, but I'm not sure, whether this is the correct 
solution.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux