Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1481646pxb; Sat, 16 Oct 2021 11:02:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPvzDQ+r6ro5XziDPJ2IrqMd2jwTf4n+wJZPsSqJPC1hVbbYjg/+3WOkvWXboDH/qWyY1e X-Received: by 2002:a17:902:784c:b0:138:f4e5:9df8 with SMTP id e12-20020a170902784c00b00138f4e59df8mr17674609pln.14.1634407369111; Sat, 16 Oct 2021 11:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634407369; cv=none; d=google.com; s=arc-20160816; b=k/pjCh9jwAWMqjlKf/nMCpZidzEFcp1396zfL1QvbHypbOQya82UYY2vU69V9D02TO FCS2CUHm2PERSGYu7y26an9dkwQupQxbgOOMygxfNzv+YqXmuOAcn1ZYdV3rkw33hhOD IJpfGFrX4ymeKSa0kJAEdnbsJ1UHPXbzc+ClnkutFnZBGKf5U4nF9I6+zltaNNjdaBLE BUvNErKLEGLoNoo4pTADpuQR/aa0l1dBT4iDx6pANT5dy2PqReeuGohcFm9XGKZXqb9b 6/XiuSq0Rf9t5TvNW1M7fb66q3Y3ZaxtXpW+JQlojXj2l52Jr29etrzIEuZTg75Cd6hv QUuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wSBkt9zYHPwlUZ1/2+m7OdxEgpbgJqT9W9WPrNpsTT4=; b=R5lvmbqnPHYIotvsjqRA+Mr+0ZON8pgWY4R4jAOjDlYoVLKaBVECbq6ml8YEuiJIKb R4F4mQXOwNFnIENmHNuLq3lhEl2BLvjikFx6cQFZuf7HVeX8L0DHYu0HYUXF3xGvWW4f kQAAfxE7qdwWesALy5GSS8VTnYkylrHg0bEu4IlG9noFGie3hf7Vkrlg7CVW4f6D9U16 EmEr7N8J/NSizC5lJj+Y39oPRgfrSrpDQWRdil4HrkYnoqO1C6JpScffuvOUcnry/xhh ITS8uxiYsYmomCziTek8Pn6DMtRPszK8Si7fPfMAMXUzJC1w+/kj6nwOOob3zzU3dH2C cOlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cd4+4EBv; 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 l17si12034875pgk.438.2021.10.16.11.02.26; Sat, 16 Oct 2021 11:02:49 -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=cd4+4EBv; 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 S236821AbhJOOyb (ORCPT + 99 others); Fri, 15 Oct 2021 10:54:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230471AbhJOOya (ORCPT ); Fri, 15 Oct 2021 10:54:30 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ED12C061570; Fri, 15 Oct 2021 07:52:24 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so7491313pjb.0; Fri, 15 Oct 2021 07:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wSBkt9zYHPwlUZ1/2+m7OdxEgpbgJqT9W9WPrNpsTT4=; b=cd4+4EBvunAe+muc+Kj5ssmqyR/v1gZu4XoQ6Sfq9tyPLjTs++rfTRLjSaELmun2aG i2b1vNDWdhdMIe4twlANpIfG+N1djG5XczwFb7zy0SDUYl8BnoY9yAZR6aXN45UOSihz kNmgqw+6cBc3qqIwrJQXbvYq65haGMFePkaDWouycHNRp5eIlji1MDo/FPnc7ltQduvY ++o8BVa/VsU+VHZ+rkavg0FfKNu8KjxmzutwKyau3N/OvKJeAUMCarzPZndNMDlDPk7c TsCqLExSFpMLC+DW9Njm5d9Y6JG5J9BNO43qFpFeox48Vu3QKziSLticwSfTr2rzRBBd TpoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wSBkt9zYHPwlUZ1/2+m7OdxEgpbgJqT9W9WPrNpsTT4=; b=CDFU6/Sv0P3WwcKuwuc43irz1Hn1ZpEjhI2krW0mIh65PqwKRKUloS+nHrbC3ENXil rg+mxQ+ojAOSjNPllgnHQOJ5veorXo75tb1LAwcIocBEs0Dbgl8qh/01NHmC/7YhgZH1 j8mGM5EhX7vWV00mRSTU7SwDtFPZ7MU4LQXBK42m5EzdHSuYl3Hhj5ZT/EKpPYb6eoOP Zt3EQJRWQ78A8yKev2Zy9cmLJOE6pfbWntGIZGtw7OXvTyzIJd2ww8/otrsn3I1/7K9d 5acFRqCGI71gOl5IQuHbMAlDz+mgtaLuZEyB2fyvuzBuvbmxj9ieZ80Yn8dwQ8I69W0b J4uQ== X-Gm-Message-State: AOAM5313f0Hn5yWBJbID2w5pUNpq5CLs+8G/I12Erna4+0WjnacllRvj KlYApGhq7WkUSj/krAV+SDg= X-Received: by 2002:a17:90a:5d89:: with SMTP id t9mr5655713pji.21.1634309543625; Fri, 15 Oct 2021 07:52:23 -0700 (PDT) Received: from theprophet ([2406:7400:63:4806:9a51:7f4b:9b5c:337a]) by smtp.gmail.com with ESMTPSA id b8sm5548190pfm.65.2021.10.15.07.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:52:23 -0700 (PDT) Date: Fri, 15 Oct 2021 20:22:10 +0530 From: Naveen Naidu To: bhelgaas@google.com Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Derrick , Nirmal Patel , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Subject: Re: [PATCH v2 17/24] PCI: vmd: Use RESPONSE_IS_PCI_ERROR() to check read from hardware Message-ID: <20211015145210.opb72brioa5tcbtw@theprophet> References: <0da4dfe7642bf89d954c7062a40566bf28d94da1.1634306198.git.naveennaidu479@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0da4dfe7642bf89d954c7062a40566bf28d94da1.1634306198.git.naveennaidu479@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/10, Naveen Naidu wrote: > 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 RESPONSE_IS_PCI_ERROR() to check the response we get when we read > data from hardware. > > This helps unify PCI error response checking and make error checks > consistent and easier to find. > > Reviewed-by: Jonathan Derrick > Signed-off-by: Naveen Naidu > --- > drivers/pci/controller/vmd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c > index a5987e52700e..db81bc4cfe8c 100644 > --- a/drivers/pci/controller/vmd.c > +++ b/drivers/pci/controller/vmd.c > @@ -538,7 +538,7 @@ static int vmd_get_phys_offsets(struct vmd_dev *vmd, bool native_hint, > int ret; > > ret = pci_read_config_dword(dev, PCI_REG_VMLOCK, &vmlock); > - if (ret || vmlock == ~0) > + if (ret || RESPONSE_IS_PCI_ERROR(&vmlock)) > return -ENODEV; > > if (MB2_SHADOW_EN(vmlock)) { > -- > 2.25.1 > Jonathan, I have added your Reviewed-by tag from the first version [1] of the patch series, since this patch did not change in the version 2. I hope that's okay. If not, I really apologize for that and can you please let me know how to rectify that mistake. [1]: https://lore.kernel.org/linux-pci/f3aca934-7dee-b294-ad3c-264e773eddda@linux.dev/T/#u Thanks, Naveen