From: Mark Brown <broonie-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
To: Frederic LAMBERT <frdrc66-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Rob Herring <rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Tobias Klauser <tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org>
Subject: Re: [PATCH] spi/spi-altera: Allow to explicitely override bus number via dts
Date: Wed, 1 Feb 2012 15:05:17 +0000 [thread overview]
Message-ID: <20120201150517.GG13723@sirena.org.uk> (raw)
In-Reply-To: <CAMVnO+n2SW=e7EP-MjLbFeF7ZW6e=FwL=UdOd=cd-XN=C132Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Wed, Feb 01, 2012 at 03:53:00PM +0100, Frederic LAMBERT wrote:
> I wrote a piece of code that uses this nvSRAM as a persistent storage.
> This runs in a softcore embedded in an FPGA, in an equipment.
> The PC version of this application uses a simple file to emulate this
> behavior.
> The simulated version, using an x86 port embedded in a VirtualBox uses a
> piece of virtual disk with /dev/sdb.
So it's just a basic block device?
> To sumarize, I have a same code that works for the 3 architecture, the
> single difference being in the device name:
> /sys/proc/spi/drivers/at25/spi0.0/eeprom for Nios2
> dataBase.dat on Linux
> /dev/sdb on the Virtual Machine
In this case surely the mechanisms used to identify regular disks (UUIDs
and so on) will also work (the .dat file will have to be an override,
but otherwise...)? Names like sdb aren't stable either - they can
change with either software or hardware changes since they just come
from the order of discovery.
> Why should I have to break that, which work nice, to use a bus enumeration
> which would be specific to the real hardware version, because I'm using a
> new tools, DTS, which is supposed to simplify my life.
> Sorry to insist, but this incapacity to set the bus number is a *real*
> regression (for me).
> I know I could use the name chosen by the kernel (it mus be something like
> /sys/.../spi253.0/...), but I have no control on it. If tomorrow someone
> changes something in the spi bus number definition, a kernel upgrade will
> have an impact on the user stuff...
We went through exactly the same routine whenever people noticed that
the names for disks weren't as stable as people had been assuming, for
example with the SATA transition from IDE to SCSI, with network devices,
and in a few other places too. Coming up with fixed names for things
that don't depend on implementation details is really rather hard and
tends to break down eventually either due to software changes or due to
newer hardware.
The other issue with your patch is that setting a bus number is
obviously not a device specific thing, it's something that will apply to
any SPI controller on Linux, and so shouldn't be something driver
specific but should instead be a change to the SPI core.
next prev parent reply other threads:[~2012-02-01 15:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 15:54 [PATCH] spi/spi-altera: Allow to explicitely override bus number via dts Tobias Klauser
[not found] ` <1328025246-23450-1-git-send-email-tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.org>
2012-02-01 13:55 ` Mark Brown
[not found] ` <20120201135524.GD13723-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-02-01 14:01 ` Frederic LAMBERT
[not found] ` <CAMVnO+kWX=NYi+YU9H5nRc9UksCJLQUi-_Kj9UASwoiqZj9tGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 14:08 ` Mark Brown
[not found] ` <20120201140838.GE13723-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-02-01 14:25 ` Frederic LAMBERT
[not found] ` <CAMVnO+m5DTYeK9mHcciqU-y7HGP-d9FXWkvTV4ZJJLTRqjK7LQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 14:35 ` Mark Brown
[not found] ` <20120201143558.GF13723-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-02-01 14:53 ` Frederic LAMBERT
[not found] ` <CAMVnO+n2SW=e7EP-MjLbFeF7ZW6e=FwL=UdOd=cd-XN=C132Qg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 15:05 ` Mark Brown [this message]
[not found] ` <20120201150517.GG13723-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-02-01 15:29 ` Frederic LAMBERT
[not found] ` <CAMVnO+kvjbxW7EdMe_YF=oSp0bR-RqaP_rPM57tyHzGKhsoNxg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 15:42 ` Mark Brown
[not found] ` <20120201154204.GH13723-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-02-01 15:52 ` Frederic LAMBERT
[not found] ` <CAMVnO+nB77XOQHfL1zZLve_=z6vFk_HMF+hj=iMTAuOAYSRExA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-01 17:57 ` Grant Likely
2012-02-01 18:10 ` Mark Brown
2012-02-01 17:59 ` Grant Likely
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=20120201150517.GG13723@sirena.org.uk \
--to=broonie-gfdadszt00ze9xe1eozjha@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=frdrc66-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=tklauser-93Khv+1bN0NyDzI6CaY1VQ@public.gmane.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