Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3245595pxk; Tue, 15 Sep 2020 14:05:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwGVqoeByEgakz30LWlU/kAmG0IieuWjs220xozjCk0aMKKrw3goDBrZh7nGdu3+KesZBa X-Received: by 2002:a50:fa81:: with SMTP id w1mr23878898edr.122.1600203905557; Tue, 15 Sep 2020 14:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600203905; cv=none; d=google.com; s=arc-20160816; b=IVbugOiWbV3CON3o9h/gjfmGXYRYT90LLfOiE4gA2pVwrRLH4nVvmXZhYrmfcx/SuF xARYFFtAsS5yBYVAu7gZwplSJZ/XPqdhGFwYsFnpsSkRxD5Ix0ZDW9n41ShzckCWe9wX Ulws8STigyaB9RghvVED821ehDO1ZR1GB6XIznfCR4XRzy0Huv7Ju4cFBF5SqqgZzQmZ uYW4TvyFXIS5O3nXKwm6T8BXGp5S6n252xUBmtz7AL5oxZPGijtCCwdDdWQi54fZdEf4 ep/U2jyXf7l2thwMYK1O+dT8uwgWQCDyLzCRR+afmPoQNCAAME7Nbrs0xUw/oLKaZa/S rnsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=gr6dX1g4rngaHHhNMjZ03APOl4TZfGQxDXkzPcizr80=; b=e85oV8b2ZtQY6wRJyOEONkmn9palDDHblPVmOJX4nLvuv1L8nRtFf2+EsXdR1yQ5Kb z4Gb6U9CBTB4w4ZBqeZnLALolCfmRJJvqc6QeD157HHr6VV4wluj/1upyEOAcy98EXCS MuKzyNIhnQTYW6H5ir7gpGj7sYEBJD6fy4Vqj+T9hl1qaaDiykHcI6y/DNBb/rFNCFSU 2NynhAe6uqdHCj6CkhjoGY21GWe0Ocelh7h7wdSIt451f/rK7qZbIeJdoJZSX/tBzo/G l4c1F4J5ww4IvdMB7mW5kfEqJ2Zy+fODiW6X6QOzthqXxteUc5/U2YncXy173YfGM6Lz 2yTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="JE3/C4Ch"; 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 oz18si10260857ejb.598.2020.09.15.14.04.43; Tue, 15 Sep 2020 14:05:05 -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="JE3/C4Ch"; 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 S1728050AbgIOUic (ORCPT + 99 others); Tue, 15 Sep 2020 16:38:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:37118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727873AbgIOUgq (ORCPT ); Tue, 15 Sep 2020 16:36:46 -0400 Received: from localhost (52.sub-72-107-123.myvzw.com [72.107.123.52]) (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 DBDFA20809; Tue, 15 Sep 2020 20:36:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600202205; bh=hR+9QjiQFWyN2W2Y/im5/MlPYRdRGdyGzHGLrBYVxBg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=JE3/C4Chwu15czXYlspesWnGolV8kaWR0831erUbBU6KMwFGI9HEcSxwrT2fEchX/ aH7DsB03ZoxxNTB6AFhAicVG8k2Qq+3lSHOjCNiowrOwZSFwpCSePmmJqh7CqYm/GG QNRk344P7vVfAx95w7iafmfFd66O5gfB5yqe2rV0= Date: Tue, 15 Sep 2020 15:36:43 -0500 From: Bjorn Helgaas To: Ming Qiao Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Debjit Ghosh , Santhanakrishnan Balraj , Rajat Jain Subject: Re: [PATCH 1/3] PCI: Add quirks for Juniper FPGAs to set class code Message-ID: <20200915203643.GA1426328@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200915151103.7086-1-mqiao@juniper.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 15, 2020 at 08:11:01AM -0700, Ming Qiao wrote: > Some of the Juniper FPGAs do not report correct PCI class ID, which > would confuse kernel APIs accessing the specific class of devices. > Change them to PCI_CLASS_SYSTEM_OTHER << 8. Please include a note about the consequence of the incorrect class ID, i.e., what happens without this quirk? Does the system panic? Does some device not work correctly? If so, which, and what does the problem look like to a user? "Confusing kernel APIs" is pretty general and won't help a user who is seeing a problem to find this patch. > Also introduce Juniper vendor ID to be used in the quirks. > ?? ? > Signed-off-by: Debjit Ghosh > Signed-off-by: Santhanakrishnan Balraj > Signed-off-by: Rajat Jain > Signed-off-by: Ming Qiao > --- > drivers/pci/quirks.c | 25 +++++++++++++++++++++++++ > include/linux/pci_ids.h | 2 ++ > 2 files changed, 27 insertions(+) > > diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c > index 2a589b6..61344d2 100644 > --- a/drivers/pci/quirks.c > +++ b/drivers/pci/quirks.c > @@ -5632,3 +5632,28 @@ static void apex_pci_fixup_class(struct pci_dev *pdev) > } > DECLARE_PCI_FIXUP_CLASS_HEADER(0x1ac1, 0x089a, > PCI_CLASS_NOT_DEFINED, 8, apex_pci_fixup_class); > + > +/* > + * PCI class reported by some Juniper FPGAs is not correct. > + * Change it to SYSTEM. > + */ > +static void quirk_jnx_fpga(struct pci_dev *dev) > +{ > + if (!dmi_match(DMI_BOARD_VENDOR, "Juniper Networks Inc.")) > + return; Why is the DMI_BOARD_VENDOR relevant to this quirk? This check seems to mean that the class code is programmable by the BIOS, and all BIOSes program it correctly *except* the Juniper BIOS. If this is just a silicon defect in the chips, you shouldn't need to check the DMI_BOARD_VENDOR. > + dev->class = PCI_CLASS_SYSTEM_OTHER << 8; > +} > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x0004, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x006A, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x006B, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x006C, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x006E, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x0079, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x0083, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x0071, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x00A7, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x00A8, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x00A9, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JUNIPER, 0x00AA, quirk_jnx_fpga); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_XILINX, 0x0505, quirk_jnx_fpga); > diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h > index 1ab1e24..bfbf8f1 100644 > --- a/include/linux/pci_ids.h > +++ b/include/linux/pci_ids.h > @@ -1859,6 +1859,8 @@ > #define PCI_VENDOR_ID_ESDGMBH 0x12fe > #define PCI_DEVICE_ID_ESDGMBH_CPCIASIO4 0x0111 > > +#define PCI_VENDOR_ID_JUNIPER 0X1304 Please use "0x1304" (lower-case 'x') like the rest of the file. > #define PCI_VENDOR_ID_CB 0x1307 /* Measurement Computing */ > > #define PCI_VENDOR_ID_SIIG 0x131f > -- > 2.10.0 >