All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fugang Duan <fugang.duan@nxp.com>
To: Troy Kisky <troy.kisky@boundarydevices.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"lznuaa@gmail.com" <lznuaa@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>,
	"l.stach@pengutronix.de" <l.stach@pengutronix.de>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"tremyfr@gmail.com" <tremyfr@gmail.com>,
	"gerg@uclinux.org" <gerg@uclinux.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
	"stillcompiling@gmail.com" <stillcompiling@gmail.com>,
	"sergei.shtylyov@cogentembedded.com"
	<sergei.shtylyov@cogentembedded.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"holgerschurig@gmail.com" <holgerschurig@gmail.com>
Subject: RE: [PATCH net 1/1] net: fec: update dirty_tx even if no skb
Date: Mon, 9 May 2016 02:02:46 +0000	[thread overview]
Message-ID: <VI1PR0401MB1855159EE178BE4806E3E3B3FF700@VI1PR0401MB1855.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <1461290434-18462-1-git-send-email-troy.kisky@boundarydevices.com>

From: Troy Kisky <troy.kisky@boundarydevices.com> Sent: Friday, April 22, 2016 10:01 AM
> To: netdev@vger.kernel.org; davem@davemloft.net; Fugang Duan
> <fugang.duan@nxp.com>; lznuaa@gmail.com
> Cc: Fabio Estevam <fabio.estevam@nxp.com>; l.stach@pengutronix.de;
> andrew@lunn.ch; tremyfr@gmail.com; gerg@uclinux.org; linux-arm-
> kernel@lists.infradead.org; johannes@sipsolutions.net;
> stillcompiling@gmail.com; sergei.shtylyov@cogentembedded.com;
> arnd@arndb.de; holgerschurig@gmail.com; Troy Kisky
> <troy.kisky@boundarydevices.com>
> Subject: [PATCH net 1/1] net: fec: update dirty_tx even if no skb
> 
> If dirty_tx isn't updated, then dma_unmap_single will be called twice.
> 
> This fixes a
> [   58.420980] ------------[ cut here ]------------
> [   58.425667] WARNING: CPU: 0 PID: 377 at /home/schurig/d/mkarm/linux-
> 4.5/lib/dma-debug.c:1096 check_unmap+0x9d0/0xab8()
> [   58.436405] fec 2188000.ethernet: DMA-API: device driver tries to free DMA
> memory it has not allocated [device address=0x0000000000000000] [size=66
> bytes]
> 
> encountered by Holger
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> Tested-by: <holgerschurig@gmail.com>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 08243c2..b71654c 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1197,10 +1197,8 @@ fec_enet_tx_queue(struct net_device *ndev, u16
> queue_id)
>  					 fec16_to_cpu(bdp->cbd_datlen),
>  					 DMA_TO_DEVICE);
>  		bdp->cbd_bufaddr = cpu_to_fec32(0);
> -		if (!skb) {
> -			bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
> -			continue;
> -		}
> +		if (!skb)
> +			goto skb_done;
> 
>  		/* Check for errors. */
>  		if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | @@ -1239,7
> +1237,7 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id)
> 
>  		/* Free the sk buffer associated with this last transmit */
>  		dev_kfree_skb_any(skb);
> -
> +skb_done:
>  		/* Make sure the update to bdp and tx_skbuff are performed
>  		 * before dirty_tx
>  		 */
> --
> 2.5.0

Thanks. 
Acked-by: Fugang Duan <fugang.duan@nxp.com>

WARNING: multiple messages have this Message-ID (diff)
From: fugang.duan@nxp.com (Fugang Duan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net 1/1] net: fec: update dirty_tx even if no skb
Date: Mon, 9 May 2016 02:02:46 +0000	[thread overview]
Message-ID: <VI1PR0401MB1855159EE178BE4806E3E3B3FF700@VI1PR0401MB1855.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <1461290434-18462-1-git-send-email-troy.kisky@boundarydevices.com>

