public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Martin Dalecki <dalecki@evision-ventures.com>
Cc: linux-kernel@vger.kernel.org
Subject: [patch] Remove dead DISK_RECOVERY_TIME code.
Date: Wed, 22 May 2002 13:36:26 +0200	[thread overview]
Message-ID: <20020522133626.A32497@ucw.cz> (raw)
In-Reply-To: <20020522093013.GD312@pazke.ipt> <20020522114206.D31145@ucw.cz> <3CEB59E2.7020307@evision-ventures.com> <20020522131100.A32147@ucw.cz> <3CEB70F4.4030902@evision-ventures.com>

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

On Wed, May 22, 2002 at 12:20:36PM +0200, Martin Dalecki wrote:

> >>Any one of you who cares enough?
> > 
> > Here you go ...
> 
> Thank's looks fine applied.

And here is one more for you ...

-- 
Vojtech Pavlik
SuSE Labs

[-- Attachment #2: recovery_time.diff --]
[-- Type: text/plain, Size: 3203 bytes --]

ChangeSet@1.585, 2002-05-22 13:34:07+02:00, vojtech@twilight.ucw.cz
  This removes all stuff related to DISK_RECOVERY_TIME. It seems to have been a hack to make
  some really broken hardware work - but broken beyond repair as well. It was reading the PIT
  timer without proper locking (hence interfering with system time), it was reading it regardless
  of the architecture (will work on PCs and similar only), etc, etc. Goodbye DISK_RECOVERY_TIME.


 drivers/ide/ide.c   |   35 -----------------------------------
 include/linux/ide.h |    7 -------
 2 files changed, 42 deletions(-)


diff -Nru a/drivers/ide/ide.c b/drivers/ide/ide.c
--- a/drivers/ide/ide.c	Wed May 22 13:34:27 2002
+++ b/drivers/ide/ide.c	Wed May 22 13:34:27 2002
@@ -139,34 +139,6 @@
  */
 struct ata_channel ide_hwifs[MAX_HWIFS];	/* master data repository */
 
-#if (DISK_RECOVERY_TIME > 0)
-/*
- * For really screwed hardware (hey, at least it *can* be used with Linux)
- * we can enforce a minimum delay time between successive operations.
- */
-static unsigned long read_timer (void)
-{
-	unsigned long t, flags;
-	int i;
-
-	__save_flags(flags);	/* local CPU only */
-	__cli();		/* local CPU only */
-	t = jiffies * 11932;
-	outb_p(0, 0x43);
-	i = inb_p(0x40);
-	i |= inb(0x40) << 8;
-	__restore_flags(flags);	/* local CPU only */
-	return (t - i);
-}
-#endif
-
-static inline void set_recovery_timer(struct ata_channel *channel)
-{
-#if (DISK_RECOVERY_TIME > 0)
-	channel->last_time = read_timer();
-#endif
-}
-
 static void init_hwif_data(struct ata_channel *ch, unsigned int index)
 {
 	static const byte ide_major[] = {
@@ -986,11 +958,6 @@
 	 */
 	if (block == 0 && drive->remap_0_to_1 == 1)
 		block = 1;  /* redirect MBR access to EZ-Drive partn table */
-
-#if (DISK_RECOVERY_TIME > 0)
-	while ((read_timer() - ch->last_time) < DISK_RECOVERY_TIME);
-#endif
-
 	{
 		ide_startstop_t res;
 
@@ -1462,7 +1429,6 @@
 				} else
 					startstop = ide_error(drive, drive->rq, "irq timeout", GET_STAT());
 			}
-			set_recovery_timer(ch);
 			enable_irq(ch->irq);
 
 			spin_lock_irq(ch->lock);
@@ -1612,7 +1578,6 @@
 	 * same irq as is currently being serviced here, and Linux
 	 * won't allow another of the same (on any CPU) until we return.
 	 */
-	set_recovery_timer(drive->channel);
 	if (startstop == ide_stopped) {
 		if (!ch->handler) {	/* paranoia */
 			clear_bit(IDE_BUSY, &ch->active);
diff -Nru a/include/linux/ide.h b/include/linux/ide.h
--- a/include/linux/ide.h	Wed May 22 13:34:27 2002
+++ b/include/linux/ide.h	Wed May 22 13:34:27 2002
@@ -40,9 +40,6 @@
 
 /* Right now this is only needed by a promise controlled.
  */
-#ifndef DISK_RECOVERY_TIME		/* off=0; on=access_delay_time */
-# define DISK_RECOVERY_TIME	0	/*  for hardware that needs it */
-#endif
 #ifndef OK_TO_RESET_CONTROLLER		/* 1 needed for good error recovery */
 # define OK_TO_RESET_CONTROLLER	0	/* 0 for use with AH2372A/B interface */
 #endif
@@ -547,10 +544,6 @@
 	unsigned slow		: 1;	/* flag: slow data port */
 	unsigned io_32bit	: 1;	/* 0=16-bit, 1=32-bit */
 	unsigned char bus_state;	/* power state of the IDE bus */
-
-#if (DISK_RECOVERY_TIME > 0)
-	unsigned long last_time;	/* time when previous rq was done */
-#endif
 };
 
 /*

      parent reply	other threads:[~2002-05-22 11:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-22  9:30 [PATCH] duplicate clock calculation code in 3 IDE drivers Andrey Panin
2002-05-22  9:42 ` Vojtech Pavlik
2002-05-22  8:42   ` Martin Dalecki
2002-05-22 11:11     ` Vojtech Pavlik
     [not found]       ` <3CEB70F4.4030902@evision-ventures.com>
2002-05-22 11:36         ` Vojtech Pavlik [this message]

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=20020522133626.A32497@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=dalecki@evision-ventures.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