From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,FAKE_REPLY_C,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72E7DC2BA83 for ; Wed, 12 Feb 2020 14:04:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 46C7A2082F for ; Wed, 12 Feb 2020 14:04:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WCRA5WLD"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="ybhA5sw1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46C7A2082F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=RjEiD3LO6FIEhQOVfl+s1Yj2JFofRSOwIBJ/Pq1RooE=; b=WCRA5WLDfIJCa0 QNiZwVu1jSdBimi68XwiNP1XtiU/AdG4mfRk1v102kLigAgmdPiYg4kEzUN9hDs8Pvj6OHBT+Bq19 dXjFJMn0iP3P/OjF784vs91Kt7qRvyouD9xCsU/ae5JQYYkqo6eIbIN/DcigQLzwdyYK+VFEqhTb9 rM12GlHnfvuFWMVRaDXZ/s4rvvQe67EkvFiXKs4xlnccsRiMaUWgsznFr0rwWxVTz+9wP6H1+Nw0d z3B6C/WWPPrAx48jqeQj2XiLlLJd7caYjQm+HTLyaRokSQVtLG6Z9sff0QVPOPTTAYNaUI5p1aRfz eXegm8jhmMkXEFUD0JHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1sd4-00076Q-Tg; Wed, 12 Feb 2020 14:04:38 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1sd2-00075o-1R; Wed, 12 Feb 2020 14:04:37 +0000 Received: from localhost (173-25-83-245.client.mchsi.com [173.25.83.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7839A20724; Wed, 12 Feb 2020 14:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581516275; bh=o9BHn+9tET4BD0g8kAYLMhwyFEa94It7nBIG65XyVow=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ybhA5sw1XC0h+W6Zeya0JSyVEIzLi+xMgWYE+Dwss2uAZuddrdzio//rz6eimr3jf 5fLzed0lzlgiW1e3gJzM4JGdbsZRLPLhAOBWjt9aGVTFpyj7hLZk6qW6Tax2jy+LJS zVOS8XI3s1D5+v5kCab07CmDWyahtMIe3CLy9eEY= Date: Wed, 12 Feb 2020 08:04:34 -0600 From: Bjorn Helgaas To: Lad Prabhakar Subject: Re: [PATCH v4 2/6] PCI: rcar: Fix calculating mask for PCIEPAMR register Message-ID: <20200212140434.GA129189@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200208183641.6674-3-prabhakar.mahadev-lad.rj@bp.renesas.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200212_060436_103621_030906C8 X-CRM114-Status: GOOD ( 17.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Heiko Stuebner , Catalin Marinas , Shawn Lin , Will Deacon , Marek Vasut , Lorenzo Pieralisi , Kishon Vijay Abraham I , linux-rockchip@lists.infradead.org, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, Arnd Bergmann , Lad Prabhakar , Rob Herring , linux-arm-kernel@lists.infradead.org, Jingoo Han , Yoshihiro Shimoda , linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Greg Kroah-Hartman , Andrew Murray , Gustavo Pimentel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Feb 08, 2020 at 06:36:37PM +0000, Lad Prabhakar wrote: > The mask value was calculated incorrectly for PCIEPAMR register if the > size was less the 128bytes, this patch fixes the above by adding a check > on size. s/less the/less than/ s/128bytes,/128 bytes./ s/this patch fixes the above/Fix this issue/ > Signed-off-by: Lad Prabhakar > --- > drivers/pci/controller/pcie-rcar.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/pcie-rcar.c b/drivers/pci/controller/pcie-rcar.c > index d5568db..c76a92a 100644 > --- a/drivers/pci/controller/pcie-rcar.c > +++ b/drivers/pci/controller/pcie-rcar.c > @@ -71,7 +71,7 @@ void rcar_pcie_set_outbound(int win, void __iomem *base, > /* Setup PCIe address space mappings for each resource */ > resource_size_t res_start; > resource_size_t size; > - u32 mask; > + u32 mask = 0x0; > > rcar_pci_write_reg(base, 0x00000000, PCIEPTCTLR(win)); > > @@ -80,7 +80,8 @@ void rcar_pcie_set_outbound(int win, void __iomem *base, > * keeps things pretty simple. > */ > size = resource_size(res); > - mask = (roundup_pow_of_two(size) / SZ_128) - 1; > + if (size > 128) > + mask = (roundup_pow_of_two(size) / SZ_128) - 1; I would put the "mask = 0x0" right here so it's all in one place, i.e., if (size > 128) mask = (roundup_pow_of_two(size) / SZ_128) - 1; else mask = 0x0; > rcar_pci_write_reg(base, mask << 7, PCIEPAMR(win)); > > if (!host) { > -- > 2.7.4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel