linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ladislav Michl <oss-lists@triops.cz>
To: Dan Carpenter <error27@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	linux-staging@lists.linux.dev, netdev@vger.kernel.org,
	linux-mips@vger.kernel.org,
	Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: Re: [PATCH 2/3] staging: octeon: avoid needless device allocation
Date: Mon, 17 Apr 2023 11:37:02 +0200	[thread overview]
Message-ID: <ZD0TPvDa7zopm0dx@lenoch> (raw)
In-Reply-To: <26dd05e9-befa-4190-ac3c-bf31d58a5f1e@kili.mountain>

On Mon, Apr 17, 2023 at 11:37:30AM +0300, Dan Carpenter wrote:
> On Thu, Apr 13, 2023 at 07:20:08PM +0200, Andrew Lunn wrote:
> > > I was asking this question myself and then came to this:
> > > Converting driver to phylink makes separating different macs easier as
> > > this driver is splitted between staging and arch/mips/cavium-octeon/executive/
> > > However I'll provide changes spotted previously as separate preparational
> > > patches. Would that work for you?
> > 
> > Is you end goal to get this out of staging? phylib vs phylink is not a
> > reason to keep it in staging.
> > 
> > It just seems odd to be adding new features to a staging driver. As a
> > bit of a "carrot and stick" maybe we should say you cannot add new
> > features until it is ready to move out of staging?
> 
> We already have that rule.  But I don't know anything about phy vs
> phylink...

Let me elaborate here a bit then.

Current Octeon driver comes from Cavium's vendor kernel tree. Cavium
started this about two decades ago based on their own ideas and tries
to bend kernel interfaces around them.

Driver is based aroud Packet Input Processing/Input Packet Data (PIP/IPD)
units which can connect their data streams to various interfaces.
SGMII/1000BASE-X/QSGMII and RGMII are just two of them.

Currently driver iterates over all interfaces and all ports to bind
interfaces to PIP/IPD. There is a lot of code deciding which
interfaces/ports exits on given Octeon SoC, see
arch/mips/cavium-octeon/executive/
Driver code then calls those helpers with interface/port aguments
and they do the magic using switches deciding what to do based
on interface type.

I'm proposing to leave all that trickery behind and just follow what's
written in device tree, so each I/O interface ends up as a driver
with its own mac ops. While it is possible to implement that as
private mac ops as some other drivers do, I think it is more
convenient to use phylink_mac_ops.

In case I'm missing something or I'm wrong with analysis, please let
me know.

Thanks,
	ladis

  reply	other threads:[~2023-04-17  9:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 14:11 [PATCH 0/3] staging: octeon: Convert to use phylink Ladislav Michl
2023-04-13 14:13 ` [PATCH 1/3] staging: octeon: don't panic Ladislav Michl
2023-04-13 15:57   ` Andrew Lunn
2023-04-13 16:14     ` Ladislav Michl
2023-04-13 16:28       ` Andrew Lunn
2023-04-13 14:14 ` [PATCH 2/3] staging: octeon: avoid needless device allocation Ladislav Michl
2023-04-13 16:12   ` Andrew Lunn
2023-04-13 16:43     ` Ladislav Michl
2023-04-13 17:20       ` Andrew Lunn
2023-04-13 17:51         ` Ladislav Michl
2023-04-15  0:21         ` Ladislav Michl
2023-04-17  8:37         ` Dan Carpenter
2023-04-17  9:37           ` Ladislav Michl [this message]
2023-04-17 13:27             ` Andrew Lunn
2023-04-13 14:15 ` [RFC 3/3] staging: octeon: convert to use phylink Ladislav Michl
2023-04-13 15:35   ` Dan Carpenter
2023-04-13 16:04     ` Ladislav Michl
2023-04-13 16:10       ` Dan Carpenter
2023-04-13 16:17         ` Ladislav Michl
2023-04-13 15:45 ` [PATCH 0/3] staging: octeon: Convert " Andrew Lunn
2023-04-13 16:35   ` Ladislav Michl
2023-04-13 17:12     ` Andrew Lunn
2023-04-13 17:29       ` Ladislav Michl

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=ZD0TPvDa7zopm0dx@lenoch \
    --to=oss-lists@triops.cz \
    --cc=andrew@lunn.ch \
    --cc=chris.packham@alliedtelesis.co.nz \
    --cc=error27@gmail.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).