mbox series

[v2,00/20] i.MX6, DesignWare PCI improvements

Message ID 20190104174925.17153-1-andrew.smirnov@gmail.com (mailing list archive)
Headers show
Series i.MX6, DesignWare PCI improvements | expand

Message

Andrey Smirnov Jan. 4, 2019, 5:49 p.m. UTC
Everyone:

This is the series containing various small improvements that I made
while reading the code and researching commit history of pci-imx6.c
and pcie-designware*.c files. All changes are optional, so commits
that don't seem like an improvement can be easily dropped. Hopefully
each patch is self-explanatory.

I tested this series on i.MX6Q, i.MX7D and i.MX8MQ.

Feedback is welcome!

Thanks,
Andrey Smirnov

Changes since [v1]:

  - Dropped "PCI: imx6: Drop imx6_pcie_link_up()" due to the matter
    already having been addressed by "PCI: imx6: Fix link training
    status detection in link up check" from Trent Piepho

  - Changed "designware" -> "dwc" for all subject lines

  - Collected Acked-by's from Gustavo Pimentel

[v1] lkml.kernel.org/r/20181221072716.29017-1-andrew.smirnov@gmail.com

Andrey Smirnov (20):
  PCI: imx6: Simplify imx7d_pcie_wait_for_phy_pll_lock()
  PCI: imx6: Remove redundant debug tracing
  PCI: imx6: Return -ETIMEOUT from imx6_pcie_wait_for_speed_change()
  PCI: imx6: Remove duplicate macro definitions
  PCI: imx6: Remove PCIE_PL_PFLR_* constants
  PCI: imx6: Remove PCIE_PHY_RX_ASIC_OUT* constants
  PCI: dwc: Make use of IS_ALIGNED()
  PCI: dwc: Share code for dw_pcie_rd/wr_other_conf()
  PCI: dwc: imx6: Share PHY debug register definitions
  PCI: dwc: Make use of BIT() in constant definitions
  PCI: imx6: Make use of BIT() in constant definitions
  PCI: imx6: Simplify bit operations in PHY functions
  PCI: imx6: Simplify pcie_phy_poll_ack()
  PCI: imx6: Restrict PHY register data to 16-bit
  PCI: imx6: Pass data to dw_pcie_writel_dbi() directly
  PCI: imx6: Use common mask in imx6_pcie_reset_phy()
  PCI: imx6: Simplify bit operations in imx6_setup_phy_mpll()
  PCI: imx6: Remove magic numbers from imx6_pcie_establish_link()
  PCI: dwc: Make use of GENMASK/FIELD_PREP
  PCI: dwc: Remove superfluous shifting in definitions

 drivers/pci/controller/dwc/pci-imx6.c         | 139 +++++++-----------
 .../pci/controller/dwc/pcie-designware-host.c |  61 +++-----
 drivers/pci/controller/dwc/pcie-designware.c  |  18 +--
 drivers/pci/controller/dwc/pcie-designware.h  |  60 ++++----
 4 files changed, 115 insertions(+), 163 deletions(-)

Comments

Lorenzo Pieralisi Feb. 1, 2019, 4:27 p.m. UTC | #1
On Fri, Jan 04, 2019 at 09:49:05AM -0800, Andrey Smirnov wrote:
> Everyone:
> 
> This is the series containing various small improvements that I made
> while reading the code and researching commit history of pci-imx6.c
> and pcie-designware*.c files. All changes are optional, so commits
> that don't seem like an improvement can be easily dropped. Hopefully
> each patch is self-explanatory.

Side note: You should trim the CC list, eg I do not think CC LKML is
needed at all for this series.

@Lucas: May I ask you to consider please which patches you deem
worth for inclusion ? I will have a look too but I would be grateful
if the driver maintainers can chime in to help.

Thanks,
Lorenzo

