[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc9cb9e7-68bd-3bfa-9310-5fbf99a86544@acm.org>
Date: Fri, 17 Sep 2021 10:27:27 -0700
From: Bart Van Assche <bvanassche@....org>
To: Can Guo <cang@...eaurora.org>, asutoshd@...eaurora.org,
nguyenb@...eaurora.org, hongwus@...eaurora.org,
ziqichen@...eaurora.org, linux-scsi@...r.kernel.org,
kernel-team@...roid.com
Cc: Alim Akhtar <alim.akhtar@...sung.com>,
Avri Altman <avri.altman@....com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Bean Huo <beanhuo@...ron.com>,
Stanley Chu <stanley.chu@...iatek.com>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scsi: ufs: Fix a possible dead lock in clock scaling
On 9/16/21 6:51 PM, Can Guo wrote:
> Assume a scenario where task A and B call ufshcd_devfreq_scale()
> simultaneously. After task B calls downgrade_write() [1], but before it
> calls down_read() [3], if task A calls down_write() [2], when task B calls
> down_read() [3], it will lead to dead lock.
Something is wrong with the above description. The downgrade_write() call is
not followed by down_read() but by up_read(). Additionally, I don't see how
concurrent calls of ufshcd_devfreq_scale() could lead to a deadlock. If one
thread calls downgrade_write() and another thread calls down_write() immediately,
that down_write() call will block until the other thread has called up_read()
without triggering a deadlock.
Thanks,
Bart.
Powered by blists - more mailing lists