All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Andy Gross <andy.gross@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] soc: qcom: wcnss_ctrl: Make wcnss_ctrl parent the other components
Date: Thu, 31 Mar 2016 12:39:24 -0700	[thread overview]
Message-ID: <20160331193924.GD8929@tuxbot> (raw)
In-Reply-To: <20160331184700.GE8252@hector.attlocal.net>

On Thu 31 Mar 11:47 PDT 2016, Andy Gross wrote:

> On Mon, Mar 28, 2016 at 09:35:25PM -0700, Bjorn Andersson wrote:
> > We need the signal from wcnss_ctrl indicating that the firmware is up
> > and running before we can communicate with the other components of the
> > chip. So make these other components children of the wcnss_ctrl device,
> > so they can be probed in order.
> > 
> > The process seems to take between 1/2-5 seconds, so this is done in a
> > worker, instead of holding up the probe.
> > 
> > Also adding the wait for a cbc completion if the firmware indicates this is
> > needed - like on 8016.
> 
> Can you define what a CBC is?
> 

Unfortunately I have no clue and have not yet seen this abbreviation in
any documentation...

> 
> <snip>
> 
> >  /**
> >   * wcnss_download_nv() - send nv binary to WCNSS
> > - * @work:	work struct to acquire wcnss context
> > + * @wcnss:	wcnss_ctrl state handle
> > + *
> > + * Returns 1 on success or 2 to indicate upcoming cbc completion. Negative
> 
> maybe a nit, but define the return values
> 

I'll remap them a step down, so the function returns 0 on success and 1
on "need to wait for cbc complete". That way we don't have an undefined
hole in the return set as well.

> > + * errno on failure.
> >   */
> > -static void wcnss_download_nv(struct work_struct *work)
> > +static int wcnss_download_nv(struct wcnss_ctrl *wcnss)
> >  {
> > -	struct wcnss_ctrl *wcnss = container_of(work, struct wcnss_ctrl, download_nv_work);
> >  	struct wcnss_download_nv_req *req;
> >  	const struct firmware *fw;
> >  	const void *data;
> > @@ -178,7 +207,7 @@ static void wcnss_download_nv(struct work_struct *work)
> >  
> >  	req = kzalloc(sizeof(*req) + NV_FRAGMENT_SIZE, GFP_KERNEL);
> >  	if (!req)
> > -		return;
> > +		return -ENOMEM;
> >  
> >  	ret = request_firmware(&fw, NVBIN_FILE, wcnss->dev);
> >  	if (ret) {
> 
> <snip>
> 
> > +static void wcnss_async_probe(struct work_struct *work)
> > +{
> > +	struct wcnss_ctrl *wcnss = container_of(work, struct wcnss_ctrl, probe_work);
> > +	int ret;
> > +
> > +	ret = wcnss_request_version(wcnss);
> > +	if (ret < 0)
> > +		return;
> > +
> > +	ret = wcnss_download_nv(wcnss);
> > +	if (ret < 0)
> > +		return;
> > +
> > +	/* Wait for pending CBC completion if download nv returns 2 */
> > +	if (ret == 2) {
> 
> Perhaps have a #define for the value is warranted
> 

With the above remap I can rename ret here to need_cbc and the code will
be understandable.

> > +		ret = wait_for_completion_timeout(&wcnss->cbc, WCNSS_REQUEST_TIMEOUT);
> > +		if (!ret)
> > +			dev_err(wcnss->dev, "expected cbc completion\n");
> > +	}
> > +
> > +	of_platform_populate(wcnss->dev->of_node, NULL, NULL, wcnss->dev);
> >  }
> 
> <snip>

Thanks for the feedback!

Regards,
Bjorn

  reply	other threads:[~2016-03-31 19:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29  4:35 [PATCH 1/5] soc: qcom: smd: Make callback pass channel reference Bjorn Andersson
2016-03-29  4:35 ` [PATCH 2/5] soc: qcom: smem: Use write-combine remap for SMEM Bjorn Andersson
2016-03-31 18:28   ` Andy Gross
2016-03-29  4:35 ` [PATCH 3/5] dt-binding: Add Qualcomm WCNSS control binding Bjorn Andersson
     [not found]   ` <1459226126-16725-3-git-send-email-bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-03-31 14:28     ` Rob Herring
2016-03-31 14:28       ` Rob Herring
2016-03-31 17:16       ` Bjorn Andersson
2016-03-31 17:38         ` Rob Herring
     [not found]           ` <CAL_JsqKbjUxOMbn00OOmwM1vvjRzC8RzX=4WA7WP+K2XYjOSMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-31 18:24             ` Bjorn Andersson
2016-03-31 18:24               ` Bjorn Andersson
2016-03-31 20:42               ` Rob Herring
2016-03-31 21:28                 ` Bjorn Andersson
2016-03-29  4:35 ` [PATCH 4/5] soc: qcom: wcnss_ctrl: Make wcnss_ctrl parent the other components Bjorn Andersson
2016-03-31 18:47   ` Andy Gross
2016-03-31 19:39     ` Bjorn Andersson [this message]
2016-03-29  4:35 ` [PATCH 5/5] ARM: dts: qcom: msm8974: Introduce pronto node Bjorn Andersson

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=20160331193924.GD8929@tuxbot \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=robh+dt@kernel.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 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.