All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Robin <benjamin.robin@bootlin.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Yuti Amonkar" <yamonkar@cadence.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Robert Foss" <rfoss@kernel.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>, "Nishanth Menon" <nm@ti.com>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Tero Kristo" <kristo@kernel.org>, "Andrew Davis" <afd@ti.com>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Chintan Vankar" <c-vankar@ti.com>,
	"Abhash Kumar Jha" <a-kumar2@ti.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Thomas Richard" <thomas.richard@bootlin.com>,
	"Swapnil Jakhade" <sjakhade@cadence.com>,
	"Siddharth Vadapalli" <s-vadapalli@ti.com>,
	"Gregory CLEMENT" <gregory.clement@bootlin.com>,
	"Théo Lebrun" <theo.lebrun@bootlin.com>,
	"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
	"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH 4/4] phy: cadence-torrent: rewrite Torrent PHY driver
Date: Tue, 24 Nov 2026 18:18:24 +0100	[thread overview]
Message-ID: <22sq13shQmSOkQPF53jaXw@bootlin.com> (raw)
In-Reply-To: <20261121-artichoke-sturgeon-of-karma-a7c4e5@quoll>

On Saturday, November 21, 2026 at 5:16 PM, Krzysztof Kozlowski wrote:
> On Fri, Nov 20, 2026 at 01:55:52PM +0100, Benjamin Robin wrote:
> > The Cadence Torrent PHY (sd0801) is a multi-protocol SerDes used in
> > several SoCs, among them the Texas Instruments J72xx family. Its
> > programming depends on many parameters: the selected protocol (each
> > associated PLL has to be set to a different frequency), the DisplayPort
> > bit rate, the reference clock frequency, whether spread-spectrum
> > clocking (SSC) is enabled, the number of lanes, and the PHY revision
> > and technology (process node).
> > 
> > The current phy-cadence-torrent driver hard-codes, for every supported
> > configuration, the set of register values to program. Because this
> > configuration space is large, adding a new board or a new combination
> > of standards requires duplicating dozens of opaque register values,
> > which is inflexible and hard to maintain.
> > 
> > This new driver version computes the register values instead:
> > 
> >   - registers that depend on the reference clock frequency or on a PLL
> >     frequency are computed at run time, from the reference clock
> >     obtained through the clock framework and from the PLL frequency
> >     derived from the selected standard;
> >   - the other registers, which only depend on the standard type, the
> >     PHY revision and the technology, are handled by one function per
> >     register, using an internal table selected through a
> >     standard/revision/technology key.
> > 
> > The PHY revision and technology are detected automatically from the
> > PHY identification registers, and the DisplayPort link initialization
> > and rate reconfiguration have been rewritten.
> > 
> > Compared with the existing driver, this rewrite provides:
> 
> 10k lines patch!

I was expecting this kind of feedback, which is why the cover letter says:

  Because this is a complete rewrite, the diff is large and not well
  suited to a line-by-line review. The rewritten driver can be fetched
  from the phy-cadence-torrent branch at https://github.com/benjarobin/linux

To give more context: the new driver was written from scratch, in a new
empty file, although a very small part of the old driver was copied over.
I initially considered adding the new driver to staging, but after internal
discussion we decided against it.

> 
> No, instead improve the driver instead of doing bunch of significant
> changes like:
> 
> > -#define MAX_NUM_LANES		4
> > +#define MAX_NUM_LANES		8

Regarding incremental changes: I could try to build a series of smaller
steps from the old driver towards the new one. That comes at an
additional "cost", since intermediate patches would fix functions or
how there are called, that a later patch then removes or replaces.

However, even with such a series, the core transformation remains: one
patch replacing all the tables with per-register functions computing the
values. That patch alone removes roughly 3k lines and adds 2.5k lines,
which cannot really be split further.

So, I am going to try to create an incremental series: many "small" patches
converging towards the new implementation, with one unavoidable large patch.

With this additional context, could you confirm whether you would
prefer the series split into smaller patches?

> 
> This is absolutely unreviewable.


-- 
Benjamin Robin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Robin <benjamin.robin@bootlin.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Yuti Amonkar" <yamonkar@cadence.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Robert Foss" <rfoss@kernel.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>, "Nishanth Menon" <nm@ti.com>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Tero Kristo" <kristo@kernel.org>, "Andrew Davis" <afd@ti.com>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Chintan Vankar" <c-vankar@ti.com>,
	"Abhash Kumar Jha" <a-kumar2@ti.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Thomas Richard" <thomas.richard@bootlin.com>,
	"Swapnil Jakhade" <sjakhade@cadence.com>,
	"Siddharth Vadapalli" <s-vadapalli@ti.com>,
	"Gregory CLEMENT" <gregory.clement@bootlin.com>,
	"Théo Lebrun" <theo.lebrun@bootlin.com>,
	"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
	"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH 4/4] phy: cadence-torrent: rewrite Torrent PHY driver
Date: Tue, 24 Nov 2026 18:18:24 +0100	[thread overview]
Message-ID: <22sq13shQmSOkQPF53jaXw@bootlin.com> (raw)
In-Reply-To: <20261121-artichoke-sturgeon-of-karma-a7c4e5@quoll>

