From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E37BCE94125 for ; Fri, 6 Oct 2023 21:48:15 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 875DA1E3; Fri, 6 Oct 2023 23:47:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 875DA1E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1696628893; bh=7ShH9lM/jTtdIpDBd5tkXIdLZJ6EOzXUhDKKnj55xPo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=grts/xAtBP140DQok3dXBdTD3V//ZuTmTsAPgobVyZggPFdhXlWc+VDzMs+YRNIlc +oYehaBNg7qxu6kWPz3qzveq8tbVQMdrlfHuOBTmCsfsFqJUxq4olFqByGOjTbtDTI 7BdyQCJq3fCWogpGN5E6hcpcmD1SGe62jOiFOLLg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 15F5CF80310; Fri, 6 Oct 2023 23:47:23 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9022AF8047D; Fri, 6 Oct 2023 23:47:22 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 493C8F8047D; Fri, 6 Oct 2023 23:47:18 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 43352F80166 for ; Fri, 6 Oct 2023 23:47:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 43352F80166 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=UIB5D7QU Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id CD072B82A90; Fri, 6 Oct 2023 21:47:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B17AC433C7; Fri, 6 Oct 2023 21:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696628829; bh=7ShH9lM/jTtdIpDBd5tkXIdLZJ6EOzXUhDKKnj55xPo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UIB5D7QUgappiPLI6dOoUHSxvt5YAjXDxSa8MYt3/cAFv/c5IHJYHnYTPpU858ZTu ClL/Cf8dYmT/K2AsekQJqM/9c+T/Lu+ejjHS7ojVK3HC8q8o9i3501u//0M0XEEIUA kQhpB665WwNyXG+96GLLJwQmYMwetRfLQ0qkrS4cswc44g/UYawosmoi4NMFiFOe4q duYX45Tg97UhJ6fdrukD6yY2MmoCfaH9XlYzON02quQybVLTyXOqpCIZOPLdLN7pvz WNUh6/12mNBI+Q820T8snzNGUsqfrHG91QPyG1E9MvoRh77CxpA+aVQH87ZXbvLdOH hY2YnF6sVQk4Q== Date: Fri, 6 Oct 2023 14:47:02 -0700 From: Jakub Kicinski To: Herve Codina Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Qiang Zhao , Li Yang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Christophe Leroy , Randy Dunlap , netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Simon Horman , Christophe JAILLET , Thomas Petazzoni Subject: Re: [PATCH v7 10/30] net: wan: Add support for QMC HDLC Message-ID: <20231006144702.778c165e@kernel.org> In-Reply-To: <20230928070652.330429-11-herve.codina@bootlin.com> References: <20230928070652.330429-1-herve.codina@bootlin.com> <20230928070652.330429-11-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: VIJL7GT2B5XJFAGO7ETCW5VLV5CVCBKB X-Message-ID-Hash: VIJL7GT2B5XJFAGO7ETCW5VLV5CVCBKB X-MailFrom: kuba@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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);