public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Marangi <ansuelsmth@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jonathan McDowell <noodles@earth.li>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] net: dsa: qca8k: change only max_frame_size of mac_frame_size_reg
Date: Tue, 21 Jun 2022 16:46:06 +0200	[thread overview]
Message-ID: <62b1d9af.1c69fb81.6ff6b.7b32@mx.google.com> (raw)
In-Reply-To: <20220621123041.6y7rre26iqhhwdoa@skbuf>

On Tue, Jun 21, 2022 at 03:30:41PM +0300, Vladimir Oltean wrote:
> On Sat, Jun 18, 2022 at 08:22:59AM +0200, Christian Marangi wrote:
> > Currently we overwrite the entire MAX_FRAME_SIZE reg instead of tweaking
> > just the MAX_FRAME_SIZE value. Change this and update only the relevant
> > bits.
> > 
> > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> > ---
> >  drivers/net/dsa/qca8k.c | 8 ++++++--
> >  drivers/net/dsa/qca8k.h | 3 ++-
> >  2 files changed, 8 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
> > index 2727d3169c25..eaaf80f96fa9 100644
> > --- a/drivers/net/dsa/qca8k.c
> > +++ b/drivers/net/dsa/qca8k.c
> > @@ -2345,7 +2345,9 @@ qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
> >  		return 0;
> >  
> >  	/* Include L2 header / FCS length */
> > -	return qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, new_mtu + ETH_HLEN + ETH_FCS_LEN);
> > +	return regmap_update_bits(priv->regmap, QCA8K_MAX_FRAME_SIZE_REG,
> > +				  QCA8K_MAX_FRAME_SIZE_MASK,
> > +				  new_mtu + ETH_HLEN + ETH_FCS_LEN);
> >  }
> >  
> >  static int
> > @@ -3015,7 +3017,9 @@ qca8k_setup(struct dsa_switch *ds)
> >  	}
> >  
> >  	/* Setup our port MTUs to match power on defaults */
> > -	ret = qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, ETH_FRAME_LEN + ETH_FCS_LEN);
> > +	ret = regmap_update_bits(priv->regmap, QCA8K_MAX_FRAME_SIZE_REG,
> > +				 QCA8K_MAX_FRAME_SIZE_MASK,
> > +				 ETH_FRAME_LEN + ETH_FCS_LEN);
> >  	if (ret)
> >  		dev_warn(priv->dev, "failed setting MTU settings");
> >  
> > diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h
> > index ec58d0e80a70..1d0c383a95e7 100644
> > --- a/drivers/net/dsa/qca8k.h
> > +++ b/drivers/net/dsa/qca8k.h
> > @@ -87,7 +87,8 @@
> >  #define   QCA8K_MDIO_MASTER_MAX_REG			32
> >  #define QCA8K_GOL_MAC_ADDR0				0x60
> >  #define QCA8K_GOL_MAC_ADDR1				0x64
> > -#define QCA8K_MAX_FRAME_SIZE				0x78
> > +#define QCA8K_MAX_FRAME_SIZE_REG			0x78
> > +#define   QCA8K_MAX_FRAME_SIZE_MASK			GENMASK(13, 0)
> 
> What's at bits 14 and beyond? Trying to understand the impact of this change.
>

Most of them are reserved bits (from Documentation).
The few we have Documentation of are debug bits about CRC handling, IPG
and special mode where the MAC send pause frames based on the signal.

It's a cleanup and seems a nice change now that we are touching this
part.

> >  #define QCA8K_REG_PORT_STATUS(_i)			(0x07c + (_i) * 4)
> >  #define   QCA8K_PORT_STATUS_SPEED			GENMASK(1, 0)
> >  #define   QCA8K_PORT_STATUS_SPEED_10			0
> > -- 
> > 2.36.1
> > 

-- 
	Ansuel

  reply	other threads:[~2022-06-21 14:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-18  6:22 [PATCH 1/3] net: dsa: qca8k: reduce mgmt ethernet timeout Christian Marangi
2022-06-18  6:22 ` [PATCH 2/3] net: dsa: qca8k: change only max_frame_size of mac_frame_size_reg Christian Marangi
2022-06-21 12:30   ` Vladimir Oltean
2022-06-21 14:46     ` Christian Marangi [this message]
2022-06-18  6:23 ` [PATCH 3/3] net: dsa: qca8k: reset cpu port on MTU change Christian Marangi
2022-06-21 12:33 ` [PATCH 1/3] net: dsa: qca8k: reduce mgmt ethernet timeout Vladimir Oltean
2022-06-21 14:48   ` Christian Marangi

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=62b1d9af.1c69fb81.6ff6b.7b32@mx.google.com \
    --to=ansuelsmth@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=noodles@earth.li \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.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