diff mbox series

[1/2] bus: mhi: core: add SBL state callback

Message ID 20221105194943.826847-1-robimarko@gmail.com (mailing list archive)
State Not Applicable
Headers show
Series [1/2] bus: mhi: core: add SBL state callback | expand

Commit Message

Robert Marko Nov. 5, 2022, 7:49 p.m. UTC
Add support for SBL state callback in MHI core.

It is required for ath11k MHI devices in order to be able to set QRTR
instance ID in the SBL state so that QRTR instance ID-s dont conflict in
case of multiple PCI/MHI cards or AHB + PCI/MHI card.
Setting QRTR instance ID is only possible in SBL state and there is
currently no way to ensure that we are in that state, so provide a
callback that the controller can trigger off.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
 drivers/bus/mhi/host/main.c | 1 +
 include/linux/mhi.h         | 2 ++
 2 files changed, 3 insertions(+)

Comments

Manivannan Sadhasivam Nov. 7, 2022, 11:27 a.m. UTC | #1
On Sat, Nov 05, 2022 at 08:49:42PM +0100, Robert Marko wrote:
> Add support for SBL state callback in MHI core.
> 
> It is required for ath11k MHI devices in order to be able to set QRTR
> instance ID in the SBL state so that QRTR instance ID-s dont conflict in
> case of multiple PCI/MHI cards or AHB + PCI/MHI card.
> Setting QRTR instance ID is only possible in SBL state and there is
> currently no way to ensure that we are in that state, so provide a
> callback that the controller can trigger off.
> 

Where can I find the corresponding ath11k patch that makes use of this
callback?

Thanks,
Mani

