Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp921184rdb; Fri, 20 Oct 2023 03:32:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgOElaP72NNGY5+2/ZXwrl1xAINNkBS9Ewf8BQfsczE5teLhUC/mlvVTaYlYyDWCyDejnk X-Received: by 2002:a17:902:d4cf:b0:1c3:92de:1b23 with SMTP id o15-20020a170902d4cf00b001c392de1b23mr1379088plg.59.1697797936016; Fri, 20 Oct 2023 03:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697797936; cv=none; d=google.com; s=arc-20160816; b=mL/Pn+80YFbUS6bMVyH/XNPhRqYKUtfkL2UGz5aakm3LtBu6sRUnBV/ZeakEl0lnEp KBKaBCPLSABd5Caq9NaeNDog6GBTc9fdsr4alWJaldGABQr9dK0CpXzCRKmem4rjVM18 z+lhZZMw7MYl1ZBZ31i4FWdO2hmPe7ZfNRxy0P3037O/EAqBL7t+tFdtfudu1IB2oF+0 39wG0XFeWHKynX6wttRTt0U1RrV9hglK5Jt8OUlG8v4zjNyKmAuqIefE82bjht47xv8t H+zYAY5EJrug+32L6HoTdBT5bp02sjOsC5SWF4NzLFyXMx57gV+ATGpTDLrMoOkJbYp9 Xdcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Yojani6yn2+kJJ61hD9zQcUn8nFUjZtEJH18DxEg50k=; fh=Ku4rpZluzJB+G9vQVPu7qAagHLleNx84zz+BPW6AE7g=; b=Alql3D9/C2z/RUSWb09FmDq+7TgmKv76Ot2uhbkuPvFCkJJJPiRnJksoprcyOxOZE2 ojAeb8VszxS/i+hSpWCuiwr9xONPBNVexrlbTajGLqH20WHhdTcn5WmQspSVFqFDKQ0U QY//eSkIniDq/5oltF+/8VqN322n2yUbQo7Lhn4N7hs8w8B6HLsA/Fdaa4vjoxoVWyNO PP8xH1V5+XchCUsEPp1zXuFljUxXKyfhY+n4DzNAcM/TGd2nyEs5Fm7IV28ibSXP+Ja7 eq4MViGz6PMOQv0grxYXdgCSDw1B4b1OnnwGF0CRPqfaTkFIlmcsdGT+oR6lb8idrtPa B9IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PeQkqlkr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id d1-20020a170903230100b001c9c496bdebsi1645749plh.337.2023.10.20.03.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:32:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PeQkqlkr; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 1EFA98229D1D; Fri, 20 Oct 2023 03:32:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376855AbjJTKby (ORCPT + 52 others); Fri, 20 Oct 2023 06:31:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376881AbjJTKbx (ORCPT ); Fri, 20 Oct 2023 06:31:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4976BD46 for ; Fri, 20 Oct 2023 03:31:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90FB6C433C9; Fri, 20 Oct 2023 10:31:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697797910; bh=YdZwi7PiVHPeDTOb8qJp4IGfc6Ab3P3P06xqpebgMOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PeQkqlkrKwhwOuMrgCDVdmzEk+/EMUkWdzasJzPNwzOLhONHsD9j0cg8Ok+8aTif8 VwOytIPt52bPYtiif3eSVk2M0ZKEV0C9GFUAx1/SsatBdciHWBkyzdlnyI9W7UYqpX wpkhsl0iz02v7lK48mTGU9hs+gXKgciY4AFpuiLUtLrV/49qzQTYVVBOIsBhQlikJK zR45lGIKYQ3aZfFoCtzG6ZtvQSdZIdYxt7/NJ69bbcFnAXutjkPfUtSMQUdOXBwDbq iewNOmRoD49nxi4BFlKSNpudzUzb0EXTVyEBGUpjz66WL6WEP3k1Hz0xMJaEba9kL/ OpnQSwS9REJig== From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com, evelyn.tsai@mediatek.com, shayne.chen@mediatek.com, Bo.Jiao@mediatek.com, sujuan.chen@mediatek.com, linux-mediatek@lists.infradead.org Subject: [PATCH v3 08/13] wifi: mt76: dma: introduce __mt76_dma_queue_reset utility routine Date: Fri, 20 Oct 2023 12:30:55 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 20 Oct 2023 03:32:01 -0700 (PDT) This is a preliminary patch to introduce WED support for mt7996 Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/dma.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 64027572a5e6..7b622e966f58 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -195,7 +195,8 @@ mt76_dma_sync_idx(struct mt76_dev *dev, struct mt76_queue *q) } static void -mt76_dma_queue_reset(struct mt76_dev *dev, struct mt76_queue *q) +__mt76_dma_queue_reset(struct mt76_dev *dev, struct mt76_queue *q, + bool reset_idx) { int i; @@ -206,11 +207,19 @@ mt76_dma_queue_reset(struct mt76_dev *dev, struct mt76_queue *q) for (i = 0; i < q->ndesc; i++) q->desc[i].ctrl = cpu_to_le32(MT_DMA_CTL_DMA_DONE); - Q_WRITE(q, cpu_idx, 0); - Q_WRITE(q, dma_idx, 0); + if (reset_idx) { + Q_WRITE(q, cpu_idx, 0); + Q_WRITE(q, dma_idx, 0); + } mt76_dma_sync_idx(dev, q); } +static void +mt76_dma_queue_reset(struct mt76_dev *dev, struct mt76_queue *q) +{ + __mt76_dma_queue_reset(dev, q, true); +} + static int mt76_dma_add_rx_buf(struct mt76_dev *dev, struct mt76_queue *q, struct mt76_queue_buf *buf, void *data) -- 2.41.0