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: <1c768936-9306-4bb9-8a2f-1e21e09e4b56@shenghaoyang.info>
Date: Sun, 13 Oct 2024 13:26:53 +0800
From: Shenghao Yang <me@...nghaoyang.info>
To: Andrew Lunn <andrew@...n.ch>
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
>>  struct mv88e6xxx_ptp_ops;
>>  struct mv88e6xxx_pcs_ops;
>> +struct mv88e6xxx_cc_coeffs;
>>  
>> -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.

Hi Andrew,

Thanks! Happy to spin a v3 if preferred.
 
>>  	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.

I've looked around a bit and this doesn't seem possible - the common
timecounter code in time/timecounter.c and linux/timecounter.h has a
dependency on the cc_mult and cc_shift fields within the cyclecounter
tstamp_cc.

We can't remove that dependency without specializing it for mv88e6xxx.

Shenghao


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