Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1697280pxb; Mon, 11 Oct 2021 11:06:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxR6PCiuGlnwGPwtTxMuTGFvrxYqQG6jaQqaKMYf2OeNmdBIOyNJE9y7QAjqMTCha0fS7m X-Received: by 2002:a17:906:4895:: with SMTP id v21mr28136687ejq.299.1633975605005; Mon, 11 Oct 2021 11:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633975604; cv=none; d=google.com; s=arc-20160816; b=wbjyK2EXp2/ewtetqej8Z22MXwKAjBTKwXsmV1616MWKB8Ty9Yz+jDyOQACviCK94K gX6p1jWoG8ljbV64/2sRToS/JUqqlgCbxYTWNcFnEAjHBQXjE5JRTRBjNvBO4osj5trt Wy8wXcVqYrPWj73PqPlfZ6xsRdE8dzYtux9786nXLmew4+Pk293tz3PRQ2fk93naFH7y QHl7uhToMueRHvJa61EwU54w0RAqxtqesU7DH6IqEmuFbFI2g60hda4WbT7Dh5LxntfC cif9VxrS7P5mg1jEnr7xVKkIA9v5EAV9D4x4lXZAvvK7u9Zdo+YzE1sdKvmi/ZpD1Oyr ma7g== 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=uTfOlYjXNBEAayJpHetBNlZe2ZqNE3iJj+P39moFg1o=; b=TejyA9FKNiP6WrFIbC4HiKFZma+Yhnn4qRPb/yG0NulovVSuRtnNHzj/vy77ZW0oRv 4gKarJzOXQSj/xo1yG7S/IjjjztZd52xsPGC+h5p8+yD9mCG2mQGO1QFrJsuqb1c/2WG fLDyiUqM134urif2RyCi4tGw0JHqcUrjf/fbG1Q4tSmg4wGLR4m768GZLoGJpuEiugfc caFnM8ZNFpV7IL+d3wdsKDwuydFfK5dBZWI0RJC2SimAUCR9qMYHqtUdgyflqeSwBA6r WAImQXgSwp6adyzfMdQeYdut2VQsmGquFblIqWNbhvpIW7KN5KBzKl/WEYIvP5/oTbD0 iA6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CSXN0d+R; 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 dz18si19577416edb.250.2021.10.11.11.06.18; Mon, 11 Oct 2021 11:06:44 -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=CSXN0d+R; 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 S234281AbhJKSFx (ORCPT + 99 others); Mon, 11 Oct 2021 14:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbhJKSFv (ORCPT ); Mon, 11 Oct 2021 14:05:51 -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 79BD3C061570; Mon, 11 Oct 2021 11:03:51 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id r2so11522752pgl.10; Mon, 11 Oct 2021 11:03:51 -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=uTfOlYjXNBEAayJpHetBNlZe2ZqNE3iJj+P39moFg1o=; b=CSXN0d+RX5gVlA5Q6T781+097P6ScH10C+hQduS/VAIjDhz85Wkn5oq4rZtV4nfhI/ nA7yRKHyjET+4LZoq5kDrIEZ14S24AaOC39nfFj3G85zXmqKjmUJ6aAnSvDgQjdjcdvr TW8t0fDtHViTExg8YHlvXF11jbrY/+JdLD5lc9Ohb/4RTZRB7fP9d7sANa0PcJH7gIDj k6iXlH7fyyhtKawMwvJoCpo4EvBqo6VJLX3bs8kjrC3GXmUW17j3xgcT4miUwKa5AED5 39GsmDT6IeglFJIKalOSnZqiu6V5/ZV+dYoVHjRwmgtFIRAKg0D9AAh0S3V5MF37cCmb HcOw== 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=uTfOlYjXNBEAayJpHetBNlZe2ZqNE3iJj+P39moFg1o=; b=WGK2orXrEAL3iwtQWrIEh5R9iuDE7K3BV9AxMujQsU5CDP9YfH3+eAU37w3+2+LjnI RC7G4vrsUahOq5iU0KvFg8SRNmzUjnAAs5naeDsqiiYVDcB/pKRvMomkP2yD+M0/mm9d 43zXGrCi5ogtz+r7l07n8RR7Xx3Ola9d6nvL6ZKdG04vWrVIrBLaZo4XStkRkDLsgnWH P6XqwC+DhygX656Qks6009CcugJINLOS44vkpc1duxI2/bkt2VOF5K7/N4NtcImyqMiR 8hyvp43vZKrz5v2bMlRabLKdceDGE2zqXA/1ca+fby7g6IltxMwQRbFdfVGqI6EIP5BK d5WQ== X-Gm-Message-State: AOAM531p4uwShAh5xGvu4AvWKTjGIrMo7J6wXFV5QsIdroolmSBtHxFY kYtTZO6V6JP4H1M8hvztez1PZxa9Nxx2uyGo X-Received: by 2002:a62:6206:0:b0:44c:bc1f:aa5a with SMTP id w6-20020a626206000000b0044cbc1faa5amr26730462pfb.5.1633975430947; Mon, 11 Oct 2021 11:03:50 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:9f95:848b:7cc8:d852:ad42]) by smtp.gmail.com with ESMTPSA id d12sm8711637pgf.19.2021.10.11.11.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 11:03:50 -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 Lin , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Heiko Stuebner , linux-rockchip@lists.infradead.org (open list:PCIE DRIVER FOR ROCKCHIP), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Rockchip SoC support) Subject: [PATCH 13/22] PCI: rockchip: Use SET_PCI_ERROR_RESPONSE() when device not found Date: Mon, 11 Oct 2021 23:32:57 +0530 Message-Id: <11cbd327beeed70c6db69aad4eeafe28ade4ecb3.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/pcie-rockchip-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c index c52316d0bfd2..f5d718700d59 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -222,7 +222,7 @@ static int rockchip_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, struct rockchip_pcie *rockchip = bus->sysdata; if (!rockchip_pcie_valid_device(rockchip, bus, PCI_SLOT(devfn))) { - *val = 0xffffffff; + SET_PCI_ERROR_RESPONSE(val); return PCIBIOS_DEVICE_NOT_FOUND; } -- 2.25.1