lkml.org 
[lkml]   [2000]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: ISA PnP (again) + [PATCH]
Bruce J.A. Nourish wrote:
> ISA PnP seems to be working as a module in 2.3.39, in so far as is loads
> ok:
>
> Jan 14 16:17:28 marvin kernel: isapnp: Scanning for Pnp cards...
> Jan 14 16:17:28 marvin kernel: isapnp: Card 'OPL3-SA3 Sound'
> Jan 14 16:17:28 marvin kernel: isapnp: 1 Plug & Play card detected total
>
> But when i try to configure my card for use, using /proc/isapnp, cat
> segfaults and I get an oops. This is the related part of my rc.modules:
>
> # Sound conf
> cat >> /proc/isapnp <<EOF
> card 0 YMH0800
> dev 0 YMH0021
[snip]
> EOF
>
> This is the oops, passed thru ksymoops:
> Oops: 0000
> CPU: 0
> EIP: 0010:[<c480ca7a>]
> EFLAGS: 00010246
> eax: 00000000 ebx: a8652100 ecx: c1173008 edx: c114bea0
[snip]
> >>EIP; c480ca7a <[isa-pnp]isapnp_find_dev+6e/cc> <=====
> Trace; c480f6c5 <[isa-pnp]isapnp_set_device+51/cc>
> Trace; c481093c <[isa-pnp]isapnp_info_write+a6c/217c>
[snip]
> Code; c480ca7a <[isa-pnp]isapnp_find_dev+6e/cc> <=====
> 0: 39 50 10 cmpl %edx,0x10(%eax) <=====
> Code; c480ca7d <[isa-pnp]isapnp_find_dev+71/cc>
> 3: 74 19 je 1e <_EIP+0x1e> c480ca98 <[isa-pnp]isapnp_find_dev+8c/cc>

This bug was introduced in 2.3.37, when the ISAPnP driver moved to
list_head structures. The included patch should fix it. isapnp_find_dev()
is called from isapnp_set_device() with from == NULL.

The second chunk of the patch is subject to a disagreement
between me and Martin Mares. I think it should be in for completeness, and
so that uninitialised data structures aren't left lying around. Martin
thinks it shouldn't be in since dev->children has no meaning for ISAPnP
cards. You pays your money and takes your choice. Leave it in or out as
you see fit, it won't bite anyone (yet ;-)).

--
Peter Denison <peterd@pnd-pc.demon.co.uk>
Linux Driver for Promise DC4030VL cards.
See http://www.pnd-pc.demon.co.uk/promise/promise.html for details
--- drivers/pnp/isapnp.c.old Tue Jan 11 22:40:25 2000
+++ drivers/pnp/isapnp.c Fri Jan 14 22:57:32 2000
@@ -18,7 +18,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Changelog:
- * 2000-01-01 Added ISAPnP quirks handling
+ * 2000-01-01 Added quirks handling for buggy hardware
* Peter Denison <peterd@pnd-pc.demon.co.uk>
*/

@@ -984,6 +984,7 @@
card->device = (header[3] << 8) | header[2];
card->serial = (header[7] << 24) | (header[6] << 16) | (header[5] << 8) | header[4];
isapnp_checksum_value = 0x00;
+ INIT_LIST_HEAD(&card->children);
INIT_LIST_HEAD(&card->devices);
isapnp_parse_resource_map(card);
if (isapnp_checksum_value != 0x00)
@@ -1185,10 +1186,11 @@
struct list_head *list;

list = card->devices.next;
- if (from)
+ if (from) {
list = from->bus_list.next;
- if (from->bus != card) /* something is wrong */
- return NULL;
+ if (from->bus != card) /* something is wrong */
+ return NULL;
+ }
while (list != &card->devices) {
int idx;
struct pci_dev *dev = pci_dev_b(list);
\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.054 / U:2.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site