> Signed-off-by: Robert Marko <robimarko@gmail.com>
> ---
>  drivers/bus/mhi/host/main.c | 1 +
>  include/linux/mhi.h         | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
> index df0fbfee7b78..8b03dd1f0cb8 100644
> --- a/drivers/bus/mhi/host/main.c
> +++ b/drivers/bus/mhi/host/main.c
> @@ -900,6 +900,7 @@ int mhi_process_ctrl_ev_ring(struct mhi_controller *mhi_cntrl,
>  			switch (event) {
>  			case MHI_EE_SBL:
>  				st = DEV_ST_TRANSITION_SBL;
> +				mhi_cntrl->status_cb(mhi_cntrl, MHI_CB_EE_SBL_MODE);
>  				break;
>  			case MHI_EE_WFW:
>  			case MHI_EE_AMSS:
> diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> index a5441ad33c74..beffe102dd19 100644
> --- a/include/linux/mhi.h
> +++ b/include/linux/mhi.h
> @@ -34,6 +34,7 @@ struct mhi_buf_info;
>   * @MHI_CB_SYS_ERROR: MHI device entered error state (may recover)
>   * @MHI_CB_FATAL_ERROR: MHI device entered fatal error state
>   * @MHI_CB_BW_REQ: Received a bandwidth switch request from device
> + * @MHI_CB_EE_SBL_MODE: MHI device entered SBL mode
>   */
>  enum mhi_callback {
>  	MHI_CB_IDLE,
> @@ -45,6 +46,7 @@ enum mhi_callback {
>  	MHI_CB_SYS_ERROR,
>  	MHI_CB_FATAL_ERROR,
>  	MHI_CB_BW_REQ,
> +	MHI_CB_EE_SBL_MODE,
>  };
>  
>  /**
> -- 
> 2.38.1
>
Robert Marko Nov. 7, 2022, 11:31 a.m. UTC | #2
On Mon, 7 Nov 2022 at 12:28, Manivannan Sadhasivam <mani@kernel.org> wrote:
>
> On Sat, Nov 05, 2022 at 08:49:42PM +0100, Robert Marko wrote:
> > Add support for SBL state callback in MHI core.
> >
> > It is required for ath11k MHI devices in order to be able to set QRTR
> > instance ID in the SBL state so that QRTR instance ID-s dont conflict in
> > case of multiple PCI/MHI cards or AHB + PCI/MHI card.
> > Setting QRTR instance ID is only possible in SBL state and there is
> > currently no way to ensure that we are in that state, so provide a
> > callback that the controller can trigger off.
> >
>
> Where can I find the corresponding ath11k patch that makes use of this
> callback?

Hi Mani,
ath11k patch was sent as part of the same series to everybody included
in this patch as well
under the name of "[PATCH 2/2] wifi: ath11k: use unique QRTR instance ID".

If you did not receive it due to some kind of error, its available at
the linux-wireless patchwork[1]
or ath11k mailing list[2].

[1] https://patchwork.kernel.org/project/linux-wireless/patch/20221105194943.826847-2-robimarko@gmail.com/
[2] http://lists.infradead.org/pipermail/ath11k/2022-November/003678.html

Regards,
Robert

>
> Thanks,
> Mani
>
> > Signed-off-by: Robert Marko <robimarko@gmail.com>
> > ---
> >  drivers/bus/mhi/host/main.c | 1 +
> >  include/linux/mhi.h         | 2 ++
> >  2 files changed, 3 insertions(+)
> >
> > diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
> > index df0fbfee7b78..8b03dd1f0cb8 100644
> > --- a/drivers/bus/mhi/host/main.c
> > +++ b/drivers/bus/mhi/host/main.c
> > @@ -900,6 +900,7 @@ int mhi_process_ctrl_ev_ring(struct mhi_controller *mhi_cntrl,
> >                       switch (event) {
> >                       case MHI_EE_SBL:
> >                               st = DEV_ST_TRANSITION_SBL;
> > +                             mhi_cntrl->status_cb(mhi_cntrl, MHI_CB_EE_SBL_MODE);
> >                               break;
> >                       case MHI_EE_WFW:
> >                       case MHI_EE_AMSS:
> > diff --git a/include/linux/mhi.h b/include/linux/mhi.h
> > index a5441ad33c74..beffe102dd19 100644
> > --- a/include/linux/mhi.h
> > +++ b/include/linux/mhi.h
> > @@ -34,6 +34,7 @@ struct mhi_buf_info;
> >   * @MHI_CB_SYS_ERROR: MHI device entered error state (may recover)
> >   * @MHI_CB_FATAL_ERROR: MHI device entered fatal error state
> >   * @MHI_CB_BW_REQ: Received a bandwidth switch request from device
> > + * @MHI_CB_EE_SBL_MODE: MHI device entered SBL mode
> >   */
> >  enum mhi_callback {
> >       MHI_CB_IDLE,
> > @@ -45,6 +46,7 @@ enum mhi_callback {
> >       MHI_CB_SYS_ERROR,
> >       MHI_CB_FATAL_ERROR,
> >       MHI_CB_BW_REQ,
> > +     MHI_CB_EE_SBL_MODE,
> >  };
> >
> >  /**
> > --
> > 2.38.1
> >
>
> --
> மணிவண்ணன் சதாசிவம்
diff mbox series

Patch

diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c
index df0fbfee7b78..8b03dd1f0cb8 100644
--- a/drivers/bus/mhi/host/main.c
+++ b/drivers/bus/mhi/host/main.c
@@ -900,6 +900,7 @@  int mhi_process_ctrl_ev_ring(struct mhi_controller *mhi_cntrl,
 			switch (event) {
 			case MHI_EE_SBL:
 				st = DEV_ST_TRANSITION_SBL;
+				mhi_cntrl->status_cb(mhi_cntrl, MHI_CB_EE_SBL_MODE);
 				break;
 			case MHI_EE_WFW:
 			case MHI_EE_AMSS:
diff --git a/include/linux/mhi.h b/include/linux/mhi.h
index a5441ad33c74..beffe102dd19 100644
--- a/include/linux/mhi.h
+++ b/include/linux/mhi.h
@@ -34,6 +34,7 @@  struct mhi_buf_info;
  * @MHI_CB_SYS_ERROR: MHI device entered error state (may recover)
  * @MHI_CB_FATAL_ERROR: MHI device entered fatal error state
  * @MHI_CB_BW_REQ: Received a bandwidth switch request from device
+ * @MHI_CB_EE_SBL_MODE: MHI device entered SBL mode
  */
 enum mhi_callback {
 	MHI_CB_IDLE,
@@ -45,6 +46,7 @@  enum mhi_callback {
 	MHI_CB_SYS_ERROR,
 	MHI_CB_FATAL_ERROR,
 	MHI_CB_BW_REQ,
+	MHI_CB_EE_SBL_MODE,
 };
 
 /**