Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7157331imm; Tue, 24 Jul 2018 09:16:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf2pgclMVFd2H3yK7BHm+0Ef2Ob6YijBefnWC6sDYVS+M9ZRrVPkzg7DNRhfLOD/8sybXox X-Received: by 2002:a63:ec14:: with SMTP id j20-v6mr16680086pgh.28.1532448991480; Tue, 24 Jul 2018 09:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532448991; cv=none; d=google.com; s=arc-20160816; b=FzQpM4YlsMqxKgPAIsVyI7PUZWe+DbgdX8HE5sHxukhlNDMBqMhqskQJyQhtNo6JTD mURLPtR//Byq8iaOUz7NqOeba11CBQxqEYjeAvVm90D3rPZ9RbPGSxdH0jjkZC/hrS7H AUMSrKkYKHpXtoLoHdv8ktVr/Fl5G0Oviu+bmiJwMzlQ+bMzQCNTylV0Ndg6VdvFRBbZ HvJs8aoQbSh67iewxGHM4s+0g65TobXlZiuXQZaYcpfq9YBtmamzuI6TUqBGp0kQj7kh 3qDmKF/nzIbTbGV+MNMegOWt7cfumxane1wdLH7IWgaNJXdWYhRv+tMJ7ba+0gG2VrLk TUpQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=GnnbHl7axWkEqdr7f36TKukCdcVh/NuyVEbqhpqaGvY=; b=SVKryGygLTxm1aIlll0N5a0+ZYpei0R/KOmyOQAzWQehvAJeiN+LBMWukzpj5Fj06S rCh7eg/avD+id/QYXqEoQlz6zJnI6Mt8eCHMXnFLbUFmBfOQjdNccQgAspuSg6uY7trT WK8JnltHDgTUKP4KUe+OEcqbWR/6vz6Gc8BoH53eDTmuSqWagC1UvoSXEmoT7AW7owte 5k6YvtifWR9ONkt91WkGTQVZMfwFk+6NYbW3h8LLF8MZbL3GTXzoyFQfmeNYYxlHpA6o PymrUK2oEn0udqxJ+jkM3hBLlMqNzacxazCEv41jzm0sqF26Dn0Tr2cfPJAlTGzn0e6A 21Vg== ARC-Authentication-Results: i=1; mx.google.com; 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 h126-v6si10592350pgc.429.2018.07.24.09.16.16; Tue, 24 Jul 2018 09:16:31 -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; 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 S2388546AbeGXRVx (ORCPT + 99 others); Tue, 24 Jul 2018 13:21:53 -0400 Received: from mail.bootlin.com ([62.4.15.54]:39383 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388289AbeGXRVx (ORCPT ); Tue, 24 Jul 2018 13:21:53 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 39AC220733; Tue, 24 Jul 2018 18:14:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (91-160-177-164.subs.proxad.net [91.160.177.164]) by mail.bootlin.com (Postfix) with ESMTPSA id 73211203D9; Tue, 24 Jul 2018 18:14:37 +0200 (CEST) Date: Tue, 24 Jul 2018 18:14:37 +0200 From: Boris Brezillon To: Arnd Bergmann Cc: Geert Uytterhoeven , Peter Rosin , Wolfram Sang , Linux I2C , Jonathan Corbet , "open list:DOCUMENTATION" , Greg KH , Przemyslaw Sroka , Arkadiusz Golec , Alan Douglas , Bartosz Folta , Damian Kos , Alicja Jurasik-Urbaniak , Cyprian Wronka , Suresh Punnoose , Rafal Ciepiela , Thomas Petazzoni , Nishanth Menon , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , Vitor Soares , Linus Walleij , Xiang Lin , "open list:GPIO SUBSYSTEM" , Sekhar Nori , Przemyslaw Gaj Subject: Re: [PATCH v6 00/10] Add the I3C subsystem Message-ID: <20180724181437.1d1b27a8@bbrezillon> In-Reply-To: References: <20180719152930.3715-1-boris.brezillon@bootlin.com> <2ab0ab75-2df0-2714-f007-c33b25481016@axentia.se> <20180720101206.tv7nsoanwo5ftnia@ninjato> <21b269c5-a3a7-c5de-c81e-c9c9301ae13e@axentia.se> <20180720151751.242d4809@bbrezillon> <20180724162806.318a92c6@bbrezillon> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Jul 2018 17:58:29 +0200 Arnd Bergmann wrote: > On Tue, Jul 24, 2018 at 5:46 PM, Geert Uytterhoeven > wrote: > > Hi Arnd, > > > > On Tue, Jul 24, 2018 at 5:40 PM Arnd Bergmann wrote: > >> On Tue, Jul 24, 2018 at 5:15 PM, Geert Uytterhoeven > >> wrote: > >> > On Tue, Jul 24, 2018 at 5:05 PM Arnd Bergmann wrote: > >> > >> >> That's not the case I was describing here, I was thinking of what > >> >> Wolfram described with the Renesas SoC that has two i2c masters > >> >> multiplexed through the pinmux layer. I would assume that we > >> >> can still do the same thing in i3c by shutting down the current > >> >> master without a handover, and reprobing everything from scratch. > >> > > >> > The major disadvantage of reprobing is that it may cause visual disturbances > >> > when i2c slaves are involved with e.g. the display pipeline (think HDMI encoders > >> > etc.). > >> > >> Do you mean we should reuse the device pointer and association with > >> the driver even when we switch out the i3c master using the pinmux? > >> > >> Or do you mean we need to be prepared for driving a single > >> slave through multiple masters over the lifetime of that device, > >> but using the i3c master handover protocol? > >> In the second case, how do we decide which master to use > >> for accessing a device for a given request? > > > > I'll have to defer to Wolfram. He's the i2c and muxing expert. > > On i2c, we only have the first case, and Wolfram said that it > intentionally does the reprobe to avoid the problems we discussed. > The question is what to do about this if it happens again on i3c. > Peter seemed to think that it was possibly something we might > have to handle, while Boris said that it wouldn't be because it's > not coverered by the i3c spec. > > The second case is the one that started the discussion, and > this is where I said I'd prefer to associate each slave with at > most one master at boot time, while the current v6 patch > is prepared for having one slave be accessed alternatingly > by multiple masters using the master handover, though so > far nobody has been able to describe exactly how we'd pick > which master is active at what point, Even if it's not yet implemented, I have everything in place to figure this out (see the ->cur_master field in the i3c_bus object). Now, what's missing is a list of possible masters attached to an i3c device so that the framework can pick the most appropriate one at runtime and initiate mastership handover if required (if the selected master is not the currently active one). The selection logic should look like this: if (active_master supports requested feature) use active master else pick an inactive one that has relevant caps and initiate mastership handover (+ update bus->cur_master) > or what specific scenario > would require it. I think I described a scenario (masters having different capabilities all connected to the same bus), though I don't know how likely this use case is :-/.