From: Niklas Cassel <niklas.cassel@axis.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: <linux-omap@vger.kernel.org>, <linux-pci@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
Pratyush Anand <pratyush.anand@gmail.com>
Subject: Re: [PATCH 0/2] PCI: dwc: convert remaining dbi read/writes to dw_pcie_readX_dbi/dw_pcie_writeX_dbi
Date: Mon, 4 Sep 2017 18:10:55 +0200 [thread overview]
Message-ID: <90a9daea-d962-07a6-6c5d-be7a16810123@axis.com> (raw)
In-Reply-To: <20170815223946.GQ32525@bhelgaas-glaptop.roam.corp.google.com>
On 08/16/2017 12:39 AM, Bjorn Helgaas wrote:
> [+cc Kishon, Pratyush]
>
> On Fri, Jul 14, 2017 at 02:07:33PM +0200, Niklas Cassel wrote:
>> Since the introduction of the dw_pcie_readX_dbi/dw_pcie_writeX_dbi macros,
>> most dw_pcie_read(pci->dbi_base, ..)/dw_pcie_write(pci->dbi_base, ..) calls
>> have been converted to dw_pcie_readX_dbi/dw_pcie_writeX_dbi calls.
>> Convert the remaining calls.
>>
>> Niklas Cassel (2):
>> PCI: dwc: dra7xx: utilize dw_pcie_readX_dbi/dw_pcie_writeX_dbi macros
>> PCI: dwc: spear13xx: utilize dw_pcie_readX_dbi/dw_pcie_writeX_dbi
>> macros
>>
>> drivers/pci/dwc/pci-dra7xx.c | 14 ++++++--------
>> drivers/pci/dwc/pcie-spear13xx.c | 22 ++++++++++------------
>> 2 files changed, 16 insertions(+), 20 deletions(-)
>
> These patches are short, but obscure, e.g.,
>
> - dw_pcie_read(pci->dbi_base + exp_cap_off + PCI_EXP_LNKCAP, 4, &val);
> + val = dw_pcie_readl_dbi(pci, exp_cap_off + PCI_EXP_LNKCAP);
>
> The original call path was:
>
> dw_pcie_read(addr, ...)
> readl(addr)
>
> and we're replacing it with the much more complicated:
>
> dw_pcie_readl_dbi
> __dw_pcie_read_dbi
> if (pci->ops->read_dbi)
> return pci->ops->read_dbi(pci, base, reg, size)
> dw_pcie_read(base + reg, size, &val)
> readl
>
> This is not functionally equivalent (the new path uses ops->read_dbi
> if it's set), so the changelog should say something about why we need
> this change.
>
> Neither dra7xx nor spear13xx sets .read_dbi, so my guess is this
> doesn't actually fix anything that's broken and this is just for
> consistency.
Hello Bjorn,
It is just for consistency.
Sorry for my misleading cover letter.
It should have said: "For consistency, convert all
dw_pcie_read(pci->dbi_base, ..)/dw_pcie_write(pci->dbi_base, ..)
calls to use the dw_pcie_readX_dbi/dw_pcie_writeX_dbi macros".
It is true that dw_pcie_readX_dbi/dw_pcie_writeX_dbi will use
ops->read_dbi if it is set. However, if ops->read_dbi is set,
you will most likely want to use that function for reading the dbi.
Anyway, neither spear13xx nor dra7xx has ops->read_dbi set,
so these patches shouldn't change their current behavior.
Do you want me to resend these patches or would you prefer
to just drop them?
Best regards,
Niklas
>
> That's fine, but I'm confused because I looked for some of the
> previous conversions you mentioned but couldn't find any. I'm lost in
> a maze of twisty little passages.
>
> Bjorn
>
prev parent reply other threads:[~2017-09-04 16:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-14 12:07 Niklas Cassel
2017-07-14 12:07 ` [PATCH 1/2] PCI: dwc: dra7xx: utilize dw_pcie_readX_dbi/dw_pcie_writeX_dbi macros Niklas Cassel
2017-07-14 12:07 ` [PATCH 2/2] PCI: dwc: spear13xx: " Niklas Cassel
2017-08-14 18:09 ` Bjorn Helgaas
2017-08-02 21:32 ` [PATCH 0/2] PCI: dwc: convert remaining dbi read/writes to dw_pcie_readX_dbi/dw_pcie_writeX_dbi Bjorn Helgaas
2017-08-03 20:12 ` Bjorn Helgaas
2017-08-04 5:19 ` Kishon Vijay Abraham I
2017-08-03 5:03 ` Vignesh R
2017-08-15 22:39 ` Bjorn Helgaas
2017-09-04 16:10 ` Niklas Cassel [this message]
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=90a9daea-d962-07a6-6c5d-be7a16810123@axis.com \
--to=niklas.cassel@axis.com \
--cc=helgaas@kernel.org \
--cc=kishon@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=pratyush.anand@gmail.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®