From owner-svn-src-stable@freebsd.org Mon Mar 6 06:45:01 2017 Return-Path: Delivered-To: svn-src-stable@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 C6DC1CF8F46; Mon, 6 Mar 2017 06:45:01 +0000 (UTC) (envelope-from mav@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 mx1.freebsd.org (Postfix) with ESMTPS id 9E5FB180B; Mon, 6 Mar 2017 06:45:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v266j00u004990; Mon, 6 Mar 2017 06:45:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v266j0JB004987; Mon, 6 Mar 2017 06:45:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703060645.v266j0JB004987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 6 Mar 2017 06:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r314764 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 06:45:01 -0000 Author: mav Date: Mon Mar 6 06:45:00 2017 New Revision: 314764 URL: https://svnweb.freebsd.org/changeset/base/314764 Log: MFC r314326: Send TERMINATE to firmware when aborting active ATIO. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_freebsd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Mon Mar 6 06:43:17 2017 (r314763) +++ stable/11/sys/dev/isp/isp.c Mon Mar 6 06:45:00 2017 (r314764) @@ -7133,7 +7133,7 @@ static const uint32_t mbpfc[] = { ISP_FC_OPMAP(0x00, 0x00), /* 0x3f: */ ISP_FC_OPMAP(0x03, 0x01), /* 0x40: MBOX_LOOP_PORT_BYPASS */ ISP_FC_OPMAP(0x03, 0x01), /* 0x41: MBOX_LOOP_PORT_ENABLE */ - ISP_FC_OPMAP_HALF(0x0, 0x01, 0x3, 0xcf), /* 0x42: MBOX_GET_RESOURCE_COUNT */ + ISP_FC_OPMAP_HALF(0x0, 0x01, 0x1f, 0xcf), /* 0x42: MBOX_GET_RESOURCE_COUNT */ ISP_FC_OPMAP(0x01, 0x01), /* 0x43: MBOX_REQUEST_OFFLINE_MODE */ ISP_FC_OPMAP(0x00, 0x00), /* 0x44: */ ISP_FC_OPMAP(0x00, 0x00), /* 0x45: */ Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Mon Mar 6 06:43:17 2017 (r314763) +++ stable/11/sys/dev/isp/isp_freebsd.c Mon Mar 6 06:45:00 2017 (r314764) @@ -1011,7 +1011,7 @@ isp_dump_atpd(ispsoftc_t *isp, int chan) if (atp->state == ATPD_STATE_FREE) continue; isp_prt(isp, ISP_LOGALL, "Chan %d ATP [0x%x] origdlen %u bytes_xfrd %u lun %jx nphdl 0x%04x s_id 0x%06x d_id 0x%06x oxid 0x%04x state %s", - chan, atp->tag, atp->orig_datalen, atp->bytes_xfered, (uintmax_t)atp->lun, atp->nphdl, atp->sid, atp->portid, atp->oxid, states[atp->state & 0x7]); + chan, atp->tag, atp->orig_datalen, atp->bytes_xfered, (uintmax_t)atp->lun, atp->nphdl, atp->sid, atp->did, atp->oxid, states[atp->state & 0x7]); } } @@ -1344,8 +1344,8 @@ isp_target_start_ctio(ispsoftc_t *isp, u ATPD_SET_SEQNO(cto, atp); cto->ct_nphdl = atp->nphdl; cto->ct_rxid = atp->tag; - cto->ct_iid_lo = atp->portid; - cto->ct_iid_hi = atp->portid >> 16; + cto->ct_iid_lo = atp->sid; + cto->ct_iid_hi = atp->sid >> 16; cto->ct_oxid = atp->oxid; cto->ct_vpidx = ISP_GET_VPIDX(isp, XS_CHANNEL(ccb)); cto->ct_timeout = (XS_TIME(ccb) + 999) / 1000; @@ -2088,7 +2088,8 @@ isp_handle_platform_atio7(ispsoftc_t *is atp->bytes_xfered = 0; atp->lun = lun; atp->nphdl = nphdl; - atp->portid = sid; + atp->sid = sid; + atp->did = did; atp->oxid = aep->at_hdr.ox_id; atp->rxid = aep->at_hdr.rx_id; atp->cdb0 = atiop->cdb_io.cdb_bytes[0]; @@ -3269,7 +3270,23 @@ isp_abort_atio(ispsoftc_t *isp, union cc /* Search for the ATIO among running. */ atp = isp_find_atpd(isp, XS_CHANNEL(accb), accb->atio.tag_id); if (atp != NULL) { - /* XXX Send TERMINATE to firmware here. */ + /* Send TERMINATE to firmware. */ + if (!atp->dead && IS_24XX(isp)) { + uint8_t storage[QENTRY_LEN]; + ct7_entry_t *cto = (ct7_entry_t *) storage; + + ISP_MEMZERO(cto, sizeof (ct7_entry_t)); + cto->ct_header.rqs_entry_type = RQSTYPE_CTIO7; + cto->ct_header.rqs_entry_count = 1; + cto->ct_nphdl = atp->nphdl; + cto->ct_rxid = atp->tag; + cto->ct_iid_lo = atp->sid; + cto->ct_iid_hi = atp->sid >> 16; + cto->ct_oxid = atp->oxid; + cto->ct_vpidx = XS_CHANNEL(accb); + cto->ct_flags = CT7_NOACK|CT7_TERMINATE; + isp_target_put_entry(isp, cto); + } isp_put_atpd(isp, XS_CHANNEL(accb), atp); ccb->ccb_h.status = CAM_REQ_CMP; } else { Modified: stable/11/sys/dev/isp/isp_freebsd.h ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.h Mon Mar 6 06:43:17 2017 (r314763) +++ stable/11/sys/dev/isp/isp_freebsd.h Mon Mar 6 06:45:00 2017 (r314764) @@ -103,7 +103,7 @@ typedef struct atio_private_data { lun_id_t lun; uint32_t nphdl; uint32_t sid; - uint32_t portid; + uint32_t did; uint16_t rxid; /* wire rxid */ uint16_t oxid; /* wire oxid */ uint16_t word3; /* PRLI word3 params */