From: Jassi Brar <jassisinghbrar@gmail.com>
To: Samuel Holland <samuel@sholland.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
Ondrej Jirman <megous@megous.com>,
Devicetree List <devicetree@vger.kernel.org>,
linux-sunxi@googlegroups.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Maxime Ripard <mripard@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
Rob Herring <robh+dt@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v6 2/6] mailbox: sun6i-msgbox: Add a new mailbox driver
Date: Wed, 12 Feb 2020 20:02:26 -0600 [thread overview]
Message-ID: <CABb+yY2MJ-1i0K7XVkPT3+6ac1XR9-3zf-GDNeswOMp6Zn_Ufw@mail.gmail.com> (raw)
In-Reply-To: <20200113051852.15996-3-samuel@sholland.org>
On Sun, Jan 12, 2020 at 11:18 PM Samuel Holland <samuel@sholland.org> wrote:
>
> +static int sun6i_msgbox_send_data(struct mbox_chan *chan, void *data)
> +{
> + struct sun6i_msgbox *mbox = to_sun6i_msgbox(chan);
> + int n = channel_number(chan);
> + uint32_t msg = *(uint32_t *)data;
> +
> + /* Using a channel backwards gets the hardware into a bad state. */
> + if (WARN_ON_ONCE(!(readl(mbox->regs + CTRL_REG(n)) & CTRL_TX(n))))
> + return 0;
> +
> + /* We cannot post a new message if the FIFO is full. */
> + if (readl(mbox->regs + FIFO_STAT_REG(n)) & FIFO_STAT_MASK) {
> + mbox_dbg(mbox, "Channel %d busy sending 0x%08x\n", n, msg);
> + return -EBUSY;
> + }
> +
This check should go into sun6i_msgbox_last_tx_done().
send_data() assumes all is clear to send next packet.
.....
> +
> + mbox->controller.dev = dev;
> + mbox->controller.ops = &sun6i_msgbox_chan_ops;
> + mbox->controller.chans = chans;
> + mbox->controller.num_chans = NUM_CHANS;
> + mbox->controller.txdone_irq = false;
> + mbox->controller.txdone_poll = true;
> + mbox->controller.txpoll_period = 5;
> +
nit: just a single space should do too.
Sorry, for some reason I thought I had replied to this patch, but
apparently not. My mistake. Do you want to revise this submission or
send another patch on top?
thanks
_______________________________________________
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:[~2020-02-13 2:02 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-13 5:18 [PATCH v6 0/6] Allwinner sun6i message box support Samuel Holland
2020-01-13 5:18 ` [PATCH v6 1/6] dt-bindings: mailbox: Add a sun6i message box binding Samuel Holland
2020-01-13 9:30 ` Maxime Ripard
2020-01-13 22:38 ` Rob Herring
2020-01-13 5:18 ` [PATCH v6 2/6] mailbox: sun6i-msgbox: Add a new mailbox driver Samuel Holland
2020-01-13 9:15 ` Philipp Zabel
2020-02-13 2:02 ` Jassi Brar [this message]
2020-02-13 2:18 ` Samuel Holland
2020-02-15 3:48 ` Samuel Holland
2020-02-15 4:47 ` Jassi Brar
2020-02-15 6:19 ` [PATCH] mailbox: sun6i-msgbox: Remove unneeded FIFO status check Samuel Holland
2020-01-13 5:18 ` [PATCH v6 3/6] ARM: dts: sunxi: a83t: Add msgbox node Samuel Holland
2020-01-13 5:18 ` [PATCH v6 4/6] ARM: dts: sunxi: h3/h5: " Samuel Holland
2020-01-13 5:18 ` [PATCH v6 5/6] arm64: dts: allwinner: a64: " Samuel Holland
2020-01-13 5:18 ` [PATCH v6 6/6] arm64: dts: allwinner: h6: " Samuel Holland
2020-02-13 1:43 ` [PATCH v6 0/6] Allwinner sun6i message box support Samuel Holland
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=CABb+yY2MJ-1i0K7XVkPT3+6ac1XR9-3zf-GDNeswOMp6Zn_Ufw@mail.gmail.com \
--to=jassisinghbrar@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=mark.rutland@arm.com \
--cc=megous@megous.com \
--cc=mripard@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=samuel@sholland.org \
--cc=wens@csie.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 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).