From: Sudeep Holla <sudeep.holla@arm.com>
To: Jim Quinlan <james.quinlan@broadcom.com>
Cc: Peng Fan <peng.fan@nxp.com>,
Bo Zhang <bozhang.zhang@broadcom.com>,
Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 02/11] firmware: arm_scmi: Segregate tx channel handling and prepare to add rx
Date: Fri, 19 Jul 2019 11:26:36 +0100 [thread overview]
Message-ID: <20190719102636.GA18022@e107155-lin> (raw)
In-Reply-To: <CA+-6iNzmkT26cEdpD_C=L0bJ4TOEZwGuakin+GR4brSjSETfRA@mail.gmail.com>
On Thu, Jul 18, 2019 at 05:23:10PM -0400, Jim Quinlan wrote:
> On Mon, Jul 8, 2019 at 11:47 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > The transmit(Tx) channels are specified as the first entry and the
> > receive(Rx) channels are the second entry as per the device tree
> > bindings. Since we currently just support Tx, index 0 is hardcoded at
> > all required callsites.
> >
> > In order to prepare for adding Rx support, let's remove those hardcoded
> > index and add boolean parameter to identify Tx/Rx channels when setting
> > them up.
> >
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> > drivers/firmware/arm_scmi/driver.c | 33 ++++++++++++++++--------------
> > 1 file changed, 18 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> > index 0bd2af0a008f..f7fb6d5bfc64 100644
> > --- a/drivers/firmware/arm_scmi/driver.c
> > +++ b/drivers/firmware/arm_scmi/driver.c
> > @@ -112,7 +112,7 @@ struct scmi_chan_info {
> > * @version: SCMI revision information containing protocol version,
> > * implementation version and (sub-)vendor identification.
> > * @minfo: Message info
> > - * @tx_idr: IDR object to map protocol id to channel info pointer
> > + * @tx_idr: IDR object to map protocol id to Tx channel info pointer
> > * @protocols_imp: List of protocols implemented, currently maximum of
> > * MAX_PROTOCOLS_IMP elements allocated by the base protocol
> > * @node: List head
> > @@ -640,22 +640,26 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo)
> > return 0;
> > }
> >
> > -static int scmi_mailbox_check(struct device_node *np)
> > +static int scmi_mailbox_check(struct device_node *np, int idx)
> > {
> > - return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, NULL);
> > + return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells",
> > + idx, NULL);
> > }
> >
> > -static inline int
> > -scmi_mbox_chan_setup(struct scmi_info *info, struct device *dev, int prot_id)
> > +static int scmi_mbox_chan_setup(struct scmi_info *info, struct device *dev,
> > + int prot_id, bool tx)
> > {
> > - int ret;
> > + int ret, idx;
> > struct resource res;
> > resource_size_t size;
> > struct device_node *shmem, *np = dev->of_node;
> > struct scmi_chan_info *cinfo;
> > struct mbox_client *cl;
> >
> > - if (scmi_mailbox_check(np)) {
> > + /* Transmit channel is first entry i.e. index 0 */
> > + idx = tx ? 0 : 1;
> > +
> > + if (scmi_mailbox_check(np, idx)) {
> > cinfo = idr_find(&info->tx_idr, SCMI_PROTOCOL_BASE);
> > goto idr_alloc;
> > }
> > @@ -669,11 +673,11 @@ scmi_mbox_chan_setup(struct scmi_info *info, struct device *dev, int prot_id)
> > cl = &cinfo->cl;
> > cl->dev = dev;
> > cl->rx_callback = scmi_rx_callback;
> > - cl->tx_prepare = scmi_tx_prepare;
> > + cl->tx_prepare = tx ? scmi_tx_prepare : NULL;
> > cl->tx_block = false;
> > - cl->knows_txdone = true;
> > + cl->knows_txdone = tx;
> >
> > - shmem = of_parse_phandle(np, "shmem", 0);
> > + shmem = of_parse_phandle(np, "shmem", idx);
> Hi Sudeep,
>
> You can't see it in the diff but you have two error messages that use
> "Tx"; should this be changed to "Tx/Rx"?
>
Thanks for spotting, will fix it.
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-07-19 10:27 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-08 15:47 [PATCH 00/11] firmware: arm_scmi: Add support for Rx, async commands and delayed response Sudeep Holla
2019-07-08 15:47 ` [PATCH 01/11] firmware: arm_scmi: Reorder some functions to avoid forward declarations Sudeep Holla
2019-07-08 15:47 ` [PATCH 02/11] firmware: arm_scmi: Segregate tx channel handling and prepare to add rx Sudeep Holla
2019-07-18 21:23 ` Jim Quinlan
2019-07-19 10:26 ` Sudeep Holla [this message]
2019-07-08 15:47 ` [PATCH 03/11] firmware: arm_scmi: Add receive channel support for notifications Sudeep Holla
2019-07-08 15:47 ` [PATCH 04/11] firmware: arm_scmi: Separate out tx buffer handling and prepare to add rx Sudeep Holla
2019-07-08 15:47 ` [PATCH 05/11] firmware: arm_scmi: Add receive buffer support for notifications Sudeep Holla
2019-07-18 21:24 ` Jim Quinlan
[not found] ` <CA+-6iNz26xUyrzVSbWA+jwEfj3BC8k8KNCg2SreDK7mfWsbAWg@mail.gmail.com>
2019-07-19 10:29 ` Sudeep Holla
2019-07-08 15:47 ` [PATCH 06/11] firmware: arm_scmi: Add mechanism to unpack message headers Sudeep Holla
2019-07-08 15:47 ` [PATCH 07/11] firmware: arm_scmi: Add support for asynchronous commands and delayed response Sudeep Holla
2019-07-18 21:38 ` Jim Quinlan
2019-07-19 11:03 ` Sudeep Holla
2019-07-19 20:16 ` Jim Quinlan
2019-07-22 13:08 ` Sudeep Holla
2019-07-08 15:47 ` [PATCH 08/11] firmware: arm_scmi: Drop async flag in sensor_ops->reading_get Sudeep Holla
2019-07-08 16:05 ` Guenter Roeck
2019-07-08 15:47 ` [PATCH 09/11] firmware: arm_scmi: Add asynchronous sensor read if it supports Sudeep Holla
2019-07-08 15:47 ` [PATCH 10/11] firmware: arm_scmi: Drop config flag in clk_ops->rate_set Sudeep Holla
2019-07-22 21:30 ` Stephen Boyd
2019-07-08 15:47 ` [PATCH 11/11] firmware: arm_scmi: Use asynchronous CLOCK_RATE_SET when possible Sudeep Holla
2019-07-22 21:29 ` Stephen Boyd
2019-07-23 10:59 ` Sudeep Holla
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=20190719102636.GA18022@e107155-lin \
--to=sudeep.holla@arm.com \
--cc=bozhang.zhang@broadcom.com \
--cc=james.quinlan@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=volodymyr_babchuk@epam.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