Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1412871pxb; Sat, 16 Oct 2021 09:17:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk9NoPQd2RCPCzT+jxvQFJ5YjvINuuppObM9etbOzdLZOv3ygK9Vt5UT3OfG7tL0dnv2QB X-Received: by 2002:a62:5297:0:b0:3f4:263a:b078 with SMTP id g145-20020a625297000000b003f4263ab078mr17982985pfb.20.1634401020925; Sat, 16 Oct 2021 09:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634401020; cv=none; d=google.com; s=arc-20160816; b=DcCS05MO0se3Q65IXft7nigRPDQg5oW8BniuBJKmLbcnjZRvXl3i2iIaBxxN0oUOt+ k+PDC3XY5LuHhWTffLNMuqG5FamGmMRe5IgtURtOCGB/PN4Q6NT4DT5c77SxznTHn5cS YsVLy16xoujLpLuUUbVVoL102fs40pTD7o8DFex4LRgIi6AiqeZ0qh+9tFBgTIBkAdVX vDPMWXVlA/sR4tGER5P27SbVkeFsJdZfgPdS6FnySu0mZtppetW/FHkm93j4TSwPS/bP OTDQLW8CGwRnTx3m16qmcvX6/sotRoa5RD3vAVXfFgXav3YDQKVNIdalTNCRLzVvCLoC X48w== 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=FA4eEA0vKwb58YOkbLP9K2NVmJYtwGLqPjb+iaCxg5k=; b=oZVUKAJkIB7WpXCk04s3womzdmEH5R7y9kv04f0Ops07h1AMb+kQ3kR7gvU2XmoCyI OYHv2USvBF+0gSPCDAg7JVzun7P1QGFQMIPKTLlkkQCaFFfyZhhJ6XN/ZJbW8e70Gu5T 1UahWbLazHYsg4jl23FnJ8TCKDsk3W9Lhp8UWkbo8T1Prx5xhnQ53QJ0fpWCkoG36W3a 2Is01zkQGWVZiYXOvEBLXYzynGbL4yNOxDdWcgPTK58p04QtmSpqbZ113AeUErpDYb4N pbh+5XTAOcgBR50uuWV0s+dnuIO2JETT39a0irGRIXywKFuKZvSOkHN8d5DoSPEtFN41 F2TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WRjdWN38; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si11823032pgj.19.2021.10.16.09.16.49; Sat, 16 Oct 2021 09:17:00 -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=@gmail.com header.s=20210112 header.b=WRjdWN38; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240649AbhJOOqW (ORCPT + 99 others); Fri, 15 Oct 2021 10:46:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232140AbhJOOqV (ORCPT ); Fri, 15 Oct 2021 10:46:21 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31AB3C061570; Fri, 15 Oct 2021 07:44:15 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id m26so8556643pff.3; Fri, 15 Oct 2021 07:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FA4eEA0vKwb58YOkbLP9K2NVmJYtwGLqPjb+iaCxg5k=; b=WRjdWN38D6pmIz2/eZS7kZpgxON4LRg1nj1/L5q1P46XY1xU9gmCLz7v3Z1dom5rzl +WQEdkj/O22XjHY6DAWhTFUhRU12KIbbRjefhHurp4DhcVlL1TlElgkS5Gx2fgUw9t4Q hQS9VLRLx+DJvw/Agp6G1JvNmT43lWpoGtuhQoy5cAw9KDLRNtAlP99Z4ETNvMHBD9Hg vc30U0TeuXD+spXiWoWOiGWeFjPKGiPZvriG3s9bNY6Tn1A/NWF0/tkrQJxAuxAc+Le9 oemYmYUCjs51o8j/mNARaXeUstnlx3pDVfKdltZbHEuJLjmub2e6DdPdVYBnDdLBhA1Q zeIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FA4eEA0vKwb58YOkbLP9K2NVmJYtwGLqPjb+iaCxg5k=; b=ovROcr4uo+WR83wAVJCdNGJ/4jRhxaPCwzDZb0huGqLMH/Agtj8oRiAxN9n8cmPp8j ov4sjJk6uPr7j9lXv280QDolUm/1wYmPvg/FqKt9fnRfWiIvyZcUHDD38gP7TPQ4Mzs2 9dP0LNi1vmXXyeZQJk90k6Ry6XVO5qSpD4ek9aBam2AGMR/jeyNAXCaV6fD5GmK6n5Zh Joy1S+In3pZ4W3yPHASijv+VaU6UpejJjamu5VeLVh3SrhBb4ZYiPCIfAQIfC9+D67nW A2+Fso7urSw7rUq0Mcla+plm4G0KqWV9sSS5eiUsgJkXx0FqbzyMAh9jRCK4msOFwFmg Cc/g== X-Gm-Message-State: AOAM533jFrnPz81cJoL8Sl/UZ+vqbXIJXVkchNUAPgqvBXYSf2//uss0 Bbv8zswqQfyZJV+vedhq3Mw= X-Received: by 2002:a63:e243:: with SMTP id y3mr9615900pgj.101.1634309054683; Fri, 15 Oct 2021 07:44:14 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:4806:9a51:7f4b:9b5c:337a]) by smtp.gmail.com with ESMTPSA id f18sm5293491pfa.60.2021.10.15.07.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:44:14 -0700 (PDT) From: Naveen Naidu To: bhelgaas@google.com Cc: Naveen Naidu , linux-kernel-mentees@lists.linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= Subject: [PATCH v2 09/24] PCI: histb: Remove redundant error fabrication when device read fails Date: Fri, 15 Oct 2021 20:08:50 +0530 Message-Id: <42d789c39ff42b123f67f330e6e15ce26047ea3c.1634306198.git.naveennaidu479@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org An MMIO read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. The host controller drivers sets the error response values (~0) and returns an error when faulty hardware read occurs. But the error response value (~0) is already being set in PCI_OP_READ and PCI_USER_READ_CONFIG whenever a read by host controller driver fails. Thus, it's no longer necessary for the host controller drivers to fabricate any error response. This helps unify PCI error response checking and make error check consistent and easier to find. Signed-off-by: Naveen Naidu --- drivers/pci/controller/dwc/pcie-histb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-histb.c b/drivers/pci/controller/dwc/pcie-histb.c index 86f9d16c50d7..410555dccb6d 100644 --- a/drivers/pci/controller/dwc/pcie-histb.c +++ b/drivers/pci/controller/dwc/pcie-histb.c @@ -127,10 +127,8 @@ static int histb_pcie_rd_own_conf(struct pci_bus *bus, unsigned int devfn, { struct dw_pcie *pci = to_dw_pcie_from_pp(bus->sysdata); - if (PCI_SLOT(devfn)) { - *val = ~0; + if (PCI_SLOT(devfn)) return PCIBIOS_DEVICE_NOT_FOUND; - } *val = dw_pcie_read_dbi(pci, where, size); return PCIBIOS_SUCCESSFUL; -- 2.25.1