All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: linux-kernel@vger.kernel.org
Cc: Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@suse.cz>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [patch] portman2x4.c: fix boot hang
Date: Wed, 24 Oct 2007 21:44:17 +0200	[thread overview]
Message-ID: <20071024194417.GA17025@elte.hu> (raw)
In-Reply-To: <alpine.LFD.0.999.0710232057080.30120@woody.linux-foundation.org>

Subject: portman2x4.c: fix boot hang
From: Ingo Molnar <mingo@elte.hu>

when booting an allyesconfig bzImage kernel the bootup hangs in the 
portman2x4 driver (on a box that does not have this hardware), at:

 Pid: 1, comm:              swapper
 EIP: 0060:[<c02f763c>] CPU: 0
 EIP is at parport_pc_read_status+0x4/0x8
  EFLAGS: 00000202    Not tainted  (2.6.23-rc9 #904)
 EAX: f7e57a7f EBX: 00000010 ECX: c2b808c0 EDX: 00000379
 ESI: f7cb8230 EDI: 00000010 EBP: f7cb8230 DS: 007b ES: 007b FS: 0000
 CR0: 8005003b CR2: fff9c000 CR3: 007ec000 CR4: 00000690
 DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
 DR6: ffff0ff0 DR7: 00000400
  [<c04613de>] portman_flush_input+0xde/0x12c
  [<c0461a24>] snd_portman_probe+0x368/0x484
  [<c02fbb8c>] __device_attach+0x0/0x8
  [<c02fce68>] platform_drv_probe+0xc/0x10
  [<c02fba6c>] driver_probe_device+0x74/0x194
  [<c0587174>] klist_next+0x38/0x70
  [<c02fbb8c>] __device_attach+0x0/0x8
  [<c02faea1>] bus_for_each_drv+0x35/0x68
  [<c02fbc22>] device_attach+0x72/0x78

the reason is due to an inconsistent error return code of 1 or 2, while 
snd_portman_probe only realizes negative error codes.

with this fixed the probe fails as it should and the bootup continues.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 sound/drivers/portman2x4.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux/sound/drivers/portman2x4.c
===================================================================
--- linux.orig/sound/drivers/portman2x4.c
+++ linux/sound/drivers/portman2x4.c
@@ -467,7 +467,7 @@ static int portman_probe(struct parport 
 	/* Check for ESTB to be clear */
 	/* 4 */
 	if ((parport_read_status(p) & ESTB) == ESTB)
-		return 1;	/* CODE 1 - Strobe Failure. */
+		return -EIO;	/* CODE 1 - Strobe Failure. */
 
 	/* Set for RXDATA0 where no damage will be done. */
 	/* 5 */
@@ -475,7 +475,7 @@ static int portman_probe(struct parport 
 
 	/* 6 */
 	if ((parport_read_status(p) & ESTB) != ESTB)
-		return 1;	/* CODE 1 - Strobe Failure. */
+		return -EIO;	/* CODE 1 - Strobe Failure. */
 
 	/* 7 */
 	parport_write_control(p, 0);	/* Reset Strobe=0. */
@@ -491,7 +491,7 @@ static int portman_probe(struct parport 
 	 */
 	/* 9 */
 	if ((parport_read_status(p) & TXEMPTY) == 0)
-		return 2;
+		return -EIO;
 
 	/* Return OK status. */
 	return 0;


  parent reply	other threads:[~2007-10-24 19:44 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24  4:19 Linux v2.6.24-rc1 Linus Torvalds
2007-10-24  4:49 ` Willy Tarreau
2007-10-24  5:22 ` Dave Young
2007-10-24  7:23   ` Ingo Molnar
2007-10-24  7:32     ` Ohad Ben-Cohen
2007-10-24  7:33     ` Dave Young
2007-10-24  8:12     ` Jens Axboe
2007-10-24  7:44 ` kvm_main.c:220: error: implicit declaration of function 'smp_call_function_mask' Paolo Ornati
2007-10-24  7:56   ` Jeff Garzik
2007-10-24  8:04 ` Linux v2.6.24-rc1 Ingo Molnar
2007-10-24  8:04 ` Christoph Hellwig
2007-10-24 10:17   ` Linux v2.6.24-rc1, x86 arch code quality, unifications Ingo Molnar
2007-10-24 11:07   ` Linux v2.6.24-rc1 Sam Ravnborg
2007-10-24 12:12     ` Ingo Molnar
2007-10-24 12:21       ` Sam Ravnborg
2007-10-24 21:30       ` [RFC - GIT pull] first step to get rid of x86_64 and i386 dirs Sam Ravnborg
2007-10-24 22:50         ` Randy Dunlap
2007-10-25  6:14           ` Yinghai Lu
2007-10-25 10:56             ` Sam Ravnborg
2007-10-25 15:45               ` Randy Dunlap
2007-10-25 10:18         ` Ingo Molnar
2007-10-25 10:55           ` Sam Ravnborg
2007-10-24  8:10 ` [uml-devel] [Git Patch] arch/um/drivers/ubd_kern.c: fix a building error WANG Cong
2007-10-24  8:10   ` WANG Cong
2007-10-24 11:03   ` [uml-devel] " Jens Axboe
2007-10-24 11:03     ` Jens Axboe
2007-10-24 11:30 ` [git pull] x86 arch updates Ingo Molnar
2007-10-24 11:48   ` Jeff Garzik
2007-10-24 12:03     ` Ingo Molnar
2007-10-24 13:25 ` 2.6.24-rc1 fails with lockup and BUG: Romano Giannetti
2007-10-24 14:27   ` Ingo Molnar
2007-10-24 15:53     ` Romano Giannetti
2007-10-24 15:55       ` Ingo Molnar
2007-10-24 16:11         ` Peter Zijlstra
2007-10-26  5:57           ` Romano Giannetti
2007-10-26  6:37             ` 2.6.24-rc1 fails with lockup - /sbin/ifconfig / inet_ioctl() / dev_close() / rtl8169_down() Ingo Molnar
2007-10-26 16:48               ` Stephen Hemminger
2007-10-26 17:56                 ` Ingo Molnar
2007-10-26 18:33                   ` [PATCH] r8169: don't call napi_disable if not doing NAPI Stephen Hemminger
2007-10-26 20:17                     ` Francois Romieu
2007-10-28 22:18                     ` Romano Giannetti
2007-10-29  8:56                     ` Romano Giannetti
2007-10-24 16:44   ` 2.6.24-rc1 fails with lockup and BUG: Joseph Fannin
2007-10-26  5:59     ` Romano Giannetti
2007-10-24 18:19 ` Linux v2.6.24-rc1 Giacomo Catenazzi
2007-12-04 10:08   ` [Bug 9246] On 2.6.24-rc1-gc9927c2b BUG: unable to handle kernel paging request at virtual address 3d15b925 Ingo Molnar
2007-12-04 16:47     ` Giacomo A. Catenazzi
2007-12-04 20:08       ` Rafael J. Wysocki
2007-12-05  9:26         ` Giacomo A. Catenazzi
2007-10-24 19:44 ` Ingo Molnar [this message]
2007-10-24 20:12   ` [patch] portman2x4.c: fix boot hang Frans Pop
2007-10-24 21:29     ` Ingo Molnar
2007-10-25  8:16   ` Takashi Iwai
2007-10-25  5:18 ` 2.6.24-rc1 doesn't build Theodore Tso
2007-10-25  5:30   ` Kamalesh Babulal
2007-10-25 12:45 ` Linux v2.6.24-rc1 edz_mania
2007-10-26  5:19 ` [PATCH] Dump filtering supports x86_64 sparsemem(Re: Linux v2.6.24-rc1) Ken'ichi Ohmichi
2007-10-26  5:19   ` Ken'ichi Ohmichi

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=20071024194417.GA17025@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --cc=tiwai@suse.de \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.