From patchwork Mon Aug 17 15:12:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266099 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 F03FEC433E1 for ; Mon, 17 Aug 2020 19:01:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D79842072D for ; Mon, 17 Aug 2020 19:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597690890; bh=qpYVExMYuXlY8Y4VITqpkEQO2JIAQnnXvNxeNv4FaKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iIelkJI99u94cCR+DT0FfzCUW6KKErtuoI1mARD0WNghGfiuk9w5KJB9VJWfokkzM dEN7T3aiZQtqNCs2WhZbemRLXwYkWHHyHLSJ+io3oTUdPHv5qTdsGuQoGkg8qnQjoW 9ZxONvfLINovCpJ9YCLjOWym0rQvfxIfzyipOj7M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403945AbgHQTBR (ORCPT ); Mon, 17 Aug 2020 15:01:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:59920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730609AbgHQPrw (ORCPT ); Mon, 17 Aug 2020 11:47:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 540EA221E2; Mon, 17 Aug 2020 15:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679271; bh=qpYVExMYuXlY8Y4VITqpkEQO2JIAQnnXvNxeNv4FaKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CpUSdo7Gxf6+OrCEIGuk9McDIuze6s9Oq+MvLDRfqKCOPCZ/ONlY55ssHMPAR6P/e dKC1DvHLcV5Eurj3LYTUAHmjzAKVKizYzS5v4Y3D2F5tNY7ptWH8uBMX2QXE0fTCoC qSlcMcbS51Xv+gHUXEJsN0uHoktl+jcs9xnE1mYw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Stephen Boyd , Rob Clark , Sam Ravnborg , Sasha Levin Subject: [PATCH 5.7 124/393] drm/bridge: ti-sn65dsi86: Fix off-by-one error in clock choice Date: Mon, 17 Aug 2020 17:12:54 +0200 Message-Id: <20200817143825.623167276@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Douglas Anderson [ Upstream commit fe3d7a35497c807d0dad0642afd87d6ba5b6fc86 ] If the rate in our table is _equal_ to the rate we want then it's OK to pick it. It doesn't need to be greater than the one we want. Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver") Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd Reviewed-by: Rob Clark Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200504213225.1.I21646c7c37ff63f52ae6cdccc9bc829fbc3d9424@changeid Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/ti-sn65dsi86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index d865cc2565bc0..8a0e34f2160af 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -475,7 +475,7 @@ static int ti_sn_bridge_calc_min_dp_rate_idx(struct ti_sn_bridge *pdata) 1000 * pdata->dp_lanes * DP_CLK_FUDGE_DEN); for (i = 1; i < ARRAY_SIZE(ti_sn_bridge_dp_rate_lut) - 1; i++) - if (ti_sn_bridge_dp_rate_lut[i] > dp_rate_mhz) + if (ti_sn_bridge_dp_rate_lut[i] >= dp_rate_mhz) break; return i;