From owner-svn-src-stable-10@freebsd.org Mon Mar 6 06:21:28 2017 Return-Path: Delivered-To: svn-src-stable-10@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 AEDA3CFA5F5; Mon, 6 Mar 2017 06:21:27 +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 6E99010BF; Mon, 6 Mar 2017 06:21:27 +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 v266LQVq093665; Mon, 6 Mar 2017 06:21:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v266LQh3093664; Mon, 6 Mar 2017 06:21:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201703060621.v266LQh3093664@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:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314731 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 06:21:28 -0000 Author: mav Date: Mon Mar 6 06:21:26 2017 New Revision: 314731 URL: https://svnweb.freebsd.org/changeset/base/314731 Log: MFC r314045: Remove duplicate INOT allocation. For some reason isp_handle_platform_notify_fc() allocated INOT just before calling isp_handle_platform_target_tmf(), which also allocates INOT. It seems to be a braino introduced in r196008. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Mon Mar 6 06:20:58 2017 (r314730) +++ stable/10/sys/dev/isp/isp_freebsd.c Mon Mar 6 06:21:26 2017 (r314731) @@ -2564,13 +2564,11 @@ isp_handle_platform_notify_fc(ispsoftc_t break; case IN_ABORT_TASK: { - tstate_t *tptr; uint16_t nphdl, lun; uint32_t sid; uint64_t wwn; - atio_private_data_t *atp; fcportdb_t *lp; - struct ccb_immediate_notify *inot = NULL; + isp_notify_t tmp, *nt = &tmp; if (ISP_CAP_SCCFW(isp)) { lun = inp->in_scclun; @@ -2592,47 +2590,25 @@ isp_handle_platform_notify_fc(ispsoftc_t wwn = INI_ANY; sid = PORT_ANY; } - tptr = get_lun_statep(isp, 0, lun); - if (tptr == NULL) { - tptr = get_lun_statep(isp, 0, CAM_LUN_WILDCARD); - if (tptr == NULL) { - isp_prt(isp, ISP_LOGWARN, "ABORT TASK for lun %x, but no tstate", lun); - return; - } - } - atp = isp_find_atpd(isp, tptr, inp->in_seqid); - - if (atp) { - inot = (struct ccb_immediate_notify *) SLIST_FIRST(&tptr->inots); - isp_prt(isp, ISP_LOGTDEBUG0, "ABORT TASK RX_ID %x WWN 0x%016llx state %d", inp->in_seqid, (unsigned long long) wwn, atp->state); - if (inot) { - tptr->inot_count--; - SLIST_REMOVE_HEAD(&tptr->inots, sim_links.sle); - ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, inot->ccb_h.path, "%s: Take FREE INOT count now %d\n", __func__, tptr->inot_count); - } else { - ISP_PATH_PRT(isp, ISP_LOGWARN, tptr->owner, "out of INOT structures\n"); - } - } else { - ISP_PATH_PRT(isp, ISP_LOGWARN, tptr->owner, "abort task RX_ID %x from wwn 0x%016llx, state unknown\n", inp->in_seqid, wwn); - } - if (inot) { - isp_notify_t tmp, *nt = &tmp; - ISP_MEMZERO(nt, sizeof (isp_notify_t)); - nt->nt_hba = isp; - nt->nt_tgt = FCPARAM(isp, 0)->isp_wwpn; - nt->nt_wwn = wwn; - nt->nt_nphdl = nphdl; - nt->nt_sid = sid; - nt->nt_did = PORT_ANY; - nt->nt_lun = lun; - nt->nt_need_ack = 1; - nt->nt_channel = 0; - nt->nt_ncode = NT_ABORT_TASK; - nt->nt_lreserved = inot; - isp_handle_platform_target_tmf(isp, nt); - needack = 0; - } - rls_lun_statep(isp, tptr); + isp_prt(isp, ISP_LOGTDEBUG0, "ABORT TASK RX_ID %x WWN 0x%016llx", + inp->in_seqid, (unsigned long long) wwn); + + ISP_MEMZERO(nt, sizeof (isp_notify_t)); + nt->nt_hba = isp; + nt->nt_tgt = FCPARAM(isp, 0)->isp_wwpn; + nt->nt_wwn = wwn; + nt->nt_nphdl = nphdl; + nt->nt_sid = sid; + nt->nt_did = PORT_ANY; + nt->nt_lun = lun; + nt->nt_tagval = inp->in_seqid; + nt->nt_tagval |= (((uint64_t)(isp->isp_serno++)) << 32); + nt->nt_need_ack = 1; + nt->nt_channel = 0; + nt->nt_ncode = NT_ABORT_TASK; + nt->nt_lreserved = inp; + isp_handle_platform_target_tmf(isp, nt); + needack = 0; break; } default: