netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Jacob Keller <jacob.e.keller@intel.com>, netdev@vger.kernel.org
Cc: Doug Berger <opendmb@gmail.com>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	open list <linux-kernel@vger.kernel.org>,
	Justin Chen <justin.chen@broadcom.com>
Subject: Re: [PATCH net-next 2/3] net: bcmgenet: Pass "main" clock down to the MDIO driver
Date: Fri, 16 Feb 2024 14:50:19 -0800	[thread overview]
Message-ID: <01f75913-a360-490e-93d3-d5e983d4efb5@broadcom.com> (raw)
In-Reply-To: <e77b032a-42cf-43df-809a-24b36dbcb95d@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2334 bytes --]

On 2/16/24 14:41, Jacob Keller wrote:
> 
> 
> On 2/16/2024 10:42 AM, Florian Fainelli wrote:
>> GENET has historically had to create a MDIO platform device for its
>> controller and pass some auxiliary data to it, like a MDIO completion
>> callback. Now we also pass the "main" clock to allow for the MDIO bus
>> controller to manage that clock adequately around I/O accesses.
>>
>> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> ---
>>   drivers/net/ethernet/broadcom/genet/bcmmii.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
>> index cbbe004621bc..7a21950da77c 100644
>> --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
>> +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
>> @@ -476,6 +476,10 @@ static int bcmgenet_mii_register(struct bcmgenet_priv *priv)
>>   	ppd.wait_func = bcmgenet_mii_wait;
>>   	ppd.wait_func_data = priv;
>>   	ppd.bus_name = "bcmgenet MII bus";
>> +	/* Pass a reference to our "main" clock which is used for MDIO
>> +	 * transfers
>> +	 */
>> +	ppd.clk = priv->clk;
>>   
>>   	/* Unimac MDIO bus controller starts at UniMAC offset + MDIO_CMD
>>   	 * and is 2 * 32-bits word long, 8 bytes total.
> 
> Is this missing a modification of the header file to add the clk field
> to struct unimac_mdio_pdata? I don't see that field in the
> include/linux/platform_data/mdio-bcm-unimac.h header currently...
> 
> Oh. you included that in the first patch of the series. I see.

I suppose I could have included it in patch #1, and have introduced in 
patch #2 the hunk that dealt with fetching pdata->clk, but since I was 
re-organizing the mdio-bcm-unimac.c driver's probe function, it felt 
more natural to arrange it that way.

> 
> It feels like the series would be more natural of this was 1/3 instead
> of 2/3, since the current 1/3 patch depends on this clk value being set, no?

I sort of debated that with myself, and ended up going with: put the 
plumbing first, wire it later, rather than the opposite. If someone was 
to run a bisection there would not be any difference in behavior until 
patch #2 regardless of their ordering.

> 
> The result of the series makes sense tho:
> 
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

Thanks Jacob!
-- 
Florian


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

  reply	other threads:[~2024-02-16 22:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 18:42 [PATCH net-next 0/3] Rework GENET MDIO controller clocking Florian Fainelli
2024-02-16 18:42 ` [PATCH net-next 1/3] net: mdio: mdio-bcm-unimac: Manage clock around I/O accesses Florian Fainelli
2024-02-16 22:37   ` Jacob Keller
2024-02-17 10:43   ` kernel test robot
2024-02-16 18:42 ` [PATCH net-next 2/3] net: bcmgenet: Pass "main" clock down to the MDIO driver Florian Fainelli
2024-02-16 22:41   ` Jacob Keller
2024-02-16 22:50     ` Florian Fainelli [this message]
2024-02-17 15:21   ` Andrew Lunn
2024-02-17 17:18     ` Florian Fainelli
2024-02-16 18:42 ` [PATCH net-next 3/3] Revert "net: bcmgenet: Ensure MDIO unregistration has clocks enabled" Florian Fainelli
2024-02-16 22:41   ` Jacob Keller

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=01f75913-a360-490e-93d3-d5e983d4efb5@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=jacob.e.keller@intel.com \
    --cc=justin.chen@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=opendmb@gmail.com \
    --cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).