Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1821820ybl; Thu, 9 Jan 2020 02:11:30 -0800 (PST) X-Google-Smtp-Source: APXvYqw63Ns0zd/eSPx79TsKdp2+2PRMqoJ+3re/HuD8HS7Eu7Aky9BF7fJTv4vKxpEt4XJZFWRM X-Received: by 2002:a05:6808:a8e:: with SMTP id q14mr2367021oij.173.1578564690615; Thu, 09 Jan 2020 02:11:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578564690; cv=none; d=google.com; s=arc-20160816; b=ZspiIkix0IzXnXV5dqXzhowkMGNF45qFwyu72nYfYPkdExgW35VwS6ze2c9QS3TAZ1 lsvFqXWTG3qcha06jz8fgWykMcoEe12tdPgarGXZe8HyeD80NqpHjswsSTywd/WXaxJs 14VtU7yldsJFvDQK0HwiMg/qc7tyykQxPGHOcwjxqkyweZ1BeQEwXS7E9G3FkylZ0k+T E1PxKqqC62LXnRqop/mzBI+nEFUGCYY573etMop7pA1ZY0WNbBgHK0RvW2gc0jbxUQE4 u6fGMNF8lsWX1Z/ZWaCczavlMrNatPLm5xfRBBHGq7xeNyCANVSEh+E6A+v1i9EsbUyr nwhQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=n5eM3QDnkmnCt5VEAF4sexmGO06DdrkGwPZDOP4ViXU=; b=OSOQX1HurUU4xfdNVVK+dpS6oVsMkEsDy04Q0Mc9WyKUWRObPQR+1QW44vz71rxVLM BQODOgovvOqvQsxQ7JK5FvxH1W+j10/pqIpe/4B0CbS574R12OcDZZiJ5fVeJZCNaX1G cXsSmNKskXwky+Coii8HHrkTxQgqNGY4GTpggkBzBg07n1hUSqJV5Rlnw2/Qnc+tftxW VsEZT4/MS6G4PBAIxjvDz+dqoLdi/kbRjLTD/7d0gMM8H41gRn3n19gyEI+F22zFV5rv UeiEQq/pBdmJLgWC+XWK132pImbc8E9uxzuz0k0Mezi4l3wFdqc88DT7+csbTeZ8uhnl VNXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3si3488957otr.37.2020.01.09.02.11.18; Thu, 09 Jan 2020 02:11:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728774AbgAIItQ (ORCPT + 99 others); Thu, 9 Jan 2020 03:49:16 -0500 Received: from mail.manjaro.org ([176.9.38.148]:46416 "EHLO manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728755AbgAIItQ (ORCPT ); Thu, 9 Jan 2020 03:49:16 -0500 Received: from localhost (localhost [127.0.0.1]) by manjaro.org (Postfix) with ESMTP id 9069F36E4E55; Thu, 9 Jan 2020 09:49:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BYu5Us4bT7v6; Thu, 9 Jan 2020 09:49:13 +0100 (CET) From: Tobias Schramm To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH 1/1] drm/bridge: anx78xx: fix integer type used for storing dp link rate Date: Thu, 9 Jan 2020 09:48:01 +0100 Message-Id: <20200109084801.3117-2-t.schramm@manjaro.org> In-Reply-To: <20200109084801.3117-1-t.schramm@manjaro.org> References: <20200109084801.3117-1-t.schramm@manjaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit ff1e8fb68ea0 ("drm/bridge: analogix-anx78xx: Avoid drm_dp_link helpers") changed the link training logic to remove use of drm_dp_link helpers. However the new logic stores the maximum link rate in a u8, overflowing it. This commit changes the logic to store the max link rate in a unsigned int instead. Signed-off-by: Tobias Schramm --- drivers/gpu/drm/bridge/analogix-anx78xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c index 274989f96a91..0f38b8c40dff 100644 --- a/drivers/gpu/drm/bridge/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c @@ -748,6 +748,7 @@ static int anx78xx_init_pdata(struct anx78xx *anx78xx) static int anx78xx_dp_link_training(struct anx78xx *anx78xx) { u8 dp_bw, dpcd[2]; + unsigned int max_link_rate; int err; err = regmap_write(anx78xx->map[I2C_IDX_RX_P0], SP_HDMI_MUTE_CTRL_REG, @@ -866,8 +867,8 @@ static int anx78xx_dp_link_training(struct anx78xx *anx78xx) if (err) return err; - dpcd[0] = drm_dp_max_link_rate(anx78xx->dpcd); - dpcd[0] = drm_dp_link_rate_to_bw_code(dpcd[0]); + max_link_rate = drm_dp_max_link_rate(anx78xx->dpcd); + dpcd[0] = drm_dp_link_rate_to_bw_code(max_link_rate); err = regmap_write(anx78xx->map[I2C_IDX_TX_P0], SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]); if (err) -- 2.24.1