From: Paul Gortmaker <p_gortmaker@yahoo.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: alan@lxorguk.ukuu.org.uk, ag784@freenet.buffalo.edu,
linux-kernel@vger.kernel.org
Subject: [PATCH] sbpcd oops on merged requests
Date: Wed, 14 Feb 2001 04:59:11 -0500 [thread overview]
Message-ID: <3A8A56EF.2DA6AB1D@yahoo.com> (raw)
Two fixes here - 1st is to make the new max_drives its own separate
module parameter since the driver uses the existing sbpcd module
parameter internally for more than just module parameters <sigh>.
2nd is more important - if you read more than 4 blocks from the
device, you will get a random crash - meaning you could mount a
cd and do "ls" and think it worked if that is all you did. Anything
more gets a rolling oops, EIP pointing off into outer space etc.
Tracked this down to the addition of the generic merge request
handling added to ll_rw_block in 2.3.41 (apparently nobody has
used this driver since then!!!) - it appears these conflict with
the molestation of the request list that sbpcd does from within.
Rather than attack sbpcd with a chainsaw, I went for the minimal
patch approach and simply disabled request merging. Lets face it,
performance is not an issue if you are using a 2x speed CD with
seek times you measure with a wall calendar.
Patch is against 2.4.2-pre3.
Paul.
--- drivers/cdrom/sbpcd.c~ Wed Feb 14 04:02:04 2001
+++ drivers/cdrom/sbpcd.c Wed Feb 14 04:09:55 2001
@@ -323,7 +323,7 @@
* Andrew J. Kroll <ag784@freenet.buffalo.edu> Wed Jul 26 04:24:10 EDT 2000
*
* 4.64 Fix module parameters - were being completely ignored.
- * Can also specify max_drives as 3rd setup int to get rid of
+ * Can also specify max_drives=N as a setup int to get rid of
* "ghost" drives on crap hardware (aren't they all?) Paul Gortmaker
*
* TODO
@@ -339,6 +339,15 @@
*
*/
+/*
+ * Trying to merge requests breaks this driver horribly (as in it goes
+ * boom and apparently has done so since 2.3.41). As it is a legacy
+ * driver for a horribly slow double speed CD on a hideous interface
+ * designed for polled operation, I won't loose any sleep in simply
+ * disallowing merging. Paul G. 02/2001
+ */
+#define DONT_MERGE_REQUESTS
+
#ifndef SBPCD_ISSUE
#define SBPCD_ISSUE 1
#endif SBPCD_ISSUE
@@ -476,7 +485,8 @@
#else
static int sbpcd[] = {CDROM_PORT, SBPRO}; /* probe with user's setup only */
#endif
-MODULE_PARM(sbpcd, "3i");
+MODULE_PARM(sbpcd, "2i");
+MODULE_PARM(max_drives, "i");
#define NUM_PROBE (sizeof(sbpcd) / sizeof(int))
@@ -5566,7 +5576,6 @@
#else
sbpcd_ioaddr = sbpcd[0];
sbpro_type = sbpcd[1];
- max_drives = sbpcd[2];
#endif
CDo_command=sbpcd_ioaddr;
@@ -5661,6 +5670,21 @@
msg(DBG_SEQ,"found SoundScape interface at %04X.\n", sbpcd_ioaddr);
return (0);
}
+
+#ifdef DONT_MERGE_REQUESTS
+static int dont_merge_requests_fn(request_queue_t *q, struct request *req,
+ struct request *next, int max_segments)
+{
+ return 0;
+}
+
+static int dont_bh_merge_fn(request_queue_t *q, struct request *req,
+ struct buffer_head *bh, int max_segments)
+{
+ return 0;
+}
+#endif
+
/*==========================================================================*/
/*
* Test for presence of drive and initialize it.
@@ -5828,6 +5852,11 @@
#endif MODULE
}
blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);
+#ifdef DONT_MERGE_REQUESTS
+ (BLK_DEFAULT_QUEUE(MAJOR_NR))->back_merge_fn = dont_bh_merge_fn;
+ (BLK_DEFAULT_QUEUE(MAJOR_NR))->front_merge_fn = dont_bh_merge_fn;
+ (BLK_DEFAULT_QUEUE(MAJOR_NR))->merge_requests_fn = dont_merge_requests_fn;
+#endif
blk_queue_headactive(BLK_DEFAULT_QUEUE(MAJOR_NR), 0);
read_ahead[MAJOR_NR] = buffers * (CD_FRAMESIZE / 512);
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
reply other threads:[~2001-02-14 10:13 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=3A8A56EF.2DA6AB1D@yahoo.com \
--to=p_gortmaker@yahoo.com \
--cc=ag784@freenet.buffalo.edu \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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.