Subject: Re: i2c device interrupt handlers
To: Jared D. McNeill <jmcneill@invisible.ca>
From: Jachym Holecek <freza@dspfpga.com>
List: tech-kern
Date: 02/05/2007 19:05:27
# Jared D. McNeill 2007-02-05:
> Something has gone wrong though; in the original non-kthread  
> implementation I had, I was successfully trapping the interrupt and  
> responding in time, and I could eject / close the tray (the system  
> would freeze shortly after, but at least wouldn't reset). Now with  
> this kthread implementation, the system resets immediately after I  
> press the eject button.
> 
> Is there something obviously wrong with my logic here? Patch is  
> attached.

RCS file: /cvsroot/src/sys/dev/i2c/i2cvar.h,v
@@ -88,6 +94,12 @@
 	int	(*ic_initiate_xfer)(void *, i2c_addr_t, int);
 	int	(*ic_read_byte)(void *, uint8_t *, int);
 	int	(*ic_write_byte)(void *, uint8_t, int);
+
+	LIST_HEAD(, ic_intr_list) ic_list;
+	int	ic_running;
+	int	ic_pending;
+	struct proc *ic_intr_thread;
+	const char *ic_devname;
 } *i2c_tag_t;

ic_running & ic_pending need volatile, ic_list should have some protection.
Not sure this will solve the problem... :)

	-- Jachym