From: Abhishek Singh <quic_abhishes@quicinc.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: <srinivas.kandagatla@linaro.org>, <linux-arm-msm@vger.kernel.org>,
<quic_bkumar@quicinc.com>, <linux-kernel@vger.kernel.org>,
<quic_ktadakam@quicinc.com>, <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v1] misc: fastrpc: Trigger a panic using BUG_ON in device release
Date: Fri, 30 Aug 2024 14:14:15 +0530 [thread overview]
Message-ID: <4b0b90e2-a6c1-40d7-9dc6-ec22adfafca4@quicinc.com> (raw)
In-Reply-To: <2024081353-blah-reversion-1435@gregkh>
On 8/13/2024 3:07 PM, Greg KH wrote:
> On Mon, Aug 05, 2024 at 04:36:28PM +0530, Abhishek Singh wrote:
>>
>> On 7/30/2024 12:46 PM, Greg KH wrote:
>>> On Tue, Jul 30, 2024 at 12:39:45PM +0530, Abhishek Singh wrote:
>>>> The user process on ARM closes the device node while closing the
>>>> session, triggers a remote call to terminate the PD running on the
>>>> DSP. If the DSP is in an unstable state and cannot process the remote
>>>> request from the HLOS, glink fails to deliver the kill request to the
>>>> DSP, resulting in a timeout error. Currently, this error is ignored,
>>>> and the session is closed, causing all the SMMU mappings associated
>>>> with that specific PD to be removed. However, since the PD is still
>>>> operational on the DSP, any attempt to access these SMMU mappings
>>>> results in an SMMU fault, leading to a panic. As the SMMU mappings
>>>> have already been removed, there is no available information on the
>>>> DSP to determine the root cause of its unresponsiveness to remote
>>>> calls. As the DSP is unresponsive to all process remote calls, use
>>>> BUG_ON to prevent the removal of SMMU mappings and to properly
>>>> identify the root cause of the DSP’s unresponsiveness to the remote
>>>> calls.
>>>>
>>>> Signed-off-by: Abhishek Singh <quic_abhishes@quicinc.com>
>>>> ---
>>>> drivers/misc/fastrpc.c | 4 ++++
>>>> 1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>>>> index 5204fda51da3..bac9c749564c 100644
>>>> --- a/drivers/misc/fastrpc.c
>>>> +++ b/drivers/misc/fastrpc.c
>>>> @@ -97,6 +97,7 @@
>>>> #define FASTRPC_RMID_INIT_CREATE_STATIC 8
>>>> #define FASTRPC_RMID_INIT_MEM_MAP 10
>>>> #define FASTRPC_RMID_INIT_MEM_UNMAP 11
>>>> +#define PROCESS_KILL_SC 0x01010000
>>>>
>>>> /* Protection Domain(PD) ids */
>>>> #define ROOT_PD (0)
>>>> @@ -1128,6 +1129,9 @@ static int fastrpc_invoke_send(struct fastrpc_session_ctx *sctx,
>>>> fastrpc_context_get(ctx);
>>>>
>>>> ret = rpmsg_send(cctx->rpdev->ept, (void *)msg, sizeof(*msg));
>>>> + /* trigger panic if glink communication is broken and the message is for PD kill */
>>>> + BUG_ON((ret == -ETIMEDOUT) && (handle == FASTRPC_INIT_HANDLE) &&
>>>> + (ctx->sc == PROCESS_KILL_SC));
>>>
>>> You just crashed the machine completely, sorry, but no, properly handle
>>> the issue and clean up if you can detect it, do not break systems.
>>>
>> But the Glink communication with DSP is already broken; we cannot communicate with the DSP.
>> The system will crash if we proceed with cleanup on the ARM side. If we don’t do cleanup,
>> a resource leak will occur. Eventually, the system will become dead. That’s why I am
>> crashing the device.
>
> Then explicitly call panic() if you think you really want to shut the
> system down.
>
>> What does it mean to explicitly call panic()? Are you trying to say we should use panic() instead of BUG_ON()?
>
> greg k-h
next prev parent reply other threads:[~2024-08-30 8:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 7:09 Abhishek Singh
2024-07-30 7:16 ` Greg KH
2024-08-05 11:06 ` Abhishek Singh
2024-08-13 9:37 ` Greg KH
2024-08-30 8:44 ` Abhishek Singh [this message]
2024-08-19 11:00 ` Caleb Connolly
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=4b0b90e2-a6c1-40d7-9dc6-ec22adfafca4@quicinc.com \
--to=quic_abhishes@quicinc.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_bkumar@quicinc.com \
--cc=quic_ktadakam@quicinc.com \
--cc=srinivas.kandagatla@linaro.org \
/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®