Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1686403pxb; Mon, 11 Oct 2021 10:54:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6RSCNdQwUBP6FxqMx5DtLnWi6GhFEkdrpXYZZn/Pl6Xx8MObwzu1QxnuzjeR73GGUxyyr X-Received: by 2002:a17:90a:de0b:: with SMTP id m11mr441244pjv.39.1633974853367; Mon, 11 Oct 2021 10:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633974853; cv=none; d=google.com; s=arc-20160816; b=K3Lz1g67oAZjf3fJzjhuJry3XK7EWnmsodsonJmFd+saHa7wlLV/m8Bp8DlDMti6rU Pb/WuLRSYQ4hrQTmB8l91pXCE8+SxgejG+pHODaEXX85vxpCwQAknf6TidwKt7DWfY4d yMYS1eBci3KtbfyYLJOmAZjXTw5fTj2nmRZIYy2cxX9WnrLDdq/TkC6DqGC6O7/T17r2 dR1Sl8jeWI2B+W+53svS1UghvCnoToVPBKB9G0vXMJwKEhHGfmkqSGh3CcP2EKisH6Vh Z+CvraMjl/YLkf1hq/4fHKa/SbhQt77FgU2WoexuSsOojxpeAvFAZ0Az1lYNmt9g+s2d Oyzg== 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=/eCkgBabqgzZMoeU3aBzDcQBc9kpvi2Lrj2FSZUU1HE=; b=PJjB8WIJvJ42sFOoqOeUsl6DDfP4wPujfl3YF2mnez0xfFxSXD8wm2elHLjLSfSvBh R4Z3HIs8QFdtQuOYNhkTkcPAZnmcjefaoWREYFmxlWNW++hX2C/q0M55mF1xQg6cO71V UEXzRACO/z9QJpOSuqQh6n72imGkc7LC1MYpBjy89rfdabBCXU7zD5Hm+15+/77d6hnK j2kCbtKKM8aLePwkiflhASVoYiut9tj+pUZoJsHcA0NzS1dQhEUQ4Y2g9J3rMZFfteuW FFAJ5BNbWt5UjdAzECLemxXJf6g/l73vsUqlHhrieHyYYi8mJiYZ03Uy2nc/yhtWB+0M 2uQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="YHh9+t/+"; 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 a3si7442401pgc.115.2021.10.11.10.54.00; Mon, 11 Oct 2021 10:54:13 -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="YHh9+t/+"; 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 S234065AbhJKRxk (ORCPT + 99 others); Mon, 11 Oct 2021 13:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234036AbhJKRxj (ORCPT ); Mon, 11 Oct 2021 13:53:39 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E6A2C061570; Mon, 11 Oct 2021 10:51:39 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id q19so14991198pfl.4; Mon, 11 Oct 2021 10:51:39 -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=/eCkgBabqgzZMoeU3aBzDcQBc9kpvi2Lrj2FSZUU1HE=; b=YHh9+t/+VTBC4s3ntJ//sJ/3/IIr2caH4VqARETHgUCXzk5AJvktpuzm9dE1uaz8JR xfjTOD7aZUQWRjbKXiGclanTMy8FIrFMav39XmnhURFykou9MBA41/JZBhSM+7F4oHLA SP02gBaRgAi+oh7QRziQfMLDPOty5vvLh/RP3ivWQn6Y2sB6qtOy64EiNbYPGwDrncay C+mDaqnykJqY0eIAz2Iz0OW+V+GdMg/ZeNJtD5NKeLGRVzSxqJEP1uOfrPqA3jU0492d fW5eUzfXmMfoZsHp372XsnmCWx3xGZMWZOUwL0mzcXIQAAPaFvY1njIycCdWRu30XZ95 C7iA== 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=/eCkgBabqgzZMoeU3aBzDcQBc9kpvi2Lrj2FSZUU1HE=; b=2EzmkW5e0Wjo2up4hPJxQl1f8YTqMTzkj1T44w7uv8k2sPb/lB+F9wvbfdBAvfSZSo Oo0tE/Kur79YHY2+0fhfxJBnIm9NSn6Xwy25w0/yTZZLORYOF0kT+LQIPNtQ/WJGp2kY q6aSBo02Zn/dO1JVwJvaQJhNRc+QhO7XnOzkN0RHJQ83Ctvk6jQ3kqwAfABDK1JvQpcK IXqY4D/DZTXrIXVNWkrW12mB18W1ymoBLPFpf6LcD3ZJ3lq6ONr2+RvoNVHi69ssaCjG ujJSfUrrDR6GA4Nv/Ra+Ut9UJl1DJoGBD7zZiJKjQRaN+d2iDF9VkZiOr9e3kX6uXHFT Qivg== X-Gm-Message-State: AOAM53363BD9YJAuliIpzQI+4nLUHhS471fWLmS+TEy3RqFWlCtzOK+1 EkzZVXDW5kFfP5UUcEiiGZQ= X-Received: by 2002:aa7:93ca:0:b0:44c:da51:38ac with SMTP id y10-20020aa793ca000000b0044cda5138acmr21437391pff.67.1633974698694; Mon, 11 Oct 2021 10:51:38 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:9f95:848b:7cc8:d852:ad42]) by smtp.gmail.com with ESMTPSA id y6sm124618pjw.2.2021.10.11.10.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 10:51:38 -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, p.zabel@pengutronix.de, Ryder Lee , Jianjun Wang , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Matthias Brugger , linux-mediatek@lists.infradead.org (open list:PCIE DRIVER FOR MEDIATEK), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Subject: [PATCH 05/22] PCI: mediatek: Use SET_PCI_ERROR_RESPONSE() when device not found Date: Mon, 11 Oct 2021 23:21:22 +0530 Message-Id: <01f0c358e3ea05510e04384c3fb5edc577523430.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-mediatek.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index 2f3f974977a3..aa744ccd1a2a 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -369,13 +369,13 @@ static int mtk_pcie_config_read(struct pci_bus *bus, unsigned int devfn, port = mtk_pcie_find_port(bus, devfn); if (!port) { - *val = ~0; + SET_PCI_ERROR_RESPONSE(val); return PCIBIOS_DEVICE_NOT_FOUND; } ret = mtk_pcie_hw_rd_cfg(port, bn, devfn, where, size, val); if (ret) - *val = ~0; + SET_PCI_ERROR_RESPONSE(val); return ret; } -- 2.25.1