Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756755Ab3JIBn6 (ORCPT ); Tue, 8 Oct 2013 21:43:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46079 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755992Ab3JIBny (ORCPT ); Tue, 8 Oct 2013 21:43:54 -0400 Date: Tue, 8 Oct 2013 18:41:44 -0700 From: Greg Kroah-Hartman To: delicious quinoa Cc: Alan Tull , "H. Peter Anvin" , monstr@monstr.eu, Pavel Machek , Michal Simek , linux-kernel@vger.kernel.org, Dinh Nguyen , Philip Balister , Alessandro Rubini , Steffen Trumtrar , Jason Gunthorpe , Jason Cooper , Yves Vandervennet , Kyle Teske , Josh Cartwright , Nicolas Pitre , Mark Langsdorf , Felipe Balbi , linux-doc@vger.kernel.org, Mauro Carvalho Chehab , David Brown , Rob Landley , "David S. Miller" , Joe Perches , Cesar Eduardo Barros , Samuel Ortiz , Andrew Morton Subject: Re: [RFC PATCH v2 0/1] FPGA subsystem core Message-ID: <20131009014144.GB17066@kroah.com> References: <20131004141646.GA9396@kroah.com> <524ED081.1040600@monstr.eu> <524EF0CE.4040002@zytor.com> <524EFE76.70200@monstr.eu> <524F04FD.5020804@zytor.com> <20131004233341.GA4028@kroah.com> <1381251614.6062.9.camel@atx-linux-37> <20131008214401.GC11941@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4486 Lines: 94 On Tue, Oct 08, 2013 at 06:47:41PM -0500, delicious quinoa wrote: > On Tue, Oct 8, 2013 at 4:44 PM, Greg Kroah-Hartman > wrote: > > On Tue, Oct 08, 2013 at 12:00:14PM -0500, Alan Tull wrote: > >> On Fri, 2013-10-04 at 16:33 -0700, Greg Kroah-Hartman wrote: > >> > On Fri, Oct 04, 2013 at 11:12:13AM -0700, H. Peter Anvin wrote: > >> > > On 10/04/2013 10:44 AM, Michal Simek wrote: > >> > > > > >> > > > If you look at it in general I believe that there is wide range of > >> > > > applications which just contain one bitstream per fpga and the > >> > > > bitstream is replaced by newer version in upgrade. For them > >> > > > firmware interface should be pretty useful. Just setup firmware > >> > > > name with bitstream and it will be automatically loaded in startup > >> > > > phase. > >> > > > > >> > > > Then there is another set of applications especially in connection > >> > > > to partial reconfiguration where this can be done statically by > >> > > > pregenerated partial bitstreams or automatically generated on > >> > > > target cpu. For doing everything on the target firmware interface > >> > > > is not the best because everything can be handled by user > >> > > > application and it is easier just to push this bitstream to do > >> > > > device and not to save it to the fs. > >> > > > > >> > > > I think the question here is if this subsystem could have several > >> > > > interfaces. For example Alan is asking for adding char support. > >> > > > Does it even make sense to have more interfaces with the same > >> > > > backend driver? When this is answered then we can talk which one > >> > > > make sense to have. In v2 is sysfs and firmware one. Adding char > >> > > > is also easy to do. > >> > > > > >> > > > >> > > Greg, what do you think? > >> > > > >> > > I agree that the firmware interface makes sense when the use of the > >> > > FPGA is an implementation detail in a fixed hardware configuration, > >> > > but that is a fairly restricted use case all things considered. > >> > > >> > Ideally I thought this would be just like "firmware", you dump the file > >> > to the FPGA, it validates it and away you go with a new image running in > >> > the chip. > >> > > >> > But, it sounds like this is much more complicated, so much so that > >> > configfs might be the correct interface for it, as you can do lots of > >> > things there, and it is very flexible (some say too flexible...) > >> > > >> > A char device, with a zillion different custom ioctls is also a way to > >> > do it, but one that I really want to avoid as that gets messy really > >> > quickly. > >> > >> Hi Greg, > >> > >> We are discussing a char device that has very few interfaces: > >> - a way of writing the image to fpga > >> - a way of getting fpga manager status > >> - a way of setting fpga manager state > >> > >> This all looks like standard char driver interface to me. Writing the > >> image could be writing to the devnode (cat image.bin > /dev/fpga0). The > >> status stuff would be sysfs attributes. All normal stuff any char > >> driver in the kernel would do. Why not just go with that? > > > > Because we really hate to add new ioctls to the kernel if at all > > possible. > > I don't see any need for adding any ioctls. > > > Using sysfs (and it's one-value-per-file rule), makes > > userspace tools easier, and managing the different devices in the system > > easier (you know _exactly_ which device you are talking to, you don't > > have to guess based on minor number). > > That's cool. The interface we could use is writing the raw fpga data > to /sys/class/fpga_manager/fpga0/fpga_config_data > > Reading or setting the fpga state could be from > /sys/class/fpga_manager/fpga0/fpga_config_state Ok, that's fine, I don't object to that, but you are giving up the notification and loading ability of the kernel for the image files by doing this, which will require you to use/write/maintain userspace tools. If you use the firmware interface, no userspace tool is needed at all, which I can see some people really wanting, right? > Or do I misunderstand? Do you include sysfs attributes when you > are talking about ioctls? You can't do ioctls on sysfs files, so no. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/