Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4150529pxa; Mon, 10 Aug 2020 01:59:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoNxSRG5leIXr23BjpL+lD440kzTYhLRRI4DNHZtsC6As2LbPlqokS3n7ijDH7AfcdusDr X-Received: by 2002:a17:906:e0c2:: with SMTP id gl2mr20314304ejb.160.1597049960654; Mon, 10 Aug 2020 01:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597049960; cv=none; d=google.com; s=arc-20160816; b=O5lejtXah4xReOQDnR8pW4Lc1EqOIe0tWuRucKDS6TgCjKAZDywpB4o/KB9vMGOZOX NHdy9EXFj5+6eeCWu+di+cIiz5odNthcJuOnordtOYbg0bXa4IkQIx2jyr8ZSOdRYPTb vBxCvISLMKl/hDfeIp035xaK2zOhvT/RFygAkgr9jtBhubPySsQ+jRCxCwJy7gg5z2pN TrumaUFn6ti0sR6VfXieDtz3Q9M1aqNwjXeTHVOI+nnJzKjtsZG5MsQggtm+jVIXlZt/ qhrNv4Qig5V4tvKqiMiOPu9Z2tk6FOKv349g3xS83tokIEOySa+BMO2mtDJ6m2tluDU4 ZHHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=4pEvYWwLa73W3R5cKkm1KnTTLjtQ4dieDxtz0y8G8oA=; b=Xfsr7ATphy0tip+cdk0CKF7IKA8+kkJQD0NeoMmC6mVIv6FVmsek+Ee8ioPX7LQORt N6Voa+qG+Ct7W4XgF4UGnXmZiH9A0k8khe7/1GexeEU+ZdEJT/eAfd6tpkbL6eFy7Y8g ivbuhQqnlkfaFhrMgKc/Jay/+8nF4x3ktjPUxwWWqMacjj86IdUfbUZ/g7D7MBphFazi i9WZNeIE1yahsUyAmIbQM6BsQar9qF78ng2R8dRmMj6CtORwl+zr8Q3ehmtv6oOyAG/2 SyOn5wwM2W1MH3JAWsDIuTLWN+y8WOTKOHtmQqewrqe1nGQJFG3OXuBWY+laSnZp6fLy ApeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Is7f0DON; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si11723326ejq.427.2020.08.10.01.58.49; Mon, 10 Aug 2020 01:59:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Is7f0DON; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbgHJI6i (ORCPT + 99 others); Mon, 10 Aug 2020 04:58:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbgHJI6h (ORCPT ); Mon, 10 Aug 2020 04:58:37 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27931C061788 for ; Mon, 10 Aug 2020 01:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4pEvYWwLa73W3R5cKkm1KnTTLjtQ4dieDxtz0y8G8oA=; b=Is7f0DONT5by1wJlcnqFtlDzaC iFsARMQBDz+i9YQHROca2vQitiSLM0T1EirwaJRdPXjuTyrlnqGAmbkkVfcm0r3hHwQCfXhBzI/AL hlPeh31HyKfGWE2atpzjGw2ZFP+Pe6R4llisGsjKbIV4fo326jC/9pedBewcg1ETvt2Q=; Received: from p54ae996c.dip0.t-ipconnect.de ([84.174.153.108] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1k53dZ-0003XJ-SM for linux-wireless@vger.kernel.org; Mon, 10 Aug 2020 10:58:33 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 1/6] mt76: set interrupt mask register to 0 before requesting irq Date: Mon, 10 Aug 2020 10:58:27 +0200 Message-Id: <20200810085832.65662-1-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Avoids spurious interrupts in case the hardware was running already Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7603/pci.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7615/mmio.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt76x0/pci.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt76x2/pci.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7915/pci.c | 2 ++ 6 files changed, 12 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/pci.c b/drivers/net/wireless/mediatek/mt76/mt7603/pci.c index 2f2f337e2201..a5845da3547a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/pci.c @@ -44,6 +44,8 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) (mt76_rr(dev, MT_HW_REV) & 0xff); dev_info(mdev->dev, "ASIC revision: %04x\n", mdev->rev); + mt76_wr(dev, MT_INT_MASK_CSR, 0); + ret = devm_request_irq(mdev->dev, pdev->irq, mt7603_irq_handler, IRQF_SHARED, KBUILD_MODNAME, dev); if (ret) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c index de170765e938..ba927033bbe8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c @@ -35,6 +35,8 @@ mt76_wmac_probe(struct platform_device *pdev) (mt76_rr(dev, MT_HW_REV) & 0xff); dev_info(mdev->dev, "ASIC revision: %04x\n", mdev->rev); + mt76_wr(dev, MT_INT_MASK_CSR, 0); + ret = devm_request_irq(mdev->dev, irq, mt7603_irq_handler, IRQF_SHARED, KBUILD_MODNAME, dev); if (ret) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c index 133f93a6ed1b..a0526f06262b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c @@ -227,6 +227,8 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base, bus_ops->rmw = mt7615_rmw; dev->mt76.bus = bus_ops; + mt76_wr(dev, MT_INT_MASK_CSR, 0); + ret = devm_request_irq(mdev->dev, irq, mt7615_irq_handler, IRQF_SHARED, KBUILD_MODNAME, dev); if (ret) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c index f7ec3400e368..5e567483b372 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c @@ -180,6 +180,8 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id) mdev->rev = mt76_rr(dev, MT_ASIC_VERSION); dev_info(mdev->dev, "ASIC revision: %08x\n", mdev->rev); + mt76_wr(dev, MT_INT_MASK_CSR, 0); + ret = devm_request_irq(mdev->dev, pdev->irq, mt76x02_irq_handler, IRQF_SHARED, KBUILD_MODNAME, dev); if (ret) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c index 6dfb0df8ec8a..377cf9c02a6f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c @@ -63,6 +63,8 @@ mt76x2e_probe(struct pci_dev *pdev, const struct pci_device_id *id) mdev->rev = mt76_rr(dev, MT_ASIC_VERSION); dev_info(mdev->dev, "ASIC revision: %08x\n", mdev->rev); + mt76_wr(dev, MT_INT_MASK_CSR, 0); + ret = devm_request_irq(mdev->dev, pdev->irq, mt76x02_irq_handler, IRQF_SHARED, KBUILD_MODNAME, dev); if (ret) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c index 05dd19258f54..59034d480543 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/pci.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/pci.c @@ -124,6 +124,8 @@ static int mt7915_pci_probe(struct pci_dev *pdev, (mt7915_l1_rr(dev, MT_HW_REV) & 0xff); dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev); + mt76_wr(dev, MT_INT_MASK_CSR, 0); + /* master switch of PCIe tnterrupt enable */ mt7915_l1_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff); -- 2.28.0