Message ID | 20231003125300.5541-2-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2060888vqb; Tue, 3 Oct 2023 05:53:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGl6kMc2ldoEmV4yL9fCL6Ph8rTAXea8wcmvp5IMuP6vDwjY+lqlWorxAlPDvoGBS2l71CZ X-Received: by 2002:a17:90a:a882:b0:274:4fb:3610 with SMTP id h2-20020a17090aa88200b0027404fb3610mr12194925pjq.47.1696337619830; Tue, 03 Oct 2023 05:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696337619; cv=none; d=google.com; s=arc-20160816; b=vePRPeXFz1NNaTLSZVaQR79oUWRj2fbgdoRK3/gNMWD9jKpV2QsIC5dzAR5E7E/U/l HkRVZuWzeaG0kO/Fj1VPJh9QcJaRiuD3xqnpUcWjLZkqk6O63fQB4jlS2TFsRGDFDoPy AFlsSM+uPng1LKU+YRBgJ9KqZi3zdQBRi36lTk7THifXna09InD/H4MAtG6NY1CgXUOU /ds/UeNBEsZ/BCJMy0FgGov0TJnB1qmrEyVXZq9kkgBmGttTd9poosyCsxeJF2m6RXhL zuH7oWFRZqyruQnPmA9UYXKrCxM3/Yu3OeFFb2U+S/1iWuDCsh+0EOzufzLKa9nkTzVE 2vTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WD4aMEReG0QfqAHbigaIkY//IuTFs4PPW4uIlOTEJNU=; fh=40OfMyTgvQ/SDqiGjlZT1c0+70yJS9m8UhH5uZV2Ows=; b=GMFJsxyq0d9HCVHGuC/zt42qB1wQBBd//yREUbU03/YuMI/6Jm5veduoh9xOdTwIaP RZmEvRLwy3SsNEdeMNEISrfNJUq8nkxHelsZscnlKKhC/B3D2GlZFLIQ5CJ9Iy1DV4zn kpuxCqZlnK5BmsAD1N8Y0wtFrkIxC3XrXY6QlbaboS1t/aRqvzpyhll6DCr5tCpW5fJ0 VXBrbXotMpbVYFM93CDJgbGOR9HDlKOWveAKWiFWsO+tNUqT9tY2cm5iJCqHFvGNtHCp USahQd9CHrHryt8z1uNGIS+YKqLaWaJoUXdQi69wrhEH1YEvHKmXdS1Re44+XZhroQXv BcMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NZU5PvXI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x5-20020a170902b40500b001c62b51ac0fsi1325082plr.306.2023.10.03.05.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 05:53:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NZU5PvXI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2BD8C825A982; Tue, 3 Oct 2023 05:53:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232204AbjJCMxf (ORCPT <rfc822;chrisfriedt@gmail.com> + 17 others); Tue, 3 Oct 2023 08:53:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231266AbjJCMxd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 3 Oct 2023 08:53:33 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A675BF; Tue, 3 Oct 2023 05:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696337611; x=1727873611; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ColEi8Bgy84f92KFXrjvKWg7/PjGY+5N1fWbadVJ1hM=; b=NZU5PvXIqaUSGd5JFftfypJjvWLxU8ykj9ufeWIirf+zh/FRbPpPiopF 9QwLXEKwZAxKpJ2pyfiOnUK5BlLAhYKaSFdgn1ShZaIBSWU5u51bKNOcu C+xQW4Xv7cRH5SWCElgrMe+OpQDaNF7w1h0RB0cOwpewFfP1VK8Mquoed zxMgwIZBkhu/CMN4r0myEA2z2GiokcP5xtLUlQ+bW1UpE23SP9+triAaQ Ke0m7EG1SFZR3hS5L6mQRK0C4QgdSXogwdLB2QxQmYA2bf0HzwRuaKJfv IOtrI110Ecq8YBtdrX1M8e7P7/i9gyHMCuZnFJcvl4qAnJHvSQ4d0qU4k g==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="447022379" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="447022379" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 05:53:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="998006040" X-IronPort-AV: E=Sophos;i="6.03,197,1694761200"; d="scan'208";a="998006040" Received: from bmihaile-mobl1.ger.corp.intel.com (HELO localhost) ([10.251.222.64]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2023 05:53:22 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>, bcm-kernel-feedback-list@broadcom.com, jonathan.derrick@linux.dev, kw@linux.com, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-renesas-soc@vger.kernel.org, lpieralisi@kernel.org, marek.vasut+renesas@gmail.com, minghuan.Lian@nxp.com, mingkai.hu@nxp.com, m.karthikeyan@mobiveil.co.in, nirmal.patel@linux.intel.com, rjui@broadcom.com, robh@kernel.org, roy.zang@nxp.com, sbranden@broadcom.com, yoshihiro.shimoda.uh@renesas.com, Zhiqiang.Hou@nxp.com, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH 1/3] PCI: vmd: Correct PCI Header Type Register's MFD bit check Date: Tue, 3 Oct 2023 15:52:58 +0300 Message-Id: <20231003125300.5541-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231003125300.5541-1-ilpo.jarvinen@linux.intel.com> References: <20231003125300.5541-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 05:53:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778738916075468926 X-GMAIL-MSGID: 1778738916075468926 |
Series |
PCI: PCI_HEADER_TYPE bugfix & cleanups
|
|
Commit Message
Ilpo Järvinen
Oct. 3, 2023, 12:52 p.m. UTC
vmd_domain_reset() attempts to find whether the device may contain
multiple functions by checking 0x80 (Multi-Function Device), however,
the hdr_type variable has already been masked with PCI_HEADER_TYPE_MASK
so the check can never true.
To fix the issue, don't mask the read with PCI_HEADER_TYPE_MASK.
Fixes: 6aab5622296b ("PCI: vmd: Clean up domain before enumeration")
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Cc: Nirmal Patel <nirmal.patel@linux.intel.com>
---
drivers/pci/controller/vmd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index e718a816d481..d5b97a6aae56 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -525,8 +525,7 @@ static void vmd_domain_reset(struct vmd_dev *vmd) base = vmd->cfgbar + PCIE_ECAM_OFFSET(bus, PCI_DEVFN(dev, 0), 0); - hdr_type = readb(base + PCI_HEADER_TYPE) & - PCI_HEADER_TYPE_MASK; + hdr_type = readb(base + PCI_HEADER_TYPE); functions = (hdr_type & 0x80) ? 8 : 1; for (fn = 0; fn < functions; fn++) {