From patchwork Tue Aug 23 16:16:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1088912 X-Patchwork-Delegate: bhelgaas@google.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7NGGoFO001428 for ; Tue, 23 Aug 2011 16:16:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135Ab1HWQQt (ORCPT ); Tue, 23 Aug 2011 12:16:49 -0400 Received: from smtp-out.google.com ([74.125.121.67]:59326 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504Ab1HWQQs (ORCPT ); Tue, 23 Aug 2011 12:16:48 -0400 Received: from hpaq1.eem.corp.google.com (hpaq1.eem.corp.google.com [172.25.149.1]) by smtp-out.google.com with ESMTP id p7NGGkQ7025540; Tue, 23 Aug 2011 09:16:46 -0700 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1314116206; bh=3l5uXy3CdrzU14/D/VBO4+SlpDs=; h=Subject:To:From:Cc:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding; b=yGsC7bzh4ZHAQwqD8dCN864eep8HQzmsLDduEPMEkY67frYxMHnz/SCStKgGKTv1I zjL4sG9sxKUX5Xh5U2a9g== DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=subject:to:from:cc:date:message-id:user-agent: mime-version:content-type:content-transfer-encoding:x-system-of-record; b=Ckdjl/NPmmr5cmZsAb5UplIVhQKzpB+4w6ltPtfaQFkyKkline3Ww/qttuDq7Nub4 yo1B96jtOh+szlwKWdClg== Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.18.96.155]) by hpaq1.eem.corp.google.com with ESMTP id p7NGGi8W011021; Tue, 23 Aug 2011 09:16:44 -0700 Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id AABF220CD3; Tue, 23 Aug 2011 09:16:43 -0700 (PDT) Subject: [PATCH] PCI hotplug: shpchp: don't blindly claim non-AMD 0x7450 device IDs To: Jesse Barnes From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Ralf Jung , Joerg Roedel Date: Tue, 23 Aug 2011 10:16:43 -0600 Message-ID: <20110823161643.27268.89203.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-System-Of-Record: true Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 23 Aug 2011 16:16:50 +0000 (UTC) Previously we claimed device ID 0x7450, regardless of the vendor, which is clearly wrong. Now we'll claim that device ID only for AMD. I suspect this was just a typo in the original code, but it's possible this change will break shpchp on non-7450 AMD bridges. If so, we'll have to fix them as we find them. Reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638863 Reported-by: Ralf Jung Cc: Joerg Roedel Signed-off-by: Bjorn Helgaas Tested-by: Ralf Jung Tested-by: Ralf Jung --- drivers/pci/hotplug/shpchp_core.c | 4 ++-- drivers/pci/hotplug/shpchp_hpc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 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/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index aca972b..dd7e0c5 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c @@ -278,8 +278,8 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) static int is_shpc_capable(struct pci_dev *dev) { - if ((dev->vendor == PCI_VENDOR_ID_AMD) || (dev->device == - PCI_DEVICE_ID_AMD_GOLAM_7450)) + if (dev->vendor == PCI_VENDOR_ID_AMD && + dev->device == PCI_DEVICE_ID_AMD_GOLAM_7450) return 1; if (!pci_find_capability(dev, PCI_CAP_ID_SHPC)) return 0; diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index 36547f0..75ba231 100644 --- a/drivers/pci/hotplug/shpchp_hpc.c +++ b/drivers/pci/hotplug/shpchp_hpc.c @@ -944,8 +944,8 @@ int shpc_init(struct controller *ctrl, struct pci_dev *pdev) ctrl->pci_dev = pdev; /* pci_dev of the P2P bridge */ ctrl_dbg(ctrl, "Hotplug Controller:\n"); - if ((pdev->vendor == PCI_VENDOR_ID_AMD) || (pdev->device == - PCI_DEVICE_ID_AMD_GOLAM_7450)) { + if (pdev->vendor == PCI_VENDOR_ID_AMD && + pdev->device == PCI_DEVICE_ID_AMD_GOLAM_7450) { /* amd shpc driver doesn't use Base Offset; assume 0 */ ctrl->mmio_base = pci_resource_start(pdev, 0); ctrl->mmio_size = pci_resource_len(pdev, 0);