Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp929718ybm; Wed, 27 May 2020 11:25:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrKzpB6IXqwA90OzMAiez+uFUqIjjVuAz3dvjWviP13+oPY8cXJRJD8ZrnwKcjovmO5pTY X-Received: by 2002:a17:906:4d9a:: with SMTP id s26mr2844046eju.153.1590603932052; Wed, 27 May 2020 11:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590603932; cv=none; d=google.com; s=arc-20160816; b=bsNoqR9hx64+6cMa1BdDtnb44yqykgOLw+VjZFZj22QUM50L2wQgDqCdQdG1SF+Zo5 xZNt3YI9r7Exv7DUByTtvfcEzllDC78kUFts2hgbdj8H+XYc7miCBLwl+vkgziUuDsux iLkKukG5rDp7+JkamG6Xk6zZC1nfi2BYPJKL4Ju3xviw+jjCXeBVbVF41VFO+P9dnVpw cYmZsDpcm8t3mzXn/9hQRj8gCuer/U+kyPEn38UNPop+oRq3I6/2QGYoclPAmjLQXevW RmtJZRYSghgRg47UYUu51jNexSSBItTZO3WAVQjcD6Ai5Tal9d4QS7Zl7oMvpL71nIjx /qGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:from :references:cc:to:subject:dkim-signature; bh=fDQQL5F7NUmi63rPrswmsLUk/cVgqyfGJGxuaKIuerc=; b=YPnKKjMqvZ0hFGrH969OfrodrEmIrm1NBFuQ2iTPHfgj+q+3ARwuPDSyYN0HewxaV7 G8sulGxtJHufyF5W5/RubuxpnhAWMJGCDvA5iWxJB2iYRFo2qlFZAaOB2X3s0RNjEXwe T3qy3HEQGZvCqfo880/kvwEjjM0tUeED4YIVUdnPqz+dztj9hQTHr+3HsiNYmLvkn1AV NJdGqaNBjXioJQdMpaiAeHeD4jklAniQYJ26N/zc1ZcU4GC74GFX9XwlnqPAIhd6eGqw c84NkM5XeiKi+GIgwwHASEqXfht7DYY0b5LgQTjClpsBTmFXT1BVRLi4JWJUtqokyVoH MkKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZCfDeGHg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s17si2111454edi.175.2020.05.27.11.25.09; Wed, 27 May 2020 11:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZCfDeGHg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389171AbgE0OZv (ORCPT + 98 others); Wed, 27 May 2020 10:25:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389166AbgE0OZv (ORCPT ); Wed, 27 May 2020 10:25:51 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C377C08C5C2 for ; Wed, 27 May 2020 07:25:51 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id x13so9541589wrv.4 for ; Wed, 27 May 2020 07:25:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=fDQQL5F7NUmi63rPrswmsLUk/cVgqyfGJGxuaKIuerc=; b=ZCfDeGHgkwr9TFZB7Uml9rT03xtCxGugZtuvCoEluYZeBMY+Zqnsl0kcvlkhXRNGqz X/wqEce2QJwMvlOEWvyZCRr5ThtZLuPdaeJpQ4tRravGdAhTpNCG3RidS6TR6FEK7jQe xgbabj5Rbgy+aHWCIAeoT1EIhIud36GwUbMiLV8IenWT3D+J6P+7Nbh58l4sHwX8yxGm V5B4IbAZe2+mr28zJCRks0RPTruIX6rnWi8Hja7ozZyFnX1h37SiL5JvkzLoK0JQqoJA bfw8rb95Fk+XKZAV2iKSSfW5p/3nGTKi51epUNCGCmJHz4vMFfXRpzm8OUlTvTnI1CnB uClg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fDQQL5F7NUmi63rPrswmsLUk/cVgqyfGJGxuaKIuerc=; b=GTCpzYsNk4oIX2R6sco1rcvgZ3m9TU//ukek/4IkQUVKbQh0siQ8MH0cqtDuE6dSjV clQzepnOPLvoUbsaxxH5w42Y8WRG2E9ieWdOtS1BO6FleQpldYl1igQ567cagjBin+Qj nQU6sslPfen2QD5V8J8Ma4oYSlxmnoEI+/CvvUSzlVem7U2BxBu93CgUmhix5CgXh6P4 i0qzOo452QyofpjyPa5gtDboQyUd3bOr+lHy5QwpFYo4I40xJOb12xofV7NqBzmIB/pU dZTkZnEBaW3BCArmDmC7nJHXGWGDNS7CGMp6xN+Mz4KEx3MXr3s6HME9P6d/Xv2cPN0A 0+aA== X-Gm-Message-State: AOAM531cwlSZKO/WvvjN+8Jmsh+sIZ5ktdA6CQb1LiOGdnXLPz2EroSw 9pp5ORhdL1mg/M2b/+oZMIYeLL47Ax8x5w== X-Received: by 2002:a5d:4488:: with SMTP id j8mr17764483wrq.242.1590589549429; Wed, 27 May 2020 07:25:49 -0700 (PDT) Received: from macbook.local ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id i21sm3110144wml.5.2020.05.27.07.25.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 May 2020 07:25:48 -0700 (PDT) Subject: Re: [PATCH] drm/msm/dpu: avoid open-coded 64-bit division To: Arnd Bergmann , Rob Clark , Kalyan Thota Cc: Matthias Kaehlcke , Sibi Sankar , Viresh Kumar , Evan Green , Akash Asthana , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200527133543.599948-1-arnd@arndb.de> From: Georgi Djakov Message-ID: <9f910f55-1057-8c44-ceda-e0593fb13ffe@linaro.org> Date: Wed, 27 May 2020 17:25:46 +0300 MIME-Version: 1.0 In-Reply-To: <20200527133543.599948-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Georgi Djakov 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 > > /* 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) >