Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Mar 2017 06:20:58 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r314730 - stable/11/sys/dev/isp
Message-ID:  <201703060620.v266KwUB090773@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Mar  6 06:20:58 2017
New Revision: 314730
URL: https://svnweb.freebsd.org/changeset/base/314730

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/11/sys/dev/isp/isp_freebsd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/isp/isp_freebsd.c
==============================================================================
--- stable/11/sys/dev/isp/isp_freebsd.c	Mon Mar  6 06:20:14 2017	(r314729)
+++ stable/11/sys/dev/isp/isp_freebsd.c	Mon Mar  6 06:20:58 2017	(r314730)
@@ -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:



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