Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp619934pxb; Thu, 17 Feb 2022 10:57:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/BE+l9v0SjA9oNUJ8Y4lgMalQGr6R3Id4/WR5g/1OadXzYyl3YNiWDZvxgT7JK6W+05vg X-Received: by 2002:a63:1c1:0:b0:34e:b5da:7d05 with SMTP id 184-20020a6301c1000000b0034eb5da7d05mr3393401pgb.9.1645124244545; Thu, 17 Feb 2022 10:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645124244; cv=none; d=google.com; s=arc-20160816; b=eqg365k6Pv2FNzKQZjPcpQtOEk/uikZNEzRlPhoBUClXxK/xdhnDCFyY7co7H1czKb vFzgFTKtxvOQIhqIdycNJV8YNyAFZMrKwZ6AtfRBY/xEa91iP944kT3E1TPZ7FgDcHH/ gUpdBHpJ82OlpQCYTv/O9bhFTJah1SvYMgQ9Sdm6XzglPsBltGR7dIjIVeRLAVNGh13T BLTrMx6SmLSn1kt8ObfolV/S5xL2ZYqeSdck5FYO6Frgknnvfm0zHR3uzIgjO62XujtR PUtZ+GP9ikpPrSme1QueLpWi0a3hQMNdRhDoyIAbvxqWlwI1MXO2Db1weSvZzc9HvViK eE5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0zytHf9FkJ/PPPieoPlaB6am9Dki6g+U3R/IZo38jLU=; b=x+vbYM1e+Ukqdz7t3cYwEkiGRHfmH3OlLA8P3Fe2IAnFElsykXAGAaEM2KApilrOg/ PVyrN3g94Ufh3G4GNubrElIOIWcuQZozHUQnEoMFiJg0lqPGSZH2zHluouH7uf5K6bAU Q7q/iGr4gqbUeLllM7Sc1t+r/NggDbi6U6l9B4I1fT+djIRXans0r7tOcV82UpryVzf2 qpgGL+ErUFrDcvcrDFwDeb3b/fwvO83EfAXUs+sUgX1++NIO/rTPZa5dMlHa/XoQidrG zTixaYzcS1jSJ9rWFa0EpNVFry/MmTJauXYzpYJdc0NuahCPU7J08cSkebQ2qky7NTM1 sxBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=auYbTr3b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 8si9023393pgb.410.2022.02.17.10.57.09; Thu, 17 Feb 2022 10:57:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=auYbTr3b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S237452AbiBQIW5 (ORCPT + 99 others); Thu, 17 Feb 2022 03:22:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:40722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235577AbiBQIW4 (ORCPT ); Thu, 17 Feb 2022 03:22:56 -0500 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8304B1EB425 for ; Thu, 17 Feb 2022 00:22:42 -0800 (PST) Received: by mail-pj1-x102e.google.com with SMTP id om7so4866704pjb.5 for ; Thu, 17 Feb 2022 00:22:42 -0800 (PST) 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=0zytHf9FkJ/PPPieoPlaB6am9Dki6g+U3R/IZo38jLU=; b=auYbTr3bUun55c3vBXt7qY9ZrmwpIs78nu5pz18cj7v0siiy6+G4aRNbk/2LLcvodS asUmF3hxOd6ZBy+ihtNE6oN8R9cn1ymyRv9UHjqnbDk+q41MxMNbtxf/MMEUbPKEYXA/ dhm2coht7GKbfTxGOJDbdrBGoDbRdjO0iSzxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0zytHf9FkJ/PPPieoPlaB6am9Dki6g+U3R/IZo38jLU=; b=tBihTjw5Dj9c3n2y7kfYy/SjLdxc4Jmox4/r1HWcQlG8toASOlqHc85vExNie2pmlz newY6rtWkpJ/k6+zC/fS2c28UZDJGSmKMDEtjlFX7Y0ZFEysn8EfUtGYhPon6k1MkKk4 6cALejdBFg+92N9ahkGZiXCV7aKqXSD6dOB5gCas9Vprhgl4ZMcHynmRNuqXnUIi8MbD r237WAX6sAOqyrNRIRWySTzyNTYaDdRDa5NSmC/EvF3i9bmEfrNw2/85z9hFa6BgDXab WzWKOxo2PvLhmCgt2WVfJV1pI1TkvG+0ClR9aq2l9kHhRDtwdKCaDJDA7L93I+twlzjk UugA== X-Gm-Message-State: AOAM531WfwLjHayxNESvP3E0LZ4598L+EazKtYtlW/MbclM1JFyzMM4N 0Rhj3aZno7zVj0qTBhBsUDNffgDIeasGsQ== X-Received: by 2002:a17:90a:9408:b0:1b5:3908:d3d1 with SMTP id r8-20020a17090a940800b001b53908d3d1mr1948242pjo.188.1645086161956; Thu, 17 Feb 2022 00:22:41 -0800 (PST) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:cdb:2c0b:b1f8:e426]) by smtp.gmail.com with ESMTPSA id m8sm1545449pgb.0.2022.02.17.00.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 00:22:41 -0800 (PST) From: Hsin-Yi Wang To: Xin Ji , Robert Foss Cc: Neil Armstrong , Jernej Skrabec , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Daniel Vetter , Andrzej Hajda Subject: [PATCH v2] drm/bridge: Clear the DP_AUX_I2C_MOT bit passed in aux read command. Date: Thu, 17 Feb 2022 16:22:25 +0800 Message-Id: <20220217082224.1823916-1-hsinyi@chromium.org> X-Mailer: git-send-email 2.35.1.265.g69c8d7142f-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the previous transfer didn't end with a command without DP_AUX_I2C_MOT, the next read trasnfer will miss the first byte. But if the command in previous transfer is requested with length 0, it's a no-op to anx7625 since it can't process this command. anx7625 requires the last command to be read command with length > 0. It's observed that if we clear the DP_AUX_I2C_MOT in read transfer, we can still get correct data. Clear the read commands with DP_AUX_I2C_MOT bit to fix this issue. Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel") Signed-off-by: Hsin-Yi Wang --- v1->v2: Offline discussed with Xin Ji, it's better to clear the bit on read commands only. --- drivers/gpu/drm/bridge/analogix/anx7625.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 633618bafd75d3..2805e9bed2c2f4 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -253,6 +253,8 @@ static int anx7625_aux_trans(struct anx7625_data *ctx, u8 op, u32 address, addrm = (address >> 8) & 0xFF; addrh = (address >> 16) & 0xFF; + if (!is_write) + op &= ~DP_AUX_I2C_MOT; cmd = DPCD_CMD(len, op); /* Set command and length */ -- 2.35.1.265.g69c8d7142f-goog