From: Chris Metcalf <cmetcalf@tilera.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] arch/tile: add arch/tile/drivers/ directory with SROM driver
Date: Fri, 6 May 2011 15:37:07 -0400 [thread overview]
Message-ID: <4DC44DE3.8000509@tilera.com> (raw)
In-Reply-To: <201105050841.40576.arnd@arndb.de>
On 5/5/2011 2:41 AM, Arnd Bergmann wrote:
> On Wednesday 04 May 2011, Chris Metcalf wrote:
>> This commit does two things: it adds the infrastructure for a new
>> arch/tile/drivers/ directory, and it populates it with the first
>> instance of a driver for that directory, a SPI Flash ROM (srom) driver.
>>
>> The directory is motivated as follows. While some classes of
>> driver implementations should be grouped together so they are easily
>> modified as a class (network, ATA, RTC, PCI, I2C, etc etc) there are
>> "miscellaneous" drivers that don't benefit from any sharing with other
>> driver implementations. If those drivers are for hardware that can
>> plausibly be used by multiple architectures, it makes sense to put
>> them somewhere like drivers/char. But if they are only usable on
>> a single architecture (in this case drivers written for the Tilera
>> para-virtualization model using our hypervisor) it makes sense to group
>> such drivers with their architecture, to avoid cluttering the "drivers"
>> hierarchy for other architectures that can't use that driver.
> I generally advise against putting any device drivers into arch/*/,
> on the ground that it is much easier to find similar drivers when
> they are in a common place. We probably have a few similar drivers
> in the tree already, e.g drivers/misc/eeprom/* and drivers/char/ps3flash.c
> and drivers/platform/x86/intel_scu_ipcutil.c are examples of preexisting
> drivers.
>
> I'd probably put this one in driver/misc/eeprom and make the interface
> look like the other ones (sysfs bin attribute instead of character
> device), which is a trivial change.
>
> Alternatively, you could create drivers/platform/tile to hold tile
> specific device drivers, instead of keeping them under arch/tile.
For the implementation, as you say, it's worth conforming to the other
eeprom drivers regardless of where we put the actual implementation, so
I'll look into the sysfs infrastructure (I haven't used it before, but I
need to learn about it anyway).
As far as the location in the tree, I think it's 50/50 on something like
our eeprom driver. On the one hand the actual implementation is very
Tilera-specific and very similar to all the other simple Tilera-specific
para-virtualized drivers, which are mostly just read/write wrappers around
hypervisor syscalls (we currently have about a dozen of these for various
minor bits of I/O). On the other hand there is a little bit of eeprom
commonality too, but on balance it feels like it makes more sense to keep
it with the other "misc" Tilera drivers. I'd say neither answer is
obviously wrong :-)
As to where the "misc" Tilera drivers should go, I see that so far there is
only drivers/platform/x86 (as created by Len Brown in 2008, along with a
note that "other architectures will create drivers/platform/<arch>"). Is
it fair to say that "drivers/s390", "drivers/parisc", and "drivers/sh" (for
example) are all in their current locations just for historical reasons,
and should in principle also be under "drivers/platform"? If so, yes,
drivers/platform/tile seems like a reasonable location.
>> +/**
>> + * srom_llseek() - Change the current device offset.
>> [...]
> This looks unnecessary, just use generic_file_llseek.
It looks like I also can just discard the llseek code altogether if we
switch over to the sysfs model - even better :-)
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
next prev parent reply other threads:[~2011-05-06 19:37 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 19:10 [PATCH] arch/tile: add arch/tile/drivers/ directory with SROM driver Chris Metcalf
2011-05-05 6:41 ` Arnd Bergmann
2011-05-06 19:37 ` Chris Metcalf [this message]
2011-05-20 18:05 ` Chris Metcalf
2011-05-20 18:46 ` Arnd Bergmann
2011-05-20 22:40 ` Eric Biederman
2011-05-20 23:39 ` Chris Metcalf
2011-05-21 3:21 ` Greg KH
2011-05-21 9:33 ` Arnd Bergmann
2011-05-21 13:52 ` Chris Metcalf
2011-05-21 15:02 ` Arnd Bergmann
2011-05-21 15:31 ` Chris Metcalf
2011-05-21 15:50 ` Eric Biederman
2011-05-23 20:10 ` Chris Metcalf
2011-05-21 7:46 ` Eric Biederman
2011-05-21 8:32 ` Arnd Bergmann
2011-05-22 0:54 ` Mike Frysinger
2011-05-28 15:13 ` [PATCH v2] arch/tile: add hypervisor-based character driver for SPI flash ROM Chris Metcalf
2011-05-28 21:23 ` Greg KH
2011-05-29 0:32 ` Chris Metcalf
2011-05-29 11:45 ` Greg KH
2011-05-29 12:18 ` Chris Metcalf
2011-05-29 13:47 ` Greg KH
2011-05-29 15:45 ` Arnd Bergmann
2011-05-29 18:23 ` Chris Metcalf
2011-06-02 15:04 ` [PATCH v3] " Chris Metcalf
2011-06-10 16:41 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DC44DE3.8000509@tilera.com \
--to=cmetcalf@tilera.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).