> I tested this series on i.MX6Q, i.MX7D and i.MX8MQ.
> 
> Feedback is welcome!
> 
> Thanks,
> Andrey Smirnov
> 
> Changes since [v1]:
> 
>   - Dropped "PCI: imx6: Drop imx6_pcie_link_up()" due to the matter
>     already having been addressed by "PCI: imx6: Fix link training
>     status detection in link up check" from Trent Piepho
> 
>   - Changed "designware" -> "dwc" for all subject lines
> 
>   - Collected Acked-by's from Gustavo Pimentel
> 
> [v1] lkml.kernel.org/r/20181221072716.29017-1-andrew.smirnov@gmail.com
> 
> Andrey Smirnov (20):
>   PCI: imx6: Simplify imx7d_pcie_wait_for_phy_pll_lock()
>   PCI: imx6: Remove redundant debug tracing
>   PCI: imx6: Return -ETIMEOUT from imx6_pcie_wait_for_speed_change()
>   PCI: imx6: Remove duplicate macro definitions
>   PCI: imx6: Remove PCIE_PL_PFLR_* constants
>   PCI: imx6: Remove PCIE_PHY_RX_ASIC_OUT* constants
>   PCI: dwc: Make use of IS_ALIGNED()
>   PCI: dwc: Share code for dw_pcie_rd/wr_other_conf()
>   PCI: dwc: imx6: Share PHY debug register definitions
>   PCI: dwc: Make use of BIT() in constant definitions
>   PCI: imx6: Make use of BIT() in constant definitions
>   PCI: imx6: Simplify bit operations in PHY functions
>   PCI: imx6: Simplify pcie_phy_poll_ack()
>   PCI: imx6: Restrict PHY register data to 16-bit
>   PCI: imx6: Pass data to dw_pcie_writel_dbi() directly
>   PCI: imx6: Use common mask in imx6_pcie_reset_phy()
>   PCI: imx6: Simplify bit operations in imx6_setup_phy_mpll()
>   PCI: imx6: Remove magic numbers from imx6_pcie_establish_link()
>   PCI: dwc: Make use of GENMASK/FIELD_PREP
>   PCI: dwc: Remove superfluous shifting in definitions
> 
>  drivers/pci/controller/dwc/pci-imx6.c         | 139 +++++++-----------
>  .../pci/controller/dwc/pcie-designware-host.c |  61 +++-----
>  drivers/pci/controller/dwc/pcie-designware.c  |  18 +--
>  drivers/pci/controller/dwc/pcie-designware.h  |  60 ++++----
>  4 files changed, 115 insertions(+), 163 deletions(-)
> 
> -- 
> 2.20.1
>
Andrey Smirnov Feb. 15, 2019, 12:59 a.m. UTC | #2
On Fri, Feb 1, 2019 at 8:27 AM Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
>
> On Fri, Jan 04, 2019 at 09:49:05AM -0800, Andrey Smirnov wrote:
> > Everyone:
> >
> > This is the series containing various small improvements that I made
> > while reading the code and researching commit history of pci-imx6.c
> > and pcie-designware*.c files. All changes are optional, so commits
> > that don't seem like an improvement can be easily dropped. Hopefully
> > each patch is self-explanatory.
>
> Side note: You should trim the CC list, eg I do not think CC LKML is
> needed at all for this series.
>

I add it because it's always recommended by scripts/get_maintainer.pl
and it really simplifies creating lore references to previous versions
of the patches I sent, that is I don't have to remember which
tree-specific list that series went to.

> @Lucas: May I ask you to consider please which patches you deem
> worth for inclusion ? I will have a look too but I would be grateful
> if the driver maintainers can chime in to help.
>

Lorenzo, can you apply the dwc specific patches that are already
reviewed by Gustavo Pimentel from this series, to keep things moving
while we are waiting on Lucas? I can also spin them out into a
separate series if that's perferable.

Thanks,
Andrey Smirnov
Lorenzo Pieralisi Feb. 15, 2019, 10:13 a.m. UTC | #3
On Thu, Feb 14, 2019 at 04:59:04PM -0800, Andrey Smirnov wrote:

[...]

> > @Lucas: May I ask you to consider please which patches you deem
> > worth for inclusion ? I will have a look too but I would be grateful
> > if the driver maintainers can chime in to help.
> >
> 
> Lorenzo, can you apply the dwc specific patches that are already
> reviewed by Gustavo Pimentel from this series, to keep things moving
> while we are waiting on Lucas? I can also spin them out into a
> separate series if that's perferable.

Yes I can apply them, provided I can cherry-pick them from the series,
otherwise I would ask you please to create a series out of them and send
it so that I can proceed.

Thanks,
Lorenzo
Lorenzo Pieralisi Feb. 19, 2019, 12:22 p.m. UTC | #4
On Thu, Feb 14, 2019 at 04:59:04PM -0800, Andrey Smirnov wrote:

[...]

> Lorenzo, can you apply the dwc specific patches that are already
> reviewed by Gustavo Pimentel from this series, to keep things moving
> while we are waiting on Lucas? I can also spin them out into a
> separate series if that's perferable.

Hi Andrey,

do you have time to respin the series with *only* dwc patches ACK'ed
by Gustavo ? Or it is not doable owing to patches interdependency ?

Please let me know, I would like to reduce the delta by merging what's
ready.

Thanks,
Lorenzo
Andrey Smirnov Feb. 19, 2019, 7:47 p.m. UTC | #5
On Tue, Feb 19, 2019 at 4:22 AM Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
>
> On Thu, Feb 14, 2019 at 04:59:04PM -0800, Andrey Smirnov wrote:
>
> [...]
>
> > Lorenzo, can you apply the dwc specific patches that are already
> > reviewed by Gustavo Pimentel from this series, to keep things moving
> > while we are waiting on Lucas? I can also spin them out into a
> > separate series if that's perferable.
>
> Hi Andrey,
>
> do you have time to respin the series with *only* dwc patches ACK'ed
> by Gustavo ? Or it is not doable owing to patches interdependency ?
>

Sorry for the delay, it's doable and I'll send out a separate series shortly.

Thanks,
Andrey Smirnov