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 X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 387CBC2D0F8 for ; Wed, 13 May 2020 00:42:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DCBF20753 for ; Wed, 13 May 2020 00:42:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CUMGA/J4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DCBF20753 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=lRGNNS9H+X3AleovnuU4KWXg/DrRSRxmGujBt5xCBd4=; b=CUM GA/J4ktfjvP2IsdIFWPqOBHsFMvQjXUsQTbjfU0RrNtTxchvs33Tlg/+XRGO1axZRjyj3VLlMVC+9 3EZAiob6cTgLmxwHhD3zaYA5UGkhav/qnFLKQz/VMx4ygL0e7aYwNgVtICbjp+1g4bzgfT+/c72W7 ZplHyaSXod5NEDNkBbTlb+snWTmqgZMTDk9bMt3mJQdOzclMQMY0JpuBeyqVSP8bwjQgbhJvyBzy4 aOBcvLjNRJJIF418Xoyvc3M5oFR/QDGl1RuXH/jxyk35AMt9aBmkpyzMSglpO8erEsnX9R/M0jQLH QyJnaQ8KdCTmTuog4DcFKR6vZQxZTrw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYfTy-0000CR-00; Wed, 13 May 2020 00:42:46 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYfRC-0003qz-54 for linux-arm-kernel@lists.infradead.org; Wed, 13 May 2020 00:39:56 +0000 Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-02.qualcomm.com with ESMTP; 12 May 2020 17:39:48 -0700 Received: from gurus-linux.qualcomm.com ([10.46.162.81]) by ironmsg03-sd.qualcomm.com with ESMTP; 12 May 2020 17:39:47 -0700 Received: by gurus-linux.qualcomm.com (Postfix, from userid 383780) id 437E94D95; Tue, 12 May 2020 17:39:47 -0700 (PDT) From: Guru Das Srinagesh To: linux-pwm@vger.kernel.org, Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Subject: [RESEND PATCH v14 00/11] Convert PWM period and duty cycle to u64 Date: Tue, 12 May 2020 17:39:33 -0700 Message-Id: X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_173954_256470_25C18CDE X-CRM114-Status: GOOD ( 16.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Guru Das Srinagesh , Daniel Thompson , Arnd Bergmann , David Collins , Stephen Boyd , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Dan Carpenter , Joe Perches , Subbaraman Narayanamurthy , Lee Jones , Guenter Roeck MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Because period and duty cycle are defined in the PWM framework structs as ints with units of nanoseconds, the maximum time duration that can be set is limited to ~2.147 seconds. Consequently, applications desiring to set greater time periods via the PWM framework are not be able to do so - like, for instance, causing an LED to blink at an interval of 5 seconds. Redefining the period and duty cycle struct members in the core PWM framework structs as u64 values will enable larger time durations to be set and solve this problem. Such a change to the framework mandates that drivers using these struct members (and corresponding helper functions) also be modified correctly in order to prevent compilation errors. This patch series introduces the changes to all the drivers first, followed by the framework change at the very end so that when the latter is applied, all the drivers are in good shape and there are no compilation errors. Changes from v13: - Pruned cc-list and added same (reduced) set of reviewers to all patches. - Added Lee Jones' Acked-by to the pwm_bl.c patch. - Added Jani Nikula's Acked-by to intel-panel.c patch. - Added Stephen Boyd's Acked-by to pwm-clk.c patch. - Addressed Geert's review comments in clps711x.c patch. Changes from v12: - Rebased to tip of for-next - Collected Acked-by for sun4i - Reworked patch for intel-panel.c due to rebase, dropped Jani's Acked-by as a result Changes from v11: - Rebased to tip of for-next. - Collected "Acked-by:" for v7 (unchanged) of pwm: sifive: [4] - Squished stm32-lp.c change with final patch in series - sun4i: Used nsecs_to_jiffies() - imx27: Added overflow handling logic - clps711x: Corrected the if condition for skipping the division - clk: pwm: Reverted to v8 version, added check to prevent division-by-zero Changes from v10: - Carefully added back all the "Reviewed-by: " and "Acked-by: " tags received so far that had gotten missed in v9. No other changes. Changes from v9: - Gathered the received "Reviewed-by: " tag - Added back the clk-pwm.c patch because kbuild test robot complained [3] and addressed received review comments. - clps711x: Addressed review comments. Changes from v8: - Gathered all received "Acked-by: " and "Reviewed-by: " tags - Dropped patch to clk-pwm.c for reasons mentiond in [2] - Expanded audience of unreviewed patches Changes from v7: - Changed commit messages of all patches to be brief and to the point. - Added explanation of change in cover letter. - Dropped change to pwm-sti.c as upon review it was unnecessary as struct pwm_capture is not being modified in the PWM core. Changes from v6: - Split out the driver changes out into separate patches, one patch per file for ease of reviewing. Changes from v5: - Dropped the conversion of struct pwm_capture to u64 for reasons mentioned in https://www.spinics.net/lists/linux-pwm/msg11541.html Changes from v4: - Split the patch into two: one for changes to the drivers, and the actual switch to u64 for ease of reverting should the need arise. - Re-examined the patch and made the following corrections: * intel_panel.c: DIV64_U64_ROUND_UP -> DIV_ROUND_UP_ULL (as only the numerator would be 64-bit in this case). * pwm-sti.c: do_div -> div_u64 (do_div is optimized only for x86 architectures, and div_u64's comment block suggests to use this as much as possible). Changes from v3: - Rebased to current tip of for-next. Changes from v2: - Fixed %u -> %llu in a dev_dbg in pwm-stm32-lp.c, thanks to kbuild test robot - Added a couple of fixes to pwm-imx-tpm.c and pwm-sifive.c Changes from v1: - Fixed compilation errors seen when compiling for different archs. v1: - Reworked the change pushed upstream earlier [1] so as to not add an extension to an obsolete API. With this change, pwm_ops->apply() can be used to set pwm_state parameters as usual. [1] https://lore.kernel.org/lkml/20190916140048.GB7488@ulmo/ [2] https://lore.kernel.org/lkml/20200312190859.GA19605@xxxxxxxxxxxxxx/ [3] https://www.spinics.net/lists/linux-pwm/msg11906.html [4] https://www.spinics.net/lists/linux-pwm/msg11986.html Guru Das Srinagesh (11): drm/i915: Use 64-bit division macro hwmon: pwm-fan: Use 64-bit division macro ir-rx51: Use 64-bit division macro pwm: clps711x: Cast period to u32 before use as divisor pwm: pwm-imx-tpm: Use 64-bit division macro pwm: imx27: Use 64-bit division macro and function pwm: sifive: Use 64-bit division macro pwm: sun4i: Use nsecs_to_jiffies to avoid a division backlight: pwm_bl: Use 64-bit division function clk: pwm: Use 64-bit division function pwm: core: Convert period and duty cycle to u64 drivers/clk/clk-pwm.c | 7 +++- drivers/gpu/drm/i915/display/intel_panel.c | 2 +- drivers/hwmon/pwm-fan.c | 2 +- drivers/media/rc/ir-rx51.c | 3 +- drivers/pwm/core.c | 14 ++++---- drivers/pwm/pwm-clps711x.c | 5 ++- drivers/pwm/pwm-imx-tpm.c | 2 +- drivers/pwm/pwm-imx27.c | 53 +++++++++++++++++++++++++----- drivers/pwm/pwm-sifive.c | 2 +- drivers/pwm/pwm-stm32-lp.c | 2 +- drivers/pwm/pwm-sun4i.c | 2 +- drivers/pwm/sysfs.c | 8 ++--- drivers/video/backlight/pwm_bl.c | 3 +- include/linux/pwm.h | 12 +++---- 14 files changed, 82 insertions(+), 35 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7D80C433E0 for ; Wed, 20 May 2020 22:58:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B1D320708 for ; Wed, 20 May 2020 22:58:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pzlNu7DI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B1D320708 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=hC5mFQX4ECT3mDH3zqnYC4VRR5M5sSMnjonNaqIc9oU=; b=pzl Nu7DITYtmOlfNg+WgQvBLlpUVY55Ox9jFsx6JIUrhI1+B+6uqRWoEEqe1bc8HJELQ6ZctnBdzkkKP LbxfziUX9zEl9lp6NZHVsIxWqbmjB7SS87RU+CpW3cYxWSWMKA+GiBYA6MRURDwkGF68pnqfPzRec LGyrUZzrc41d+J2gHIsrBS4A7lBIeWgkZ566L/SXgJIjhvSEWKrT+3/MG8zDL5Eb5fCrgagEIAYRR QgT0+lG3MKJh23ZTkRe6FzC72n4qXzJiAKjLbgGbAHLAGZJMEkTuh3HQnCyJaIkMxXMrD+Uc4emV3 q2MmmaboUToj9r+Y8v0dxAU3ubFHkKA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbXfO-0002PS-Bm; Wed, 20 May 2020 22:58:26 +0000 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jbXdK-0000vt-Od for linux-arm-kernel@lists.infradead.org; Wed, 20 May 2020 22:56:48 +0000 Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 20 May 2020 15:56:06 -0700 Received: from gurus-linux.qualcomm.com ([10.46.162.81]) by ironmsg-SD-alpha.qualcomm.com with ESMTP; 20 May 2020 15:56:06 -0700 Received: by gurus-linux.qualcomm.com (Postfix, from userid 383780) id 574F44D8D; Wed, 20 May 2020 15:56:06 -0700 (PDT) From: Guru Das Srinagesh To: linux-pwm@vger.kernel.org, Thierry Reding , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Subject: [RESEND PATCH v14 00/11] Convert PWM period and duty cycle to u64 Date: Wed, 20 May 2020 15:55:53 -0700 Message-ID: X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200520_155618_861710_1AA3BD0D X-CRM114-Status: GOOD ( 16.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Guru Das Srinagesh , Daniel Thompson , Arnd Bergmann , David Collins , Stephen Boyd , linux-kernel@vger.kernel.org, Geert Uytterhoeven , Dan Carpenter , Joe Perches , Subbaraman Narayanamurthy , Lee Jones , Guenter Roeck MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Message-ID: <20200520225553.PSbqbud7SrR5pUtZWmpSQJad7ICTCWQ22kIxtlUsEq8@z> [REQUEST] As the patch series stands currently, only 4 out of 11 patches remain unreviewed. All the other patches have either an Acked-by or a Reviewed-by tag. Could these remaining patches in the series be reviewed as well? - 04/11 - 05/11 - 06/11 - 11/11 [COVER LETTER] Because period and duty cycle are defined in the PWM framework structs as ints with units of nanoseconds, the maximum time duration that can be set is limited to ~2.147 seconds. Consequently, applications desiring to set greater time periods via the PWM framework are not be able to do so - like, for instance, causing an LED to blink at an interval of 5 seconds. Redefining the period and duty cycle struct members in the core PWM framework structs as u64 values will enable larger time durations to be set and solve this problem. Such a change to the framework mandates that drivers using these struct members (and corresponding helper functions) also be modified correctly in order to prevent compilation errors. This patch series introduces the changes to all the drivers first, followed by the framework change at the very end so that when the latter is applied, all the drivers are in good shape and there are no compilation errors. Changes from v13: - Pruned cc-list and added same (reduced) set of reviewers to all patches. - Added Lee Jones' Acked-by to the pwm_bl.c patch. - Added Jani Nikula's Acked-by to intel-panel.c patch. - Added Stephen Boyd's Acked-by to pwm-clk.c patch. - Addressed Geert's review comments in clps711x.c patch. Changes from v12: - Rebased to tip of for-next - Collected Acked-by for sun4i - Reworked patch for intel-panel.c due to rebase, dropped Jani's Acked-by as a result Changes from v11: - Rebased to tip of for-next. - Collected "Acked-by:" for v7 (unchanged) of pwm: sifive: [4] - Squished stm32-lp.c change with final patch in series - sun4i: Used nsecs_to_jiffies() - imx27: Added overflow handling logic - clps711x: Corrected the if condition for skipping the division - clk: pwm: Reverted to v8 version, added check to prevent division-by-zero Changes from v10: - Carefully added back all the "Reviewed-by: " and "Acked-by: " tags received so far that had gotten missed in v9. No other changes. Changes from v9: - Gathered the received "Reviewed-by: " tag - Added back the clk-pwm.c patch because kbuild test robot complained [3] and addressed received review comments. - clps711x: Addressed review comments. Changes from v8: - Gathered all received "Acked-by: " and "Reviewed-by: " tags - Dropped patch to clk-pwm.c for reasons mentiond in [2] - Expanded audience of unreviewed patches Changes from v7: - Changed commit messages of all patches to be brief and to the point. - Added explanation of change in cover letter. - Dropped change to pwm-sti.c as upon review it was unnecessary as struct pwm_capture is not being modified in the PWM core. Changes from v6: - Split out the driver changes out into separate patches, one patch per file for ease of reviewing. Changes from v5: - Dropped the conversion of struct pwm_capture to u64 for reasons mentioned in https://www.spinics.net/lists/linux-pwm/msg11541.html Changes from v4: - Split the patch into two: one for changes to the drivers, and the actual switch to u64 for ease of reverting should the need arise. - Re-examined the patch and made the following corrections: * intel_panel.c: DIV64_U64_ROUND_UP -> DIV_ROUND_UP_ULL (as only the numerator would be 64-bit in this case). * pwm-sti.c: do_div -> div_u64 (do_div is optimized only for x86 architectures, and div_u64's comment block suggests to use this as much as possible). Changes from v3: - Rebased to current tip of for-next. Changes from v2: - Fixed %u -> %llu in a dev_dbg in pwm-stm32-lp.c, thanks to kbuild test robot - Added a couple of fixes to pwm-imx-tpm.c and pwm-sifive.c Changes from v1: - Fixed compilation errors seen when compiling for different archs. v1: - Reworked the change pushed upstream earlier [1] so as to not add an extension to an obsolete API. With this change, pwm_ops->apply() can be used to set pwm_state parameters as usual. [1] https://lore.kernel.org/lkml/20190916140048.GB7488@ulmo/ [2] https://lore.kernel.org/lkml/20200312190859.GA19605@xxxxxxxxxxxxxx/ [3] https://www.spinics.net/lists/linux-pwm/msg11906.html [4] https://www.spinics.net/lists/linux-pwm/msg11986.html Guru Das Srinagesh (11): drm/i915: Use 64-bit division macro hwmon: pwm-fan: Use 64-bit division macro ir-rx51: Use 64-bit division macro pwm: clps711x: Cast period to u32 before use as divisor pwm: pwm-imx-tpm: Use 64-bit division macro pwm: imx27: Use 64-bit division macro and function pwm: sifive: Use 64-bit division macro pwm: sun4i: Use nsecs_to_jiffies to avoid a division backlight: pwm_bl: Use 64-bit division function clk: pwm: Use 64-bit division function pwm: core: Convert period and duty cycle to u64 drivers/clk/clk-pwm.c | 7 +++- drivers/gpu/drm/i915/display/intel_panel.c | 2 +- drivers/hwmon/pwm-fan.c | 2 +- drivers/media/rc/ir-rx51.c | 3 +- drivers/pwm/core.c | 14 ++++---- drivers/pwm/pwm-clps711x.c | 5 ++- drivers/pwm/pwm-imx-tpm.c | 2 +- drivers/pwm/pwm-imx27.c | 53 +++++++++++++++++++++++++----- drivers/pwm/pwm-sifive.c | 2 +- drivers/pwm/pwm-stm32-lp.c | 2 +- drivers/pwm/pwm-sun4i.c | 2 +- drivers/pwm/sysfs.c | 8 ++--- drivers/video/backlight/pwm_bl.c | 3 +- include/linux/pwm.h | 12 +++---- 14 files changed, 82 insertions(+), 35 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel