Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1695646pxb; Mon, 11 Oct 2021 11:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTEO2BArKR7ZRbdtDtU0IqgBtg1B1j+QpFEG04TvzXU1lQ6KoTKRlDz8i6VFUmWiqj+ffs X-Received: by 2002:a17:906:c009:: with SMTP id e9mr27594536ejz.509.1633975493059; Mon, 11 Oct 2021 11:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633975493; cv=none; d=google.com; s=arc-20160816; b=lHXjI6/+3DpzF0i0JHyL/xyY5efO1s4umAKZDCbFNJihERi+t6FhW4QtMlHbIFIk/8 EaJANUsFWFhwq9wIwt4XcaBds3w1JJWEtOL4IY9Bf/z0YMqTuoUZapBthVeJVcScpeCr kCc7D9UfUgqpXrpV3OFVdUaNPu+wvUcTMeValp91hulBBkq1Xyp6kcBGZqTaRXisSqog LHBbomipjRrJKgCMZkf/bvjiTZp3m2j2U2WwRBLfdn8EtQvRlH4cC1agZhgfkbHCmG77 YLLBfK15C8doOanSifFt1h6bqChiBYMt2Qp+YPs5x9O8OzGWKlhUcHy5ev+xWCZ05fi9 n9Aw== 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=06w4bvyU3F5XYJfjaevgNf8iCsWjF2RGPbd38EHlRsE=; b=HizPRro4RPtf1JpIqs6ytb0u+JJpTogoUty12H8l/LofvLYoSpicf/lktYbCYzrRsP jlwui+hVhy3jESwa5USpglSty49bKgWwe/PZsW7XaNdcmoy8dDmESYsTt+PrSQyPPZqR O5GzSue8J8I/+N/2gwk6PPP1G96FsAcwEk1bTtvjbi+z5RmugJ1iN+z9zzVGbMiU7JSg T0NubA6D4r+KdlYH93H0MHSAP5Teyv83Up/k5RC7wdmv1kOnMuvmQBuaJlcXnW/baGQ1 BDqVrOg8t+nmvAMFHK3Hxnb8FRtccNC3joS/TqE/LtMfV7lprGWUJj/0Pps/QLJcw9wO 98Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ewhaVOVE; 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 b20si2956860ejq.703.2021.10.11.11.04.28; Mon, 11 Oct 2021 11:04:53 -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=ewhaVOVE; 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 S234040AbhJKSCa (ORCPT + 99 others); Mon, 11 Oct 2021 14:02:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232673AbhJKSC3 (ORCPT ); Mon, 11 Oct 2021 14:02:29 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB14C061570; Mon, 11 Oct 2021 11:00:29 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id oa4so13126182pjb.2; Mon, 11 Oct 2021 11:00:29 -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=06w4bvyU3F5XYJfjaevgNf8iCsWjF2RGPbd38EHlRsE=; b=ewhaVOVE3Ut21et20HX9bpL1dBjGMy3f7hQ3DwpDRkqgOicXp9ZoVxk63UAjCISdVW uINmSYUK71oj9tD88th+1BNaOBErxbqvn5DP/5bAqBzvn3VWHBc+MKR3O5UiFcLJdCu0 DU1VAnPejnU7bKuvSjzVXqnFJ6IMlao+lMvDCQjNNeI/6SXeKq1q4ZEAeOwSfCH+ROtQ YmrDcj6Yrmf6VbDXgVIK8X1m0UW4IShYFugP69VsnQCseLJbF47XzeFw60v74kjRYyow Xs46ZyAezSIRbYtUQX/OqWuxzXQaE0aE7UTivfDSFVg/83QmMLk65cgoVWopJsZfN1BG DnUQ== 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=06w4bvyU3F5XYJfjaevgNf8iCsWjF2RGPbd38EHlRsE=; b=4KT0uFbQw4aYzsA2Xya4xrtLuxqXQrbeyA2fTUe7cRpMBEc819eK9N6LbaLYQ8f7Cc aEXxPSZNep/hnEUCjuFyvEgNN2sAVGYnMAx6niSNd27UsONSyS678y8VcsYlaQFg7zC7 5JRazkf/djgQrP0IkudeuFPv8q+yWd+MR8vyLWSSvOJvJ0Mz5+U+JfCGUjXX2lEynIfZ 1pIFSkN6HQKk2FAnDVnDxSEnWQgxMh0tSZqchWT9DFqyOQ7tXiEdayOobrbQ+TE4jCKG 7baDd6sBjOXI8widGXpPdCXCzk6RfH2hy4eceMHBwZb65LihdF9HUPEVPwkPmBT+jbzQ Ck6Q== X-Gm-Message-State: AOAM530obtSGznEpWbyKco+2wu1Z/Zrin47omMKHSI1vfBkHvG3VQM+E kuDOqvWCZplTHCYhe4+/tgfGOLV30qIILpNt X-Received: by 2002:a17:90a:5894:: with SMTP id j20mr527868pji.82.1633975228856; Mon, 11 Oct 2021 11:00:28 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:9f95:848b:7cc8:d852:ad42]) by smtp.gmail.com with ESMTPSA id z9sm116702pji.42.2021.10.11.11.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 11:00:28 -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, thomas.petazzoni@bootlin.com, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/22] PCI: mvebu: Use SET_PCI_ERROR_RESPONSE() when device not found Date: Mon, 11 Oct 2021 23:30:00 +0530 Message-Id: <147d72149c4863be53b6044e8db6772c1b450bc0.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. Signed-off-by: Naveen Naidu --- drivers/pci/controller/pci-mvebu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pci-mvebu.c b/drivers/pci/controller/pci-mvebu.c index ed13e81cd691..51d61194a31a 100644 --- a/drivers/pci/controller/pci-mvebu.c +++ b/drivers/pci/controller/pci-mvebu.c @@ -654,7 +654,7 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, port = mvebu_pcie_find_port(pcie, bus, devfn); if (!port) { - *val = 0xffffffff; + SET_PCI_ERROR_RESPONSE(val); return PCIBIOS_DEVICE_NOT_FOUND; } @@ -664,7 +664,7 @@ static int mvebu_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, size, val); if (!mvebu_pcie_link_up(port)) { - *val = 0xffffffff; + SET_PCI_ERROR_RESPONSE(val); return PCIBIOS_DEVICE_NOT_FOUND; } -- 2.25.1