Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2908318pxb; Mon, 18 Oct 2021 04:35:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygKUHRjeBZgoh/ybAZ3mwM+JQY8XxLWdB5tpSwkwUiKNwcxLxjSHSYWYEcvH0R2bij0Mdx X-Received: by 2002:aa7:de8f:: with SMTP id j15mr228023edv.347.1634556903999; Mon, 18 Oct 2021 04:35:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634556903; cv=none; d=google.com; s=arc-20160816; b=RmihsqgARI3r+rZsM7IygqvU0oBoyc3Aca2hmHFk7ULtasWP34vHX8aOZLY7MB0VPF /f5lnOVWqyzjoBzLUmjXCqv+hicAiivmijd8k/HRV5i/n2N/yrcijcdzPOExRTJzrn+D Ed8KggVfhE7FM7HfbXApP9BoJuPiWSjo5chgxST9my15+kwn/371821VWk4AfDKQYM7Z N5kl4zLzbFNa3nS/0AGoKoBzICz81wu+lULLPgt5D7MDQM4f9qvloY0/A8SP0XZdhevG Ve7CBb5//efR4FfB7o7ee5GuF2LlgzHYeRkIcCVoSj6mzHL3/uPVmTqTDrVLMbkabE/M vg+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=C0ObgRrATtrPSK/G4VV3LCyZwiCeoUzdzpzXNcktwlM=; b=zPYJnEV6587k0JT6ZEJa5kXx+iAmW7tgjlchZrEWHbWuSa9CtspXSolVD1Kc3azpsI nkd5DQkjipptZ5cOztdzvMAd2sfqURcrT9GQdnL/R++1D62KX4zx6/6Je+LdxyZf12IQ vKR/Cy+jPOfMqGTngvy7lLfzmzszahoWT2k6CMScWahgYugoGKmnqW8B9iVnH9H5VOvJ m9IYP+3a1OpxzSFYeB/N8JNSpQ7Hcg5xGr4p8/7coMz4oTWxQdSDzx19hGwtdAFNhd3X nvSpcCIF87CPCxQhbDk6Y3hlW7kaY+cPe2UMKKLXreX29qiE9oFkmCGZkTLuBsq2JYu3 sGvg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci26si19391407ejb.57.2021.10.18.04.34.40; Mon, 18 Oct 2021 04:35:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbhJRLe4 (ORCPT + 99 others); Mon, 18 Oct 2021 07:34:56 -0400 Received: from mail-ua1-f45.google.com ([209.85.222.45]:45895 "EHLO mail-ua1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbhJRLez (ORCPT ); Mon, 18 Oct 2021 07:34:55 -0400 Received: by mail-ua1-f45.google.com with SMTP id a17so1378710uax.12; Mon, 18 Oct 2021 04:32:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C0ObgRrATtrPSK/G4VV3LCyZwiCeoUzdzpzXNcktwlM=; b=OPhI2GQUOUf/z6GJ0EyL7zohIqlYAVyq+fBJduNp9Z6Ksc6QUNEmDcYAG3zg0gQGWc ycTgb2uIoJgOZGB3B+lZ70PuMxpoqbUZZxR56V0QZYYL8dZ1+meUPqDWasbR40xl8BAy xsqGtS6AsWt+0eWLJm3FylMWQPSlVL4YMtYCA8bp/z2BpbUDIIomk4MHMdeCHPc5d9w5 O32ThN6h/wJZFJSfZRtLiWdM49LeZ3F7r2OUOtDu8oXwZ2u4n6jxoBSysEINVYmsA2BV WvdMFy5Gbz5oKUWF04HMU/C0Bjk2GnU83qN7MEevFnUZ7NMDLM19HNtQWS2HJDltKCPg JIiQ== X-Gm-Message-State: AOAM5329s8tHM17sJrZeR6qmRbhlMQNe9TGvYjkTFHNURM+TvDMGABXR GwtKhcza1XSVwTb8jzV9cHJb591q598lBw== X-Received: by 2002:ab0:6546:: with SMTP id x6mr24460407uap.1.1634556764247; Mon, 18 Oct 2021 04:32:44 -0700 (PDT) Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com. [209.85.222.46]) by smtp.gmail.com with ESMTPSA id w8sm8845280vkh.36.2021.10.18.04.32.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 04:32:43 -0700 (PDT) Received: by mail-ua1-f46.google.com with SMTP id f4so5100184uad.4; Mon, 18 Oct 2021 04:32:43 -0700 (PDT) X-Received: by 2002:a67:d583:: with SMTP id m3mr26629786vsj.41.1634556763010; Mon, 18 Oct 2021 04:32:43 -0700 (PDT) MIME-Version: 1.0 References: <2544a93bf8725eecbea510e7ddbff6b5a5593c84.1634306198.git.naveennaidu479@gmail.com> In-Reply-To: <2544a93bf8725eecbea510e7ddbff6b5a5593c84.1634306198.git.naveennaidu479@gmail.com> From: Geert Uytterhoeven Date: Mon, 18 Oct 2021 13:32:31 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 14/24] PCI: rcar: Remove redundant error fabrication when device read fails To: Naveen Naidu Cc: Bjorn Helgaas , linux-kernel-mentees@lists.linuxfoundation.org, linux-pci , Linux Kernel Mailing List , Marek Vasut , Yoshihiro Shimoda , Lorenzo Pieralisi , Rob Herring , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , "open list:PCI DRIVER FOR RENESAS R-CAR" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Naveen, On Sat, Oct 16, 2021 at 5:33 PM 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. > > The host controller drivers sets the error response values (~0) and > returns an error when faulty hardware read occurs. But the error > response value (~0) is already being set in PCI_OP_READ and > PCI_USER_READ_CONFIG whenever a read by host controller driver fails. > > Thus, it's no longer necessary for the host controller drivers to > fabricate any error response. > > This helps unify PCI error response checking and make error check > consistent and easier to find. > > Signed-off-by: Naveen Naidu Thanks for your patch! > --- a/drivers/pci/controller/pcie-rcar-host.c > +++ b/drivers/pci/controller/pcie-rcar-host.c > @@ -161,10 +161,8 @@ static int rcar_pcie_read_conf(struct pci_bus *bus, unsigned int devfn, > > ret = rcar_pcie_config_access(host, RCAR_PCI_ACCESS_READ, > bus, devfn, where, val); > - if (ret != PCIBIOS_SUCCESSFUL) { > - *val = 0xffffffff; I don't see the behavior you describe in PCI_OP_READ(), so dropping this will lead to returning an uninitialized value? > + if (ret != PCIBIOS_SUCCESSFUL) > return ret; > - } > > if (size == 1) > *val = (*val >> (BITS_PER_BYTE * (where & 3))) & 0xff; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds