Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1801229rda; Tue, 24 Oct 2023 03:56:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEq/I09Br3XQh+/AvtqpROhnJat+c5IL4GkddlQ+6VEJXEdUNrEKGJht9OgFuIOXZUFOfG9 X-Received: by 2002:a17:902:d487:b0:1ca:dee1:4d1a with SMTP id c7-20020a170902d48700b001cadee14d1amr6228345plg.25.1698144995399; Tue, 24 Oct 2023 03:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698144995; cv=none; d=google.com; s=arc-20160816; b=sBXemFeYqk+/DXmWdxS4hMKi2znsB17ikSLmu2b3EUGbb1PSu7lK25msJjczcn34HJ f9IJDzLxMIQQXMm4u8D0up3sE/5ZpLHOtLBOLLstYzll8vaTDYUswANPZkPzUYhMyBuj GgSjrg3jL4dmME5NltMNxNgeiW45l78liDRfg/5/LwLxszSRnhjj/8nObdOxuGJNIJpQ Hou6y+XCthMp/9HovAovHnvzX9Jcp5cdbgJHMkW7zfSs1KOa1RXbZQH05dedHCUzVAb2 2Q4a5t2AePBj1aFm+EYSQdSk+tYKQlZ8WB2bB5PXSeMKDf9r5SbCrHzZx1MuhPm3DKCP 1y+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=nwVSc2jleQxVGrepOOjUKlRr0MJ2IteitrEC0RX+MiM=; fh=7DrigCZUhoQC9ll3dUNPxRxg3Ihrn42ZJRnnM5GUG/s=; b=oml/Smj0jTL5KBIyz1e4z41YWJCa0ZUU2VbjTbFqMgiz9RMcG2KCpjOXCLmSheWlah VkG0eplHQ9+m+wS0d1uK3jsq14ObPhS92c3Ojw79w7hNzhRAWVpUnNwZRvi0aJv13q/Z ZMLHPddoTh3bAGP3KnduRXNOW/VLfc8NyNPQR9+sihMLmDWAP9jUTfvSqEWwa3BPrZZX vaWzTw4vZ3pfMWQgkkRno+3GLT+UpL5fFvly2DoVJDPpfK3tLEN6dcgUrPGFA1lRngJh cmkPibvjZxpU5ATdcRa6SHIBzM2HGpRU5skSXuXs/DFJW2wKgIsl2jopcL60SCrB5975 DmYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="kUukX/5F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id x1-20020a1709028ec100b001c5f37aeebdsi8134166plo.579.2023.10.24.03.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 03:56:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="kUukX/5F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 85D6B8078674; Tue, 24 Oct 2023 03:56:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233496AbjJXKzz (ORCPT + 99 others); Tue, 24 Oct 2023 06:55:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232854AbjJXKzx (ORCPT ); Tue, 24 Oct 2023 06:55:53 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F92510C6; Tue, 24 Oct 2023 03:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698144950; x=1729680950; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rP21uFRnfVWXZ25USLUeupGk34jQ/H1beVBH1jodnfM=; b=kUukX/5FAYHUo7Yffbwg5xd5rzltW2nXM0q34AH8L7xGhrLvq0vY/+PS HNqZei+GjOlAwMszQ39DQJ3fiPBLzJ87ZTyNl7JxyYiayUL+DDjHCVRS2 flQLSdALx5/8TyLDWfZqwa9AIn9lri5V7k0eeuNREEGhJwrrjNB9nKh1g faYSwqajL0qWcV3OY2dfU1w6lEb/yzlrwgeIYzA0jDz+866DYLXKL13sK 2CiTPF1ZZZHARHpwa8Cr3zWMNbkzWfR65gzIkoel2MI7lfJD3muRx83Ja aYzL0taA414vToDqfQvDTmJmTdRZExUJFIBNjt9rSr4FsotGF+Mdo4eii g==; X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="389879602" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="389879602" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 03:55:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10872"; a="1089802807" X-IronPort-AV: E=Sophos;i="6.03,247,1694761200"; d="scan'208";a="1089802807" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2023 03:55:47 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC2) (envelope-from ) id 1qvF4a-00000008BgP-3Kkn; Tue, 24 Oct 2023 13:55:44 +0300 Date: Tue, 24 Oct 2023 13:55:44 +0300 From: Andy Shevchenko To: Stephen Boyd Cc: David Laight , Michael Turquette , Sebastian Reichel , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v3 1/1] clk: divider: Fix divisor masking on 64 bit platforms Message-ID: References: <20230630183835.464216-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 24 Oct 2023 03:56:07 -0700 (PDT) On Mon, Oct 23, 2023 at 08:34:12PM -0700, Stephen Boyd wrote: > Quoting Sebastian Reichel (2023-06-30 11:38:35) > > --- a/include/linux/math.h > > +++ b/include/linux/math.h > > @@ -36,6 +36,17 @@ > > > > #define DIV_ROUND_UP __KERNEL_DIV_ROUND_UP > > > > +/** > > + * DIV_ROUND_UP_NO_OVERFLOW - divide two numbers and always round up > > + * @n: numerator / dividend > > + * @d: denominator / divisor > > + * > > + * This functions does the same as DIV_ROUND_UP, but internally uses a > > + * division and a modulo operation instead of math tricks. This way it > > + * avoids overflowing when handling big numbers. > > + */ > > +#define DIV_ROUND_UP_NO_OVERFLOW(n, d) (((n) / (d)) + !!((n) % (d))) > > Can you get someone to review/ack this macro? Maybe Andy? > > > + > > #define DIV_ROUND_DOWN_ULL(ll, d) \ > > ({ unsigned long long _tmp = (ll); do_div(_tmp, d); _tmp; }) First of all, it should be a separate patch and second, same issue is being discussed here (as it needs to be fixed in UAPI header directly): https://lore.kernel.org/all/your-ad-here.call-01697881440-ext-2458@work.hours/ -- With Best Regards, Andy Shevchenko