From: Bjorn Helgaas <helgaas@kernel.org>
To: Jan Luebbe <jlu@pengutronix.de>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Andrew Lunn <andrew@lunn.ch>, Jason Cooper <jason@lakedaemon.net>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@pengutronix.de,
Gregory Clement <gregory.clement@free-electrons.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] PCI: mvebu: Check DRAM window size
Date: Mon, 6 Nov 2017 13:17:49 -0600 [thread overview]
Message-ID: <20171106191749.GC31930@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <20171005211650.GZ25517@bhelgaas-glaptop.roam.corp.google.com>
On Thu, Oct 05, 2017 at 04:16:50PM -0500, Bjorn Helgaas wrote:
> On Mon, Sep 25, 2017 at 06:56:58PM -0500, Bjorn Helgaas wrote:
> > On Mon, Aug 28, 2017 at 05:25:17PM +0200, Jan Luebbe wrote:
> > > The sum of the DRAM windows may exceed 4GB (at least on Armada XP).
> > > Return an error in that case.
> > >
> > > Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> >
> > Looking for an ack from Thomas or Jason before applying this...
>
> Ping, I think I'm stil waiting for an ack for this. Or did I miss it?
I'm dropping this. Please repost it with the appropriate acks if it's
still needed.
> > > ---
> > > drivers/pci/host/pci-mvebu.c | 27 ++++++++++++++++++++++-----
> > > 1 file changed, 22 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
> > > index f353a6eb2f01..5d74af81d104 100644
> > > --- a/drivers/pci/host/pci-mvebu.c
> > > +++ b/drivers/pci/host/pci-mvebu.c
> > > @@ -206,10 +206,10 @@ static void mvebu_pcie_set_local_dev_nr(struct mvebu_pcie_port *port, int nr)
> > > * BAR[0,2] -> disabled, BAR[1] -> covers all DRAM banks
> > > * WIN[0-3] -> DRAM bank[0-3]
> > > */
> > > -static void mvebu_pcie_setup_wins(struct mvebu_pcie_port *port)
> > > +static int mvebu_pcie_setup_wins(struct mvebu_pcie_port *port)
> > > {
> > > const struct mbus_dram_target_info *dram;
> > > - u32 size;
> > > + u64 size;
> > > int i;
> > >
> > > dram = mv_mbus_dram_info();
> > > @@ -252,19 +252,32 @@ static void mvebu_pcie_setup_wins(struct mvebu_pcie_port *port)
> > > if ((size & (size - 1)) != 0)
> > > size = 1 << fls(size);
> > >
> > > + if (size > 0x100000000) {
> > > + dev_err(&port->pcie->pdev->dev,
> > > + "Could not configure DRAM window (too large): 0x%llx\n",
> > > + size);
> > > +
> > > + return -EINVAL;
> > > + }
> > > +
> > > /* Setup BAR[1] to all DRAM banks. */
> > > mvebu_writel(port, dram->cs[0].base, PCIE_BAR_LO_OFF(1));
> > > mvebu_writel(port, 0, PCIE_BAR_HI_OFF(1));
> > > mvebu_writel(port, ((size - 1) & 0xffff0000) | 1,
> > > PCIE_BAR_CTRL_OFF(1));
> > > +
> > > + return 0;
> > > }
> > >
> > > -static void mvebu_pcie_setup_hw(struct mvebu_pcie_port *port)
> > > +static int mvebu_pcie_setup_hw(struct mvebu_pcie_port *port)
> > > {
> > > u32 cmd, mask;
> > > + int ret;
> > >
> > > /* Point PCIe unit MBUS decode windows to DRAM space. */
> > > - mvebu_pcie_setup_wins(port);
> > > + ret = mvebu_pcie_setup_wins(port);
> > > + if (ret)
> > > + return ret;
> > >
> > > /* Master + slave enable. */
> > > cmd = mvebu_readl(port, PCIE_CMD_OFF);
> > > @@ -277,6 +290,8 @@ static void mvebu_pcie_setup_hw(struct mvebu_pcie_port *port)
> > > mask = mvebu_readl(port, PCIE_MASK_OFF);
> > > mask |= PCIE_MASK_ENABLE_INTS;
> > > mvebu_writel(port, mask, PCIE_MASK_OFF);
> > > +
> > > + return 0;
> > > }
> > >
> > > static int mvebu_pcie_hw_rd_conf(struct mvebu_pcie_port *port,
> > > @@ -882,7 +897,9 @@ static int mvebu_pcie_setup(int nr, struct pci_sys_data *sys)
> > >
> > > if (!port->base)
> > > continue;
> > > - mvebu_pcie_setup_hw(port);
> > > + err = mvebu_pcie_setup_hw(port);
> > > + if (err)
> > > + return 0;
> > > }
> > >
> > > return 1;
> > > --
> > > 2.11.0
> > >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2017-11-06 19:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-28 15:25 [PATCH 0/2] fix 4GB DRAM window support on mvebu Jan Luebbe
2017-08-28 15:25 ` [PATCH 1/2] bus: mbus: fix window size calculation for 4GB windows Jan Luebbe
2017-09-19 14:43 ` Gregory CLEMENT
2017-09-20 16:37 ` Uwe Kleine-König
2017-08-28 15:25 ` [PATCH 2/2] PCI: mvebu: Check DRAM window size Jan Luebbe
2017-09-25 23:56 ` Bjorn Helgaas
2017-10-05 21:16 ` Bjorn Helgaas
2017-11-06 19:17 ` Bjorn Helgaas [this message]
2017-08-28 15:30 ` [RFC] ARM: Orion: " Jan Luebbe
2017-08-28 15:51 ` Andrew Lunn
2017-08-30 20:07 ` [PATCH 0/2] fix 4GB DRAM window support on mvebu Bjorn Helgaas
2017-08-31 8:11 ` Gregory CLEMENT
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=20171106191749.GC31930@bhelgaas-glaptop.roam.corp.google.com \
--to=helgaas@kernel.org \
--cc=andrew@lunn.ch \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=jlu@pengutronix.de \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=thomas.petazzoni@free-electrons.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
all inboxes | Powered by JetHome®