Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp709483pxv; Thu, 15 Jul 2021 14:06:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5lxCaFnMGlqgtwnoDMpQkfYMJ6sHrlv+CwGMalkWKGf0kO4athXMUPXpkbYYhLB/4Flti X-Received: by 2002:a05:6402:498:: with SMTP id k24mr9903716edv.25.1626383185817; Thu, 15 Jul 2021 14:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383185; cv=none; d=google.com; s=arc-20160816; b=jr+em1oqPpy+uPDj+ciTQ4I5wiqbStrDkVst+3eGHzVqP1LVuG2TBvNnsFMaUyPdz9 QofTswsLyoVf3fe5jYFBFVBlBgMk712XA7iST+OxI5zSAWVZxvxrkfDTiY2bmPcndHpL aYz1jxVqRxxuSBphZtDT0otR1rulfW31hR4UvBrdyKEES2++MDsIwzu4KmByrDdmVNuc nDIC3tpRaUnbAUPoUu9Yd6EqaH6MhI/0HJHPS0MA0YuehQqKpK+bUHsHj7M+nYAzlagG YIIffh5JjMK7g3S3IRhtrXyD/CjKO8mj/y/Ezx5MYP5/cmf1pVGuzUfxAvNEzdYZrHjR yZQw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=On2F0wR0iZosDn8Aa9bDlCk7qUWW7Dle8UfGCggduDE=; b=Fk2uMnMfbrbkjRvpmO9b7Fhf1SsI1Jt4Pb3/Vv4AG/quYE+XT+fAdFxifbPITaQ4po 9seC12rWTuDnetXLIZPtNsE2nqir9vUoAWrJN0pHaHB8cWfETdImcOAQLaaS9FZGFAlx K8xDz6IvHojeCSsGjJO+MiC12GieZsWxFGcX717BgHqFNETkYMR4H2Je5csPuVUGMc2N 7bx2X+UGB5Y/77yV4kkEz+i0H8Pd9lkMKp4PaBYuyoQ0MJhDaWOGUsJHlZdNkB2VC3QI pVSUlvF0/Oe6ZopMyIstos/2KNZNjoYE58oFKJkczN0N6aOqr31wLz38/a9noCy7eY6C 2kKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pO5cRRVR; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si4123975ejj.397.2021.07.15.14.05.59; Thu, 15 Jul 2021 14:06:25 -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=@linuxfoundation.org header.s=korg header.b=pO5cRRVR; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242072AbhGOTP2 (ORCPT + 99 others); Thu, 15 Jul 2021 15:15:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:38864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243238AbhGOTBq (ORCPT ); Thu, 15 Jul 2021 15:01:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7714561404; Thu, 15 Jul 2021 18:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375517; bh=u8Ivap6Yz4KRmQsyQWImKIcEhtJI8QScwssbNbl8UkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pO5cRRVRSaYvivihq89xeN53KI55uSJra8GK1v3AogrequZwT6wjoN+8qL1iy9lcU jfss9gmdgFBRTe/sa8IrUEPnCl0Eo+OT+z+wCaxK/kQi42peAp2rMy7j180aJQstWH kTll0dL9SbKZ7W7r9AQyLaOOJI9p6L05uZSsIIgE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Szabo , Ping-Ke Shih , Kalle Valo , Sasha Levin Subject: [PATCH 5.12 122/242] rtw88: add quirks to disable pci capabilities Date: Thu, 15 Jul 2021 20:38:04 +0200 Message-Id: <20210715182614.539447350@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ping-Ke Shih [ Upstream commit 956c6d4f20c5446727e0c912dd8f527f2dc7b779 ] 8821CE with ASPM cannot work properly on Protempo Ltd L116HTN6SPW. Add a quirk to disable the cap. The reporter describes the symptom is that this module (driver) causes frequent freezes, randomly but usually within a few minutes of running (thus very soon after boot): screen display remains frozen, no response to either keyboard or mouse input. All I can do is to hold the power button to power off, then reboot. Reported-by: Paul Szabo Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210607012254.6306-1-pkshih@realtek.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw88/pci.c | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index 6b5c885798a4..e5110d2cbc1d 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -2,6 +2,7 @@ /* Copyright(c) 2018-2019 Realtek Corporation */ +#include #include #include #include "main.h" @@ -1598,6 +1599,36 @@ static void rtw_pci_napi_deinit(struct rtw_dev *rtwdev) netif_napi_del(&rtwpci->napi); } +enum rtw88_quirk_dis_pci_caps { + QUIRK_DIS_PCI_CAP_MSI, + QUIRK_DIS_PCI_CAP_ASPM, +}; + +static int disable_pci_caps(const struct dmi_system_id *dmi) +{ + uintptr_t dis_caps = (uintptr_t)dmi->driver_data; + + if (dis_caps & BIT(QUIRK_DIS_PCI_CAP_MSI)) + rtw_disable_msi = true; + if (dis_caps & BIT(QUIRK_DIS_PCI_CAP_ASPM)) + rtw_pci_disable_aspm = true; + + return 1; +} + +static const struct dmi_system_id rtw88_pci_quirks[] = { + { + .callback = disable_pci_caps, + .ident = "Protempo Ltd L116HTN6SPW", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Protempo Ltd"), + DMI_MATCH(DMI_PRODUCT_NAME, "L116HTN6SPW"), + }, + .driver_data = (void *)BIT(QUIRK_DIS_PCI_CAP_ASPM), + }, + {} +}; + int rtw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { @@ -1648,6 +1679,7 @@ int rtw_pci_probe(struct pci_dev *pdev, goto err_destroy_pci; } + dmi_check_system(rtw88_pci_quirks); rtw_pci_phy_cfg(rtwdev); ret = rtw_register_hw(rtwdev, hw); -- 2.30.2