public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Evert van Grootheest <janevert@iae.nl>
To: andre@linux-ide.org, linux-kernel@vger.kernel.org,
	Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Subject: ht6560b patch for 2.4 (and 2.6?)
Date: Sun, 28 Dec 2003 15:29:21 +0100	[thread overview]
Message-ID: <3FEEE8C1.9080102@iae.nl> (raw)

Andre,

You're listed as the IDE maintainer for 2.4.
I'm one of the few people that own one of those Holtek 6560B VLB IDE 
interfaces.

Here's a patch against 2.4.23 that at least allows the kernel to boot 
when using the driver. Without this patch it simply hangs somewhere 
during early initialisation.

I won't be surprised if a comparable patch is required for 2.6, although 
I have not checked whether it applies. (I have no 2.6 sources yet)

This is my first kernel patch so if there is something not in order 
please let me know.

Thanks,
Jan Evert van Grootheest
janevert@iae.nl

--- 
../../pristine/kernel-source-2.4.23-fswan-lmsens/drivers/ide/legacy/ht6560b.c 
       2003-06-13 16:51:33.000000000 +0200
+++ drivers/ide/legacy/ht6560b.c        2003-12-28 15:03:01.000000000 +0100
@@ -23,6 +23,20 @@
   *                      "Prefetch" mode bit OFF for ide disks and
   *                      ON for anything else.
   *
+ *  version 8          (dropped useless 0. from version)
+ *                     Jan Evert van Grootheest   <janevert@iae.nl>
+ *                     - Removed Mikko as maintainer; he admits to no 
longer
+ *                       having the proper hardware. Also the URL no longer
+ *                       works.
+ *                     - Fix things for 2.4 kernels.
+ *                     - Rename probe_ht6560b to setup_ht6560b; there's np
+ *                       probing there because that's done in try_to_init.
+ *                       So that one's been renamed to probe_
+ *                     - Remove the use of check_region(); patch from 
William
+ *                       Stinson that he made as part of kernel 
janitors for
+ *                       2.6
+ *                     - this driver is not tested (by me) as module!
+ *
   *
   *  HT-6560B EIDE-controller support
   *  To activate controller support use kernel parameter "ide0=ht6560b".
@@ -30,11 +44,9 @@
   *
   *  Author:    Mikko Ala-Fossi            <maf@iki.fi>
   *             Jan Evert van Grootheest   <janevert@iae.nl>
- *
- *  Try:  http://www.maf.iki.fi/~maf/ht6560b/
   */

-#define HT6560B_VERSION "v0.07"
+#define HT6560B_VERSION "v8"

  #undef REALLY_SLOW_IO          /* most systems can safely undef this */

@@ -173,7 +185,7 @@
  /*
   * Autodetection and initialization of ht6560b
   */
-static int __init try_to_init_ht6560b(void)
+static int __init probe_ht6560b(void)
  {
         u8 orig_value;
         int i;
@@ -194,6 +206,7 @@
                 outb(orig_value, HT_CONFIG_PORT);
                 return 0;
         }
+
         /*
          * Ht6560b autodetected
          */
@@ -312,11 +325,10 @@
  #endif
  }

-void __init probe_ht6560b (void)
+void __init setup_ht6560b (void)
  {
         int t;

-       request_region(HT_CONFIG_PORT, 1, ide_hwifs[0].name);
         ide_hwifs[0].chipset = ide_ht6560b;
         ide_hwifs[1].chipset = ide_ht6560b;
         ide_hwifs[0].selectproc = &ht6560b_selectproc;
@@ -371,6 +383,36 @@
         release_region(HT_CONFIG_PORT, 1);
  }

+
+#ifndef MODULE
+void __init ide_probe_for_ht6560b(void)
+#else
+int ide_probe_for_ht6560b(void)
+#endif
+{
+       if (!request_region(HT_CONFIG_PORT, 1, ide_hwifs[0].name)) {
+               printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", 
__FUNCTION__);
+       }
+       else if (!probe_ht6560b()) {
+               release_region(HT_CONFIG_PORT, 1);
+                printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__);
+       }
+       else {
+               printk("\ndebug %d", __LINE__);
+               setup_ht6560b();
+               printk("\ndebug %d", __LINE__);
+#ifdef MODULE
+               return 1;
+#endif
+       }
+
+#ifdef MODULE
+       return 0;
+#endif
+}
+
+
+
  #ifndef MODULE
  /*
   * init_ht6560b:
@@ -380,16 +422,7 @@

  void __init init_ht6560b (void)
  {
-       if (check_region(HT_CONFIG_PORT,1)) {
-               printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n",
-                       __FUNCTION__);
-               return;
-       }
-       if (!try_to_init_ht6560b()) {
-                printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__);
-               return;
-       }
-       probe_ht6560b();
+       ide_register_driver(ide_probe_for_ht6560b);
  }

  #else
@@ -400,23 +433,15 @@

  int __init ht6560b_mod_init(void)
  {
-       if (check_region(HT_CONFIG_PORT,1)) {
-               printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n",
-                       __FUNCTION__);
+       if (!ide_probe_for_ht6560b())
                 return -ENODEV;
-       }
-
-       if (!try_to_init_ht6560b()) {
-               printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__);
-               return -ENODEV;
-       }
-
-       probe_ht6560b();
+
          if (ide_hwifs[0].chipset != ide_ht6560b &&
              ide_hwifs[1].chipset != ide_ht6560b) {
                  ht6560b_release();
                  return -ENODEV;
-        }
+       }
+
          return 0;
  }
  module_init(ht6560b_mod_init);


             reply	other threads:[~2003-12-28 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-28 14:29 Jan Evert van Grootheest [this message]
2004-01-09  0:12 ` [PATCH] Re: ht6560b patch for 2.4 (and 2.6?) Bartlomiej Zolnierkiewicz
2004-01-10 14:39   ` Jan Evert van Grootheest

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=3FEEE8C1.9080102@iae.nl \
    --to=janevert@iae.nl \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=andre@linux-ide.org \
    --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