From: Jan Evert van Grootheest <j.e.van.grootheest@caiway.nl>
To: linux-ide@vger.kernel.org, bzolnier@gmail.com
Subject: [PATCH ht6560b] Force prefetch for some devices
Date: Mon, 18 Feb 2008 13:50:02 +0100 [thread overview]
Message-ID: <47B97EFA.2040805@caiway.nl> (raw)
[-- Attachment #1: Type: text/plain, Size: 535 bytes --]
Prefetch needs to be set for some ide devices to work when connected to
a ht6560b interface. This was not always done properly, causing a system
with a HD and CD on the primary interface to not work properly. Or, in
effect, hang hard.
This patch forces prefetch on devices before checking whether it
is necessary to change the settings in the interface
This patch should also be applied to 2.4. I don't currently have a
2.4 tree around.
(also change my email address)
Signed-off-by: Jan Evert van Grootheest <janevert@caiway.nl>
[-- Attachment #2: ht65.oldide.patch --]
[-- Type: text/x-patch, Size: 1968 bytes --]
--- linux-2.6.git/drivers/ide/legacy/ht6560b.c 2008-02-01 18:50:31.000000000 +0100
+++ linux-2.6.24/drivers/ide/legacy/ht6560b.c 2008-02-18 13:48:59.000000000 +0100
@@ -23,18 +23,21 @@
* "Prefetch" mode bit OFF for ide disks and
* ON for anything else.
*
+ * Version 0.08 Need to force prefetch for CDs and other non-disk
+ * devices. (not sure which devices exactly need
+ * prefetch)
*
* HT-6560B EIDE-controller support
* To activate controller support use kernel parameter "ide0=ht6560b".
* Use hdparm utility to enable PIO mode support.
*
* Author: Mikko Ala-Fossi <maf@iki.fi>
- * Jan Evert van Grootheest <janevert@iae.nl>
+ * Jan Evert van Grootheest <janevert@caiway.nl>
*
* Try: http://www.maf.iki.fi/~maf/ht6560b/
*/
-#define HT6560B_VERSION "v0.07"
+#define HT6560B_VERSION "v0.08"
#include <linux/module.h>
#include <linux/types.h>
@@ -132,15 +135,20 @@
u8 select, timing;
local_irq_save(flags);
-
+
select = HT_CONFIG(drive);
timing = HT_TIMING(drive);
-
+
+ /*
+ * Need to enforce prefetch sometimes because otherwise
+ * it'll hang (hard).
+ */
+ if (drive->media != ide_disk || !drive->present)
+ select |= HT_PREFETCH_MODE;
+
if (select != current_select || timing != current_timing) {
current_select = select;
current_timing = timing;
- if (drive->media != ide_disk || !drive->present)
- select |= HT_PREFETCH_MODE;
(void)inb(HT_CONFIG_PORT);
(void)inb(HT_CONFIG_PORT);
(void)inb(HT_CONFIG_PORT);
@@ -190,11 +198,12 @@
outb(HT_TIMING_DEFAULT, 0x1f6); /* IDE_SELECT_REG */
(void) inb(0x1f7); /* IDE_STATUS_REG */
- printk("\nht6560b " HT6560B_VERSION
+ printk("ht6560b " HT6560B_VERSION
": chipset detected and initialized"
#ifdef DEBUG
" with debug enabled"
#endif
+ "\n"
);
return 1;
}
next reply other threads:[~2008-02-18 13:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-18 12:50 Jan Evert van Grootheest [this message]
2008-02-18 13:58 ` [PATCH ht6560b] Force prefetch for some devices Sergei Shtylyov
2008-02-18 14:36 ` Alan Cox
2008-02-18 15:21 ` Jan Evert van Grootheest
2008-02-18 15:47 ` Alan Cox
2008-06-27 19:51 ` Jan Evert van Grootheest
2008-06-27 20:04 ` Alan Cox
2008-02-18 23:14 ` Bartlomiej Zolnierkiewicz
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=47B97EFA.2040805@caiway.nl \
--to=j.e.van.grootheest@caiway.nl \
--cc=bzolnier@gmail.com \
--cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).