Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753339Ab3ISR2h (ORCPT ); Thu, 19 Sep 2013 13:28:37 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:56694 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752866Ab3ISR21 (ORCPT ); Thu, 19 Sep 2013 13:28:27 -0400 Date: Thu, 19 Sep 2013 11:28:14 -0600 From: Jason Gunthorpe To: Yves Vandervennet Cc: monstr@monstr.eu, Alan Tull , Jason Cooper , Michal Simek , linux-kernel@vger.kernel.org, Pavel Machek , Greg Kroah-Hartman , Dinh Nguyen , Philip Balister , Alessandro Rubini , Mauro Carvalho Chehab , Andrew Morton , Cesar Eduardo Barros , Joe Perches , "David S. Miller" , Stephen Warren , Arnd Bergmann , David Brown , Dom Cobley Subject: Re: [RFC PATCH] fpga: Introduce new fpga subsystem Message-ID: <20130919172814.GA3855@obsidianresearch.com> References: <20130918191517.GQ19937@titan.lakedaemon.net> <20130918203247.GA11181@obsidianresearch.com> <1379539063.31417.23.camel@atx-linux-37> <523AD814.1060406@monstr.eu> 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) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.161 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1765 Lines: 37 On Thu, Sep 19, 2013 at 10:18:03AM -0500, Yves Vandervennet wrote: > On Thu, Sep 19, 2013 at 5:55 AM, Michal Simek wrote: > > >> Is there some way a per-device userspace helper can be added that can > >> handle adding the headers? Such that different fpga types get different > >> helpers? > > > > What do you exactly mean by that? Any example what do you want to achieve? > Bit streams may not be in raw format, so using 'cat' is not possible. > Xilinx and Altera have their own bit stream "richer" format, that need > to be processed before they are presented to the driver(s). So, a > hotplug helper per manufacturer/FPGA is required. Assuming 'cat' will > be used is too limiting. > Does it make sense to you? IMHO it doesn't make sense to use request firmware for this, in general. 1) The driver doesn't know what firmware to request. It just knows how to send it to a FPGA. 2) Telling the kernel a filename via sysfs and then having it go around the long way via request_firwmare to get the data is silly. Just give the kernel the actual data instead of a file name 3) It is hard to use, when userspace writes the file name the kernel doesn't return until request_firmware completes, which means you need multiple threads in user space to make this work. 4) Converting an input file into bitstreamable format should be done in userspace. This doesn't require request_firmware. If you want to make it automatic then a program invoked via udev is the way to go. Jason -- 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/