Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp719671pxb; Thu, 21 Oct 2021 08:13:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiElHCQBe5vDIrTdqL+Rmx7do9y5a8RZFZscG2CcUGav1qoDZkS+jOMiqzLTXs3njKfFh4 X-Received: by 2002:a63:7543:: with SMTP id f3mr4883650pgn.449.1634829215413; Thu, 21 Oct 2021 08:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634829215; cv=none; d=google.com; s=arc-20160816; b=eED4u4T7G/qiX6fhjU7EYm3iUuruzq7lKcjTegbd9xGQ3BduHvhQTTnEqZAHA8qWgi 7XYJNjlM//DSIYICWqFveWxn4F+cERc8f1n+mTeZqrXVyl9s2PCkSEsyK8AGMnKsGV4J gV5yoFamAv+qr8qUdyAABU9OFiqRTXz7yA0pcaWl4XO8pBvyp6CQ0j6E+yzlLsMEF99O wa8/PvNWzR9GJrYSWInrXbWo+9HKoZsvzmDTQpuRFDcwKzjmFYG5DDsye5P6N6syc/Y1 5MGHT4LcMXl1eT1cxKzI4ZHVcboVpGXLevairpSoQgpkTlWvopg/M/DCUJdiyzEtNNFx cmZg== 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=xNMj4vJ6w6bjyJ+mdzfoXDI8bRWTSoh4NitmERzhWwDj3IS65Apuuew5v772CFShK+ YQVtCYaMGvx9229PAWUYqWpe1B8ffUrVg2r/B44ITqJ98CKYgqATrSwJ7mlh8OeIXfWV GiIUAbrrxj1iAl4crPoCsYHhKnNGYjqyYypmfRguLFqe6wgULFFU8YABLGSjLG+TCkvx kHYMLDDUxuheiKilJjq/1JACJDdmOI29jz9pMU/7eRV1KIdw4PNrzRjcuF9EOobAGSsW ngoiIeaC/PIU10Xm/JW9EmySTZb60z5bC4F8elezrryugHdRc6D4dNlT5HMgp8u4Ss8L 5g4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MSAARfVk; 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 g7si1076147pgg.426.2021.10.21.08.13.22; Thu, 21 Oct 2021 08:13:35 -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=MSAARfVk; 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 S231826AbhJUPOC (ORCPT + 99 others); Thu, 21 Oct 2021 11:14:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231520AbhJUPOA (ORCPT ); Thu, 21 Oct 2021 11:14:00 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB2C3C061348; Thu, 21 Oct 2021 08:11:44 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id m21so567766pgu.13; Thu, 21 Oct 2021 08:11:44 -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=MSAARfVkkBFaa5Ke5ob3e1LwRETvIsI33C2lnbjRTuAmIo3JjMsSIGohrcEr7GesQo YBiVfDVx92ElvZl+8rczQScmVzoG5ry6w4RPZDxetXdzQQ/GfEuoXZ6SIWaD8XMUt6J9 J7HWgg3KkLAqTEwfg9rVkAdV55stFrUiQmOhjyfbrU/lRuEh/OCtlWGos+FHtYDiOpqM KHqMpDUE03pkwqD8tn8d1Tiw5l5YYGKHSz+UsxK435/gmfmdvW5MaWFKGd02PPO4gi+X saQGEi++av2pKzxu+zMV/B/auaPuRaTGKq+9CCwCD+0nUS25WJhsnriyYWdRkffmiE1B 3XVQ== 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=jPKhROLj/8tmuY+Q9wGnLP9hebpeRANC9VaVMYqmHtuEtvrP+1+PON73dwdVsFgiBp AyxahYRNY+37VVxKSMLILtmpDMjGnOaLyeDbxFrEpSyaXLzHaax3tGmy/2LSP+AsO++9 V5r3hwDd7b8FI0l/SdNo5inURHF3eVmuA2rbqxpH4D0W1hxWfp2wmiDeQESihiZVOtTt rjflLB8YBwurCmSjbhaxtzDJdSd6opz4T4WAf4G+N2ZAoODuOLwIDJcj8YSMzDVh9g0q bPBvpPwJGt2wIzOEhhEGP0sqTRtbXJ27iGhRwzvGT0ckRPgRm/peA6J24cbeYIvm6eYI lMLw== X-Gm-Message-State: AOAM5321QJXndRnG+L99Z4QB19hp2N4TmQsNMOl3gIhpFRfujnDn10gV lPZppPlyh4i6jep3ChVCl8s= X-Received: by 2002:a05:6a00:1248:b0:44c:84cd:f795 with SMTP id u8-20020a056a00124800b0044c84cdf795mr6283222pfi.79.1634829104274; Thu, 21 Oct 2021 08:11:44 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:29a4:d874:a949:6890:f95f]) by smtp.gmail.com with ESMTPSA id c9sm5508027pgq.58.2021.10.21.08.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 08:11:43 -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, skhan@linuxfoundation.org, Shawn Guo , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= Subject: [PATCH v3 09/25] PCI: histb: Remove redundant error fabrication when device read fails Date: Thu, 21 Oct 2021 20:37:34 +0530 Message-Id: <0e8d665e676717cc69394c6153aa85dbb4d02ca1.1634825082.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