Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7014093imm; Tue, 24 Jul 2018 07:04:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdCqdDXRlQ3ARYxoNRDN1O+ugbFZlQ5xzen37wEl13YFU46P5KW3Ij9EarSDoq92vSBBTDM X-Received: by 2002:a63:ab0c:: with SMTP id p12-v6mr16345338pgf.190.1532441090026; Tue, 24 Jul 2018 07:04:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532441090; cv=none; d=google.com; s=arc-20160816; b=muHe0pPEdOcD8pWmI5Cba3oUd/94GCGp/l8V80OKJwY7TEf6g/IZmFCIBiRDzM9mQj lkPcEFKssmBxFa7FUFOBA7oQW7VoH8lmD/LgcfWiNaTicVzbjWYkk7khEromCckvoCaG 7H1A+nDuoz9RDIM/sV90YWUB5pHSaLDgzbeZGZUQVIqgGD7q9u1wCNiQZNihNwJI3OUs 3CZMtFYjI8AF86wkdFO1ARSA4agrEfLt0xhjymo6p50FfGNU29mrubHwpdvAULoaUJ0R JUcwZcBDsKSBFCcOd+VtnbhUq5gT0fZg9bPZ7OcZBAWVVwyMORUOny6txVj5v3p5hD4Y mdhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=I2DrHoBiiSNvVNg3ODPVs4slcAGKfiV5fUiOIJk2380=; b=q81QKo4hQaO6HMFvlkwfUmPgmq7rrsqImCMeZBmrn0Ko5MXDkGIgOILDsBYxaVkaFA J//4WA0QYvNDzksOHEsciE83fwvOVe6VwuS1yJT1l3mq67IlpxurJrSDFF9/SZxLmm8C TQnzh98xpWWeI0D2YyvkHieSZx39afCaBICPXUYRuYvQMDARgX1+ASPT2xYvahHCgZC+ iPSpXecMa4oTHO8teEaxzEuilRTezeI/el2Q9lbGIrs4xFLQ055MwXFCm4hUwa1KxPKk u10mmCMrjGeSeerUxG0im7IoD0jCwCSLcVMmxEVMek9lwnJpDjgXjWZnVhsTsDy0ImnI EdHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tF3iObDn; 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 x19-v6si11325732pgk.80.2018.07.24.07.04.35; Tue, 24 Jul 2018 07:04:49 -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=fail header.i=@gmail.com header.s=20161025 header.b=tF3iObDn; 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 S2388483AbeGXPKT (ORCPT + 99 others); Tue, 24 Jul 2018 11:10:19 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:33124 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388391AbeGXPKS (ORCPT ); Tue, 24 Jul 2018 11:10:18 -0400 Received: by mail-qt0-f196.google.com with SMTP id c15-v6so4184467qtp.0; Tue, 24 Jul 2018 07:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=I2DrHoBiiSNvVNg3ODPVs4slcAGKfiV5fUiOIJk2380=; b=tF3iObDncjzSeRhWR8Hxqrr/a6sLYL3OHSLHorlH/7YF8sKUPHthFl9beYEx1e5Ah3 k5Tc+B/r1A/I73hr4Pmx+Vy0dXbH5etDfaYoUeTnEqADhhnmbcYSDY5Ih1ArU+8ulqbw QTl1EfsijQze5snElzEeOETt8eAUA7FVOtJDFNZFeykoMOK1FwsQvWeWjLU5t1mAb1pB 2qUoXA1xwkAMUtNHXQHA0UEttxdyJUHqcfPqVpLG9zjpgtQn/3UeJ0fG32IBg6WEGfvt 63XJ7+T5PwmeLyD67C8h7GwtHWhZZ0u2HcYQptkQLosExSNWjGdoaVDztYfNIhm3mk34 bRrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=I2DrHoBiiSNvVNg3ODPVs4slcAGKfiV5fUiOIJk2380=; b=AEXktt9YIU+2KlX1cmEHvKuJHS13j+kbhnG4lvMJ6Y7ILacPocZif/kqSLncBdUIJr aEG/FfbHISrBLFs5arjPpNtsG7GJhsUyN6DRNdBkQpp9LvlxBC8o2nV0QWRNphV6ITwF Qs1+auS8xyxqIckAcIcy5SlKoV7/8BkVnOqz2wT4IqJF8bYGyTGaXYGUEiwxXK6XyUxT z9+KsU8armbmohJ2alb6aah2+cKGJ4Ys76hHymyDvEe9t9aOcZBN2rGUgYpu0jggPaQG 24Jx8+jrKEWeX/nq2J129spmge1t2gY2qrLLygQkjopyl9CNV2H0zvXolYafCw9Qei0v ryMg== X-Gm-Message-State: AOUpUlH+1qzLQJdmU10zIf0MtW78AjYTZkPUS/mj9Z3JOd1P7G0hqFWg iMV9PVo/IImBE2m7FVnZh73uPe1mZW0EI+tg4jU= X-Received: by 2002:a0c:afb8:: with SMTP id s53-v6mr15225159qvc.164.1532441019084; Tue, 24 Jul 2018 07:03:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:967d:0:0:0:0:0 with HTTP; Tue, 24 Jul 2018 07:03:38 -0700 (PDT) In-Reply-To: <20180720151751.242d4809@bbrezillon> 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> From: Arnd Bergmann Date: Tue, 24 Jul 2018 16:03:38 +0200 X-Google-Sender-Auth: w1t9NEseinwBWK0bssflYYmo0hI Message-ID: Subject: Re: [PATCH v6 00/10] Add the I3C subsystem To: Boris Brezillon Cc: Peter Rosin , Wolfram Sang , linux-i2c@vger.kernel.org, Jonathan Corbet , "open list:DOCUMENTATION" , Greg Kroah-Hartman , 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 , DTML , Linux Kernel Mailing List , Vitor Soares , Geert Uytterhoeven , Linus Walleij , Xiang Lin , linux-gpio@vger.kernel.org, Sekhar Nori , Przemyslaw Gaj Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 20, 2018 at 3:17 PM, Boris Brezillon wrote: > On Fri, 20 Jul 2018 13:28:10 +0200 Arnd Bergmann wrote: > >> On Fri, Jul 20, 2018 at 1:13 PM, Peter Rosin wrote: >> > On 2018-07-20 12:57, Arnd Bergmann wrote: >> >> * What I understand from reading i2c-demux-pinctrl.c, a slave device >> >> will only ever be observable from one master at a time, when you >> >> switch over, all children get removed on one master and added to >> >> the other one, to be probed again by their respective drivers. >> >> I can see this as a useful feature on i3c as well, in particular to >> >> deal with the situation where we have i2c slaves connected to a >> >> pinmux that can switch them between an i3c master and an >> >> i2c-only master (possibly a gpio based one). That particular use >> >> case however doesn't seem to fix well in the current code, which >> >> is structure around i3c buses. >> > >> > It's pretty easy to come up with examples where this reprobing is >> > not desirable at all. E.g. if one of the involved I2C devices is >> > a HDMI encoder (I have a TDA19988 here) sitting in the middle of the >> > graphics pipeline. Blink-blink on the screen because some *other* >> > unrelated device needed to be accessed by an alternative master. Not >> > pretty. >> >> Agreed, we definitely don't want to reprobe all devices during normal >> operation for i3c master handover. >> > > Re-probing would not happen, no matter the solution we choose. It's > that, in one case, you would have X virtual/linux devices representing > the same physical device and in the other case, you would just have > one, and everytime a transfer is requested by the driver, the core > would pick the appropriate master to do it (most likely the one in > control of the bus at that time) I think this is one of the cases I'd want to avoid: controlling multiple masters that are active at the same time without going through the handover. If we have an actual pinmux between two masters and only one of them can even see the bus, I think we should go through a complete remove/probe cycle the way that the i2c-demux-pinctrl does today. If OTOH we a primary/secondary master pair with handover capability, I would prefer to not see one slave on both devices at the same time, or (ideally) only use one of the two masters and disable the other one completely. >> If we find a case in which it is needed, we could still deal with it >> like this: >> - enumerate all slaves connected to the bus for each of the >> two masters > > That's what will happen if you don't share the same bus representation. To clarify: I meant list them in the DT representation, not enumerate them in Linux during boot. Sorry for using a misleading description here. >> - mark each slave as status="enabled" in at most one of the >> buses, and as disabled everywhere else > > We shouldn't need to do that. We can just let the driver check whether > the master provides the necessary capabilities to efficiently > communicate with the device, and if it does not just return -ENOTSUPP > in the ->probe() function. This way you'll have a device, but not > driver controlling it on one bus, and on the other bus, you'll have > another device (which points to the same physical device) this time > with a driver attached to it. I'd still hope that we can completely avoid that case and never have the case where one physical device has two live representations in the kernel. It /could/ still be done of course, but would not always do the right thing, depending on the type of device (a temperature sensor could just be probed twice without problems, a network device probably cannot) Arnd