On Fri, Mar 11, 2016 at 11:56:41AM -0700, Theo de Raadt wrote:
> > But what we really should do the SMBALERT# dance of reading the Alert
> > Response Address, which will make sure the device de-asserts the
> > SMBALERT# line.
>
> Ah, I did not check the spec. That sounds very reasonable...
I've tried doing this without success.
I'm getting a slave address in polling mode. It's always 0x0 which
is not a valid address for a slave device. Most likely a bug in the
crude changes I've made. Or perhaps the hardware is really triggering
a bogus alert.
> > If we're going with this diff, it would be good to add an XXX comment
> > that we ignore SMBALERT# for now.
>
> I later asked for that ridiculous if statement to be split into different
> blocks, for the various reasons.
I now prefer this diff. I can make additional code cleanups in this driver
in separate commits. But this is enough to fix the problem and matches what
FreeBSD (dev/ichsmb) and Linux (drivers/i2c/busses/i2c-i801.c) do with
regard to SMBALERT# -- just ignore it.
OK?
Index: ichiic.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/ichiic.c,v
retrieving revision 1.37
diff -u -p -r1.37 ichiic.c
--- ichiic.c 7 Dec 2015 02:56:36 -0000 1.37
+++ ichiic.c 12 Mar 2016 13:18:15 -0000
@@ -338,11 +338,11 @@ ichiic_intr(void *arg)
u_int8_t *b;
size_t len;
- /* Read status */
+ /* Read status (XXX ignore SMBALERT# for now) */
st = bus_space_read_1(sc->sc_iot, sc->sc_ioh, ICH_SMB_HS);
if ((st & ICH_SMB_HS_BUSY) != 0 || (st & (ICH_SMB_HS_INTR |
ICH_SMB_HS_DEVERR | ICH_SMB_HS_BUSERR | ICH_SMB_HS_FAILED |
- ICH_SMB_HS_SMBAL | ICH_SMB_HS_BDONE)) == 0)
+ ICH_SMB_HS_BDONE)) == 0)
/* Interrupt was not for us */
return (0);