Re: [PATCH 1/2] mmc: sdhci-esdhc-imx: fix access hardirq-unsafe lock in atomic context

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

 



On Mon, Dec 23, 2013 at 08:47:01PM +0800, Shawn Guo wrote:
> On Mon, Dec 23, 2013 at 07:02:23PM +0800, Dong Aisheng wrote:
> > Sometimes we may meet the following lockdep issue.
> > The root cause is .set_clock callback is executed with spin_lock_irqsave
> > in sdhci_do_set_ios. However, the IMX set_clock callback will try to access
> > clk_get_rate which is using a mutex lock.
> > 
> > The fix avoids access mutex in .set_clock callback by initializing the
> > pltfm_host->clock at probe time and use it later instead of calling
> > clk_get_rate again in atomic context.
> 
> While I agree this is the way less intrusive, I'm also wondering why
> sdhci_do_set_ios() needs a spinlock at all, or at least it's
> questionable if the lock should necessarily be held for such a long
> running section.

Per my understanding, it's for protecting the host structure including
register r/w where can also be accessed from ISR, so we need it.

> 
> Nevertheless, as long as we can guarantee that the rate of
> pltfm_host->clk does not change after the driver is probed, I'm fine
> with the patch.
> 

We does not change the host parent clock always currently.

Regards
Dong Aisheng
> Shawn
> 

--
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