Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3449245pxx; Mon, 2 Nov 2020 09:09:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkboo1s5NPasfw3rugRkYBNSiaQeFP9iP31dpks6nFan8P9Z0D8D+wtQbth7s5u+1LDdK3 X-Received: by 2002:a17:906:d8b0:: with SMTP id qc16mr15891136ejb.268.1604336970057; Mon, 02 Nov 2020 09:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604336970; cv=none; d=google.com; s=arc-20160816; b=MgIhR7WVlZe/rDmFnGABQFG0379zrwf5HgKPSgQJJKW6eKcAHSEK/ZxCM0cYN7UMBU FhAi6wV15EGNGxD1mrQSB21dPhpXfbfR/fGO7WQQl1ULD/tTZ/JioJk15B8X2xZ/JgFy XjrQY3OVZqzIC6XcqgxJ9b/56lAylGH6IqW/yLSNNzH/GlY21W8Z0tfNrPahn6vguQC2 AQ7qDOQ2MmOCPsQFwa80x9d6EaVvpiaAnbMvmJlag7EVj4bbN1X/Itm7oXtppY4csBgE OvG2UNPxCPafFfaCz8qz2TL5wd7xVfBRBhNsK3rKM+chxjt/Rmx5BCtDYVKUg3BPUsWe E8XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=ESh9xtdAgdP17+IlQOl8SchaQP1wByfvx2mtwCrql2Q=; b=kjA3y5K2IrdbKLzajJ3bDjgvOb5rU0hkRYzffbvggH9jUsL9K8W+Qt7FioG21tcz4L kbTnftDF4FHXGMkAupV28qqk2grna+aQKJywabTziNsBwmaCsmVsKomaDceR2MxllQ7u /HJ4GjeASIn65IoCkay7Bu2gBwEuYVVrqesAW0Ash7hdBElfMcgOtP06HMNmlW6gt4M2 xsVEurcwMKV6rtgJ6BUcf8jP0UL6XwvOpZLRr29U6kxGi6O4vkaustXvqA7QWyzfrdoT inhzjFAn8IGdMyBJ+7ATULV3Yp4S/qL9qb7OP2MVDo4hd6sMTwWbYt7cWSzs4ys9zqvO Q9lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=X4DuJJO0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id lt22si10372559ejb.30.2020.11.02.09.09.05; Mon, 02 Nov 2020 09:09:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=X4DuJJO0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727337AbgKBRGn (ORCPT + 99 others); Mon, 2 Nov 2020 12:06:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727150AbgKBRGn (ORCPT ); Mon, 2 Nov 2020 12:06:43 -0500 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CDBBC0617A6 for ; Mon, 2 Nov 2020 09:06:41 -0800 (PST) Received: by mail-pl1-x643.google.com with SMTP id u2so1182468pls.10 for ; Mon, 02 Nov 2020 09:06:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=ESh9xtdAgdP17+IlQOl8SchaQP1wByfvx2mtwCrql2Q=; b=X4DuJJO0/gEJdfLQm0/YE9Y2l9ZhKtY5Whhq2yImpVUTGKCiG2r0WVGyUFoVbJELm0 LPmnoj1qViMSnbrVTZa3YlJxORw9Cxk4h/6jPyeDD7BV6b3PHq4EyLWx721+H44mT1+K ZBy4zvIIkSSMS0k9A5cRioGINRzvU1KBwGgS8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=ESh9xtdAgdP17+IlQOl8SchaQP1wByfvx2mtwCrql2Q=; b=rain0cnb+eg3dYGp2zDMSYWIvRAyhpBwqf2n4bL9D6KS4CyHAZgjoyTA9hj7C7T2oI +7Cjef09t9UPbazwELPsmrwp4YSGyWC6VjKYAcCD/l5oKtQzMYQsqpFkLpJdVjfU9mAn 2LVkl0VV3356K4fXT5tQ3qvodqLrPvQRwt/HNV5SgQuIpknO6SjhkAq7BcM8K6AuL8n9 rwPvjgcyKNPwwkbxPMA2E1RaqPCKY6XFWfGSTRQS9svkaTeWbWj14M/vS/0JvUUMh7g4 iW0j4UlJqL1HmiiSxx2nQxkrR1IXQCgAvV0glOBJBZso0R/8P7ePdwB73UFUWI6XxQ97 /Y/A== X-Gm-Message-State: AOAM531M/x8l/fOEp4FxTGW9F7+sxHh+dq1uNpaKbKWbj6Q/80Ra3ZfH +PRraiQDHvqv8EItcsVfCNpOJA== X-Received: by 2002:a17:902:8649:b029:d6:d1e7:e78b with SMTP id y9-20020a1709028649b02900d6d1e7e78bmr4135219plt.63.1604336801123; Mon, 02 Nov 2020 09:06:41 -0800 (PST) Received: from chromium.org ([2620:15c:202:201:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id 12sm5476052pfh.88.2020.11.02.09.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 09:06:40 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20201030011738.2028313-1-swboyd@chromium.org> <20201030011738.2028313-2-swboyd@chromium.org> Subject: Re: [PATCH v2 1/4] drm/bridge: ti-sn65dsi86: Combine register accesses in ti_sn_aux_transfer() From: Stephen Boyd Cc: Andrzej Hajda , Neil Armstrong , LKML , dri-devel , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sean Paul To: Doug Anderson Date: Mon, 02 Nov 2020 09:06:38 -0800 Message-ID: <160433679882.884498.16765038474501300057@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Doug Anderson (2020-11-02 08:18:47) > Hi, >=20 > On Thu, Oct 29, 2020 at 6:17 PM Stephen Boyd wrote: > > > > These register reads and writes are sometimes directly next to each > > other in the register address space. Let's use regmap bulk read/write > > APIs to get the data with one transfer instead of multiple i2c > > transfers. This helps cut down on the number of transfers in the case of > > something like reading an EDID where we read in blocks of 16 bytes at a > > time and the last for loop here is sending an i2c transfer for each of > > those 16 bytes, one at a time. Ouch! > > > > Changes in v2: > > - Combined AUX_CMD register write >=20 > The change from v1 to v2 makes me slightly nervous, though I guess > it's fine. Specifically, all the examples in the datasheet show > programming the CMD before the ADDR and LEN. This change will make it > programmed after. Since there's a separate START bit I guess it's OK, > though. Nothing in the datasheet explicitly says that the order in > the examples is the only order that will work... Hmmm now that you mention it the SEND bit is explicitly being cleared in the programming sequence by being there at the start. If I want to combine that with the adjacent register writes then I should make sure that the SEND bit is cleared at the beginning. Otherwise the hardware may be in the middle of a transaction if the previous transaction is still running, i.e. a timeout where the SEND bit never cleared. I think we should go back to the previous patch I had here. Combining this register write is wrong. If anything, we should clear the SEND bit on a timeout and make sure during probe that this bit is clear and then drop the programming of this register from this function entirely. That would reduce the sequence by one register, but is more complicated vs. just making sure it has the clear bit here to begin with. >=20 > Reviewed-by: Douglas Anderson Thanks, but I'll send another round picking up acks and such and your previous review tag on the v1 of this patch.