Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2725533imm; Fri, 20 Jul 2018 03:58:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpezxMpfDXD+OUVQVfhoOAPf7+OBSHSEvLY3/t9VP3u3VvXKPBv17fbkLEykDMQuaPIJ8nCR X-Received: by 2002:a65:660a:: with SMTP id w10-v6mr1586524pgv.366.1532084281437; Fri, 20 Jul 2018 03:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532084281; cv=none; d=google.com; s=arc-20160816; b=RienBrHHXooDjU6uJFfcd53JEo28QKRAfCHVFaELGCw/dhh62dKABdrTxSXtolqg8g vmgNSc/cTiOSwuSktFer9Z7tUok44U9264KBAM+99RbHjIqrCZ/EkMowuLN90m64UTe1 zT5jHOkT0sbpQZtssN4CT0V+7r719CLV1u7x/vivLUs3nVxTwT9baaVvhQCHZ5vALq+/ nqJyzWQbsP8wlI5UYkuqXoVRwIkHk6oyFFAjNI82plXh2PQoIrPDPsljYpkVojjat/PD TMNuvG6Cf05QF9O2POCNJ9WRLGC5/A78JvalFMESKXDghZGVW7A5r3tKYEmOgxAxx4Fn KuGQ== 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=z43dF2khbYJcgqJvlRlv7aXo1E2B5EqmU3p5M6AROqs=; b=ddEfdKF/Ky1QvOf46Dp2FfkaNNnhR8XU5/pvR55sQW4JRm1BKJiaBc25ISw69I9H8J O2iFDbKvpYayHm5nSl5JlWqx5F/7gc6JI4ZrRz06vp7sNkVbUVC7LGjtvSRTvi3AaAb6 PephE8TXeyTMN6sdngl8FMwqV/lQrWbDh+/mS4LaEO897KAdcCsXp8pW9GMBc9PhtmL5 2o9MuX8k3nO4uSmJLXgngtVcecVSes3OxLNN3mNIXsKTmlgcBkZoRtLWfGo/+bey62Z9 0j1r56pE25L9SiBJ1S+u+JbfCbryh4pEUjAlq397vHuy/H2ne/lf5u7pwYGiyO7wd+iw EO7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=fF8DXxnq; 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 r7-v6si1580581pgn.491.2018.07.20.03.57.46; Fri, 20 Jul 2018 03:58:01 -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=fF8DXxnq; 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 S1729816AbeGTLox (ORCPT + 99 others); Fri, 20 Jul 2018 07:44:53 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:41292 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727233AbeGTLox (ORCPT ); Fri, 20 Jul 2018 07:44:53 -0400 Received: by mail-lf1-f65.google.com with SMTP id v22-v6so1503178lfe.8; Fri, 20 Jul 2018 03:57:09 -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=z43dF2khbYJcgqJvlRlv7aXo1E2B5EqmU3p5M6AROqs=; b=fF8DXxnqJsv/N4ovg8dfZcjqG9NXZ6o0SsV3vwcevT/CSsVqHt2m2rYHsU2Khhsevp uIPpODV7KwV7cBFpv23t+Nj5GP6x2JrADfknnEez/2vGgEUMPQL2VhXA3NmJyNbi+CuO m017cyKmJDj8FDY9CAArInHbelzeBleZ8QUsamgqPUuZuK3T0RAT0QpVuls/nsdyI/4U /uxhfqDe9Gr4mAFOWkMXuQh/QyGeJZOK3HJVan2HLkxsWjxBEv7pKoMxTafmE2qW15kW bNp7RQ+wql75YNbYHNV8hlmQtQG3gasrvYv7JnZkT/RJk/kdujx6AMRFVmZ4IXsSTYny tz+w== 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=z43dF2khbYJcgqJvlRlv7aXo1E2B5EqmU3p5M6AROqs=; b=ojuZHzM82Q9pfB0TALtUntNPhqPvXhnD43TCPviiTIrHCbHzNxflcDTBuGiQh3z0iT DPTm05VVj3cBjPMmAVmh5N2LUzJEnmWe+2mBE52J/cG62oOIL2ky5fgwKlyupoM5PqgG GJ5XpeUBRhoQUBpg3omfySeteQvANx6ulI2LXrP0ppx7ReypsJsbnr2dqvtVTW6gvydP CsNLuiX77C/cVsv90h8Xkb4PmdVvshisO+TQKdWZBJ5Gj7UVrTQ6G0cEMHsp2w9PG/d3 nSdgD8jtQYMQViRxkNBwH32DcCbXn/8lPnkGmGLrgFLHsRZEPDLQDND6jbMUCsCy7TIL attw== X-Gm-Message-State: AOUpUlFAIi6F1Hsss4Q3nyjq+2neskVzQg7eOCUYQMeJ28lHwqGVFBAR +u790qIwG0QHDWppPeKORiD09WKLiktf1moOVEA= X-Received: by 2002:a19:b24e:: with SMTP id b75-v6mr1063381lff.11.1532084228538; Fri, 20 Jul 2018 03:57:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:41c1:0:0:0:0:0 with HTTP; Fri, 20 Jul 2018 03:57:07 -0700 (PDT) In-Reply-To: <20180720101206.tv7nsoanwo5ftnia@ninjato> References: <20180719152930.3715-1-boris.brezillon@bootlin.com> <2ab0ab75-2df0-2714-f007-c33b25481016@axentia.se> <20180720101206.tv7nsoanwo5ftnia@ninjato> From: Arnd Bergmann Date: Fri, 20 Jul 2018 12:57:07 +0200 X-Google-Sender-Auth: WxP8cv0M6F9eLTfnExnz8SPkC0c Message-ID: Subject: Re: [PATCH v6 00/10] Add the I3C subsystem To: Wolfram Sang Cc: Peter Rosin , Boris Brezillon , 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 12:12 PM, Wolfram Sang wrote: > >> I have not read much of the I3C spec. I'm just coming from the >> current situation with I2C and the i2c-demux-pinctrl driver which >> tries to retrofit this into the I2C world and is not doing a grand >> job. And how could it? >> >> If you can acknowledge that i2c-demux-pinctrl is needed for I2C >> but for some reason is not needed for I3C because of something >> that differs between I2C and I3C, then fine, by all means ditch >> the explicit bus object. >> >> But in my mind splitting up the devices on the same bus between >> several of our own masters and then not have a single object for >> the bus is going to cause headaches down the line. Be it address >> clashes or trouble with master ping-pong or whatever. >> >> I think the reason for i2c-demux-pinctrl is that some (most?) I2C >> hardware suffers from quirks and one way to work around it is to >> make selected accesses from a different master. I expect I3C HW >> to also suffer from quirks... >> >> Maybe a bit-bang I3C master isn't feasible for some fundamental >> reason? But if it is, then I'd say that it's just a matter of time >> until someone finds a situation where such a thing could be used to >> work around some I3C quirk. And then it might be too expensive to >> always use the bit-bang master for the affected device. >> >> But what do I know? Don't let me hold this series back... > > Thanks, Peter. You nailed it, the I2C use case (and its limits). From > what I know about I3C, bit-banging doesn't sound very feasible to me, so > the situation might be a bit different. Still, no one knows about future > I3C use cases and HW quirks. This is why I encouraged the seperate bus > object because back then it was said it was easy to do and implement. If > this now becomes a show-stopper, we can surely re-decide. I am not > strong on this point, it was just something which would have helped I2C. > (And for that matter, we (= the Renesas Upstream Kernel Team) was > discussing something similar to the i2c demuxer for SPI, too. We have > multiple IP cores which can do SPI on R-Car, all with their pros and > cons) I think we need to distinguish between demuxing and i3c master handover here, they are two separate issues that both need to be solved and that are not too hard to do, but we get into trouble if we combine them in arbitrary ways, which is what I'm concerned about: * 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. * The other thing we definitely have to support for i3c is to deal with handing over control of the bus between the i3c master owned by Linux, and other masters that are /not/ owned by the same Linux instance. This is the part that the spec discusses in much detail, with the intention of temporarily giving up control of the bus to let another master do its thing on a shared slave without user interaction. Combining the two quickly gets nasty I think. The current design seems to imply that a device driver could keep talking to a slave while it is being reparented from one master to another. I can't think of a good reason why we would possibly want that, but it definitely opens up questions in what happens to e.g. the sysfs representation, lock order, and power management that I'd rather not have to think about. Arnd