mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Georgi Djakov <georgi.djakov@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>, Rob Clark <robdclark@chromium.org>,
	Kalyan Thota <kalyan_t@codeaurora.org>
Cc: Matthias Kaehlcke <mka@chromium.org>,
	Sibi Sankar <sibis@codeaurora.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Evan Green <evgreen@chromium.org>,
	Akash Asthana <akashast@codeaurora.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/msm/dpu: avoid open-coded 64-bit division
Date: Wed, 27 May 2020 17:25:46 +0300	[thread overview]
Message-ID: <9f910f55-1057-8c44-ceda-e0593fb13ffe@linaro.org> (raw)
In-Reply-To: <20200527133543.599948-1-arnd@arndb.de>

On 27.05.20 16:35, Arnd Bergmann wrote:
> 64-bit integer division is normally not allowed in the kernel
> because of the large overhead on 32-bit machines:
> 
> drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.o: in function `_dpu_core_perf_crtc_update_bus':
> dpu_core_perf.c:(.text+0x810): undefined reference to `__aeabi_uldivmod'
> 
> The function already contains a call to do_div(), so I assume this
> is never called in a performance critical context, and we can
> use div_u64 for the second one as well.
> 
> Fixes: 04d9044f6c57 ("drm/msm/dpu: add support for clk and bw scaling for display")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Georgi Djakov <georgi.djakov@linaro.org>

Thanks for the patch Arnd. I just noticed this in linux-next.

Rob, could you please take it into msm-next, as the patch which
triggers the issue is also there?

Thanks,
Georgi

> ---
>  include/linux/interconnect.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/interconnect.h b/include/linux/interconnect.h
> index 3a63d98613fc..8279fe9b2082 100644
> --- a/include/linux/interconnect.h
> +++ b/include/linux/interconnect.h
> @@ -11,7 +11,7 @@
>  #include <linux/types.h>
>  
>  /* macros for converting to icc units */
> -#define Bps_to_icc(x)	((x) / 1000)
> +#define Bps_to_icc(x)	div_u64((x), 1000)
>  #define kBps_to_icc(x)	(x)
>  #define MBps_to_icc(x)	((x) * 1000)
>  #define GBps_to_icc(x)	((x) * 1000 * 1000)
> 


      reply	other threads:[~2020-05-27 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 13:35 Arnd Bergmann
2020-05-27 14:25 ` Georgi Djakov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f910f55-1057-8c44-ceda-e0593fb13ffe@linaro.org \
    --to=georgi.djakov@linaro.org \
    --cc=akashast@codeaurora.org \
    --cc=arnd@arndb.de \
    --cc=evgreen@chromium.org \
    --cc=kalyan_t@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=robdclark@chromium.org \
    --cc=sibis@codeaurora.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®