From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3235C072A2 for ; Fri, 17 Nov 2023 22:37:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234509AbjKQWho (ORCPT ); Fri, 17 Nov 2023 17:37:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230379AbjKQWhn (ORCPT ); Fri, 17 Nov 2023 17:37:43 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51323D4D; Fri, 17 Nov 2023 14:37:40 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A999CC433C8; Fri, 17 Nov 2023 22:37:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700260660; bh=Ndj0p7n2VYiLvuAu7Gg193qmpVDyBOQt2CzlcP0rtVA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=NrTIERkPhX0tiu56TFlHegIui6QO8D4nVLD8eVCTzR0MVDYhzzrDODdpJ3eJICSmb PplbPAVjNXocnpXVA/na2nQNXeY9IM/K6+TUZfAYbxZChvPUoknh/aHzLSt60jbete vdt21tLwVbW/Vsyogn5BL9ULyKr2EtcTWCwGHkWD4UsKeDg+lG3W4ZZ8uRO1YImweY JGFgFpu7LCZh2R9ptlulR+D4Ya1gGWdt0Kulk4ldSUHLBfGQzGo9kcOuN4S0M1UIjw 7MK/eOEZeyh0FmbkN7Gu6OUPNtEMIuzMzK9MB4tz6/+Ux6ODW8Ne7f4ovR9TfX1Ve6 VAOozy3B2mpHg== Date: Fri, 17 Nov 2023 16:37:38 -0600 From: Bjorn Helgaas To: Ilpo =?utf-8?B?SsOkcnZpbmVu?= Cc: "John W. Linville" , Kalle Valo , Larry Finger , linux-wireless@vger.kernel.org, Ping-Ke Shih , Bjorn Helgaas , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/7] wifi: rtlwifi: Convert to use PCIe capability accessors Message-ID: <20231117223738.GA95634@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231117094425.80477-3-ilpo.jarvinen@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, Nov 17, 2023 at 11:44:20AM +0200, Ilpo Järvinen wrote: > The rtlwifi driver accesses PCIe capabilities through custom config > offsets. > > Convert the accesses to use the normal PCIe capability accessors. > pcibridge_pciehdr_offset in the struct mp_adapter becomes unused after > the conversion and can be removed. More good stuff. I guess patch [1/7] was specifically for the RMW things, and this one is for the rest? > @@ -219,7 +220,7 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) > } > > /*for promising device will in L0 state after an I/O. */ > - pci_read_config_byte(rtlpci->pdev, 0x80, &tmp_u1b); > + pcie_capability_read_word(rtlpci->pdev, PCI_EXP_LNKCTL, &tmp_u1b); > > /*Set corresponding value. */ > aspmlevel |= BIT(0) | BIT(1); I guess this is PCI_EXP_LNKCTL_ASPM_L0S | PCI_EXP_LNKCTL_ASPM_L1? There's also a similar u_pcibridge_aspmsetting mask in rtl_pci_enable_aspm(). And some scary looking stuff in rtl_pci_get_amd_l1_patch(). And platform_enable_dma64(). No clue what either of those does.