git: 802f8d4afeaf - main - mpr/mps: Remove write-only flag and callout

From: Warner Losh <imp_at_FreeBSD.org>
Date: Mon, 24 Jan 2022 20:21:32 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=802f8d4afeafa8667af378c652b7a5cf12958b4e

commit 802f8d4afeafa8667af378c652b7a5cf12958b4e
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-01-24 20:21:09 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-01-24 20:21:09 +0000

    mpr/mps: Remove write-only flag and callout
    
    The discovery callout is initialized and cancelled only, making it
    write-only. Remove a state flag associated with it being pending as well
    as two defines that aren't used that are associated with it. Remove
    MP?SAS_SHUTDOWN flag, which is unused.
    
    Sponsored by:           Netflix
    Reviewed by:            ken, scottl, mav
    Differential Revision:  https://reviews.freebsd.org/D33925
---
 sys/dev/mpr/mpr_sas.c | 5 -----
 sys/dev/mpr/mpr_sas.h | 3 ---
 sys/dev/mps/mps_sas.c | 8 --------
 sys/dev/mps/mps_sas.h | 3 ---
 4 files changed, 19 deletions(-)

diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c
index db5df14562e7..4a8dccb18538 100644
--- a/sys/dev/mpr/mpr_sas.c
+++ b/sys/dev/mpr/mpr_sas.c
@@ -820,8 +820,6 @@ mpr_attach_sas(struct mpr_softc *sc)
 	sc->sassc->startup_refcount = 0;
 	mprsas_startup_increment(sassc);
 
-	callout_init(&sassc->discovery_callout, 1 /*mpsafe*/);
-
 	mpr_unlock(sc);
 
 	/*
@@ -937,9 +935,6 @@ mprsas_discovery_end(struct mprsas_softc *sassc)
 
 	MPR_FUNCTRACE(sc);
 
-	if (sassc->flags & MPRSAS_DISCOVERY_TIMEOUT_PENDING)
-		callout_stop(&sassc->discovery_callout);
-
 	/*
 	 * After discovery has completed, check the mapping table for any
 	 * missing devices and update their missing counts. Only do this once
diff --git a/sys/dev/mpr/mpr_sas.h b/sys/dev/mpr/mpr_sas.h
index 4ec6be15613c..5c7344eef6fa 100644
--- a/sys/dev/mpr/mpr_sas.h
+++ b/sys/dev/mpr/mpr_sas.h
@@ -91,9 +91,7 @@ struct mprsas_softc {
 	u_int			flags;
 #define MPRSAS_IN_DISCOVERY	(1 << 0)
 #define MPRSAS_IN_STARTUP	(1 << 1)
-#define MPRSAS_DISCOVERY_TIMEOUT_PENDING	(1 << 2)
 #define MPRSAS_QUEUE_FROZEN	(1 << 3)
-#define	MPRSAS_SHUTDOWN		(1 << 4)
 #define	MPRSAS_TOREMOVE		(1 << 5)
 	u_int			maxtargets;
 	struct mprsas_target	*targets;
@@ -101,7 +99,6 @@ struct mprsas_softc {
 	struct cam_sim		*sim;
 	struct cam_path		*path;
 	struct intr_config_hook	sas_ich;
-	struct callout		discovery_callout;
 	struct mpr_event_handle	*mprsas_eh;
 
 	u_int                   startup_refcount;
diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c
index 681565aca2d1..e55c4978208a 100644
--- a/sys/dev/mps/mps_sas.c
+++ b/sys/dev/mps/mps_sas.c
@@ -86,9 +86,6 @@ __FBSDID("$FreeBSD$");
 #include <dev/mps/mps_table.h>
 #include <dev/mps/mps_sas.h>
 
-#define MPSSAS_DISCOVERY_TIMEOUT	20
-#define MPSSAS_MAX_DISCOVERY_TIMEOUTS	10 /* 200 seconds */
-
 /*
  * static array to check SCSI OpCode for EEDP protection bits
  */
@@ -773,8 +770,6 @@ mps_attach_sas(struct mps_softc *sc)
 	sc->sassc->startup_refcount = 0;
 	mpssas_startup_increment(sassc);
 
-	callout_init(&sassc->discovery_callout, 1 /*mpsafe*/);
-
 	mps_unlock(sc);
 
 	/*
@@ -889,9 +884,6 @@ mpssas_discovery_end(struct mpssas_softc *sassc)
 
 	MPS_FUNCTRACE(sc);
 
-	if (sassc->flags & MPSSAS_DISCOVERY_TIMEOUT_PENDING)
-		callout_stop(&sassc->discovery_callout);
-
 	/*
 	 * After discovery has completed, check the mapping table for any
 	 * missing devices and update their missing counts. Only do this once
diff --git a/sys/dev/mps/mps_sas.h b/sys/dev/mps/mps_sas.h
index 4d782ad8e7a3..3750500f4091 100644
--- a/sys/dev/mps/mps_sas.h
+++ b/sys/dev/mps/mps_sas.h
@@ -86,16 +86,13 @@ struct mpssas_softc {
 	u_int			flags;
 #define MPSSAS_IN_DISCOVERY	(1 << 0)
 #define MPSSAS_IN_STARTUP	(1 << 1)
-#define MPSSAS_DISCOVERY_TIMEOUT_PENDING	(1 << 2)
 #define MPSSAS_QUEUE_FROZEN	(1 << 3)
-#define	MPSSAS_SHUTDOWN		(1 << 4)
 	u_int			maxtargets;
 	struct mpssas_target	*targets;
 	struct cam_devq		*devq;
 	struct cam_sim		*sim;
 	struct cam_path		*path;
 	struct intr_config_hook	sas_ich;
-	struct callout		discovery_callout;
 	struct mps_event_handle	*mpssas_eh;
 
 	u_int                   startup_refcount;