From: Kishon Vijay Abraham I <kishon@ti.com>
To: Bjorn Helgaas <helgaas@kernel.org>,
Pankaj Dubey <pankaj.dubey@samsung.com>
Cc: <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
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: Thu, 4 Jan 2018 14:33:44 +0530 [thread overview]
Message-ID: <e89e3ed8-ebb3-8195-44a8-84e6c24d8268@ti.com> (raw)
In-Reply-To: <20171020174108.GK6332@bhelgaas-glaptop.roam.corp.google.com>
Hi Pankaj,
On Friday 20 October 2017 11:11 PM, Bjorn Helgaas 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.
Since you are planning to send a new version, I have one comment below..
>
>> ---
>> 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");
>> +
IMO this should be moved to dw_pcie_setup() in
drivers/pci/dwc/pcie-designware.c which is common to both RC and EP.
>> 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.
>
>> +{
>> + u32 val;
>> +
>> + val = dw_pcie_readl_dbi(pci, PCIE_ATU_VIEWPORT);
>> + if (val == 0xffffffff)
>> + return 1;
Not directly related to this patch but IMO iatu_unroll should be enabled for
all designware core version 4.80?? IMO comparing value in ATU_VIEWPORT to
0xffffffff is not a good indication of whether the platform support iatu unroll
or not.
If this is specific to 4.80, then glue drivers should just pass the designware
core version and if it is 4.80, then iatu unroll should be enabled?
Thanks
Kishon
next prev parent reply other threads:[~2018-01-04 9:03 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
2018-01-04 9:03 ` Kishon Vijay Abraham I [this message]
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=e89e3ed8-ebb3-8195-44a8-84e6c24d8268@ti.com \
--to=kishon@ti.com \
--cc=Joao.Pinto@synopsys.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=jingoohan1@gmail.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®