From patchwork Tue Jul 14 19:35:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 6788671 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BB7CB9F2F0 for ; Tue, 14 Jul 2015 19:35:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6D3E2071E for ; Tue, 14 Jul 2015 19:35:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFD50206BD for ; Tue, 14 Jul 2015 19:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752427AbbGNTfN (ORCPT ); Tue, 14 Jul 2015 15:35:13 -0400 Received: from mail-ob0-f179.google.com ([209.85.214.179]:34182 "EHLO mail-ob0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752301AbbGNTfM (ORCPT ); Tue, 14 Jul 2015 15:35:12 -0400 Received: by obre1 with SMTP id e1so12683079obr.1 for ; Tue, 14 Jul 2015 12:35:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=nZuFLDFUjwLvwcPfN0zeICFcaF6lAbUfMlN1Sdk/tlY=; b=DUuALJNhxbrsp2zpzvd0W3JBU+jmwQefeRCBcIRh1OWEuxIVtcXqqAsYCDRalNtbAB BPz1CflKghMJGhIz1PB4feeE5p8NWJUMVy5Wf5aWFb6m4Qm/RqJiGjbK6cQyWYHqqJD8 6v4Cp0/0RBOHH+zccU6A3j/CS5ZvCXXPYH0RwkoNklHKF6sZaB1Dgjk7B8mll4nr4BmG PZlJp41vBvbblHtcQ0yz0zOCWZRVQ3Gzd00FIACvrw9ZWc8bv7qKCe3zCRixDSpexf8D AFaA/jyZECTRghNo0bYtbhSmhepwfanF7c0+JKHmcWtfRTU0p0YevDmlYy0bqut7t8VO eqVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=nZuFLDFUjwLvwcPfN0zeICFcaF6lAbUfMlN1Sdk/tlY=; b=lgDu0JQQQmpXWHFjuqfXGZm+zSda3chu1gw6rlvcefrxoD+0nVxrM5bJz6eCY4lkRJ qw7d5MFsqgE/pGwtzJOxWRJKaHsJ4+L26WMp4Sdipbx1y52RwJftSTO6IDwdOUGFIw2G h/NgOIOULhOk+1g8z84xh9qJ2zAWxWaPWabs1nTo7Zyn7jfuJEBZmrS8TlzQAAepSuIa IRzqVxghq8eR69JUOF8bhQZZMkg+EERYj7ytwkc3TE0D9dprqhrCg7LHZZGtkGecd2oc 7e0R2U8RCiNkkjM1fIZPq6ykQFKv0azJKjWOnHPoxe98KKvGv2ryBus3EbICNypS7tB2 Q91A== X-Gm-Message-State: ALoCoQke4UaYhQxJlHDElzrGYm7TD/xh1dYr35sxKqdANd33d39ajn3o6z5pZFEw+7/jCgh20zt7 X-Received: by 10.182.215.193 with SMTP id ok1mr247016obc.6.1436902512269; Tue, 14 Jul 2015 12:35:12 -0700 (PDT) Received: from localhost ([69.71.1.1]) by smtp.gmail.com with ESMTPSA id d80sm1009835oic.21.2015.07.14.12.35.10 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 14 Jul 2015 12:35:11 -0700 (PDT) Subject: [PATCH v2 5/5] PCI: Shift PCI_CLASS_NOT_DEFINED consistently with other classes To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Mathias Nyman , x86@kernel.org, Felipe Balbi , Yu Zhao , Huang Rui , Krzysztof =?utf-8?q?Ha=C5=82asa?= , Matthew Wilcox , Jason Chang Date: Tue, 14 Jul 2015 14:35:09 -0500 Message-ID: <20150714193509.13224.80127.stgit@bhelgaas-glaptop2.roam.corp.google.com> In-Reply-To: <20150714193153.13224.40528.stgit@bhelgaas-glaptop2.roam.corp.google.com> References: <20150714193153.13224.40528.stgit@bhelgaas-glaptop2.roam.corp.google.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The PCI class in dev->class is a three-byte value comprising a base class, sub-class, and interface type. PCI_CLASS_NOT_DEFINED includes the base class and sub-class, but not the interface type, so it should be shifted to make space for the interface. It happens that PCI_CLASS_NOT_DEFINED is zero, so it doesn't matter in the end, but we should still use it consistently with other class definitions. Treat PCI_CLASS_NOT_DEFINED as a base class/sub-class value that should appear in bits 8-23 of dev->class. Signed-off-by: Bjorn Helgaas --- drivers/pci/probe.c | 2 +- drivers/pci/quirks.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index cefd636..71bd520 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1268,7 +1268,7 @@ int pci_setup_device(struct pci_dev *dev) bad: dev_err(&dev->dev, "ignoring class %#08x (doesn't match header type %02x)\n", dev->class, dev->hdr_type); - dev->class = PCI_CLASS_NOT_DEFINED; + dev->class = PCI_CLASS_NOT_DEFINED << 8; } /* We found a fine healthy device, go go go... */ diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 35f8d40..32cc9c8 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2843,7 +2843,7 @@ static void fixup_ti816x_class(struct pci_dev *dev) class, dev->class); } DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_TI, 0xb800, - PCI_CLASS_NOT_DEFINED, 0, fixup_ti816x_class); + PCI_CLASS_NOT_DEFINED, 8, fixup_ti816x_class); /* Some PCIe devices do not work reliably with the claimed maximum * payload size supported. @@ -3661,13 +3661,13 @@ static void quirk_tw686x_class(struct pci_dev *pdev) dev_info(&pdev->dev, "TW686x PCI class overridden (%#08x -> %#08x)\n", class, pdev->class); } -DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6864, PCI_CLASS_NOT_DEFINED, 0, +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6864, PCI_CLASS_NOT_DEFINED, 8, quirk_tw686x_class); -DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6865, PCI_CLASS_NOT_DEFINED, 0, +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6865, PCI_CLASS_NOT_DEFINED, 8, quirk_tw686x_class); -DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6868, PCI_CLASS_NOT_DEFINED, 0, +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6868, PCI_CLASS_NOT_DEFINED, 8, quirk_tw686x_class); -DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6869, PCI_CLASS_NOT_DEFINED, 0, +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6869, PCI_CLASS_NOT_DEFINED, 8, quirk_tw686x_class); /*