Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Fidan Aliyeva <fidan.aliyeva.ext@ericsson.com>
Cc: olteanv@gmail.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, marek.behun@nic.cz,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Eckerman <thomas.eckerman.ext@ericsson.com>
Subject: Re: [RFC PATCH 1/1] mv88e6xxx: Cache scratch config of 6352 in setup
Date: Mon, 11 May 2026 01:13:58 +0200	[thread overview]
Message-ID: <d979651d-bba0-4042-8e72-609b56121682@lunn.ch> (raw)
In-Reply-To: <20260510213429.2044612-1-fidan.aliyeva.ext@ericsson.com>

On Sun, May 10, 2026 at 11:34:29PM +0200, Fidan Aliyeva wrote:
> In mv88e6352 scratch register in Global Control 2 set of registers
> returns which port is attached to SERDES. This value is set and
> stays constant after the switch is released from reset; thus, it
> can be cached during chip setup instead of reading the register
> everytime when SERDES config is needed.
> 
> 1. Add setup_chip_specific member to mv88e6xxx_ops and
> g2_scratch_config3 member to mv88e6xxx_chip.
> 2. Add mv88e6352_g2_cache_global_scratch_config3 function as
> .setup_chip_specific which reads the CONFIG3 value from the scratch
> register and caches it.
> 3. Call .setup_chip_specific during chip setup.
> 4. Refactor mv88e6352_g2_scratch_port_has_serdes to use the cached
> value.
> 5. Remove the locks surrounding mv88e6352_g2_scratch_port_has_serdes.
> Not needed anymore since no register access in the function.

We ask for lots of small patches which are obviously correct and have
good commit messages.

It seems like you could break this up into smaller patches. Taking to
account my other comment, how about 4 Patches:

1) Add mv88e6532_reset() which simply called mv88e6532_g1_reset(), and
make use of it for the 6352 family ops structure.

2) add g2_scratch_config3 member to mv88e6xxx_chip, add a helper to
read the register, and call it from mv88e6532_reset().

3) Rework mv88e6352_g2_scratch_port_has_serdes() to use the cached value.

4) Remove the locks.

   Andrew

      parent reply	other threads:[~2026-05-10 23:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-10 21:34 [RFC PATCH 1/1] mv88e6xxx: Cache scratch config of 6352 in setup Fidan Aliyeva
2026-05-10 21:45 ` Fidan Aliyeva
2026-05-10 23:06   ` Andrew Lunn
2026-05-10 23:13 ` Andrew Lunn [this message]

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=d979651d-bba0-4042-8e72-609b56121682@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fidan.aliyeva.ext@ericsson.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.behun@nic.cz \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=thomas.eckerman.ext@ericsson.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