From: Lad Prabhakar <prabhakar.csengg@gmail.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Kishon Vijay Abraham I <kishon@ti.com>,
Marek Vasut <marek.vasut+renesas@gmail.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
linux-pci@vger.kernel.org
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andrew Murray <andrew.murray@arm.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-renesas-soc@vger.kernel.org,
Chris Paterson <Chris.Paterson2@renesas.com>,
Frank Rowand <frowand.list@gmail.com>,
Gustavo Pimentel <gustavo.pimentel@synopsys.com>,
Jingoo Han <jingoohan1@gmail.com>,
Simon Horman <horms@verge.net.au>,
Shawn Lin <shawn.lin@rock-chips.com>,
Tom Joseph <tjoseph@cadence.com>,
Heiko Stuebner <heiko@sntech.de>,
linux-rockchip@lists.infradead.org,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [v3 2/6] PCI: rcar: Fix calculating mask for PCIEPAMR register
Date: Wed, 8 Jan 2020 16:22:07 +0000 [thread overview]
Message-ID: <20200108162211.22358-3-prabhakar.mahadev-lad.rj@bp.renesas.com> (raw)
In-Reply-To: <20200108162211.22358-1-prabhakar.mahadev-lad.rj@bp.renesas.com>
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.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
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 d5568db27efc..c76a92a8b72e 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;
rcar_pci_write_reg(base, mask << 7, PCIEPAMR(win));
if (!host) {
--
2.20.1
next prev parent reply other threads:[~2020-01-08 16:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 16:22 [v3 0/6] Add support for PCIe controller to work in endpoint mode on R-Car SoCs Lad Prabhakar
2020-01-08 16:22 ` [v3 1/6] PCI: rcar: Preparation for adding endpoint support Lad Prabhakar
2020-01-08 16:22 ` Lad Prabhakar [this message]
2020-01-08 16:22 ` [v3 3/6] PCI: endpoint: Add support to handle multiple base for mapping outbound memory Lad Prabhakar
2020-01-09 6:27 ` Kishon Vijay Abraham I
2020-01-10 18:08 ` Lad, Prabhakar
2020-01-13 8:58 ` Kishon Vijay Abraham I
2020-01-14 8:09 ` Lad, Prabhakar
2020-01-08 16:22 ` [v3 4/6] dt-bindings: PCI: rcar: Add bindings for R-Car PCIe endpoint controller Lad Prabhakar
2020-01-13 21:22 ` Rob Herring
2020-01-14 8:11 ` Lad, Prabhakar
2020-01-21 17:57 ` Lad, Prabhakar
2020-01-22 8:15 ` Kishon Vijay Abraham I
2020-01-30 20:54 ` Lad, Prabhakar
2020-01-08 16:22 ` [v3 5/6] PCI: rcar: Add support for rcar PCIe controller in endpoint mode Lad Prabhakar
2020-01-16 5:55 ` Kishon Vijay Abraham I
2020-01-08 16:22 ` [v3 6/6] misc: pci_endpoint_test: Add Device ID for RZ/G2E PCIe controller Lad Prabhakar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200108162211.22358-3-prabhakar.mahadev-lad.rj@bp.renesas.com \
--to=prabhakar.csengg@gmail.com \
--cc=Chris.Paterson2@renesas.com \
--cc=andrew.murray@arm.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=gustavo.pimentel@synopsys.com \
--cc=heiko@sntech.de \
--cc=horms@verge.net.au \
--cc=jingoohan1@gmail.com \
--cc=kishon@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=magnus.damm@gmail.com \
--cc=marek.vasut+renesas@gmail.com \
--cc=mark.rutland@arm.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh+dt@kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=tjoseph@cadence.com \
--cc=will@kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).