public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bruce Robson <bns_robson@hotmail.com>
To: linux-scsi@vger.kernel.org
Subject: PNP AHA-1542CP not working after upgrading kernel from 2.2.25 to 2.4.20
Date: Sun, 29 Feb 2004 12:00:06 +0000	[thread overview]
Message-ID: <4041D446.4060300@hotmail.com> (raw)

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

I've recently upgraded my kernel from 2.2.25 to 2.4.20.
After the upgrade, I was unable to use my ZIP 100 PLUS drive that
is attached to an Adaptec AHA-1542CP SCSI card.

The card is set to use PNP, the BIOS is set for non-PNP operating
systems and allocates resources to the card.

I did not have any PNP features in the old 2.2.25 kernel but built
the new 2.4.20 with the isapnp driver. In the new kernel
a)  the isapnp driver found the card
b)  the aha1542 driver logged the message
      "ISAPnP found an AHA1535 at I/O 0x330"
c)  the aha1542 driver did not log a message to say that it was
      "Configuring Adaptec".

I added printk statements to the aha1542 driver to find out why it
was not configuring the card and this made it do so. I did a few
experiments was different printk statements and concluded that the
AHA-1542CP needs a delay between when it is "PNP activated" and
when it is next accessed. I've now added a mdelay(100) statement
after activating the card and am able to use my ZIP drive.

I attach a diff -u of the changes I've made. As well as adding
the mdelay, I have left in one printk statement that I think
is useful.

After making my fix, I looked at the aha1542 driver for 2.6.1.
This has a number of changes to the PNP part of the driver. These
mainly appear to be due to changes to the interface to PNP in 2.6.1.
However it has a call to pnp_port_valid after doing the activation.
I presume this causes the driver to wait after activating the card.
i.e. It is a better way of achieving what I've achieved with the
mdelay statement.

Is it possible to either add my fix to 2.4 or for someone competent
in kernel hacking to implement a fix similar to that done in the
2.6 driver?


Bruce


[-- Attachment #2: diff-u.txt --]
[-- Type: text/plain, Size: 1212 bytes --]

--- aha1542.c.orig	Fri Oct 12 23:35:53 2001
+++ aha1542.c	Sat Feb 28 21:30:27 2004
@@ -23,6 +23,9 @@
  *        19-Jul-99
  *  Modified by Adam Fritzler <mid@auk.cx>
  *        Added proper detection of the AHA-1640 (MCA version of AHA-1540)
+ *  Modified by Bruce Robson <bns_robson@hotmail.com>
+ *        Added a delay after activating a PNP card (needed by AHA-1542CP)
+ *        28-Feb-04
  */
 
 #include <linux/config.h>
@@ -1174,6 +1177,10 @@
 			   the DMA set up that is enough */
 			   
 			printk(KERN_INFO "ISAPnP found an AHA1535 at I/O 0x%03X\n", bases[indx]);
+
+			/* aha1542_test_port fails for AHA-1542CP if we don't wait for the card */
+			/* n.b. In 2.6.1 the driver calls pnp_port_valid */
+			mdelay(100);	/* I've made no attempt to minimise this */
 		}
 	}
 	for (indx = 0; indx < sizeof(bases) / sizeof(bases[0]); indx++)
@@ -1189,8 +1196,10 @@
 				printk(KERN_ERR "Invalid address for shpnt with 1542.\n");
 				goto unregister;
 			}
-			if (!aha1542_test_port(bases[indx], shpnt))
+			if (!aha1542_test_port(bases[indx], shpnt)) {
+				printk(KERN_INFO "aha1542 probed 0x%03X, card not at this address\n", bases[indx]);
 				goto unregister;
+			}
 
 
 			base_io = bases[indx];


                 reply	other threads:[~2004-02-29 12:01 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=4041D446.4060300@hotmail.com \
    --to=bns_robson@hotmail.com \
    --cc=linux-scsi@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