Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1045914rwo; Sat, 22 Jul 2023 05:39:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlGJ6WJgYjVw6NpYuGh0ncj24VCGRrR6lSvcSl1Bbgb5IwCmTZk5Tq0y9YpiJmtmYWaeY112 X-Received: by 2002:a17:90b:24f:b0:262:c974:6057 with SMTP id fz15-20020a17090b024f00b00262c9746057mr2676200pjb.32.1690029561039; Sat, 22 Jul 2023 05:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690029561; cv=none; d=google.com; s=arc-20160816; b=axJDBXu6iRytqs09LvRGs11uflh7WV1scPMUruxLzYhQnJ6BEmRi9C7CXPhgxRpH4Z /t2R9KMRpfD5EqmpsE/BZDovPWvEaXc5pfJJKXZAImkUVl4JeBoQvz0pyFiCIuA02UCW PozMiPoNwUdBYfBOes9UbWfsk2nu8IRJMxsTghyfYLYvFAfRNRFCD6UEQdyUu4SXRwT6 /vcDWkqUK0E6eGEndSy2GQN4er6f/FgkGJQ6ru/y0R9s+HBII54wFK63nTNTjV5Gvix7 cgTB6jtH90/9C5kCl87BbtkHlQz2yItJ0oP8UNCSxOaTVNNNx+Z1hxZxXCOQQtvyVl3K fLdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jugx+ek1DsEka1mnslyo+q8EmdcBrFJ7S6gP2NbSf4Q=; fh=27zS+EDSqSKEFC1x9ouHIdRYroj58rAIbp7uF7OgRws=; b=FTS7FoxpTg++SxaeWal7mtmHCmC7hKHPb6ei66i8NciOtvNfYe+k589cnezZvOoM9E IAZ1wbVegeNygyu8mgb438Q4JYgEH9z2F6OcxVMtpoFYK1hHSKFU231UG7QngLgREzo0 pLgwoerwAeMIawg60GCkP/r8+1FRxZCpaqQEygmTXLam8DJBM2DF8smBvgd6SBcLjFyZ xPNe2J5XsxYxy14Gn2oNcY5qeMwxC6Oj4VU8tILKWfJmxmWkbOR52LSAeQjPU8o98eVX iIXlHq1TPvg4zs4goneACj27E5bWXqT0w5+6MfmRSXbuZQky6bOm2iKgDyvYYE9+wytf lg1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SViBSP2Y; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw5-20020a17090b4d0500b00267e9ad4f40si2175979pjb.54.2023.07.22.05.39.07; Sat, 22 Jul 2023 05:39:21 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=SViBSP2Y; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229651AbjGVMHP (ORCPT + 99 others); Sat, 22 Jul 2023 08:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbjGVMHO (ORCPT ); Sat, 22 Jul 2023 08:07:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 637E99B; Sat, 22 Jul 2023 05:07:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0147D60ADC; Sat, 22 Jul 2023 12:07:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 505F9C433C7; Sat, 22 Jul 2023 12:07:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690027632; bh=LHu1mcnkLw/wuOC7LXCvVU6Rvr+BEi9/IVyMC9fsb4U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SViBSP2YUDRJc016X31tSNtmsh5rUmAESOoSka4YrBXSDvc2QDnUOVsTliGJOiKrK G5VeP7UaoZkb5gZmvBX75MWjuj+2uRKAoETBSuaECqNvWdjwsy5W2iyAt0qmCdCSPA wx+afve347o8vjijstygxQjFCB04WevUeuaZJ2/4m4UqHBDxJQq+1ROkXkqR3wcFjD YWPRvK+6g84h7ZO7pwDdE27BjKTOs0wOihpa+08vg+w2BWUHsumB3RPKCX9X8qScAH y4lSJNZkF3VS1sUhNOJzR7/yg5k4/qMVsZGVLSX+jOBNxUD2Qh3gPhF0Q48Ib4l+nN 35kbaHIQ8j/6g== Date: Sat, 22 Jul 2023 13:07:08 +0100 From: Conor Dooley To: Krzysztof Kozlowski Cc: Peter Rosin , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Doug Anderson , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] dt-bindings: i2c: arb-gpio-challange: convert to DT schema Message-ID: <20230722-overlay-molehill-4213d2143609@spud> References: <20230722095710.17496-1-krzysztof.kozlowski@linaro.org> <20230722095710.17496-2-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZlpMUJot7nwCApJ5" Content-Disposition: inline In-Reply-To: <20230722095710.17496-2-krzysztof.kozlowski@linaro.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 --ZlpMUJot7nwCApJ5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jul 22, 2023 at 11:57:10AM +0200, Krzysztof Kozlowski wrote: > +description: | > + This uses GPIO lines and a challenge & response mechanism to arbitrate who is > + the master of an I2C bus in a multimaster situation. > + > + In many cases using GPIOs to arbitrate is not needed and a design can use the > + standard I2C multi-master rules. Using GPIOs is generally useful in the case > + where there is a device on the bus that has errata and/or bugs that makes > + standard multimaster mode not feasible. > + > + Note that this scheme works well enough but has some downsides: > + * It is nonstandard (not using standard I2C multimaster) > + * Having two masters on a bus in general makes it relatively hard to debug > + problems (hard to tell if i2c issues were caused by one master, another, > + or some device on the bus). > + > + Algorithm: > + All masters on the bus have a 'bus claim' line which is an output that the > + others can see. These are all active low with pull-ups enabled. We'll > + describe these lines as: > + * OUR_CLAIM: output from us signaling to other hosts that we want the bus > + * THEIR_CLAIMS: output from others signaling that they want the bus > + > + The basic algorithm is to assert your line when you want the bus, then make > + sure that the other side doesn't want it also. A detailed explanation is > + best done with an example. > + > + Let's say we want to claim the bus. We: > + 1. Assert OUR_CLAIM. > + 2. Waits a little bit for the other sides to notice (slew time, say 10 > + microseconds). > + 3. Check THEIR_CLAIMS. If none are asserted then the we have the bus and we > + are done. > + 4. Otherwise, wait for a few milliseconds and see if THEIR_CLAIMS are released. > + 5. If not, back off, release the claim and wait for a few more milliseconds. > + 6. Go back to 1 (until retry time has expired). > + their-claim-gpios: > + minItems: 1 > + maxItems: 2 > + description: > + The GPIOs that the other sides use to claim the bus. Note that some > + implementations may only support a single other master. Where does the maxItems: 2 come from? --ZlpMUJot7nwCApJ5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZLvGawAKCRB4tDGHoIJi 0jJhAQCbYOZez/5kf9akM32O2aDza6i0f9bNeZ80SrDUech7fgD+O0SMp9cHjbFS IVJ6YbJ/S8pfSac/P2s09mqXwsGiUgU= =Wp9x -----END PGP SIGNATURE----- --ZlpMUJot7nwCApJ5--