Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci - Match 400-, 495-, and 500-series controllers.



details:   https://anonhg.NetBSD.org/src/rev/27cf4cf6962e
branches:  trunk
changeset: 979855:27cf4cf6962e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jan 15 14:07:15 2021 +0000

description:
- Match 400-, 495-, and 500-series controllers.
- Apply OpenBSD rev 1.38, which ignores the SMBALERT# interrupt that
  fires spuriously on some systems (ignored by Linux and FreeBSD, as
  well).

diffstat:

 sys/dev/pci/ichsmb.c |  25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diffs (83 lines):

diff -r ce90ac74aa85 -r 27cf4cf6962e sys/dev/pci/ichsmb.c
--- a/sys/dev/pci/ichsmb.c      Fri Jan 15 05:34:49 2021 +0000
+++ b/sys/dev/pci/ichsmb.c      Fri Jan 15 14:07:15 2021 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: ichsmb.c,v 1.68 2020/04/22 07:17:01 msaitoh Exp $      */
-/*     $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */
+/*     $NetBSD: ichsmb.c,v 1.69 2021/01/15 14:07:15 thorpej Exp $      */
+/*     $OpenBSD: ichiic.c,v 1.44 2020/10/07 11:23:05 jsg Exp $ */
 
 /*
  * Copyright (c) 2005, 2006 Alexander Yurchenko <grange%openbsd.org@localhost>
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.68 2020/04/22 07:17:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.69 2021/01/15 14:07:15 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -30,7 +30,6 @@
 #include <sys/kernel.h>
 #include <sys/mutex.h>
 #include <sys/condvar.h>
-#include <sys/proc.h>
 #include <sys/module.h>
 
 #include <sys/bus.h>
@@ -128,6 +127,7 @@
                case PCI_PRODUCT_INTEL_2HS_SMB:
                case PCI_PRODUCT_INTEL_3HS_SMB:
                case PCI_PRODUCT_INTEL_3HS_U_SMB:
+               case PCI_PRODUCT_INTEL_4HS_H_SMB:
                case PCI_PRODUCT_INTEL_CORE4G_M_SMB:
                case PCI_PRODUCT_INTEL_CORE5G_M_SMB:
                case PCI_PRODUCT_INTEL_CMTLK_SMB:
@@ -147,6 +147,8 @@
                case PCI_PRODUCT_INTEL_DH89XXCL_SMB:
                case PCI_PRODUCT_INTEL_C2000_PCU_SMBUS:
                case PCI_PRODUCT_INTEL_C3K_SMBUS_LEGACY:
+               case PCI_PRODUCT_INTEL_495_YU_SMB:
+               case PCI_PRODUCT_INTEL_5HS_LP_SMB:
                        return 1;
                }
        }
@@ -418,11 +420,6 @@
        /*
         * Transfer timeout. Kill the transaction and clear status bits.
         */
-       snprintb(fbuf, sizeof(fbuf), LPCIB_SMB_HS_BITS, st);
-       aprint_error_dev(sc->sc_dev,
-           "exec: op %d, addr 0x%02x, cmdlen %zd, len %zd, "
-           "flags 0x%02x: timeout, status %s\n",
-           op, addr, cmdlen, len, flags, fbuf);
        bus_space_write_1(sc->sc_iot, sc->sc_ioh, LPCIB_SMB_HC,
            LPCIB_SMB_HC_KILL);
        DELAY(ICHIIC_DELAY);
@@ -450,9 +447,14 @@
 
        /* Read status */
        st = bus_space_read_1(sc->sc_iot, sc->sc_ioh, LPCIB_SMB_HS);
+
+       /* Clear status bits */
+       bus_space_write_1(sc->sc_iot, sc->sc_ioh, LPCIB_SMB_HS, st);
+
+       /* XXX Ignore SMBALERT# for now */
        if ((st & LPCIB_SMB_HS_BUSY) != 0 || (st & (LPCIB_SMB_HS_INTR |
            LPCIB_SMB_HS_DEVERR | LPCIB_SMB_HS_BUSERR | LPCIB_SMB_HS_FAILED |
-           LPCIB_SMB_HS_SMBAL | LPCIB_SMB_HS_BDONE)) == 0)
+           LPCIB_SMB_HS_BDONE)) == 0)
                /* Interrupt was not for us */
                return (0);
 
@@ -464,9 +466,6 @@
        if ((sc->sc_i2c_xfer.flags & I2C_F_POLL) == 0)
                mutex_enter(&sc->sc_exec_lock);
 
-       /* Clear status bits */
-       bus_space_write_1(sc->sc_iot, sc->sc_ioh, LPCIB_SMB_HS, st);
-
        /* Check for errors */
        if (st & (LPCIB_SMB_HS_DEVERR | LPCIB_SMB_HS_BUSERR | LPCIB_SMB_HS_FAILED)) {
                sc->sc_i2c_xfer.error = EIO;



Home | Main Index | Thread Index | Old Index