linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@tilera.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Greg KH <gregkh@suse.de>,
	Eric Biederman <ebiederm@aristanetworks.com>,
	<linux-kernel@vger.kernel.org>,
	Chris Wright <chrisw@sous-sol.org>,
	Benjamin Thery <benjamin.thery@bull.net>,
	Phil Carmody <ext-phil.2.carmody@nokia.com>
Subject: Re: [PATCH] arch/tile: add arch/tile/drivers/ directory with SROM driver
Date: Sat, 21 May 2011 11:31:32 -0400	[thread overview]
Message-ID: <4DD7DAD4.4020401@tilera.com> (raw)
In-Reply-To: <201105211702.15949.arnd@arndb.de>

On 5/21/2011 11:02 AM, Arnd Bergmann wrote:
> On Saturday 21 May 2011 15:52:39 Chris Metcalf wrote:
>> Sounds like the consensus is that a character driver is in fact the best
>> option here.
> At least the one that meets the least resistance ;-)

Well, perhaps that's what I meant :-)  I do take Greg K-H's point that we
don't really want to mess with the cleanliness of the bin_attribute API,
though.

> The general tendency is to always group drivers by their purpose these
> days, instead of by the bus or other interface that they are attached
> to. I would definitely prefer grouping it with drivers of the same
> purpose.
>
> The main reason is to make sure that a driver writer can easily find
> existing drivers with the same purpose take them as example code, so
> that new code uses the same API as existing code.
>
> If you want to keep the srom.c driver with a chardev interface for
> the SPI chip only, I would recommend sticking it into drivers/char/
> for now, or possibly a new drivers/char/flash/.

I will plan to push it to drivers/char/tile-srom.c for now, then.

> I have agreed to take over future maintainership of drivers/char and
> driver/misc during UDS in Budapest, basically to keep random
> stuff from getting added there, so I will try to find a better place
> for flash drivers like this.

I'll add my thanks for helping keep the kernel a better place.  It's great
that there are folks like yourself who are willing to devote time to code
and structural cleanliness rather than just shoving in whatever they can
get away with :-)

> Can you explain why there are both i2c and spi drivers? If they
> have the same purpose (e.g. providing a place to store the kernel
> binary) and same data layout, I would recommend using the
> same user interface for both.

The I2C eeprom driver can't be used to store the boot stream, just the SPI
driver; the I2C eeprom driver is mostly for customer use.  In fact the
drivers are similar enough that I rewrote the SPI driver for sysfs first,
since it was harder, but then found that grafting in support for the I2C
driver was pretty easy, since all I had to do was add some
conditionalization (different "chunk" size for writes, no need for write
retries during sector erase, no support for page_size and sector_size
attributes).  The absence of "size" attributes for the I2C driver is the
only visible user interface difference, but it's fundamental to the devices.

It's tempting to combine the drivers into one, but it feels like we might
as well publish the I2C driver with the other eeprom sysfs drivers, and the
SPI driver as a character device, as discussed.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com



  reply	other threads:[~2011-05-21 15:31 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
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 [this message]
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=4DD7DAD4.4020401@tilera.com \
    --to=cmetcalf@tilera.com \
    --cc=arnd@arndb.de \
    --cc=benjamin.thery@bull.net \
    --cc=chrisw@sous-sol.org \
    --cc=ebiederm@aristanetworks.com \
    --cc=ext-phil.2.carmody@nokia.com \
    --cc=gregkh@suse.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).