From: Andy Jeffries <lkml@andyjeffries.co.uk>
To: linux-kernel@vger.kernel.org
Cc: alec@bugs.shadowstar.net
Subject: Re: HPT372 on KR7A-RAID
Date: Thu, 21 Feb 2002 09:46:46 +0000 [thread overview]
Message-ID: <20020221094646.1c499b6e.lkml@andyjeffries.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.44.0202210427050.27301-100000@bugs.home.shadowstar.net>
In-Reply-To: <20020221091319.37e74cba.lkml@andyjeffries.co.uk> <Pine.LNX.4.44.0202210427050.27301-100000@bugs.home.shadowstar.net>
On Thu, 21 Feb 2002 04:28:31 -0500 (EST), Alec Smith <alec@bugs.shadowstar.net> wrote:
> Did you check Andre Hedrick's IDE patches at http://www.linuxdiskcert.org?
> For unexplained reasons, the power penguins refuse to take Andre's work
> into the standard kernel even though he's the official IDE/ATA maintainer.
> Andre may have already solved your problem.
In Andre's 2.4.16 patch (from that website), the chipset_names array still
doesn't contain the HPT372 chipset and I'm guessing it will still panic
the kernel because at lines 1433-1437 of the patch it says:
+ pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
+ class_rev &= 0xff;
+
+ p += sprintf(p, "\nController: %d\n", i);
+ p += sprintf(p, "Chipset: HPT%s\n", chipset_nums[class_rev]);
Now, if the class_rev is one higher than the number of items in the array
(which it is because chipset_names is now called chipset_nums but it just
contains slightly different strings, i.e. not starting with HPT) it will
still reference an item in the array beyond bounds. A hacky patch my boss
found on the internet (he's the one with the motherboard) did the
following:
+ if(class_rev >= (sizeof(chipset_names)/sizeof(char *))) {
+ class_rev = (sizeof(chipset_names)/sizeof(char *)) - 1;
+ }
I think this is awful, but as I said, I'm not a good enough Kernel
programmer to die gracefully or depending on a passed in parameter fake it
to be the end of the chipset array (which the dirty hack above doesn't
solve, if there are two further revisions it will break again).
Kind regards,
--
Andy Jeffries
Linux/PHP Programmer
- Windows Crash HOWTO: compile the code below in VC++ and run it!
main (){for(;;){printf("Hung up\t\b\b\b\b\b\b");}}
next prev parent reply other threads:[~2002-02-21 9:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.44.0202210427050.27301-100000@bugs.home.shadowstar.net>
2002-02-21 9:13 ` Andy Jeffries
2002-02-21 9:46 ` Andy Jeffries [this message]
2002-02-21 13:16 ` Andy Jeffries
2002-02-21 13:22 ` Alan Cox
2002-03-04 15:40 ` Andy Jeffries
2002-03-04 16:51 ` Alan Cox
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=20020221094646.1c499b6e.lkml@andyjeffries.co.uk \
--to=lkml@andyjeffries.co.uk \
--cc=alec@bugs.shadowstar.net \
--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
all inboxes | Powered by JetHome®