Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7586702ybi; Mon, 22 Jul 2019 16:16:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrBvflz/8bt93mukzf8e9fMQugGqrjzsZthTu8VZbl6MttSsOumWQicDrlk/hpOaAIj6sq X-Received: by 2002:a17:90a:1c1:: with SMTP id 1mr79551587pjd.72.1563837404445; Mon, 22 Jul 2019 16:16:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563837404; cv=none; d=google.com; s=arc-20160816; b=wkPhnqeI760WlJDpa5Ov/T94lECR76JBN5nitzBXFsNkd832VdhshZF1JeEzfPZRhT oNa4KR5U2tkjyNinGoNYGSug3El6sz9V8YFBxeKTRo9I98hg0ZnDDVZadfZ9Cym/mqg0 4PGgGMRdEGcZvLz581N+GIe/kLUDVJtn12F15+HOv/F4FsYTG0kmY9RaxpoALMFKodb4 dm+ouctgfXZUCWgg98L54QvwO58ZucFQW60jp215KtgOdxrPxAkyF5ycqO0RoHY6J6YR T4yqN13boNFBeICPwHxiUUg5/FmEwmKZJ8suuG5UDso5JusSHRyDVqenCckApTNCGdso IIdA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ZEY3bYOzp3RlSizWjVehuryQ18nF3wYfUG0Q8twJJZM=; b=CDzMNpZEpj4lV77Zs2ST6LW32gk/RWh2HXt5avaOjZD9XFJ8Eru3kOr7aUKQYsOuwH VT7DEU+/EOIhNvK9+V1RfKNlDdaXcREzkVZgQEazEkKrU9NaE3wXw1foJG+1fR3HqqZh TqMkWnJ7xMCUkA+dUltF/VgbEq/c0idC+Sbxb1nFhuN3L2dK+nZbBpb+2/TCfc6/LhTx jLXGz71W2hEG7K+K3slHUVMa7YfboJofrOnDTff7NN3y4vvP8EM7Eu1e8l1QDm6m98al 2SHKxuXIK3lg+fJRHVBG+tOfTdg2sT7BsTsVaYZNuzhglwbBYey0TKuJtyT22Vn65fy5 eSKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MURvjPXp; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d6si10318005pjc.7.2019.07.22.16.16.28; Mon, 22 Jul 2019 16:16:44 -0700 (PDT) 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=@chromium.org header.s=google header.b=MURvjPXp; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731409AbfGVSTv (ORCPT + 99 others); Mon, 22 Jul 2019 14:19:51 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43897 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbfGVSTv (ORCPT ); Mon, 22 Jul 2019 14:19:51 -0400 Received: by mail-pf1-f196.google.com with SMTP id i189so17769247pfg.10 for ; Mon, 22 Jul 2019 11:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZEY3bYOzp3RlSizWjVehuryQ18nF3wYfUG0Q8twJJZM=; b=MURvjPXpQv5UN7mAWkHfdQhSjEwS47X0WVij4lXD6DFvDLOxfR9xyMTRP16hP5J4eJ RPGo+ay9cCo0tGH8itIzhdtsLIADAq2Wk8JgklQ9PW1rEW7SJvZ0B0eztFO8ExaQLn/C DTGohGh7GIxojqBTtmb63srZUTv7lTEhhtuTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZEY3bYOzp3RlSizWjVehuryQ18nF3wYfUG0Q8twJJZM=; b=UgrgqIMLCGbCTfOnXWhGy2yjPo6xF8FR9mzAy6SGfmIDP1SxUj87ZGepclaApDyvs8 eDea+FemKi5wK/emLCA9NmXWHJeHqzb7MPoeFftzOS2RDbL7A4rNNLYDQiTOQT+ZX6aP SHZMTlpBUJRYXsZ46Mgw8cuyemj+1x3UJaak4+BpAZx2iVrmhvoVwyFhdmTCvEW5AICZ mhdGqxzItNBWjA5yRKuRbRgE2V6Az8GtQ8PVKy7vj5CzJI+X7Nwqc8IsDHAxaPJza1zQ Zl07k9EpjwbMOiU/ocxw6iZNEpq91FPGD2sYlsGm5N+sYFUIHWTT8SZdaeZe/EYv+OZ9 vFWA== X-Gm-Message-State: APjAAAUqDQIFm4d96MVN2OoJG+Au/9RszTjHqP8dWO7auSVANVh9plbU aYsPpr0FQxf9k6Y37Jk7o/ZTMnUOypk= X-Received: by 2002:a63:6c02:: with SMTP id h2mr71668487pgc.61.1563819590479; Mon, 22 Jul 2019 11:19:50 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id v10sm41283234pfe.163.2019.07.22.11.19.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jul 2019 11:19:49 -0700 (PDT) From: Matthias Kaehlcke To: Andrzej Hajda , Laurent Pinchart , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jose Abreu , Neil Armstrong , Douglas Anderson , Adam Jackson , Matthias Kaehlcke Subject: [PATCH v2] drm/bridge: dw-hdmi: Refuse DDC/CI transfers on the internal I2C controller Date: Mon, 22 Jul 2019 11:19:45 -0700 Message-Id: <20190722181945.244395-1-mka@chromium.org> X-Mailer: git-send-email 2.22.0.657.g960e92d24f-goog 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 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 --- Changes in v2: - changed DDC_I2C_ADDR to DDC_CI_ADDR --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 045b1b13fd0e..28933629f3c7 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -35,6 +35,7 @@ #include +#define DDC_CI_ADDR 0x37 #define DDC_SEGMENT_ADDR 0x30 #define HDMI_EDID_LEN 512 @@ -322,6 +323,13 @@ 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. + */ + return -EOPNOTSUPP; + dev_dbg(hdmi->dev, "xfer: num: %d, addr: %#x\n", num, addr); for (i = 0; i < num; i++) { -- 2.22.0.657.g960e92d24f-goog