Thu Nov 20 02:56:40 2008 UTC ()
Apply patch (requested by jnemeth in ticket #80):
Work around rbus resource allocation problem so aic PCMCIA cards work.


(snj)
diff -r1.110 -r1.110.2.1 src/doc/HACKS
diff -r1.37 -r1.37.14.1 src/sys/dev/pcmcia/aic_pcmcia.c

cvs diff -r1.110 -r1.110.2.1 src/doc/HACKS (expand / switch to unified diff)

--- src/doc/HACKS 2008/09/27 03:57:37 1.110
+++ src/doc/HACKS 2008/11/20 02:56:40 1.110.2.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: HACKS,v 1.110 2008/09/27 03:57:37 macallan Exp $ 1# $NetBSD: HACKS,v 1.110.2.1 2008/11/20 02:56:40 snj Exp $
2# 2#
3# This file is intended to document workarounds for currently unsolved 3# This file is intended to document workarounds for currently unsolved
4# (mostly) compiler bugs. 4# (mostly) compiler bugs.
5# 5#
6# Format: 6# Format:
7# hack title 7# hack title
8# cdate creation date 8# cdate creation date
9# mdate mod date 9# mdate mod date
10# who responsible developer 10# who responsible developer
11# port ... 11# port ...
12# affected ports, space separated, if not "all" 12# affected ports, space separated, if not "all"
13# file affected file : revision : line from : line to 13# file affected file : revision : line from : line to
14# affected files and revision and line numbers describing hack 14# affected files and revision and line numbers describing hack
@@ -298,26 +298,38 @@ mdate 03 August 2008 @@ -298,26 +298,38 @@ mdate 03 August 2008
298who veego 298who veego
299file src/crypto/dist/heimdal/lib/asn1/gen.c : 1.10 299file src/crypto/dist/heimdal/lib/asn1/gen.c : 1.10
300file src/lib/libasn1/Makefile : 1.32 300file src/lib/libasn1/Makefile : 1.32
301file src/lib/libhdb/Makefile : 1.23 301file src/lib/libhdb/Makefile : 1.23
302file src/lib/libgssapi/Makefile : 1.20 302file src/lib/libgssapi/Makefile : 1.20
303file src/lib/libhx509/Makefile : 1.3 303file src/lib/libhx509/Makefile : 1.3
304pr 9702 39185 304pr 9702 39185
305descr 305descr
306 asn1_compile does not check if generated header files do not have to 306 asn1_compile does not check if generated header files do not have to
307 be rebuild. 307 be rebuild.
308 Generate .hx files and copy it in the Makefiles if they changed. 308 Generate .hx files and copy it in the Makefiles if they changed.
309kcah 309kcah
310 310
 311hack rbus resource allocation work around
 312cdate 10 May 2007
 313who jnemeth
 314file src/sys/dev/pcmcia/aic_pcmcia.c : 1.35
 315pr 26909 31245
 316descr
 317 On some cards, the card align field property value interferes
 318 with the rbus resource allocation causing the card not to
 319 configure properly. Setting it to 0 fixes the problem but it
 320 is not the proper solution.
 321kcah
 322
311port vax 323port vax
312 324
313 hack gcc4/vax ICE 325 hack gcc4/vax ICE
314 cdate  326 cdate
315 who tsutsui 327 who tsutsui
316 file sys/arch/vax/conf/Makefile.vax 328 file sys/arch/vax/conf/Makefile.vax
317 descr 329 descr
318 GCC4 on vax gets ICE on compiling sys/ddb/db_command.c. 330 GCC4 on vax gets ICE on compiling sys/ddb/db_command.c.
319 -fno-tree-ter prevents it so add it to COPTS. 331 -fno-tree-ter prevents it so add it to COPTS.
320 kcah 332 kcah
321 333
322 hack gcc4/vax compiler crash 334 hack gcc4/vax compiler crash
323 cdate Fri Jun 30 22:39:12 PDT 2006 335 cdate Fri Jun 30 22:39:12 PDT 2006

cvs diff -r1.37 -r1.37.14.1 src/sys/dev/pcmcia/aic_pcmcia.c (expand / switch to unified diff)

--- src/sys/dev/pcmcia/aic_pcmcia.c 2008/04/05 21:31:23 1.37
+++ src/sys/dev/pcmcia/aic_pcmcia.c 2008/11/20 02:56:40 1.37.14.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: aic_pcmcia.c,v 1.37 2008/04/05 21:31:23 cegger Exp $ */ 1/* $NetBSD: aic_pcmcia.c,v 1.37.14.1 2008/11/20 02:56:40 snj Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997 Marc Horowitz. All rights reserved. 4 * Copyright (c) 1997 Marc Horowitz. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.37 2008/04/05 21:31:23 cegger Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: aic_pcmcia.c,v 1.37.14.1 2008/11/20 02:56:40 snj Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/select.h> 37#include <sys/select.h>
38#include <sys/device.h> 38#include <sys/device.h>
39 39
40#include <sys/cpu.h> 40#include <sys/cpu.h>
41#include <sys/bus.h> 41#include <sys/bus.h>
42#include <sys/intr.h> 42#include <sys/intr.h>
43 43
44#include <dev/scsipi/scsipi_all.h> 44#include <dev/scsipi/scsipi_all.h>
45#include <dev/scsipi/scsipiconf.h> 45#include <dev/scsipi/scsipiconf.h>
46#include <dev/scsipi/scsi_all.h> 46#include <dev/scsipi/scsi_all.h>
@@ -94,26 +94,29 @@ aic_pcmcia_match(struct device *parent,  @@ -94,26 +94,29 @@ aic_pcmcia_match(struct device *parent,
94 sizeof(aic_pcmcia_products[0]), NULL)) 94 sizeof(aic_pcmcia_products[0]), NULL))
95 return (1); 95 return (1);
96 return (0); 96 return (0);
97} 97}
98 98
99int 99int
100aic_pcmcia_validate_config(cfe) 100aic_pcmcia_validate_config(cfe)
101 struct pcmcia_config_entry *cfe; 101 struct pcmcia_config_entry *cfe;
102{ 102{
103 if (cfe->iftype != PCMCIA_IFTYPE_IO || 103 if (cfe->iftype != PCMCIA_IFTYPE_IO ||
104 cfe->num_memspace != 0 || 104 cfe->num_memspace != 0 ||
105 cfe->num_iospace != 1) 105 cfe->num_iospace != 1)
106 return (EINVAL); 106 return (EINVAL);
 107/* XXX Below line is a hack to get around an rbus resource allocation */
 108/* XXX problem. It should be removed when the problem is fixed. */
 109 cfe->iomask = 0;
107 return (0); 110 return (0);
108} 111}
109 112
110void 113void
111aic_pcmcia_attach(struct device *parent, struct device *self, 114aic_pcmcia_attach(struct device *parent, struct device *self,
112 void *aux) 115 void *aux)
113{ 116{
114 struct aic_pcmcia_softc *psc = (void *)self; 117 struct aic_pcmcia_softc *psc = (void *)self;
115 struct aic_softc *sc = &psc->sc_aic; 118 struct aic_softc *sc = &psc->sc_aic;
116 struct pcmcia_attach_args *pa = aux; 119 struct pcmcia_attach_args *pa = aux;
117 struct pcmcia_config_entry *cfe; 120 struct pcmcia_config_entry *cfe;
118 struct pcmcia_function *pf = pa->pf; 121 struct pcmcia_function *pf = pa->pf;
119 int error; 122 int error;