[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231006144702.778c165e@kernel.org>
Date: Fri, 6 Oct 2023 14:47:02 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Herve Codina <herve.codina@...tlin.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Andrew Lunn
<andrew@...n.ch>, Rob Herring <robh+dt@...nel.org>, Krzysztof Kozlowski
<krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>, Qiang Zhao <qiang.zhao@....com>,
Li Yang <leoyang.li@....com>, Liam Girdwood <lgirdwood@...il.com>, Mark
Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai
<tiwai@...e.com>, Shengjiu Wang <shengjiu.wang@...il.com>, Xiubo Li
<Xiubo.Lee@...il.com>, Fabio Estevam <festevam@...il.com>, Nicolin Chen
<nicoleotsuka@...il.com>, Christophe Leroy <christophe.leroy@...roup.eu>,
Randy Dunlap <rdunlap@...radead.org>, netdev@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, alsa-devel@...a-project.org, Simon
Horman <horms@...nel.org>, Christophe JAILLET
<christophe.jaillet@...adoo.fr>, Thomas Petazzoni
<thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v7 10/30] net: wan: Add support for QMC HDLC
On Thu, 28 Sep 2023 09:06:28 +0200 Herve Codina wrote:
> +static int qmc_hdlc_close(struct net_device *netdev)
> +{
> + struct qmc_hdlc *qmc_hdlc = netdev_to_qmc_hdlc(netdev);
> + struct qmc_hdlc_desc *desc;
> + int i;
> +
> + netif_stop_queue(netdev);
> +
> + qmc_chan_stop(qmc_hdlc->qmc_chan, QMC_CHAN_ALL);
> + qmc_chan_reset(qmc_hdlc->qmc_chan, QMC_CHAN_ALL);
stopping the queue looks a bit racy, a completion may come in
and restart the queue
> + for (i = 0; i < ARRAY_SIZE(qmc_hdlc->tx_descs); i++) {
> + desc = &qmc_hdlc->tx_descs[i];
> + if (!desc->skb)
> + continue;
> + dma_unmap_single(qmc_hdlc->dev, desc->dma_addr, desc->dma_size,
> + DMA_TO_DEVICE);
> + kfree_skb(desc->skb);
> + desc->skb = NULL;
> + }
> +
> + for (i = 0; i < ARRAY_SIZE(qmc_hdlc->rx_descs); i++) {
> + desc = &qmc_hdlc->rx_descs[i];
> + if (!desc->skb)
> + continue;
> + dma_unmap_single(qmc_hdlc->dev, desc->dma_addr, desc->dma_size,
> + DMA_FROM_DEVICE);
> + kfree_skb(desc->skb);
> + desc->skb = NULL;
> + }
> +
> + hdlc_close(netdev);
Powered by blists - more mailing lists