linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Ira Weiny <iweiny@acm.org>
To: linuxppc-dev <linuxppc-dev@lists.linuxppc.org>,
	andre@linux-ide.org, andre@suse.com
Subject: IDE 1Gig Microdrive (Working!!)
Date: Tue, 18 Sep 2001 22:28:48 -0700	[thread overview]
Message-ID: <3BA82D10.5694BC63@acm.org> (raw)

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

I have Ben H's 2.4.9 kernel and I have hacked up something which allows
the 1Gig Microdrive PCCard to work.

What I am wondering is, does my patch stand a chance of making it into
the tree?

>From what I can tell there is already some code to disable the IRQ on
the Card but I guess the 1Gig drive does not honor this.  So I am
disabling the IRQ at the processor.  It is my understanding that the IDE
maintainer will not accept this.  Of course I would put this flag into
the hwif or drive structure and not use a global like this but if I am
going to have to apply this patch for every kernel upgrade I will leave
it this way.

These are against Ben's latest rsync.  Any thoughts, would be
appreciated.

And Thanks so much for all your help again,
Ira Weiny
iweiny@acm.org

[-- Attachment #2: ide-cs.patch --]
[-- Type: text/plain, Size: 1016 bytes --]

*** ./ide-cs.c	Sun Sep  9 17:35:01 2001
--- /usr/src/linux/drivers/ide/ide-cs.c	Sun Sep 16 08:15:36 2001
*************** int idecs_register (int arg1, int arg2,
*** 233,238 ****
--- 233,245 ----
          return ide_register_hw(&hw, NULL);
  }

+
+ extern int ide_disable_irq_on_probe;
+
  void ide_config(dev_link_t *link)
  {
      client_handle_t handle = link->handle;
*************** void ide_config(dev_link_t *link)
*** 334,339 ****
--- 341,351 ----
      if (link->io.NumPorts2)
  	release_region(link->io.BasePort2, link->io.NumPorts2);

+     ide_disable_irq_on_probe = 1;
+
      outb(0x02, ctl_base); // Set nIEN = disable device interrupts

      /* retry registration in case device is still spinning up */
*************** void ide_config(dev_link_t *link)
*** 352,357 ****
--- 364,375 ----
  	schedule_timeout(HZ/10);
      }

+     ide_disable_irq_on_probe = 0;
+
      if (hd < 0) {
  	printk(KERN_NOTICE "ide_cs: ide_register() at 0x%03x & 0x%03x"
  	       ", irq %u failed\n", io_base, ctl_base,

[-- Attachment #3: ide-probe.patch --]
[-- Type: text/plain, Size: 2183 bytes --]

*** ./ide-probe.c	Sun Sep  9 17:35:01 2001
--- /usr/src/linux/drivers/ide/ide-probe.c	Tue Sep 18 20:48:25 2001
*************** static inline void do_identify (ide_driv
*** 176,181 ****
--- 176,183 ----
  	return;
  }

+ int ide_disable_irq_on_probe = 0;
+
  /*
   * try_to_identify() sends an ATA(PI) IDENTIFY request to a drive
   * and waits for a response.  It also monitors irqs while this is
*************** static int actual_try_to_identify (ide_d
*** 213,223 ****
--- 215,234 ----
  	if ((cmd == WIN_PIDENTIFY))
  		OUT_BYTE(0,IDE_FEATURE_REG);	/* disable dma & overlap */

+         if (ide_disable_irq_on_probe == 1)
+         {
+            disable_irq(HWIF(drive)->irq);
+         }
+
  #if CONFIG_BLK_DEV_PDC4030
  	if (HWIF(drive)->chipset == ide_pdc4030) {
  		/* DC4030 hosted drives need their own identify... */
  		extern int pdc4030_identify(ide_drive_t *);
  		if (pdc4030_identify(drive)) {
+                         if (ide_disable_irq_on_probe == 1)
+                         {
+                                 enable_irq(HWIF(drive)->irq);
+                         }
  			return 1;
  		}
  	} else
*************** static int actual_try_to_identify (ide_d
*** 227,238 ****
--- 238,254 ----
  	timeout += jiffies;
  	do {
  		if (0 < (signed long)(jiffies - timeout)) {
+                         if (ide_disable_irq_on_probe == 1)
+                         {
+                                 enable_irq(HWIF(drive)->irq);
+                         }
  			return 1;	/* drive timed-out */
  		}
  		ide_delay_50ms();		/* give drive a breather */
  	} while (IN_BYTE(hd_status) & BUSY_STAT);

  	ide_delay_50ms();		/* wait for IRQ and DRQ_STAT */
+
  	if (OK_STAT(GET_STAT(),DRQ_STAT,BAD_R_STAT)) {
  		unsigned long flags;
  		__save_flags(flags);	/* local CPU only */
*************** static int actual_try_to_identify (ide_d
*** 242,248 ****
--- 258,272 ----
  		(void) GET_STAT();	/* clear drive IRQ */
  		__restore_flags(flags);	/* local CPU only */
  	} else
+         {
  		rc = 2;			/* drive refused ID */
+         }
+
+         if (ide_disable_irq_on_probe == 1)
+         {
+            enable_irq(HWIF(drive)->irq);
+         }
+
  	return rc;
  }


             reply	other threads:[~2001-09-19  5:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-19  5:28 Ira Weiny [this message]
2001-09-19 13:38 ` IDE 1Gig Microdrive (Working!!) Benjamin Herrenschmidt
2001-09-19 18:45   ` Ira Weiny

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=3BA82D10.5694BC63@acm.org \
    --to=iweiny@acm.org \
    --cc=andre@linux-ide.org \
    --cc=andre@suse.com \
    --cc=linuxppc-dev@lists.linuxppc.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).