phone-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sireesh Kodali" <sireeshkodali1@gmail.com>
To: "Alex Elder" <elder@ieee.org>, <phone-devel@vger.kernel.org>,
	<~postmarketos/upstreaming@lists.sr.ht>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<elder@kernel.org>
Cc: "Vladimir Lypak" <vladimir.lypak@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>
Subject: Re: [RFC PATCH 13/17] net: ipa: Add support for IPA v2.x in the driver's QMI interface
Date: Mon, 18 Oct 2021 23:52:31 +0530	[thread overview]
Message-ID: <CF2QQACAFQQ9.3H61DJ29ALVVI@skynet-linux> (raw)
In-Reply-To: <d50312f8-823d-01b1-47a5-7190be93408d@ieee.org>

On Thu Oct 14, 2021 at 4:00 AM IST, Alex Elder wrote:
> On 9/19/21 10:08 PM, Sireesh Kodali wrote:
> > On IPA v2.x, the modem doesn't send a DRIVER_INIT_COMPLETED, so we have
> > to rely on the uc's IPA_UC_RESPONSE_INIT_COMPLETED to know when its
> > ready. We add a function here that marks uc_ready = true. This function
> > is called by ipa_uc.c when IPA_UC_RESPONSE_INIT_COMPLETED is handled.
>
> This should use the new ipa_mem_find() interface for getting the
> memory information for the ZIP region.
>

Got it, thanks

> I don't know where the IPA_UC_RESPONSE_INIT_COMPLETED gets sent
> but I presume it ends up calling ipa_qmi_signal_uc_loaded().
>

IPA_UC_RESPONSE_INIT_COMPLETED is handled by the ipa_uc sub-driver. The
handler calls ipa_qmi_signal_uc_loaded() once the response is received,
at which point we know the uc has been inited.

> I think actually the DRIVER_INIT_COMPLETE message from the modem
> is saying "I finished initializing the microcontroller." And
> I've wondered why there is a duplicate mechanism. Maybe there
> was a race or something.
>

This makes sense. Given that some modems rely on the IPA block for
initialization, I wonder if Qualcomm decided it would be easier to allow
the modem to complete the uc initialization and send the signal instead.

