Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1690150pxb; Mon, 11 Oct 2021 10:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxypSOEiYECHELcdgy4KAYbZ1YcCWHvh5/70FfSBga87JrLoWYsglFU+7M/8RHCDldFaDPn X-Received: by 2002:a05:6402:268f:: with SMTP id w15mr20173068edd.13.1633975146572; Mon, 11 Oct 2021 10:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633975146; cv=none; d=google.com; s=arc-20160816; b=ymEXJnuljLw0Kbipmt/wotnScHUzFyKWdg5yAAbMhwXAA1E7+9e1h94nBaVzWorV7k +jRRz41VwdkiT4/ON4lG88895QPexNFyt9nhDX2oJnb5Hgnoffl5xgv8ecrxsbyir7Yx WSgU4VhkfGJOrwv5MqJIxTNU61+7cUvF5ipgrYQsnz8sfCPccCOyTvb1WaRtGyGsz5Q4 Vokg8bR5BWVBkcdyvj9RJskaBoVXjyt3MO1s8hVAmekzaaJf8jOcC5lxynLwf8qNZU/A X7qwzBKjat5IUGAD8KyM1vJbJpA4BTW8C9e+dlEN/OTdO0/XmPu/OBuzGYEmefmzTDlf b2Ag== 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=2ZImDxRTs4nwbSxsAKdaHyup0N9fnqvqZDCDk/+Vf0Y=; b=gGQMdKDXgznCYey+voU0QByoDhyHPrbgaee7PH35qvp9fyqts4lA2d0nld3CoYnOnr PEYpoKfpfRgECWjfDJG/pRmh45WicUT4x1mO65GSeJAwa5HdVTKWZ+ZqvKmhSfXP7EBP U120+OTgZ7OsL0v7Mxzjx8EbC/uDgdCnHb/e136ee+QOPbgoIiZ7yrbjDVv0GhN9JLId n4FnYf6TWgSFpMLpD4d9w8bzc9a08W/EHKgQtXPScUsYWWakL6VSlvJTgm6vBmogGTWS U3vOqZhm2FBYBNs1NPGUHc+y6tv7xzP3G9bkHFvS3ihPQ3mqqZRDnZUVtv0vNlr/Iv1v Hd9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eT5FFReQ; 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 u4si16267776ejy.271.2021.10.11.10.58.43; Mon, 11 Oct 2021 10:59:06 -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=eT5FFReQ; 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 S233912AbhJKR4i (ORCPT + 99 others); Mon, 11 Oct 2021 13:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231771AbhJKR4i (ORCPT ); Mon, 11 Oct 2021 13:56:38 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E277DC061570; Mon, 11 Oct 2021 10:54:37 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id g184so11500270pgc.6; Mon, 11 Oct 2021 10:54:37 -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=2ZImDxRTs4nwbSxsAKdaHyup0N9fnqvqZDCDk/+Vf0Y=; b=eT5FFReQfb1LcNkIwafOPSuleoxZmsTsEcyXNFqnLbBwjR6De+HHX2hPGC3hRgbQ16 zE4jTh/rIAcYWSvPmFrEjULaYVLLRN8sqBUeh3K65+oqfDf7Bu4yvx+DGFUPHfgW0eOJ sBzf9i7HOnuxtcl0doAhD/UylSNfLnlYbRb+SeJMJeS8czBpuU+6J5kjGzdnCdeMiVUI mvTh4fDdQUD68Xt2zYHW61FFfUd4TolDMj/0x8MLJ+boiRdwCdHR32iwHpHBgpXUp1lx CRowfDvAxBA9Hj8CQ1nyvrBG4bEd5NCf7J7x6nl051mfFqZ0twgWmbSxa8CGO8w0ocgW QOcQ== 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=2ZImDxRTs4nwbSxsAKdaHyup0N9fnqvqZDCDk/+Vf0Y=; b=d28QBHkMwF/8XJyfNIniQP/NXueEPq6DqsBcvsWTTXvZF7vfD7hGtkcYWHxJ/yxZRD A5dJh4fZ+gamEz0827snd7Ovli2YsRH9K+dfBByPfki+NT8J56diqKPHOnxlO5khptDg P1rPf5BSR5Ak4dQPw1a+giUFLD7l3Oxz+0o1f4v59z66MXPNW9OaI3mwCxTLPMqf3ZXg HsqPZ3rP3Vi86/w8UYdnnSXl5T0G4/KBCkW9lY/en4DD1rpTCqk5eFsq7ENztGGf+F31 oduYCigKzjRuyb+iQnnzkRDDlJC1zzqf+Dr/XCcQTYhlNgPET2T7kOl/bUXfgFR7WAgl VT7g== X-Gm-Message-State: AOAM530/5d5yybt5aVxwTIU+aFbLHwpcN45eCe0RHqUDc4YI4bUieUjH Kn6E/2cRZkH5HGEEY+TrXzY= X-Received: by 2002:a63:7504:: with SMTP id q4mr19249112pgc.103.1633974877421; Mon, 11 Oct 2021 10:54:37 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:9f95:848b:7cc8:d852:ad42]) by smtp.gmail.com with ESMTPSA id v22sm8605011pff.93.2021.10.11.10.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 10:54:36 -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 07/22] PCI: histb: Use SET_PCI_ERROR_RESPONSE() when device not found Date: Mon, 11 Oct 2021 23:23:58 +0530 Message-Id: <9cc65876240166eafc256e0b3f0b9af61a125c42.1633972263.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. Use SET_PCI_ERROR_RESPONSE() to set the error response, when a faulty read occurs. This helps unify PCI error response checking and make error check consistent and easier to find. Compile tested only. Signed-off-by: Naveen Naidu --- drivers/pci/controller/dwc/pcie-histb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-histb.c b/drivers/pci/controller/dwc/pcie-histb.c index 86f9d16c50d7..1392732b104f 100644 --- a/drivers/pci/controller/dwc/pcie-histb.c +++ b/drivers/pci/controller/dwc/pcie-histb.c @@ -128,7 +128,7 @@ 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; + SET_PCI_ERROR_RESPONSE(val); return PCIBIOS_DEVICE_NOT_FOUND; } -- 2.25.1