From: Johan Hovold <johan@kernel.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Johan Hovold <johan+linaro@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Bjorn Andersson <andersson@kernel.org>,
Andy Gross <agross@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Jiri Slaby <jirislaby@kernel.org>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Daniel Thompson <daniel.thompson@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] serial: qcom-geni: fix mapping of empty DMA buffer
Date: Wed, 8 Mar 2023 08:51:57 +0100 [thread overview]
Message-ID: <ZAg+neaKU51D59QJ@hovoldconsulting.com> (raw)
In-Reply-To: <CAD=FV=VR5oCThAuc29Bum-VHQUcH_H+s4nr55YpJk1aYaqZKTQ@mail.gmail.com>
On Tue, Mar 07, 2023 at 10:41:46AM -0800, Doug Anderson wrote:
> Hi,
>
> On Tue, Mar 7, 2023 at 8:43 AM Johan Hovold <johan+linaro@kernel.org> wrote:
> >
> > Make sure that there is data in the ring buffer before trying to set up
> > a zero-length DMA transfer.
> >
> > This specifically fixes the following warning when unmapping the empty
> > buffer on the sc8280xp-crd:
> >
> > WARNING: CPU: 0 PID: 138 at drivers/iommu/dma-iommu.c:1046 iommu_dma_unmap_page+0xbc/0xd8
> > ...
> > Call trace:
> > iommu_dma_unmap_page+0xbc/0xd8
> > dma_unmap_page_attrs+0x30/0x1c8
> > geni_se_tx_dma_unprep+0x28/0x38
> > qcom_geni_serial_isr+0x358/0x75c
> >
> > Fixes: 2aaa43c70778 ("tty: serial: qcom-geni-serial: add support for serial engine DMA")
> > Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> > ---
> > drivers/tty/serial/qcom_geni_serial.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> > index 2aa3872e6283..9871225b2f9b 100644
> > --- a/drivers/tty/serial/qcom_geni_serial.c
> > +++ b/drivers/tty/serial/qcom_geni_serial.c
> > @@ -631,6 +631,9 @@ static void qcom_geni_serial_start_tx_dma(struct uart_port *uport)
> > if (port->tx_dma_addr)
> > return;
> >
> > + if (uart_circ_empty(xmit))
> > + return;
>
> I guess you could remove the uart_circ_empty() test in
> qcom_geni_serial_handle_tx_dma() now?
I considered that, but decided to leave it in as it makes the flow in
qcom_geni_serial_handle_tx_dma() a bit more obvious (and that function
already handles the related uart_write_wakeup() which the check could
potentially be combined with).
> In any case, with or without that:
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
Thanks for reviewing.
Johan
next prev parent reply other threads:[~2023-03-08 7:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 16:44 [PATCH 0/4] serial: qcom-geni: fix console shutdown hang Johan Hovold
2023-03-07 16:44 ` [PATCH 1/4] " Johan Hovold
2023-03-07 18:34 ` Doug Anderson
2023-03-07 16:44 ` [PATCH 2/4] serial: qcom-geni: fix DMA mapping leak on shutdown Johan Hovold
2023-03-07 18:36 ` Doug Anderson
2023-03-07 16:44 ` [PATCH 3/4] serial: qcom-geni: fix mapping of empty DMA buffer Johan Hovold
2023-03-07 18:41 ` Doug Anderson
2023-03-08 7:51 ` Johan Hovold [this message]
2023-03-07 16:44 ` [PATCH 4/4] serial: qcom-geni: drop bogus uart_write_wakeup() Johan Hovold
2023-03-07 18:47 ` Doug Anderson
2023-03-07 16:44 ` [PATCH 0/4] serial: qcom-geni: fix console shutdown hang Bartosz Golaszewski
2023-03-07 16:47 ` Bartosz Golaszewski
2023-03-07 17:03 ` Johan Hovold
2023-03-08 14:27 ` Srinivas Kandagatla
2023-03-08 14:29 ` Srinivas Kandagatla
2023-03-08 17:24 ` Andrew Halaney
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=ZAg+neaKU51D59QJ@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=daniel.thompson@linaro.org \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=johan+linaro@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox