Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8844470ybl; Fri, 17 Jan 2020 02:04:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwVajZSXnyOK7SGQPtUHSsRAHrqh0L278Dsnqd6arddf4UO9UtJhwNoMIIIsOOtvjZKTPKW X-Received: by 2002:aca:5144:: with SMTP id f65mr2903897oib.5.1579255455894; Fri, 17 Jan 2020 02:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579255455; cv=none; d=google.com; s=arc-20160816; b=wgmwBrWa9U8s5GuY9C1kbA+QhWeNjUrDm5L/yszRr/ZXjLgQDV25zxwVdAyfo53Im3 uuGZTUCWSoDu7TVGS4Qo2oj9cFdT4bnQn7+fKLd+ps0bnksHv22+oXyvOlkfJjzLLwK2 DgKRpNjIcNZueBByV4Bh0GUJ3KZYq53aMlXXtgnGh2wvT+6oGDLSYmCbeHokq0zshRXi R8ZC/d1JcXve5gpU4cUJCsc1SahH0YHQuey1kmyVjgEZ6chy9b9RSdMFpxRbWaixM+8y xYS9qiTUbFSaZdtMAvA7q+ZzQgizuHuBC+B9gSzn1OjIHQG9yLpik/AbFghncghyKOo+ e4cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=FCkijMQphRE8Mr4fW6ndAfrNvL8gGE95bsivtOZKJ30=; b=sOzyzex15c8eXCQ9ZiW++XQdxLEtu2FzsyvS/NYVgfQkJwQj4OUp8vyFeK8C0RxuDS Fw6uMd1l6zUawtUd+BUIdrid0o1AJq0ctjNnNJSppI73GMLZ7bvL7bkRmW7BKMkYotND 5HP5inVRf65l/afnkId9BtIQ6vPUCko1LbczIkVuOOYbWS8J9jUnkprO5yD73KIXF/SS aYOPBNJrRLur9qhJGJptz/MoVn1NwOyLDerW49ZzjglkKl0k7blLlFQeWReT3scK7kP0 /pG2zsX3fObAe24TK+qsX+lIH6MIr3Vb+GPmaCD71jMhL/I+nTLjZ6JmIgSWOUdASDhG +Ngg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=j5QfMYv0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si3167882ote.41.2020.01.17.02.04.04; Fri, 17 Jan 2020 02:04:15 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=j5QfMYv0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726778AbgAQKDH (ORCPT + 99 others); Fri, 17 Jan 2020 05:03:07 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:44909 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726554AbgAQKDG (ORCPT ); Fri, 17 Jan 2020 05:03:06 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200117100305euoutp01a0708cb5ccac32af602ebfb483511801~qpGffXj8_1352413524euoutp01d for ; Fri, 17 Jan 2020 10:03:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200117100305euoutp01a0708cb5ccac32af602ebfb483511801~qpGffXj8_1352413524euoutp01d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1579255385; bh=FCkijMQphRE8Mr4fW6ndAfrNvL8gGE95bsivtOZKJ30=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=j5QfMYv076MRYuAvV9unKr0uS4ufwRSCIsTjKsnBVV0dRcBKcMesk+Dstxdv/FYDa fUH/+q3TdmhbvM8Da8d38z5E7Mz2wm2c41wcdIot37xLH4OWnZIAwcOmDgp36dzuJ7 Xssy0jqfjlN3wMZdJ9QgybqwgWmnkQwoG6O1UKFI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200117100305eucas1p2ff5eb893a046122f6bc743ce871fa547~qpGfQ8rTh0451504515eucas1p2a; Fri, 17 Jan 2020 10:03:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 64.2A.61286.956812E5; Fri, 17 Jan 2020 10:03:05 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200117100304eucas1p1758fb3bcddb6440d914684f863fa550d~qpGex6Blh1996119961eucas1p1g; Fri, 17 Jan 2020 10:03:04 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200117100304eusmtrp1803be891b65d0223e1f0acfaebbe872b~qpGexFAua3085130851eusmtrp1F; Fri, 17 Jan 2020 10:03:04 +0000 (GMT) X-AuditID: cbfec7f2-ef1ff7000001ef66-3c-5e218659b042 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 56.A5.08375.856812E5; Fri, 17 Jan 2020 10:03:04 +0000 (GMT) Received: from [106.120.51.74] (unknown [106.120.51.74]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200117100304eusmtip277a70c91926c89454bd5ab1160a717c4~qpGeQ7X-51169211692eusmtip2S; Fri, 17 Jan 2020 10:03:04 +0000 (GMT) Subject: Re: [PATCH 1/1] drm/bridge: anx78xx: fix integer type used for storing dp link rate To: Tobias Schramm , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org From: Andrzej Hajda Message-ID: <4486560b-05e5-6c03-0a8e-4f193141a5c8@samsung.com> Date: Fri, 17 Jan 2020 11:03:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200109084801.3117-2-t.schramm@manjaro.org> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFKsWRmVeSWpSXmKPExsWy7djPc7qRbYpxBoc62C16z51ksvi/bSKz xZWv79ksrn5/yWxx8s1VFovOiUvYLS7vmsNmcagv2uLeur3MDpwe72+0snvs/baAxWN2x0xW jxMTLjF5bP/2gNXjfvdxJo+Gw2sYPQ70Tmbx+LxJLoAzissmJTUnsyy1SN8ugStj/+TlTAVb eSue7nnP2MA4jbuLkZNDQsBE4s3jaexdjFwcQgIrGCX+d91hg3C+MEpsffiQEcL5zChx+d5X FpiW12f2Q1UtZ5RY3bCLGcJ5yyhx/3c3M0iVsECcxMOFu1hAEiICtxklVm4+CDaLWaCVUeLZ 2clgVWwCmhJ/N99kA7F5Bewklq45CRZnEVCVWNbVwQ5iiwpESDy58pgVokZQ4uTMJ2B3cApY STSsfArWyywgL7H97RxmCFtc4taT+UwgyyQE7rFLzDu5nhXicBeJNSeXQNnCEq+Ob2GHsGUk Tk/ugXquXuL+ihZmiOYOYBBs2MkMkbCWuHPuF9A2DqANmhLrd+lDhB0lGs9+YAYJSwjwSdx4 Kwhx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7X4 EKMp0HMTmaVEk/OBCSWvJN7Q1NDcwtLQ3Njc2MxCSZy3Q+BgjJBAemJJanZqakFqEUwfEwen VAOjjnGwdJiS4yV+U6VT+2VPLbIRbY7Ly1F/N5Pn7JOFJ+v//n+myuqt1paxVMzH3G3PuaKN tUHvpA4sdVvhLbozJF7Wx3aC4gMhwbP7s4q/H5ihVnjmwu3L5oHqc4w6NE8/mbe6/vGeT9IG 5UfKX5iq9P9l2SYhVr5l3W1phnU615oWCv3ZLXZaiaU4I9FQi7moOBEAXZU0H/ACAAA= X-CMS-MailID: 20200117100304eucas1p1758fb3bcddb6440d914684f863fa550d X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200109084920eucas1p1ed027ed22778b67eb86301d3bdf34bb5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200109084920eucas1p1ed027ed22778b67eb86301d3bdf34bb5 References: <20200109084801.3117-1-t.schramm@manjaro.org> <20200109084801.3117-2-t.schramm@manjaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09.01.2020 09:48, Tobias Schramm wrote: > 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); The code converts bw_code to rate, then reverse, maybe it should be simplified: dpcd[0] = anx78xx->dpcd[DP_MAX_LINK_RATE]; Regards Andrzej > err = regmap_write(anx78xx->map[I2C_IDX_TX_P0], > SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]); > if (err)