Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4954872ybv; Mon, 17 Feb 2020 09:09:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyEbkp1ncWEPACTHvYp/7lthy5PiZ3cd3DXhtuaqtqoLT9cckMGs6dZFFscKpkQ0GAaKgsf X-Received: by 2002:aca:503:: with SMTP id 3mr44032oif.106.1581959358174; Mon, 17 Feb 2020 09:09:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581959358; cv=none; d=google.com; s=arc-20160816; b=0O47XPNrIZdDPpRZE7DQ6+FBgJ+ztHGC12huGEOww5uCBAsMRSy+dxnAFUWc/n4vnn ep0HoKsEN2ToQqcxjors0ZhHL5N0BOtpBA0MKWn1HzbURmL3gXY+6knQos9KXrW/BDyy C1ZJOwCgWLAXoM7DycNFrt80Q3iyTMCBiFY9BsT8Vb0rWOxP8zGh3K1Zw9Xyod8cc5b5 XHZh+xNhWIoxWLfeFDFpApvb7tFO/mb/5/x9BASqunGacfStDtdArFBNdNvtY5joHRUv 5Q4TvGiogZQs+hOHlS/JBXwwONYXfEA4/1NzAET8QLwy9z858zU7vZZd5m3c5+jl0J7S 2Hqg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=jtT16Jxrj0t4rmcF3pI027RlFrD1sO/0vfoT1pfCP7k=; b=eZU7YVJYjjx4omLI5xOzUW7c4ZC+zptn0STy6epyFGg1MiWq0eP4GBPIF3MTOyGa8I ezAngREPBUMmm6kUnl7Ry8WBQ/lrhhDwkhF2GKsI3TRaFuR08QQTJG8Q/szsPK3Vxlfy sWbTaxR3WtG7KE6PqEKVOSdW7dfqgvnIFqdct4h/VRvBiwsEPOVzHO54zk0E/JLKaQXF htMXH+oXQ6aXtpfJTCMERhxUta6G/h5lHBCaOmUJDbGAuVnplXV+freOPcp0gR9BhnfZ imv/XPY+RcTWsYTyXCn8Ww5dVZZ6hpK+Bb2YIfEpKgivCI0iIcRnX5NBEz/AMm569hvP nHWg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si465826otp.129.2020.02.17.09.09.05; Mon, 17 Feb 2020 09:09:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728929AbgBQRGY (ORCPT + 99 others); Mon, 17 Feb 2020 12:06:24 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42602 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728142AbgBQRGX (ORCPT ); Mon, 17 Feb 2020 12:06:23 -0500 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 6751B293BEA; Mon, 17 Feb 2020 17:06:21 +0000 (GMT) Date: Mon, 17 Feb 2020 18:06:17 +0100 From: Boris Brezillon To: Arnd Bergmann Cc: Jose Abreu , Joao Pinto , Wolfram Sang , gregkh , Boris Brezillon , "linux-kernel@vger.kernel.org" , Vitor Soares , Mark Brown , "linux-i3c@lists.infradead.org" Subject: Re: [RFC v2 0/4] Introduce i3c device userspace interface Message-ID: <20200217180617.79bc5b1d@collabora.com> In-Reply-To: References: <20200217155141.08e87b3f@collabora.com> <20200217163622.6c78fa3f@collabora.com> <20200217172309.26697082@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-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 Mon, 17 Feb 2020 17:31:08 +0100 Arnd Bergmann wrote: > On Mon, Feb 17, 2020 at 5:23 PM Boris Brezillon > wrote: > > On Mon, 17 Feb 2020 15:55:08 +0000 Vitor Soares wrote: > > > > Okay, I have clearly not read the code carefully enough. I thought you > > were declaring a new i3c_device_driver and were manually binding all > > orphan devices to this driver. Looks like the solution is more subtle > > than that, and i3cdevs are actually subdevices that are automatically > > created/removed when the I3C device is unbound/bound. That means the > > 'on-demand driver loading' logic is not impacted by this new layer. I'm > > still not convinced this is needed (I expect i3cdev to be used mostly > > for experiment, and in that case, having a udev rule, or manually > > binding the device to the i3cdev driver shouldn't be a problem). > > I'm fairly sure it's not needed, other approaches could be used to > provide user space access, but it's not clear if any other way is > better either. It also took me a while to figure out what is going on > when I read the code. > > One thought that I had was that this could be better integrated into > the core, with user space being there implicitly through sysfs rather > than a /dev file. Hm, doing I3C transfers through sysfs sounds a bit odd. sysfs entries are most of the time exposing human readable/writable stuff (plain text data, that is). > > > I'm also not sure what happens if the device is still used when > > i3cdev_detach() is called, can transfers still be done after the device > > is attached to its in-kernel driver? > > I think this is still an open issue that I also pointed out. The driver > binding/unbinding and user space access definitely needs to > be properly serialized, whichever method is used to implement the > user access. Well, going for the spidev approach would solve that and make the whole implementation more straightforward and less invasive (no notifier, no need to expose internal device types to this i3cdev driver, no concurrency issues, ...). We can always revisit this solution if it proves to be to limited and we feel the need for a kernel-driven i3cdev auto-binding logic, but I doubt we'll ever be in that position since udev can handle that for us, and if we start having actual userspace drivers (which is not the case yet), I expect distros to add the relevant udev rules to take care of this auto-bind.