NetBSD Problem Report #9463

Received: (qmail 4320 invoked from network); 22 Feb 2000 01:55:50 -0000
Message-Id: <200002220108.KAA00774@duplo.sm.sony.co.jp>
Date: Tue, 22 Feb 2000 10:08:44 +0900 (JST)
From: Atsushi Onoe <onoe@sm.sony.co.jp>
Reply-To: onoe@sm.sony.co.jp
To: gnats-bugs@gnats.netbsd.org
Subject: no interrupt on card detect after resume
X-Send-Pr-Version: 3.95

>Number:         9463
>Category:       kern
>Synopsis:       no interrupt on card detect after resume
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 21 17:57:00 +0000 2000
>Closed-Date:    Tue Feb 22 03:12:03 +0000 2000
>Last-Modified:  Tue Feb 22 03:12:54 +0000 2000
>Originator:     Atsushi Onoe
>Release:        NetBSD-current source as of Feb 20, 2000
>Organization:

>Environment:

System: NetBSD duplo.sm.sony.co.jp 1.4T NetBSD 1.4T (DUPLO) #79: Tue Feb 22 08:53:27 JST 2000 onoe@duplo.sm.sony.co.jp:/usr/obj/DUPLO i386


>Description:
	With cardbus configuration, VAIO PCG-N505AS does not interrupt on
	card detect after resume.  It seems that APM BIOS does not preserve
	all states of RL5C475 correctly.
	In this state, the interrupts from the card are still delivered
	after reinitializing, e.g.  by "ifconfig down; ifconfig up"
>How-To-Repeat:
	insert/remove the card from slot after resume.
	with cardbus configuration on PCG-N505, PCG-C2 (ACPI VAIO notebooks)
>Fix:
	copy workaround from dev/ic/i82365.c

Index: pccbb.c
===================================================================
RCS file: /usr/cvsroot/netbsd/syssrc/sys/dev/pci/pccbb.c,v
retrieving revision 1.23
diff -c -r1.23 pccbb.c
*** pccbb.c	2000/02/06 08:14:13	1.23
--- pccbb.c	2000/02/22 00:13:22
***************
*** 167,172 ****
--- 167,173 ----
  static void pccbb_pcmcia_do_io_map __P((struct pcic_handle *, int));
  static void pccbb_pcmcia_wait_ready __P((struct pcic_handle *));
  static void pccbb_pcmcia_do_mem_map __P((struct pcic_handle *, int));
+ static void pccbb_powerhook __P((int, void *));

  /* bus-space allocation and disallocation functions */
  #if rbus
***************
*** 587,592 ****
--- 588,594 ----
  	}

  	printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);
+ 	powerhook_establish(pccbb_powerhook, sc);

  	{
  		u_int32_t sockstat =
***************
*** 3103,3105 ****
--- 3105,3139 ----
  }

  #endif /* rbus */
+ 
+ static void
+ pccbb_powerhook (why, arg)
+ 	int why;
+ 	void *arg;
+ {
+ 	struct pccbb_softc *sc = arg;
+ 	u_int32_t reg;
+ 	bus_space_tag_t base_memt = sc->sc_base_memt;	/* socket regs memory */
+ 	bus_space_handle_t base_memh = sc->sc_base_memh;
+ 
+ 	DPRINTF(("%s: power: why %d\n", sc->sc_dev.dv_xname, why));
+ 
+ 	if (why == PWR_RESUME) {
+ 		/* CSC Interrupt: Card detect interrupt on */
+ 		reg = bus_space_read_4(base_memt, base_memh, CB_SOCKET_MASK);
+ 		/* Card detect intr is turned on. */
+ 		reg |= CB_SOCKET_MASK_CD;
+ 		bus_space_write_4(base_memt, base_memh, CB_SOCKET_MASK, reg);
+ 		/* reset interrupt */
+ 		reg = bus_space_read_4(base_memt, base_memh, CB_SOCKET_EVENT);
+ 		bus_space_write_4(base_memt, base_memh, CB_SOCKET_EVENT, reg);
+ 
+ 		/*
+ 		 * check for card insertion or removal during suspend period.
+ 		 * XXX: the code can't cope with card swap (remove then insert).
+ 		 * how can we detect such situation?
+ 		 */
+ 		if (why == PWR_RESUME)
+ 			(void)pccbbintr(sc);
+ 	}
+ }
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: enami 
State-Changed-When: Mon Feb 21 19:12:03 PST 2000 
State-Changed-Why:  
Proposed diff is applied (with very small cosmetic change). 
Thanks. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.