Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4915881ybv; Mon, 17 Feb 2020 08:21:50 -0800 (PST) X-Google-Smtp-Source: APXvYqy4toy1i7axB5RA8a5bwiaU4KYr6ih5AfoEda/sduhBtnG2mGm9/6wRAkcqHaiIz6keG1/l X-Received: by 2002:a9d:760d:: with SMTP id k13mr12239169otl.42.1581956509987; Mon, 17 Feb 2020 08:21:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581956509; cv=none; d=google.com; s=arc-20160816; b=ijmRy2rfeDa8uKSxZfehO6ZZPbYyWf0crlmNUil+4S1UcReoNzx9a6qxAbgKzqs08d 2xaekH7fLc8P7VpuJ4bDDalp3JIFn2ogs3jXajTB09r2BG8VST2YBw/UpHv3O08/9dDN CBySSv4wIRySggQI6oHHmiYkbQuv1Uk8QaXslQoyiPsIR42A6J/frSdRW0zX0LiJCcaM 0z0mj+g+ujLEwKCSA2pIfoihRnlKKqbx+3l0X8ZcpxfHDVwE/b9NTGBMOLIEZtpXCB8c 72RWBZdJjsC6xYOuO26V9cY5lOYevfruWUsXRjUD4Egg/Dv5VSM2masvHm6uDopSORml NAPg== 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 :in-reply-to:references:mime-version; bh=lz5L3NbtJ0eT+z7vQiCfCDfhvILPoZ8ZpwXcA1H2eD4=; b=Q3DAqTse1h/9uoyWJ1qsZeec1vqmK9MXAPWftoi6NtR3EYIoIiws11c1ezm0buC5Mw x08IjFa3zmb4Hj08wDAeO5/ivw5YsbO+bvpGp3K5uwjyhYTAXdRlBvstNyMnUFUat4XU Sydnsp52QOghd+JpyPDQ30K0xNneQYTM9Pd5sA/8Vkor9jKw9Z42GqZ/MHeDShaaZkvJ lcNC7D/8/cOlWfERbN/lzcmCmIWVAmJAu5CMOjqQHsofoDA5EPq9v7iaja53m1aDv4iu HJgl7zOngJJg9Z7vk+caklvNqlmOm1IdYLRwPnegoy2BFsK8b0SZXhPIC/DQZwW9jMbT PzMA== 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 l80si6587876oib.268.2020.02.17.08.21.37; Mon, 17 Feb 2020 08:21:49 -0800 (PST) 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 S1726879AbgBQQUQ (ORCPT + 99 others); Mon, 17 Feb 2020 11:20:16 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:37999 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbgBQQUQ (ORCPT ); Mon, 17 Feb 2020 11:20:16 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MS3zP-1isTnI0KwF-00TYUK for ; Mon, 17 Feb 2020 17:20:15 +0100 Received: by mail-qv1-f53.google.com with SMTP id y2so7788168qvu.13 for ; Mon, 17 Feb 2020 08:20:14 -0800 (PST) X-Gm-Message-State: APjAAAWihEqOlChBvk1J58pqVWk1G68M8Fzd3rX1xsH+z1UV39On1Nch xdQWKPdD88+uSWY5qlewItIhiXXJkgo3hLAxkKQ= X-Received: by 2002:a05:6214:524:: with SMTP id x4mr13442601qvw.4.1581956413750; Mon, 17 Feb 2020 08:20:13 -0800 (PST) MIME-Version: 1.0 References: <20200217155141.08e87b3f@collabora.com> <20200217163622.6c78fa3f@collabora.com> In-Reply-To: <20200217163622.6c78fa3f@collabora.com> From: Arnd Bergmann Date: Mon, 17 Feb 2020 17:19:57 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC v2 0/4] Introduce i3c device userspace interface To: Boris Brezillon Cc: Vitor Soares , "linux-kernel@vger.kernel.org" , linux-i3c@lists.infradead.org, Jose Abreu , Joao Pinto , Wolfram Sang , gregkh , Boris Brezillon , Mark Brown Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:g+UpWlHjuSTTJLK08YLd+oHfifIgzuoa7a0t8p6HCeak7K+ng8c mp4MYM7jui9SnNMiguKBKFpDxPm2hN1WI2Kir9S3Dg5WPMDew7lZ8P0bN5MbVrVl9Oblz7l 5Nru81BmDVLHnpWf1y4lVgg1gQm4m3uNn5nxYQdzBuaaahyoFRhI8VOFScEjEDjZVTKaLuZ x/Aju0LA4cytZqBWzs71w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:qeIXXhfCi8c=:gbJd3OxhP3Yv4BJwUf5mCi /BRi/GyyG834gpER1Dxyk5qFYBR2l5RCkHNuweME/i6f+YB99xQvDsQIACjSN9cAH03sadccP xNDV20mL7ttthK8DcwlTjWrZnMmEo8Nzm2BxTM6N3XfEr3uCpYjCqHfTCgvJ1lmuzhLN1i0Fg h2XEtjqJNT5zYja+Bij0lVnItR8OOGy8FSNrp/g/FfCGW7hPin5IQRiKBQOI4HfynI6TSggdp XTmZqm0+X23ts16DDzc1aycBtmU0O0Wu0nZyF1nxek1+NQOCs3ACyjFNz/nbnXMom0aIsxX2W Y6mtbDk/BPWMxfCdhQKQJnc6BrkwSajiZ6pjqyHlRsK/LgWWu119eXXumvdYI3XA3fRMvPkjw Zymouf3f7sYAg4c/M44wfCyiuEUNKQV/jdeL1VmlqkGlyE9msxWb4Kdg0DhzIoGeNUL6fj9sJ ybj79ZbqcK1qBZ07DXL+HtFoBLw225r1ge3ugmJUoIOv05kKZEV7ueiArr5uySTLEpu/DfUjd QToHkwVNkt3wzOgNx1YYoPg5U19xBH4gWm/zmNP54Cv5Cfn5GCL9WhsKDWZhxDWuxFs3zeEjf 2zozqY+oQ/3R1yLdR5Mg9dBvtvaKrowmOARu7UgAhJuIhkzDiSi4meBLgwtJTTVLf+cwMjgqo NqjdIqeTIGY6f02yDI/uIiEpcju3/gLuKUzdp4KhrTgszk+fTShUkXf8z17NjwRRNF/qItFte Le8lA+nmt82PCmcFNjs56oDZApm08yx6/kfde2VvP8p9XahIM7bhME0rjHLYXwkDoMj9JXwbw gMcFrffYlfOCk0IYQu16cqTj3vBII/YRKcT8mQA7tU6Bde9I1s= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 17, 2020 at 4:36 PM Boris Brezillon wrote: > On Mon, 17 Feb 2020 16:06:45 +0100 Arnd Bergmann wrote: > > On Mon, Feb 17, 2020 at 3:51 PM Boris Brezillon > > wrote: > > > Sorry for taking so long to reply, and thanks for working on that topic. > > > > > > On Wed, 29 Jan 2020 13:17:31 +0100 > > > Vitor Soares wrote: > > > > > > > For today there is no way to use i3c devices from user space and > > > > the introduction of such API will help developers during the i3c device > > > > or i3c host controllers development. > > > > > > > > The i3cdev module is highly based on i2c-dev and yet I tried to address > > > > the concerns raised in [1]. > > > > > > > > NOTES: > > > > - The i3cdev dynamically request an unused major number. > > > > > > > > - The i3c devices are dynamically exposed/removed from dev/ folder based > > > > on if they have a device driver bound to it. > > > > > > May I ask why you need to automatically bind devices to the i3cdev > > > driver when they don't have a driver matching the device id > > > loaded/compiled-in? If we get the i3c subsystem to generate proper > > > uevents we should be able to load the i3cdev module and bind the device > > > to this driver using a udev rule. > > > > I think that would require manual configuration to ensure that the correct > > set of devices get bound to either the userspace driver or an in-kernel > > driver. > > Hm, isn't that what udev is supposed to do anyway? Remember that > I3C devices expose a manufacturer and part-id (which are similar to the > USB vendor and product ids), so deciding when an I3C device should be > bound to the i3cdev driver should be fairly easy, and that's a > per-device decision anyway. > > > The method from the current patch series is more complicated, > > but it means that any device can be accessed by the user space driver > > as long as it's not already owned by a kernel driver. > > Well, I'm more worried about the extra churn this auto-binding logic > might create for the common 'on-demand driver loading' use case. At > first, there's no driver matching a specific device, but userspace > might load one based on the uevents it receives. With the current > approach, that means we'd first have to unbind the device before > loading the driver. AFAICT, no other subsystem does that. As I understand it, this is handled by the patches: when a new device shows up, this triggers the creation of the userspace interface and also the event that leads to the kernel driver to get loaded. If there is a kernel driver for the device, that should still load and bind to the device, at which point the user space interface will go away again. This may waste CPU cycles for first creating and then destroying the user space interface, but I don't see how it requires extra work. If it does require manual configuration or unbinding, that would indeed be a bad design. Arnd