Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7761324ybi; Mon, 22 Jul 2019 20:12:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+oVUJd5KZlWKA1tNHi2BaM87Koyl3BvWsF+tswwrYLHGDb6Z8pFh3L1HJkwBp+HTuYiw4 X-Received: by 2002:a17:902:968c:: with SMTP id n12mr82246091plp.59.1563851537976; Mon, 22 Jul 2019 20:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563851537; cv=none; d=google.com; s=arc-20160816; b=BJBnDhxnCoe1fRXcjnv4Sck+7wQfaQZzFFiiMjN2Nsl5UZHskWQCaxmBxcHkt5cyrs RZHL7odbdRkAAZgWMsmKsm9wZu12TQmfPY1AYlMXmxhRwv50bX88pEpQPb9DoaxFygOF EpZ1O9J2aNesqRDTlVb+EFKtSGYuW40iBHwFBLI63xs7vsMFdIrw4H/EP8yrNoHzYadw qE5s0XT+0ILJsDABURVHZqK2kzJ6DudAnAr1Ug0bqGuyAZjphPqmE5zozbdZW5SCZZIV 1F857/e1U3VXKz193ic7r2GNHefEfi1B9iXS1iT47I9RG4Zvv2O2Yu5upml2dtHwzpgE PgWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IbSm7aUPCPODZOR8QIAKq+60N3QfY43kv2h3mhmy9JI=; b=oWekiXbZFyKFal8Ot5SC2JOdjyiDYmSs4Zg9AulBysLDcFpWpjpR4AvSF02YqAl1Is HnJpwlN0H/o4KznvTVGpVAIZk3KYzsVW0XZhsIIkoRIFcXV7h2xJmTFv1mA05xflEkSp Vz3Ou6KLAFvMxrODRYYRChSRI9ETszXYiiIJoq+RR1z+ZToOsJgaHS71aquO+cATOQT6 5Acp8BiJ7Pj75g1G8PXJsoQpa46NE6S1PcRLaSHUuihnHvw5Mip9pcLtsNbHu4Y0Z/vz BGdikgi7zSXmDWUpu1Coc7kR6CpPWlQqwnGMRco0Y17JmWp+WDo4eEc1ydkgNx+KgcSP KZpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=QldmT9XY; 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 31si9712766plc.356.2019.07.22.20.12.02; Mon, 22 Jul 2019 20:12:17 -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=@poorly.run header.s=google header.b=QldmT9XY; 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 S1730113AbfGVUY2 (ORCPT + 99 others); Mon, 22 Jul 2019 16:24:28 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:44329 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729621AbfGVUY1 (ORCPT ); Mon, 22 Jul 2019 16:24:27 -0400 Received: by mail-yb1-f195.google.com with SMTP id a14so15401301ybm.11 for ; Mon, 22 Jul 2019 13:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=IbSm7aUPCPODZOR8QIAKq+60N3QfY43kv2h3mhmy9JI=; b=QldmT9XYK72SQ7U5ZxUvFimH+3fpq2KpaUvK4DEG6/EWgWERMqrrT4+MiCC0IWH3od j4KowEjinazaD1qQm76hTIXKFED8g/eZLUSCIYV1i1IfC6lJ/Vb3HHnebc25GjVEpTC9 9FfCuNm1aCAuWjvqSIk63VhYZVBtTf6Yq0ybK9NiF5EdpahXmdtOqj2lAiFTOr2KEmj+ pcXQdynuGP63E8J3loL6eM3KW7YYvjQ6/tpG2QY4uobV8JM9JYIDTs9NwAPtKUj7Ag+C XPKiv/+QqcmXBDFTXdetWaxlTb3p1uW5kGS7ilfnH94zyq3uWUB4eObAFfqOgQra6SVG aHcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=IbSm7aUPCPODZOR8QIAKq+60N3QfY43kv2h3mhmy9JI=; b=RQ8lqz4nnJvJYP5Mb+DMBFkh/Ly4dw4Itu+p3+32f3q98B9LvZBa8H1uMwGIC7dPs9 G+So+YvtBk69r2V2Jcj/O7+hC25HhLr3MHBuhurh1x5KfVcJMjL1Uz5ZJ5HIsVK2wWTB T6bec9yBkHLj1/E4heJoRjUgykBAT/m2UV1cG+w/7dwooT8E/od7K9dbeuzXlyODKqtx AbzUQNqLcR6ewi7qw7gvmAeX5aq3k1Cpj+kBDHBLVYiOh4H4Svn8AxiBicFDWmnYxJu8 lNzIf966wFL6HWf2boF7Hik+916LsuFoHyRgaZMaiDPY/8ra+YSwi/FkRDTi1KUsNF1S NjiA== X-Gm-Message-State: APjAAAXg4H5gY1pNqITbuaIYif7w4pJyvlAVCHkOHtAq0yeHxSeRjgpf CdA0rMkc7dN1sekxE3N64hHfgQ== X-Received: by 2002:a05:6902:508:: with SMTP id x8mr47454720ybs.406.1563827066965; Mon, 22 Jul 2019 13:24:26 -0700 (PDT) Received: from localhost ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id k126sm9433394ywf.36.2019.07.22.13.24.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 13:24:26 -0700 (PDT) Date: Mon, 22 Jul 2019 16:24:26 -0400 From: Sean Paul To: Matthias Kaehlcke Cc: Andrzej Hajda , Laurent Pinchart , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jose Abreu , Neil Armstrong , Douglas Anderson , Adam Jackson Subject: Re: [PATCH v2] drm/bridge: dw-hdmi: Refuse DDC/CI transfers on the internal I2C controller Message-ID: <20190722202426.GL104440@art_vandelay> References: <20190722181945.244395-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190722181945.244395-1-mka@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 22, 2019 at 11:19:45AM -0700, Matthias Kaehlcke wrote: > 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 This is very likely a stupid question, but I didn't see an answer for it, so I'll just ask :) If the controller supports xfers of 8 bytes and 1 bytes, could you just split up any of these transactions into len/8+len%8 transactions? Sean > 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 > -- Sean Paul, Software Engineer, Google / Chromium OS