public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Petr Cvek" <petr.cvek@tul.cz>
To: grant.likely@secretlab.ca, linux-kernel@vger.kernel.org
Subject: problem with xsysace
Date: Thu, 06 Oct 2011 12:39:27 +0200	[thread overview]
Message-ID: <op.v2xej1ql4x40tt@localhost> (raw)

Hello,
I'm using microblaze arch linux on ML506 board and I found problem with  
SystemACE CF driver.

When xsysace driver is probed, and dts file does not include entry  
"port-number" (existence of line not actually tested) on line:

	of_property_read_u32(dev->dev.of_node, "port-number", &id);

kernel fails to boot with this message:

	<4>VFS: Cannot open root device "xsa2" or unknown-block(0,0)
	<4>Please append a correct "root=" boot option; here are the available  
partitions:
	<4>fff:ffff0     990864 xs`  (driver?)
	<4>  fff:ffff1     124960 xs`1 00000000-0000-0000-0000-000000000000
	<4>  fff:ffff2     865872 xs`2 00000000-0000-0000-0000-000000000000
	<0>Kernel panic - not syncing: VFS: Unable to mount root fs on  
unknown-block(0,0)

(note xs` xs`1 xs`2)

So I' ve done some searching and found "ace->id" variable, which has value  
"-1". Because this value define letter of drive and is incremented by 'a',  
then with its value of -1, creates letter before 'a' thus '`'.

"ace->id" value is assigned in ace_probe function on line

     of_property_read_u32(dev->dev.of_node, "port-number", &id);
     if (id < 0)
         id = 0;

This condition should prevents value to be less than zero, but is does  
not. This is because type of value, which is unsigned (u32) few lines  
before, condition is never true.  So I suggest changing it to int.  
Actually, there was patch, some time ago, which has changed it into u32.

	http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=5d10302f46df1d9a85c34ea97f9b6c29e414482e

And finally here is my patch, which change this line back:

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index fb1975d..3ed920c 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1155,7 +1155,7 @@ static int __devinit ace_probe(struct  
platform_device *dev)
  {
         resource_size_t physaddr = 0;
         int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard  
coded */
-       u32 id = dev->id;
+       int id = dev->id;
         int irq = NO_IRQ;
         int i;

Signed-off-by: Petr Cvek <petr.cvek@tul.cz>

                 reply	other threads:[~2011-10-06 10:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=op.v2xej1ql4x40tt@localhost \
    --to=petr.cvek@tul.cz \
    --cc=grant.likely@secretlab.ca \
    --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