mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: randy_dunlap <rdunlap@xenotime.net>
To: Wakko Warner <wakko@animx.eu.org>
Cc: linux-kernel@vger.kernel.org, akpm <akpm@osdl.org>,
	linux@dominikbrodowski.net
Subject: [PATCH] pcmcia/ds: handle any error code
Date: Thu, 12 May 2005 22:20:38 -0700	[thread overview]
Message-ID: <20050512222038.325081b2.rdunlap@xenotime.net> (raw)
In-Reply-To: <20050512230206.GA1380@animx.eu.org>

On Thu, 12 May 2005 19:02:06 -0400 Wakko Warner wrote:

| Wakko Warner wrote:
| > 3) I put together a boot kernel/initrd using 2.6.12-rc2 (also tested
| > 2.6.12-rc4) which seems to work, except that pcmcia does not function
| > properly.  When pcmcia.ko gets loaded, it is unable to register it's char
| > dev.  I'm not sure why this is.  2.6.11.8 worked fine with no modifications
| > to the system.  This is a system designed to boot from floppy minimally,
| > search for a device which has some files that populates a tmpfs filesystem
| > which becomes the root filesystem.  This module is loaded from the tmpfs
| > filesystem.  Module-init-tools version is 3.2-pre (Not sure if this makes a
| > difference).  I tested this on a notebook that I have.  I also have this
| > same kernel version installed which works fine.  It could be a different
| > version of module-init-tools, but I'm unsure at this point (I do not have
| > access to the notebook at this time.
| 
| I tested this again today with a few changes.  It appears that if pcmcia.ko
| (or rather the .c files that make it up) are compiled with -Os, it will fail
| to register a character device.  Being that one of my goals for this was to
| fit everything on a floppy, I had to use -Os when building the kernel. 
| (pcmcia was not one of the modules that belongs on the floppy, however I
| did not want to have to compile the kernel and then again for the modules
| w/o -Os)
| 
| I believe that pcmcia.ko is the only module I am using that  uses a dynamic
| major.

There is some small difference in locking in fs/char_dev.c between
2.6.12-rc4 and 2.6.11.8, but I don't yet see why it would cause a
failure in register_chrdev().

Oh, there's a big difference in drivers/pcmcia/ds.c, lots of probe
changes.  This is where to look further (but not tonight).
The question then becomes is this a real regression?

Do you suspect a problem with -Os code generation?

Looks to me like ds.c needs at least this small fix...

---

register_chrdev() can return errors (negative) other then -EBUSY,
so check for any negative error code.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>

diffstat:=
 drivers/pcmcia/ds.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -Naurp ./drivers/pcmcia/ds.c~ds_check_major ./drivers/pcmcia/ds.c
--- ./drivers/pcmcia/ds.c~ds_check_major	2005-05-12 13:16:41.000000000 -0700
+++ ./drivers/pcmcia/ds.c	2005-05-12 19:45:36.000000000 -0700
@@ -1592,9 +1592,9 @@ static int __init init_pcmcia_bus(void)
 
 	/* Set up character device for user mode clients */
 	i = register_chrdev(0, "pcmcia", &ds_fops);
-	if (i == -EBUSY)
+	if (i < 0)
 		printk(KERN_NOTICE "unable to find a free device # for "
-		       "Driver Services\n");
+		       "Driver Services (error=%d)\n", i);
 	else
 		major_dev = i;
 


  reply	other threads:[~2005-05-13  5:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-12  1:52 Bugs in 2.6.12-rc kernels Wakko Warner
2005-05-12 23:02 ` Wakko Warner
2005-05-13  5:20   ` randy_dunlap [this message]
2005-05-13 10:50     ` [PATCH] pcmcia/ds: handle any error code Wakko Warner
2005-05-13 19:45     ` Wakko Warner
2005-05-14 17:22       ` randy_dunlap
2005-05-14 17:26         ` Wakko Warner
2005-05-14 17:32           ` randy_dunlap
2005-06-07  2:09             ` Wakko Warner

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=20050512222038.325081b2.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=wakko@animx.eu.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

all inboxes | Powered by JetHome®