From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A059F342CA7 for ; Sat, 30 May 2026 17:54:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780163643; cv=none; b=JilxNTa6ZmxwNCtDB5m08mglILcNA64F0h2hPs5i+G+c4aQuRedm3un7bjg9utL1W9yFqRlzCZ961FKzV1SXi0krpurbFgDxRawNN6v7eaAI+bg27evWU0qQCx5mWwQ9MDomEyUGKQ8h4llgwsXD+1JsYaRmqc6gN0XB1yI9U0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780163643; c=relaxed/simple; bh=LMcisw0sAT9zsAN9m+1zmDIoWcCr1nxRW3JQAJUBrVw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To: Content-Type:References; b=tbwco6Ji5Ia5EbvLecxyV4XS7r42JFbMVF56jjDkkoV2nDyYGYo7vPHJ2Xnc8WQliLHq9vMWmXQyHU5dE9r7Ux55xvWciC4H0intJ+u+xRH55i1oqhPe81SrfQbeyw6AT0tEZQG5OwGhij4DYr5EYZuqsU9actltdVQFnYfEcLY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=DLs/iq2U; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="DLs/iq2U" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20260530174528euoutp029ff3624ff6203978382d9785822ee6fc~0aO72YfmT0643506435euoutp02C for ; Sat, 30 May 2026 17:45:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20260530174528euoutp029ff3624ff6203978382d9785822ee6fc~0aO72YfmT0643506435euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1780163128; bh=bTDLJmGkDlSze5mlnTF045Cqf4W18oFetb77eOLT1x8=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=DLs/iq2Uwd2IhWSAOl+8zQZEeaib+dwK5qtDl8BZ4AU2+3T/pSGDx1aF9gXo7O0HK VkRIL0LPY6BsX7sl67Qr83Or1QN/glU4oeJpEbhIV97qJpmMSabbSXl6iDrAkVqhWp 4Ib6DZUVsKH6CGfEXBYY06PTJCCzj+dh3D70XYtE= Received: from eusmtip1.samsung.com (unknown [203.254.199.221]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20260530174526eucas1p1c3685340ad4d1f8d44f7c77408102f2d~0aO5_XT4K2399623996eucas1p1y; Sat, 30 May 2026 17:45:26 +0000 (GMT) Received: from [192.168.1.44] (unknown [106.210.136.40]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20260530174525eusmtip1b099a5e622db8c74e1c2c6e57e01ef74~0aO41luc40897308973eusmtip1C; Sat, 30 May 2026 17:45:24 +0000 (GMT) Message-ID: <5c017479-0d1b-434c-a859-7f52b25d7dfc@samsung.com> Date: Sat, 30 May 2026 19:45:24 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RESEND] pwm: th1520: Remove requirement for mul_u64_u64_div_u64_roundup To: Maurice Hieronymus , Drew Fustini , Guo Ren , Fu Wei , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich Cc: linux-riscv@lists.infradead.org, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Content-Language: en-US From: Michal Wilczynski In-Reply-To: <47062326dcf87b605cf4def9835394551645caa5.camel@mailbox.org> Content-Transfer-Encoding: 8bit X-CMS-MailID: 20260530174526eucas1p1c3685340ad4d1f8d44f7c77408102f2d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20260525131112eucas1p1d7e4836f71c81686e1f71e4007e344ec X-EPHeader: CA X-CMS-RootMailID: 20260525131112eucas1p1d7e4836f71c81686e1f71e4007e344ec References: <20260525-pwm-th1520-fix-v1-1-814e537c6812@mailbox.org> <8857fc45-b787-4661-b27b-8976e655f7c9@samsung.com> <1f550af5b8d1fa2aaa9936d5b0010c156e0cb455.camel@mailbox.org> <58245ce0-7271-4b07-b866-0037ff68d92c@samsung.com> <47062326dcf87b605cf4def9835394551645caa5.camel@mailbox.org> On 5/30/26 12:41, Maurice Hieronymus wrote: >> >> Apologies, I have to correct my statement from before after >> discussing > No worries! >> with Uwe. The reason the macro was used in the mentioned driver is >> NOT >> that PWM controllers have 64-bit registers - Uwe isn't aware of that >> being a real pattern either, and I was inferring it from the code >> rather >> than from hardware reality. The actual reason the macros get used >> isn't >> unified across drivers and we should pin that down separately rather >> than block your patch on it. >> >> So please hold off on the Rust helper for now - your initial patch >> might >> be the right direction. >> > Is there any further conclusion which direction is right? Can we merge > my patch, does it need some change or are we going down the road with > the Rust helpers? I think this patch is fine to move forward. We were wondering if there would be any noticeable difference in execution speed between the 64-bit computations and the mixed 32-bit/64-bit computations. I ran a profile on the platform, and the performance with and without the patch is identical: Here's the test I ran WITH PATCH # hyperfine --warmup 2 --runs 40 './pwmtestperf' Time (mean ± σ): 3.370 s ± 0.069 s [User: 0.069 s, System: 3.313 s] Range (min … max): 3.271 s … 3.547 s 40 runs WITHOUT PATCH # hyperfine --warmup 2 --runs 40 './pwmtestperf Time (mean ± σ): 3.368 s ± 0.051 s [User: 0.058 s, System: 3.326 s] Range (min … max): 3.278 s … 3.516 s 40 runs The delta is completely within the margin of error, confirming that 64-bit math is just as fast as 32-bit math on this architecture under standard loads. It is worth mentioning that to get a more meaningful performance measurement, pwmtestperf would probably need to be modified to stress this specific code path much more heavily. That said, fitting it into 32-bit where appropriate makes perfect sense from a code quality perspective. Reviewed-by: Michal Wilczynski > > Thanks! > > Maurice >>> >>> Maurice >>> >> >> Best regards, >