linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Quentin Schulz <foss@0leil.net>
To: Antoine Tenart <antoine.tenart@bootlin.com>
Cc: davem@davemloft.net, andrew@lunn.ch, f.fainelli@gmail.com,
	hkallweit1@gmail.com, richardcochran@gmail.com,
	alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com, allan.nielsen@microchip.com
Subject: Re: [PATCH net-next v3 4/8] net: phy: mscc: take into account the 1588 block in MACsec init
Date: Sun, 21 Jun 2020 17:38:42 +0200	[thread overview]
Message-ID: <964739eb70dcd58153d8548f7b57719b@0leil.net> (raw)
In-Reply-To: <20200619122300.2510533-5-antoine.tenart@bootlin.com>

Hi Antoine,

On 2020-06-19 14:22, Antoine Tenart wrote:
> This patch takes in account the use of the 1588 block in the MACsec
> initialization, as a conditional configuration has to be done (when the
> 1588 block is used).
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
> ---
>  drivers/net/phy/mscc/mscc_macsec.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/mscc/mscc_macsec.c
> b/drivers/net/phy/mscc/mscc_macsec.c
> index c0eeb62cb940..713c62b1d1f0 100644
> --- a/drivers/net/phy/mscc/mscc_macsec.c
> +++ b/drivers/net/phy/mscc/mscc_macsec.c
> @@ -285,7 +285,9 @@ static void vsc8584_macsec_mac_init(struct
> phy_device *phydev,
>  				 MSCC_MAC_CFG_PKTINF_CFG_STRIP_PREAMBLE_ENA |
>  				 MSCC_MAC_CFG_PKTINF_CFG_INSERT_PREAMBLE_ENA |
>  				 (bank == HOST_MAC ?
> -				  MSCC_MAC_CFG_PKTINF_CFG_ENABLE_TX_PADDING : 0));
> +				  MSCC_MAC_CFG_PKTINF_CFG_ENABLE_TX_PADDING : 0) |
> +				 (IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING) ?
> +				  MSCC_MAC_CFG_PKTINF_CFG_MACSEC_BYPASS_NUM_PTP_STALL_CLKS(0x8) : 
> 0));

Do we have more info on this 0x8? Where does it come from? What does it 
mean?

Also this starts to get a little bit hard to read. Would it make sense 
to have
two temp variables? e.g.:

	padding = bank == HOST_MAC ? MSCC_MAC_CFG_PKTINF_CFG_ENABLE_TX_PADDING 
: 0;
	ptp_stall_clks = IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING) ?
		MSCC_MAC_CFG_PKTINF_CFG_MACSEC_BYPASS_NUM_PTP_STALL_CLKS(0x8) : 0;

	vsc8584_macsec_phy_write(phydev, bank, MSCC_MAC_CFG_PKTINF_CFG,
				 MSCC_MAC_CFG_PKTINF_CFG_STRIP_FCS_ENA |
				 MSCC_MAC_CFG_PKTINF_CFG_INSERT_FCS_ENA |
				 MSCC_MAC_CFG_PKTINF_CFG_LPI_RELAY_ENA |
				 MSCC_MAC_CFG_PKTINF_CFG_STRIP_PREAMBLE_ENA |
				 MSCC_MAC_CFG_PKTINF_CFG_INSERT_PREAMBLE_ENA |
				 padding |
				 ptp_stall_clks);

Thanks,
Quentin

  reply	other threads:[~2020-06-21 15:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-19 12:22 [PATCH net-next v3 0/8] net: phy: mscc: PHC and timestamping support Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 1/8] net: phy: add support for a common probe between shared PHYs Antoine Tenart
2020-06-20 14:49   ` Andrew Lunn
2020-06-19 12:22 ` [PATCH net-next v3 2/8] net: phy: mscc: fix copyright and author information in MACsec Antoine Tenart
2020-06-20 14:50   ` Andrew Lunn
2020-06-19 12:22 ` [PATCH net-next v3 3/8] net: phy: mscc: remove the TR CLK disable magic value Antoine Tenart
2020-06-20 14:52   ` Andrew Lunn
2020-06-22 12:49     ` Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 4/8] net: phy: mscc: take into account the 1588 block in MACsec init Antoine Tenart
2020-06-21 15:38   ` Quentin Schulz [this message]
2020-06-22 14:25     ` Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 5/8] net: phy: mscc: 1588 block initialization Antoine Tenart
2020-06-20 15:10   ` Andrew Lunn
2020-06-22 13:07     ` Antoine Tenart
2020-06-21 16:57   ` Quentin Schulz
2020-06-22 15:26     ` Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 6/8] net: phy: mscc: timestamping and PHC support Antoine Tenart
2020-06-20 15:00   ` Richard Cochran
2020-06-22 13:09     ` Antoine Tenart
2020-06-20 15:16   ` Andrew Lunn
2020-06-20 15:21   ` Andrew Lunn
2020-06-22 13:31     ` Antoine Tenart
2020-06-20 15:40   ` Andrew Lunn
2020-06-22 13:26     ` Antoine Tenart
2020-06-21 17:35   ` Quentin Schulz
2020-06-22 15:35     ` Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 7/8] dt-bindings: net: phy: vsc8531: document the load/save GPIO Antoine Tenart
2020-06-19 12:23 ` [PATCH net-next v3 8/8] MIPS: dts: ocelot: describe " Antoine Tenart

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=964739eb70dcd58153d8548f7b57719b@0leil.net \
    --to=foss@0leil.net \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=thomas.petazzoni@bootlin.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).