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]
Date:	Thu, 14 Aug 2014 09:26:45 +0000
From:	"fugang.duan@...escale.com" <fugang.duan@...escale.com>
To:	Richard Cochran <richardcochran@...il.com>
CC:	"shawn.guo@...aro.org" <shawn.guo@...aro.org>,
	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH v2 1/1] net: fec: ptp: avoid register access when ipg
 clock is disabled

From: Richard Cochran <richardcochran@...il.com> Sent: Thursday, August 14, 2014 5:13 PM
>To: Duan Fugang-B38611
>Cc: shawn.guo@...aro.org; davem@...emloft.net; netdev@...r.kernel.org
>Subject: Re: [PATCH v2 1/1] net: fec: ptp: avoid register access when ipg
>clock is disabled
>
>On Thu, Aug 14, 2014 at 09:02:07AM +0000, fugang.duan@...escale.com wrote:
>>
>> I know your means. Even if cancel the time_keep work, ptp timer still is
>running and continutious.
>> The time_keep work just to avoid timer overrun because FEC just support
>32bit counter.
>
>Right, so the time_keep must continue when the clock is running. It does
>not depend on whether time stamping is enabled.

So, your mean we need to start the time_keep early like the orignal method, on the contrary,
The patch like below is not reasonable:

@@ -289,9 +289,11 @@ int fec_ptp_set(struct net_device *ndev, struct ifreq *ifr)
        switch (config.tx_type) {
        case HWTSTAMP_TX_OFF:
                fep->hwts_tx_en = 0;
+               cancel_delayed_work_sync(&fep->time_keep);
                break;
        case HWTSTAMP_TX_ON:
                fep->hwts_tx_en = 1;
+               schedule_delayed_work(&fep->time_keep, HZ);
                break;
        default:

>
>> And, you said "return an error", I don't know your mean.
>> In addition, when clock is disabled, FEC ptp counter don't run any more.
>
>You can return an error from your 'gettime' method.
>
In the driver:
Gettime()->fec_ptp_gettime()->timecounter_read()->fec_ptp_read()
Period delayed work: fec_time_keep()->timecounter_read()->fec_ptp_read()

When ethx disable, all clocks are disabled. For gettime(), your mean that we check clock is on or not,
If clock is disabled, return an error in .fec_ptp_gettime() ?
How did it in the delayed work ?

Thanks for your review, I am confused by your suggestion.

Thanks,
Andy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