Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1103397rdg; Fri, 11 Aug 2023 09:46:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8Xok4pg/6qLkK7hkMnSK7AJbrMYLmoA4G6SkVyF0YskYGAPyuSGxmlItBMVH4qxVk3HOa X-Received: by 2002:a17:90a:fd89:b0:267:7743:9857 with SMTP id cx9-20020a17090afd8900b0026777439857mr1702479pjb.17.1691772418276; Fri, 11 Aug 2023 09:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691772418; cv=none; d=google.com; s=arc-20160816; b=itZNNOZFDOlXz3ztORxB3KLyNHUhWN/UVKZAJAR01JUj3b4f5ieVGUQBWITwzxLDqI EgohUENz/ryRdfrY1POgKZ3sLr0ZjPxWSDsfti9n3BBy20qnpyyA+CygikxSMY6ddwp4 odJFAaUp5fE/3DhIFnNa5z4hFAe2GJaR97FrJsB4zI71Lnx8Jr5sekH3IzDj0IpAAhb5 8+12SC04ao2FMPak3pVbIPJHgArIy/NMppXiRwm5x3dq/MGDuCBWoOTM6I+ZtFDltO0E oJ7QHrivXNpc/1jrZGmr2ojcBvYM3u6nyK3ZULv5MvYPYHvRKnO/xPAFEP6wjV7c0qUR 3+QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9Kmg99ifzvVDXw5iZF67CnPsk4R1aNFzdMl+/K7HXgc=; fh=3QbqESXJnchgYeOzdjIBlGxddfyGojmAihSJsrm+GQA=; b=A7T1Ze4HHuMtP+YAdwyKO5INaxrZ9JDUmCFDiOO0Dys7PPg0USMiKkuFgT9wjihSMC VY8NeApzHblQGb3eMEQG9EfYMr0S7uBFuK3mf4SLm3Ktk4Ge+94+Fpe1IayuekH52odM Ni/d/c90+82BgQEY+L/5USq9CEjFhVas2heAxAXuFnQA5zpE3lYOhrNY1ERWkEUIigUx tY6YSfZBN3RZ8BWdGQ5nJA7S3fP1kcQCSyLhB41vONb/CUpPkUdLSGHoIJMNdYVG3bo1 Af/UDGqE4I/WS+Pi/Q7DzEGav5qnGXJt6hiBjn2E/FSngohec0KuUJAPqSZE1RPc4+Vf MFMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=I0Bwbkye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w2-20020a17090aad4200b0026b2fdb4f82si571933pjv.29.2023.08.11.09.46.46; Fri, 11 Aug 2023 09:46:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=I0Bwbkye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232837AbjHKQdL (ORCPT + 99 others); Fri, 11 Aug 2023 12:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjHKQdK (ORCPT ); Fri, 11 Aug 2023 12:33:10 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72DE4109 for ; Fri, 11 Aug 2023 09:33:09 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fe85fd3d27so3612233e87.0 for ; Fri, 11 Aug 2023 09:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691771587; x=1692376387; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9Kmg99ifzvVDXw5iZF67CnPsk4R1aNFzdMl+/K7HXgc=; b=I0Bwbkye7tXfJM3o4t36qj6mD05r/dqvJZR0jcPgseHrr/gA5yyKFgQadJ5qvYL7T1 7PiYMe00V8B4o+CtGwdRqSSa6fq4sAibeJDkeTh/XtR785K1WThCx7FDzoWI7u6ISLp8 uVTa6+WSWdaXgcxm8635IeKHbyFuPCnqRTn7pxNRM3L+5WtT4eluR3dgPFwzX3FB7QJT C7U1+ho4n/2RZrX5hFrMMLnxksJIw4jmiO6bmlYF9nZsopofcgUc1iJQXMzJz6kHMC3r oopbZmOrkw+HbXvouLZxCTSo5CHikfLLhpsn1ghwL2OmtNdm3PqKzTZCkfRobWrQzB2C C/Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691771587; x=1692376387; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9Kmg99ifzvVDXw5iZF67CnPsk4R1aNFzdMl+/K7HXgc=; b=jB1MSiSLxts7WHBQVtLkgHXZMzM1aMxYYCN72UaGZa7u+nHwRNXbQfHlaE50cc1GKk BqeiedxbETtllfggwYMC0ZekiT8h7yht8c5PQpGNDQN09bk666B8mM3hvrP2wwhqSiFG UU54a58vk3qMdfeJYHbp6oY0E72CoY3Y/hgTBqtFnbl16Q8oFv8cxUj62AFX/taAHSah 8nEMEphwQMz+WL6WM7G9sloWdYzuvIqr/0S3kivV39m+T602nzkuuNTp6hHs1aD0SY/h wH85XPZJA/LI+t8id1xAfeYIBErK9qjxXhXyd7hRhQVj327MvL5fsbDVwzJA/Rjqn0TR 17rQ== X-Gm-Message-State: AOJu0YyaU3D0mUFxDvbEqMpN4acGWbs4EYEgxTy65PfBp7brZTior738 A1MMagAmzNVeVv0eg5zLn6k= X-Received: by 2002:a19:8c56:0:b0:4fe:6ff:dfcb with SMTP id i22-20020a198c56000000b004fe06ffdfcbmr1706443lfj.30.1691771587622; Fri, 11 Aug 2023 09:33:07 -0700 (PDT) Received: from [10.0.0.100] (host-85-29-92-32.kaisa-laajakaista.fi. [85.29.92.32]) by smtp.gmail.com with ESMTPSA id a5-20020a19f805000000b004fb9536bc99sm778839lff.169.2023.08.11.09.33.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Aug 2023 09:33:07 -0700 (PDT) Message-ID: <455e16aa-7e51-4ebf-ab36-2bd5db4e4f16@gmail.com> Date: Fri, 11 Aug 2023 19:35:09 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 09/11] drm/bridge: tc358768: Fix tc358768_ns_to_cnt() Content-Language: en-US To: Tomi Valkeinen , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Francesco Dolcini Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Aradhya Bhatia References: <20230804-tc358768-v1-0-1afd44b7826b@ideasonboard.com> <20230804-tc358768-v1-9-1afd44b7826b@ideasonboard.com> From: =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= In-Reply-To: <20230804-tc358768-v1-9-1afd44b7826b@ideasonboard.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/08/2023 13:44, Tomi Valkeinen wrote: > The tc358768_ns_to_cnt() is, most likely, supposed to do a div-round-up > operation, but it misses subtracting one from the dividend. > > Fix this by just using DIV_ROUND_UP(). Reviewed-by: Peter Ujfalusi > Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver") > Signed-off-by: Tomi Valkeinen > --- > drivers/gpu/drm/bridge/tc358768.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c > index 9411b0fb471e..dc2241c18dde 100644 > --- a/drivers/gpu/drm/bridge/tc358768.c > +++ b/drivers/gpu/drm/bridge/tc358768.c > @@ -630,7 +630,7 @@ static int tc358768_setup_pll(struct tc358768_priv *priv, > > static u32 tc358768_ns_to_cnt(u32 ns, u32 period_ps) > { > - return (ns * 1000 + period_ps) / period_ps; > + return DIV_ROUND_UP(ns * 1000, period_ps); > } > > static u32 tc358768_ps_to_ns(u32 ps) > -- Péter