From: Bjorn Helgaas <helgaas@kernel.org>
To: Pankaj Dubey <pankaj.dubey@samsung.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Kishon Vijay Abraham I <kishon@ti.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Jingoo Han <jingoohan1@gmail.com>,
Joao Pinto <Joao.Pinto@synopsys.com>
Subject: Re: [PATCH] PCI: designware: move dw_pcie_iatu_unroll_enabled to pcie-designware.c
Date: Mon, 6 Nov 2017 13:31:18 -0600 [thread overview]
Message-ID: <20171106193118.GF31930@bhelgaas-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <CAGcde9GiL2U45xRyFnKo=u8RbiMNYNyNJsv3dEkbVum38t1dRg@mail.gmail.com>
On Tue, Oct 24, 2017 at 07:10:55PM +0530, Pankaj Dubey wrote:
> On 20 October 2017 at 23:11, Bjorn Helgaas <helgaas@kernel.org> wrote:
> >
> > On Thu, Oct 12, 2017 at 10:11:08AM +0530, Pankaj Dubey wrote:
> > > IATU unroll feature can be enabled in EP mode as well, so we need to
> > > have this check in pcie-designware-ep.c, so instead of making this
> > > function as static in pcie-desigware-host.c, let's move this in
> > > pcie-designware.c so that both pcie-designware-host.c and
> > > pcie-designware-ep.c can use it.
> > >
> > > Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
> >
> > This is fine with me but I'm looking for an ack from Jingoo and/or Joao.
>
> Jingoo / Joao any comments on this?
Dropping for lack of ack. Please repost if/when we have an ack.
> > > ---
> > > drivers/pci/dwc/pcie-designware-ep.c | 4 ++++
> > > drivers/pci/dwc/pcie-designware-host.c | 11 -----------
> > > drivers/pci/dwc/pcie-designware.c | 11 +++++++++++
> > > drivers/pci/dwc/pcie-designware.h | 1 +
> > > 4 files changed, 16 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/drivers/pci/dwc/pcie-designware-ep.c b/drivers/pci/dwc/pcie-designware-ep.c
> > > index d53d5f1..64803a9 100644
> > > --- a/drivers/pci/dwc/pcie-designware-ep.c
> > > +++ b/drivers/pci/dwc/pcie-designware-ep.c
> > > @@ -314,6 +314,10 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep)
> > > if (ep->ops->ep_init)
> > > ep->ops->ep_init(ep);
> > >
> > > + pci->iatu_unroll_enabled = dw_pcie_iatu_unroll_enabled(pci);
> > > + dev_dbg(dev, "iATU unroll: %s\n",
> > > + pci->iatu_unroll_enabled ? "enabled" : "disabled");
> > > +
> > > epc = devm_pci_epc_create(dev, &epc_ops);
> > > if (IS_ERR(epc)) {
> > > dev_err(dev, "failed to create epc device\n");
> > > diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c
> > > index 81e2157..d3f579e 100644
> > > --- a/drivers/pci/dwc/pcie-designware-host.c
> > > +++ b/drivers/pci/dwc/pcie-designware-host.c
> > > @@ -574,17 +574,6 @@ static struct pci_ops dw_pcie_ops = {
> > > .write = dw_pcie_wr_conf,
> > > };
> > >
> > > -static u8 dw_pcie_iatu_unroll_enabled(struct dw_pcie *pci)
> > > -{
> > > - u32 val;
> > > -
> > > - val = dw_pcie_readl_dbi(pci, PCIE_ATU_VIEWPORT);
> > > - if (val == 0xffffffff)
> > > - return 1;
> > > -
> > > - return 0;
> > > -}
> > > -
> > > void dw_pcie_setup_rc(struct pcie_port *pp)
> > > {
> > > u32 val;
> > > diff --git a/drivers/pci/dwc/pcie-designware.c b/drivers/pci/dwc/pcie-designware.c
> > > index 88abddd..f15da90 100644
> > > --- a/drivers/pci/dwc/pcie-designware.c
> > > +++ b/drivers/pci/dwc/pcie-designware.c
> > > @@ -92,6 +92,17 @@ void __dw_pcie_write_dbi(struct dw_pcie *pci, void __iomem *base, u32 reg,
> > > dev_err(pci->dev, "write DBI address failed\n");
> > > }
> > >
> > > +u8 dw_pcie_iatu_unroll_enabled(struct dw_pcie *pci)
> >
> > I know this is just moved verbatim, but it's more conventional to simply
> > return an int (or possibly bool) for a predicate like this. There's really
> > no point in going out of your way to specify "u8" for the return type.
> >
>
> Ok, it can be done, will wait for comments from Jingoo and or Joao and
> then update.
>
> Thanks,
> Pankaj
>
>
> > > +{
> > > + u32 val;
> > > +
> > > + val = dw_pcie_readl_dbi(pci, PCIE_ATU_VIEWPORT);
> > > + if (val == 0xffffffff)
> > > + return 1;
> > > +
> > > + return 0;
> > > +}
> > > +
> > > static u32 dw_pcie_readl_ob_unroll(struct dw_pcie *pci, u32 index, u32 reg)
> > > {
> > > u32 offset = PCIE_GET_ATU_OUTB_UNR_REG_OFFSET(index);
> > > diff --git a/drivers/pci/dwc/pcie-designware.h b/drivers/pci/dwc/pcie-designware.h
> > > index e5d9d77..8d6829c 100644
> > > --- a/drivers/pci/dwc/pcie-designware.h
> > > +++ b/drivers/pci/dwc/pcie-designware.h
> > > @@ -242,6 +242,7 @@ int dw_pcie_prog_inbound_atu(struct dw_pcie *pci, int index, int bar,
> > > void dw_pcie_disable_atu(struct dw_pcie *pci, int index,
> > > enum dw_pcie_region_type type);
> > > void dw_pcie_setup(struct dw_pcie *pci);
> > > +u8 dw_pcie_iatu_unroll_enabled(struct dw_pcie *pci);
> > >
> > > static inline void dw_pcie_writel_dbi(struct dw_pcie *pci, u32 reg, u32 val)
> > > {
> > > --
> > > 2.7.4
> > >
next prev parent reply other threads:[~2017-11-06 19:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171012044055epcas1p44b2e6b7cc21d42319529a518197aca9f@epcas1p4.samsung.com>
2017-10-12 4:41 ` Pankaj Dubey
2017-10-20 17:41 ` Bjorn Helgaas
2017-10-24 13:40 ` Pankaj Dubey
2017-11-06 19:31 ` Bjorn Helgaas [this message]
2018-01-04 9:03 ` Kishon Vijay Abraham I
2017-12-21 16:34 ` Jingoo Han
2017-12-28 9:52 ` Pankaj Dubey
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=20171106193118.GF31930@bhelgaas-glaptop.roam.corp.google.com \
--to=helgaas@kernel.org \
--cc=Joao.Pinto@synopsys.com \
--cc=bhelgaas@google.com \
--cc=jingoohan1@gmail.com \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=pankaj.dubey@samsung.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®