From owner-freebsd-hackers@freebsd.org Thu Aug 11 17:54:11 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63BF5BB5981 for ; Thu, 11 Aug 2016 17:54:11 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4DD961D89 for ; Thu, 11 Aug 2016 17:54:11 +0000 (UTC) (envelope-from david@catwhisker.org) Received: by mailman.ysv.freebsd.org (Postfix) id 4D2D7BB5980; Thu, 11 Aug 2016 17:54:11 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CD21BB597F for ; Thu, 11 Aug 2016 17:54:11 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2168A1D88 for ; Thu, 11 Aug 2016 17:54:10 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id u7BHs9fe033417 for ; Thu, 11 Aug 2016 17:54:09 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id u7BHs9Gt033416 for hackers@freebsd.org; Thu, 11 Aug 2016 10:54:09 -0700 (PDT) (envelope-from david) Date: Thu, 11 Aug 2016 10:54:09 -0700 From: David Wolfskill To: hackers@freebsd.org Subject: "ipmi0: KCS..." whines Message-ID: <20160811175409.GW1112@albert.catwhisker.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hn090KliNom6wizA" Content-Disposition: inline User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2016 17:54:11 -0000 --hn090KliNom6wizA Content-Type: multipart/mixed; boundary="3xvobRwI6W2FSfVC" Content-Disposition: inline --3xvobRwI6W2FSfVC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I'm trying to figure out how to cope with some messages: =2E.. kernel: ipmi0: KCS: Failed to read completion code =2E.. kernel: ipmi0: KCS error: ff that recently started showing up on some machines at work (which run somethinng based on FreeBSD). As the messages started showing up shortly after a colleague committed some code that would issue "ipmitool dcmi power reading" periodically, I tried issuing the command myself... to no (initial) effect. I then tried doing it in a loop: foreach n (`jot 10`) ipmitool dcmi power reading end Nothing. But then, 10 isn't a very big number, so I tried again with 32 -- and got a few. That said, I have seen no evidence of data corruption or mis-reporting that coincides with the messages being issued: at this point, the messages seem to merely be annoying, and there's nothing I can do to stop getting them (except to not issue "ipmitool dcmi power reading", perhaps). Also, I have no real evidence that whatever is causing the messages to be issued "in real life" is actually related to my "articial" recreation of the symptoms. I poked around a bit, and found that the messages are issued from src/sys/dev/ipmi/ipmi_kcs.c, where device_printf(9) is used to emit them. (Eventually, that gets around to using printf(9), which is why I was unable to merely use syslog.conf to stop spamming the console.) As a proof-of-concept, I cobbled up the attached patch (with significant help from a colleague). It seems to do as intended: suppress the messages for a "normal" boot, but emit them for a verbose boot. I'm not at all happy with that approach: it's way too far on the "treating the symptom" side than "fixing the root cause." On the other hand, it's not clear that emitting a message about which I can do nothing useful is all that ... useful. :-} But ... none of the machines to which I have access and have the requisite hardware are running stock FreeBSD. Is anyone able to reproduce this on a stock FreeBSD machine? Better: anyone have a better idea how to address thhe issue? Thanks! Peace, david --=20 David H. Wolfskill david@catwhisker.org Those who would murder in the name of God or prophet are blasphemous coward= s. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --3xvobRwI6W2FSfVC Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ipmi_kcs.c.diff" Content-Transfer-Encoding: quoted-printable diff --git a/sys/dev/ipmi/ipmi_kcs.c b/sys/dev/ipmi/ipmi_kcs.c --- a/sys/dev/ipmi/ipmi_kcs.c +++ b/sys/dev/ipmi/ipmi_kcs.c @@ -148,7 +148,7 @@ =20 /* Read error status */ data =3D INB(sc, KCS_DATA); - if (data !=3D 0) + if (data !=3D 0 && (data !=3D 0xff || bootverbose)) device_printf(sc->ipmi_dev, "KCS error: %02x\n", data); =20 @@ -414,8 +414,10 @@ =20 /* Next we read the completion code. */ if (kcs_read_byte(sc, &req->ir_compcode) !=3D 1) { - device_printf(sc->ipmi_dev, - "KCS: Failed to read completion code\n"); + if (bootverbose) { + device_printf(sc->ipmi_dev, + "KCS: Failed to read completion code\n"); + } goto fail; } #ifdef KCS_DEBUG --3xvobRwI6W2FSfVC-- --hn090KliNom6wizA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJXrLvBXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDQ0I3Q0VGOTE3QTgwMUY0MzA2NEQ3N0Ix NTM5Q0M0MEEwNDlFRTE3AAoJEBU5zECgSe4XS4UH/A48/9XlKrqqtHK+okEr6FJ0 8Lx1mPYHLRE3+qX9XEjBawJT0P9wLLWPcL6jDaWJvTsyLjif2bGlMmsDNgTxsHy+ siHzJdusVA/GgWtOUtekH9QtMpKszmTPks0wEpheRoGx+HMLZIS3QewM+Sbw9dL5 X7o81vE4Kksh5GBSqrwuNSYbk1kaCl3QjlVWsdcnSafQtM5cWaBfel/lOUeIqmjn zJIcE1ZVUR7vaHEZDBvBAhJtamv6WQSGiAvsdDSu8s8F3ZTyOv/T1MQeVavFmUHM heXHX98wc+8NziTVYdbwNA2tyfbvI0ffKwvJsxwoaJpesZzsIaAkMlvSVdygf40= =0YL2 -----END PGP SIGNATURE----- --hn090KliNom6wizA--