Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jun 2019 11:38:53 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r348734 - stable/12/sys/dev/intpm
Message-ID:  <201906061138.x56BcrtM024824@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Thu Jun  6 11:38:53 2019
New Revision: 348734
URL: https://svnweb.freebsd.org/changeset/base/348734

Log:
  MFC r345411: intpm: change translation of HBA error status to smbus(4) errors
  
  PIIX4_SMBHSTSTAT_ERR can be set for several reasons that, unfortunately,
  cannot be distinguished, but the most typical case is a missing or hung
  slave (SMB_ENOACK).
  
  PIIX4_SMBHSTSTAT_FAIL means failed or killed / aborted transaction, so
  it's previous mapping to SMB_ENOACK was not ideal.
  
  After this change an smb(4) access to a missing slave results in ENXIO
  rather than EIO.  To me, that seems to be more appropriate.

Modified:
  stable/12/sys/dev/intpm/intpm.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/intpm/intpm.c
==============================================================================
--- stable/12/sys/dev/intpm/intpm.c	Thu Jun  6 11:36:58 2019	(r348733)
+++ stable/12/sys/dev/intpm/intpm.c	Thu Jun  6 11:38:53 2019	(r348734)
@@ -525,12 +525,19 @@ intsmb_error(device_t dev, int status)
 {
 	int error = 0;
 
+	/*
+	 * PIIX4_SMBHSTSTAT_ERR can mean either of
+	 * - SMB_ENOACK ("Unclaimed cycle"),
+	 * - SMB_ETIMEOUT ("Host device time-out"),
+	 * - SMB_EINVAL ("Illegal command field").
+	 * SMB_ENOACK seems to be most typical.
+	 */
 	if (status & PIIX4_SMBHSTSTAT_ERR)
-		error |= SMB_EBUSERR;
+		error |= SMB_ENOACK;
 	if (status & PIIX4_SMBHSTSTAT_BUSC)
 		error |= SMB_ECOLLI;
 	if (status & PIIX4_SMBHSTSTAT_FAIL)
-		error |= SMB_ENOACK;
+		error |= SMB_EABORT;
 
 	if (error != 0 && bootverbose)
 		device_printf(dev, "error = %d, status = %#x\n", error, status);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906061138.x56BcrtM024824>