Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1408955pxb; Sat, 16 Oct 2021 09:11:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiVQsMdVJ61pXINilLqgd1DvFyhDXFJNoKfSWAgVdcp7Z/1kWT0DU4twNDeIYFe5/KgwQ/ X-Received: by 2002:a17:90b:4a8d:: with SMTP id lp13mr21628657pjb.32.1634400698185; Sat, 16 Oct 2021 09:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634400698; cv=none; d=google.com; s=arc-20160816; b=Fz61iWChQBUrP5du9b0TyiyZFW1EmwXm/d0nftKdZgcHpeMgk2CAAWg7ouFAkkjYEP 4yVPPsYFlui9ngl+R/XUHKPYDrYVDpH1SG3FspuXqWi7Nqroi4MiwyVVwDM+IYasVAQB /OK5Dsyl8TLvmaGFELyq6LMDaEu3NME1K7LPHlhJPR+lE0hvhhwEaxC3dRqeuoN8vCse VGraYagQpXtlt9g2iRUsRYpuIuv/fApecxzTwEv0uBLnT+5wzYINaxNftCQ58wwOMCcf gXZKvW0aSqTO7h//W8bbeCM63e+YD39/KGsmj7sEM1mNOFMiQQb5NaneUT7ZPw99jdQa 1x5g== 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=r3o5gBqF0m60j/685v1gCV+85CWmYdPsbI4M53MCV74=; b=qiMGqdCFE3/sK3CMk6D2Lol0SsJOeYC+0cPwjzTpLB8mtoETrCxFuxYyw6pHyqiBk2 qCs3ro9pOTgv+sFTL32iBlAnNwHY/aQZ3+6i/MCgTIfoD/s2BUkmTZbEfjkEWjNhcdE5 0+HMhnbYAqxvXtWrqajf94uxGxqwHV2D7elLCOjW7E++iNIUfgnrvBdgqcaVKH+XzNcd 5Os5cZX5PFiMmubpp18eJf0MdplSpbr5JFnKBJWTWs2SzopTsQKA7Gz34boDrXFR9ZN0 PSHQirIk0F+yY4A2gFw6e8YS/kyqQt5CczNJOGwN6Ovs63iB0aaL/bOxw0kk4wuqS9cb im5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=i6fqth5u; 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 e190si12953681pgc.507.2021.10.16.09.10.31; Sat, 16 Oct 2021 09:11:38 -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=i6fqth5u; 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 S240613AbhJOOpT (ORCPT + 99 others); Fri, 15 Oct 2021 10:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236502AbhJOOpR (ORCPT ); Fri, 15 Oct 2021 10:45:17 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5A18C061570; Fri, 15 Oct 2021 07:43:10 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id s1so4713247plg.12; Fri, 15 Oct 2021 07:43:10 -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=r3o5gBqF0m60j/685v1gCV+85CWmYdPsbI4M53MCV74=; b=i6fqth5uZU8VCAy4RPMnbl7AIp+Tdvs11/vzA7yll5FwjxTWdkRv88xIyhz0rk2t9u d4AiJSDP9CeHws6FKjuMBjxyhe3oEKOlHBeRvXqqSONxYvGaf/uu/y8kCDk7Z6bc4uW5 WrvJWL+UYcG1TwCL22/zI+7Y27VKBRtvBou8+Mxw+Buv+EtieEQ5ZlJLDA+ryKzQv7tM GVcKbxBrGR/WZOyeKmiDwtFpl0kCPqLy5BzU+2dkv32Q9ciLg3lI1SEDECWR9dA4q9Vb t3SUiEXFtf2kXoqI+thdO7iaXuabp1MfEWNiLcGvQ84iWwAbAw22BL5ZTmVth5ZnWwiD qTUA== 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=r3o5gBqF0m60j/685v1gCV+85CWmYdPsbI4M53MCV74=; b=XlHOkX0/dW2yD4DsMQYYOjMSL6MMfqvRjh38xyYu/M0dnOff5rzr6W/QzIDxTtxZWx 9WrEeyVdQwj5hRz/XYIqfQtyUN47VszFlwT22+HFVE7N9jdZtEwdV2YAeNIWxIgwOM6v QbHrEpmQVNrpCLXVXcW7CWHkIUrB7JS/X0P8S+6TZPfQIX74IdAwwWqDUfvWYUorTLAI MOrcKvvYQRwvo9nRrDSHwmJG+tHPiqkGzfUYHUu2sexguA5gHvMZB5K/heNlwCvLRXnP EoCKimvrqWmrtNIj4KCTisNbXMOIAyPKGej34MaBr3b245yZLj2nINlagqvjK/FJiCth jxTA== X-Gm-Message-State: AOAM531XfkJUhtiHwH4s2anFzceHQvC/0CwQYmSvfgfTIbdf/GqHRxIG M6jKJdfteiX0p1lwn2MNg+c= X-Received: by 2002:a17:90b:390d:: with SMTP id ob13mr13887102pjb.49.1634308990354; Fri, 15 Oct 2021 07:43:10 -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.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:43:09 -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, Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM IPROC ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM IPROC ARM ARCHITECTURE) Subject: [PATCH v2 06/24] PCI: iproc: Remove redundant error fabrication when device read fails Date: Fri, 15 Oct 2021 20:08:47 +0530 Message-Id: <71757601a719e2ff6ca27615183e322a7709ff65.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/pcie-iproc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 30ac5fbefbbf..e3d86416a4fb 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -659,10 +659,8 @@ static int iproc_pci_raw_config_read32(struct iproc_pcie *pcie, void __iomem *addr; addr = iproc_pcie_map_cfg_bus(pcie, 0, devfn, where & ~0x3); - if (!addr) { - *val = ~0; + if (!addr) return PCIBIOS_DEVICE_NOT_FOUND; - } *val = readl(addr); -- 2.25.1