Regards,
Sireesh
> -Alex
>
> > Signed-off-by: Sireesh Kodali <sireeshkodali1@gmail.com>
> > Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>
> > ---
> >   drivers/net/ipa/ipa_qmi.c | 27 ++++++++++++++++++++++++++-
> >   drivers/net/ipa/ipa_qmi.h | 10 ++++++++++
> >   2 files changed, 36 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ipa/ipa_qmi.c b/drivers/net/ipa/ipa_qmi.c
> > index 7e2fe701cc4d..876e2a004f70 100644
> > --- a/drivers/net/ipa/ipa_qmi.c
> > +++ b/drivers/net/ipa/ipa_qmi.c
> > @@ -68,6 +68,11 @@
> >    * - The INDICATION_REGISTER request and INIT_COMPLETE indication are
> >    *   optional for non-initial modem boots, and have no bearing on the
> >    *   determination of when things are "ready"
> > + *
> > + * Note that on IPA v2.x, the modem doesn't send a DRIVER_INIT_COMPLETE
> > + * request. Thus, we rely on the uc's IPA_UC_RESPONSE_INIT_COMPLETED to know
> > + * when the uc is ready. The rest of the process is the same on IPA v2.x and
> > + * later IPA versions
> >    */
> >   
> >   #define IPA_HOST_SERVICE_SVC_ID		0x31
> > @@ -345,7 +350,12 @@ init_modem_driver_req(struct ipa_qmi *ipa_qmi)
> >   			req.hdr_proc_ctx_tbl_info.start + mem->size - 1;
> >   	}
> >   
> > -	/* Nothing to report for the compression table (zip_tbl_info) */
> > +	mem = &ipa->mem[IPA_MEM_ZIP];
> > +	if (mem->size) {
> > +		req.zip_tbl_info_valid = 1;
> > +		req.zip_tbl_info.start = ipa->mem_offset + mem->offset;
> > +		req.zip_tbl_info.end = ipa->mem_offset + mem->size - 1;
> > +	}
> >   
> >   	mem = ipa_mem_find(ipa, IPA_MEM_V4_ROUTE_HASHED);
> >   	if (mem->size) {
> > @@ -525,6 +535,21 @@ int ipa_qmi_setup(struct ipa *ipa)
> >   	return ret;
> >   }
> >   
> > +/* With IPA v2 modem is not required to send DRIVER_INIT_COMPLETE request to AP.
> > + * We start operation as soon as IPA_UC_RESPONSE_INIT_COMPLETED irq is triggered.
> > + */
> > +void ipa_qmi_signal_uc_loaded(struct ipa *ipa)
> > +{
> > +	struct ipa_qmi *ipa_qmi = &ipa->qmi;
> > +
> > +	/* This is needed only on IPA 2.x */
> > +	if (ipa->version > IPA_VERSION_2_6L)
> > +		return;
> > +
> > +	ipa_qmi->uc_ready = true;
> > +	ipa_qmi_ready(ipa_qmi);
> > +}
> > +
> >   /* Tear down IPA QMI handles */
> >   void ipa_qmi_teardown(struct ipa *ipa)
> >   {
> > diff --git a/drivers/net/ipa/ipa_qmi.h b/drivers/net/ipa/ipa_qmi.h
> > index 856ef629ccc8..4962d88b0d22 100644
> > --- a/drivers/net/ipa/ipa_qmi.h
> > +++ b/drivers/net/ipa/ipa_qmi.h
> > @@ -55,6 +55,16 @@ struct ipa_qmi {
> >    */
> >   int ipa_qmi_setup(struct ipa *ipa);
> >   
> > +/**
> > + * ipa_qmi_signal_uc_loaded() - Signal that the UC has been loaded
> > + * @ipa:		IPA pointer
> > + *
> > + * This is called when the uc indicates that it is ready. This exists, because
> > + * on IPA v2.x, the modem does not send a DRIVER_INIT_COMPLETED. Thus we have
> > + * to rely on the uc's INIT_COMPLETED response to know if it was initialized
> > + */
> > +void ipa_qmi_signal_uc_loaded(struct ipa *ipa);
> > +
> >   /**
> >    * ipa_qmi_teardown() - Tear down IPA QMI handles
> >    * @ipa:		IPA pointer
> > 


  reply	other threads:[~2021-10-18 18:33 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  3:07 [RFC PATCH 00/17] net: ipa: Add support for IPA v2.x Sireesh Kodali
2021-09-20  3:07 ` [RFC PATCH 01/17] net: ipa: Correct ipa_status_opcode enumeration Sireesh Kodali
2021-10-13 22:28   ` Alex Elder
2021-10-18 16:12     ` Sireesh Kodali
2021-09-20  3:07 ` [RFC PATCH 02/17] net: ipa: revert to IPA_TABLE_ENTRY_SIZE for 32-bit IPA support Sireesh Kodali
2021-10-13 22:28   ` Alex Elder
2021-10-18 16:16     ` Sireesh Kodali
2021-09-20  3:07 ` [RFC PATCH 04/17] net: ipa: Establish ipa_dma interface Sireesh Kodali
2021-10-13 22:29   ` Alex Elder
2021-10-18 16:45     ` Sireesh Kodali
2021-09-20  3:07 ` [RFC PATCH 05/17] net: ipa: Check interrupts for availability Sireesh Kodali
2021-10-13 22:29   ` Alex Elder
2021-09-20  3:08 ` [RFC PATCH 06/17] net: ipa: Add timeout for ipa_cmd_pipeline_clear_wait Sireesh Kodali
2021-10-13 22:29   ` Alex Elder
2021-10-18 17:02     ` Sireesh Kodali
2021-09-20  3:08 ` [RFC PATCH 07/17] net: ipa: Add IPA v2.x register definitions Sireesh Kodali
2021-10-13 22:29   ` Alex Elder
2021-10-18 17:25     ` Sireesh Kodali
2021-09-20  3:08 ` [RFC PATCH 08/17] net: ipa: Add support for IPA v2.x interrupts Sireesh Kodali
2021-10-13 22:29   ` Alex Elder
2021-09-20  3:08 ` [RFC PATCH 09/17] net: ipa: Add support for using BAM as a DMA transport Sireesh Kodali
2021-10-13 22:30   ` Alex Elder
2021-10-18 17:30     ` Sireesh Kodali
2021-09-20  3:08 ` [PATCH 10/17] net: ipa: Add support for IPA v2.x commands and table init Sireesh Kodali
2021-10-13 22:30   ` Alex Elder
2021-10-18 18:13     ` Sireesh Kodali
2021-09-20  3:08 ` [RFC PATCH 11/17] net: ipa: Add support for IPA v2.x endpoints Sireesh Kodali
2021-10-13 22:30   ` Alex Elder
2021-10-18 18:17     ` Sireesh Kodali
2021-09-20  3:08 ` [RFC PATCH 12/17] net: ipa: Add support for IPA v2.x memory map Sireesh Kodali
2021-10-13 22:30   ` Alex Elder
2021-10-18 18:19     ` Sireesh Kodali
2021-09-20  3:08 ` [RFC PATCH 13/17] net: ipa: Add support for IPA v2.x in the driver's QMI interface Sireesh Kodali
2021-10-13 22:30   ` Alex Elder
2021-10-18 18:22     ` Sireesh Kodali [this message]
2021-09-20  3:08 ` [RFC PATCH 14/17] net: ipa: Add support for IPA v2 microcontroller Sireesh Kodali
2021-10-13 22:30   ` Alex Elder
2021-09-20  3:08 ` [RFC PATCH 15/17] net: ipa: Add IPA v2.6L initialization sequence support Sireesh Kodali
2021-10-13 22:30   ` Alex Elder
2021-09-20  3:08 ` [RFC PATCH 16/17] net: ipa: Add hw config describing IPA v2.x hardware Sireesh Kodali
2021-10-13 22:30   ` Alex Elder
2021-10-18 18:35     ` Sireesh Kodali
2021-09-20  3:08 ` [RFC PATCH 17/17] dt-bindings: net: qcom,ipa: Add support for MSM8953 and MSM8996 IPA Sireesh Kodali
2021-09-23 12:42   ` Rob Herring
2021-10-13 22:31   ` Alex Elder
2021-10-13 22:27 ` [RFC PATCH 00/17] net: ipa: Add support for IPA v2.x Alex Elder

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=CF2QQACAFQQ9.3H61DJ29ALVVI@skynet-linux \
    --to=sireeshkodali1@gmail.com \
    --cc=davem@davemloft.net \
    --cc=elder@ieee.org \
    --cc=elder@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=vladimir.lypak@gmail.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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;
as well as URLs for NNTP newsgroup(s).