mbox series

[RFC,0/5] phy: qcom-qmp: split the QMP PHY driver

Message ID 20220516114525.3596196-1-dmitry.baryshkov@linaro.org
Headers show
Series phy: qcom-qmp: split the QMP PHY driver | expand

Message

Dmitry Baryshkov May 16, 2022, 11:45 a.m. UTC
While adding support for the PCIe EP mode support to the QMP driver I
couldn't help but notice that the QMP PHY driver has slowly become the a
beast with tons of conditions and corner cases being inserted here and
there.r

This an RFC for an attempt to to cleanup the QMP driver by splitting the
QMP PHY driver into four smaller drivers, each targeting a particular
family of PHY backends (DP/combo, PCIe, UFS and USB). Yes, this results
in some code duplication, but I hope that the end result is still better
than the current situation.

If the idea looks good, I will continue polishing the drivers. A
feedback regarding the common functions (ones, left in the
phy-qcom-qmp.c file) would be appreciated.

Dmitry Baryshkov (5):
  phy: qcom-qmp: split combo PHY support
  phy: qcom-qmp: split DP data to DP-specific structures
  phy: qcom-qmp: split UFS PHY support
  phy: qcom-qmp: split PCIe PHY support
  phy: qcom-qmp: complete split of the QMP driver

 drivers/phy/qualcomm/Makefile             |    2 +-
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 1362 +++++
 drivers/phy/qualcomm/phy-qcom-qmp-lib.h   |  290 +
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c  | 1945 +++++++
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c   |  863 +++
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c   | 2104 ++++++++
 drivers/phy/qualcomm/phy-qcom-qmp.c       | 5983 +--------------------
 drivers/phy/qualcomm/phy-qcom-qmp.h       |   43 +
 8 files changed, 6732 insertions(+), 5860 deletions(-)
 create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-combo.c
 create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-lib.h
 create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
 create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
 create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-usb.c

Comments

Dmitry Baryshkov May 16, 2022, 11:50 a.m. UTC | #1
On 16/05/2022 14:45, Dmitry Baryshkov wrote:
> While adding support for the PCIe EP mode support to the QMP driver I
> couldn't help but notice that the QMP PHY driver has slowly become the a
> beast with tons of conditions and corner cases being inserted here and
> there.r
> 
> This an RFC for an attempt to to cleanup the QMP driver by splitting the
> QMP PHY driver into four smaller drivers, each targeting a particular
> family of PHY backends (DP/combo, PCIe, UFS and USB). Yes, this results
> in some code duplication, but I hope that the end result is still better
> than the current situation.
> 
> If the idea looks good, I will continue polishing the drivers. A
> feedback regarding the common functions (ones, left in the
> phy-qcom-qmp.c file) would be appreciated.

Oh. 3 patches out of five bounced because of moving the tables between 
source files. It looks like for the review I will have to split this 
somehow. Ideas are appreciated.

> 
> Dmitry Baryshkov (5):
>    phy: qcom-qmp: split combo PHY support
>    phy: qcom-qmp: split DP data to DP-specific structures
>    phy: qcom-qmp: split UFS PHY support
>    phy: qcom-qmp: split PCIe PHY support
>    phy: qcom-qmp: complete split of the QMP driver
> 
>   drivers/phy/qualcomm/Makefile             |    2 +-
>   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 1362 +++++
>   drivers/phy/qualcomm/phy-qcom-qmp-lib.h   |  290 +
>   drivers/phy/qualcomm/phy-qcom-qmp-pcie.c  | 1945 +++++++
>   drivers/phy/qualcomm/phy-qcom-qmp-ufs.c   |  863 +++
>   drivers/phy/qualcomm/phy-qcom-qmp-usb.c   | 2104 ++++++++
>   drivers/phy/qualcomm/phy-qcom-qmp.c       | 5983 +--------------------
>   drivers/phy/qualcomm/phy-qcom-qmp.h       |   43 +
>   8 files changed, 6732 insertions(+), 5860 deletions(-)
>   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-lib.h
>   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
>   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
>   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-usb.c
>
Vinod Koul May 16, 2022, 11:52 a.m. UTC | #2
On 16-05-22, 14:50, Dmitry Baryshkov wrote:
> On 16/05/2022 14:45, Dmitry Baryshkov wrote:
> > While adding support for the PCIe EP mode support to the QMP driver I
> > couldn't help but notice that the QMP PHY driver has slowly become the a
> > beast with tons of conditions and corner cases being inserted here and
> > there.r
> > 
> > This an RFC for an attempt to to cleanup the QMP driver by splitting the
> > QMP PHY driver into four smaller drivers, each targeting a particular
> > family of PHY backends (DP/combo, PCIe, UFS and USB). Yes, this results
> > in some code duplication, but I hope that the end result is still better
> > than the current situation.
> > 
> > If the idea looks good, I will continue polishing the drivers. A
> > feedback regarding the common functions (ones, left in the
> > phy-qcom-qmp.c file) would be appreciated.
> 
> Oh. 3 patches out of five bounced because of moving the tables between
> source files. It looks like for the review I will have to split this
> somehow. Ideas are appreciated.

