Re: /dev/disk0 vs /dev/mmc0

2013-10-07 Thread David Jander
On Mon, 7 Oct 2013 08:41:11 +0200
Sascha Hauer  wrote:

> On Mon, Oct 07, 2013 at 08:32:03AM +0200, David Jander wrote:
> > 
> > Dear Sascha,
> > 
> > On Sun, 6 Oct 2013 12:39:50 +0200
> > Sascha Hauer  wrote:
> > > 
> > > It doesn't interfere with the kernel. The kernel currently ignores this
> > > aliases. There are patches floating to let the kernel honor this
> > > aliases, but then they should simply have the same effect as they have
> > > in barebox.
> > 
> > That doesn't _feel_ right. Changing standard device names in Linux via
> > aliases in the DT might be a fancy idea, but it'd have a different
> > reason/use-case than in the case of barebox. IMHO using the same DT for
> > both seems to be the Right Thing (tm) to do, but then the semantics must
> > be the same also. If I need aliases in the DT only to be able to tell
> > devices apart from each other in barebox, while in Linux the effect would
> > only be a rather inconvenient renaming of devices with no other added
> > value, I think we need a different way to differentiate devices in
> > barebox. Why not just use a simple driver-provided prefix (mci, mmc, usb,
> > sata, etc...) for now?
> 
> That's not enough. We also need a fixed numbering. Otherwise a
> nonremovable eMMC and a removable SD card change their device names
> depending on the detect order.

True. Can host->dev.id be used? Should be fixed AFAICS...

> Using aliases to provide a numbering is done in the Kernel aswell at
> least for gpios, uarts and i2c busses, so expanding this scheme to
> mmc/sd slots doesn't feel too wrong to me.

Yes, but we are doing it in barebox now only because there is no other way to
tell devices apart from each other. While the MMC device being called
"mmcblk0" or whatever in Linux is perfectly fine (no need for alias), in
barebox the device is now named "disk0", and there is no way of knowing what
"disk0" actually is. Using DT-aliases for that purpose seems wrong to me.
Why was this changed anyway? Introduction of some common "disk" layer (like
scsi-disk on Linux)? Or just for the sake of confusing it with other
"disk"-like devices?

Best regards,

-- 
David Jander
Protonic Holland.

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] i2c-omap: fix reported revison

2013-10-07 Thread Jan Weitzel
Report correct major and minor revision
Signed-off-by: Jan Weitzel 
---
 drivers/i2c/busses/i2c-omap.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index bec3b29..8e31ef4 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1079,7 +1079,7 @@ i2c_omap_probe(struct device_d *pdev)
omap_i2c_init(i2c_omap);
 
dev_info(pdev, "bus %d rev%d.%d at %d kHz\n",
-pdev->id, i2c_omap->rev >> 4, i2c_omap->rev & 0xf, 
i2c_omap->speed);
+pdev->id, major, minor, i2c_omap->speed);
 
omap_i2c_idle(i2c_omap);
 
-- 
1.7.0.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: /dev/disk0 vs /dev/mmc0

2013-10-07 Thread Sascha Hauer
On Mon, Oct 07, 2013 at 11:57:35AM +0200, David Jander wrote:
> On Mon, 7 Oct 2013 08:41:11 +0200
> Sascha Hauer  wrote:
> 
> > On Mon, Oct 07, 2013 at 08:32:03AM +0200, David Jander wrote:
> > > 
> > > Dear Sascha,
> > > 
> > > On Sun, 6 Oct 2013 12:39:50 +0200
> > > Sascha Hauer  wrote:
> > > > 
> > > > It doesn't interfere with the kernel. The kernel currently ignores this
> > > > aliases. There are patches floating to let the kernel honor this
> > > > aliases, but then they should simply have the same effect as they have
> > > > in barebox.
> > > 
> > > That doesn't _feel_ right. Changing standard device names in Linux via
> > > aliases in the DT might be a fancy idea, but it'd have a different
> > > reason/use-case than in the case of barebox. IMHO using the same DT for
> > > both seems to be the Right Thing (tm) to do, but then the semantics must
> > > be the same also. If I need aliases in the DT only to be able to tell
> > > devices apart from each other in barebox, while in Linux the effect would
> > > only be a rather inconvenient renaming of devices with no other added
> > > value, I think we need a different way to differentiate devices in
> > > barebox. Why not just use a simple driver-provided prefix (mci, mmc, usb,
> > > sata, etc...) for now?
> > 
> > That's not enough. We also need a fixed numbering. Otherwise a
> > nonremovable eMMC and a removable SD card change their device names
> > depending on the detect order.
> 
> True. Can host->dev.id be used? Should be fixed AFAICS...

host->dev.id depends on the probe order.

> 
> > Using aliases to provide a numbering is done in the Kernel aswell at
> > least for gpios, uarts and i2c busses, so expanding this scheme to
> > mmc/sd slots doesn't feel too wrong to me.
> 
> Yes, but we are doing it in barebox now only because there is no other way to
> tell devices apart from each other. While the MMC device being called
> "mmcblk0" or whatever in Linux is perfectly fine (no need for alias),

Linux has exactly the same problem. There are enough systems on which
the eMMC changes its name depending on a SD card being plugged in or
not.

> in
> barebox the device is now named "disk0", and there is no way of knowing what
> "disk0" actually is. Using DT-aliases for that purpose seems wrong to me.
> Why was this changed anyway? Introduction of some common "disk" layer (like
> scsi-disk on Linux)? Or just for the sake of confusing it with other
> "disk"-like devices?

It has always been diskx on barebox, this behaviour hasn't changed.

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox