From linux at brodo.de  Sat Jul  5 11:44:24 2003
From: linux at brodo.de (Dominik Brodowski)
Date: Sat Jul  5 09:57:13 2003
Subject: [PATCH] pcmcia: don't hide calls to socket drivers
Message-ID: <20030705084424.GC1465@brodo.de>

Don't hide calls to the socket driver by "shorthand functions"

 drivers/pcmcia/cs.c |   89 ++++++++++++++++------------------------------------
 1 files changed, 28 insertions(+), 61 deletions(-)

diff -ruN linux-original/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- linux-original/drivers/pcmcia/cs.c	2003-07-05 10:35:43.000000000 +0200
+++ linux/drivers/pcmcia/cs.c	2003-07-05 10:42:51.000000000 +0200
@@ -225,43 +225,6 @@
 };
 #define SERVICE_COUNT (sizeof(service_table)/sizeof(lookup_t))
 
-/*======================================================================
-
- These functions are just shorthand for the actual low-level drivers
-
-======================================================================*/
-
-static int get_socket_status(struct pcmcia_socket *s, int *val)
-{
-	return s->ss_entry->get_status(s, val);
-}
-
-static int set_socket(struct pcmcia_socket *s, socket_state_t *state)
-{
-	return s->ss_entry->set_socket(s, state);
-}
-
-static int set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
-{
-	return s->ss_entry->set_io_map(s, io);
-}
-
-static int set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
-{
-	return s->ss_entry->set_mem_map(s, mem);
-}
-
-static int suspend_socket(struct pcmcia_socket *s)
-{
-	s->socket = dead_socket;
-	return s->ss_entry->suspend(s);
-}
-
-static int init_socket(struct pcmcia_socket *s)
-{
-	s->socket = dead_socket;
-	return s->ss_entry->init(s);
-}
 
 /*====================================================================
 
@@ -339,7 +302,8 @@
 	INIT_LIST_HEAD(&socket->cis_cache);
 	spin_lock_init(&socket->lock);
 
-	init_socket(socket);
+	socket->socket = dead_socket;
+	socket->ss_entry->init(socket);
 
 	init_completion(&socket->thread_done);
 	init_waitqueue_head(&socket->thread_wait);
@@ -516,7 +480,8 @@
 
     /* Blank out the socket state */
     s->state &= SOCKET_PRESENT|SOCKET_SETUP_PENDING;
-    init_socket(s);
+    s->socket = dead_socket;
+    s->ss_entry->init(s);
     s->irq.AssignedIRQ = s->irq.Config = 0;
     s->lock_count = 0;
     destroy_cis_cache(s);
@@ -531,7 +496,7 @@
     s->socket.Vpp = 0;
     s->socket.Vcc = 0;
     s->socket.io_irq = 0;
-    set_socket(s, &s->socket);
+    s->ss_entry->set_socket(s, &s->socket);
     /* */
 #ifdef CONFIG_CARDBUS
     cb_free(s);
@@ -625,16 +590,16 @@
 	int status, i;
 
 	skt->socket.flags |= SS_OUTPUT_ENA | SS_RESET;
-	set_socket(skt, &skt->socket);
+	skt->ss_entry->set_socket(skt, &skt->socket);
 	udelay((long)reset_time);
 
 	skt->socket.flags &= ~SS_RESET;
-	set_socket(skt, &skt->socket);
+	skt->ss_entry->set_socket(skt, &skt->socket);
 
 	set_current_state(TASK_UNINTERRUPTIBLE);
 	schedule_timeout(cs_to_timeout(unreset_delay));
 	for (i = 0; i < unreset_limit; i++) {
-		get_socket_status(skt, &status);
+		skt->ss_entry->get_status(skt, &status);
 
 		if (!(status & SS_DETECT))
 			return CS_NO_CARD;
@@ -654,7 +619,7 @@
 {
 	int status, i;
 
-	get_socket_status(skt, &status);
+	skt->ss_entry->get_status(skt, &status);
 	if (!(status & SS_DETECT))
 		return CS_NO_CARD;
 
@@ -662,7 +627,7 @@
 	schedule_timeout(cs_to_timeout(initial_delay));
 
 	for (i = 0; i < 100; i++) {
-		get_socket_status(skt, &status);
+		skt->ss_entry->get_status(skt, &status);
 		if (!(status & SS_DETECT))
 			return CS_NO_CARD;
 
@@ -699,7 +664,7 @@
 	}
 	skt->state |= SOCKET_PRESENT;
 	skt->socket.flags = SS_DEBOUNCED;
-	set_socket(skt, &skt->socket);
+	skt->ss_entry->set_socket(skt, &skt->socket);
 
 	/*
 	 * Wait "vcc_settle" for the supply to stabilise.
@@ -745,7 +710,8 @@
 		return CS_IN_USE;
 
 	send_event(skt, CS_EVENT_PM_SUSPEND, CS_EVENT_PRI_LOW);
-	suspend_socket(skt);
+	skt->socket = dead_socket;
+	skt->ss_entry->suspend(skt);
 	skt->state |= SOCKET_SUSPEND;
 
 	return CS_SUCCESS;
@@ -763,7 +729,8 @@
 	if (!(skt->state & SOCKET_SUSPEND))
 		return CS_IN_USE;
 
-	init_socket(skt);
+	skt->socket = dead_socket;
+	skt->ss_entry->init(skt);
 
 	ret = socket_setup(skt, resume_delay);
 	if (ret == CS_SUCCESS) {
@@ -817,7 +784,7 @@
 			schedule_timeout(cs_to_timeout(2));
 		}
 
-		get_socket_status(skt, &status);
+		skt->ss_entry->get_status(skt, &status);
 		if ((skt->state & SOCKET_PRESENT) &&
 		     !(status & SS_DETECT))
 			socket_remove(skt);
@@ -1371,7 +1338,7 @@
     if (CHECK_HANDLE(handle))
 	return CS_BAD_HANDLE;
     s = SOCKET(handle);
-    get_socket_status(s, &val);
+    s->ss_entry->get_status(s, &val);
     status->CardState = status->SocketState = 0;
     status->CardState |= (val & SS_DETECT) ? CS_EVENT_CARD_DETECT : 0;
     status->CardState |= (val & SS_CARDBUS) ? CS_EVENT_CB_DETECT : 0;
@@ -1450,7 +1417,7 @@
 	return CS_BAD_PAGE;
     s = win->sock;
     win->ctl.card_start = req->CardOffset;
-    if (set_mem_map(s, &win->ctl) != 0)
+    if (s->ss_entry->set_mem_map(s, &win->ctl) != 0)
 	return CS_BAD_OFFSET;
     return CS_SUCCESS;
 } /* map_mem_page */
@@ -1483,7 +1450,7 @@
 	    c->Attributes &= ~CONF_ENABLE_IRQ;
 	    s->socket.io_irq = 0;
 	}
-	set_socket(s, &s->socket);
+	s->ss_entry->set_socket(s, &s->socket);
     }
 
     if (mod->Attributes & CONF_VCC_CHANGE_VALID)
@@ -1495,7 +1462,7 @@
 	if (mod->Vpp1 != mod->Vpp2)
 	    return CS_BAD_VPP;
 	c->Vpp1 = c->Vpp2 = s->socket.Vpp = mod->Vpp1;
-	if (set_socket(s, &s->socket))
+	if (s->ss_entry->set_socket(s, &s->socket))
 	    return CS_BAD_VPP;
     } else if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) ||
 	       (mod->Attributes & CONF_VPP2_CHANGE_VALID))
@@ -1525,7 +1492,7 @@
     if (req->Attributes & WIN_USE_WAIT)
 	win->ctl.flags |= MAP_USE_WAIT;
     win->ctl.speed = req->AccessSpeed;
-    set_mem_map(win->sock, &win->ctl);
+    win->sock->ss_entry->set_mem_map(win->sock, &win->ctl);
     
     return CS_SUCCESS;
 } /* modify_window */
@@ -1625,7 +1592,7 @@
 	    s->socket.flags = SS_OUTPUT_ENA;   /* Is this correct? */
 	    s->socket.Vpp = 0;
 	    s->socket.io_irq = 0;
-	    set_socket(s, &s->socket);
+	    s->ss_entry->set_socket(s, &s->socket);
 	}
 	if (c->state & CONFIG_IO_REQ)
 	    for (i = 0; i < MAX_IO_WIN; i++) {
@@ -1635,7 +1602,7 @@
 		if (s->io[i].Config != 0)
 		    continue;
 		io.map = i;
-		set_io_map(s, &io);
+		s->ss_entry->set_io_map(s, &io);
 	    }
 	c->state &= ~CONFIG_LOCKED;
     }
@@ -1736,7 +1703,7 @@
 
     /* Shut down memory window */
     win->ctl.flags &= ~MAP_ACTIVE;
-    set_mem_map(s, &win->ctl);
+    s->ss_entry->set_mem_map(s, &win->ctl);
     s->state &= ~SOCKET_WIN_REQ(win->index);
 
     /* Release system memory */
@@ -1783,7 +1750,7 @@
     if (req->Vpp1 != req->Vpp2)
 	return CS_BAD_VPP;
     s->socket.Vpp = req->Vpp1;
-    if (set_socket(s, &s->socket))
+    if (s->ss_entry->set_socket(s, &s->socket))
 	return CS_BAD_VPP;
     
     c->Vcc = req->Vcc; c->Vpp1 = c->Vpp2 = req->Vpp1;
@@ -1801,7 +1768,7 @@
 	s->socket.io_irq = s->irq.AssignedIRQ;
     else
 	s->socket.io_irq = 0;
-    set_socket(s, &s->socket);
+    s->ss_entry->set_socket(s, &s->socket);
     s->lock_count++;
     
     /* Set up CIS configuration registers */
@@ -1866,7 +1833,7 @@
 		}
 		iomap.start = s->io[i].BasePort;
 		iomap.stop = iomap.start + s->io[i].NumPorts - 1;
-		set_io_map(s, &iomap);
+		s->ss_entry->set_io_map(s, &iomap);
 		s->io[i].Config++;
 	    }
     }
@@ -2087,7 +2054,7 @@
     win->ctl.sys_start = win->base;
     win->ctl.sys_stop = win->base + win->size-1;
     win->ctl.card_start = 0;
-    if (set_mem_map(s, &win->ctl) != 0)
+    if (s->ss_entry->set_mem_map(s, &win->ctl) != 0)
 	return CS_BAD_ARGS;
     s->state |= SOCKET_WIN_REQ(w);
 

From linux at brodo.de  Sat Jul  5 13:00:29 2003
From: linux at brodo.de (Dominik Brodowski)
Date: Sat Jul  5 11:21:08 2003
Subject: [PATCH] try to keep hd64465 socket driver up to date
Message-ID: <20030705100029.GA15248@brodo.de>

Even though the hd64465_ss.c driver seems to be very broken [note the
#error in lines 625-628], try to keep it up to date wrt pcmcia core
changes in 2.5.
This patch includes the following changes:

- irqreturn_t update
- callbacks use pcmcia_socket * not integer
- remove "inquire_socket"
- move "owner" field to pcmcia_socket
- allow socket drivers to call pcmcia_parse_events directly
- Remove work handler and work queue.  Call pcmcia_parse_events direct
  from interrupt handler. 
- update registration process

 drivers/pcmcia/hd64465_ss.c |  186 ++++++++++++++------------------------------
 1 files changed, 62 insertions(+), 124 deletions(-)



diff -ruN linux-original/drivers/pcmcia/hd64465_ss.c linux/drivers/pcmcia/hd64465_ss.c
--- linux-original/drivers/pcmcia/hd64465_ss.c	2003-07-05 10:22:58.000000000 +0200
+++ linux/drivers/pcmcia/hd64465_ss.c	2003-07-05 11:51:06.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * $Id$
+ * $Id: hd64465_ss.c,v 1.6 2003/05/04 19:29:58 lethal Exp $
  *
  * Device driver for the PCMCIA controller module of the
  * Hitachi HD64465 handheld companion chip.
@@ -74,38 +74,26 @@
 
 typedef struct hs_socket_t
 {
+    unsigned int	number;
     u_int   	    	irq;
     u_long  	    	mem_base;
     u_long  	    	mem_length;
-    void	    	(*handler)(void *info, u_int events);
-    void    	    	*handler_info;
-    u_int   	    	pending_events;
     u_int   	    	ctrl_base;
     socket_state_t  	state;
     pccard_io_map     	io_maps[MAX_IO_WIN];
     pccard_mem_map  	mem_maps[MAX_WIN];
     struct vm_struct	*io_vma;    /* allocated kernel vm for mapping IO space */
+    struct pcmcia_socket	socket;
 } hs_socket_t;
 
+
+
 #define HS_MAX_SOCKETS 2
 static hs_socket_t hs_sockets[HS_MAX_SOCKETS];
-static spinlock_t hs_pending_event_lock = SPIN_LOCK_UNLOCKED;
 
 /* Calculate socket number from ptr into hs_sockets[] */
 #define hs_sockno(sp) 	(sp - hs_sockets)
 
-static socket_cap_t hs_socket_cap =
-{
-    SS_CAP_PCCARD   	    /* support 16 bit cards */
-    |SS_CAP_STATIC_MAP      /* mappings are fixed in host memory */
-    ,
-    0xffde/*0xffff*/, 	    /* IRQs mapped in s/w so can do any, really */
-    HD64465_PCC_WINDOW,     /* 16MB fixed window size */
-    0,	    	    	    /* no PCI support */
-    0,	    	    	    /* no CardBus support */
-    0	    	    	    /* no bus operations needed */
-};
-
 #define hs_in(sp, r)	    inb((sp)->ctrl_base + (r))
 #define hs_out(sp, v, r)    outb(v, (sp)->ctrl_base + (r))
 
@@ -359,11 +347,11 @@
 
 /*============================================================*/
 
-static int hs_init(unsigned int sock)
+static int hs_init(struct pcmcia_socket *s)
 {
-    	hs_socket_t *sp = &hs_sockets[sock];
+    	hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
 	
-    	DPRINTK("hs_init(%d)\n", sock);
+    	DPRINTK("hs_init(%d)\n", sp->number);
 	
 	sp->pending_events = 0;
 	sp->state.Vcc = 0;
@@ -375,9 +363,10 @@
 
 /*============================================================*/
 
-static int hs_suspend(unsigned int sock)
+static int hs_suspend(struct pcmcia_socket *s)
 {
-    	DPRINTK("hs_suspend(%d)\n", sock);
+    	hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
+    	DPRINTK("hs_suspend(%d)\n", sp->number);
 
     	/* TODO */
 	
@@ -386,32 +375,10 @@
 
 /*============================================================*/
 
-static int hs_register_callback(unsigned int sock,
-    	    void (*handler)(void *, unsigned int), void * info)
-{
-    	hs_socket_t *sp = &hs_sockets[sock];
-	
-    	DPRINTK("hs_register_callback(%d)\n", sock);
-	sp->handler = handler;
-	sp->handler_info = info;
-	return 0;
-}
-
-/*============================================================*/
 
-static int hs_inquire_socket(unsigned int sock, socket_cap_t *cap)
+static int hs_get_status(struct pcmcia_socket *s, u_int *value)
 {
-    	DPRINTK("hs_inquire_socket(%d)\n", sock);
-
-	*cap = hs_socket_cap;
-	return 0;
-}
-
-/*============================================================*/
-
-static int hs_get_status(unsigned int sock, u_int *value)
-{
-    	hs_socket_t *sp = &hs_sockets[sock];
+    	hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
     	unsigned int isr;
 	u_int status = 0;
 	
@@ -473,9 +440,9 @@
 
 /*============================================================*/
 
-static int hs_get_socket(unsigned int sock, socket_state_t *state)
+static int hs_get_socket(struct pcmcia_socket *s, socket_state_t *state)
 {
-    	hs_socket_t *sp = &hs_sockets[sock];
+    	hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
 
     	DPRINTK("hs_get_socket(%d)\n", sock);
 	
@@ -485,9 +452,9 @@
 
 /*============================================================*/
 
-static int hs_set_socket(unsigned int sock, socket_state_t *state)
+static int hs_set_socket(struct pcmcia_socket *s, socket_state_t *state)
 {
-    	hs_socket_t *sp = &hs_sockets[sock];
+    	hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
     	u_long flags;
 	u_int changed;
 	unsigned short cscier;
@@ -495,12 +462,12 @@
     	DPRINTK("hs_set_socket(sock=%d, flags=%x, csc_mask=%x, Vcc=%d, Vpp=%d, io_irq=%d)\n",
 	    sock, state->flags, state->csc_mask, state->Vcc, state->Vpp, state->io_irq);
 	
-	save_and_cli(flags);	/* Don't want interrupts happening here */
+	local_irq_save(flags);	/* Don't want interrupts happening here */
 
 	if (state->Vpp != sp->state.Vpp ||
 	    state->Vcc != sp->state.Vcc) {
 	    if (!hs_set_voltages(sp, state->Vcc, state->Vpp)) {
-	    	restore_flags(flags);
+	    	local_irq_restore(flags);
 	    	return -EINVAL;
 	    }
 	}
@@ -588,7 +555,7 @@
 /*    	hd64465_io_debug = 0; */
 	sp->state = *state;
 	    
-	restore_flags(flags);
+	local_irq_restore(flags);
 
 #if HD64465_DEBUG > 10
 	if (state->flags & SS_OUTPUT_ENA)   
@@ -599,9 +566,9 @@
 
 /*============================================================*/
 
-static int hs_set_io_map(unsigned int sock, struct pccard_io_map *io)
+static int hs_set_io_map(struct pcmcia_socket *s, struct pccard_io_map *io)
 {
-    	hs_socket_t *sp = &hs_sockets[sock];
+    	hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
 	int map = io->map;
 	struct pccard_io_map *sio;
 	pgprot_t prot;
@@ -681,9 +648,9 @@
 
 /*============================================================*/
 
-static int hs_set_mem_map(unsigned int sock, struct pccard_mem_map *mem)
+static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
 {
-    	hs_socket_t *sp = &hs_sockets[sock];
+    	hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
 	struct pccard_mem_map *smem;
 	int map = mem->map;
 	unsigned long paddr, size;
@@ -722,13 +689,6 @@
 
 /*============================================================*/
 
-static void hs_proc_setup(unsigned int sock, struct proc_dir_entry *base)
-{
-    	DPRINTK("hs_proc_setup(%d)\n", sock);
-}
-
-/*============================================================*/
-
 /*
  * This function is registered with the HD64465 glue code to do a
  * secondary demux step on the PCMCIA interrupts.  It handles 
@@ -756,35 +716,9 @@
 
 /*
  * Interrupt handling routine.
- *
- * This uses the schedule_work() technique to cause reportable events
- * such as card insertion and removal to be handled in keventd's
- * process context.
  */
  
-
-static void hs_events_bh(void *dummy)
-{
-	hs_socket_t *sp;
-	u_int events;
-	int i;
-
-	for (i=0; i<HS_MAX_SOCKETS; i++) {
-	    sp = &hs_sockets[i];
-
-	    spin_lock_irq(&hs_pending_event_lock);
-	    events = sp->pending_events;
-	    sp->pending_events = 0;
-	    spin_unlock_irq(&hs_pending_event_lock);
-	    
-	    if (sp->handler)
-		sp->handler(sp->handler_info, events);
-	}
-}
-
-static DECLARE_WORK(hs_events_task, hs_events_bh, NULL);
-
-static void hs_interrupt(int irq, void *dev, struct pt_regs *regs)
+static irqreturn_t hs_interrupt(int irq, void *dev, struct pt_regs *regs)
 {
     	hs_socket_t *sp = (hs_socket_t *)dev;
 	u_int events = 0;
@@ -839,34 +773,22 @@
 
 	hs_out(sp, cscr, CSCR);
 
-	if (events) {
-	    /*
-    	     * Arrange for events to be reported to the registered
-	     * event handler function (from CardServices) in a process
-	     * context (keventd) "soon".
-	     */
-	    spin_lock(&hs_pending_event_lock);
-	    sp->pending_events |= events;
-	    spin_unlock(&hs_pending_event_lock);
-	    
-	    schedule_work(&hs_events_task);
-	}
+	if (events)
+		pcmcia_parse_events(&sp->socket, events);
+
+	return IRQ_HANDLED;
 }
 
 /*============================================================*/
 
 static struct pccard_operations hs_operations = {
-	.owner			= THIS_MODULE,
 	.init			= hs_init,
 	.suspend		= hs_suspend,
-	.register_callback	= hs_register_callback,
-	.inquire_socket		= hs_inquire_socket,
 	.get_status		= hs_get_status,
 	.get_socket		= hs_get_socket,
 	.set_socket		= hs_set_socket,
 	.set_io_map		= hs_set_io_map,
 	.set_mem_map		= hs_set_mem_map,
-	.proc_setup		= hs_proc_setup,
 };
 
 static int hs_init_socket(hs_socket_t *sp, int irq, unsigned long mem_base,
@@ -959,15 +881,9 @@
 	    vfree(sp->io_vma->addr);
 }
 
-static struct pcmcia_socket_class_data hd64465_data = {
-	.nsock = HS_MAX_SOCKETS,
-	.ops = &hs_operations,
-};
-
 static struct device_driver hd64465_driver = {
 	.name = "hd64465-pcmcia",
 	.bus = &platform_bus_type,
-	.devclass = &pcmcia_socket_class,
 	.suspend = pcmcia_socket_dev_suspend,
 	.resume = pcmcia_socket_dev_resume,
 };
@@ -996,7 +912,8 @@
 	}
 
 /*	hd64465_io_debug = 1; */
-	register_driver(&hd64465_driver);
+	if (driver_register(&hd64465_driver))
+		return -EINVAL;
 	
 	/* Wake both sockets out of STANDBY mode */
 	/* TODO: wait 15ms */
@@ -1014,36 +931,53 @@
 	v |= HD64465_PCCCSCR_PSWSEL;
 	outb(v, HD64465_REG_PCC0CSCR);
 
-    	hs_set_voltages(&hs_sockets[0], 0, 0);
-    	hs_set_voltages(&hs_sockets[1], 0, 0);
-	
 	/*
 	 * Setup hs_sockets[] structures and request system resources.
 	 * TODO: on memory allocation failure, power down the socket
 	 *       before quitting.
 	 */
+	for (i=0; i<2; i++) {
+		hs_set_voltages(&hs_sockets[i], 0, 0);
+
+		hs_sockets[i].socket.features |=  SS_CAP_PCCARD | SS_CAP_STATIC_MAP;      /* mappings are fixed in host memory */
+		hs_sockets[i].socket.irq_mask =  0xffde;/*0xffff*/	    /* IRQs mapped in s/w so can do any, really */
+		hs_sockets[i].socket.map_size = HD64465_PCC_WINDOW;     /* 16MB fixed window size */
+
+		hs_sockets[i].socket.owner = THIS_MODULE;
+		hs_sockets[i].socket.ss_entry = &hs_operations;
+	}
+
 	i = hs_init_socket(&hs_sockets[0],
 	    HD64465_IRQ_PCMCIA0,
 	    HD64465_PCC0_BASE,
 	    HD64465_REG_PCC0ISR);
 	if (i < 0) {
 		unregister_driver(&hd64465_driver);
-		return i;
+	    return i;
 	}
+
 	i = hs_init_socket(&hs_sockets[1],
 	    HD64465_IRQ_PCMCIA1,
 	    HD64465_PCC1_BASE,
 	    HD64465_REG_PCC1ISR);
 	if (i < 0) {
 		unregister_driver(&hd64465_driver);
-		return i;
+	    return i;
 	}
 
 /*	hd64465_io_debug = 0; */
-	hd64465_device.dev.class_data = &hd64465_data;
+
 	platform_device_register(&hd64465_device);
 
-	return 0;
+	for (i=0; i<2; i++) {
+		unsigned int ret;
+		hs_sockets[i].socket.dev.dev = &hd64465_device.dev;		
+		ret = pcmcia_register_socket(&hs_sockets[i].socket);
+		if (ret && i)
+			pcmcia_unregister_socket(&hs_socket[0].socket);
+	}
+
+    	return 0;
 }
 
 static void __exit exit_hs(void)
@@ -1051,16 +985,20 @@
     	u_long flags;
 	int i;
 	
-	save_and_cli(flags);
+	for (i=0 ; i<HS_MAX_SOCKETS ; i++)
+		pcmcia_unregister_socket(&hs_socket[i].socket);
+
+	local_irq_save(flags);
 
     	/*
 	 * Release kernel resources
 	 */
 	for (i=0 ; i<HS_MAX_SOCKETS ; i++)
 	    hs_exit_socket(&hs_sockets[i]);
-	platform_device_unregister(&hd64465_device);
 	
-	restore_flags(flags);
+	local_irq_restore(flags);
+
+	platform_device_unregister(&hd64465_device);
 	unregister_driver(&hd64465_driver);
 }
 

From lethal at linux-sh.org  Sat Jul  5 10:28:16 2003
From: lethal at linux-sh.org (Paul Mundt)
Date: Sat Jul  5 14:28:21 2003
Subject: [PATCH] try to keep hd64465 socket driver up to date
In-Reply-To: <20030705100029.GA15248@brodo.de>
References: <20030705100029.GA15248@brodo.de>
Message-ID: <20030705132816.GA32115@linux-sh.org>

On Sat, Jul 05, 2003 at 12:00:29PM +0200, Dominik Brodowski wrote:
> Even though the hd64465_ss.c driver seems to be very broken [note the
> #error in lines 625-628], try to keep it up to date wrt pcmcia core
> changes in 2.5.

I just noticed this error, it seems this driver doesn't get as much use as it
used to. I'll work on fixing this up shortly. I don't have the hardware for
this though, so it will likely go untested for awhile.

[snip]
> +		ret = pcmcia_register_socket(&hs_sockets[i].socket);
> +		if (ret && i)
> +			pcmcia_unregister_socket(&hs_socket[0].socket);
> +	}
> +
> +    	return 0;
>  }
>  
Typo I presume, since there's no hs_socket[].

>  static void __exit exit_hs(void)
> @@ -1051,16 +985,20 @@
>      	u_long flags;
>  	int i;
>  	
> -	save_and_cli(flags);
> +	for (i=0 ; i<HS_MAX_SOCKETS ; i++)
> +		pcmcia_unregister_socket(&hs_socket[i].socket);
> +
> +	local_irq_save(flags);
>  
Same here.

>      	/*
>  	 * Release kernel resources
>  	 */
>  	for (i=0 ; i<HS_MAX_SOCKETS ; i++)
>  	    hs_exit_socket(&hs_sockets[i]);
> -	platform_device_unregister(&hd64465_device);
>  	
> -	restore_flags(flags);
> +	local_irq_restore(flags);
> +
> +	platform_device_unregister(&hd64465_device);
>  	unregister_driver(&hd64465_driver);
>  }
>  
For this, I've just moved the local_irq_save()/local_irq_restore() into
hs_exit_socket(), as looping over HS_MAX_SOCKETS twice doesn't make much sense.

The rest of this looks good, I'll merge this into LinuxSH CVS.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20030705/9641baf3/attachment.bin
From daniel.ritz at gmx.ch  Sun Jul  6 01:39:34 2003
From: daniel.ritz at gmx.ch (Daniel Ritz)
Date: Sat Jul  5 23:46:12 2003
Subject: yenta-socket oops with 2.5.73-mm3, 2.5.74, 2.5.74-mm1
Message-ID: <200307060039.34263.daniel.ritz@gmx.ch>

hello

problem is that an interrupt arrives before socket->thread_wait is initialized
so we crash in __wake_up_common. i think source of the interrupt is socket_init
called before the initialization. but an interrupt can still arrive before...

i think the whole init stuff should happen even before we do request_irq(). i
tried moving around pcmcia_register_socket() but then my card doesn't come up...
maybe we should add something like pcmcia_alloc_socket() which does kmalloc()
a socket struct and does all the important init stuff? russel?

michael, can you try this one?

rgds
-daniel


--- 1.50/drivers/pcmcia/cs.c	Mon Jun 30 22:22:30 2003
+++ edited/cs.c	Sat Jul  5 23:58:07 2003
@@ -338,13 +338,13 @@
 	socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
 	INIT_LIST_HEAD(&socket->cis_cache);
 	spin_lock_init(&socket->lock);
-
-	init_socket(socket);
-
 	init_completion(&socket->thread_done);
 	init_waitqueue_head(&socket->thread_wait);
 	init_MUTEX(&socket->skt_sem);
 	spin_lock_init(&socket->thread_lock);
+
+	init_socket(socket);
+
 	ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
 	if (ret < 0)
 		return ret;




On Friday 04 July 2003 09:10, Michael Frank wrote:
> modprobe yenta-socket produces oops below _only_ after cold boot and _only_
> when e100 loaded. No PCMCIA problems with this system with 2.4 and 2.5
> until recent PCMCIA rework.
>
> Reproduced behavior with 2.5.73-mm3, 2.5.74, 2.5.74-mm1
>
> 2.5.73-mm2 no oops but hangs about 1 in 10 at
>  PCI: Enabling device 0:12.0 (0->2) (PCMCIA). e100 was loaded but not
> tested wo e100
>
> Conditions:
>  Cold-boot - no oops when warm-boot+load after successful load or when
> unload+load e100 loaded
>
> Oops appears 1 in 4 loads and looks similar every time
>
> Setup:
> ACPI core enabled, no usb
>
> $ lsmod
> pcmcia_core
> toshiba_acpi
> e100
>
> $ lspci
> 00:00.0 Host bridge: Transmeta Corporation LongRun Northbridge (rev 01)
> 00:00.1 RAM memory: Transmeta Corporation SDRAM controller
> 00:00.2 RAM memory: Transmeta Corporation BIOS scratchpad
> 00:04.0 VGA compatible controller: S3 Inc. 86C270-294 Savage/IX-MV (rev 13)
> 00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI AC-Link
> Controller Audio Device (rev 01) 00:07.0 ISA bridge: ALi Corporation M1533
> PCI to ISA Bridge [Aladdin IV] 00:0e.0 Ethernet controller: Intel Corp.
> 82557/8/9 [Ethernet Pro 100] (rev 08) 00:10.0 IDE interface: ALi
> Corporation M5229 IDE (rev c3)
> 00:11.0 Bridge: ALi Corporation M7101 PMU
> 00:12.0 CardBus bridge: Toshiba America Info Systems ToPIC95 PCI to Cardbus
> Bridge with ZV Support (rev 32) 00:14.0 USB Controller: ALi Corporation USB
> 1.1 Controller (rev 03)
>
> No serial port, Oops taken from screen
> unable to handle null pointer dereference at 0
> oops: 0000 #1
> EFLAGS 00010086
> EIP is at __wake_up_common+0x13
> eax ce09c9c0 ebx 286 ecx 1 edx 0
> esi 1 edi 0 ebp ccc67dcc esp ccc67dc0
> ds 7b es 7b ss 68
> Process modprobe pid 1153 threadinfo ccc66000 task cd68e080
> Stack: 286 4000001 0 ccc67de8 c011afa1 ce09c9c0 3 1
>        0 ce09c800 ccc67df0 cf8a3ecf cccc67e04 cf87a7ea ce09c830 80
>        cdffec00 ccc67e24 c010d0aa 5 ce09c800 ccc67e50 280 5
> Call trace:
> __wake_up+0x11
> pcmcia_parse_events+0x23
> yenta_interrupt+0x26
> handle_IRQ_event+0x2a
> do_IRQ+0x82
> common_interrupt+0x18
> setup_irq+0x9b
> yenta_interrupt+0x0
> request_irq+0x89
> yenta_probe+0x137
> yenta_interrupt+0x0
> pci_device_probe_static+0x20
> pci_device_probe+0x21
> bus_match+0x38
> driver_attach+0x3e
> bus_add_driver+0x6e
> driver_register+0x36
> pci_register_driver+0x6a
> yenta_socket_init+0xd
> sys_init_module+0xe0
> syscall_call+0x7
> Code: 8b 3a 8b 45 08 83 c0 04 39 c2 74 23 8b 5a f4 8b 4d 14 51 8b
>  <0> Fatal exception in interrupt
> In interrupt handler - not syncing
>
> It is now running allright by starting pcmcia ahead of network.
>


From mflt1 at micrologica.com.hk  Sun Jul  6 12:26:34 2003
From: mflt1 at micrologica.com.hk (Michael Frank)
Date: Sun Jul  6 04:29:25 2003
Subject: yenta-socket oops with 2.5.73-mm3, 2.5.74, 2.5.74-mm1
In-Reply-To: <200307060039.34263.daniel.ritz@gmx.ch>
References: <200307060039.34263.daniel.ritz@gmx.ch>
Message-ID: <200307061126.34635.mflt1@micrologica.com.hk>

Hello Daniel and Dominik,

Now I got two patches to try, thank you.

I got the patch below (not yet tested) from Dominik. 

I will test this further on Monday. 

Regards
Michael

diff -ruN linux-original/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- linux-original/drivers/pcmcia/cs.c  2003-07-05 10:22:58.000000000 +0200
+++ linux/drivers/pcmcia/cs.c   2003-07-05 10:28:56.000000000 +0200
@@ -351,6 +351,10 @@
 
        wait_for_completion(&socket->thread_done);
        BUG_ON(!socket->thread);
+
+       /* ok, allow interrupts to be parsed */
+       socket->init_done = 1;
+
        pcmcia_parse_events(socket, SS_DETECT);
 
        return 0;
@@ -361,6 +365,8 @@
        struct pcmcia_socket *socket = class_get_devdata(class_dev);
        client_t *client;
 
+       socket->init_done = 0;  /* block interrupts */
+
        if (socket->thread) {
                init_completion(&socket->thread_done);
                socket->thread = NULL;
@@ -870,6 +876,9 @@
 
 void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
 {
+       if (unlikely(&s->init_done == 0))
+               return;
+
        spin_lock(&s->thread_lock);
        s->thread_events |= events;
        spin_unlock(&s->thread_lock);
diff -ruN linux-original/include/pcmcia/ss.h linux/include/pcmcia/ss.h
--- linux-original/include/pcmcia/ss.h  2003-07-05 10:23:00.000000000 +0200
+++ linux/include/pcmcia/ss.h   2003-07-05 10:24:22.000000000 +0200
@@ -215,6 +215,7 @@
        wait_queue_head_t               thread_wait;
        spinlock_t                      thread_lock;    /* protects thread_events */
        unsigned int                    thread_events;
+       unsigned short                  init_done;      /* interrupts are parsed only if this is != 0 */
 
        /* pcmcia (16-bit) */
        struct pcmcia_bus_socket        *pcmcia;


On Sunday 06 July 2003 06:39, Daniel Ritz wrote:
> hello
>
> problem is that an interrupt arrives before socket->thread_wait is
> initialized so we crash in __wake_up_common. i think source of the
> interrupt is socket_init called before the initialization. but an interrupt
> can still arrive before...
>
> i think the whole init stuff should happen even before we do request_irq().
> i tried moving around pcmcia_register_socket() but then my card doesn't
> come up... maybe we should add something like pcmcia_alloc_socket() which
> does kmalloc() a socket struct and does all the important init stuff?
> russel?
>
> michael, can you try this one?
>
> rgds
> -daniel
>
>
> --- 1.50/drivers/pcmcia/cs.c	Mon Jun 30 22:22:30 2003
> +++ edited/cs.c	Sat Jul  5 23:58:07 2003
> @@ -338,13 +338,13 @@
>  	socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
>  	INIT_LIST_HEAD(&socket->cis_cache);
>  	spin_lock_init(&socket->lock);
> -
> -	init_socket(socket);
> -
>  	init_completion(&socket->thread_done);
>  	init_waitqueue_head(&socket->thread_wait);
>  	init_MUTEX(&socket->skt_sem);
>  	spin_lock_init(&socket->thread_lock);
> +
> +	init_socket(socket);
> +
>  	ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
>  	if (ret < 0)
>  		return ret;
>
> On Friday 04 July 2003 09:10, Michael Frank wrote:
> > modprobe yenta-socket produces oops below _only_ after cold boot and
> > _only_ when e100 loaded. No PCMCIA problems with this system with 2.4 and
> > 2.5 until recent PCMCIA rework.
> >
> > Reproduced behavior with 2.5.73-mm3, 2.5.74, 2.5.74-mm1
> >
> > 2.5.73-mm2 no oops but hangs about 1 in 10 at
> >  PCI: Enabling device 0:12.0 (0->2) (PCMCIA). e100 was loaded but not
> > tested wo e100
> >
> > Conditions:
> >  Cold-boot - no oops when warm-boot+load after successful load or when
> > unload+load e100 loaded
> >
> > Oops appears 1 in 4 loads and looks similar every time
> >
> > Setup:
> > ACPI core enabled, no usb
> >
> > $ lsmod
> > pcmcia_core
> > toshiba_acpi
> > e100
> >
> > $ lspci
> > 00:00.0 Host bridge: Transmeta Corporation LongRun Northbridge (rev 01)
> > 00:00.1 RAM memory: Transmeta Corporation SDRAM controller
> > 00:00.2 RAM memory: Transmeta Corporation BIOS scratchpad
> > 00:04.0 VGA compatible controller: S3 Inc. 86C270-294 Savage/IX-MV (rev
> > 13) 00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI
> > AC-Link Controller Audio Device (rev 01) 00:07.0 ISA bridge: ALi
> > Corporation M1533 PCI to ISA Bridge [Aladdin IV] 00:0e.0 Ethernet
> > controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08) 00:10.0 IDE
> > interface: ALi Corporation M5229 IDE (rev c3)
> > 00:11.0 Bridge: ALi Corporation M7101 PMU
> > 00:12.0 CardBus bridge: Toshiba America Info Systems ToPIC95 PCI to
> > Cardbus Bridge with ZV Support (rev 32) 00:14.0 USB Controller: ALi
> > Corporation USB 1.1 Controller (rev 03)
> >
> > No serial port, Oops taken from screen
> > unable to handle null pointer dereference at 0
> > oops: 0000 #1
> > EFLAGS 00010086
> > EIP is at __wake_up_common+0x13
> > eax ce09c9c0 ebx 286 ecx 1 edx 0
> > esi 1 edi 0 ebp ccc67dcc esp ccc67dc0
> > ds 7b es 7b ss 68
> > Process modprobe pid 1153 threadinfo ccc66000 task cd68e080
> > Stack: 286 4000001 0 ccc67de8 c011afa1 ce09c9c0 3 1
> >        0 ce09c800 ccc67df0 cf8a3ecf cccc67e04 cf87a7ea ce09c830 80
> >        cdffec00 ccc67e24 c010d0aa 5 ce09c800 ccc67e50 280 5
> > Call trace:
> > __wake_up+0x11
> > pcmcia_parse_events+0x23
> > yenta_interrupt+0x26
> > handle_IRQ_event+0x2a
> > do_IRQ+0x82
> > common_interrupt+0x18
> > setup_irq+0x9b
> > yenta_interrupt+0x0
> > request_irq+0x89
> > yenta_probe+0x137
> > yenta_interrupt+0x0
> > pci_device_probe_static+0x20
> > pci_device_probe+0x21
> > bus_match+0x38
> > driver_attach+0x3e
> > bus_add_driver+0x6e
> > driver_register+0x36
> > pci_register_driver+0x6a
> > yenta_socket_init+0xd
> > sys_init_module+0xe0
> > syscall_call+0x7
> > Code: 8b 3a 8b 45 08 83 c0 04 39 c2 74 23 8b 5a f4 8b 4d 14 51 8b
> >  <0> Fatal exception in interrupt
> > In interrupt handler - not syncing
> >
> > It is now running allright by starting pcmcia ahead of network.

-- 
Powered by linux-2.5.74-mm1. Compiled with gcc-2.95-3 - mature and rock solid

My current linux related activities:
- 2.5 yenta_socket testing
- Test development and testing of swsusp and ACPI S3
- Everyday usage of 2.5 kernel

More info on 2.5 kernel: http://www.codemonkey.org.uk/post-halloween-2.5.txt


From rmk at arm.linux.org.uk  Sun Jul  6 09:45:24 2003
From: rmk at arm.linux.org.uk (Russell King)
Date: Sun Jul  6 08:45:23 2003
Subject: yenta-socket oops with 2.5.73-mm3, 2.5.74, 2.5.74-mm1
In-Reply-To: <200307061126.34635.mflt1@micrologica.com.hk>;
	from mflt1@micrologica.com.hk on Sun, Jul 06, 2003 at 11:26:34AM +0800
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<200307061126.34635.mflt1@micrologica.com.hk>
Message-ID: <20030706084524.A8146@flint.arm.linux.org.uk>

On Sun, Jul 06, 2003 at 11:26:34AM +0800, Michael Frank wrote:
> I got the patch below (not yet tested) from Dominik. 

I've already thrown this one out and suggested a cleaner alternative to
Dominik.

I was busy wasting time trying to get an XScale platform up and running
yesterday, and getting nowhere fast.  Going nowhere at all is a very
accurate description of yesterdays activities.  I suspect the hardware
may have been messed up during transit thanks to various screws missing.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


From mflt1 at micrologica.com.hk  Sun Jul  6 22:14:13 2003
From: mflt1 at micrologica.com.hk (Michael Frank)
Date: Sun Jul  6 14:17:48 2003
Subject: yenta-socket oops with 2.5.73-mm3, 2.5.74, 2.5.74-mm1
In-Reply-To: <20030706084524.A8146@flint.arm.linux.org.uk>
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<200307061126.34635.mflt1@micrologica.com.hk>
	<20030706084524.A8146@flint.arm.linux.org.uk>
Message-ID: <200307062114.16117.mflt1@micrologica.com.hk>

On Sunday 06 July 2003 15:45, Russell King wrote:
> On Sun, Jul 06, 2003 at 11:26:34AM +0800, Michael Frank wrote:
> > I got the patch below (not yet tested) from Dominik.
>
> I've already thrown this one out and suggested a cleaner alternative to
> Dominik.
>

I await the new patch then, 

> I was busy wasting time trying to get an XScale platform up and running
> yesterday, and getting nowhere fast.  Going nowhere at all is a very
> accurate description of yesterdays activities.  I suspect the hardware
> may have been messed up during transit thanks to various screws missing.

Hopefully Monday will be a better day...

Regards
Michael

-- 
Powered by linux-2.5.74-mm1. Compiled with gcc-2.95-3 - mature and rock solid

My current linux related activities:
- 2.5 yenta_socket testing
- Test development and testing of swsusp and ACPI S3
- Everyday usage of 2.5 kernel

More info on 2.5 kernel: http://www.codemonkey.org.uk/post-halloween-2.5.txt


From rmk at arm.linux.org.uk  Mon Jul  7 00:15:51 2003
From: rmk at arm.linux.org.uk (Russell King)
Date: Sun Jul  6 23:15:52 2003
Subject: yenta-socket oops with 2.5.73-mm3, 2.5.74, 2.5.74-mm1
In-Reply-To: <200307060039.34263.daniel.ritz@gmx.ch>;
	from daniel.ritz@gmx.ch on Sun, Jul 06, 2003 at 12:39:34AM +0200
References: <200307060039.34263.daniel.ritz@gmx.ch>
Message-ID: <20030706231551.B16820@flint.arm.linux.org.uk>

On Sun, Jul 06, 2003 at 12:39:34AM +0200, Daniel Ritz wrote:
> problem is that an interrupt arrives before socket->thread_wait is
> initialized so we crash in __wake_up_common. i think source of the
> interrupt is socket_init called before the initialization. but an
> interrupt can still arrive before...

I suspect that even with your patch below, there is the posibility
to receive an unintentional call into pcmcia_parse_events() from some
socket drivers.  The all round better fix is to make pcmcia_parse_events()
ignore socket change events until the socket thread is up and running.

Nevertheless, the patch looks correct, so I am still interested in
whether your patch helps solve Michael's problem.

> michael, can you try this one?

Daniel's patch:

--- 1.50/drivers/pcmcia/cs.c	Mon Jun 30 22:22:30 2003
+++ edited/cs.c	Sat Jul  5 23:58:07 2003
@@ -338,13 +338,13 @@
 	socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
 	INIT_LIST_HEAD(&socket->cis_cache);
 	spin_lock_init(&socket->lock);
-
-	init_socket(socket);
-
 	init_completion(&socket->thread_done);
 	init_waitqueue_head(&socket->thread_wait);
 	init_MUTEX(&socket->skt_sem);
 	spin_lock_init(&socket->thread_lock);
+
+	init_socket(socket);
+
 	ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
 	if (ret < 0)
 		return ret;

and my patch (may apply with some offset, which I'm about to check
into bk anyway):

--- linux/drivers/pcmcia/cs.c.old	Fri Jul  4 10:21:50 2003
+++ linux/drivers/pcmcia/cs.c	Sun Jul  6 23:04:10 2003
@@ -870,11 +870,13 @@
 
 void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
 {
-	spin_lock(&s->thread_lock);
-	s->thread_events |= events;
-	spin_unlock(&s->thread_lock);
+	if (s->thread) {
+		spin_lock(&s->thread_lock);
+		s->thread_events |= events;
+		spin_unlock(&s->thread_lock);
 
-	wake_up(&s->thread_wait);
+		wake_up(&s->thread_wait);
+	}
 } /* pcmcia_parse_events */
 
 

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


From rmk at arm.linux.org.uk  Mon Jul  7 00:34:29 2003
From: rmk at arm.linux.org.uk (Russell King)
Date: Sun Jul  6 23:34:20 2003
Subject: corresponding patches to [RFC]
In-Reply-To: <20030612194751.GA3300@brodo.de>;
	from linux@brodo.de on Thu, Jun 12, 2003 at 09:47:51PM +0200
References: <20030612194751.GA3300@brodo.de>
Message-ID: <20030706233429.C16820@flint.arm.linux.org.uk>

On Thu, Jun 12, 2003 at 09:47:51PM +0200, Dominik Brodowski wrote:
> Just a few changes to the RFC, the most important is that for static mapped
> sockets its now enough to do "echo 1 > /sys/.../settings/start" [once all
> other things are done properly, of course...]
> 
> 	Dominik
> 
> BTW: these changes are only released with the GPL v.2

Appologies for the delay in getting to this.

Can you clear the license change with David Hinds please?  I suspect that
without David saying "ok" to it, and maybe asking for us to change the
MAINTAINERS entry, Linus may not accept the patch.

Similarly, I think David needs to be asked whether he wants his name and
email address to continue to appear in the MODULE_AUTHOR tag.

> +static struct kobj_type ktype_pcmcia_settings = {
> +	.sysfs_ops	= &sysfs_ops,
> +	.default_attrs	= default_attrs,
> +};
> +
> +static struct kobject pcmcia_settings_kobj = {
> +	.name = "settings",
> +	.parent = &pcmcia_bus_type.subsys.kset.kobj,
> +	.ktype = &ktype_pcmcia_settings,
> +};
> +
> +
> +/*====================================================================*/
> +

Hmm, this is adding attributes to the "pcmcia" bus, placing them in
a directory called /sysfs/bus/pcmcia/settings ?

Is there a reason why these can't just place them directly into the
pcmcia bus directory?

I'm also slightly worried about the lifetime of the pcmcia_bus object.
Although bus_unregister() makes it disappear from the sysfs tree, any
references to that object and any sub-object will cause other code in
the kernel to keep a reference to the pcmcia_bus_type, which gets
really messy when the module whose storage it was using has long
since gone.

Don't worry, its not only pcmcia with this problem - USB sufferes
similarly from it.  I don't think there's an easy solution for the
users; in other words, its a device model problem.

>  static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
>  {
>  	struct pcmcia_socket *socket = class_dev->class_data;
> @@ -936,6 +1156,7 @@
>  
>  	bus_register(&pcmcia_bus_type);
>  	class_interface_register(&pcmcia_bus_interface);
> +	kobject_register(&pcmcia_settings_kobj);
>  
>  	/* Set up character device for user mode clients */
>  	i = register_chrdev(0, "pcmcia", &ds_fops);
> @@ -970,6 +1191,7 @@
>  	if (major_dev != -1)
>  		unregister_chrdev(major_dev, "pcmcia");
>  
> +	kobject_unregister(&pcmcia_settings_kobj);
>  	bus_unregister(&pcmcia_bus_type);
>  }
>  module_exit(exit_pcmcia_bus);

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


From rmk at arm.linux.org.uk  Mon Jul  7 00:42:22 2003
From: rmk at arm.linux.org.uk (Russell King)
Date: Sun Jul  6 23:42:12 2003
Subject: [PATCH] pcmcia: don't sleep when you aren't tired
In-Reply-To: <20030620214356.GA1700@brodo.de>;
	from linux@brodo.de on Fri, Jun 20, 2003 at 11:43:56PM +0200
References: <20030620214356.GA1700@brodo.de>
Message-ID: <20030706234222.D16820@flint.arm.linux.org.uk>

On Fri, Jun 20, 2003 at 11:43:56PM +0200, Dominik Brodowski wrote:
> There seems to be no reason why ds.c should wait for 100ms before it
> unregisters the drivers etc. Also, check whether it's safe to sleep
> here...

I'm not so sure we want to make this change just yet.  Eventually, yes.
Net devices are currently undergoing something of a overhaul, sorting
out the lifetime of the "net_device" object.  I think this work needs
to be completed before we think about removing this timer.

I also think that we need to eliminate the timers in all the pcmcia
card drivers before this change; they likewise have a (shorter) timer
on ejection.

This is all part of a crude attempt at sequencing events to make stuff
occur in the right order.  ie:

- unplug device
- start 50ms timer to remove processing in card drivers
  (crude attempt to wait for card driver interrupt handlers to return.)
- start 100ms timer to delay notification to cardmgr
- card driver removes all references
- (50ms wait caused by difference in timers)
- card removal notification hits user space

Other than that, its something we should do.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


From mflt1 at micrologica.com.hk  Mon Jul  7 11:02:24 2003
From: mflt1 at micrologica.com.hk (Michael Frank)
Date: Mon Jul  7 03:06:51 2003
Subject: yenta-socket oops with 2.5.73-mm3, 2.5.74, 2.5.74-mm1
In-Reply-To: <20030706231551.B16820@flint.arm.linux.org.uk>
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<20030706231551.B16820@flint.arm.linux.org.uk>
Message-ID: <200307070958.56751.mflt1@micrologica.com.hk>

Applied both patches without offsets.

Did 20 halt cycles with e100 loaded - no oopses. Seems to
be fixed. 

The oops without e100 seems to be fixed too but needs more 
watching as it's probability increases when power is off for 
longer than the short time in above test where power is switched
on again within a few seconds after the halt.

Regards
Michael


On Monday 07 July 2003 06:15, Russell King wrote:
> On Sun, Jul 06, 2003 at 12:39:34AM +0200, Daniel Ritz wrote:
> > problem is that an interrupt arrives before socket->thread_wait is
> > initialized so we crash in __wake_up_common. i think source of the
> > interrupt is socket_init called before the initialization. but an
> > interrupt can still arrive before...
>
> I suspect that even with your patch below, there is the posibility
> to receive an unintentional call into pcmcia_parse_events() from some
> socket drivers.  The all round better fix is to make pcmcia_parse_events()
> ignore socket change events until the socket thread is up and running.
>
> Nevertheless, the patch looks correct, so I am still interested in
> whether your patch helps solve Michael's problem.
>
> > michael, can you try this one?
>
> Daniel's patch:
>
> --- 1.50/drivers/pcmcia/cs.c	Mon Jun 30 22:22:30 2003
> +++ edited/cs.c	Sat Jul  5 23:58:07 2003
> @@ -338,13 +338,13 @@
>  	socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
>  	INIT_LIST_HEAD(&socket->cis_cache);
>  	spin_lock_init(&socket->lock);
> -
> -	init_socket(socket);
> -
>  	init_completion(&socket->thread_done);
>  	init_waitqueue_head(&socket->thread_wait);
>  	init_MUTEX(&socket->skt_sem);
>  	spin_lock_init(&socket->thread_lock);
> +
> +	init_socket(socket);
> +
>  	ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
>  	if (ret < 0)
>  		return ret;
>
> and my patch (may apply with some offset, which I'm about to check
> into bk anyway):
>
> --- linux/drivers/pcmcia/cs.c.old	Fri Jul  4 10:21:50 2003
> +++ linux/drivers/pcmcia/cs.c	Sun Jul  6 23:04:10 2003
> @@ -870,11 +870,13 @@
>
>  void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
>  {
> -	spin_lock(&s->thread_lock);
> -	s->thread_events |= events;
> -	spin_unlock(&s->thread_lock);
> +	if (s->thread) {
> +		spin_lock(&s->thread_lock);
> +		s->thread_events |= events;
> +		spin_unlock(&s->thread_lock);
>
> -	wake_up(&s->thread_wait);
> +		wake_up(&s->thread_wait);
> +	}
>  } /* pcmcia_parse_events */

-- 
Powered by linux-2.5.74-mm1. Compiled with gcc-2.95-3 - mature and rock solid

My current linux related activities:
- 2.5 yenta_socket testing
- Test development and testing of swsusp and ACPI S3
- Everyday usage of 2.5 kernel

More info on 2.5 kernel: http://www.codemonkey.org.uk/post-halloween-2.5.txt


From linux at brodo.de  Mon Jul  7 15:39:53 2003
From: linux at brodo.de (Dominik Brodowski)
Date: Mon Jul  7 14:05:19 2003
Subject: [PATCH] pcmcia: don't sleep when you aren't tired
In-Reply-To: <20030706234222.D16820@flint.arm.linux.org.uk>
References: <20030620214356.GA1700@brodo.de>
	<20030706234222.D16820@flint.arm.linux.org.uk>
Message-ID: <20030707123953.GC1905@brodo.de>

Hi Russell,

On Sun, Jul 06, 2003 at 11:42:22PM +0100, Russell King wrote:
> On Fri, Jun 20, 2003 at 11:43:56PM +0200, Dominik Brodowski wrote:
> > There seems to be no reason why ds.c should wait for 100ms before it
> > unregisters the drivers etc. Also, check whether it's safe to sleep
> > here...
> 
> I'm not so sure we want to make this change just yet.  Eventually, yes.
> Net devices are currently undergoing something of a overhaul, sorting
> out the lifetime of the "net_device" object.  I think this work needs
> to be completed before we think about removing this timer.

I agree completely. At first I thought it's because this migh_sleep(), but
in fact unloading of devices is quite borken..

> This is all part of a crude attempt at sequencing events to make stuff
> occur in the right order.  ie:
> 
> - unplug device
> - start 50ms timer to remove processing in card drivers
>   (crude attempt to wait for card driver interrupt handlers to return.)
> - start 100ms timer to delay notification to cardmgr
> - card driver removes all references
> - (50ms wait caused by difference in timers)
> - card removal notification hits user space
> 
> Other than that, its something we should do.

Yes, but as you pointed out, not at this time.

	Dominik

From linux at brodo.de  Mon Jul  7 15:47:20 2003
From: linux at brodo.de (Dominik Brodowski)
Date: Mon Jul  7 14:05:20 2003
Subject: corresponding patches to [RFC]
In-Reply-To: <20030706233429.C16820@flint.arm.linux.org.uk>
References: <20030612194751.GA3300@brodo.de>
	<20030706233429.C16820@flint.arm.linux.org.uk>
Message-ID: <20030707124720.GD1905@brodo.de>

On Sun, Jul 06, 2003 at 11:34:29PM +0100, Russell King wrote:
> On Thu, Jun 12, 2003 at 09:47:51PM +0200, Dominik Brodowski wrote:
> > Just a few changes to the RFC, the most important is that for static mapped
> > sockets its now enough to do "echo 1 > /sys/.../settings/start" [once all
> > other things are done properly, of course...]
> > 
> > 	Dominik
> > 
> > BTW: these changes are only released with the GPL v.2
> 
> Appologies for the delay in getting to this.

No problem, have been re-working these patches a bit in the past few days;
hopefully I'll get to publish a complete new patchset today.

> Can you clear the license change with David Hinds please?  I suspect that
> without David saying "ok" to it, and maybe asking for us to change the
> MAINTAINERS entry, Linus may not accept the patch.

To clarify some things: I don't care whether it's GPL v.2 or GPL/MPL.
However, some of the code I want to patch in is clearly based on differenct
GPL-only code. That's why I consider this step to be necessary. Nonetheless,
I'll ask David.

> > +	.ktype = &ktype_pcmcia_settings,
> 
> Hmm, this is adding attributes to the "pcmcia" bus, placing them in
> a directory called /sysfs/bus/pcmcia/settings ?

Aww, this seems to be a very old patchset you're reviewing here...

> I'm also slightly worried about the lifetime of the pcmcia_bus object.
> Although bus_unregister() makes it disappear from the sysfs tree, any
> references to that object and any sub-object will cause other code in
> the kernel to keep a reference to the pcmcia_bus_type, which gets
> really messy when the module whose storage it was using has long
> since gone.

Any module using pcmcia_bus will increase the refcount of ds.ko. Doesn't
this solve this problem?

	Dominik

From linux at brodo.de  Tue Jul  8 16:51:11 2003
From: linux at brodo.de (Dominik Brodowski)
Date: Tue Jul  8 16:03:50 2003
Subject: PCMCIA Status
In-Reply-To: <20030708014921.GA19464@sixbit.org>
References: <20030708014921.GA19464@sixbit.org>
Message-ID: <20030708135111.GA2212@brodo.de>

A new patchset for in-kernel matching, hotplug, ... pcmcia is available at
http://www.brodo.de/pcmcia/

It is far more advanced than the previously published 2.5.67 patchset, but
includes a few bugs.[*] That's why I haven't yet created a "complete" diff
between 2.5.74-base and 2.5.74-pcmcia... 

I hope to get a release for 2.5.75 done, though.

The following patches will be submitted for inclusion and properly announced
on this mailing list very soon:

pcmcia-2.5.74-ds_license
pcmcia-2.5.74-ds_resources_1ab
pcmcia-2.5.74-ds_device
pcmcia-2.5.74-ds_sysfs_output

Nonetheless, if you want to take a look where this will lead to, take a look
at the other patches available at http://www.brodo.de/pcmcia/

	Dominik

[*] it works well on my notebook, but:
- somehow I have too many references to driver modules if cardmgr is loaded,
     too [I _think_ I know what this problem is]
- some driver modules depend(!) on module unloading after usage in order to
     clean up stale links or other stuff. This issue needs to be adressed.
- strange lockups appear with my new IBM PCMCIA Data/Fax Modem. Don't know
     whether this is related to these patches, though
- the resource management should try to block NON_ISA access on PCI-PCI
     bridges for window'ed sockets, and then use only the limitied windows
     offered by this bridge. It's been partly done by arjanv, but needs 
     a) integration with the resource manager, and
     b) proper testing [arjanv's notebook doesn't boot on 2.5. currently

From linux at brodo.de  Tue Jul  8 18:00:25 2003
From: linux at brodo.de (Dominik Brodowski)
Date: Tue Jul  8 16:04:00 2003
Subject: [PATCHES] pcmcia: struct pcmcia_device, proper sysfs representation
 for PCMCIA cards
Message-ID: <20030708150025.GA18141@brodo.de>

These patches add a new "struct pcmcia_device", which contains a
corresponding struct device. For multifunction PCMCIA cards, the same is
done as for multifunction PCI devices: one such device for each function is
created. It makes life *soooo* much easier.


pcmcia-2.5.74-bk6-ds_license - add ds.c license to be GPL only

As some of this code is based on GPL-only code, it has been necessary to
switch the license to be GPL only, too. Dave Hinds has OK'ed this change.


pcmcia-2.5.74-bk6-resources_1ab - check whether resource setup is done

see various threads, especially my latest RFCs


pcmcia-2.5.74-bk6-pcmcia_device - actual adding of struct pcmcia_device

pcmcia-2.5.74-bk6-sysfs_device_info - more sysfs output for pcmcia_devices



Please test & apply,

	Dominik
-------------- next part --------------
Change the license of ds.c to GPL only. This is necessary as I want to
merge code which is clearly derivative work of other GPL-only
code. OK'ed with David Hinds.

 drivers/pcmcia/ds.c |   35 ++++++++++-------------------------
 1 files changed, 10 insertions(+), 25 deletions(-)

diff -ruN linux-original/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-original/drivers/pcmcia/ds.c	2003-07-08 15:54:10.000000000 +0200
+++ linux/drivers/pcmcia/ds.c	2003-07-08 16:01:38.000000000 +0200
@@ -1,34 +1,19 @@
 /*======================================================================
 
     PC Card Driver Services
-    
-    ds.c 1.112 2001/10/13 00:08:28
-    
-    The contents of this file are subject to the Mozilla Public
-    License Version 1.1 (the "License"); you may not use this file
-    except in compliance with the License. You may obtain a copy of
-    the License at http://www.mozilla.org/MPL/
-
-    Software distributed under the License is distributed on an "AS
-    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-    implied. See the License for the specific language governing
-    rights and limitations under the License.
+   
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License version 2 as
+    published by the Free Software Foundation.
 
     The initial developer of the original code is David A. Hinds
     <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
     are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
 
-    Alternatively, the contents of this file may be used under the
-    terms of the GNU General Public License version 2 (the "GPL"), in
-    which case the provisions of the GPL are applicable instead of the
-    above.  If you wish to allow the use of your version of this file
-    only under the terms of the GPL and not to allow others to use
-    your version of this file under the MPL, indicate your decision
-    by deleting the provisions above and replace them with the notice
-    and other provisions required by the GPL.  If you do not delete
-    the provisions above, a recipient may use your version of this
-    file under either the MPL or the GPL.
-    
+    Adaption to the Linux driver model, hotplug and module functions
+    of kernel 2.5 are Copyright (C) 2003 Dominik Brodowski. All Rights 
+    Reserved
+
 ======================================================================*/
 
 #include <linux/config.h>
@@ -63,9 +48,9 @@
 
 /* Module parameters */
 
-MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
+MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>, Dominik Brodowski <linux@brodo.de>");
 MODULE_DESCRIPTION("PCMCIA Driver Services " CS_RELEASE);
-MODULE_LICENSE("Dual MPL/GPL");
+MODULE_LICENSE("GPL");
 
 #define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
 
-------------- next part --------------
This patch adds a struct pcmcia_device, and fills it with content for
every function of every pcmcia card inserted into the socket as long
as there are resources to play with (see previous patch)

 drivers/pcmcia/cistpl.c |    1
 drivers/pcmcia/cs.c     |    3
 drivers/pcmcia/ds.c     |  179 +++++++++++++++++++++++++++++++++++++++++++++++-
 include/pcmcia/ds.h     |   25 ++++++
 4 files changed, 206 insertions(+), 2 deletions(-)

diff -ruN linux-original/drivers/pcmcia/cistpl.c linux/drivers/pcmcia/cistpl.c
--- linux-original/drivers/pcmcia/cistpl.c	2003-07-08 15:58:51.000000000 +0200
+++ linux/drivers/pcmcia/cistpl.c	2003-07-08 16:08:05.000000000 +0200
@@ -1417,6 +1417,7 @@
     ret = pcmcia_parse_tuple(handle, &tuple, parse);
     return ret;
 }
+EXPORT_SYMBOL(read_tuple);
 
 /*======================================================================
 
diff -ruN linux-original/drivers/pcmcia/cs.c linux/drivers/pcmcia/cs.c
--- linux-original/drivers/pcmcia/cs.c	2003-07-08 15:58:51.000000000 +0200
+++ linux/drivers/pcmcia/cs.c	2003-07-08 16:08:05.000000000 +0200
@@ -128,6 +128,9 @@
 LIST_HEAD(pcmcia_socket_list);
 DECLARE_RWSEM(pcmcia_socket_list_rwsem);
 
+EXPORT_SYMBOL(pcmcia_socket_list);
+EXPORT_SYMBOL(pcmcia_socket_list_rwsem);
+
 /*====================================================================*/
 
 /* String tables for error messages */
diff -ruN linux-original/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-original/drivers/pcmcia/ds.c	2003-07-08 16:09:00.000000000 +0200
+++ linux/drivers/pcmcia/ds.c	2003-07-08 16:11:22.000000000 +0200
@@ -93,6 +93,11 @@
 	socket_bind_t		*bind;
 	struct device		*socket_dev;
 	struct pcmcia_socket	*parent;
+
+	/* the PCMCIA devices connected to this socket (normally one, more
+	 * for multifunction devices: */
+	struct list_head	devices_list;
+	struct semaphore	devices_list_sem;
 };
 
 #define SOCKET_PRESENT		0x01
@@ -127,6 +132,9 @@
 
 /*======================================================================*/
 
+extern int validate_cis(client_handle_t handle, cisinfo_t *info);
+extern int read_tuple(client_handle_t handle, cisdata_t code, void *parse);
+
 static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
 static struct pcmcia_bus_socket * get_socket_info_by_nr(unsigned int nr);
 
@@ -183,6 +191,141 @@
 }
 #endif
 
+/*********************** device adding / removing ***************************/
+
+
+static int pcmcia_add_card(struct pcmcia_socket *s)
+{
+	struct pcmcia_device *p_dev;
+	int ret;
+	unsigned int has_cis = 0;
+	unsigned int func = 0, no_funcs = 1;
+
+	down(&s->pcmcia->devices_list_sem);
+
+ next_device:
+	DEBUG(0, "ds: pcmcia_add_card(%i):", func);
+
+	p_dev = kmalloc(sizeof(struct pcmcia_device), GFP_KERNEL);
+	if (!p_dev) {
+		ret = -ENOMEM;
+		goto out;
+	}
+	memset(p_dev, 0, sizeof(struct pcmcia_device));
+	p_dev->dev.bus = &pcmcia_bus_type;
+	p_dev->dev.parent = s->dev.dev;
+	p_dev->socket = s;
+
+	/* first case: no resources are available, so we can't decode
+	 * any device information */
+	if (!((dynamic_resources_available) || 
+	     (s->features & SS_CAP_HAS_RESOURCES))) {
+		DEBUG(0, "no resources available\n");
+		sprintf (p_dev->dev.bus_id, "pcmcia%d.?", 
+			 s->sock);
+		sprintf (p_dev->dev.name, "unknown");
+		ret = device_register(&p_dev->dev);
+		if (ret) {
+			kfree(p_dev);
+			goto out;
+		}
+		list_add(&p_dev->socket_device_list, &s->pcmcia->devices_list);
+		goto out;
+	}
+
+	/* if we got here for the first time, we need to check whether
+	 * the CIS is valid etc. */
+	if (!func) {
+		cisinfo_t cisinfo;
+		ret = pcmcia_validate_cis(s->pcmcia->handle, &cisinfo);
+		if (ret || !cisinfo.Chains) {
+			DEBUG(0, "invalid CIS\n");
+		} else {
+			cistpl_longlink_mfc_t mfc;
+
+			DEBUG(0, "has CIS\n");
+			has_cis = 1;
+			if (!read_tuple(s->pcmcia->handle, CISTPL_LONGLINK_MFC, &mfc))
+				no_funcs = mfc.nfn;
+			else
+				no_funcs = 1;
+		}
+	}
+
+	p_dev->func = func;
+	p_dev->has_cis = has_cis;
+
+	sprintf (p_dev->dev.bus_id, "pcmcia%d.%d", s->sock, p_dev->func);
+
+	/* read out device name "vers_1" */
+	if (!has_cis || (read_tuple(s->pcmcia->handle, CISTPL_VERS_1, &p_dev->vers1)))
+		p_dev->vers1.ns = 0;
+
+	if (p_dev->vers1.ns) {
+		char name[255] = "\0";
+		int i = 0;
+		for (i=0; i < p_dev->vers1.ns; i++) {
+			strcat(name, (p_dev->vers1.str + p_dev->vers1.ofs[i]));
+			strcat(name, " ");
+		}
+		snprintf(p_dev->dev.name, DEVICE_NAME_SIZE, "%s", name);
+	} else
+		sprintf (p_dev->dev.name, "unknown");
+
+	/* read out manufacture ID */
+	if (has_cis && !(read_tuple(s->pcmcia->handle, CISTPL_MANFID, &p_dev->manfid)))
+		p_dev->has_manfid = 1;
+
+	/* read out function ID -- rule of thumb: cards with no FUNCID, but with 
+	 * common memory device geometry information, are probably memory cards */
+	if (has_cis && !(read_tuple(s->pcmcia->handle, CISTPL_FUNCID, &p_dev->funcid)))
+		p_dev->has_funcid = 1;
+	else {
+		cistpl_device_geo_t devgeo;
+		if (has_cis && !(read_tuple(s->pcmcia->handle, CISTPL_DEVICE_GEO, &devgeo))) {
+			DEBUG(0, "(mem device geometry) leads to funcid_memory\n");
+			p_dev->has_funcid = 1;
+			p_dev->funcid.func = CISTPL_FUNCID_MEMORY;
+		}
+	}
+
+	/* register it both with the driver model core and with the bus socket list */
+	ret = device_register(&p_dev->dev);
+	if (ret) {
+		kfree(p_dev);
+		goto out;
+	}
+	list_add(&p_dev->socket_device_list, &s->pcmcia->devices_list);
+
+	/* if we got a multifunction device, we need to register more devices,
+	 * so go back up */
+	func++;
+	if (no_funcs > func)
+		goto next_device;
+
+ out:
+	up(&s->pcmcia->devices_list_sem);
+	return ret;
+}
+
+static void pcmcia_remove_card(struct pcmcia_socket *s)
+{
+	struct list_head *p1;
+	struct list_head *p2;
+
+	DEBUG(0, "ds: pcmcia_remove_card()\n");
+
+	down(&s->pcmcia->devices_list_sem);
+	list_for_each_safe(p1, p2, &s->pcmcia->devices_list) {
+		struct pcmcia_device *p_dev = container_of(p1, struct pcmcia_device, socket_device_list);
+		device_unregister(&p_dev->dev);
+		list_del(&p_dev->socket_device_list);
+		kfree(p_dev);
+	}
+	up(&s->pcmcia->devices_list_sem);
+}
+
+
 /*======================================================================
 
     These manage a ring buffer of events pending for one user process
@@ -236,6 +379,7 @@
 static void handle_removal(void *data)
 {
     struct pcmcia_bus_socket *s = data;
+    pcmcia_remove_card(s->parent);
     handle_event(s, CS_EVENT_CARD_REMOVAL);
     s->state &= ~SOCKET_REMOVAL_PENDING;
 }
@@ -260,6 +404,10 @@
     case CS_EVENT_CARD_REMOVAL:
 	s->state &= ~SOCKET_PRESENT;
 	if (!(s->state & SOCKET_REMOVAL_PENDING)) {
+		/* this is delayed so that the other "clients" [i.e. the 
+		 * specific drivers can shut down]. Once the client and 
+		 * driver management is unified, this delay can go away.
+		 */
 		s->state |= SOCKET_REMOVAL_PENDING;
 		schedule_delayed_work(&s->removal,  HZ/10);
 	}
@@ -267,6 +415,7 @@
 	
     case CS_EVENT_CARD_INSERTION:
 	s->state |= SOCKET_PRESENT;
+	pcmcia_add_card(s->parent);
 	handle_event(s, event);
 	break;
 
@@ -643,6 +792,9 @@
 
 /*====================================================================*/
 
+extern struct rw_semaphore pcmcia_socket_list_rwsem;
+extern struct list_head pcmcia_socket_list;
+
 static int ds_ioctl(struct inode * inode, struct file * file,
 		    u_int cmd, u_long arg)
 {
@@ -687,12 +839,31 @@
     if (cmd & IOC_IN) copy_from_user((char *)&buf, (char *)arg, size);
     
     if ((cmd != DS_ADJUST_RESOURCE_INFO) && (!dyn_res_status)) {
+	    struct pcmcia_socket *sock;
+
 	    dyn_res_status = 2;
 
 	    /* resources have just become available, and will stay available forever...
 	     * well, at least as long as the kernel is rebooted [pcmcia isn't modular
 	     * at the moment] */
 	    dynamic_resources_available = 1;
+
+	    /* rescan the sockets, if necessary */
+	    down_read(&pcmcia_socket_list_rwsem);
+
+	    list_for_each_entry(sock, &pcmcia_socket_list, socket_list) {
+		    if (!sock->pcmcia)
+			    continue;
+		    if (sock->features & SS_CAP_HAS_RESOURCES)
+			    continue;
+		    if (list_empty(&sock->pcmcia->devices_list))
+			    continue;
+		    pcmcia_remove_card(sock);
+		    pcmcia_add_card(sock);
+	    }
+
+	    up_read(&pcmcia_socket_list_rwsem);
+
     }
 
     switch (cmd) {
@@ -860,6 +1031,9 @@
 	s->socket_dev = socket->dev.dev;
 	INIT_WORK(&s->removal, handle_removal, s);
 	s->parent = socket;
+	socket->pcmcia = s;
+	init_MUTEX(&s->devices_list_sem);
+	INIT_LIST_HEAD(&s->devices_list);
 
 	/* Set up hotline to Card Services */
 	client_reg.dev_info = bind.dev_info = &dev_info;
@@ -886,11 +1060,10 @@
 	if (ret != CS_SUCCESS) {
 		cs_error(NULL, RegisterClient, ret);
 		kfree(s);
+		socket->pcmcia = NULL;
 		return -EINVAL;
 	}
 
-	socket->pcmcia = s;
-
 	return 0;
 }
 
@@ -902,6 +1075,8 @@
 	if (!socket || !socket->pcmcia)
 		return;
 
+	pcmcia_remove_card(socket);
+
 	flush_scheduled_work();
 
 	pcmcia_deregister_client(socket->pcmcia->handle);
diff -ruN linux-original/include/pcmcia/ds.h linux/include/pcmcia/ds.h
--- linux-original/include/pcmcia/ds.h	2003-07-08 15:54:13.000000000 +0200
+++ linux/include/pcmcia/ds.h	2003-07-08 16:08:05.000000000 +0200
@@ -159,5 +159,30 @@
 /* error reporting */
 void cs_error(client_handle_t handle, int func, int ret);
 
+
+struct pcmcia_socket;
+
+struct pcmcia_device {
+	struct pcmcia_socket		*socket;
+
+	struct list_head		socket_device_list;
+
+	unsigned int			func;
+	struct device			dev;
+
+	/* cis information */
+	unsigned int			has_cis;
+	cistpl_vers_1_t			vers1;
+
+	unsigned int			has_manfid;
+	cistpl_manfid_t			manfid;
+
+	unsigned int			has_funcid;
+	cistpl_funcid_t			funcid;
+};
+
+#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
+#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_DS_H */
-------------- next part --------------
To do anything proper in the kernel, it needs to be known whether
a) the socket driver only uses a fixed area of IOPORTS and IOMEM,
therefore can't clash with other e.g. ISA devices -- then
socket->flags should be |= SS_CAP_HAS_RESOURCES --, or
b) the resource database (for all other sockets) has been filled with
enough information [currently by cardmgr, later using a different
interface]

Later, pccardd will only be started -- and thus insert events only be
handled -- once these resources have been set. So some of this code
will disappear again soon.

 drivers/pcmcia/ds.c |   31 +++++++++++++++++++++++++++++--
 include/pcmcia/ss.h |    1 +
 2 files changed, 30 insertions(+), 2 deletions(-)

diff -ruN linux-original/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-original/drivers/pcmcia/ds.c	2003-07-08 16:03:57.000000000 +0200
+++ linux/drivers/pcmcia/ds.c	2003-07-08 16:03:49.000000000 +0200
@@ -110,6 +110,14 @@
 
 /*====================================================================*/
 
+/* As soon as the iomem/ioport/irq configuration is done by cardmgr
+ * (3.2.x), this is set to 1.
+ */
+static int dynamic_resources_available = 0;
+
+
+/*====================================================================*/
+
 void cs_error(client_handle_t handle, int func, int ret)
 {
 	error_info_t err = { func, ret };
@@ -643,6 +651,8 @@
     u_int size;
     int ret, err;
     ds_ioctl_arg_t buf;
+    static int dyn_res_status = 1;
+
 
     DEBUG(2, "ds_ioctl(socket %d, %#x, %#lx)\n", i, cmd, arg);
     
@@ -676,10 +686,27 @@
     
     if (cmd & IOC_IN) copy_from_user((char *)&buf, (char *)arg, size);
     
+    if ((cmd != DS_ADJUST_RESOURCE_INFO) && (!dyn_res_status)) {
+	    dyn_res_status = 2;
+
+	    /* resources have just become available, and will stay available forever...
+	     * well, at least as long as the kernel is rebooted [pcmcia isn't modular
+	     * at the moment] */
+	    dynamic_resources_available = 1;
+    }
+
     switch (cmd) {
     case DS_ADJUST_RESOURCE_INFO:
-	ret = pcmcia_adjust_resource_info(s->handle, &buf.adjust);
-	break;
+    {
+	    if (dyn_res_status == 2) {
+		    printk(KERN_INFO "pcmcia: warning: DS_ADJUST_RESOURCE_INFO calls don't do anything...\n");
+		    dyn_res_status++;
+		    break;
+	    }
+	    dyn_res_status = 0;
+	    ret = pcmcia_adjust_resource_info(s->handle, &buf.adjust);
+	    break;
+    }
     case DS_GET_CARD_SERVICES_INFO:
 	ret = pcmcia_get_card_services_info(&buf.servinfo);
 	break;
diff -ruN linux-original/include/pcmcia/ss.h linux/include/pcmcia/ss.h
--- linux-original/include/pcmcia/ss.h	2003-07-08 15:58:51.000000000 +0200
+++ linux/include/pcmcia/ss.h	2003-07-08 16:03:49.000000000 +0200
@@ -57,6 +57,7 @@
 #define SS_CAP_VIRTUAL_BUS	0x0002
 #define SS_CAP_MEM_ALIGN	0x0004
 #define SS_CAP_STATIC_MAP	0x0008
+#define SS_CAP_HAS_RESOURCES	0x0010
 #define SS_CAP_PCCARD		0x4000
 #define SS_CAP_CARDBUS		0x8000
 
-------------- next part --------------
This patch adds seven files (manf_id, card_id, func_id, vers1 to
vers4) to any pcmcia device registered with the driver model core.

 drivers/pcmcia/ds.c |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 55 insertions(+)

diff -ruN linux-original/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c
--- linux-original/drivers/pcmcia/ds.c	2003-07-08 16:14:02.000000000 +0200
+++ linux/drivers/pcmcia/ds.c	2003-07-08 16:15:55.000000000 +0200
@@ -191,6 +191,43 @@
 }
 #endif
 
+/************************ per-device sysfs output ***************************/
+
+#define show_one(file_name, object, test, format)			\
+static ssize_t show_##file_name 					\
+(struct device *dev, char *buf)						\
+{									\
+	struct pcmcia_device *p_dev = to_pcmcia_dev(dev);		\
+	return p_dev->test ? sprintf (buf, format, p_dev->object) : 	\
+			sprintf(buf, "unknown\n");			\
+}	 								\
+DEVICE_ATTR(file_name, 0444, show_##file_name, NULL);
+
+show_one(func_id, funcid.func, has_funcid, "%1X\n");
+show_one(manf_id, manfid.manf, has_manfid, "%04X\n");
+show_one(card_id, manfid.card, has_manfid, "%04X\n");
+
+#define show_one_s(file_name, object, test)	 			\
+static ssize_t show_##file_name 					\
+(struct device *dev, char *buf)						\
+{									\
+	struct pcmcia_device *p_dev = to_pcmcia_dev(dev);		\
+	return test ? sprintf (buf, "%s\n", object) : 			\
+			sprintf(buf, "\n");				\
+}	 								\
+DEVICE_ATTR(file_name, 0444, show_##file_name, NULL);
+
+show_one_s(vers1, (p_dev->vers1.str + p_dev->vers1.ofs[0]), 
+	   (p_dev->vers1.ns >= 1));
+show_one_s(vers2, (p_dev->vers1.str + p_dev->vers1.ofs[1]), 
+	   (p_dev->vers1.ns >= 2));
+show_one_s(vers3, (p_dev->vers1.str + p_dev->vers1.ofs[2]), 
+	   (p_dev->vers1.ns >= 3));
+show_one_s(vers4, (p_dev->vers1.str + p_dev->vers1.ofs[3]), 
+	   (p_dev->vers1.ns >= 4));
+
+
+
 /*********************** device adding / removing ***************************/
 
 
@@ -297,6 +334,15 @@
 	}
 	list_add(&p_dev->socket_device_list, &s->pcmcia->devices_list);
 
+	/* add sysfs files */
+	device_create_file(&p_dev->dev, &dev_attr_func_id);
+	device_create_file(&p_dev->dev, &dev_attr_manf_id);
+	device_create_file(&p_dev->dev, &dev_attr_card_id);
+	device_create_file(&p_dev->dev, &dev_attr_vers1);
+	device_create_file(&p_dev->dev, &dev_attr_vers2);
+	device_create_file(&p_dev->dev, &dev_attr_vers3);
+	device_create_file(&p_dev->dev, &dev_attr_vers4);
+
 	/* if we got a multifunction device, we need to register more devices,
 	 * so go back up */
 	func++;
@@ -318,6 +364,15 @@
 	down(&s->pcmcia->devices_list_sem);
 	list_for_each_safe(p1, p2, &s->pcmcia->devices_list) {
 		struct pcmcia_device *p_dev = container_of(p1, struct pcmcia_device, socket_device_list);
+
+		device_remove_file(&p_dev->dev, &dev_attr_func_id);
+		device_remove_file(&p_dev->dev, &dev_attr_manf_id);
+		device_remove_file(&p_dev->dev, &dev_attr_card_id);
+		device_remove_file(&p_dev->dev, &dev_attr_vers1);
+		device_remove_file(&p_dev->dev, &dev_attr_vers2);
+		device_remove_file(&p_dev->dev, &dev_attr_vers3);
+		device_remove_file(&p_dev->dev, &dev_attr_vers4);
+
 		device_unregister(&p_dev->dev);
 		list_del(&p_dev->socket_device_list);
 		kfree(p_dev);
From willy at debian.org  Tue Jul  8 18:23:42 2003
From: willy at debian.org (Matthew Wilcox)
Date: Tue Jul  8 17:23:32 2003
Subject: Did you break PCI irq probing on my ancient Thinkpad?
In-Reply-To: <3F0AEC21.9060803@thekelleys.org.uk>
References: <3F0AEC21.9060803@thekelleys.org.uk>
Message-ID: <20030708162342.GK23597@parcelfarce.linux.theplanet.co.uk>

On Tue, Jul 08, 2003 at 05:06:57PM +0100, Simon Kelley wrote:
> Somewhere between Linux 2.5.72 and the state of the BK-CVS mirror 
> yesterday something broke in the PCI interrupt probing on my old 
> Thinkpad 760.
> 
> Prodding around in in LKML revealed 
> http://lists.insecure.org/lists/linux-kernel/2003/Jun/5744.html
> and a look at the log for drivers/pci/probe.c shows changes by you so 
> I'm taking a first stab that you may be able to help (and that I can 
> help you make it work.)
> 
> If I'm barking up the wrong tree please feel free to tell me.
> 
> IBM thinkpad 760, Pentium 133.
> 
> Immediate symptom is  no working PCMCIA slots.

Well ... this is tricky because I know there's been some tampering
with the PCMCIA code too.

> lsof:
> 00:00.0 Host bridge: Intel Corp. 430MX - 82437MX Mob. System Ctrlr 
> (MTSC) & 82438MX Data Path (MTDP) (rev 02)
> 00:01.0 ISA bridge: Intel Corp. 82371FB PIIX ISA [Triton I] (rev 02)
> 00:02.0 CardBus bridge: Texas Instruments PCI1130 (rev 04)
> 00:02.1 CardBus bridge: Texas Instruments PCI1130 (rev 04)
> 00:03.0 VGA compatible controller: Trident Microsystems TGUI 
> 9660/968x/968x (rev d3)
> 00:05.0 Multimedia video controller: IBM MPEG PCI Bridge
> 
> Note that this machine has always (even on 2.4.x) said
> 
> PCI: No IRQ known for interrupt pin A of device 00:02.0. Please try 
> using pci=biosirq.
> PCI: No IRQ known for interrupt pin B of device 00:02.1. Please try 
> using pci=biosirq.
> 
> even when pci=biosirq is set. The PCMCIA slots did work though.
> 
> Under 2.5.74 I now see:
> 
> PCI: No IRQ known for interrupt pin A of device 0000:00:02.0. Please try 
> using pci=biosirq.
> ti113x: Routing card interrupts to PCI
> Yenta IRQ list 0000, PCI irq0
> Socket status: 30000006
> PCI: No IRQ known for interrupt pin B of device 0000:00:02.1. Please try 
> using pci=biosirq.
> ti113x: Routing card interrupts to PCI
> Yenta IRQ list 0000, PCI irq0
> 
> and new also:
> PIIXa: IDE controller at PCI slot 0000:00:01.0
> PIIXa: chipset revision 2
> PIIXa: bad irq (0): will probe later

Does it probe later?  Does it get an interrupt assigned by the time
you're at the login prompt?

> Starting and (16 bit) PCMCIA driver now fails with
> RequestIRQ: Resource in use
> 
> 
> 
> It looks to me like the PCI IRQ probing is broken. Any suggestions? 
> Please let me know if you need further information.

I think the PCMCIA bit is the more likely to be broken.  However, you
can convince me otherwise ;-)

Send me an lspci -v from 2.5.72 and another from 2.5.74-BK, that way we
can compare them and see if anything obvious is wrong.

You could also diff the two output files yourself and see what changed ;-)

My bet's still on the PCMCIA changes being the problem.

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

From linux at brodo.de  Tue Jul  8 20:18:19 2003
From: linux at brodo.de (Dominik Brodowski)
Date: Tue Jul  8 18:18:22 2003
Subject: Did you break PCI irq probing on my ancient Thinkpad?
In-Reply-To: <20030708162342.GK23597@parcelfarce.linux.theplanet.co.uk>
References: <3F0AEC21.9060803@thekelleys.org.uk>
	<20030708162342.GK23597@parcelfarce.linux.theplanet.co.uk>
Message-ID: <20030708171819.GA22970@brodo.de>

On Tue, Jul 08, 2003 at 05:23:42PM +0100, Matthew Wilcox wrote:
> > Immediate symptom is  no working PCMCIA slots.
> 
> Well ... this is tricky because I know there's been some tampering
> with the PCMCIA code too.

Might be... a forward-port from 2.4.-ac proved to be (partly) wrong. Could
you try the attached patch by rmk, please?

	Dominik
-------------- next part --------------
An embedded message was scrubbed...
From: Russell King <rmk@arm.linux.org.uk>
Subject: Re: Fwd: Re: 2.5.74-mm1
Date: Sun, 6 Jul 2003 23:02:56 +0100
Size: 4473
Url: http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20030708/b18d32b2/attachment.eml
From tim at buttersideup.com  Tue Jul  8 20:40:33 2003
From: tim at buttersideup.com (Tim Small)
Date: Tue Jul  8 19:41:10 2003
Subject: Did you break PCI irq probing on my ancient Thinkpad?
In-Reply-To: <20030708171819.GA22970@brodo.de>
References: <3F0AEC21.9060803@thekelleys.org.uk>
	<20030708162342.GK23597@parcelfarce.linux.theplanet.co.uk>
	<20030708171819.GA22970@brodo.de>
Message-ID: <3F0B1021.8030303@buttersideup.com>

Dominik Brodowski wrote:

>On Tue, Jul 08, 2003 at 05:23:42PM +0100, Matthew Wilcox wrote:
>  
>
>>>Immediate symptom is  no working PCMCIA slots.
>>>      
>>>
>>Well ... this is tricky because I know there's been some tampering
>>with the PCMCIA code too.
>>    
>>
>
>Might be... a forward-port from 2.4.-ac proved to be (partly) wrong. Could
>you try the attached patch by rmk, please?
>
>	Dominik
>  
>
Hmm, looking around the 2.4 version of this code, I wasn't entirely 
comfortable with the way the code configured these TI bridges - it seems 
to try to configure older chips in the same way as newer chips - and it 
can end up writing to reserved registers and/or invalid values to 
existing registers on older chips...

These might be of use:

http://www.buttersideup.com/files/ti1031.pdf
http://www.buttersideup.com/files/ti1131.pdf
http://www.buttersideup.com/files/ti1031.patch

the last is a patch against linux 2.4.20 that I used to get my TI1031 
based SCM Microsystems "PCI Swapbox" to work.  Haven't had time to 
finish it up, or forward port it to 2.5.x yet unfortunately...  It is 
based on an earlier patch by Pavel Roskin, which - I think - got applied 
to -ac

Cheers,

Tim.



From simon at thekelleys.org.uk  Tue Jul  8 21:01:12 2003
From: simon at thekelleys.org.uk (Simon Kelley)
Date: Tue Jul  8 20:00:52 2003
Subject: Did you break PCI irq probing on my ancient Thinkpad?
In-Reply-To: <20030708171819.GA22970@brodo.de>
References: <3F0AEC21.9060803@thekelleys.org.uk>
	<20030708162342.GK23597@parcelfarce.linux.theplanet.co.uk>
	<20030708171819.GA22970@brodo.de>
Message-ID: <3F0B14F8.5090702@thekelleys.org.uk>

Dominik Brodowski wrote:
> On Tue, Jul 08, 2003 at 05:23:42PM +0100, Matthew Wilcox wrote:
> 
>>>Immediate symptom is  no working PCMCIA slots.
>>
>>Well ... this is tricky because I know there's been some tampering
>>with the PCMCIA code too.
> 
> 
> Might be... a forward-port from 2.4.-ac proved to be (partly) wrong. Could
> you try the attached patch by rmk, please?
> 
> 	Dominik
> 
> 
> ------------------------------------------------------------------------
> 
> Subject:
> Re: Fwd: Re: 2.5.74-mm1
> From:
> Russell King <rmk@arm.linux.org.uk>
> Date:
> Sun, 6 Jul 2003 23:02:56 +0100
> To:
> Alan Cox <alan@lxorguk.ukuu.org.uk>, Patrick Mochel <mochel@osdl.org>
> 
> 
> On Fri, Jul 04, 2003 at 05:58:24PM +0100, Alan Cox wrote:
> 
>>On Iau, 2003-07-03 at 23:36, Russell King wrote:
>>
>>>Dominik,
>>>
>>>The patch below seems to be causing some lockups.
>>>
>>>Pat Mochel has a TI bridge where irq_mask is zero.  For both sockets,
>>>PCI config register 0x8c is 0x00001000 and 0x92 is 0x66.
>>>
>>>This seems to mean that we're using PCI serial interrupt mode rather
>>>than the hard-wired ISA or PCI INT# mode.  Maybe these laptops can't
>>>handle PCI INT# mode?
>>>
>>>Also copying Alan since I believe that the patch below came from the -ac
>>>tree.
>>
>>The diagnosis looks right. I guess someone with docs needs to detect
>>this case and avodi pci mode
> 
> 
> Ok, looked at the docs for the PCI4450 and the TI1211.  Since there is
> only one setting for PCI serial IRQ mode (which is the mode Pat's
> laptop is in) we must not switch out of this mode.  Note that serial PCI
> IRQ mode includes serial ISA IRQ mode.
> 
> So, here's a patch for 2.5.  We basically ignore this if we're using
> serial PCI IRQ mode.
> 
> --- orig/drivers/pcmcia/ti113x.h	Wed Jul  2 22:44:06 2003
> +++ linux/drivers/pcmcia/ti113x.h	Sun Jul  6 22:52:41 2003
> @@ -179,21 +179,26 @@
>  	/*
>  	 * If ISA interrupts don't work, then fall back to routing card
>  	 * interrupts to the PCI interrupt of the socket.
> +	 *
> +	 * Tweaking this when we are using serial PCI IRQs causes hangs
> +	 *   --rmk
>  	 */
>  	if (!socket->socket.irq_mask) {
> -		int irqmux, devctl;
> -
> -		printk (KERN_INFO "ti113x: Routing card interrupts to PCI\n");
> +		u8 irqmux, devctl;
>  
>  		devctl = config_readb(socket, TI113X_DEVICE_CONTROL);
> -		devctl &= ~TI113X_DCR_IMODE_MASK;
> +		if (devctl & TI113X_DCR_IMODE_MASK != TI12XX_DCR_IMODE_ALL_SERIAL) {
> +			printk (KERN_INFO "ti113x: Routing card interrupts to PCI\n");
> +
> +			devctl &= ~TI113X_DCR_IMODE_MASK;
>  
> -		irqmux = config_readl(socket, TI122X_IRQMUX);
> -		irqmux = (irqmux & ~0x0f) | 0x02; /* route INTA */
> -		irqmux = (irqmux & ~0xf0) | 0x20; /* route INTB */
> +			irqmux = config_readl(socket, TI122X_IRQMUX);
> +			irqmux = (irqmux & ~0x0f) | 0x02; /* route INTA */
> +			irqmux = (irqmux & ~0xf0) | 0x20; /* route INTB */
>  
> -		config_writel(socket, TI122X_IRQMUX, irqmux);
> -		config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
> +			config_writel(socket, TI122X_IRQMUX, irqmux);
> +			config_writeb(socket, TI113X_DEVICE_CONTROL, devctl);
> +		}
>  	}
>  
>  	socket->socket.ss_entry->init = ti_init;
> 
> 
> 

Well, the patch fixes things on the ThinkPad, but only by accident, I 
think.

config_readb(socket, TI113X_DEVICE_CONTROL) gives a value of 0x72.

The conditional
if (devctl & TI113X_DCR_IMODE_MASK != TI12XX_DCR_IMODE_ALL_SERIAL)

parses to
if (devctl & (TI113X_DCR_IMODE_MASK != TI12XX_DCR_IMODE_ALL_SERIAL))

which doesn't make much sense, but does stop routing of interupts to PCI 
when devctl == 0x72.

Changing to
if ((devctl & TI113X_DCR_IMODE_MASK) != TI12XX_DCR_IMODE_ALL_SERIAL)

looks more sensible, but doesn't do the right thing, since
TI113X_DCR_IMODE_MASK == 0x06 and
TI12XX_DCR_IMODE_ALL_SERIAL == 0x06

Should the test be
if ((devctl & TI113X_DCR_IMODE_MASK) != TI113X_DCR_IMODE_ISA)

maybe?

Summary:
not routing interrupts to PCI with a 1130, makes things work.
the test for that is wrong in this patch.
value in DCR for 1130 on a Thinkpad 760 is 0x72


HTH


Simon.


From rmk at arm.linux.org.uk  Wed Jul  9 23:41:00 2003
From: rmk at arm.linux.org.uk (Russell King)
Date: Wed Jul  9 22:41:24 2003
Subject: corresponding patches to [RFC]
In-Reply-To: <20030707124720.GD1905@brodo.de>;
	from linux@brodo.de on Mon, Jul 07, 2003 at 02:47:20PM +0200
References: <20030612194751.GA3300@brodo.de>
	<20030706233429.C16820@flint.arm.linux.org.uk>
	<20030707124720.GD1905@brodo.de>
Message-ID: <20030709224100.C22612@flint.arm.linux.org.uk>

On Mon, Jul 07, 2003 at 02:47:20PM +0200, Dominik Brodowski wrote:
> On Sun, Jul 06, 2003 at 11:34:29PM +0100, Russell King wrote:
> > I'm also slightly worried about the lifetime of the pcmcia_bus object.
> > Although bus_unregister() makes it disappear from the sysfs tree, any
> > references to that object and any sub-object will cause other code in
> > the kernel to keep a reference to the pcmcia_bus_type, which gets
> > really messy when the module whose storage it was using has long
> > since gone.
> 
> Any module using pcmcia_bus will increase the refcount of ds.ko. Doesn't
> this solve this problem?

The problem I was worried about (which has now been fixed by a patch via
gregkh) is what happens when you have an attribute "in use" holding
a device in memory, which requires its release function in order to free
it.  Up until this patch, it was possible to remove the module in this
state.  When the last reference is dropped, kernel goes oops because
the release function isn't there anymore.

However, I think this has become a non-issue since GregKH merged the
module use counting for device attributes.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


From mflt1 at micrologica.com.hk  Thu Jul 10 12:27:30 2003
From: mflt1 at micrologica.com.hk (Michael Frank)
Date: Thu Jul 10 04:38:23 2003
Subject: 2.5.74-mm3 yenta-socket oops back
In-Reply-To: <20030706231551.B16820@flint.arm.linux.org.uk>
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<20030706231551.B16820@flint.arm.linux.org.uk>
Message-ID: <200307101127.32590.mflt1@micrologica.com.hk>

2.5.74-mm3 yenta-socket oopsed on the first boot at the same spot. 

I have successfully used both patches below with -mm1.

Regards
Michael

On Monday 07 July 2003 06:15, Russell King wrote:

> michael, can you try this one?

Daniel's patch:

--- 1.50/drivers/pcmcia/cs.c    Mon Jun 30 22:22:30 2003
+++ edited/cs.c Sat Jul  5 23:58:07 2003
@@ -338,13 +338,13 @@
        socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
        INIT_LIST_HEAD(&socket->cis_cache);
        spin_lock_init(&socket->lock);
-
-       init_socket(socket);
-
        init_completion(&socket->thread_done);
        init_waitqueue_head(&socket->thread_wait);
        init_MUTEX(&socket->skt_sem);
        spin_lock_init(&socket->thread_lock);
+
+       init_socket(socket);
+
        ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
        if (ret < 0)
                return ret;

and my patch (may apply with some offset, which I'm about to check
into bk anyway):

--- linux/drivers/pcmcia/cs.c.old       Fri Jul  4 10:21:50 2003
+++ linux/drivers/pcmcia/cs.c   Sun Jul  6 23:04:10 2003
@@ -870,11 +870,13 @@
 
 void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
 {
-       spin_lock(&s->thread_lock);
-       s->thread_events |= events;
-       spin_unlock(&s->thread_lock);
+       if (s->thread) {
+               spin_lock(&s->thread_lock);
+               s->thread_events |= events;
+               spin_unlock(&s->thread_lock);
 
-       wake_up(&s->thread_wait);
+               wake_up(&s->thread_wait);
+       }
 } /* pcmcia_parse_events */

-- 
Powered by linux-2.5.74-mm3. Compiled with gcc-2.95-3 - mature and rock solid

My current linux related activities:
- 2.5 yenta_socket testing
- Test development and testing of swsusp for 2.4/2.5 and ACPI S3 of 2.5 kernel 
- Everyday usage of 2.5 kernel

More info on 2.5 kernel: http://www.codemonkey.org.uk/post-halloween-2.5.txt
More info on swsusp: http://sourceforge.net/projects/swsusp/


From akpm at osdl.org  Wed Jul  9 22:30:10 2003
From: akpm at osdl.org (Andrew Morton)
Date: Thu Jul 10 05:34:56 2003
Subject: 2.5.74-mm3 yenta-socket oops back
In-Reply-To: <200307101127.32590.mflt1@micrologica.com.hk>
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<20030706231551.B16820@flint.arm.linux.org.uk>
	<200307101127.32590.mflt1@micrologica.com.hk>
Message-ID: <20030709213010.1882a898.akpm@osdl.org>

Michael Frank <mflt1@micrologica.com.hk> wrote:
>
> 2.5.74-mm3 yenta-socket oopsed on the first boot at the same spot. 
> 
> I have successfully used both patches below with -mm1.
> 
> --- 1.50/drivers/pcmcia/cs.c    Mon Jun 30 22:22:30 2003
> +++ edited/cs.c Sat Jul  5 23:58:07 2003
> @@ -338,13 +338,13 @@
>         socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
>         INIT_LIST_HEAD(&socket->cis_cache);
>         spin_lock_init(&socket->lock);
> -
> -       init_socket(socket);
> -
>         init_completion(&socket->thread_done);
>         init_waitqueue_head(&socket->thread_wait);
>         init_MUTEX(&socket->skt_sem);
>         spin_lock_init(&socket->thread_lock);
> +
> +       init_socket(socket);
> +
>         ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
>         if (ret < 0)
>                 return ret;
> 

This one is clearly correct.

> and my patch (may apply with some offset, which I'm about to check
> into bk anyway):
> 
> --- linux/drivers/pcmcia/cs.c.old       Fri Jul  4 10:21:50 2003
> +++ linux/drivers/pcmcia/cs.c   Sun Jul  6 23:04:10 2003
> @@ -870,11 +870,13 @@
>  
>  void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
>  {
> -       spin_lock(&s->thread_lock);
> -       s->thread_events |= events;
> -       spin_unlock(&s->thread_lock);
> +       if (s->thread) {
> +               spin_lock(&s->thread_lock);
> +               s->thread_events |= events;
> +               spin_unlock(&s->thread_lock);
>  
> -       wake_up(&s->thread_wait);
> +               wake_up(&s->thread_wait);
> +       }
>  } /* pcmcia_parse_events */

This one may not be.  How did we get here with no thread to handle the
event?  Do you have an oops trace on this one?

Or just stick a

	if (!s->thread)
		dump_stack();

in there as well.


From mflt1 at micrologica.com.hk  Thu Jul 10 16:09:03 2003
From: mflt1 at micrologica.com.hk (Michael Frank)
Date: Thu Jul 10 08:17:51 2003
Subject: 2.5.74-mm3 yenta-socket oops back
In-Reply-To: <20030709213010.1882a898.akpm@osdl.org>
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<200307101127.32590.mflt1@micrologica.com.hk>
	<20030709213010.1882a898.akpm@osdl.org>
Message-ID: <200307101448.58180.mflt1@micrologica.com.hk>

On Thursday 10 July 2003 12:30, Andrew Morton wrote:
> Michael Frank <mflt1@micrologica.com.hk> wrote:
> > 2.5.74-mm3 yenta-socket oopsed on the first boot at the same spot.
> >
> > I have successfully used both patches below with -mm1.
> >
> > --- 1.50/drivers/pcmcia/cs.c    Mon Jun 30 22:22:30 2003
> > +++ edited/cs.c Sat Jul  5 23:58:07 2003
> > @@ -338,13 +338,13 @@
> >         socket->erase_busy.next = socket->erase_busy.prev =
> > &socket->erase_busy; INIT_LIST_HEAD(&socket->cis_cache);
> >         spin_lock_init(&socket->lock);
> > -
> > -       init_socket(socket);
> > -
> >         init_completion(&socket->thread_done);
> >         init_waitqueue_head(&socket->thread_wait);
> >         init_MUTEX(&socket->skt_sem);
> >         spin_lock_init(&socket->thread_lock);
> > +
> > +       init_socket(socket);
> > +
> >         ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
> >         if (ret < 0)
> >                 return ret;
>
> This one is clearly correct.
>
> > and my patch (may apply with some offset, which I'm about to check
> > into bk anyway):
> >
> > --- linux/drivers/pcmcia/cs.c.old       Fri Jul  4 10:21:50 2003
> > +++ linux/drivers/pcmcia/cs.c   Sun Jul  6 23:04:10 2003
> > @@ -870,11 +870,13 @@
> >
> >  void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
> >  {
> > -       spin_lock(&s->thread_lock);
> > -       s->thread_events |= events;
> > -       spin_unlock(&s->thread_lock);
> > +       if (s->thread) {
> > +               spin_lock(&s->thread_lock);
> > +               s->thread_events |= events;
> > +               spin_unlock(&s->thread_lock);
> >
> > -       wake_up(&s->thread_wait);
> > +               wake_up(&s->thread_wait);
> > +       }
> >  } /* pcmcia_parse_events */
>
> This one may not be.  How did we get here with no thread to handle the
> event?  Do you have an oops trace on this one?
>

Is called from interrupt handler. Seems that events occur before the 
thread is created.

No serial port, Oops taken from screen 
unable to handle null pointer dereference at 0
oops: 0000 #1
EFLAGS 00010086
EIP is at __wake_up_common+0x13
eax ce09c9c0 ebx 286 ecx 1 edx 0
esi 1 edi 0 ebp ccc67dcc esp ccc67dc0
ds 7b es 7b ss 68
Process modprobe pid 1153 threadinfo ccc66000 task cd68e080
Stack: 286 4000001 0 ccc67de8 c011afa1 ce09c9c0 3 1 
       0 ce09c800 ccc67df0 cf8a3ecf cccc67e04 cf87a7ea ce09c830 80
       cdffec00 ccc67e24 c010d0aa 5 ce09c800 ccc67e50 280 5
Call trace:
__wake_up+0x11
pcmcia_parse_events+0x23
yenta_interrupt+0x26
handle_IRQ_event+0x2a
do_IRQ+0x82
common_interrupt+0x18
setup_irq+0x9b
yenta_interrupt+0x0
request_irq+0x89
yenta_probe+0x137
yenta_interrupt+0x0
pci_device_probe_static+0x20
pci_device_probe+0x21
bus_match+0x38
driver_attach+0x3e
bus_add_driver+0x6e
driver_register+0x36
pci_register_driver+0x6a
yenta_socket_init+0xd
sys_init_module+0xe0
syscall_call+0x7
Code: 8b 3a 8b 45 08 83 c0 04 39 c2 74 23 8b 5a f4 8b 4d 14 51 8b
 <0> Fatal exception in interrupt
In interrupt handler - not syncing


> Or just stick a
>
> 	if (!s->thread)
> 		dump_stack();
>
> in there as well.

Applied rmk's patch and the above to -mm3 and send the stack trace once obtained.

Regards
Michael 


-- 
Powered by linux-2.5.74-mm3. Compiled with gcc-2.95-3 - mature and rock solid

My current linux related activities:
- 2.5 yenta_socket testing
- Test development and testing of swsusp for 2.4/2.5 and ACPI S3 of 2.5 kernel 
- Everyday usage of 2.5 kernel

More info on 2.5 kernel: http://www.codemonkey.org.uk/post-halloween-2.5.txt
More info on swsusp: http://sourceforge.net/projects/swsusp/


From mflt1 at micrologica.com.hk  Thu Jul 10 16:09:03 2003
From: mflt1 at micrologica.com.hk (Michael Frank)
Date: Thu Jul 10 08:20:45 2003
Subject: 2.5.74-mm3 yenta-socket oops back
In-Reply-To: <20030709213010.1882a898.akpm@osdl.org>
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<200307101127.32590.mflt1@micrologica.com.hk>
	<20030709213010.1882a898.akpm@osdl.org>
Message-ID: <200307101448.58180.mflt1@micrologica.com.hk>

On Thursday 10 July 2003 12:30, Andrew Morton wrote:
> Michael Frank <mflt1@micrologica.com.hk> wrote:
> > 2.5.74-mm3 yenta-socket oopsed on the first boot at the same spot.
> >
> > I have successfully used both patches below with -mm1.
> >
> > --- 1.50/drivers/pcmcia/cs.c    Mon Jun 30 22:22:30 2003
> > +++ edited/cs.c Sat Jul  5 23:58:07 2003
> > @@ -338,13 +338,13 @@
> >         socket->erase_busy.next = socket->erase_busy.prev =
> > &socket->erase_busy; INIT_LIST_HEAD(&socket->cis_cache);
> >         spin_lock_init(&socket->lock);
> > -
> > -       init_socket(socket);
> > -
> >         init_completion(&socket->thread_done);
> >         init_waitqueue_head(&socket->thread_wait);
> >         init_MUTEX(&socket->skt_sem);
> >         spin_lock_init(&socket->thread_lock);
> > +
> > +       init_socket(socket);
> > +
> >         ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
> >         if (ret < 0)
> >                 return ret;
>
> This one is clearly correct.
>
> > and my patch (may apply with some offset, which I'm about to check
> > into bk anyway):
> >
> > --- linux/drivers/pcmcia/cs.c.old       Fri Jul  4 10:21:50 2003
> > +++ linux/drivers/pcmcia/cs.c   Sun Jul  6 23:04:10 2003
> > @@ -870,11 +870,13 @@
> >
> >  void pcmcia_parse_events(struct pcmcia_socket *s, u_int events)
> >  {
> > -       spin_lock(&s->thread_lock);
> > -       s->thread_events |= events;
> > -       spin_unlock(&s->thread_lock);
> > +       if (s->thread) {
> > +               spin_lock(&s->thread_lock);
> > +               s->thread_events |= events;
> > +               spin_unlock(&s->thread_lock);
> >
> > -       wake_up(&s->thread_wait);
> > +               wake_up(&s->thread_wait);
> > +       }
> >  } /* pcmcia_parse_events */
>
> This one may not be.  How did we get here with no thread to handle the
> event?  Do you have an oops trace on this one?
>

Is called from interrupt handler. Seems that events occur before the 
thread is created.

No serial port, Oops taken from screen 
unable to handle null pointer dereference at 0
oops: 0000 #1
EFLAGS 00010086
EIP is at __wake_up_common+0x13
eax ce09c9c0 ebx 286 ecx 1 edx 0
esi 1 edi 0 ebp ccc67dcc esp ccc67dc0
ds 7b es 7b ss 68
Process modprobe pid 1153 threadinfo ccc66000 task cd68e080
Stack: 286 4000001 0 ccc67de8 c011afa1 ce09c9c0 3 1 
       0 ce09c800 ccc67df0 cf8a3ecf cccc67e04 cf87a7ea ce09c830 80
       cdffec00 ccc67e24 c010d0aa 5 ce09c800 ccc67e50 280 5
Call trace:
__wake_up+0x11
pcmcia_parse_events+0x23
yenta_interrupt+0x26
handle_IRQ_event+0x2a
do_IRQ+0x82
common_interrupt+0x18
setup_irq+0x9b
yenta_interrupt+0x0
request_irq+0x89
yenta_probe+0x137
yenta_interrupt+0x0
pci_device_probe_static+0x20
pci_device_probe+0x21
bus_match+0x38
driver_attach+0x3e
bus_add_driver+0x6e
driver_register+0x36
pci_register_driver+0x6a
yenta_socket_init+0xd
sys_init_module+0xe0
syscall_call+0x7
Code: 8b 3a 8b 45 08 83 c0 04 39 c2 74 23 8b 5a f4 8b 4d 14 51 8b
 <0> Fatal exception in interrupt
In interrupt handler - not syncing


> Or just stick a
>
> 	if (!s->thread)
> 		dump_stack();
>
> in there as well.

Applied rmk's patch and the above to -mm3 and send the stack trace once obtained.

Regards
Michael 


-- 
Powered by linux-2.5.74-mm3. Compiled with gcc-2.95-3 - mature and rock solid

My current linux related activities:
- 2.5 yenta_socket testing
- Test development and testing of swsusp for 2.4/2.5 and ACPI S3 of 2.5 kernel 
- Everyday usage of 2.5 kernel

More info on 2.5 kernel: http://www.codemonkey.org.uk/post-halloween-2.5.txt
More info on swsusp: http://sourceforge.net/projects/swsusp/


From akpm at osdl.org  Thu Jul 10 01:56:10 2003
From: akpm at osdl.org (Andrew Morton)
Date: Thu Jul 10 09:01:30 2003
Subject: 2.5.74-mm3 yenta-socket oops back
In-Reply-To: <200307101448.58180.mflt1@micrologica.com.hk>
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<200307101127.32590.mflt1@micrologica.com.hk>
	<20030709213010.1882a898.akpm@osdl.org>
	<200307101448.58180.mflt1@micrologica.com.hk>
Message-ID: <20030710005610.62dfa7ef.akpm@osdl.org>

Michael Frank <mflt1@micrologica.com.hk> wrote:
>
> Is called from interrupt handler. Seems that events occur before the 
>  thread is created.

OK, fair enough.  The interrupt probe happens before the socket
registration.   It needs a /* comment */



From rmk at arm.linux.org.uk  Thu Jul 10 12:08:56 2003
From: rmk at arm.linux.org.uk (Russell King)
Date: Thu Jul 10 11:08:50 2003
Subject: 2.5.74-mm3 yenta-socket oops back
In-Reply-To: <20030709213010.1882a898.akpm@osdl.org>;
	from akpm@osdl.org on Wed, Jul 09, 2003 at 09:30:10PM -0700
References: <200307060039.34263.daniel.ritz@gmx.ch>
	<20030706231551.B16820@flint.arm.linux.org.uk>
	<200307101127.32590.mflt1@micrologica.com.hk>
	<20030709213010.1882a898.akpm@osdl.org>
Message-ID: <20030710110856.A1074@flint.arm.linux.org.uk>

On Wed, Jul 09, 2003 at 09:30:10PM -0700, Andrew Morton wrote:
> This one may not be.  How did we get here with no thread to handle the
> event?  Do you have an oops trace on this one?

It's correct.  Had the fan in my server not died last night, I'd have
gotten some of these fixes to Linus.  God how I hate anything with fans
in.  They're the number one cause of failure.

The problem is that the interrupts are claimed before pcmcia has been
properly initialised, so the cs.c-private bits of pcmcia_socket aren't
setup.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


From linux at brodo.de  Thu Jul 10 16:36:38 2003
From: linux at brodo.de (linux@brodo.de)
Date: Thu Jul 10 14:37:00 2003
Subject: PCMCIA can't be probed during kernel loading????
Message-ID: <20030710133638.725B7838C@voodoo.strato-webmail.de>


> On Wed, Jul 09, 2003 at 08:06:48PM -0700, Yang Yang wrote:
> > 	I mean should the kernel be able to find the card itself and set it
> > 	up , or does it need some user application ( like cardmgr ) to do it
> > 	?
>
> Correct.

At least for the moment, yes. But I'm trying to change that for 2.5. or
2.6. or 2.7. Some userspace input will still be needed for most setups,
though.

> >	if it's the latter case, basically means it's impossible to run a
> > 	diskless station over NFS with only PCMCIA network card?
> 
> Also correct.  However, you could use an initial ramdisk and load
cardmgr
> from there, configure the interface and mount the real root filesystem
> that way.

Currently, yes. Nonetheless it should become possible soon. Yang, are you
willing to test 2.5. patches? If so, please send me a lspci -vv of the
Dell inspiron.

Many thanks,
  Dominik

From rmk at arm.linux.org.uk  Thu Jul 10 15:44:05 2003
From: rmk at arm.linux.org.uk (Russell King)
Date: Thu Jul 10 14:43:58 2003
Subject: PCMCIA can't be probed during kernel loading????
In-Reply-To: <20030710133638.725B7838C@voodoo.strato-webmail.de>;
	from linux@brodo.de on Thu, Jul 10, 2003 at 03:36:38PM +0200
References: <20030710133638.725B7838C@voodoo.strato-webmail.de>
Message-ID: <20030710144405.A7976@flint.arm.linux.org.uk>

On Thu, Jul 10, 2003 at 03:36:38PM +0200, linux@brodo.de wrote:
> Currently, yes. Nonetheless it should become possible soon. Yang, are you
> willing to test 2.5. patches? If so, please send me a lspci -vv of the
> Dell inspiron.

lspci doesn't help you to find the regions that pcmcia shouldn't use.

Based upon discussion I've had with Arjan, the only thing that tells
you seems to be experience and quirk lists.

Apparantly, the Red Hat installer has such a list of currently known
SMI ports and other quirks, and builds a custom configuration for
cardmgr at installation based upon the hardware it discovers in the
machine.

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


From linux at brodo.de  Thu Jul 10 17:10:15 2003
From: linux at brodo.de (linux@brodo.de)
Date: Thu Jul 10 15:10:41 2003
Subject: AW: PCMCIA can't be probed during kernel loading????
Message-ID: <20030710141015.834CD86E1@voodoo.strato-webmail.de>

> On Thu, Jul 10, 2003 at 03:36:38PM +0200, linux@brodo.de wrote:
> > Currently, yes. Nonetheless it should become possible soon. Yang, are
you
> > willing to test 2.5. patches? If so, please send me a lspci -vv of
the
> > Dell inspiron.
> 
> lspci doesn't help you to find the regions that pcmcia shouldn't use.

Not what regions pcmcia shouldn't use, but what pcmcia may use -- the I/O
and memory behind the PCI-PCI bridge found in recent ICH-M chipsets [as
long as the NO_ISA flag is set]
 
> Based upon discussion I've had with Arjan, the only thing that tells
> you seems to be experience and quirk lists.

Well, for certain cases [like this one] -- a "standard" PCMCIA card on a
probably mostly legacy-free notebook -- there should be a
config/boot/module parameter which allows the resources to be used even
though userspace hasn't told the kernel anything yet. Of course, some
regions might not be free -- but the "standard" eth0/eth1 range might be.

> Apparantly, the Red Hat installer has such a list of currently known
> SMI ports and other quirks, and builds a custom configuration for
> cardmgr at installation based upon the hardware it discovers in the
> machine.
Is this installer open-source? If so, does anybody know where I can grab
the sources?

    Dominik

From linux at brodo.de  Fri Jul 11 15:03:54 2003
From: linux at brodo.de (Dominik Brodowski)
Date: Fri Jul 11 13:11:14 2003
Subject: PCMCIA development and 2.6-test
Message-ID: <20030711120354.GA1880@brodo.de>

Hi all,

So, finally, Linus decided to switch to 2.6-test. What does this mean for
us? Here's my suggestion:

a) don't do anything wrt in-kernel matching, hotplug etc. It's too invasive
for a soon-to-become-stable series. With a few exceptions and a few cleanups
[most notably the register/unregister process] any out-of-tree 2.4. pcmcia
driver should work with 2.6. too.

b) continue the improvment of the socket handling, especially the socket
resource handling. This includes the "turn rsrc_mgr on its head" patch, a
mapstatic.c / mapwindow.c split-up, and some other work.

c) give me a chainsaw for 2.7. so that cardmgr can die, pcmcia and cardbus
can be seperated even more, #typedef's are removed, CodingStyle is adhered.

The consequences:

1) Russell, please revert the license-patch currently in linux-2.5-pcmcia-BK.
Due to a) it's not needed at the moment.

2) Please push the "ss_entry to ops" and the "don't hide calls to socket
drivers" anyway.

	Dominik




From willy at debian.org  Fri Jul 11 14:26:32 2003
From: willy at debian.org (Matthew Wilcox)
Date: Fri Jul 11 13:26:27 2003
Subject: PCMCIA development and 2.6-test
In-Reply-To: <20030711120354.GA1880@brodo.de>
References: <20030711120354.GA1880@brodo.de>
Message-ID: <20030711122632.GV1939@parcelfarce.linux.theplanet.co.uk>

On Fri, Jul 11, 2003 at 02:03:54PM +0200, Dominik Brodowski wrote:
> Hi all,
> 
> So, finally, Linus decided to switch to 2.6-test. What does this mean for
> us? Here's my suggestion:

That depends what 2.6-test really means.  I went and looked at the
archives for 2.3 development; 2.3.99-test1 was March 2000.  2.4.0 was
January 2001.  And remember that incompatible breaking changes continued
to go into 2.4 until at least 2.4.8.  I really hope it doesn't take that
long this time, but who knows.

I think we need to not break any drivers from this point onwards.
The core can still get whatever cleanups you like.  And if we get cardmgr
obsoleted in 2.6.3, so be it ;-)

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

From proski at gnu.org  Fri Jul 11 18:28:33 2003
From: proski at gnu.org (Pavel Roskin)
Date: Fri Jul 11 22:28:26 2003
Subject: AW: PCMCIA can't be probed during kernel loading????
In-Reply-To: <20030710141015.834CD86E1@voodoo.strato-webmail.de>
References: <20030710141015.834CD86E1@voodoo.strato-webmail.de>
Message-ID: <Pine.LNX.4.56.0307111704550.2176@marabou.research.att.com>

On Thu, 10 Jul 2003 linux@brodo.de wrote:

> > Apparantly, the Red Hat installer has such a list of currently known
> > SMI ports and other quirks, and builds a custom configuration for
> > cardmgr at installation based upon the hardware it discovers in the
> > machine.
> Is this installer open-source? If so, does anybody know where I can grab
> the sources?

It should be open source.  I think it's Anaconda, and it's available in
the source form e.g. here:
ftp://ftp.rutgers.edu/pub/redhat/linux/rawhide/SRPMS/SRPMS/anaconda-9.0.90-3.20030514173933.src.rpm

Check the files loader2/pcmcia.c and loader2/pcmciatest.c - it seems to be
a reimplementation of cardmgr.

As I understand the code, function detectHardware() in pcmciatest.c loads
modules for the devices that can potentially interfere with PCMCIA.  I
don't see any other resource management beyond that.

-- 
Regards,
Pavel Roskin

From proski at gnu.org  Fri Jul 11 18:49:04 2003
From: proski at gnu.org (Pavel Roskin)
Date: Fri Jul 11 22:48:58 2003
Subject: PCMCIA development and 2.6-test
In-Reply-To: <20030711120354.GA1880@brodo.de>
References: <20030711120354.GA1880@brodo.de>
Message-ID: <Pine.LNX.4.56.0307111732430.3095@marabou.research.att.com>

On Fri, 11 Jul 2003, Dominik Brodowski wrote:

> So, finally, Linus decided to switch to 2.6-test. What does this mean for
> us? Here's my suggestion:
>
> a) don't do anything wrt in-kernel matching, hotplug etc. It's too invasive
> for a soon-to-become-stable series. With a few exceptions and a few cleanups
> [most notably the register/unregister process] any out-of-tree 2.4. pcmcia
> driver should work with 2.6. too.

I agree with that, but it would be pity to stop exploring this approach in
the meantime.  Maybe we could have a CVS repository with the experimental
code?  I can help with makefiles to make it possible to build the new
PCMCIA modules straight from the CVS working directory.

I often want to test the patches that you post here, but I don't have time
to patch the kernel and then remember to remove those patches.  Having a
separate PCMCIA directory on CVS would encourage more testing.

Also, we could try eliminating hotplug in CVS and then if we may find
something that can be put safely to the 2.6 kernels to simplify changes in
2.7 kernels.  I mean, if there is something that every client driver
should do for hotplug support, it's better to require it now and have a
chance not to require any updates in the client drivers in 2.7 kernels.

In particular, it may be necessary for every driver to provide a unique ID
for every device so that different hotplug actions could be associated
with e.g. two network cards with different MAC addresses.

> b) continue the improvment of the socket handling, especially the socket
> resource handling. This includes the "turn rsrc_mgr on its head" patch, a
> mapstatic.c / mapwindow.c split-up, and some other work.

I think if client drivers are not affected, it should be OK, even if every
socket driver needs to be rewritten.  However, it would be nice to stop it
after 2.6.0 release if possible.

> c) give me a chainsaw for 2.7. so that cardmgr can die, pcmcia and cardbus
> can be seperated even more, #typedef's are removed, CodingStyle is adhered.

I think that most trivial changes should be allowed until 2.6.0 if they
are safe.  Replacing typedefs is trivial, in the sense that the
probability of breaking things accidentally is low.  Of course, if that
breaks client drivers, we should think twice and probably wait until 2.7
kernels.

Coding style can also be changed safely.

-- 
Regards,
Pavel Roskin

From proski at gnu.org  Fri Jul 11 22:30:08 2003
From: proski at gnu.org (Pavel Roskin)
Date: Sat Jul 12 02:30:02 2003
Subject: 2.5.75-bk1: oops on removing yenta_socket
Message-ID: <Pine.LNX.4.56.0307112117360.4252@marabou.research.att.com>

Hello!

I'm getting a kernel oops when I remove yenta_socket.  It's important to
load the "ds" module first.  The exact sequence to reproduce the problem:

modprobe ds
modprobe yenta_socket
rmmod yenta_socket

Initial debugging shows that the argument to pcmcia_deregister_client() is
invalid.  "handle" is not NULL, but handle->client_magic cannot be
accessed.

There is one TI socket but no card in it.  Linux 2.5.75-bk1 with modular
PCMCIA.  No other modules are loaded.

-------------------------------------------------------------
Unable to handle kernel paging request at virtual address cb3d3004
 printing eip:
d0843b52
*pde = 0002b067
*pte = 0b3d3000
Oops: 0000 [#1]
CPU:    0
EIP:    0060:[<d0843b52>]    Not tainted
EFLAGS: 00010282
EIP is at pcmcia_deregister_client+0x32/0x170 [pcmcia_core]
eax: 00000012   ebx: cb3d3004   ecx: 00000000   edx: c02ca2f8
esi: cb3cd1c4   edi: d084b720   ebp: cb3c1e40   esp: cb3c1e2c
ds: 007b   es: 007b   ss: 0068
Process rmmod (pid: 663, threadinfo=cb3c0000 task=cca7a000)
Stack: d0847089 cb3d3004 cb3cd030 cb3cd1c4 d084b720 cb3c1e50 d0832399
cb3d3004
       d08338b8 cb3c1e74 c01fb616 cb3cd1c4 00000042 d084b77c d084b768
cb3cd1c4
       cb3cd168 cb3cd030 cb3c1e84 c01fb634 cb3cd1c4 d084b704 cb3c1eb0
d0842aea
Call Trace:
 [<d0832399>] pcmcia_bus_remove_socket+0x39/0x60 [ds]
 [<c01fb616>] class_device_del+0xd6/0xe0
 [<c01fb634>] class_device_unregister+0x14/0x30
 [<d0842aea>] pcmcia_unregister_socket+0x4a/0xc0 [pcmcia_core]
 [<c01765e2>] sysfs_get_dentry+0x62/0x70
 [<d08366ef>] yenta_close+0x1f/0xb0 [yenta_socket]
 [<c01a583b>] pci_device_remove+0x3b/0x40
 [<c01fa7ee>] device_release_driver+0x5e/0x60
 [<c01fa81b>] driver_detach+0x2b/0x40
 [<c01faae7>] bus_remove_driver+0x57/0x90
 [<c01faf1a>] driver_unregister+0x1a/0x44
 [<c01a5ac7>] pci_unregister_driver+0x17/0x30
 [<d0837102>] yenta_socket_exit+0x12/0x16 [yenta_socket]
 [<c012c861>] sys_delete_module+0x151/0x1b0
 [<c013fa77>] sys_munmap+0x57/0x80
 [<c010930f>] syscall_call+0x7/0xb

-- 
Regards,
Pavel Roskin

From hch at lst.de  Thu Jul 24 11:58:39 2003
From: hch at lst.de (Christoph Hellwig)
Date: Thu Jul 24 09:58:47 2003
Subject: [PATCH] remove the release timer from all pcmcia net drivers
Message-ID: <20030724085839.GA9748@lst.de>

The release timer in the pcmcia drivers is not needed at all and
only causes potential problems when the functions called from
it aren't safe for timer context.  This patch kills it in all
pcmcia network driver similar to the 2.4 scsi patch I just forward
ported to 2.5.  Other pcmcia drivers will follow soon.


--- 1.19/drivers/net/pcmcia/3c574_cs.c	Mon Jun 30 23:42:46 2003
+++ edited/drivers/net/pcmcia/3c574_cs.c	Wed Jul 23 12:27:44 2003
@@ -232,7 +232,7 @@
 /* Index of functions. */
 
 static void tc574_config(dev_link_t *link);
-static void tc574_release(unsigned long arg);
+static void tc574_release(dev_link_t *link);
 static int tc574_event(event_t event, int priority,
 					   event_callback_args_t *args);
 
@@ -296,10 +296,6 @@
 	lp = dev->priv;
 	link = &lp->link;
 	link->priv = dev;
-	
-	init_timer(&link->release);
-	link->release.function = &tc574_release;
-	link->release.data = (unsigned long)link;
 	link->io.NumPorts1 = 32;
 	link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
 	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
@@ -373,9 +369,8 @@
 	if (*linkp == NULL)
 	return;
 
-	del_timer_sync(&link->release);
 	if (link->state & DEV_CONFIG) {
-		tc574_release((unsigned long)link);
+		tc574_release(link);
 		if (link->state & DEV_STALE_CONFIG) {
 			link->state |= DEV_STALE_LINK;
 			return;
@@ -554,7 +549,7 @@
 cs_failed:
 	cs_error(link->handle, last_fn, last_ret);
 failed:
-	tc574_release((unsigned long)link);
+	tc574_release(link);
 	return;
 
 } /* tc574_config */
@@ -565,10 +560,8 @@
 	still open, this will be postponed until it is closed.
 */
 
-static void tc574_release(unsigned long arg)
+static void tc574_release(dev_link_t *link)
 {
-	dev_link_t *link = (dev_link_t *)arg;
-
 	DEBUG(0, "3c574_release(0x%p)\n", link);
 
 	if (link->open) {
@@ -606,7 +599,7 @@
 		link->state &= ~DEV_PRESENT;
 		if (link->state & DEV_CONFIG) {
 			netif_device_detach(dev);
-			mod_timer(&link->release, jiffies + HZ/20);
+			tc574_release(link);
 		}
 		break;
 	case CS_EVENT_CARD_INSERTION:
@@ -1322,7 +1315,7 @@
 	netif_stop_queue(dev);
 	del_timer_sync(&lp->media);
 	if (link->state & DEV_STALE_CONFIG)
-		mod_timer(&link->release, jiffies + HZ/20);
+		tc574_release(link);
 	return 0;
 }
 
===== drivers/net/pcmcia/3c589_cs.c 1.19 vs edited =====
--- 1.19/drivers/net/pcmcia/3c589_cs.c	Mon Jun 30 23:43:04 2003
+++ edited/drivers/net/pcmcia/3c589_cs.c	Wed Jul 23 12:27:44 2003
@@ -148,7 +148,7 @@
 /*====================================================================*/
 
 static void tc589_config(dev_link_t *link);
-static void tc589_release(unsigned long arg);
+static void tc589_release(dev_link_t *link);
 static int tc589_event(event_t event, int priority,
 		       event_callback_args_t *args);
 
@@ -220,9 +220,6 @@
     link->priv = dev;
 
     spin_lock_init(&lp->lock);
-    init_timer(&link->release);
-    link->release.function = &tc589_release;
-    link->release.data = (unsigned long)link;
     link->io.NumPorts1 = 16;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
     link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
@@ -298,9 +295,8 @@
     if (*linkp == NULL)
 	return;
 
-    del_timer_sync(&link->release);
     if (link->state & DEV_CONFIG) {
-	tc589_release((unsigned long)link);
+	tc589_release(link);
 	if (link->state & DEV_STALE_CONFIG) {
 	    link->state |= DEV_STALE_LINK;
 	    return;
@@ -439,7 +435,7 @@
 cs_failed:
     cs_error(link->handle, last_fn, last_ret);
 failed:
-    tc589_release((unsigned long)link);
+    tc589_release(link);
     return;
     
 } /* tc589_config */
@@ -452,10 +448,8 @@
     
 ======================================================================*/
 
-static void tc589_release(unsigned long arg)
+static void tc589_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *)arg;
-
     DEBUG(0, "3c589_release(0x%p)\n", link);
     
     if (link->open) {
@@ -495,7 +489,7 @@
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
 	    netif_device_detach(dev);
-	    mod_timer(&link->release, jiffies + HZ/20);
+	    tc589_release(link);
 	}
 	break;
     case CS_EVENT_CARD_INSERTION:
@@ -1137,7 +1131,7 @@
     netif_stop_queue(dev);
     del_timer_sync(&lp->media);
     if (link->state & DEV_STALE_CONFIG)
-	mod_timer(&link->release, jiffies + HZ/20);
+	     tc589_release(link);
     
     return 0;
 }
===== drivers/net/pcmcia/axnet_cs.c 1.14 vs edited =====
--- 1.14/drivers/net/pcmcia/axnet_cs.c	Fri Jul 11 16:21:39 2003
+++ edited/drivers/net/pcmcia/axnet_cs.c	Wed Jul 23 12:27:44 2003
@@ -92,7 +92,7 @@
 /*====================================================================*/
 
 static void axnet_config(dev_link_t *link);
-static void axnet_release(u_long arg);
+static void axnet_release(dev_link_t *link);
 static int axnet_event(event_t event, int priority,
 		       event_callback_args_t *args);
 static int axnet_open(struct net_device *dev);
@@ -194,10 +194,6 @@
     memset(info, 0, sizeof(*info));
     link = &info->link; dev = &info->dev;
     link->priv = info;
-    
-    init_timer(&link->release);
-    link->release.function = &axnet_release;
-    link->release.data = (u_long)link;
     link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
     link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
     if (irq_list[0] == -1)
@@ -258,9 +254,8 @@
     if (*linkp == NULL)
 	return;
 
-    del_timer_sync(&link->release);
     if (link->state & DEV_CONFIG) {
-	axnet_release((u_long)link);
+	axnet_release(link);
 	if (link->state & DEV_STALE_CONFIG) {
 	    link->state |= DEV_STALE_LINK;
 	    return;
@@ -518,7 +513,7 @@
 cs_failed:
     cs_error(link->handle, last_fn, last_ret);
 failed:
-    axnet_release((u_long)link);
+    axnet_release(link);
     link->state &= ~DEV_CONFIG_PENDING;
     return;
 } /* axnet_config */
@@ -531,10 +526,8 @@
 
 ======================================================================*/
 
-static void axnet_release(u_long arg)
+static void axnet_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *)arg;
-
     DEBUG(0, "axnet_release(0x%p)\n", link);
 
     if (link->open) {
@@ -574,7 +567,7 @@
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
 	    netif_device_detach(&info->dev);
-	    mod_timer(&link->release, jiffies + HZ/20);
+	    axnet_release(link);
 	}
 	break;
     case CS_EVENT_CARD_INSERTION:
@@ -708,7 +701,7 @@
     netif_stop_queue(dev);
     del_timer_sync(&info->watchdog);
     if (link->state & DEV_STALE_CONFIG)
-	mod_timer(&link->release, jiffies + HZ/20);
+	axnet_release(link);
 
     return 0;
 } /* axnet_close */
===== drivers/net/pcmcia/com20020_cs.c 1.8 vs edited =====
--- 1.8/drivers/net/pcmcia/com20020_cs.c	Wed Apr 30 00:46:18 2003
+++ edited/drivers/net/pcmcia/com20020_cs.c	Wed Jul 23 12:27:44 2003
@@ -126,7 +126,7 @@
 /*====================================================================*/
 
 static void com20020_config(dev_link_t *link);
-static void com20020_release(u_long arg);
+static void com20020_release(dev_link_t *link);
 static int com20020_event(event_t event, int priority,
                        event_callback_args_t *args);
 
@@ -213,9 +213,6 @@
     memset(link, 0, sizeof(struct dev_link_t));
     dev->priv = lp;
 
-    init_timer(&link->release);
-    link->release.function = &com20020_release;
-    link->release.data = (u_long)link;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
     link->io.NumPorts1 = 16;
     link->io.IOAddrLines = 16;
@@ -300,7 +297,7 @@
     dev = info->dev;
 
     if (link->state & DEV_CONFIG) {
-        com20020_release((u_long)link);
+        com20020_release(link);
         if (link->state & DEV_STALE_CONFIG) {
             link->state |= DEV_STALE_LINK;
             return;
@@ -464,7 +461,7 @@
     cs_error(link->handle, last_fn, last_ret);
 failed:
     DEBUG(1,"com20020_config failed...\n");
-    com20020_release((u_long)link);
+    com20020_release(link);
 } /* com20020_config */
 
 /*======================================================================
@@ -475,9 +472,8 @@
 
 ======================================================================*/
 
-static void com20020_release(u_long arg)
+static void com20020_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *)arg;
 
     DEBUG(1,"release...\n");
 
@@ -521,9 +517,7 @@
         link->state &= ~DEV_PRESENT;
         if (link->state & DEV_CONFIG) {
             netif_device_detach(dev);
-            link->release.expires = jiffies + HZ/20;
             link->state |= DEV_RELEASE_PENDING;
-            add_timer(&link->release);
         }
         break;
     case CS_EVENT_CARD_INSERTION:
===== drivers/net/pcmcia/fmvj18x_cs.c 1.22 vs edited =====
--- 1.22/drivers/net/pcmcia/fmvj18x_cs.c	Tue Jun 24 22:24:32 2003
+++ edited/drivers/net/pcmcia/fmvj18x_cs.c	Wed Jul 23 12:27:44 2003
@@ -94,7 +94,7 @@
 static void fmvj18x_config(dev_link_t *link);
 static int fmvj18x_get_hwinfo(dev_link_t *link, u_char *node_id);
 static int fmvj18x_setup_mfc(dev_link_t *link);
-static void fmvj18x_release(u_long arg);
+static void fmvj18x_release(dev_link_t *link);
 static int fmvj18x_event(event_t event, int priority,
 			  event_callback_args_t *args);
 static dev_link_t *fmvj18x_attach(void);
@@ -279,10 +279,6 @@
     link = &lp->link;
     link->priv = dev;
 
-    init_timer(&link->release);
-    link->release.function = &fmvj18x_release;
-    link->release.data = (u_long)link;
-
     /* The io structure describes IO port mapping */
     link->io.NumPorts1 = 32;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
@@ -355,9 +351,8 @@
     if (*linkp == NULL)
 	return;
 
-    del_timer_sync(&link->release);
     if (link->state & DEV_CONFIG) {
-	fmvj18x_release((u_long)link);
+	fmvj18x_release(link);
 	if (link->state & DEV_STALE_CONFIG) {
 	    link->state |= DEV_STALE_LINK;
 	    return;
@@ -638,7 +633,7 @@
     /* All Card Services errors end up here */
     cs_error(link->handle, last_fn, last_ret);
 failed:
-    fmvj18x_release((u_long)link);
+    fmvj18x_release(link);
     link->state &= ~DEV_CONFIG_PENDING;
 
 } /* fmvj18x_config */
@@ -742,9 +737,8 @@
 }
 /*====================================================================*/
 
-static void fmvj18x_release(u_long arg)
+static void fmvj18x_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *)arg;
 
     DEBUG(0, "fmvj18x_release(0x%p)\n", link);
 
@@ -784,7 +778,7 @@
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
 	    netif_device_detach(dev);
-	    mod_timer(&link->release, jiffies + HZ/20);
+	    fmvj18x_release(link);
 	}
 	break;
     case CS_EVENT_CARD_INSERTION:
@@ -1306,7 +1300,7 @@
 
     link->open--;
     if (link->state & DEV_STALE_CONFIG)
-	mod_timer(&link->release, jiffies + HZ/20);
+	    fmvj18x_release(link);
 
     return 0;
 } /* fjn_close */
===== drivers/net/pcmcia/ibmtr_cs.c 1.15 vs edited =====
--- 1.15/drivers/net/pcmcia/ibmtr_cs.c	Fri Jul 11 16:22:01 2003
+++ edited/drivers/net/pcmcia/ibmtr_cs.c	Wed Jul 23 12:27:44 2003
@@ -114,7 +114,7 @@
 
 static void ibmtr_config(dev_link_t *link);
 static void ibmtr_hw_setup(struct net_device *dev, u_int mmiobase);
-static void ibmtr_release(u_long arg);
+static void ibmtr_release(dev_link_t *link);
 static int ibmtr_event(event_t event, int priority,
                        event_callback_args_t *args);
 
@@ -216,9 +216,6 @@
     link = &info->link;
     link->priv = info;
 
-    init_timer(&link->release);
-    link->release.function = &ibmtr_release;
-    link->release.data = (u_long)link;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
     link->io.NumPorts1 = 4;
     link->io.IOAddrLines = 16;
@@ -295,9 +292,8 @@
 	struct tok_info *ti = (struct tok_info *)dev->priv;
 	del_timer_sync(&(ti->tr_timer));
     }
-    del_timer_sync(&link->release);
     if (link->state & DEV_CONFIG) {
-        ibmtr_release((u_long)link);
+        ibmtr_release(link);
         if (link->state & DEV_STALE_CONFIG) {
             link->state |= DEV_STALE_LINK;
             return;
@@ -434,7 +430,7 @@
 cs_failed:
     cs_error(link->handle, last_fn, last_ret);
 failed:
-    ibmtr_release((u_long)link);
+    ibmtr_release(link);
 } /* ibmtr_config */
 
 /*======================================================================
@@ -445,9 +441,8 @@
 
 ======================================================================*/
 
-static void ibmtr_release(u_long arg)
+static void ibmtr_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *)arg;
     ibmtr_dev_t *info = link->priv;
     struct net_device *dev = info->dev;
 
@@ -499,7 +494,7 @@
 	    /* set flag to bypass normal interrupt code */
 	    ((struct tok_info *)dev->priv)->sram_virt |= 1;
 	    netif_device_detach(dev);
-	    mod_timer(&link->release, jiffies + HZ/20);
+	    ibmtr_release(link);
         }
         break;
     case CS_EVENT_CARD_INSERTION:
===== drivers/net/pcmcia/nmclan_cs.c 1.17 vs edited =====
--- 1.17/drivers/net/pcmcia/nmclan_cs.c	Fri Jul 11 16:58:34 2003
+++ edited/drivers/net/pcmcia/nmclan_cs.c	Wed Jul 23 12:27:44 2003
@@ -427,7 +427,7 @@
 ---------------------------------------------------------------------------- */
 
 static void nmclan_config(dev_link_t *link);
-static void nmclan_release(u_long arg);
+static void nmclan_release(dev_link_t *link);
 static int nmclan_event(event_t event, int priority,
 			event_callback_args_t *args);
 
@@ -490,9 +490,6 @@
     link->priv = dev;
     
     spin_lock_init(&lp->bank_lock);
-    init_timer(&link->release);
-    link->release.function = &nmclan_release;
-    link->release.data = (u_long)link;
     link->io.NumPorts1 = 32;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
     link->io.IOAddrLines = 5;
@@ -569,9 +566,8 @@
     if (*linkp == NULL)
 	return;
 
-    del_timer_sync(&link->release);
     if (link->state & DEV_CONFIG) {
-	nmclan_release((u_long)link);
+	nmclan_release(link);
 	if (link->state & DEV_STALE_CONFIG) {
 	    link->state |= DEV_STALE_LINK;
 	    return;
@@ -815,7 +811,7 @@
 cs_failed:
     cs_error(link->handle, last_fn, last_ret);
 failed:
-    nmclan_release((u_long)link);
+    nmclan_release(link);
     return;
 
 } /* nmclan_config */
@@ -826,9 +822,8 @@
 	net device, and release the PCMCIA configuration.  If the device
 	is still open, this will be postponed until it is closed.
 ---------------------------------------------------------------------------- */
-static void nmclan_release(u_long arg)
+static void nmclan_release(dev_link_t *link)
 {
-  dev_link_t *link = (dev_link_t *)arg;
 
   DEBUG(0, "nmclan_release(0x%p)\n", link);
 
@@ -867,7 +862,7 @@
       link->state &= ~DEV_PRESENT;
       if (link->state & DEV_CONFIG) {
 	netif_device_detach(dev);
-	mod_timer(&link->release, jiffies + HZ/20);
+	nmclan_release(link);
       }
       break;
     case CS_EVENT_CARD_INSERTION:
@@ -1012,7 +1007,7 @@
   link->open--;
   netif_stop_queue(dev);
   if (link->state & DEV_STALE_CONFIG)
-    mod_timer(&link->release, jiffies + HZ/20);
+	  nmclan_release(link);
 
   return 0;
 } /* mace_close */
===== drivers/net/pcmcia/pcnet_cs.c 1.20 vs edited =====
--- 1.20/drivers/net/pcmcia/pcnet_cs.c	Fri Jul 11 16:22:26 2003
+++ edited/drivers/net/pcmcia/pcnet_cs.c	Wed Jul 23 12:27:44 2003
@@ -110,7 +110,7 @@
 
 static void mii_phy_probe(struct net_device *dev);
 static void pcnet_config(dev_link_t *link);
-static void pcnet_release(u_long arg);
+static void pcnet_release(dev_link_t *link);
 static int pcnet_event(event_t event, int priority,
 		       event_callback_args_t *args);
 static int pcnet_open(struct net_device *dev);
@@ -293,9 +293,6 @@
     link = &info->link; dev = &info->dev;
     link->priv = info;
 
-    init_timer(&link->release);
-    link->release.function = &pcnet_release;
-    link->release.data = (u_long)link;
     link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
     link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID;
     if (irq_list[0] == -1)
@@ -357,9 +354,8 @@
     if (*linkp == NULL)
 	return;
 
-    del_timer_sync(&link->release);
     if (link->state & DEV_CONFIG) {
-	pcnet_release((u_long)link);
+	pcnet_release(link);
 	if (link->state & DEV_STALE_CONFIG) {
 	    link->state |= DEV_STALE_LINK;
 	    return;
@@ -787,7 +783,7 @@
 cs_failed:
     cs_error(link->handle, last_fn, last_ret);
 failed:
-    pcnet_release((u_long)link);
+    pcnet_release(link);
     link->state &= ~DEV_CONFIG_PENDING;
     return;
 } /* pcnet_config */
@@ -800,9 +796,8 @@
 
 ======================================================================*/
 
-static void pcnet_release(u_long arg)
+static void pcnet_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *)arg;
     pcnet_dev_t *info = link->priv;
 
     DEBUG(0, "pcnet_release(0x%p)\n", link);
@@ -848,7 +843,7 @@
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
 	    netif_device_detach(&info->dev);
-	    mod_timer(&link->release, jiffies + HZ/20);
+	    pcnet_release(link);
 	}
 	break;
     case CS_EVENT_CARD_INSERTION:
@@ -1054,7 +1049,7 @@
     netif_stop_queue(dev);
     del_timer_sync(&info->watchdog);
     if (link->state & DEV_STALE_CONFIG)
-	mod_timer(&link->release, jiffies + HZ/20);
+	    pcnet_release(link);
 
     return 0;
 } /* pcnet_close */
===== drivers/net/pcmcia/smc91c92_cs.c 1.21 vs edited =====
--- 1.21/drivers/net/pcmcia/smc91c92_cs.c	Fri Jul 11 16:22:40 2003
+++ edited/drivers/net/pcmcia/smc91c92_cs.c	Wed Jul 23 12:27:44 2003
@@ -283,7 +283,7 @@
 static dev_link_t *smc91c92_attach(void);
 static void smc91c92_detach(dev_link_t *);
 static void smc91c92_config(dev_link_t *link);
-static void smc91c92_release(u_long arg);
+static void smc91c92_release(dev_link_t *link);
 static int smc91c92_event(event_t event, int priority,
 			  event_callback_args_t *args);
 
@@ -351,9 +351,6 @@
     link->priv = dev;
 
     spin_lock_init(&smc->lock);
-    init_timer(&link->release);
-    link->release.function = &smc91c92_release;
-    link->release.data = (u_long)link;
     link->io.NumPorts1 = 16;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
     link->io.IOAddrLines = 4;
@@ -433,9 +430,8 @@
     if (*linkp == NULL)
 	return;
 
-    del_timer_sync(&link->release);
     if (link->state & DEV_CONFIG) {
-	smc91c92_release((u_long)link);
+	smc91c92_release(link);
 	if (link->state & DEV_STALE_CONFIG) {
 	    link->state |= DEV_STALE_LINK;
 	    return;
@@ -1068,7 +1064,7 @@
 config_undo:
     unregister_netdev(dev);
 config_failed:			/* CS_EXIT_TEST() calls jump to here... */
-    smc91c92_release((u_long)link);
+    smc91c92_release(link);
     link->state &= ~DEV_CONFIG_PENDING;
 
 } /* smc91c92_config */
@@ -1081,9 +1077,8 @@
 
 ======================================================================*/
 
-static void smc91c92_release(u_long arg)
+static void smc91c92_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *)arg;
 
     DEBUG(0, "smc91c92_release(0x%p)\n", link);
 
@@ -1132,7 +1127,7 @@
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
 	    netif_device_detach(dev);
-	    mod_timer(&link->release, jiffies + HZ/20);
+	    smc91c92_release(link);
 	}
 	break;
     case CS_EVENT_CARD_INSERTION:
@@ -1332,7 +1327,7 @@
     link->open--;
     del_timer_sync(&smc->media);
     if (link->state & DEV_STALE_CONFIG)
-	mod_timer(&link->release, jiffies + HZ/20);
+	    smc91c92_release(link);
 
     return 0;
 } /* smc_close */
===== drivers/net/pcmcia/xirc2ps_cs.c 1.23 vs edited =====
--- 1.23/drivers/net/pcmcia/xirc2ps_cs.c	Fri Jul 11 16:22:49 2003
+++ edited/drivers/net/pcmcia/xirc2ps_cs.c	Wed Jul 23 12:27:44 2003
@@ -295,7 +295,7 @@
 
 static int has_ce2_string(dev_link_t * link);
 static void xirc2ps_config(dev_link_t * link);
-static void xirc2ps_release(u_long arg);
+static void xirc2ps_release(dev_link_t * link);
 static int xirc2ps_event(event_t event, int priority,
 			 event_callback_args_t * args);
 
@@ -611,10 +611,6 @@
     link = &local->link;
     link->priv = dev;
 
-    init_timer(&link->release);
-    link->release.function = &xirc2ps_release;
-    link->release.data = (u_long) link;
-
     /* General socket configuration */
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.Vcc = 50;
@@ -689,9 +685,8 @@
      * the release() function is called, that will trigger a proper
      * detach().
      */
-    del_timer_sync(&link->release);
     if (link->state & DEV_CONFIG) {
-	xirc2ps_release((unsigned long)link);
+	xirc2ps_release(link);
 	if (link->state & DEV_STALE_CONFIG) {
 		link->state |= DEV_STALE_LINK;
 		return;
@@ -1164,7 +1159,7 @@
 
   config_error:
     link->state &= ~DEV_CONFIG_PENDING;
-    xirc2ps_release((u_long)link);
+    xirc2ps_release(link);
     return;
 
   cis_error:
@@ -1179,9 +1174,8 @@
  * still open, this will be postponed until it is closed.
  */
 static void
-xirc2ps_release(u_long arg)
+xirc2ps_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *) arg;
 
     DEBUG(0, "release(0x%p)\n", link);
 
@@ -1243,7 +1237,7 @@
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
 	    netif_device_detach(dev);
-	    mod_timer(&link->release, jiffies + HZ/20);
+	    xirc2ps_release(link);
 	}
 	break;
     case CS_EVENT_CARD_INSERTION:
@@ -2045,7 +2039,7 @@
 
     link->open--;
     if (link->state & DEV_STALE_CONFIG)
-	mod_timer(&link->release, jiffies + HZ/20);
+	    xirc2ps_release(link);
 
     return 0;
 }
===== drivers/net/wireless/airo_cs.c 1.8 vs edited =====
--- 1.8/drivers/net/wireless/airo_cs.c	Sat Apr 26 18:16:23 2003
+++ edited/drivers/net/wireless/airo_cs.c	Wed Jul 23 12:27:44 2003
@@ -94,7 +94,7 @@
 int reset_airo_card( struct net_device * );
 
 static void airo_config(dev_link_t *link);
-static void airo_release(u_long arg);
+static void airo_release(dev_link_t *link);
 static int airo_event(event_t event, int priority,
 		       event_callback_args_t *args);
 
@@ -208,9 +208,6 @@
 		return NULL;
 	}
 	memset(link, 0, sizeof(struct dev_link_t));
-	init_timer(&link->release);
-	link->release.function = &airo_release;
-	link->release.data = (u_long)link;
 	
 	/* Interrupt setup */
 	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
@@ -286,10 +283,9 @@
 	if (*linkp == NULL)
 		return;
 	
