Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp54243ybg; Mon, 8 Jun 2020 16:14:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaaFd2n5z/2bkd1fWBdzEpYtdF7ludKTXCtheXmEcmXCb5VmrGp0Jq5fq34QmrMWXzf6rA X-Received: by 2002:a17:906:71b:: with SMTP id y27mr16147591ejb.537.1591658093778; Mon, 08 Jun 2020 16:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591658093; cv=none; d=google.com; s=arc-20160816; b=b20COg1YquJVQzrTUemeZ7hDR89NvlSbxYPX6vSzst3Glr0ZiZNvrufsnv8K9VNs4V Usq0ArgSKTCv+NfuMQ9sKELcBb2gVG4wS7QiCg05UN/R6/Pf4B/kUKXZ974ptv1JfewG UiJ0G4vSLbMD52iT/IA9ttFz6Ov94ktLLARL0URTG+jz3u6JCNdpa/po8cDQGyOc7kFh 3o/3CdosT4j8PTs/G0vvdmgyn6VoU2MMPnwHCU6C8VctbfjCIQFF1jrfRih1OFtyxnHu HsTSESPOIH+SleRQaEs4vL9SGy0awctG3iyDMprpei6quGVrPDFNZ5v1Tfr8334mqGRq /Ong== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wx09m/aratDpZceoYOyKhwefSgLe8uMtytortaRyskE=; b=r8fNlyVDNcPJTUK8nOKsf4jegnYO2FrF2+ccLVWD9ioI0s/4qvsuxoedgK9DYi7xWe 9pgKbISRogiNUTh3GBVRO0gbmyvpQJQqrY8mfC8M0lrrJevZdkAS/2wEy1hrj42FRl40 YJyiX/Bo7u+t8dS0sLddJ8G+lANsc7v5WS73+WvptTIDbe43ZeX7emWZNViAD4cw1wYP QGAAlcKAiyrkYWqae9i5Xl+6j51eMQdWPDpstcFsPlEnCQ3Hu6GdCDdH3Z7jowmPYXbx sKhiyjmqzF7AlYKJtDSdQTBEs5+HQJle7KLAHAZBpDbELGBZqW8AXTw/kAnBUWm2wxiT oU0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="e/1c1OC0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id by19si9670079ejb.216.2020.06.08.16.14.31; Mon, 08 Jun 2020 16:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="e/1c1OC0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728310AbgFHXMC (ORCPT + 99 others); Mon, 8 Jun 2020 19:12:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:56544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728378AbgFHXKX (ORCPT ); Mon, 8 Jun 2020 19:10:23 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EEEA6208C7; Mon, 8 Jun 2020 23:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657822; bh=mS6E5KdtOU9+7cFz8Yn3gX2S53udT9uaNWpGg0utQBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e/1c1OC0+TIplm/MdXHNey5q9LSCxYDT2AHVXg46J2PdHSe+erEFTdKnP1PEkJNJ4 97jJATeWkq7SJNXqAsNxLKI8s+QQxPc0i5qyFkerhquFNwZC2afm9dEgGuFx33ROi8 +HGV415XMb32+JvpiwCOVAI+2g8sNyBPS38An8vw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lorenzo Bianconi , Felix Fietkau , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 5.7 195/274] mt76: mt7615: fix mt7615_driver_own routine Date: Mon, 8 Jun 2020 19:04:48 -0400 Message-Id: <20200608230607.3361041-195-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lorenzo Bianconi [ Upstream commit 338061619185133f56ac17365deb1e75eaecc604 ] Introduce MT_PCIE_DOORBELL_PUSH register to fix mt7615_driver_own routine for mt7663e Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 6 +++++- drivers/net/wireless/mediatek/mt76/mt7615/regs.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 0d56e0834bde..29a7aaabb6da 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -1526,16 +1526,20 @@ static void mt7622_trigger_hif_int(struct mt7615_dev *dev, bool en) static int mt7615_driver_own(struct mt7615_dev *dev) { + struct mt76_dev *mdev = &dev->mt76; u32 addr; - addr = is_mt7663(&dev->mt76) ? MT_CONN_HIF_ON_LPCTL : MT_CFG_LPCR_HOST; + addr = is_mt7663(mdev) ? MT_PCIE_DOORBELL_PUSH : MT_CFG_LPCR_HOST; mt76_wr(dev, addr, MT_CFG_LPCR_HOST_DRV_OWN); mt7622_trigger_hif_int(dev, true); + + addr = is_mt7663(mdev) ? MT_CONN_HIF_ON_LPCTL : MT_CFG_LPCR_HOST; if (!mt76_poll_msec(dev, addr, MT_CFG_LPCR_HOST_FW_OWN, 0, 3000)) { dev_err(dev->mt76.dev, "Timeout for driver own\n"); return -EIO; } + mt7622_trigger_hif_int(dev, false); return 0; diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/regs.h b/drivers/net/wireless/mediatek/mt76/mt7615/regs.h index f7c2a633841c..de0ef165c0ba 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/regs.h +++ b/drivers/net/wireless/mediatek/mt76/mt7615/regs.h @@ -65,6 +65,7 @@ enum mt7615_reg_base { #define MT_HIF2_BASE 0xf0000 #define MT_HIF2(ofs) (MT_HIF2_BASE + (ofs)) #define MT_PCIE_IRQ_ENABLE MT_HIF2(0x188) +#define MT_PCIE_DOORBELL_PUSH MT_HIF2(0x1484) #define MT_CFG_LPCR_HOST MT_HIF(0x1f0) #define MT_CFG_LPCR_HOST_FW_OWN BIT(0) -- 2.25.1