I have released the patches but yes maybe do the table moves one bit at
a time...?

> 
> > 
> > Dmitry Baryshkov (5):
> >    phy: qcom-qmp: split combo PHY support
> >    phy: qcom-qmp: split DP data to DP-specific structures
> >    phy: qcom-qmp: split UFS PHY support
> >    phy: qcom-qmp: split PCIe PHY support
> >    phy: qcom-qmp: complete split of the QMP driver
> > 
> >   drivers/phy/qualcomm/Makefile             |    2 +-
> >   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 1362 +++++
> >   drivers/phy/qualcomm/phy-qcom-qmp-lib.h   |  290 +
> >   drivers/phy/qualcomm/phy-qcom-qmp-pcie.c  | 1945 +++++++
> >   drivers/phy/qualcomm/phy-qcom-qmp-ufs.c   |  863 +++
> >   drivers/phy/qualcomm/phy-qcom-qmp-usb.c   | 2104 ++++++++
> >   drivers/phy/qualcomm/phy-qcom-qmp.c       | 5983 +--------------------
> >   drivers/phy/qualcomm/phy-qcom-qmp.h       |   43 +
> >   8 files changed, 6732 insertions(+), 5860 deletions(-)
> >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-lib.h
> >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> > 
> 
> 
> -- 
> With best wishes
> Dmitry
Dmitry Baryshkov May 16, 2022, 12:01 p.m. UTC | #3
On Mon, 16 May 2022 at 14:52, Vinod Koul <vkoul@kernel.org> wrote:
>
> On 16-05-22, 14:50, Dmitry Baryshkov wrote:
> > On 16/05/2022 14:45, Dmitry Baryshkov wrote:
> > > While adding support for the PCIe EP mode support to the QMP driver I
> > > couldn't help but notice that the QMP PHY driver has slowly become the a
> > > beast with tons of conditions and corner cases being inserted here and
> > > there.r
> > >
> > > This an RFC for an attempt to to cleanup the QMP driver by splitting the
> > > QMP PHY driver into four smaller drivers, each targeting a particular
> > > family of PHY backends (DP/combo, PCIe, UFS and USB). Yes, this results
> > > in some code duplication, but I hope that the end result is still better
> > > than the current situation.
> > >
> > > If the idea looks good, I will continue polishing the drivers. A
> > > feedback regarding the common functions (ones, left in the
> > > phy-qcom-qmp.c file) would be appreciated.
> >
> > Oh. 3 patches out of five bounced because of moving the tables between
> > source files. It looks like for the review I will have to split this
> > somehow. Ideas are appreciated.
>
> I have released the patches but yes maybe do the table moves one bit at
> a time...?

Well, I can do this, but it would be then a series of
- add foo QMP PHY driver
- move tables for msm7777-foo to the foo QMP PHY driver
-  move tables for sdm5555-foo to the foo QMP PHY driver
- ......
- remove foo QMP support from the main driver

How does that sound?

