Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1683321pxb; Mon, 11 Oct 2021 10:50:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU6QuuCASVmQEW/zqCYDxBf2uwDhJ7N9LraU+Nlt8Tr+hFTMDcwg6xlDwjwK4PU6OC7xaC X-Received: by 2002:a17:90a:f292:: with SMTP id fs18mr375828pjb.229.1633974620322; Mon, 11 Oct 2021 10:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633974620; cv=none; d=google.com; s=arc-20160816; b=D8iUBWMHyk65NFBJtN2tCELY5jpdSJJyZrN38Qn1sO4ZKP1jp4Cn+jXaMIb6WrEck5 QsG0zxuNOI+lXMKCstNTSljnaRqbApTXM0PvFvUn0CXTWY/pBYT9eyx+IpBXSw7vcW2F LtOM0YuIbx2YKsVEsjw09OQ1yfmEbL97wc+5kq2e5wysA1FWQKo8SfzU5nBlxb+8n+gA svxAe7XOmRLF6+g2CLWWmFkUSm8nWWA6ZsrKmX1AyOSXUES7LdUMLHYtdgvwiskCt2DS NeztgVwd3zC50A4p1iG8UH7PZqijfZuZmWsFARTej7vBvXLXEi3GwjBR8C6YWD7akEea spEg== 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=zxhtuL3HeCmtsqnFNhK74x+usx81ot+S79+zUUitvW0=; b=yS2vZ7bduKDxSftrT7+MhuJ65IJ8dbM7y7+83G0GHJoOOHiq3b7v9wWw5ktFU/PbCO OcgyUvD4Pu/OAZxMekbWmnVHqel/p+L6J6e91tNm2RqqR2YYdQD3QFOGHYxcBzW22472 VpnoxQRvF6Bz+lBm8csqCadUjx36FAxNZ4czvmtHWW5TKqmpOisQ+pbRDOCR/GMiWWgD 57KbDEc+AGqEXRt6kGpxNeg7SafQxxHZ+rzcBzueQeYCgr9rkaHI2TsX5vJvV8jvKBbm Yas9J4orGZXwbutqjNm8Hw8+JLHyqX6qv0rphGKocCr3xb/AEkO17zuFL03FYcuNJXeF kU8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PD6GjrTQ; 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 p8si14668472pfh.25.2021.10.11.10.50.08; Mon, 11 Oct 2021 10:50:20 -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=PD6GjrTQ; 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 S233946AbhJKRtN (ORCPT + 99 others); Mon, 11 Oct 2021 13:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232836AbhJKRtM (ORCPT ); Mon, 11 Oct 2021 13:49:12 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56EA9C061570; Mon, 11 Oct 2021 10:47:12 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id t11so11790968plq.11; Mon, 11 Oct 2021 10:47:12 -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=zxhtuL3HeCmtsqnFNhK74x+usx81ot+S79+zUUitvW0=; b=PD6GjrTQM3KCyYIuR3r9KfKJBDMUoyykds5CzWH4OLLp1/gaFDA33/40tedbUytqNs C6NA/4F//BIJVTDGSfpoVfnI+Sy0cLXqFyLEeS9emQR5US4Ef/UihfKbAwb6TwV7SZUa s1zyFoWYgwEzSCBV1E4l8hJUbSkzs9IE1/H8VwZ7Ygsxm3IV0tjVz3pejMNZsPCjKtXI uMzkMWo0th9vtZqV9Wfx+y+U2utQB5dcO3l3iCFp5LeutR/FRvONywzoVEakuMgKRs7Z 0OIg+au2Cc2rP3ui4D9HbMR9Cwrg4a3oN/FgcJP+ZjbF6c9OEFXLLKmMaw1OyqZqdau+ m/Zg== 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=zxhtuL3HeCmtsqnFNhK74x+usx81ot+S79+zUUitvW0=; b=RM9Len42ANp242wYZJ4wjyUj7Hh+TG25co2PQ4LRW0r6yHr78PVReYVBz/uwlqjh8T Vps3OXjgOoSuaguMbLwv9Xa0blMMiHInXx5HbQ7nfBrUXH52CO6JPzK/kMEJvrSNVnZi nQ15PkkTfD7pLAD3u23qtEk2h5PN31Oi2R3Qgt/aIRQfSGnsH6QZ5EbnkCpcuxYUWHH7 dwRMFO+N5cirCkctt4EnNRUWjsKkd9kQ/y3Hwsd3UnUBnqjXq4N9r4oxzFkQczed7NiR iqGNkZLWzHRKYQgJ+AtHJfYRSwZqRMLfcB6zaej7Fq50DjXoaVp0JHIRyzrg8tmEsmIP UJ/A== X-Gm-Message-State: AOAM533xC1XZrhWbOQwDg0t0j5yyL7nhdt6t7bzZPhtiXvw0aD9MXLj7 6N/t8+KuL3B9xqD1pZYgHxQ= X-Received: by 2002:a17:90a:9f8c:: with SMTP id o12mr437340pjp.96.1633974431830; Mon, 11 Oct 2021 10:47:11 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:9f95:848b:7cc8:d852:ad42]) by smtp.gmail.com with ESMTPSA id m2sm8824461pgd.70.2021.10.11.10.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 10:47:11 -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 04/22] PCI: iproc: Use SET_PCI_ERROR_RESPONSE() when device not found Date: Mon, 11 Oct 2021 23:16:36 +0530 Message-Id: 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. Use SET_PCI_ERROR_RESPONSE() to set the error response, when a faulty hardware read occurs. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 30ac5fbefbbf..f182dc2cdb0c 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -660,7 +660,7 @@ static int iproc_pci_raw_config_read32(struct iproc_pcie *pcie, addr = iproc_pcie_map_cfg_bus(pcie, 0, devfn, where & ~0x3); if (!addr) { - *val = ~0; + SET_PCI_ERROR_RESPONSE(val); return PCIBIOS_DEVICE_NOT_FOUND; } -- 2.25.1