Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3449710pxb; Tue, 19 Apr 2022 02:50:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT3q4S/+iqP5YFpHm1pCiJ2PH7GZF/Ga1dMxphXLO2UjiBnA9UCqsgeyfUHa2k9hlsO+41 X-Received: by 2002:a17:902:eb46:b0:158:341d:93a3 with SMTP id i6-20020a170902eb4600b00158341d93a3mr14769500pli.1.1650361857195; Tue, 19 Apr 2022 02:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650361857; cv=none; d=google.com; s=arc-20160816; b=hexC0fE+QMlgG8i11A/N9jYZsSbaqkWZvwnDgqlK9rLXh7x1IAYfLTzjz7EjeNc4mj 7YmbAG0OnZDPdHBAIZz58keHDMX0nKp/q+u1skt7mdRjIhSXVf+2zAhige/lEwSypJXR ax1OI5RCFPaBd6NK8gJw4u5ZXo5p6EYyBoDJW5S9S3klachpj+HQZG3JNobqgKSDCl4k 4uy9H1E/3O2+nkLTNDxZIqKkMvwXE3J2mM8BWErt4HTPcmrlUtXHuB6lXxlWrydkWo2K 5Oyj+5dvgOkgu22NnoliwqlqhGs7eqS1cPYdnsYeNu+5sy1uB6S/cuT7W6LE+mS6ceII Ss0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ymKc93JxwMqmbqjWtr9uSADMKuAwzwGd8SwuaiAH5wE=; b=byLyw8iQKdGxcQlPQAQvNaig3z2cUGjFoDXFK42zkBbcp8+oDzJWnUxjYjoF1IRvm8 XNeOXrtpJ2pejmsfNFeZXHr/Wy/dKvE5ZkfxT1SDc3ciVkPVNfhczjUkCtLAYzYmIKfx pw3IvK/fJd+eeb8jib/H3xw0ta0a9Ws5artA+4hR4jeDiTPhbfyMGU9TIFUojxPqyEyR mSowYoXM9F5EZMZN7FRfuFimtltI3Yd0IyoT9DLljUTuceEbsqYGEvdaXnTYnt65aNY7 SSXZHYMVjgoN2mTComByQaIHCe83uwRuTGeTEVn3wvIZt7Ao5FSIq2zs86gig/r/VIUe drCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g5DmO9Xj; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l35-20020a635b63000000b0039d9d404482si11366041pgm.570.2022.04.19.02.50.41; Tue, 19 Apr 2022 02:50:57 -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=@linuxfoundation.org header.s=korg header.b=g5DmO9Xj; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239319AbiDRMcu (ORCPT + 99 others); Mon, 18 Apr 2022 08:32:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239768AbiDRM2q (ORCPT ); Mon, 18 Apr 2022 08:28:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1F0F222BF; Mon, 18 Apr 2022 05:22:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 71D9460F0C; Mon, 18 Apr 2022 12:22:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FB09C385A9; Mon, 18 Apr 2022 12:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284551; bh=h3/4h0H471UJtADRLo2a8XhpcTHhAAbQKbJpOEoncW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5DmO9XjABtqtoO5wtVAHfcwN8eTjGcoEj20cxy2LMC1+s1EJpjxyCpZT0CZN8Z33 TR011tlSkQbFtBTzDH7EgORObr+uBK374z223QcNuWs5hQlA8pLZsm2bO/ZH+6YgOW i/k8h1KDcpEhfiwwp13jbibz29NBNYsqUXTkwLgM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leo Ruan , Mark Jonas , Philipp Zabel , Sasha Levin Subject: [PATCH 5.17 152/219] gpu: ipu-v3: Fix dev_dbg frequency output Date: Mon, 18 Apr 2022 14:12:01 +0200 Message-Id: <20220418121211.141002550@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Leo Ruan [ Upstream commit 070a88fd4a03f921b73a2059e97d55faaa447dab ] This commit corrects the printing of the IPU clock error percentage if it is between -0.1% to -0.9%. For example, if the pixel clock requested is 27.2 MHz but only 27.0 MHz can be achieved the deviation is -0.8%. But the fixed point math had a flaw and calculated error of 0.2%. Before: Clocks: IPU 270000000Hz DI 24716667Hz Needed 27200000Hz IPU clock can give 27000000 with divider 10, error 0.2% Want 27200000Hz IPU 270000000Hz DI 24716667Hz using IPU, 27000000Hz After: Clocks: IPU 270000000Hz DI 24716667Hz Needed 27200000Hz IPU clock can give 27000000 with divider 10, error -0.8% Want 27200000Hz IPU 270000000Hz DI 24716667Hz using IPU, 27000000Hz Signed-off-by: Leo Ruan Signed-off-by: Mark Jonas Reviewed-by: Philipp Zabel Signed-off-by: Philipp Zabel Link: https://lore.kernel.org/r/20220207151411.5009-1-mark.jonas@de.bosch.com Signed-off-by: Sasha Levin --- drivers/gpu/ipu-v3/ipu-di.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c index 666223c6bec4..0a34e0ab4fe6 100644 --- a/drivers/gpu/ipu-v3/ipu-di.c +++ b/drivers/gpu/ipu-v3/ipu-di.c @@ -447,8 +447,9 @@ static void ipu_di_config_clock(struct ipu_di *di, error = rate / (sig->mode.pixelclock / 1000); - dev_dbg(di->ipu->dev, " IPU clock can give %lu with divider %u, error %d.%u%%\n", - rate, div, (signed)(error - 1000) / 10, error % 10); + dev_dbg(di->ipu->dev, " IPU clock can give %lu with divider %u, error %c%d.%d%%\n", + rate, div, error < 1000 ? '-' : '+', + abs(error - 1000) / 10, abs(error - 1000) % 10); /* Allow a 1% error */ if (error < 1010 && error >= 990) { -- 2.35.1