From: Thierry Reding <thierry.reding@gmail.com>
To: Mikko Perttunen <cyndis@kapsi.fi>
Cc: "David S . Miller" <davem@davemloft.net>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Joao Pinto <Joao.Pinto@synopsys.com>,
Alexandre Courbot <gnurou@gmail.com>,
Jon Hunter <jonathanh@nvidia.com>,
netdev@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7] net: stmmac: Check for DMA mapping errors
Date: Thu, 9 Mar 2017 20:29:09 +0100 [thread overview]
Message-ID: <20170309192909.GA5554@ulmo.ba.sec> (raw)
In-Reply-To: <35dec9cd-65db-c62b-f35f-c90cf35b27f2@kapsi.fi>
[-- Attachment #1: Type: text/plain, Size: 1395 bytes --]
On Mon, Feb 27, 2017 at 11:37:24AM +0200, Mikko Perttunen wrote:
> On 23.02.2017 19:24, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > When DMA mapping an SKB fragment, the mapping must be checked for
> > errors, otherwise the DMA debug code will complain upon unmap.
> >
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > index 6b7a5ce19589..d7387919bdb6 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> > @@ -2072,6 +2072,8 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
> > des = skb_frag_dma_map(priv->device, frag, 0,
> > skb_frag_size(frag),
> > DMA_TO_DEVICE);
> > + if (dma_mapping_error(priv->device, des))
> > + goto dma_map_err;
>
> If this map fails, we should also unmap the previously mapped fragments and
> the separate mapping made using dma_map_single.
That's already taken care of via the dma_map_err label:
dev_kfree_skb()
consume_skb()
__kfree_skb()
skb_release_all()
skb_release_data()
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-03-09 19:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 17:24 [PATCH 0/7] net: stmmac: Fixes and Tegra186 support Thierry Reding
2017-02-23 17:24 ` [PATCH 1/7] net: stmmac: Rename clk_ptp_ref clock to ptp_ref Thierry Reding
2017-02-23 17:24 ` [PATCH 2/7] net: stmmac: Balance PTP reference clock enable/disable Thierry Reding
2017-02-27 9:31 ` Mikko Perttunen
2017-03-09 19:30 ` Thierry Reding
2017-03-02 14:47 ` Joao Pinto
2017-02-23 17:24 ` [PATCH 3/7] net: stmmac: Check for DMA mapping errors Thierry Reding
2017-02-27 9:37 ` Mikko Perttunen
2017-03-09 19:29 ` Thierry Reding [this message]
2017-02-23 17:24 ` [PATCH 4/7] net: stmmac: Parse FIFO sizes from feature registers Thierry Reding
2017-02-27 9:51 ` Mikko Perttunen
2017-03-02 15:09 ` Joao Pinto
2017-03-09 19:41 ` Thierry Reding
2017-03-10 10:32 ` Joao Pinto
2017-02-23 17:24 ` [PATCH 5/7] net: stmmac: Program RX queue size and flow control Thierry Reding
2017-02-27 10:09 ` Mikko Perttunen
2017-03-09 19:42 ` Thierry Reding
2017-03-09 20:18 ` Stephen Warren
2017-03-09 20:44 ` Thierry Reding
2017-03-02 15:15 ` Joao Pinto
2017-03-09 19:44 ` Thierry Reding
2017-02-23 17:24 ` [PATCH 6/7] net: stmmac: dwc-qos: Split out ->probe() and ->remove() Thierry Reding
2017-02-27 11:17 ` Mikko Perttunen
2017-03-02 16:43 ` Joao Pinto
2017-02-23 17:24 ` [PATCH 7/7] net: stmmac: dwc-qos: Add Tegra186 support Thierry Reding
2017-02-27 11:46 ` Mikko Perttunen
2017-03-09 20:00 ` Thierry Reding
2017-03-02 16:44 ` Joao Pinto
2017-02-23 17:57 ` [PATCH 0/7] net: stmmac: Fixes and " David Miller
2017-02-27 7:31 ` Thierry Reding
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=20170309192909.GA5554@ulmo.ba.sec \
--to=thierry.reding@gmail.com \
--cc=Joao.Pinto@synopsys.com \
--cc=alexandre.torgue@st.com \
--cc=cyndis@kapsi.fi \
--cc=davem@davemloft.net \
--cc=gnurou@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox