From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D247C352A1 for ; Wed, 7 Dec 2022 13:48:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbiLGNsb (ORCPT ); Wed, 7 Dec 2022 08:48:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbiLGNs3 (ORCPT ); Wed, 7 Dec 2022 08:48:29 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19008A19A for ; Wed, 7 Dec 2022 05:48:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=6xh1Sw7LBhI6dc4X5YjEiKcLbK9RNDnGZGqrPt2Zouc=; b=1HnoJ7aK+xEGtEzBgQwDkYsskb gLmenTi8919dnyfHLvPaAKjDMiZ77BjaTCrhrSakejUtGT6gcY1RMXfC8GOMJ5rj2g4IDQ0PyQpIj QEsC+uKgUy/x+6Z5GC+CNoX3le+SkEyBIzC/oiQni84KIObMYkGy4WDB11BoJA1//mNQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p2umd-004eoE-8x; Wed, 07 Dec 2022 14:48:23 +0100 Date: Wed, 7 Dec 2022 14:48:23 +0100 From: Andrew Lunn To: Jakub Kicinski Cc: Piergiorgio Beruto , netdev@vger.kernel.org, peppe.cavallaro@st.com, Voon Weifeng , Rayagond Kokatanur , Jose Abreu , Antonio Borneo , Tan Tee Min , Kurt Kanzenbach Subject: Re: [PATCH net] stmmac: fix potential division by 0 Message-ID: References: <20221206182823.08e5f917@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221206182823.08e5f917@kernel.org> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Dec 06, 2022 at 06:28:23PM -0800, Jakub Kicinski wrote: > On Thu, 1 Dec 2022 15:49:37 +0100 Andrew Lunn wrote: > > > The root cause is the MAC using the internal clock as a PTP reference > > > (default), which should be allowed since the connection to an external > > > PTP clock is optional from an HW perspective. The internal clock seems > > > to be derived from the MII clock speed, which is 2.5 MHz at 10 Mb/s. > > > > I think we need help from somebody who understands PTP on this device. > > The clock is clearly out of range, but how important is that to PTP? > > Will PTP work if the value is clamped to 0xff? Or should we be > > returning -EINVAL and disabling PTP because it has no chance of > > working? > > Indeed, we need some more info here :( Like does the PTP actually > work with 2.5 MHz clock? The frequency adjustment only cares about > the addend, what is sub_second_inc thing? Hi Jakub I Cc: many of the people who worked on PTP with this hardware, and nobody has replied. I think we should wait a couple more days, and then add a range check, and disable PTP for invalid clocks. That might provoke feedback. Andrew