Linux Remote Processor Subsystem development
 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>,
	Ohad Ben-Cohen <ohad@wizery.com>, Chris Lew <clew@codeaurora.org>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-soc@vger.kernel.org, linux-remoteproc@vger.kernel.org
Subject: Re: [PATCH v2 2/5] soc: qcom: Introduce QMI helpers
Date: Tue, 7 Nov 2017 11:18:01 -0800	[thread overview]
Message-ID: <20171107191801.GX28761@minitux> (raw)
In-Reply-To: <5d6b232c-341d-ed97-edc4-7492dbe3674b@codeaurora.org>

On Tue 07 Nov 08:27 PST 2017, Arun Kumar Neelakantam wrote:
> On 11/7/2017 10:50 AM, Bjorn Andersson wrote:
> > diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
> > index 91b70b170a82..9718f1c41e3d 100644
> > --- a/drivers/soc/qcom/Kconfig
> > +++ b/drivers/soc/qcom/Kconfig
> > @@ -37,6 +37,7 @@ config QCOM_PM
> >   config QCOM_QMI_HELPERS
> >   	tristate
> > +	depends on ARCH_QCOM
> I feel It should depend on QRTR instead of ARCH_QCOM

make currently skips drivers/soc/qcom when ARCH_QCOM is not set (Kbuild
doesn't), so this "depends on" ensures that anyone selecting this will
get a "unmet dependency" warning from Kbuild if they don't also depends
on ARCH_QCOM.

Not specifying a dependency on QRTR does increase build test coverage
somewhat, but as we're still limited by ARCH_QCOM it's not that big of a
gain. So I'll add this, as you suggest.

[..]
> > diff --git a/drivers/soc/qcom/qmi_interface.c b/drivers/soc/qcom/qmi_interface.c
[..]
> > +static void qmi_send_new_server(struct qmi_handle *qmi, struct qmi_service *svc)
> > +{
> > +	struct qrtr_ctrl_pkt pkt;
> > +	struct sockaddr_qrtr sq;
> > +	struct msghdr msg = {0};
> > +	struct kvec iv = { &pkt, sizeof(pkt) };
> > +	int ret;
> > +
> > +	memset(&pkt, 0, sizeof(pkt));
> > +	pkt.cmd = cpu_to_le32(QRTR_TYPE_NEW_SERVER);
> > +	pkt.server.service = cpu_to_le32(svc->service);
> > +	pkt.server.instance = cpu_to_le32(svc->version | svc->instance << 8);
> > +	pkt.server.node = qmi->sq.sq_node;
> > +	pkt.server.port = qmi->sq.sq_port;
> > +
> > +	sq.sq_family = qmi->sq.sq_family;
> > +	sq.sq_node = qmi->sq.sq_node;
> > +	sq.sq_port = QRTR_PORT_CTRL;
> > +
> > +	msg.msg_name = &sq;
> > +	msg.msg_namelen = sizeof(sq);
> > +
> > +	mutex_lock(&qmi->sock_lock);
> > +	if (qmi->sock) {
> > +		ret = kernel_sendmsg(qmi->sock, &msg, &iv, 1, sizeof(pkt));
> This NEW_SERVER message is send to name server then it will be broadcasted
> to all nodes in network by name server right.

Correct, above you can see that I use the sq_node of our socket as
destination node and QRTR_PORT_CTRL.

The name service will forward the information about the new service to
any registered nodes and will keep track of it and advertise it to
future appearing nodes.

[..]
> > +/**
> > + * qmi_send_indication() - send a request QMI message
> Look incorrect function name is used

Yes, a copy-paste error of mine. Will fix.

> > + * @qmi:	QMI client handle
> > + * @sq:		destination sockaddr
> > + * @txn:	transaction object to use for the message
> > + * @msg_id:	message id
> > + * @len:	max length of the QMI message
> > + * @ei:		QMI message description
> > + * @c_struct:	object to be encoded
> > + *
> > + * Returns 0 on success, negative errno on failure.
> > + */
> > +ssize_t qmi_send_request(struct qmi_handle *qmi, struct sockaddr_qrtr *sq,
> > +			 struct qmi_txn *txn, int msg_id, size_t len,
> > +			 struct qmi_elem_info *ei, const void *c_struct)
> > +{
> > +	return qmi_send_message(qmi, sq, txn, QMI_REQUEST, msg_id, len, ei,
> > +				c_struct);
> > +}
> > +EXPORT_SYMBOL_GPL(qmi_send_request);
> > +
> > +/**
> > + * qmi_send_indication() - send a response QMI message
> Look incorrect function name is used

Dito.

Thank you,
Bjorn

  reply	other threads:[~2017-11-07 19:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07  5:20 [PATCH v2 0/5] In-kernel QMI helpers and sysmon Bjorn Andersson
2017-11-07  5:20 ` [PATCH v2 1/5] soc: qcom: Introduce QMI encoder/decoder Bjorn Andersson
2017-11-07  5:20 ` [PATCH v2 2/5] soc: qcom: Introduce QMI helpers Bjorn Andersson
2017-11-07 16:27   ` Arun Kumar Neelakantam
2017-11-07 19:18     ` Bjorn Andersson [this message]
2017-11-08 21:40   ` Chris Lew
2017-11-07  5:20 ` [PATCH v2 3/5] remoteproc: Pass type of shutdown to subdev remove Bjorn Andersson
2017-11-07  5:20 ` [PATCH v2 4/5] remoteproc: qcom: Introduce sysmon Bjorn Andersson
2017-11-07  5:20 ` [PATCH v2 5/5] samples: Introduce Qualcomm QMI sample client Bjorn Andersson
2017-11-07 18:40   ` Jonathan Neuschäfer
2017-11-07 19:06     ` 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=20171107191801.GX28761@minitux \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=aneela@codeaurora.org \
    --cc=clew@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=ohad@wizery.com \
    /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