On Saturday, November 21, 2026 at 5:16 PM, Krzysztof Kozlowski wrote:
> On Fri, Nov 20, 2026 at 01:55:52PM +0100, Benjamin Robin wrote:
> > The Cadence Torrent PHY (sd0801) is a multi-protocol SerDes used in
> > several SoCs, among them the Texas Instruments J72xx family. Its
> > programming depends on many parameters: the selected protocol (each
> > associated PLL has to be set to a different frequency), the DisplayPort
> > bit rate, the reference clock frequency, whether spread-spectrum
> > clocking (SSC) is enabled, the number of lanes, and the PHY revision
> > and technology (process node).
> > 
> > The current phy-cadence-torrent driver hard-codes, for every supported
> > configuration, the set of register values to program. Because this
> > configuration space is large, adding a new board or a new combination
> > of standards requires duplicating dozens of opaque register values,
> > which is inflexible and hard to maintain.
> > 
> > This new driver version computes the register values instead:
> > 
> >   - registers that depend on the reference clock frequency or on a PLL
> >     frequency are computed at run time, from the reference clock
> >     obtained through the clock framework and from the PLL frequency
> >     derived from the selected standard;
> >   - the other registers, which only depend on the standard type, the
> >     PHY revision and the technology, are handled by one function per
> >     register, using an internal table selected through a
> >     standard/revision/technology key.
> > 
> > The PHY revision and technology are detected automatically from the
> > PHY identification registers, and the DisplayPort link initialization
> > and rate reconfiguration have been rewritten.
> > 
> > Compared with the existing driver, this rewrite provides:
> 
> 10k lines patch!

I was expecting this kind of feedback, which is why the cover letter says:

  Because this is a complete rewrite, the diff is large and not well
  suited to a line-by-line review. The rewritten driver can be fetched
  from the phy-cadence-torrent branch at https://github.com/benjarobin/linux

To give more context: the new driver was written from scratch, in a new
empty file, although a very small part of the old driver was copied over.
I initially considered adding the new driver to staging, but after internal
discussion we decided against it.

> 
> No, instead improve the driver instead of doing bunch of significant
> changes like:
> 
> > -#define MAX_NUM_LANES		4
> > +#define MAX_NUM_LANES		8

Regarding incremental changes: I could try to build a series of smaller
steps from the old driver towards the new one. That comes at an
additional "cost", since intermediate patches would fix functions or
how there are called, that a later patch then removes or replaces.

However, even with such a series, the core transformation remains: one
patch replacing all the tables with per-register functions computing the
values. That patch alone removes roughly 3k lines and adds 2.5k lines,
which cannot really be split further.

So, I am going to try to create an incremental series: many "small" patches
converging towards the new implementation, with one unavoidable large patch.

With this additional context, could you confirm whether you would
prefer the series split into smaller patches?

> 
> This is absolutely unreviewable.


-- 
Benjamin Robin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-11-24 17:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 12:55 [PATCH 0/4] phy: cadence-torrent: rewrite Torrent PHY driver Benjamin Robin
2026-11-20 12:55 ` Benjamin Robin
2026-11-20 12:55 ` [PATCH 1/4] arm64: dts: ti: k3-j7200: Fix QSGMII overlay by adding SERDES PHY Benjamin Robin
2026-11-20 12:55   ` Benjamin Robin
2026-11-20 12:55 ` [PATCH 2/4] dt-bindings: phy: cadence-torrent: drop cdns,num-lanes default value Benjamin Robin
2026-11-20 12:55   ` Benjamin Robin
2026-11-21 16:19   ` Krzysztof Kozlowski
2026-11-21 16:19     ` Krzysztof Kozlowski
2026-11-24 16:11     ` Benjamin Robin
2026-11-24 16:11       ` Benjamin Robin
2026-12-01 20:59       ` Rob Herring
2026-12-01 20:59         ` Rob Herring
2026-11-20 12:55 ` [PATCH 3/4] dt-bindings: phy: cadence-torrent: add phy-mode constants Benjamin Robin
2026-11-20 12:55   ` Benjamin Robin
2026-11-20 13:10   ` sashiko-bot
2026-11-20 13:10     ` sashiko-bot
2026-11-21 16:20   ` Krzysztof Kozlowski
2026-11-21 16:20     ` Krzysztof Kozlowski
2026-11-24 16:41     ` Benjamin Robin
2026-11-24 16:41       ` Benjamin Robin
2026-11-20 12:55 ` [PATCH 4/4] phy: cadence-torrent: rewrite Torrent PHY driver Benjamin Robin
2026-11-20 12:55   ` Benjamin Robin
2026-11-20 13:33   ` sashiko-bot
2026-11-20 13:33     ` sashiko-bot
2026-11-21 16:16   ` Krzysztof Kozlowski
2026-11-21 16:16     ` Krzysztof Kozlowski
2026-11-24 17:18     ` Benjamin Robin [this message]
2026-11-24 17:18       ` Benjamin Robin

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=22sq13shQmSOkQPF53jaXw@bootlin.com \
    --to=benjamin.robin@bootlin.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a-kumar2@ti.com \
    --cc=afd@ti.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=c-vankar@ti.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kristo@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mani@kernel.org \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nm@ti.com \
    --cc=p.zabel@pengutronix.de \
    --cc=rfoss@kernel.org \
    --cc=robh@kernel.org \
    --cc=s-vadapalli@ti.com \
    --cc=simona@ffwll.ch \
    --cc=sjakhade@cadence.com \
    --cc=tawfik.bayouk@mobileye.com \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=thomas.richard@bootlin.com \
    --cc=tzimmermann@suse.de \
    --cc=vigneshr@ti.com \
    --cc=vkoul@kernel.org \
    --cc=vladimir.kondratiev@mobileye.com \
    --cc=yamonkar@cadence.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.