From owner-svn-src-stable-12@freebsd.org Thu Jun 6 11:38:54 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20A6815AFE8B; Thu, 6 Jun 2019 11:38:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4607699B6; Thu, 6 Jun 2019 11:38:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86A521BE16; Thu, 6 Jun 2019 11:38:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x56BcrVW024825; Thu, 6 Jun 2019 11:38:53 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x56BcrtM024824; Thu, 6 Jun 2019 11:38:53 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201906061138.x56BcrtM024824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 6 Jun 2019 11:38:53 +0000 (UTC) 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 X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/intpm X-SVN-Commit-Revision: 348734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4607699B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jun 2019 11:38:54 -0000 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);