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 02161C352A1 for ; Wed, 7 Dec 2022 02:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiLGC23 (ORCPT ); Tue, 6 Dec 2022 21:28:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbiLGC22 (ORCPT ); Tue, 6 Dec 2022 21:28:28 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A20F7101CD for ; Tue, 6 Dec 2022 18:28:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4DAE3B81BBA for ; Wed, 7 Dec 2022 02:28:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACF8CC433D6; Wed, 7 Dec 2022 02:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670380105; bh=51irAAigSD8CTDChPJsIxhxIBXW+6KYBypkfWAsuqf8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OJN7aWbAFsRQgpHgd5tPi3CdalyIvOEKVqloL2USZs4fjByDwY+Ljo5XpmZaYH734 C3lvM498NFD+gkCjM2udnH8751A7hvRC9peKzOWQO4FOyiw5rDjxUVlEn38LAsqtc/ dKdQ5I+KCvu2izsBgDRca/XMWeXHiNtUyvdNL557iFdflLVYhEiFhKY63obWqznuKh iNeDL+5uE0Q7fbX3Z+yWnAVIqAmybYgpb7+sXuC8RRO/yhmeJOxzA8lypuf5o16e2/ +qmxqbWplpupKPtQR6nsqAth1wvVweldKPjyD6XSz3EAKfa0WQXtALuLZuBluJ6jy9 bEgRq7ApvCzGg== Date: Tue, 6 Dec 2022 18:28:23 -0800 From: Jakub Kicinski To: Andrew Lunn 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: <20221206182823.08e5f917@kernel.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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?