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 X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B7A7C433DF for ; Mon, 6 Jul 2020 23:18:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07C602073E for ; Mon, 6 Jul 2020 23:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594077532; bh=yaC/st+ngw5Sh4IXqu2ErvTyb0SMPwfqL4dOJPo6D3A=; h=Date:From:To:Cc:Subject:In-Reply-To:List-ID:From; b=m6a9qczvpNzrKL/kzg+lBV3wjmh8LG/0ICRSqEJ2/8qYnWydokCvuRp/VFm5ITPd+ JhUnXcA8H9g0MZvI1Vs5d0qk1FjLSk71Zil2Mr9F5vO4CL3EqCrFNRH9xSPdusFWZC aUXTKdanchys0BbEIULyLwscQwHX/yK4qHdnvwYI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726900AbgGFXSv (ORCPT ); Mon, 6 Jul 2020 19:18:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbgGFXSv (ORCPT ); Mon, 6 Jul 2020 19:18:51 -0400 Received: from localhost (mobile-166-175-191-139.mycingular.net [166.175.191.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EDBE2205CB; Mon, 6 Jul 2020 23:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594077530; bh=yaC/st+ngw5Sh4IXqu2ErvTyb0SMPwfqL4dOJPo6D3A=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=bTaYqMbL88uMK3kvbCJf8qkcSU110j4Hlc2k73yEmfzzHiYvXa2NP6Y8ZNfRQpwnL 6drEEsZORiBloqcgUry8kQyZyf+NHp/oae19Zl6eTDHDBmy9NhZPRPypZBMK6qUGx6 x6sqtPhq85bUfdqMeYAhV6p248TsOWw60IZQN4fo= Date: Mon, 6 Jul 2020 18:18:44 -0500 From: Bjorn Helgaas To: Rajat Jain Cc: David Woodhouse , Lu Baolu , Joerg Roedel , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , "open list:AMD IOMMU (AMD-VI)" , Linux Kernel Mailing List , linux-pci , ACPI Devel Maling List , Raj Ashok , "Krishnakumar, Lalithambika" , Mika Westerberg , Jean-Philippe Brucker , Prashant Malani , Benson Leung , Todd Broch , Alex Levin , Mattias Nissler , Rajat Jain , Bernie Keany , Aaron Durbin , Diego Rivas , Duncan Laurie , Furquan Shaikh , Jesse Barnes , Christian Kellner , Alex Williamson , Greg Kroah-Hartman , Oliver O'Halloran , Saravana Kannan , Suzuki K Poulose , Arnd Bergmann , Heikki Krogerus Subject: Re: [PATCH v2 1/7] PCI: Keep the ACS capability offset in device Message-ID: <20200706231844.GA168946@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Mon, Jul 06, 2020 at 03:16:42PM -0700, Rajat Jain wrote: > On Mon, Jul 6, 2020 at 8:58 AM Bjorn Helgaas wrote: > > On Mon, Jun 29, 2020 at 09:49:37PM -0700, Rajat Jain wrote: > > > +static void pci_enable_acs(struct pci_dev *dev); > > > > I don't think we need this forward declaration, do we? > > We need it unless we move its definition further up in the file: > > drivers/pci/pci.c: In function ‘pci_restore_state’: > drivers/pci/pci.c:1551:2: error: implicit declaration of function > ‘pci_enable_acs’; did you mean ‘pci_enable_ats’? > [-Werror=implicit-function-declaration] > 1551 | pci_enable_acs(dev); > > Do you want me to move it up in the file so that we do not need the > forward declaration? Yes, please move it. Maybe a preliminary patch that moves it but doesn't change anything else. I think I thought you had renamed the function, in which case you could tell from the patch itself. But I was mistaken! > > > @@ -4653,7 +4653,7 @@ static int pci_quirk_intel_spt_pch_acs(struct pci_dev *dev, u16 acs_flags) > > > if (!pci_quirk_intel_spt_pch_acs_match(dev)) > > > return -ENOTTY; > > > > > > - pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS); > > > + pos = dev->acs_cap; > > > > I assume you verified that all these quirks are FINAL quirks, since > > pci_init_capabilities() is called after HEADER quirks. I'll > > double-check before applying this. > > None of these quirks are applied via DECLARE_PCI_FIXUP_*(). All these > quirks are called (directly or indirectly) from either > pci_enable_acs() or pci_acs_enabled(), > > EXCEPT > > pci_idt_bus_quirk(). That one is called from > pci_bus_read_dev_vendor_id() which should be called only after the > parent bridge has been added and setup correctly. > > So it looks all good to me. Great, thanks for checking that.