-	del_timer(&link->release);
-	if ( link->state & DEV_CONFIG ) {
-		airo_release( (int)link );
-		if ( link->state & DEV_STALE_CONFIG ) {
+	if (link->state & DEV_CONFIG) {
+		airo_release(link);
+		if (link->state & DEV_STALE_CONFIG) {
 			link->state |= DEV_STALE_LINK;
 			return;
 		}
@@ -513,7 +509,7 @@
 	
  cs_failed:
 	cs_error(link->handle, last_fn, last_ret);
-	airo_release((u_long)link);
+	airo_release(link);
 	
 } /* airo_config */
 
@@ -525,10 +521,8 @@
   
   ======================================================================*/
 
-static void airo_release(u_long arg)
+static void airo_release(dev_link_t *link)
 {
-	dev_link_t *link = (dev_link_t *)arg;
-	
 	DEBUG(0, "airo_release(0x%p)\n", link);
 	
 	/*
@@ -588,7 +582,7 @@
 		link->state &= ~DEV_PRESENT;
 		if (link->state & DEV_CONFIG) {
 			netif_device_detach(local->eth_dev);
-			mod_timer(&link->release, jiffies + HZ/20);
+			airo_release(link);
 		}
 		break;
 	case CS_EVENT_CARD_INSERTION:
@@ -639,7 +633,7 @@
 	/* XXX: this really needs to move into generic code.. */
 	while (dev_list != NULL) {
 		if (dev_list->state & DEV_CONFIG)
-			airo_release((u_long)dev_list);
+			airo_release(dev_list);
 		airo_detach(dev_list);
 	}
 }
===== drivers/net/wireless/netwave_cs.c 1.19 vs edited =====
--- 1.19/drivers/net/wireless/netwave_cs.c	Sat Jun 28 03:15:32 2003
+++ edited/drivers/net/wireless/netwave_cs.c	Wed Jul 23 12:27:44 2003
@@ -204,7 +204,7 @@
 /*====================================================================*/
 
 /* PCMCIA (Card Services) related functions */
-static void netwave_release(u_long arg);     /* Card removal */
+static void netwave_release(dev_link_t *link);     /* Card removal */
 static int  netwave_event(event_t event, int priority, 
 					      event_callback_args_t *args);
 static void netwave_pcmcia_config(dev_link_t *arg); /* Runs after card 
@@ -455,10 +455,6 @@
     link = &priv->link;
     link->priv = dev;
 
-    init_timer(&link->release);
-    link->release.function = &netwave_release;
-    link->release.data = (u_long)link;
-	
     /* The io structure describes IO port mapping */
     link->io.NumPorts1 = 16;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
@@ -552,9 +548,8 @@
 	  the release() function is called, that will trigger a proper
 	  detach().
 	*/
-    del_timer(&link->release);
     if (link->state & DEV_CONFIG) {
-	netwave_release((u_long) link);
+	netwave_release(link);
 	if (link->state & DEV_STALE_CONFIG) {
 	    DEBUG(1, "netwave_cs: detach postponed, '%s' still "
 		  "locked\n", link->dev->dev_name);
@@ -1149,7 +1144,7 @@
 cs_failed:
     cs_error(link->handle, last_fn, last_ret);
 failed:
-    netwave_release((u_long)link);
+    netwave_release(link);
 } /* netwave_pcmcia_config */
 
 /*
@@ -1159,8 +1154,8 @@
  *    device, and release the PCMCIA configuration.  If the device is
  *    still open, this will be postponed until it is closed.
  */
-static void netwave_release(u_long arg) {
-    dev_link_t *link = (dev_link_t *)arg;
+static void netwave_release(dev_link_t *link)
+{
     struct net_device *dev = link->priv;
     netwave_private *priv = dev->priv;
 
@@ -1220,7 +1215,7 @@
 	link->state &= ~DEV_PRESENT;
 	if (link->state & DEV_CONFIG) {
 	    netif_device_detach(dev);
-	    mod_timer(&link->release, jiffies + HZ/20);
+	    netwave_release(link);
 	}
 	break;
     case CS_EVENT_CARD_INSERTION:
@@ -1738,8 +1733,7 @@
     link->open--;
     netif_stop_queue(dev);
     if (link->state & DEV_STALE_CONFIG)
-	mod_timer(&link->release, jiffies + HZ/20);
-	
+	    netwave_release(link);
     return 0;
 }
 
===== drivers/net/wireless/orinoco_cs.c 1.23 vs edited =====
--- 1.23/drivers/net/wireless/orinoco_cs.c	Thu May 29 12:54:13 2003
+++ edited/drivers/net/wireless/orinoco_cs.c	Wed Jul 23 12:27:44 2003
@@ -110,7 +110,7 @@
 
 /* PCMCIA gumpf */
 static void orinoco_cs_config(dev_link_t * link);
-static void orinoco_cs_release(u_long arg);
+static void orinoco_cs_release(dev_link_t * link);
 static int orinoco_cs_event(event_t event, int priority,
 			    event_callback_args_t * args);
 
@@ -202,11 +202,6 @@
 	link = &card->link;
 	link->priv = dev;
 
-	/* Initialize the dev_link_t structure */
-	init_timer(&link->release);
-	link->release.function = &orinoco_cs_release;
-	link->release.data = (u_long) link;
-
 	/* Interrupt setup */
 	link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
 	link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
@@ -272,7 +267,7 @@
 	}
 
 	if (link->state & DEV_CONFIG) {
-		orinoco_cs_release((u_long)link);
+		orinoco_cs_release(link);
 		if (link->state & DEV_CONFIG) {
 			link->state |= DEV_STALE_LINK;
 			return;
@@ -530,7 +525,7 @@
 	orinoco_cs_error(link->handle, last_fn, last_ret);
 
  failed:
-	orinoco_cs_release((u_long) link);
+	orinoco_cs_release(link);
 }				/* orinoco_cs_config */
 
 /*
@@ -539,9 +534,8 @@
  * still open, this will be postponed until it is closed.
  */
 static void
-orinoco_cs_release(u_long arg)
+orinoco_cs_release(dev_link_t *link)
 {
-	dev_link_t *link = (dev_link_t *) arg;
 	struct net_device *dev = link->priv;
 	struct orinoco_private *priv = dev->priv;
 	unsigned long flags;
@@ -697,7 +691,7 @@
 		DEBUG(0, "orinoco_cs: Removing leftover devices.\n");
 	while (dev_list != NULL) {
 		if (dev_list->state & DEV_CONFIG)
-			orinoco_cs_release((u_long) dev_list);
+			orinoco_cs_release(dev_list);
 		orinoco_cs_detach(dev_list);
 	}
 }
===== drivers/net/wireless/ray_cs.c 1.19 vs edited =====
--- 1.19/drivers/net/wireless/ray_cs.c	Fri Jul 11 00:49:09 2003
+++ edited/drivers/net/wireless/ray_cs.c	Wed Jul 23 12:27:44 2003
@@ -94,7 +94,7 @@
 #endif
 /** Prototypes based on PCMCIA skeleton driver *******************************/
 static void ray_config(dev_link_t *link);
-static void ray_release(u_long arg);
+static void ray_release(dev_link_t *link);
 static int ray_event(event_t event, int priority, event_callback_args_t *args);
 static dev_link_t *ray_attach(void);
 static void ray_detach(dev_link_t *);
@@ -374,10 +374,6 @@
     memset(dev, 0, sizeof(struct net_device));
     memset(local, 0, sizeof(ray_dev_t));
 
-    init_timer(&link->release);
-    link->release.function = &ray_release;
-    link->release.data = (u_long)link;
-
     /* The io structure describes IO port mapping. None used here */
     link->io.NumPorts1 = 0;
     link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -482,9 +478,8 @@
       the release() function is called, that will trigger a proper
       detach().
     */
-    del_timer(&link->release);
     if (link->state & DEV_CONFIG) {
-        ray_release((u_long)link);
+        ray_release(link);
         if(link->state & DEV_STALE_CONFIG) {
             link->state |= DEV_STALE_LINK;
             return;
@@ -602,14 +597,14 @@
     DEBUG(3,"ray_config rmem=%p\n",local->rmem);
     DEBUG(3,"ray_config amem=%p\n",local->amem);
     if (ray_init(dev) < 0) {
-        ray_release((u_long)link);
+        ray_release(link);
         return;
     }
 
     i = register_netdev(dev);
     if (i != 0) {
         printk("ray_config register_netdev() failed\n");
-        ray_release((u_long)link);
+        ray_release(link);
         return;
     }
 
@@ -627,7 +622,7 @@
 cs_failed:
     cs_error(link->handle, last_fn, last_ret);
 
-    ray_release((u_long)link);
+    ray_release(link);
 } /* ray_config */
 /*===========================================================================*/
 static int ray_init(struct net_device *dev)
@@ -898,9 +893,8 @@
     device, and release the PCMCIA configuration.  If the device is
     still open, this will be postponed until it is closed.
 =============================================================================*/
-static void ray_release(u_long arg)
+static void ray_release(dev_link_t *link)
 {
-    dev_link_t *link = (dev_link_t *)arg;
     struct net_device *dev = link->priv; 
     ray_dev_t *local = dev->priv;
     int i;
@@ -959,7 +953,7 @@
         link->state &= ~DEV_PRESENT;
         netif_device_detach(dev);
         if (link->state & DEV_CONFIG) {
-            mod_timer(&link->release, jiffies + HZ/20);
+	    ray_release(link);
             del_timer(&local->timer);
         }
         break;
@@ -1769,7 +1763,7 @@
     link->open--;
     netif_stop_queue(dev);
     if (link->state & DEV_STALE_CONFIG)
-	mod_timer(&link->release, jiffies + HZ/20);
+	    ray_release(link);
 
     /* In here, we should stop the hardware (stop card from beeing active)
      * and set local->card_status to CARD_AWAITING_PARAM, so that while the
===== drivers/net/wireless/wavelan_cs.c 1.24 vs edited =====
--- 1.24/drivers/net/wireless/wavelan_cs.c	Wed May 28 17:01:09 2003
+++ edited/drivers/net/wireless/wavelan_cs.c	Wed Jul 23 12:27:44 2003
@@ -4128,7 +4128,7 @@
   /* If any step failed, release any partially configured state */
   if(i != 0)
     {
-      wv_pcmcia_release((u_long) link);
+      wv_pcmcia_release(link);
       return FALSE;
     }
 
@@ -4148,9 +4148,8 @@
  * still open, this will be postponed until it is closed.
  */
 static void
-wv_pcmcia_release(u_long	arg)	/* Address of the interface struct */
+wv_pcmcia_release(dev_link_t *link)
 {
-  dev_link_t *	link = (dev_link_t *) arg;
   device *	dev = (device *) link->priv;
 
 #ifdef DEBUG_CONFIG_TRACE
@@ -4675,7 +4674,7 @@
   else
     /* The card is no more there (flag is activated in wv_pcmcia_release) */
     if(link->state & DEV_STALE_CONFIG)
-      wv_pcmcia_release((u_long)link);
+      wv_pcmcia_release(link);
 
 #ifdef DEBUG_CALLBACK_TRACE
   printk(KERN_DEBUG "%s: <-wavelan_close()\n", dev->name);
@@ -4714,10 +4713,6 @@
   if (!link) return NULL;
   memset(link, 0, sizeof(struct dev_link_t));
 
-  /* Unused for the Wavelan */
-  link->release.function = &wv_pcmcia_release;
-  link->release.data = (u_long) link;
-
   /* The io structure describes IO port mapping */
   link->io.NumPorts1 = 8;
   link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
@@ -4857,7 +4852,7 @@
   if(link->state & DEV_CONFIG)
     {
       /* Some others haven't done their job : give them another chance */
-      wv_pcmcia_release((u_long) link);
+      wv_pcmcia_release(link);
       if(link->state & DEV_STALE_CONFIG)
 	{
 #ifdef DEBUG_CONFIG_INFO
@@ -4965,7 +4960,7 @@
 	    netif_device_detach(dev);
 
 	    /* Release the card */
-	    wv_pcmcia_release((u_long) link);
+	    wv_pcmcia_release(link);
 	  }
 	break;
 
===== drivers/net/wireless/wavelan_cs.p.h 1.8 vs edited =====
--- 1.8/drivers/net/wireless/wavelan_cs.p.h	Thu May  1 20:32:19 2003
+++ edited/drivers/net/wireless/wavelan_cs.p.h	Wed Jul 23 12:27:44 2003
@@ -761,7 +761,7 @@
 static inline int
 	wv_pcmcia_config(dev_link_t *);	/* Configure the pcmcia interface */
 static void
-	wv_pcmcia_release(u_long),	/* Remove a device */
+	wv_pcmcia_release(dev_link_t *),/* Remove a device */
 	wv_flush_stale_links(void);	/* "detach" all possible devices */
 /* ---------------------- INTERRUPT HANDLING ---------------------- */
 static irqreturn_t

From JoseAndres.Arias at oracle.com  Fri Jul 25 11:05:53 2003
From: JoseAndres.Arias at oracle.com (Jose Andres Arias Velichko)
Date: Fri Jul 25 09:01:59 2003
Subject: pcmcia 2.6.0-test1 and SanDisk adapter
Message-ID: <1059120353.4175.13.camel@trantor>

Hi All,

        I've get the next problem using 2.6.0-test1 kernel and kernel
pcmcia
package: When I plug in the SanDisk CompactFlash PC Card Adapter, the
card is detected but I get next oops. In dmesg appears the next
messages:

8<----------------------------------
hde: SanDisk SDCFB-1024, CFA DISK drive
ide2 at 0x140-0x147,0x14e on irq 3
hde: max request size: 128KiB
hde: task_no_data_intr: status=0x51 { DriveReady SeekComplete Error }
hde: task_no_data_intr: error=0x04 { DriveStatusError }
hde: 2001888 sectors (1025 MB) w/1KiB Cache, CHS=1986/16/63
 /dev/ide/host2/bus0/target0/lun0: p1
 /dev/ide/host2/bus0/target0/lun0: p1
devfs_mk_bdev: could not append to parent for
ide/host2/bus0/target0/lun0/part1
kobject_register failed for hde1 (-17)
Call Trace:
 [<c0215284>] kobject_register+0x4e/0x57
 [<c0179c3b>] register_disk+0x13e/0x167
 [<c0272541>] add_disk+0x4f/0x5d
 [<c02724c7>] exact_match+0x0/0xb
 [<c02724d2>] exact_lock+0x0/0x20
 [<c028e3fe>] idedisk_attach+0x12b/0x1aa
 [<c028a07e>] ata_attach+0x82/0xe3
 [<c0283b93>] ideprobe_init+0xeb/0x107
 [<c028863a>] ide_probe_module+0x11/0x13
 [<c0289396>] ide_register_hw+0x155/0x186
 [<f98b9258>] idecs_register+0x5b/0x6d [ide_cs]
 [<c02a3b96>] CardServices+0x201/0x348
 [<f98b9757>] ide_config+0x4ed/0x826 [ide_cs]
 [<c029c116>] set_cis_map+0x3e/0x108
 [<c029c585>] read_cis_cache+0xda/0x161
 [<c029cedc>] pcmcia_get_tuple_data+0x8c/0x90
 [<c029e138>] pcmcia_parse_tuple+0x10a/0x16e
 [<c029e20c>] read_tuple+0x70/0x72
 [<c029ce00>] pcmcia_get_next_tuple+0x258/0x2a8
 [<c029c926>] pcmcia_get_first_tuple+0x9b/0x130
 [<f985d700>] yenta_set_mem_map+0x10f/0x20d [yenta_socket]
 [<f985d7b3>] yenta_set_mem_map+0x1c2/0x20d [yenta_socket]
 [<c029c116>] set_cis_map+0x3e/0x108
 [<c029c585>] read_cis_cache+0xda/0x161
 [<c029cedc>] pcmcia_get_tuple_data+0x8c/0x90
 [<c029e138>] pcmcia_parse_tuple+0x10a/0x16e
 [<c029e20c>] read_tuple+0x70/0x72
 [<c029ce00>] pcmcia_get_next_tuple+0x258/0x2a8
 [<c029c926>] pcmcia_get_first_tuple+0x9b/0x130
 [<c029c585>] read_cis_cache+0xda/0x161
 [<c029ce00>] pcmcia_get_next_tuple+0x258/0x2a8
 [<c029e303>] pcmcia_validate_cis+0xf5/0x1ce
 [<c020232d>] pathrelse_and_restore+0x47/0x4e
 [<c01ebcd4>] do_balance+0xbd/0x103
 [<f98b9c10>] ide_event+0x68/0xec [ide_cs]
 [<c02a2746>] pcmcia_register_client+0x1fc/0x234
 [<f985d7b3>] yenta_set_mem_map+0x1c2/0x20d [yenta_socket]
 [<c02a3b31>] CardServices+0x19c/0x348
 [<f98b910c>] ide_attach+0x10c/0x14a [ide_cs]
 [<f98b9ba8>] ide_event+0x0/0xec [ide_cs]
 [<c02a4726>] bind_request+0x13b/0x1b0
 [<c0217b00>] __copy_to_user_ll+0x16/0x74
 [<c02a52c9>] ds_ioctl+0x61e/0x729
 [<c03005ba>] sock_def_readable+0x58/0x5a
 [<c034f8e9>] unix_dgram_sendmsg+0x309/0x493
 [<c02fd3e9>] sock_sendmsg+0x92/0xaf
 [<c011aed9>] do_page_fault+0x15d/0x46d
 [<c0165fd2>] wake_up_inode+0x11/0x28
 [<c013a758>] buffered_rmqueue+0xa0/0x109
 [<c0141d28>] zap_pte_range+0x7f/0x1c9
 [<c0141ebd>] zap_pmd_range+0x4b/0x67
 [<c0141f1a>] unmap_page_range+0x41/0x67
 [<c014200b>] unmap_vmas+0xcb/0x213
 [<c0145279>] unmap_vma+0x41/0x7b
 [<c01452d0>] unmap_vma_list+0x1d/0x2a
 [<c0145644>] do_munmap+0x11c/0x151
 [<c015f478>] sys_ioctl+0xac/0x218
 [<c0109007>] syscall_call+0x7/0xb

Module ide_cs cannot be unloaded due to unsafe usage in
include/linux/module.h:482
ide-cs: hde: Vcc = 3.3, Vpp = 0.0
8<----------------------------------


The pcmcia-cs package I'm using for cardmgr is 3.2.4.
The laptop is toshiba tecra 9100.
And attached there are my kernel config.
Contact me for any other information.


Best Regards,
        Andres


-- 
------------------------------
Jose Andres Arias Velichko
joseandres.arias@oracle.com
Senior Unix Engineer 
EMEA IT Operations
ORACLE
Tel Work: +34 91 6312255
AIM ID: joseandresarias

Why use Windows, since there is a door?
-------------- next part --------------
#
# Automatically generated make config: don't edit
#
CONFIG_X86=y
CONFIG_MMU=y
CONFIG_UID16=y
CONFIG_GENERIC_ISA_DMA=y

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y

#
# General setup
#
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y

#
# Loadable module support
#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_OBSOLETE_MODPARM=y
# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y

#
# Processor type and features
#
CONFIG_X86_PC=y
# CONFIG_X86_VOYAGER is not set
# CONFIG_X86_NUMAQ is not set
# CONFIG_X86_SUMMIT is not set
# CONFIG_X86_BIGSMP is not set
# CONFIG_X86_VISWS is not set
# CONFIG_X86_GENERICARCH is not set
# CONFIG_X86_ES7000 is not set
# CONFIG_M386 is not set
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
# CONFIG_MPENTIUMII is not set
# CONFIG_MPENTIUMIII is not set
CONFIG_MPENTIUM4=y
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MELAN is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP2 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
# CONFIG_X86_GENERIC is not set
CONFIG_X86_CMPXCHG=y
CONFIG_X86_XADD=y
CONFIG_X86_L1_CACHE_SHIFT=7
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_X86_WP_WORKS_OK=y
CONFIG_X86_INVLPG=y
CONFIG_X86_BSWAP=y
CONFIG_X86_POPAD_OK=y
CONFIG_X86_GOOD_APIC=y
CONFIG_X86_INTEL_USERCOPY=y
CONFIG_X86_USE_PPRO_CHECKSUM=y
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
CONFIG_X86_UP_APIC=y
CONFIG_X86_UP_IOAPIC=y
CONFIG_X86_LOCAL_APIC=y
CONFIG_X86_IO_APIC=y
CONFIG_X86_TSC=y
CONFIG_X86_MCE=y
CONFIG_X86_MCE_NONFATAL=y
CONFIG_X86_MCE_P4THERMAL=y
CONFIG_TOSHIBA=y
# CONFIG_I8K is not set
CONFIG_MICROCODE=y
CONFIG_X86_MSR=m
CONFIG_X86_CPUID=m
CONFIG_EDD=y
# CONFIG_NOHIGHMEM is not set
CONFIG_HIGHMEM4G=y
# CONFIG_HIGHMEM64G is not set
CONFIG_HIGHMEM=y
CONFIG_HIGHPTE=y
# CONFIG_MATH_EMULATION is not set
CONFIG_MTRR=y

#
# Power management options (ACPI, APM)
#
CONFIG_PM=y
CONFIG_SOFTWARE_SUSPEND=y

#
# ACPI Support
#
CONFIG_ACPI=y
# CONFIG_ACPI_HT_ONLY is not set
CONFIG_ACPI_BOOT=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_SLEEP_PROC_FS=y
CONFIG_ACPI_AC=y
CONFIG_ACPI_BATTERY=y
CONFIG_ACPI_BUTTON=y
CONFIG_ACPI_FAN=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_ACPI_THERMAL=y
# CONFIG_ACPI_ASUS is not set
CONFIG_ACPI_TOSHIBA=y
# CONFIG_ACPI_DEBUG is not set
CONFIG_ACPI_BUS=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_PCI=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_APM is not set

#
# CPU Frequency scaling
#
CONFIG_CPU_FREQ=y
# CONFIG_CPU_FREQ_PROC_INTF is not set
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_24_API=y
CONFIG_CPU_FREQ_TABLE=y

#
# CPUFreq processor drivers
#
CONFIG_X86_ACPI_CPUFREQ=y
# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
# CONFIG_X86_POWERNOW_K6 is not set
# CONFIG_X86_POWERNOW_K7 is not set
# CONFIG_X86_GX_SUSPMOD is not set
CONFIG_X86_SPEEDSTEP_ICH=y
CONFIG_X86_SPEEDSTEP_CENTRINO=y
CONFIG_X86_SPEEDSTEP_LIB=y
CONFIG_X86_P4_CLOCKMOD=y
# CONFIG_X86_LONGRUN is not set
# CONFIG_X86_LONGHAUL is not set

#
# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
#
CONFIG_PCI=y
# CONFIG_PCI_GOBIOS is not set
# CONFIG_PCI_GODIRECT is not set
CONFIG_PCI_GOANY=y
CONFIG_PCI_BIOS=y
CONFIG_PCI_DIRECT=y
CONFIG_PCI_LEGACY_PROC=y
CONFIG_PCI_NAMES=y
CONFIG_ISA=y
CONFIG_EISA=y
# CONFIG_EISA_VLB_PRIMING is not set
CONFIG_EISA_PCI_EISA=y
CONFIG_EISA_VIRTUAL_ROOT=y
CONFIG_EISA_NAMES=y
# CONFIG_MCA is not set
# CONFIG_SCx200 is not set
CONFIG_HOTPLUG=y

#
# PCMCIA/CardBus support
#
CONFIG_PCMCIA=y
CONFIG_YENTA=m
CONFIG_CARDBUS=y
CONFIG_I82092=m
# CONFIG_I82365 is not set
CONFIG_TCIC=m
CONFIG_PCMCIA_PROBE=y

#
# PCI Hotplug Support
#
CONFIG_HOTPLUG_PCI=m
CONFIG_HOTPLUG_PCI_FAKE=m
CONFIG_HOTPLUG_PCI_COMPAQ=m
# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
CONFIG_HOTPLUG_PCI_IBM=m
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_HOTPLUG_PCI_CPCI=m
CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m
CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m

#
# Executable file formats
#
CONFIG_KCORE_ELF=y
# CONFIG_KCORE_AOUT is not set
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_AOUT=m
CONFIG_BINFMT_MISC=m

#
# Generic Driver Options
#
CONFIG_FW_LOADER=m

#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set

#
# Parallel port support
#
CONFIG_PARPORT=y
CONFIG_PARPORT_PC=y
CONFIG_PARPORT_PC_CML1=y
# CONFIG_PARPORT_SERIAL is not set
CONFIG_PARPORT_PC_FIFO=y
CONFIG_PARPORT_PC_SUPERIO=y
CONFIG_PARPORT_PC_PCMCIA=m
CONFIG_PARPORT_OTHER=y
CONFIG_PARPORT_1284=y

#
# Plug and Play support
#
# CONFIG_PNP is not set

#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_PARIDE is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
CONFIG_BLK_DEV_LOOP=m
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=m
CONFIG_BLK_DEV_RAM_SIZE=4096
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_LBD is not set

#
# ATA/ATAPI/MFM/RLL support
#
CONFIG_IDE=y

#
# IDE, ATA and ATAPI Block devices
#
CONFIG_BLK_DEV_IDE=y

#
# Please see Documentation/ide.txt for help/info on IDE drives
#
# CONFIG_BLK_DEV_HD_IDE is not set
# CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_IDEDISK=y
CONFIG_IDEDISK_MULTI_MODE=y
# CONFIG_IDEDISK_STROKE is not set
CONFIG_BLK_DEV_IDECS=m
CONFIG_BLK_DEV_IDECD=m
# CONFIG_BLK_DEV_IDEFLOPPY is not set
CONFIG_BLK_DEV_IDESCSI=m
# CONFIG_IDE_TASK_IOCTL is not set
# CONFIG_IDE_TASKFILE_IO is not set

#
# IDE chipset support/bugfixes
#
# CONFIG_BLK_DEV_CMD640 is not set
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_BLK_DEV_GENERIC=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
# CONFIG_BLK_DEV_IDE_TCQ is not set
# CONFIG_BLK_DEV_OFFBOARD is not set
# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
CONFIG_IDEDMA_PCI_AUTO=y
# CONFIG_IDEDMA_ONLYDISK is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_IDEDMA_PCI_WIP is not set
CONFIG_BLK_DEV_ADMA=y
# CONFIG_BLK_DEV_AEC62XX is not set
# CONFIG_BLK_DEV_ALI15X3 is not set
# CONFIG_BLK_DEV_AMD74XX is not set
# CONFIG_BLK_DEV_CMD64X is not set
# CONFIG_BLK_DEV_TRIFLEX is not set
# CONFIG_BLK_DEV_CY82C693 is not set
# CONFIG_BLK_DEV_CS5520 is not set
# CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_SC1200 is not set
CONFIG_BLK_DEV_PIIX=y
# CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_OPTI621 is not set
# CONFIG_BLK_DEV_PDC202XX_OLD is not set
# CONFIG_BLK_DEV_PDC202XX_NEW is not set
# CONFIG_BLK_DEV_RZ1000 is not set
# CONFIG_BLK_DEV_SVWKS is not set
# CONFIG_BLK_DEV_SIIMAGE is not set
# CONFIG_BLK_DEV_SIS5513 is not set
# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
# CONFIG_IDE_CHIPSETS is not set
CONFIG_IDEDMA_AUTO=y
# CONFIG_IDEDMA_IVB is not set
CONFIG_BLK_DEV_IDE_MODES=y

#
# SCSI device support
#
CONFIG_SCSI=m

#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=m
CONFIG_CHR_DEV_ST=m
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=m
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=m

#
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_REPORT_LUNS=y
CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_LOGGING is not set

#
# SCSI low-level drivers
#
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_7000FASST is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
# CONFIG_SCSI_AACRAID is not set
CONFIG_SCSI_AIC7XXX=y
CONFIG_AIC7XXX_CMDS_PER_DEVICE=64
CONFIG_AIC7XXX_RESET_DELAY_MS=2000
# CONFIG_AIC7XXX_PROBE_EISA_VL is not set
# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
CONFIG_AIC7XXX_DEBUG_MASK=0
CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_DPT_I2O is not set
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_IN2000 is not set
# CONFIG_SCSI_AM53C974 is not set
# CONFIG_SCSI_MEGARAID is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_CPQFCTS is not set
# CONFIG_SCSI_DMX3191D is not set
# CONFIG_SCSI_DTC3280 is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_EATA_PIO is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_GENERIC_NCR5380 is not set
# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_IMM is not set
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_SYM53C8XX is not set
# CONFIG_SCSI_PAS16 is not set
# CONFIG_SCSI_PCI2000 is not set
# CONFIG_SCSI_PCI2220I is not set
# CONFIG_SCSI_PSI240I is not set
# CONFIG_SCSI_QLOGIC_FAS is not set
# CONFIG_SCSI_QLOGIC_ISP is not set
# CONFIG_SCSI_QLOGIC_FC is not set
CONFIG_SCSI_QLOGIC_1280=m
# CONFIG_SCSI_SEAGATE is not set
# CONFIG_SCSI_SIM710 is not set
# CONFIG_SCSI_SYM53C416 is not set
# CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
# CONFIG_SCSI_ULTRASTOR is not set
# CONFIG_SCSI_NSP32 is not set
# CONFIG_SCSI_DEBUG is not set

#
# PCMCIA SCSI adapter support
#
CONFIG_PCMCIA_AHA152X=m
CONFIG_PCMCIA_FDOMAIN=m
CONFIG_PCMCIA_NINJA_SCSI=m
CONFIG_PCMCIA_QLOGIC=m

#
# Old CD-ROM drivers (not SCSI, not IDE)
#
# CONFIG_CD_NO_IDESCSI is not set

#
# Multi-device support (RAID and LVM)
#
CONFIG_MD=y
CONFIG_BLK_DEV_MD=m
CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
CONFIG_MD_RAID5=m
# CONFIG_MD_MULTIPATH is not set
CONFIG_BLK_DEV_DM=m

#
# Fusion MPT device support
#
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support (EXPERIMENTAL)
#
CONFIG_IEEE1394=m

#
# Subsystem Options
#
# CONFIG_IEEE1394_VERBOSEDEBUG is not set
CONFIG_IEEE1394_OUI_DB=y

#
# Device Drivers
#
# CONFIG_IEEE1394_PCILYNX is not set
CONFIG_IEEE1394_OHCI1394=m

#
# Protocol Drivers
#
CONFIG_IEEE1394_VIDEO1394=m
CONFIG_IEEE1394_SBP2=m
# CONFIG_IEEE1394_SBP2_PHYS_DMA is not set
# CONFIG_IEEE1394_ETH1394 is not set
CONFIG_IEEE1394_DV1394=m
CONFIG_IEEE1394_RAWIO=m
# CONFIG_IEEE1394_CMP is not set

#
# I2O device support
#
CONFIG_I2O=m
# CONFIG_I2O_PCI is not set
# CONFIG_I2O_BLOCK is not set
# CONFIG_I2O_SCSI is not set
CONFIG_I2O_PROC=m

#
# Networking support
#
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
# CONFIG_NETLINK_DEV is not set
CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE=m
# CONFIG_NET_IPGRE_BROADCAST is not set
CONFIG_IP_MROUTE=y
CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
# CONFIG_ARPD is not set
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
CONFIG_INET_AH=m
CONFIG_INET_ESP=m
CONFIG_INET_IPCOMP=m

#
# IP: Netfilter Configuration
#
CONFIG_IP_NF_CONNTRACK=m
CONFIG_IP_NF_FTP=m
CONFIG_IP_NF_IRC=m
CONFIG_IP_NF_TFTP=m
CONFIG_IP_NF_AMANDA=m
CONFIG_IP_NF_QUEUE=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_LIMIT=m
CONFIG_IP_NF_MATCH_MAC=m
CONFIG_IP_NF_MATCH_PKTTYPE=m
CONFIG_IP_NF_MATCH_MARK=m
# CONFIG_IP_NF_MATCH_MULTIPORT is not set
# CONFIG_IP_NF_MATCH_TOS is not set
# CONFIG_IP_NF_MATCH_RECENT is not set
# CONFIG_IP_NF_MATCH_ECN is not set
# CONFIG_IP_NF_MATCH_DSCP is not set
# CONFIG_IP_NF_MATCH_AH_ESP is not set
CONFIG_IP_NF_MATCH_LENGTH=m
CONFIG_IP_NF_MATCH_TTL=m
CONFIG_IP_NF_MATCH_TCPMSS=m
CONFIG_IP_NF_MATCH_HELPER=m
CONFIG_IP_NF_MATCH_STATE=m
CONFIG_IP_NF_MATCH_CONNTRACK=m
# CONFIG_IP_NF_MATCH_UNCLEAN is not set
CONFIG_IP_NF_MATCH_OWNER=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
# CONFIG_IP_NF_TARGET_MIRROR is not set
CONFIG_IP_NF_NAT=m
CONFIG_IP_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_TARGET_REDIRECT=m
# CONFIG_IP_NF_NAT_LOCAL is not set
# CONFIG_IP_NF_NAT_SNMP_BASIC is not set
CONFIG_IP_NF_NAT_IRC=m
CONFIG_IP_NF_NAT_FTP=m
CONFIG_IP_NF_NAT_TFTP=m
CONFIG_IP_NF_NAT_AMANDA=m
CONFIG_IP_NF_MANGLE=m
# CONFIG_IP_NF_TARGET_TOS is not set
# CONFIG_IP_NF_TARGET_ECN is not set
# CONFIG_IP_NF_TARGET_DSCP is not set
CONFIG_IP_NF_TARGET_MARK=m
# CONFIG_IP_NF_TARGET_LOG is not set
# CONFIG_IP_NF_TARGET_ULOG is not set
# CONFIG_IP_NF_TARGET_TCPMSS is not set
# CONFIG_IP_NF_ARPTABLES is not set
# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
# CONFIG_IP_NF_COMPAT_IPFWADM is not set

#
# IP: Virtual Server Configuration
#
# CONFIG_IP_VS is not set
# CONFIG_IPV6 is not set
CONFIG_XFRM_USER=m

#
# SCTP Configuration (EXPERIMENTAL)
#
CONFIG_IPV6_SCTP__=y
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_LLC is not set
# CONFIG_DECNET is not set
# CONFIG_BRIDGE is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_FASTROUTE is not set
# CONFIG_NET_HW_FLOWCONTROL is not set

#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
CONFIG_NETDEVICES=y

#
# ARCnet devices
#
# CONFIG_ARCNET is not set
CONFIG_DUMMY=m
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set
# CONFIG_ETHERTAP is not set

#
# Ethernet (10 or 100Mbit)
#
CONFIG_NET_ETHERNET=y
# CONFIG_MII is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set

#
# Tulip family network device support
#
# CONFIG_NET_TULIP is not set
# CONFIG_AT1700 is not set
# CONFIG_DEPCA is not set
# CONFIG_HP100 is not set
# CONFIG_NET_ISA is not set
CONFIG_NET_PCI=y
# CONFIG_PCNET32 is not set
# CONFIG_AMD8111_ETH is not set
# CONFIG_ADAPTEC_STARFIRE is not set
# CONFIG_AC3200 is not set
# CONFIG_APRICOT is not set
# CONFIG_B44 is not set
# CONFIG_CS89x0 is not set
# CONFIG_DGRS is not set
# CONFIG_EEPRO100 is not set
CONFIG_E100=y
# CONFIG_LNE390 is not set
# CONFIG_FEALNX is not set
# CONFIG_NATSEMI is not set
# CONFIG_NE2K_PCI is not set
# CONFIG_NE3210 is not set
# CONFIG_ES3210 is not set
# CONFIG_8139CP is not set
# CONFIG_8139TOO is not set
# CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_NET_POCKET is not set

#
# Ethernet (1000 Mbit)
#
# CONFIG_ACENIC is not set
# CONFIG_DL2K is not set
# CONFIG_E1000 is not set
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set

#
# Ethernet (10000 Mbit)
#
# CONFIG_IXGB is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PLIP is not set
CONFIG_PPP=m
# CONFIG_PPP_MULTILINK is not set
# CONFIG_PPP_FILTER is not set
CONFIG_PPP_ASYNC=m
CONFIG_PPP_SYNC_TTY=m
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_BSDCOMP=m
# CONFIG_PPPOE is not set
# CONFIG_SLIP is not set

#
# Wireless LAN (non-hamradio)
#
CONFIG_NET_RADIO=y

#
# Obsolete Wireless cards support (pre-802.11)
#
CONFIG_STRIP=m
# CONFIG_ARLAN is not set
# CONFIG_WAVELAN is not set
CONFIG_PCMCIA_WAVELAN=m
CONFIG_PCMCIA_NETWAVE=m

#
# Wireless 802.11 Frequency Hopping cards support
#
CONFIG_PCMCIA_RAYCS=m

#
# Wireless 802.11b ISA/PCI cards support
#
CONFIG_AIRO=m
CONFIG_HERMES=m
CONFIG_PLX_HERMES=m
CONFIG_TMD_HERMES=m
CONFIG_PCI_HERMES=m

#
# Wireless 802.11b Pcmcia/Cardbus cards support
#
CONFIG_PCMCIA_HERMES=m
CONFIG_AIRO_CS=m
CONFIG_PCMCIA_ATMEL=m
CONFIG_NET_WIRELESS=y

#
# Token Ring devices (depends on LLC=y)
#
# CONFIG_NET_FC is not set
# CONFIG_RCPCI is not set
# CONFIG_SHAPER is not set

#
# Wan interfaces
#
# CONFIG_WAN is not set

#
# PCMCIA network device support
#
CONFIG_NET_PCMCIA=y
CONFIG_PCMCIA_3C589=m
CONFIG_PCMCIA_3C574=m
CONFIG_PCMCIA_FMVJ18X=m
CONFIG_PCMCIA_PCNET=m
CONFIG_PCMCIA_NMCLAN=m
CONFIG_PCMCIA_SMC91C92=m
CONFIG_PCMCIA_XIRC2PS=m
CONFIG_PCMCIA_AXNET=m

#
# Amateur Radio support
#
# CONFIG_HAMRADIO is not set

#
# IrDA (infrared) support
#
CONFIG_IRDA=m

#
# IrDA protocols
#
CONFIG_IRLAN=m
CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_IRDA_ULTRA=y

#
# IrDA options
#
CONFIG_IRDA_CACHE_LAST_LSAP=y
CONFIG_IRDA_FAST_RR=y
CONFIG_IRDA_DEBUG=y

#
# Infrared-port device drivers
#

#
# SIR device drivers
#
CONFIG_IRTTY_SIR=m

#
# Dongle support
#
# CONFIG_DONGLE is not set

#
# Old SIR device drivers
#
# CONFIG_IRTTY_OLD is not set
# CONFIG_IRPORT_SIR is not set

#
# Old Serial dongle support
#

#
# FIR device drivers
#
CONFIG_USB_IRDA=m
# CONFIG_NSC_FIR is not set
# CONFIG_WINBOND_FIR is not set
# CONFIG_TOSHIBA_OLD is not set
CONFIG_TOSHIBA_FIR=m
# CONFIG_SMC_IRCC_OLD is not set
# CONFIG_SMC_IRCC_FIR is not set
# CONFIG_ALI_FIR is not set
CONFIG_VLSI_FIR=m

#
# ISDN subsystem
#
# CONFIG_ISDN_BOOL is not set

#
# Telephony Support
#
# CONFIG_PHONE is not set

#
# Input device support
#
CONFIG_INPUT=y

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
CONFIG_INPUT_MOUSEDEV_PSAUX=y
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
CONFIG_SOUND_GAMEPORT=y
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PARKBD is not set
CONFIG_SERIO_PCIPS2=y

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
CONFIG_INPUT_MOUSE=y
CONFIG_MOUSE_PS2=y
# CONFIG_MOUSE_SERIAL is not set
# CONFIG_MOUSE_INPORT is not set
# CONFIG_MOUSE_LOGIBM is not set
# CONFIG_MOUSE_PC110PAD is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_PCSPKR=y
# CONFIG_INPUT_UINPUT is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
# CONFIG_SERIAL_8250_CONSOLE is not set
# CONFIG_SERIAL_8250_CS is not set
# CONFIG_SERIAL_8250_ACPI is not set
# CONFIG_SERIAL_8250_EXTENDED is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
CONFIG_PRINTER=y
# CONFIG_LP_CONSOLE is not set
# CONFIG_PPDEV is not set
# CONFIG_TIPAR is not set

#
# I2C support
#
CONFIG_I2C=m
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_PROSAVAGE=m
CONFIG_I2C_PHILIPSPAR=m
CONFIG_I2C_ELV=m
CONFIG_I2C_VELLEMAN=m
CONFIG_SCx200_ACB=m
CONFIG_I2C_ALGOPCF=m
CONFIG_I2C_ELEKTOR=m
CONFIG_I2C_CHARDEV=m

#
# I2C Hardware Sensors Mainboard support
#
CONFIG_I2C_ALI1535=m
CONFIG_I2C_ALI15X3=m
CONFIG_I2C_AMD756=m
CONFIG_I2C_AMD8111=m
CONFIG_I2C_I801=m
# CONFIG_I2C_ISA is not set
CONFIG_I2C_PIIX4=m
CONFIG_I2C_SIS96X=m
CONFIG_I2C_VIAPRO=m

#
# I2C Hardware Sensors Chip support
#
CONFIG_SENSORS_ADM1021=m
CONFIG_SENSORS_IT87=m
CONFIG_SENSORS_LM75=m
CONFIG_SENSORS_LM85=m
CONFIG_SENSORS_LM78=m
CONFIG_SENSORS_VIA686A=m
CONFIG_SENSORS_W83781D=m
CONFIG_I2C_SENSOR=m

#
# Mice
#
# CONFIG_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
CONFIG_HW_RANDOM=y
# CONFIG_NVRAM is not set
CONFIG_RTC=y
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_SONYPI is not set

#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
CONFIG_AGP=y
# CONFIG_AGP_ALI is not set
# CONFIG_AGP_AMD is not set
# CONFIG_AGP_AMD_8151 is not set
CONFIG_AGP_INTEL=y
# CONFIG_AGP_NVIDIA is not set
# CONFIG_AGP_SIS is not set
# CONFIG_AGP_SWORKS is not set
# CONFIG_AGP_VIA is not set
CONFIG_DRM=y
# CONFIG_DRM_TDFX is not set
# CONFIG_DRM_GAMMA is not set
# CONFIG_DRM_R128 is not set
# CONFIG_DRM_RADEON is not set
# CONFIG_DRM_I810 is not set
# CONFIG_DRM_I830 is not set
# CONFIG_DRM_MGA is not set

#
# PCMCIA character devices
#
CONFIG_SYNCLINK_CS=m
# CONFIG_MWAVE is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_HANGCHECK_TIMER is not set

#
# Multimedia devices
#
CONFIG_VIDEO_DEV=m

#
# Video For Linux
#
CONFIG_VIDEO_PROC_FS=y

#
# Video Adapters
#
CONFIG_VIDEO_BT848=m
CONFIG_VIDEO_PMS=m
CONFIG_VIDEO_BWQCAM=m
CONFIG_VIDEO_CQCAM=m
CONFIG_VIDEO_W9966=m
CONFIG_VIDEO_CPIA=m
CONFIG_VIDEO_CPIA_PP=m
CONFIG_VIDEO_CPIA_USB=m
# CONFIG_VIDEO_SAA5249 is not set
# CONFIG_TUNER_3036 is not set
CONFIG_VIDEO_STRADIS=m
# CONFIG_VIDEO_ZORAN is not set
# CONFIG_VIDEO_ZR36120 is not set
CONFIG_VIDEO_SAA7134=m
# CONFIG_VIDEO_MXB is not set
# CONFIG_VIDEO_DPC is not set

#
# Radio Adapters
#
# CONFIG_RADIO_CADET is not set
# CONFIG_RADIO_RTRACK is not set
# CONFIG_RADIO_RTRACK2 is not set
# CONFIG_RADIO_AZTECH is not set
# CONFIG_RADIO_GEMTEK is not set
# CONFIG_RADIO_GEMTEK_PCI is not set
# CONFIG_RADIO_MAXIRADIO is not set
# CONFIG_RADIO_MAESTRO is not set
# CONFIG_RADIO_SF16FMI is not set
# CONFIG_RADIO_TERRATEC is not set
# CONFIG_RADIO_TRUST is not set
# CONFIG_RADIO_TYPHOON is not set
# CONFIG_RADIO_ZOLTRIX is not set

#
# Digital Video Broadcasting Devices
#
# CONFIG_DVB is not set
CONFIG_VIDEO_VIDEOBUF=m
CONFIG_VIDEO_TUNER=m
CONFIG_VIDEO_BUF=m
CONFIG_VIDEO_BTCX=m

#
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
# CONFIG_EXT3_FS_SECURITY is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
CONFIG_REISERFS_FS=y
# CONFIG_REISERFS_CHECK is not set
# CONFIG_REISERFS_PROC_INFO is not set
# CONFIG_JFS_FS is not set
CONFIG_FS_POSIX_ACL=y
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
CONFIG_AUTOFS4_FS=y

#
# CD-ROM/DVD Filesystems
#
CONFIG_ISO9660_FS=y
CONFIG_JOLIET=y
CONFIG_ZISOFS=y
CONFIG_ZISOFS_FS=y
CONFIG_UDF_FS=y

#
# DOS/FAT/NT Filesystems
#
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
CONFIG_VFAT_FS=y
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_DEVFS_FS=y
CONFIG_DEVFS_MOUNT=y
# CONFIG_DEVFS_DEBUG is not set
CONFIG_DEVPTS_FS=y
CONFIG_DEVPTS_FS_XATTR=y
# CONFIG_DEVPTS_FS_SECURITY is not set
CONFIG_TMPFS=y
CONFIG_RAMFS=y

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_HFS_FS=m
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
CONFIG_CRAMFS=m
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Network File Systems
#
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V4 is not set
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V4 is not set
# CONFIG_NFSD_TCP is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_GSS is not set
CONFIG_SMB_FS=m
CONFIG_SMB_NLS_DEFAULT=y
CONFIG_SMB_NLS_REMOTE="cp437"
CONFIG_CIFS=m
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_INTERMEZZO_FS is not set
# CONFIG_AFS_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_SMB_NLS=y
CONFIG_NLS=y

#
# Native Language Support
#
CONFIG_NLS_DEFAULT="iso8859-1"
CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
CONFIG_NLS_CODEPAGE_850=y
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_936 is not set
# CONFIG_NLS_CODEPAGE_950 is not set
# CONFIG_NLS_CODEPAGE_932 is not set
# CONFIG_NLS_CODEPAGE_949 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_ISO8859_13 is not set
# CONFIG_NLS_ISO8859_14 is not set
CONFIG_NLS_ISO8859_15=y
# CONFIG_NLS_KOI8_R is not set
# CONFIG_NLS_KOI8_U is not set
# CONFIG_NLS_UTF8 is not set

#
# Graphics support
#
CONFIG_FB=y
# CONFIG_FB_CIRRUS is not set
# CONFIG_FB_PM2 is not set
# CONFIG_FB_CYBER2000 is not set
# CONFIG_FB_IMSTT is not set
# CONFIG_FB_VGA16 is not set
CONFIG_FB_VESA=y
CONFIG_VIDEO_SELECT=y
# CONFIG_FB_HGA is not set
# CONFIG_FB_RIVA is not set
# CONFIG_FB_I810 is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_RADEON is not set
# CONFIG_FB_ATY128 is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_SIS is not set
# CONFIG_FB_NEOMAGIC is not set
# CONFIG_FB_3DFX is not set
# CONFIG_FB_VOODOO1 is not set
# CONFIG_FB_TRIDENT is not set
# CONFIG_FB_PM3 is not set
# CONFIG_FB_VIRTUAL is not set

#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
# CONFIG_MDA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_PCI_CONSOLE=y
# CONFIG_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y

#
# Logo configuration
#
CONFIG_LOGO=y
CONFIG_LOGO_LINUX_MONO=y
CONFIG_LOGO_LINUX_VGA16=y
CONFIG_LOGO_LINUX_CLUT224=y

#
# Sound
#
CONFIG_SOUND=y

#
# Advanced Linux Sound Architecture
#
CONFIG_SND=y
CONFIG_SND_SEQUENCER=y
# CONFIG_SND_SEQ_DUMMY is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_RTCTIMER=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set

#
# Generic devices
#
# CONFIG_SND_DUMMY is not set
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set

#
# ISA devices
#
# CONFIG_SND_AD1848 is not set
# CONFIG_SND_CS4231 is not set
# CONFIG_SND_CS4232 is not set
# CONFIG_SND_CS4236 is not set
# CONFIG_SND_ES1688 is not set
# CONFIG_SND_ES18XX is not set
# CONFIG_SND_GUSCLASSIC is not set
# CONFIG_SND_GUSEXTREME is not set
# CONFIG_SND_GUSMAX is not set
# CONFIG_SND_INTERWAVE is not set
# CONFIG_SND_INTERWAVE_STB is not set
# CONFIG_SND_OPTI92X_AD1848 is not set
# CONFIG_SND_OPTI92X_CS4231 is not set
# CONFIG_SND_OPTI93X is not set
# CONFIG_SND_SB8 is not set
# CONFIG_SND_SB16 is not set
# CONFIG_SND_SBAWE is not set
# CONFIG_SND_WAVEFRONT is not set
# CONFIG_SND_CMI8330 is not set
# CONFIG_SND_OPL3SA2 is not set
# CONFIG_SND_SGALAXY is not set
# CONFIG_SND_SSCAPE is not set

#
# PCI devices
#
# CONFIG_SND_ALI5451 is not set
# CONFIG_SND_AZT3328 is not set
# CONFIG_SND_CS46XX is not set
# CONFIG_SND_CS4281 is not set
# CONFIG_SND_EMU10K1 is not set
# CONFIG_SND_KORG1212 is not set
# CONFIG_SND_NM256 is not set
# CONFIG_SND_RME32 is not set
# CONFIG_SND_RME96 is not set
# CONFIG_SND_RME9652 is not set
# CONFIG_SND_HDSP is not set
# CONFIG_SND_TRIDENT is not set
# CONFIG_SND_YMFPCI is not set
# CONFIG_SND_ALS4000 is not set
# CONFIG_SND_CMIPCI is not set
# CONFIG_SND_ENS1370 is not set
# CONFIG_SND_ENS1371 is not set
# CONFIG_SND_ES1938 is not set
# CONFIG_SND_ES1968 is not set
# CONFIG_SND_MAESTRO3 is not set
# CONFIG_SND_FM801 is not set
# CONFIG_SND_ICE1712 is not set
# CONFIG_SND_ICE1724 is not set
CONFIG_SND_INTEL8X0=y
# CONFIG_SND_SONICVIBES is not set
# CONFIG_SND_VIA82XX is not set
# CONFIG_SND_VX222 is not set

#
# ALSA USB devices
#
# CONFIG_SND_USB_AUDIO is not set

#
# PCMCIA devices
#
# CONFIG_SND_VXPOCKET is not set
# CONFIG_SND_VXP440 is not set

#
# Open Sound System
#
# CONFIG_SOUND_PRIME is not set

#
# USB support
#
CONFIG_USB=y
# CONFIG_USB_DEBUG is not set

#
# Miscellaneous USB options
#
CONFIG_USB_DEVICEFS=y
CONFIG_USB_BANDWIDTH=y
# CONFIG_USB_DYNAMIC_MINORS is not set

#
# USB Host Controller Drivers
#
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_OHCI_HCD is not set
CONFIG_USB_UHCI_HCD=y

#
# USB Device Class drivers
#
CONFIG_USB_AUDIO=m
CONFIG_USB_BLUETOOTH_TTY=m
CONFIG_USB_MIDI=m
CONFIG_USB_ACM=m
CONFIG_USB_PRINTER=m
CONFIG_USB_STORAGE=m
CONFIG_USB_STORAGE_DEBUG=y
CONFIG_USB_STORAGE_DATAFAB=y
CONFIG_USB_STORAGE_FREECOM=y
CONFIG_USB_STORAGE_ISD200=y
CONFIG_USB_STORAGE_DPCM=y
CONFIG_USB_STORAGE_HP8200e=y
CONFIG_USB_STORAGE_SDDR09=y
CONFIG_USB_STORAGE_SDDR55=y
CONFIG_USB_STORAGE_JUMPSHOT=y

#
# USB Human Interface Devices (HID)
#
# CONFIG_USB_HID is not set

#
# USB HID Boot Protocol drivers
#
# CONFIG_USB_KBD is not set
# CONFIG_USB_MOUSE is not set
# CONFIG_USB_AIPTEK is not set
# CONFIG_USB_WACOM is not set
# CONFIG_USB_KBTAB is not set
# CONFIG_USB_POWERMATE is not set
# CONFIG_USB_XPAD is not set

#
# USB Imaging devices
#
# CONFIG_USB_MDC800 is not set
# CONFIG_USB_SCANNER is not set
# CONFIG_USB_MICROTEK is not set
# CONFIG_USB_HPUSBSCSI is not set

#
# USB Multimedia devices
#
# CONFIG_USB_DABUSB is not set
# CONFIG_USB_VICAM is not set
# CONFIG_USB_DSBR is not set
CONFIG_USB_IBMCAM=m
CONFIG_USB_KONICAWC=m
CONFIG_USB_OV511=m
CONFIG_USB_PWC=m
CONFIG_USB_SE401=m
CONFIG_USB_STV680=m

#
# USB Network adaptors
#
# CONFIG_USB_AX8817X is not set
# CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_PEGASUS is not set
# CONFIG_USB_RTL8150 is not set
# CONFIG_USB_USBNET is not set

#
# USB port drivers
#
# CONFIG_USB_USS720 is not set

#
# USB Serial Converter support
#
CONFIG_USB_SERIAL=m
CONFIG_USB_SERIAL_GENERIC=y
# CONFIG_USB_SERIAL_BELKIN is not set
# CONFIG_USB_SERIAL_WHITEHEAT is not set
# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
# CONFIG_USB_SERIAL_EMPEG is not set
# CONFIG_USB_SERIAL_FTDI_SIO is not set
CONFIG_USB_SERIAL_VISOR=m
# CONFIG_USB_SERIAL_IPAQ is not set
# CONFIG_USB_SERIAL_IR is not set
# CONFIG_USB_SERIAL_EDGEPORT is not set
# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
# CONFIG_USB_SERIAL_KEYSPAN is not set
# CONFIG_USB_SERIAL_KLSI is not set
# CONFIG_USB_SERIAL_KOBIL_SCT is not set
# CONFIG_USB_SERIAL_MCT_U232 is not set
# CONFIG_USB_SERIAL_PL2303 is not set
# CONFIG_USB_SERIAL_SAFE is not set
# CONFIG_USB_SERIAL_CYBERJACK is not set
# CONFIG_USB_SERIAL_XIRCOM is not set
# CONFIG_USB_SERIAL_OMNINET is not set

#
# USB Miscellaneous drivers
#
# CONFIG_USB_EMI26 is not set
# CONFIG_USB_TIGL is not set
# CONFIG_USB_AUERSWALD is not set
# CONFIG_USB_RIO500 is not set
# CONFIG_USB_BRLVGER is not set
# CONFIG_USB_LCD is not set
# CONFIG_USB_TEST is not set
# CONFIG_USB_GADGET is not set

#
# Bluetooth support
#
# CONFIG_BT is not set

#
# Profiling support
#
# CONFIG_PROFILING is not set

#
# Kernel hacking
#
# CONFIG_DEBUG_KERNEL is not set
CONFIG_DEBUG_SPINLOCK_SLEEP=y
CONFIG_FRAME_POINTER=y
CONFIG_X86_EXTRA_IRQS=y
CONFIG_X86_FIND_SMP_CONFIG=y
CONFIG_X86_MPPARSE=y

#
# Security options
#
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
CONFIG_CRYPTO=y
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_NULL=m
CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MD5=m
CONFIG_CRYPTO_SHA1=m
CONFIG_CRYPTO_SHA256=m
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_DES=m
CONFIG_CRYPTO_BLOWFISH=m
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_AES=m
CONFIG_CRYPTO_DEFLATE=m
# CONFIG_CRYPTO_TEST is not set

#
# Library routines
#
CONFIG_CRC32=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
CONFIG_X86_BIOS_REBOOT=y
From willy at debian.org  Fri Jul 25 14:37:58 2003
From: willy at debian.org (Matthew Wilcox)
Date: Fri Jul 25 13:38:02 2003
Subject: pcmcia 2.6.0-test1 and SanDisk adapter
In-Reply-To: <1059120353.4175.13.camel@trantor>
References: <1059120353.4175.13.camel@trantor>
Message-ID: <20030725123758.GJ1485@parcelfarce.linux.theplanet.co.uk>

On Fri, Jul 25, 2003 at 10:05:53AM +0200, Jose Andres Arias Velichko wrote:
> Hi All,
> 
>         I've get the next problem using 2.6.0-test1 kernel and kernel
> pcmcia
> package: When I plug in the SanDisk CompactFlash PC Card Adapter, the
> card is detected but I get next oops. In dmesg appears the next
> messages:

this looks like an IDE or devfs problem, not pcmcia.  if you disable devfs,
does the problem go away?

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

From cretin at gentoo.org  Sun Jul 27 11:46:22 2003
From: cretin at gentoo.org (Stefan Jones)
Date: Sun Jul 27 10:46:26 2003
Subject: [2.6.0-test1] yenta_socket.c:yenta_get_status returns bad
 value compared to 2.4
In-Reply-To: <1059244318.3400.17.camel@localhost>
References: <1059244318.3400.17.camel@localhost>
Message-ID: <1059299182.3383.18.camel@localhost>

OSDL wrote:
> 
> Which is interesting in itself. It's entirely possible that we should 
> just ignore the 16-bit status when it comes to the SS_POWERON logic. 
> 
> 
> Does the card actually _work_ when you do your hack? Or does it just 
> stop the hang? 
> 
It just stopped the hang, which caused me to think I was onto something.

I will continue my debugging and take this to the pcmcia list,

so far with printk's and early returns I have got the following:

The ds_ioctl's are triggering the hang,

ioctl calls to DS_ADJUST_RESOURCE_INFO and DS_GET_STATUS work fine (all
others are quoted out and are not called before the hang )

But the first call to DS_VALIDATE_CIS causes the machine to hang.
I have tracked down the hang to 

pcmcia_get_first_tuple called from
pcmcia_validate_cis called from
ds_ioctl

in cistpl.c

Will narrow it down some more today.

PS. the card is:
Netgear 802.11b wireless PC card 16-bit PCMCIA MA401
( which works fine with 2.4.21 )

For you pcmcia ppl:
http://www.ussg.iu.edu/hypermail/linux/kernel/0307.3/0166.html
( hardware details )
http://www.ussg.iu.edu/hypermail/linux/kernel/0307.3/0690.html
( my misdiagnosis )

Any tips, known problem?

Stefan


From cretin at gentoo.org  Sun Jul 27 18:43:31 2003
From: cretin at gentoo.org (Stefan Jones)
Date: Sun Jul 27 17:43:36 2003
Subject: [PATCH]  Disable (false?) IRQ check on 2.6 in orinoco_cs (was:
 yenta_socket.c:yenta_get_status returns bad value compared to 2.4)
In-Reply-To: <1059299182.3383.18.camel@localhost>
References: <1059244318.3400.17.camel@localhost>
	 <1059299182.3383.18.camel@localhost>
Message-ID: <1059324210.4316.21.camel@localhost>

Ok here is the report,

I had 

CONFIG_ISA=y
in my .config which in turn set
CONFIG_PCMCIA_PROBE=y

which enabled some invalid (for me) code in
linux/drivers/pcmcia/rsrc_mgr.c

as the machine does not need ISA 

( I always enable it by default as a few years ago an ISA free machine
wouldn't boot without it! )

This caused the hangs. With CONFIG_ISA unset it's fine.

Now when the kernel loaded the orinoco_cs driver I got:

Jul 27 17:15:37 [kernel] orinoco.c 0.13e (David Gibson
<hermes@gibson.dropbear.id.au> and others)
Jul 27 17:15:37 [kernel] orinoco_cs.c 0.13e (David Gibson
<hermes@gibson.dropbear.id.au> and others)
Jul 27 17:15:37 [kernel] orinoco_cs: RequestIRQ: Resource in use

Now I guessed that was an artifact of irq sharing + new kernel internals
so I used the patch: ( or just luck )

--- orinoco_cs.c.jj	2003-07-27 17:20:28.000000000 +0100
+++ orinoco_cs.c	2003-07-27 17:20:16.000000000 +0100
@@ -469,7 +469,7 @@
   		link->irq.Handler = orinoco_interrupt; 
   		link->irq.Instance = dev; 
 		
-		CS_CHECK(RequestIRQ, link->handle, &link->irq);
+		/*CS_CHECK(RequestIRQ, link->handle, &link->irq);*/
 	}
 
 	/* We initialize the hermes structure before completing PCMCIA

And the wireless card loaded with the normal blurb.

Jul 27 17:18:24 [cardmgr] socket 0: Netgear MA401RA
Jul 27 17:18:24 [cardmgr] executing: 'modprobe hermes'
Jul 27 17:18:24 [cardmgr] executing: 'modprobe orinoco'
Jul 27 17:18:24 [cardmgr] executing: 'modprobe orinoco_cs'

Now this fix is needed for me, your millage will vary.

Sorry for the spam

Stefan


From hermes at gibson.dropbear.id.au  Mon Jul 28 00:16:11 2003
From: hermes at gibson.dropbear.id.au (David Gibson)
Date: Mon Jul 28 04:28:57 2003
Subject: [Orinoco-users] Re: [PATCH]  Disable (false?) IRQ check on 2.6
 in orinoco_cs (was: yenta_socket.c:yenta_get_status returns bad
 value compared to 2.4)
In-Reply-To: <1059324210.4316.21.camel@localhost>
References: <1059244318.3400.17.camel@localhost>
	<1059299182.3383.18.camel@localhost> <1059324210.4316.21.camel@localhost>
Message-ID: <20030728031611.GA20573@zax>

On Sun, Jul 27, 2003 at 05:43:31PM +0100, Stefan Jones wrote:
> Ok here is the report,
> 
> I had 
> 
> CONFIG_ISA=y
> in my .config which in turn set
> CONFIG_PCMCIA_PROBE=y
> 
> which enabled some invalid (for me) code in
> linux/drivers/pcmcia/rsrc_mgr.c
> 
> as the machine does not need ISA 

Yes it does.  16-bit PCMCIA (PC-Card) is kinda-sorta an extension to
the ISA bus, so for 16-bit cards like the orinoco to work properly you
will need ISA support.  If your patch below works at all, it is by
sheer luck.

-- 
David Gibson			| For every complex problem there is a
david@gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

From cretin at gentoo.org  Mon Jul 28 09:02:50 2003
From: cretin at gentoo.org (Stefan Jones)
Date: Mon Jul 28 08:02:56 2003
Subject: [Orinoco-users] Re: [PATCH]  Disable (false?) IRQ check on 2.6
 in orinoco_cs (was: yenta_socket.c:yenta_get_status returns bad value
 compared to 2.4)
In-Reply-To: <20030728031611.GA20573@zax>
References: <1059244318.3400.17.camel@localhost>
	<1059324210.4316.21.camel@localhost>	 <20030728031611.GA20573@zax>
Message-ID: <1059375770.3403.16.camel@localhost>

On Mon, 2003-07-28 at 04:16, David Gibson wrote:
> On Sun, Jul 27, 2003 at 05:43:31PM +0100, Stefan Jones wrote:
> > Ok here is the report,
> > 
> > I had 
> > 
> > CONFIG_ISA=y
> > in my .config which in turn set
> > CONFIG_PCMCIA_PROBE=y
> > 
> > which enabled some invalid (for me) code in
> > linux/drivers/pcmcia/rsrc_mgr.c
> > 
> > as the machine does not need ISA 
> 
> Yes it does.  16-bit PCMCIA (PC-Card) is kinda-sorta an extension to
> the ISA bus, so for 16-bit cards like the orinoco to work properly you
> will need ISA support.  If your patch below works at all, it is by
> sheer luck.

Ok, then the ISA / PCMCIA_PROBE code in the 2.6 kernel needs to be fixed
so that it does not cause my machine to hang (or is this situation very
unique / a freak ? ).

Anyone have any tips / ideas how to do that, as a taster of the problem,
the first call to the function
rsrc_mgr.c:void validate_mem(struct pcmcia_socket *s)
causes the hang for me.

I will fetch another PCMCIA card and test it also and maybe another
machine.

PS. 2.4 works fine so something is amiss .....

Stefan


From cretin at gentoo.org  Mon Jul 28 10:40:56 2003
From: cretin at gentoo.org (Stefan Jones)
Date: Mon Jul 28 09:41:04 2003
Subject: [Orinoco-users] Re: [PATCH]  Disable (false?) IRQ check on 2.6
 in orinoco_cs (was: yenta_socket.c:yenta_get_status returns bad
 value compared to 2.4)
In-Reply-To: <1059375770.3403.16.camel@localhost>
References: <1059244318.3400.17.camel@localhost>
	<1059324210.4316.21.camel@localhost> <20030728031611.GA20573@zax>
	<1059375770.3403.16.camel@localhost>
Message-ID: <20030728084055.GA3510%cretin@churchillrandoms.co.uk>

On Mon, Jul 28, 2003 at 08:02:50AM +0100, Stefan Jones wrote:
> > > I had 
> > > 
> > > CONFIG_ISA=y
> > > in my .config which in turn set
> > > CONFIG_PCMCIA_PROBE=y

> > Yes it does.  16-bit PCMCIA (PC-Card) is kinda-sorta an extension to
> > the ISA bus, so for 16-bit cards like the orinoco to work properly you
> > will need ISA support.  If your patch below works at all, it is by
> > sheer luck.

I just found this on the lkml by Alan Cox:

PATCH: fix pcmcia_cs without ISA

http://www.ussg.iu.edu/hypermail/linux/kernel/0307.3/0992.html

related? What impact?

Stefan

From jgruber at tampabay.rr.com  Mon Jul 28 08:04:13 2003
From: jgruber at tampabay.rr.com (Joseph Gruber)
Date: Mon Jul 28 12:04:26 2003
Subject: [Orinoco-users] Re: [PATCH]  Disable (false?) IRQ check on 2.6
 in orinoco_cs (was: yenta_socket.c:yenta_get_status returns bad
 value	compared to 2.4)
In-Reply-To: <1059375770.3403.16.camel@localhost>
Message-ID: <200307281104.h6SB4CqN008419@ms-smtp-01.tampabay.rr.com>

Are you talking about hanging at "Starting pcmcia" during the boot process? 

> -----Original Message-----
> From: orinoco-users-admin@lists.sourceforge.net 
> [mailto:orinoco-users-admin@lists.sourceforge.net] On Behalf 
> Of Stefan Jones
> Sent: Monday, July 28, 2003 3:03 AM
> To: David Gibson
> Cc: linux-pcmcia@lists.infradead.org; 
> orinoco-users@lists.sourceforge.net
> Subject: Re: [Orinoco-users] Re: [PATCH] Disable (false?) IRQ 
> check on 2.6 in orinoco_cs (was: 
> yenta_socket.c:yenta_get_status returns bad value compared to 2.4)
> 
> On Mon, 2003-07-28 at 04:16, David Gibson wrote:
> > On Sun, Jul 27, 2003 at 05:43:31PM +0100, Stefan Jones wrote:
> > > Ok here is the report,
> > > 
> > > I had 
> > > 
> > > CONFIG_ISA=y
> > > in my .config which in turn set
> > > CONFIG_PCMCIA_PROBE=y
> > > 
> > > which enabled some invalid (for me) code in
> > > linux/drivers/pcmcia/rsrc_mgr.c
> > > 
> > > as the machine does not need ISA 
> > 
> > Yes it does.  16-bit PCMCIA (PC-Card) is kinda-sorta an extension to
> > the ISA bus, so for 16-bit cards like the orinoco to work 
> properly you
> > will need ISA support.  If your patch below works at all, it is by
> > sheer luck.
> 
> Ok, then the ISA / PCMCIA_PROBE code in the 2.6 kernel needs 
> to be fixed
> so that it does not cause my machine to hang (or is this 
> situation very
> unique / a freak ? ).
> 
> Anyone have any tips / ideas how to do that, as a taster of 
> the problem,
> the first call to the function
> rsrc_mgr.c:void validate_mem(struct pcmcia_socket *s)
> causes the hang for me.
> 
> I will fetch another PCMCIA card and test it also and maybe another
> machine.
> 
> PS. 2.4 works fine so something is amiss .....
> 
> Stefan
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet
> _072303_01/01
> _______________________________________________
> Orinoco-users mailing list
> Orinoco-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/orinoco-users
> 



From cretin at gentoo.org  Mon Jul 28 13:38:39 2003
From: cretin at gentoo.org (Stefan Jones)
Date: Mon Jul 28 12:37:14 2003
Subject: [Orinoco-users] Re: [PATCH]  Disable (false?) IRQ check on 
 2.6	in orinoco_cs (was: yenta_socket.c:yenta_get_status returns bad 
 value	compared to 2.4)
In-Reply-To: <200307281104.h6SB4CqN008419@ms-smtp-01.tampabay.rr.com>
References: <1059375770.3403.16.camel@localhost>
    <200307281104.h6SB4CqN008419@ms-smtp-01.tampabay.rr.com>
Message-ID: <36507.81.136.139.209.1059392319.squirrel@webmail.churchillrandoms.co.uk>

Joseph Gruber said:
> Are you talking about hanging at "Starting pcmcia" during the boot
> process?
>

No, when I insert a pcmcia Netgear MA401 wireless card. "Starting pcmcia"
works fine, with no pcmcia card in the slot.

When I insert the pcmcia card, cardmgr starts it's ioctl things apon
recieving a 0x04 from the pcmcia charater device.

It first calls ds_ioctrl(DS_GET_STATUS) and then
ds_ioctrl(DS_ADJUST_RESOURCE_INFO). This works fine

Then it does ds_ioctrl(DS_VALIDATE_CIS)

Which goes to cistpl.c which then goes to the "duff" funtion
validate_mem() inrsrc_mgr.c .
This is with ISA on, so PCMCIA_PROBE is also on.

The machine is now hung with a blank screen with all the hardware going
screwy!

Now if I unset ISA then it uses a different validate_mem() and all works
fine. ( well the wireless card appears on ifconfig eth1 after the patch to
orinoco_cs, I haven't got a base station though ... the dhcpd packets it
sends out are logged in ifconfig )

If I zap/hide all pcmcia device drivers then the hang still occours so it
is in the core pcmcia system, not a faulty device driver.

I have also tried the cardmgr patch from the linux-pcmcia list.

For full system config see:
http://www.ussg.iu.edu/hypermail/linux/kernel/0307.3/0166.html
The machine is an Acer Aspire 1300.

Thanks for reading,

Stefan

From hermes at gibson.dropbear.id.au  Thu Jul 31 10:40:46 2003
From: hermes at gibson.dropbear.id.au (David Gibson)
Date: Thu Jul 31 09:48:58 2003
Subject: [Orinoco-users] Re: [PATCH]  Disable (false?) IRQ check on 2.6
 in orinoco_cs (was: yenta_socket.c:yenta_get_status returns bad
 value compared to 2.4)
In-Reply-To: <20030728084055.GA3510%cretin@churchillrandoms.co.uk>
References: <1059375770.3403.16.camel@localhost>
	<20030728084055.GA3510%cretin@churchillrandoms.co.uk>
Message-ID: <20030731084046.GF29293@zax>

On Mon, Jul 28, 2003 at 09:40:56AM +0100, Stefan Jones wrote:
> On Mon, Jul 28, 2003 at 08:02:50AM +0100, Stefan Jones wrote:
> > > > I had 
> > > > 
> > > > CONFIG_ISA=y
> > > > in my .config which in turn set
> > > > CONFIG_PCMCIA_PROBE=y
> 
> > > Yes it does.  16-bit PCMCIA (PC-Card) is kinda-sorta an extension to
> > > the ISA bus, so for 16-bit cards like the orinoco to work properly you
> > > will need ISA support.  If your patch below works at all, it is by
> > > sheer luck.
> 
> I just found this on the lkml by Alan Cox:
> 
> PATCH: fix pcmcia_cs without ISA
> 
> http://www.ussg.iu.edu/hypermail/linux/kernel/0307.3/0992.html
> 
> related? What impact?

Sorry, don't know I'm afraid.  I don't know why ISA support would have
broken for your machine in recent kernels.

-- 
David Gibson			| For every complex problem there is a
david@gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

From cretin at gentoo.org  Thu Jul 31 18:36:56 2003
From: cretin at gentoo.org (Stefan Jones)
Date: Thu Jul 31 17:37:05 2003
Subject: [Orinoco-users] Re: [PATCH]  Disable (false?) IRQ check on 2.6
 in orinoco_cs (was: yenta_socket.c:yenta_get_status returns bad value
 compared to 2.4)
In-Reply-To: <20030731084046.GF29293@zax>
References: <1059375770.3403.16.camel@localhost>
	 <20030728084055.GA3510%cretin@churchillrandoms.co.uk>
	 <20030731084046.GF29293@zax>
Message-ID: <1059669415.8639.5.camel@localhost>

On Thu, 2003-07-31 at 09:40, David Gibson wrote:
> 
> Sorry, don't know I'm afraid.  I don't know why ISA support would have
> broken for your machine in recent kernels.

Thanks for looking.

Well I guess it is shear bad luck, because if I use 
"insmod pcmcia_core probe_mem=0" then all is fine. Both my testing cards
work without any bother with CONFIG_ISA.

So I suppose some subtle change made the memory probe alter the scanned
addresses slightly, which then hit a bad spot causing the hang.

Not to matter, I can live with this bug now, may find the bad memory
address some day ...

Stefan


