All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Arun Kumar Neelakantam <aneela@codeaurora.org>
Cc: Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] soc: qcom: Add AOSS QMP communication driver
Date: Wed, 26 Dec 2018 12:28:30 -0800	[thread overview]
Message-ID: <20181226202830.GE9704@minitux> (raw)
In-Reply-To: <ce0d4d55-464c-1502-9dc1-b3a495c86aee@codeaurora.org>

On Tue 20 Nov 04:22 PST 2018, Arun Kumar Neelakantam wrote:

Thanks for the review Arun.

> On 11/12/2018 1:35 PM, Bjorn Andersson wrote:
[..]
> > +int qmp_send(struct qmp *qmp, const void *data, size_t len)
> > +{
> > +	int ret;
> > +
> > +	if (WARN_ON(len + sizeof(u32) > qmp->size)) {
> > +		dev_err(qmp->dev, "message too long\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (WARN_ON(len % sizeof(u32))) {
> > +		dev_err(qmp->dev, "message not 32-bit aligned\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	mutex_lock(&qmp->tx_lock);
> > +
> > +	if (!qmp_message_empty(qmp)) {
> > +		dev_err(qmp->dev, "mailbox left busy\n");
> > +		ret = -EINVAL;
> should it be -EBUSY ?

That makes more sense.

> And qmp_messge_empty will be done either by remote if it process the data
> else by this driver in TIMEOUT case, so does we need this check for every TX
> ? I think we can just reset to Zero once in open time.

Didn't think about that, should we really make the QMP link ready again
when we get a timeout? Can we expect that the firmware of the remote
side is ready to serve future messages?


Should we keep this check and remove the writel() below?

> > +		goto out_unlock;
> > +	}
> > +
> > +	/* The message RAM only implements 32-bit accesses */
> > +	__iowrite32_copy(qmp->msgram + qmp->offset + sizeof(u32),
> > +			 data, len / sizeof(u32));
> > +	writel(len, qmp->msgram + qmp->offset);
> > +	qmp_kick(qmp);
> > +
> > +	ret = wait_event_interruptible_timeout(qmp->event,
> > +					       qmp_message_empty(qmp), HZ);
> > +	if (!ret) {
> > +		dev_err(qmp->dev, "ucore did not ack channel\n");
> > +		ret = -ETIMEDOUT;
> > +
> > +		writel(0, qmp->msgram + qmp->offset);
> > +	} else {
> > +		ret = 0;
> > +	}
> > +
> > +out_unlock:
> > +	mutex_unlock(&qmp->tx_lock);
> > +
> > +	return ret;
> > +}

Regards,
Bjorn

  reply	other threads:[~2018-12-26 20:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12  8:05 [PATCH 0/3] Qualcomm AOSS QMP side channel binding and driver Bjorn Andersson
2018-11-12  8:05 ` [PATCH 1/3] dt-bindings: soc: qcom: Add AOSS QMP binding Bjorn Andersson
2018-12-03 23:51   ` Rob Herring
2018-12-10 23:56   ` Doug Anderson
2018-11-12  8:05 ` [PATCH 2/3] soc: qcom: Add AOSS QMP communication driver Bjorn Andersson
2018-11-20 12:22   ` Arun Kumar Neelakantam
2018-12-26 20:28     ` Bjorn Andersson [this message]
2019-01-03 17:48       ` Arun Kumar Neelakantam
2018-11-12  8:05 ` [PATCH 3/3] soc: qcom: Add AOSS QMP genpd provider Bjorn Andersson
2018-11-27  3:31   ` Sai Prakash Ranjan
2018-12-26 20:30     ` Bjorn Andersson
2018-11-27 10:50   ` Sai Prakash Ranjan

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=20181226202830.GE9704@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=aneela@codeaurora.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --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.