From: Qiang Yu <quic_qianyu@quicinc.com>
To: Jeffrey Hugo <quic_jhugo@quicinc.com>, <mani@kernel.org>
Cc: <mhi@lists.linux.dev>, <linux-arm-msm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <quic_cang@quicinc.com>,
<quic_mrana@quicinc.com>, Hemant Kumar <quic_hemantk@quicinc.com>,
"Lazarus Motha" <quic_lmotha@quicinc.com>
Subject: Re: [PATCH v2 2/2] bus: mhi: host: Take irqsave lock after TRE is generated
Date: Mon, 16 Oct 2023 16:49:08 +0800 [thread overview]
Message-ID: <10f05b5a-8046-4884-b375-007a14248e00@quicinc.com> (raw)
In-Reply-To: <6b396b1a-58a7-bf7c-f644-f1bf298a31e0@quicinc.com>
On 9/29/2023 11:25 PM, Jeffrey Hugo wrote:
> On 9/24/2023 10:08 PM, Qiang Yu wrote:
>>
>> On 9/22/2023 10:50 PM, Jeffrey Hugo wrote:
>>> On 9/13/2023 2:47 AM, Qiang Yu wrote:
>>>> From: Hemant Kumar <quic_hemantk@quicinc.com>
>>>>
>>>> Take irqsave lock after TRE is generated to avoid deadlock due to core
>>>> getting interrupts enabled as local_bh_enable must not be called with
>>>> irqs disabled based on upstream patch.
>>>
>>> Where is local_bh_enable() being called? What patch? What is
>>> upstream of the codebase you submitted this to? Why is it safe to
>>> call mhi_gen_tre() without the lock?
>>
>> This patch is to fix the issue included by "[PATCH v2 1/2] bus: mhi:
>> host: Add spinlock to protect WP access when queueing TREs". In that
>> patch, we add write_lock_bh/write_unlock_bh in mhi_gen_tre().
>>
>> However, before mhi_gen_tre() is invoked, mhi_cntrl->pm_lock is
>> getted, line 1125, and it is a spin lock. So it becomes we want to
>> get and release bh lock after spin lock. __local_bh_enable_ip is
>> called as part of write_unlock_bh
>>
>> and local_bh_enable. When CONFIG_TRACE_IRQFLAGS is enabled, irq will
>> be enabled once __local_bh_enable_ip is called. The commit message is
>> not clear and confusing, will change it in [patch v3].
>>
>
> In addition to clarifying the commit message, I recommend looking at
> adding this to the other patch. It seems very odd to review a series
> where one patch introduces a known issue, and a following patch
> corrects that issue. It would be better to not introduce the issue in
> the first place.
OK, will squash two patches into one patch after we achieve an agreement.
prev parent reply other threads:[~2023-10-16 8:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 8:47 [PATCH v2 0/2] Add lock to avoid race when ringing channel DB Qiang Yu
2023-09-13 8:47 ` [PATCH v2 1/2] bus: mhi: host: Add spinlock to protect WP access when queueing TREs Qiang Yu
2023-09-22 14:44 ` Jeffrey Hugo
2023-09-25 3:10 ` Qiang Yu
2023-09-29 15:22 ` Jeffrey Hugo
2023-10-16 8:46 ` Qiang Yu
2023-10-20 15:07 ` Jeffrey Hugo
2023-11-06 4:51 ` Manivannan Sadhasivam
2023-11-07 7:59 ` Qiang Yu
2023-11-06 4:41 ` Manivannan Sadhasivam
2023-11-07 7:19 ` Qiang Yu
2023-09-13 8:47 ` [PATCH v2 2/2] bus: mhi: host: Take irqsave lock after TRE is generated Qiang Yu
2023-09-22 14:50 ` Jeffrey Hugo
2023-09-25 4:08 ` Qiang Yu
2023-09-29 15:25 ` Jeffrey Hugo
2023-10-16 8:49 ` Qiang Yu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10f05b5a-8046-4884-b375-007a14248e00@quicinc.com \
--to=quic_qianyu@quicinc.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mhi@lists.linux.dev \
--cc=quic_cang@quicinc.com \
--cc=quic_hemantk@quicinc.com \
--cc=quic_jhugo@quicinc.com \
--cc=quic_lmotha@quicinc.com \
--cc=quic_mrana@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®