>
> >
> > >
> > > Dmitry Baryshkov (5):
> > >    phy: qcom-qmp: split combo PHY support
> > >    phy: qcom-qmp: split DP data to DP-specific structures
> > >    phy: qcom-qmp: split UFS PHY support
> > >    phy: qcom-qmp: split PCIe PHY support
> > >    phy: qcom-qmp: complete split of the QMP driver
> > >
> > >   drivers/phy/qualcomm/Makefile             |    2 +-
> > >   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 1362 +++++
> > >   drivers/phy/qualcomm/phy-qcom-qmp-lib.h   |  290 +
> > >   drivers/phy/qualcomm/phy-qcom-qmp-pcie.c  | 1945 +++++++
> > >   drivers/phy/qualcomm/phy-qcom-qmp-ufs.c   |  863 +++
> > >   drivers/phy/qualcomm/phy-qcom-qmp-usb.c   | 2104 ++++++++
> > >   drivers/phy/qualcomm/phy-qcom-qmp.c       | 5983 +--------------------
> > >   drivers/phy/qualcomm/phy-qcom-qmp.h       |   43 +
> > >   8 files changed, 6732 insertions(+), 5860 deletions(-)
> > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-lib.h
> > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> > >
> >
> >
> > --
> > With best wishes
> > Dmitry
>
> --
> ~Vinod
Vinod Koul May 16, 2022, 12:23 p.m. UTC | #4
On 16-05-22, 15:01, Dmitry Baryshkov wrote:
> On Mon, 16 May 2022 at 14:52, Vinod Koul <vkoul@kernel.org> wrote:
> >
> > On 16-05-22, 14:50, Dmitry Baryshkov wrote:
> > > On 16/05/2022 14:45, Dmitry Baryshkov wrote:
> > > > While adding support for the PCIe EP mode support to the QMP driver I
> > > > couldn't help but notice that the QMP PHY driver has slowly become the a
> > > > beast with tons of conditions and corner cases being inserted here and
> > > > there.r
> > > >
> > > > This an RFC for an attempt to to cleanup the QMP driver by splitting the
> > > > QMP PHY driver into four smaller drivers, each targeting a particular
> > > > family of PHY backends (DP/combo, PCIe, UFS and USB). Yes, this results
> > > > in some code duplication, but I hope that the end result is still better
> > > > than the current situation.
> > > >
> > > > If the idea looks good, I will continue polishing the drivers. A
> > > > feedback regarding the common functions (ones, left in the
> > > > phy-qcom-qmp.c file) would be appreciated.
> > >
> > > Oh. 3 patches out of five bounced because of moving the tables between
> > > source files. It looks like for the review I will have to split this
> > > somehow. Ideas are appreciated.
> >
> > I have released the patches but yes maybe do the table moves one bit at
> > a time...?
> 
> Well, I can do this, but it would be then a series of
> - add foo QMP PHY driver
> - move tables for msm7777-foo to the foo QMP PHY driver
> -  move tables for sdm5555-foo to the foo QMP PHY driver
> - ......
> - remove foo QMP support from the main driver
> 
> How does that sound?

yes that sounds sane to me, but lets see if Bjorn has better ideas?

> 
> >
> > >
> > > >
> > > > Dmitry Baryshkov (5):
> > > >    phy: qcom-qmp: split combo PHY support
> > > >    phy: qcom-qmp: split DP data to DP-specific structures
> > > >    phy: qcom-qmp: split UFS PHY support
> > > >    phy: qcom-qmp: split PCIe PHY support
> > > >    phy: qcom-qmp: complete split of the QMP driver
> > > >
> > > >   drivers/phy/qualcomm/Makefile             |    2 +-
> > > >   drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 1362 +++++
> > > >   drivers/phy/qualcomm/phy-qcom-qmp-lib.h   |  290 +
> > > >   drivers/phy/qualcomm/phy-qcom-qmp-pcie.c  | 1945 +++++++
> > > >   drivers/phy/qualcomm/phy-qcom-qmp-ufs.c   |  863 +++
> > > >   drivers/phy/qualcomm/phy-qcom-qmp-usb.c   | 2104 ++++++++
> > > >   drivers/phy/qualcomm/phy-qcom-qmp.c       | 5983 +--------------------
> > > >   drivers/phy/qualcomm/phy-qcom-qmp.h       |   43 +
> > > >   8 files changed, 6732 insertions(+), 5860 deletions(-)
> > > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-lib.h
> > > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
> > > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> > > >   create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-usb.c
> > > >
> > >
> > >
> > > --
> > > With best wishes
> > > Dmitry
> >
> > --
> > ~Vinod
> 
> 
> 
> -- 
> With best wishes
> Dmitry