Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13473755ybl; Sun, 29 Dec 2019 12:46:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyB5ZRhitxcR9tydUGxbr/gRNFGGumddqw2wkNFjkEGxpMPCfJ+yyuyS8JMzRB2NxU1pl2A X-Received: by 2002:a9d:53cb:: with SMTP id i11mr72334197oth.158.1577652365814; Sun, 29 Dec 2019 12:46:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652365; cv=none; d=google.com; s=arc-20160816; b=EEJ5OYK/DS2Ijh7l3cH2cAPORNjY0jp64ZH7Agx8W/MS9Da1zd7odzpetr3R04SU8t z5AUEvlIhU0PasTM5zB02R73IVV4hG3nNQroLuYZtoZRwU4hU0pKGmmZhNruoPw/E2q+ tjraYtLDSBybs8dcp8RybsCXfpuJ0PQZLjwbXrN+DmEc5qIrcKQSVJLlCYNh/Uafswo2 sOeOFUXkEs2512C5dBOhi4CBoQrpE6oLRsLRvFd5j5PxySYhtM5WNKHLJQuLPbNaSw2v gUyujSvluFHnMy9Z1DCHn2QthQNF8dgIAR/cdGXe6yM2b8NFG5q3xxjf480DIsXVxXNi tcEw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PpsJwu1Ox75/bFOFLS0sFgFL09J9YNIem3xweDAZdM0=; b=A8zXHrF3oaH85hpDV91SNLgeJPTe5waOZIppnTohS5PazR6wa3fPE2VhwfTi4J5Tt1 nGqb0+YAjSAcBK8iwvZGp0wtFglpOdp82gZK+RcjBeAtsHn8OshkM6gRbcE1cTNfnkeS OYq1FqMj8z7dBn3DikvlKKyshNY8jyU2p34YFHwnm7tthc8ESfD0hbys1VuuwEo1ugXw vef2Zy5EJUjQTToY6SQAaBKT7RBcQani6pGKuxcoxyM5EwWH2xKe2F4TBqs9JQnmyo74 Po4m+jmPfhO7+OWHVM+dVDSbJZVVOCrmqHHE/o4GI5A+SKcQh+HVe0X8UkNVMp8W44I5 uSEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OtVjCXxB; 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 z25si17787569oic.23.2019.12.29.12.45.54; Sun, 29 Dec 2019 12:46:05 -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=@kernel.org header.s=default header.b=OtVjCXxB; 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 S1731252AbfL2RrX (ORCPT + 99 others); Sun, 29 Dec 2019 12:47:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:57754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731235AbfL2RrR (ORCPT ); Sun, 29 Dec 2019 12:47:17 -0500 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 0F83F208C4; Sun, 29 Dec 2019 17:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641636; bh=/hfN6siHm7KQjOiqFX4DdWf836lc/u3N4UUXUl5d0Hs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OtVjCXxB5BlJbLV0PjJpK1tdAaHfbYrttnqH2KvR56kuTwzqALghC6oyM5hh3758v b1IdsWivw0bQ7IeWCExOvngLd0wupG66ooE936mmoMvbiJB4DIKrltfQyrwKQrNq99 LwOqqWxzYcsx2V08l8kUpMZV3H5kgEG72gTeTS+g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthias Kaehlcke , Douglas Anderson , Sean Paul , Neil Armstrong , Sasha Levin Subject: [PATCH 5.4 109/434] drm/bridge: dw-hdmi: Refuse DDC/CI transfers on the internal I2C controller Date: Sun, 29 Dec 2019 18:22:42 +0100 Message-Id: <20191229172708.876152596@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthias Kaehlcke [ Upstream commit bee447e224b2645911c5d06e35dc90d8433fcef6 ] The DDC/CI protocol involves sending a multi-byte request to the display via I2C, which is typically followed by a multi-byte response. The internal I2C controller only allows single byte reads/writes or reads of 8 sequential bytes, hence DDC/CI is not supported when the internal I2C controller is used. The I2C transfers complete without errors, however the data in the response is garbage. Abort transfers to/from slave address 0x37 (DDC) with -EOPNOTSUPP, to make it evident that the communication is failing. Signed-off-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson Reviewed-by: Sean Paul Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20191002124354.v2.1.I709dfec496f5f0b44a7b61dcd4937924da8d8382@changeid Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 521d689413c8..3e82d604201e 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -36,6 +36,7 @@ #include "dw-hdmi-cec.h" #include "dw-hdmi.h" +#define DDC_CI_ADDR 0x37 #define DDC_SEGMENT_ADDR 0x30 #define HDMI_EDID_LEN 512 @@ -398,6 +399,15 @@ static int dw_hdmi_i2c_xfer(struct i2c_adapter *adap, u8 addr = msgs[0].addr; int i, ret = 0; + if (addr == DDC_CI_ADDR) + /* + * The internal I2C controller does not support the multi-byte + * read and write operations needed for DDC/CI. + * TOFIX: Blacklist the DDC/CI address until we filter out + * unsupported I2C operations. + */ + return -EOPNOTSUPP; + dev_dbg(hdmi->dev, "xfer: num: %d, addr: %#x\n", num, addr); for (i = 0; i < num; i++) { -- 2.20.1