From: "Jan Beulich" <JBeulich@novell.com>
To: <linux-kernel@vger.kernel.org>
Subject: [PATCH] ide-floppy adjustments
Date: Thu, 12 May 2005 10:32:34 +0200 [thread overview]
Message-ID: <s28322a5.093@emea1-mh.id2.novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1771 bytes --]
(Note: Patch also attached because the inline version is certain to get
line wrapped.)
Fix a build problem when IDEFLOPPY_DEBUG_BUGS is turned off, and eliminate
an access to memory that is no longer allocated (causing systems to fail
booting when CONFIG_DEBUG_PAGEALLOC is turned on).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
diff -Npru linux-2.6.12-rc4.base/drivers/ide/ide-floppy.c linux-2.6.12-rc4/drivers/ide/ide-floppy.c
--- linux-2.6.12-rc4.base/drivers/ide/ide-floppy.c 2005-05-11 17:27:57.385469928 +0200
+++ linux-2.6.12-rc4/drivers/ide/ide-floppy.c 2005-05-11 17:50:36.267888400 +0200
@@ -661,10 +661,12 @@ static void idefloppy_output_buffers (id
idefloppy_do_end_request(drive, 1, done >> 9);
+#if IDEFLOPPY_DEBUG_BUGS
if (bcount) {
printk(KERN_ERR "%s: leftover data in idefloppy_output_buffers, bcount == %d\n", drive->name, bcount);
idefloppy_write_zeros(drive, bcount);
}
+#endif
}
static void idefloppy_update_buffers (ide_drive_t *drive, idefloppy_pc_t *pc)
@@ -1048,6 +1050,9 @@ static ide_startstop_t idefloppy_issue_p
atapi_bcount_t bcount;
ide_handler_t *pkt_xfer_routine;
+#if 0 /* Accessing floppy->pc is not valid here, the previous pc may be gone
+ and have lived on another thread's stack; that stack may have become
+ unmapped meanwhile (CONFIG_DEBUG_PAGEALLOC). */
#if IDEFLOPPY_DEBUG_BUGS
if (floppy->pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD &&
pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD) {
@@ -1055,6 +1060,7 @@ static ide_startstop_t idefloppy_issue_p
"Two request sense in serial were issued\n");
}
#endif /* IDEFLOPPY_DEBUG_BUGS */
+#endif
if (floppy->failed_pc == NULL &&
pc->c[0] != IDEFLOPPY_REQUEST_SENSE_CMD)
[-- Attachment #2: linux-2.6.12-rc4-idefloppy.patch --]
[-- Type: text/plain, Size: 1724 bytes --]
(Note: Patch also attached because the inline version is certain to get
line wrapped.)
Fix a build problem when IDEFLOPPY_DEBUG_BUGS is turned off, and eliminate
an access to memory that is no longer allocated (causing systems to fail
booting when CONFIG_DEBUG_PAGEALLOC is turned on).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
diff -Npru linux-2.6.12-rc4.base/drivers/ide/ide-floppy.c linux-2.6.12-rc4/drivers/ide/ide-floppy.c
--- linux-2.6.12-rc4.base/drivers/ide/ide-floppy.c 2005-05-11 17:27:57.385469928 +0200
+++ linux-2.6.12-rc4/drivers/ide/ide-floppy.c 2005-05-11 17:50:36.267888400 +0200
@@ -661,10 +661,12 @@ static void idefloppy_output_buffers (id
idefloppy_do_end_request(drive, 1, done >> 9);
+#if IDEFLOPPY_DEBUG_BUGS
if (bcount) {
printk(KERN_ERR "%s: leftover data in idefloppy_output_buffers, bcount == %d\n", drive->name, bcount);
idefloppy_write_zeros(drive, bcount);
}
+#endif
}
static void idefloppy_update_buffers (ide_drive_t *drive, idefloppy_pc_t *pc)
@@ -1048,6 +1050,9 @@ static ide_startstop_t idefloppy_issue_p
atapi_bcount_t bcount;
ide_handler_t *pkt_xfer_routine;
+#if 0 /* Accessing floppy->pc is not valid here, the previous pc may be gone
+ and have lived on another thread's stack; that stack may have become
+ unmapped meanwhile (CONFIG_DEBUG_PAGEALLOC). */
#if IDEFLOPPY_DEBUG_BUGS
if (floppy->pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD &&
pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD) {
@@ -1055,6 +1060,7 @@ static ide_startstop_t idefloppy_issue_p
"Two request sense in serial were issued\n");
}
#endif /* IDEFLOPPY_DEBUG_BUGS */
+#endif
if (floppy->failed_pc == NULL &&
pc->c[0] != IDEFLOPPY_REQUEST_SENSE_CMD)
reply other threads:[~2005-05-12 8:34 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=s28322a5.093@emea1-mh.id2.novell.com \
--to=jbeulich@novell.com \
--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
all inboxes | Powered by JetHome®