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 EF791C4332F for ; Sat, 10 Dec 2022 10:51:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbiLJKvA (ORCPT ); Sat, 10 Dec 2022 05:51:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbiLJKu6 (ORCPT ); Sat, 10 Dec 2022 05:50:58 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 327451C12E for ; Sat, 10 Dec 2022 02:50:57 -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=qDFOCp8xGZjhvcpjBI18iWLXCGce+evVOb7dtZx8Uso=; b=0B1urZeCoUWDgjaGJvB0YgPbyB uyM9EowfkZXhG55iJGb6ir8Cp+8NXKNW4hjNMJFXUGpRzAX6bjG+4holdbU2Xqhx85MB27cxfRC/F 0F6N+Zd/NZTNpjOtBBhSbTmMKoM/REsRR0OzVmhA32b1dH3ELo8k/TWtKVhKQr/KaI3E=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1p3xR4-004x1e-Kn; Sat, 10 Dec 2022 11:50:26 +0100 Date: Sat, 10 Dec 2022 11:50:26 +0100 From: Andrew Lunn To: Piergiorgio Beruto Cc: Kurt Kanzenbach , Jakub Kicinski , netdev@vger.kernel.org, peppe.cavallaro@st.com, Voon Weifeng , Rayagond Kokatanur , Jose Abreu , Antonio Borneo , Tan Tee Min Subject: Re: [PATCH net] stmmac: fix potential division by 0 Message-ID: References: <20221206182823.08e5f917@kernel.org> <87v8mne09m.fsf@kurt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Dec 08, 2022 at 10:27:56AM +0100, Piergiorgio Beruto wrote: > > > > > > Here's the Altera manual: > > > > > > https://www.intel.com/content/www/us/en/docs/programmable/683126/21-2/functional-description-of-the-emac.html > > > > > > Table 183 shows the minimum PTP frequencies and also states "Therefore, > > > a higher PTP clock frequency gives better system performance.". > > > > > > So, I'd say using a clock of 2.5MHz seems possible, but will result in > > > suboptimal precision. > > > > Thanks for the info. So i seems like the correct fix is to camp to > > 0xff, rather than mask with 0xff. > Andrew, given your comment, do you wish me to re-post the patch with > this fix? Or wait for more feedback first? Please post a patch. Often the only way to get feedback is to break systems :-( In this case, clamping actually seems like it could fix systems, not break them. Andrew