From patchwork Tue Jul 30 16:22:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 13747631 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 623B7C3DA49 for ; Tue, 30 Jul 2024 16:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UBU0YUlD83j4/uevah3ue0tx8XO2Q1fxPJyicDiheV4=; b=XUHkJ3XErhsetDYevnYMcRrLEd n2ytn/eKJn7yRufNA8/LFZcDwHC7SP948GFBwtGbXM++scVVg543GIJhMae6RgNIEQLBlfI/CxQul O0q8Tn9qVo0yVGlAE5K6bddpUwZ7hJENpbePspROZi52xJNSHNCCMeM+1/aKbrymR86Po+/8ecUa2 ory2ZwpsPMXfoylEQmk/B+iglY5MP4R2SrzP1Lh36GDCarRqq8Egw2JGlTpe8H9Ia8YjnlXK+Rpuq ugQozbbnWeLholVJ4I0eylfAo25SzGWPqHSnOCnGLITW+jP7XUK2lLZ3iRPk42ma5u+ilSsMhsWRC mUbjUqcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYpft-0000000Fqne-2JhM; Tue, 30 Jul 2024 16:26:09 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sYpdH-0000000FptZ-0g4t for linux-arm-kernel@lists.infradead.org; Tue, 30 Jul 2024 16:23:28 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7AC7C61C12; Tue, 30 Jul 2024 16:23:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D144CC4AF0C; Tue, 30 Jul 2024 16:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722356606; bh=goFYc4tszjB+5vMtiKcyp7Goi8HpUFHwYeiuijvPdNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ElRH25wasGrkx9O/t6c6dZbQZNOhgZw+KQRz4BrhyUiKKA7Ev3MK1lRdz5TqUFYqh mZHNChLUSY7K8zZ7V3CAHwhpqDznzBgimy17V75S8uMPQL6YAuCUzLl8mxi0VyWVqg pZMSCn1E2wYmXn4qi+K1iZUaVHRxqb7XV8LzMWcVowBWwxfJa2YlmzLVh236az6eVc WjPdDnjmFexpw6XQ8p3KQaVBXG6EcCimRefjPDItRAYiOV77pEd3nbhelzeMeSsIco V4r1o+rlAsdNRar4yJ7LhsEMFr1tCv/1A89eu2TEXr8m72OBnrXNeE8jxEeMsHCYQG lFyzVtnNZBH6A== From: Lorenzo Bianconi To: netdev@vger.kernel.org Cc: nbd@nbd.name, lorenzo.bianconi83@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-arm-kernel@lists.infradead.org, upstream@airoha.com, angelogioacchino.delregno@collabora.com, benjamin.larsson@genexis.eu, rkannoth@marvell.com, sgoutham@marvell.com, andrew@lunn.ch, arnd@arndb.de, horms@kernel.org Subject: [PATCH net-next 5/9] net: airoha: Use qdma pointer as private structure in airoha_irq_handler routine Date: Tue, 30 Jul 2024 18:22:44 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240730_092327_287703_CECBD4F8 X-CRM114-Status: GOOD ( 11.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a preliminary patch to support multi-QDMA controllers. Signed-off-by: Lorenzo Bianconi --- drivers/net/ethernet/mediatek/airoha_eth.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mediatek/airoha_eth.c b/drivers/net/ethernet/mediatek/airoha_eth.c index 763b8df73552..18a0c8889073 100644 --- a/drivers/net/ethernet/mediatek/airoha_eth.c +++ b/drivers/net/ethernet/mediatek/airoha_eth.c @@ -1975,8 +1975,7 @@ static int airoha_qdma_hw_init(struct airoha_qdma *qdma) static irqreturn_t airoha_irq_handler(int irq, void *dev_instance) { - struct airoha_eth *eth = dev_instance; - struct airoha_qdma *qdma = ð->qdma[0]; + struct airoha_qdma *qdma = dev_instance; u32 intr[ARRAY_SIZE(qdma->irqmask)]; int i; @@ -1986,7 +1985,7 @@ static irqreturn_t airoha_irq_handler(int irq, void *dev_instance) airoha_qdma_wr(qdma, REG_INT_STATUS(i), intr[i]); } - if (!test_bit(DEV_STATE_INITIALIZED, ð->state)) + if (!test_bit(DEV_STATE_INITIALIZED, &qdma->eth->state)) return IRQ_NONE; if (intr[1] & RX_DONE_INT_MASK) { @@ -2039,7 +2038,7 @@ static int airoha_qdma_init(struct platform_device *pdev, return qdma->irq; err = devm_request_irq(eth->dev, qdma->irq, airoha_irq_handler, - IRQF_SHARED, KBUILD_MODNAME, eth); + IRQF_SHARED, KBUILD_MODNAME, qdma); if (err) return err;