Re: [PATCH V2 1/1] remoteproc: qcom: Add NOTIFY_FATAL event type to SSR subdevice

From: Dmitry Baryshkov
Date: Wed Aug 28 2024 - 17:06:15 EST


On Tue, Aug 20, 2024 at 11:39:43AM GMT, Gokul Sriram Palanisamy wrote:
> From: Vignesh Viswanathan <quic_viswanat@xxxxxxxxxxx>
>
> Currently the SSR subdevice notifies the client driver on crash of the
> rproc from the recovery workqueue using the BEFORE_SHUTDOWN event.
> However, the client driver might be interested to know that the device
> has crashed immediately to pause any further transactions with the
> rproc. This calls for an event to be sent to the driver in the IRQ
> context as soon as the rproc crashes.
>
> Add NOTIFY_FATAL event to SSR subdevice to atomically notify rproc has
> crashed to the client driver. The client driver in this scenario is a
> ath Wi-Fi driver which is continuously queuing data to the remoteproc and
> needs to know if remoteproc crashes as soon as possible to stop queuing
> further data and also dump some debug statistics on the driver side that
> could potentially help in debug of why the remoteproc crashed.
>
> Validated the event in IPQ9574 and IPQ5332 by forcing the rproc to crash
> and ensuring the registered notifier function receives the notification
> in IRQ context.
>
> The client driver in this scenario is a Wi-Fi driver which is continuously
> queuing data to the remoteproc and needs to know if remoteproc crashes
> as soon as possible to stop queuing further data and also dump some
> debug statistics on the driver side that could potentially help in
> debug of why the remoteproc crashed.

Please post the patch together with the user of the API. Right now the
series has just a single patch in it, so it's impossible to judge
whether it makes sense or not.

>
> Signed-off-by: Vignesh Viswanathan <quic_viswanat@xxxxxxxxxxx>
> Acked-by: Mukesh Ojha <quic_mojha@xxxxxxxxxxx>
> Signed-off-by: Gokul Sriram Palanisamy <quic_gokulsri@xxxxxxxxxxx>
> ---
> changes since v1:
> - No changes. Rebased on top of linux-next.
> - We will now have a user for this notifier, ath12k.
>
> drivers/remoteproc/qcom_common.c | 60 +++++++++++++++++++++++++++
> drivers/remoteproc/remoteproc_core.c | 12 ++++++
> include/linux/remoteproc.h | 3 ++
> include/linux/remoteproc/qcom_rproc.h | 17 ++++++++
> 4 files changed, 92 insertions(+)

--
With best wishes
Dmitry