lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9b1fe702-39b2-4492-b107-f1b3e7f3c2a9@lunn.ch>
Date: Tue, 8 Oct 2024 23:22:59 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Shenghao Yang <me@...nghaoyang.info>
Cc: netdev@...r.kernel.org, f.fainelli@...il.com, olteanv@...il.com,
	pavana.sharma@...i.com, ashkan.boldaji@...i.com, kabel@...nel.org
Subject: Re: [PATCH net v2 2/3] net: dsa: mv88e6xxx: read cycle counter
 period from hardware

> diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
> index bd66189a593f..a54682240839 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.h
> +++ b/drivers/net/dsa/mv88e6xxx/chip.h
> @@ -206,6 +206,7 @@ struct mv88e6xxx_gpio_ops;
>  struct mv88e6xxx_avb_ops;
>  struct mv88e6xxx_ptp_ops;
>  struct mv88e6xxx_pcs_ops;
> +struct mv88e6xxx_cc_coeffs;
>  
>  struct mv88e6xxx_irq {
>  	u16 masked;
> @@ -408,6 +409,7 @@ struct mv88e6xxx_chip {
>  	struct cyclecounter	tstamp_cc;
>  	struct timecounter	tstamp_tc;
>  	struct delayed_work	overflow_work;
> +	const struct mv88e6xxx_cc_coeffs *cc_coeffs;
>  
>  	struct ptp_clock	*ptp_clock;
>  	struct ptp_clock_info	ptp_clock_info;
> @@ -714,8 +716,6 @@ struct mv88e6xxx_avb_ops {
>  	int (*tai_write)(struct mv88e6xxx_chip *chip, int addr, u16 data);
>  };
>  
> -struct mv88e6xxx_cc_coeffs;
> -

It is better to put it in the correct place with the first patch,
rather than move it in the second patch.

>  	memset(&chip->tstamp_cc, 0, sizeof(chip->tstamp_cc));
>  	chip->tstamp_cc.read	= mv88e6xxx_ptp_clock_read;
>  	chip->tstamp_cc.mask	= CYCLECOUNTER_MASK(32);
> -	chip->tstamp_cc.mult	= ptp_ops->cc_coeffs->cc_mult;
> -	chip->tstamp_cc.shift	= ptp_ops->cc_coeffs->cc_shift;
> +	chip->tstamp_cc.mult	= chip->cc_coeffs->cc_mult;
> +	chip->tstamp_cc.shift	= chip->cc_coeffs->cc_shift;

Once these patches are merged, it would be nice to remove
chip->tstamp_cc.mult and chip->tstamp_cc.shift and use
chip->cc_coeffs->cc_mult and chip->cc_coeffs->cc_shift. We don't need
the same values in two places.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