From: Troy Kisky <troy.kisky@boundarydevices.com> Sent: Friday, April 22, 2016 10:01 AM
> To: netdev at vger.kernel.org; davem at davemloft.net; Fugang Duan
> <fugang.duan@nxp.com>; lznuaa at gmail.com
> Cc: Fabio Estevam <fabio.estevam@nxp.com>; l.stach at pengutronix.de;
> andrew at lunn.ch; tremyfr at gmail.com; gerg at uclinux.org; linux-arm-
> kernel at lists.infradead.org; johannes at sipsolutions.net;
> stillcompiling at gmail.com; sergei.shtylyov at cogentembedded.com;
> arnd at arndb.de; holgerschurig at gmail.com; Troy Kisky
> <troy.kisky@boundarydevices.com>
> Subject: [PATCH net 1/1] net: fec: update dirty_tx even if no skb
> 
> If dirty_tx isn't updated, then dma_unmap_single will be called twice.
> 
> This fixes a
> [   58.420980] ------------[ cut here ]------------
> [   58.425667] WARNING: CPU: 0 PID: 377 at /home/schurig/d/mkarm/linux-
> 4.5/lib/dma-debug.c:1096 check_unmap+0x9d0/0xab8()
> [   58.436405] fec 2188000.ethernet: DMA-API: device driver tries to free DMA
> memory it has not allocated [device address=0x0000000000000000] [size=66
> bytes]
> 
> encountered by Holger
> 
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> Tested-by: <holgerschurig@gmail.com>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 08243c2..b71654c 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1197,10 +1197,8 @@ fec_enet_tx_queue(struct net_device *ndev, u16
> queue_id)
>  					 fec16_to_cpu(bdp->cbd_datlen),
>  					 DMA_TO_DEVICE);
>  		bdp->cbd_bufaddr = cpu_to_fec32(0);
> -		if (!skb) {
> -			bdp = fec_enet_get_nextdesc(bdp, &txq->bd);
> -			continue;
> -		}
> +		if (!skb)
> +			goto skb_done;
> 
>  		/* Check for errors. */
>  		if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | @@ -1239,7
> +1237,7 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id)
> 
>  		/* Free the sk buffer associated with this last transmit */
>  		dev_kfree_skb_any(skb);
> -
> +skb_done:
>  		/* Make sure the update to bdp and tx_skbuff are performed
>  		 * before dirty_tx
>  		 */
> --
> 2.5.0

Thanks. 
Acked-by: Fugang Duan <fugang.duan@nxp.com>

  parent reply	other threads:[~2016-05-09  2:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22  2:00 [PATCH net 1/1] net: fec: update dirty_tx even if no skb Troy Kisky
2016-04-22  2:00 ` Troy Kisky
2016-04-22  5:59 ` Fugang Duan
2016-04-22  5:59   ` Fugang Duan
2016-04-22 16:11   ` Troy Kisky
2016-04-22 16:11     ` Troy Kisky
2016-04-25  1:57     ` Fugang Duan
2016-04-25  1:57       ` Fugang Duan
2016-04-25  6:28       ` Fugang Duan
2016-04-25  6:28         ` Fugang Duan
2016-05-07 18:56   ` Troy Kisky
2016-05-07 18:56     ` Troy Kisky
2016-05-09  2:00     ` Fugang Duan
2016-05-09  2:00       ` Fugang Duan
2016-05-09  2:02 ` Fugang Duan [this message]
2016-05-09  2:02   ` Fugang Duan

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=VI1PR0401MB1855159EE178BE4806E3E3B3FF700@VI1PR0401MB1855.eurprd04.prod.outlook.com \
    --to=fugang.duan@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=fabio.estevam@nxp.com \
    --cc=gerg@uclinux.org \
    --cc=holgerschurig@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lznuaa@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=stillcompiling@gmail.com \
    --cc=tremyfr@gmail.com \
    --cc=troy.kisky@boundarydevices.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.