All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication
@ 2023-12-13  6:02 Xinglong Yang
  2024-03-08  6:16 ` Shivnandan Kumar
  2024-03-08  9:50 ` Sudeep Holla
  0 siblings, 2 replies; 6+ messages in thread
From: Xinglong Yang @ 2023-12-13  6:02 UTC (permalink / raw
  To: cristian.marussi@arm.com, Sudeep Holla
  Cc: linux-arm-kernel@lists.infradead.org

The shared memory is overwritten happened in some condition and the detail are
as follows:
Based on mailbox transportation. The thread A is waiting for response and The 
thread B is waiting the mark_txdone() to submit the next message. When the thread
A is timed out because that the callee do not reply promptly and then caller begins
to tx_tick() for the next message(for thread B). At the same time, the shared memory
is written by the callee(response for thread A) and set channel free. After the callee
has written the shared memory. The caller written the shared memory again for
thread B. In such case the shared memory written by callee is overwritten by caller. 
Later, the caller received the completion IRQ for Thread A(BUT has been overwritten
by Thread B's tx->buffer). The caller checks the shared memory discover that the buffer
is error. Which case triggers a chain of errors.

The part of error logs are as follows:
[    19.135368] arm-scmi firmware:scmi: timed out in resp(caller: xxx)
[    19.508536] arm-scmi firmware:scmi: Invalid message type:0 for 301 - HDR:0x%X state:1

Because the same token ID are received twice by caller, the second IRQ with the same token
will be treated as invalid message and abandoned.

Regards,
Xinglong

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication
  2023-12-13  6:02 [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication Xinglong Yang
@ 2024-03-08  6:16 ` Shivnandan Kumar
  2024-03-08  8:33   ` Cristian Marussi
  2024-03-08  9:50 ` Sudeep Holla
  1 sibling, 1 reply; 6+ messages in thread
From: Shivnandan Kumar @ 2024-03-08  6:16 UTC (permalink / raw
  To: xinglong.yang; +Cc: cristian.marussi, linux-arm-kernel, sudeep.holla

On 12/13/2023 11:32 AM, Xinglong Yang wrote:
> The shared memory is overwritten happened in some condition and the detail are
> as follows:
> Based on mailbox transportation. The thread A is waiting for response and The
> thread B is waiting the mark_txdone() to submit the next message. When the thread
> A is timed out because that the callee do not reply promptly and then caller begins
> to tx_tick() for the next message(for thread B). At the same time, the shared memory
> is written by the callee(response for thread A) and set channel free. After the callee
> has written the shared memory. The caller written the shared memory again for
> thread B. In such case the shared memory written by callee is overwritten by caller.
> Later, the caller received the completion IRQ for Thread A(BUT has been overwritten
> by Thread B's tx->buffer). The caller checks the shared memory discover that the buffer
> is error. Which case triggers a chain of errors.
> 
> The part of error logs are as follows:
> [    19.135368] arm-scmi firmware:scmi: timed out in resp(caller: xxx)
> [    19.508536] arm-scmi firmware:scmi: Invalid message type:0 for 301 - HDR:0x%X state:1
> 
> Because the same token ID are received twice by caller, the second IRQ with the same token
> will be treated as invalid message and abandoned.
> 
> Regards,
> Xinglong
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


hi Xinglong,

I encountered the same issue recently.
Is any fix identified/merged for this in a separate thread?

Thanks,
Shivnandan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication
  2024-03-08  6:16 ` Shivnandan Kumar
@ 2024-03-08  8:33   ` Cristian Marussi
  2024-03-08  9:53     ` Sudeep Holla
  0 siblings, 1 reply; 6+ messages in thread
From: Cristian Marussi @ 2024-03-08  8:33 UTC (permalink / raw
  To: Shivnandan Kumar; +Cc: xinglong.yang, linux-arm-kernel, sudeep.holla

On Fri, Mar 08, 2024 at 11:46:07AM +0530, Shivnandan Kumar wrote:
> On 12/13/2023 11:32 AM, Xinglong Yang wrote:
> > The shared memory is overwritten happened in some condition and the detail are
> > as follows:
> > Based on mailbox transportation. The thread A is waiting for response and The
> > thread B is waiting the mark_txdone() to submit the next message. When the thread
> > A is timed out because that the callee do not reply promptly and then caller begins
> > to tx_tick() for the next message(for thread B). At the same time, the shared memory
> > is written by the callee(response for thread A) and set channel free. After the callee
> > has written the shared memory. The caller written the shared memory again for
> > thread B. In such case the shared memory written by callee is overwritten by caller.
> > Later, the caller received the completion IRQ for Thread A(BUT has been overwritten
> > by Thread B's tx->buffer). The caller checks the shared memory discover that the buffer
> > is error. Which case triggers a chain of errors.
> > 
> > The part of error logs are as follows:
> > [    19.135368] arm-scmi firmware:scmi: timed out in resp(caller: xxx)
> > [    19.508536] arm-scmi firmware:scmi: Invalid message type:0 for 301 - HDR:0x%X state:1
> > 
> > Because the same token ID are received twice by caller, the second IRQ with the same token
> > will be treated as invalid message and abandoned.
> > 
> > Regards,
> > Xinglong
> > 
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
> 
> hi Xinglong,
> 

Hi Shivnandan,

> I encountered the same issue recently.
> Is any fix identified/merged for this in a separate thread?

This fix has beem merged back to 5.15 stable.

https://lore.kernel.org/linux-arm-kernel/20231220172112.763539-1-cristian.marussi@arm.com/

Thanks,
Cristian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication
  2023-12-13  6:02 [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication Xinglong Yang
  2024-03-08  6:16 ` Shivnandan Kumar
@ 2024-03-08  9:50 ` Sudeep Holla
  1 sibling, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2024-03-08  9:50 UTC (permalink / raw
  To: Xinglong Yang
  Cc: cristian.marussi@arm.com, Sudeep Holla,
	linux-arm-kernel@lists.infradead.org

On Wed, Dec 13, 2023 at 06:02:18AM +0000, Xinglong Yang wrote:
> 
> This email (including its attachments) is intended only for the person or
> entity to which it is addressed and may contain information that is
> privileged, confidential or otherwise protected from disclosure.
> Unauthorized use, dissemination, distribution or copying of this email or
> the information herein or taking any action in reliance on the contents of
> this email or the information herein, by anyone other than the intended
> recipient, or an employee or agent responsible for delivering the message to
> the intended recipient, is strictly prohibited. If you are not the intended
> recipient, please do not read, copy, use or disclose any part of this e-mail
> to others. Please notify the sender immediately and permanently delete this
> e-mail and any attachments if you received it in error. Internet
> communications cannot be guaranteed to be timely, secure, error-free or
> virus-free. The sender does not accept liability for any errors or
> omissions.

Thanks for the note, I have deleted your email. If you expect any response
in the future, please fix your email to not add this disclaimer.

-- 
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication
  2024-03-08  8:33   ` Cristian Marussi
@ 2024-03-08  9:53     ` Sudeep Holla
  2024-03-09 13:05       ` Shivnandan Kumar
  0 siblings, 1 reply; 6+ messages in thread
From: Sudeep Holla @ 2024-03-08  9:53 UTC (permalink / raw
  To: Shivnandan Kumar, xinglong.yang
  Cc: Cristian Marussi, Sudeep Holla, linux-arm-kernel

On Fri, Mar 08, 2024 at 08:33:17AM +0000, Cristian Marussi wrote:
> On Fri, Mar 08, 2024 at 11:46:07AM +0530, Shivnandan Kumar wrote:
> > On 12/13/2023 11:32 AM, Xinglong Yang wrote:
> > > The shared memory is overwritten happened in some condition and the detail are
> > > as follows:
> > > Based on mailbox transportation. The thread A is waiting for response and The
> > > thread B is waiting the mark_txdone() to submit the next message. When the thread
> > > A is timed out because that the callee do not reply promptly and then caller begins
> > > to tx_tick() for the next message(for thread B). At the same time, the shared memory
> > > is written by the callee(response for thread A) and set channel free. After the callee
> > > has written the shared memory. The caller written the shared memory again for
> > > thread B. In such case the shared memory written by callee is overwritten by caller.
> > > Later, the caller received the completion IRQ for Thread A(BUT has been overwritten
> > > by Thread B's tx->buffer). The caller checks the shared memory discover that the buffer
> > > is error. Which case triggers a chain of errors.
> > >
> > > The part of error logs are as follows:
> > > [    19.135368] arm-scmi firmware:scmi: timed out in resp(caller: xxx)
> > > [    19.508536] arm-scmi firmware:scmi: Invalid message type:0 for 301 - HDR:0x%X state:1
> > >
> > > Because the same token ID are received twice by caller, the second IRQ with the same token
> > > will be treated as invalid message and abandoned.
> > >
> > > Regards,
> > > Xinglong
> > >
> > > _______________________________________________
> > > linux-arm-kernel mailing list
> > > linux-arm-kernel@lists.infradead.org
> > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
> >
> > hi Xinglong,
> >
>
> Hi Shivnandan,
>
> > I encountered the same issue recently.
> > Is any fix identified/merged for this in a separate thread?

I assume you are running neither latest upstream nor the latest stable
trees(v5.15+)

>
> This fix has beem merged back to 5.15 stable.
>
> https://lore.kernel.org/linux-arm-kernel/20231220172112.763539-1-cristian.marussi@arm.com/

--
Regards,
Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication
  2024-03-08  9:53     ` Sudeep Holla
@ 2024-03-09 13:05       ` Shivnandan Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Shivnandan Kumar @ 2024-03-09 13:05 UTC (permalink / raw
  To: Sudeep Holla, xinglong.yang; +Cc: Cristian Marussi, linux-arm-kernel



On 3/8/2024 3:23 PM, Sudeep Holla wrote:
> On Fri, Mar 08, 2024 at 08:33:17AM +0000, Cristian Marussi wrote:
>> On Fri, Mar 08, 2024 at 11:46:07AM +0530, Shivnandan Kumar wrote:
>>> On 12/13/2023 11:32 AM, Xinglong Yang wrote:
>>>> The shared memory is overwritten happened in some condition and the detail are
>>>> as follows:
>>>> Based on mailbox transportation. The thread A is waiting for response and The
>>>> thread B is waiting the mark_txdone() to submit the next message. When the thread
>>>> A is timed out because that the callee do not reply promptly and then caller begins
>>>> to tx_tick() for the next message(for thread B). At the same time, the shared memory
>>>> is written by the callee(response for thread A) and set channel free. After the callee
>>>> has written the shared memory. The caller written the shared memory again for
>>>> thread B. In such case the shared memory written by callee is overwritten by caller.
>>>> Later, the caller received the completion IRQ for Thread A(BUT has been overwritten
>>>> by Thread B's tx->buffer). The caller checks the shared memory discover that the buffer
>>>> is error. Which case triggers a chain of errors.
>>>>
>>>> The part of error logs are as follows:
>>>> [    19.135368] arm-scmi firmware:scmi: timed out in resp(caller: xxx)
>>>> [    19.508536] arm-scmi firmware:scmi: Invalid message type:0 for 301 - HDR:0x%X state:1
>>>>
>>>> Because the same token ID are received twice by caller, the second IRQ with the same token
>>>> will be treated as invalid message and abandoned.
>>>>
>>>> Regards,
>>>> Xinglong
>>>>
>>>> _______________________________________________
>>>> linux-arm-kernel mailing list
>>>> linux-arm-kernel@lists.infradead.org
>>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>>
>>>
>>> hi Xinglong,
>>>
>>
>> Hi Shivnandan,
>>
>>> I encountered the same issue recently.
>>> Is any fix identified/merged for this in a separate thread?
> 
> I assume you are running neither latest upstream nor the latest stable
> trees(v5.15+)

hi Sudeep,Crisian,

Thank you for your response. Indeed, my build lacked this patch.
I will apply it.

Thanks,
Shivnandan


> 
>>
>> This fix has beem merged back to 5.15 stable.
>>
>> https://lore.kernel.org/linux-arm-kernel/20231220172112.763539-1-cristian.marussi@arm.com/
> 
> --
> Regards,
> Sudeep

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-09 13:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13  6:02 [BUG REPORT] firmware: arm_scmi: Shared Memory Overwritten in SCMI Mailbox Communication Xinglong Yang
2024-03-08  6:16 ` Shivnandan Kumar
2024-03-08  8:33   ` Cristian Marussi
2024-03-08  9:53     ` Sudeep Holla
2024-03-09 13:05       ` Shivnandan Kumar
2024-03-08  9:50 ` Sudeep Holla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.