From nobody Mon Dec 1 06:23:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dKYkP2Mm5z6J9fc for ; Mon, 01 Dec 2025 06:23:25 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dKYkP0TsKz3BqP for ; Mon, 01 Dec 2025 06:23:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764570205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21sQ0Xl0UP7wjILRyeQZrYRrsxYpQZISibSGr+4OVgU=; b=Q4HbURT62MieF6u36jjYWFNh2oGlqK69+x0XfRErG1je1yqERJiWhHb4p3QtqDdnvr0VwY 858DKC4N7L9zZHyVaoAq5ywS1Uc4B8OpS+xtHeSRNfheLqLWwFlwmxNIXpg5UFfEwvaxhr 3hdOC9fYoLDkUA/zBk6bDwVIaUz0+HaCM3D+h0fCInv119k16cuEkd8TDrSUEVlKekU9vF V0+v6ZB0AIMX2pRg3/28SKn13pe83mkzsccW7KVgbPE2l6H3Vr6oM5hblRAjaXxRdHNgd5 FrXgQQEwypl5h/5gQRrT5fZ9+jJCz4hPEfC1IyOniIBcPD+GXCE8tTln2gtp+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1764570205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=21sQ0Xl0UP7wjILRyeQZrYRrsxYpQZISibSGr+4OVgU=; b=ipnx4s4V1oaVuGexv1fB6cmkL5Sd31x7MN/o44zA/kNsiSwwFYZXtOVagPuR10sEWjYOmd tdBm0U7rlBK6DlDuoXJwgrqCbVOHsHSX0QxnOMwsddSDBwj5znndZdDFUF9LiWD2IJJdaU 8YJlOgUNGUI7u9mAiFzBNq9O61j2qtslN7Jhur/PjwHPVrWv2lSXg7TiuQDM6DQIsoeOMa z7payKHc80ITNugTmeuCOsVk1jM8+artzKAiy1xyDGKAX6cpxqKp9NSMNBsG0EzyaYkL0e 1j1g4VQt3LvKm5+sELECWB7xTBQd0vi9DzzRwuDhN4ZGL+Go9Qnhqx+LlSuBbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1764570205; a=rsa-sha256; cv=none; b=hs0AEk1Lh2unFr/yM3BuWlFzEHxPaxj1XeMQiI4DvoT/o4EPMCLtVbdM72fUga+TEc80Wx GRlIUNOAvaj9WDQilC644HhzdW3X7TIqhsvL9HmCswhCd3OpoQ20VlZ19JsrpJFhnh2sik 6ImN3LyVEdB91qMEzrpbUw4QXvgz+87CKQhkpwfJKtRfX7PqalXxIjkRWRiyPLr4HgHrwi 9wwKAygotItL9gfJNj6XG5E0iBS9g0WYXKQNkSprw7xeZa4o9Rs9MRm0T9HnV2OfbB7okE XsrySiVXAWWuqqi0H3SHfF06vGNkBaOZX5vm298ejphDUgkUQE02HcsksNsqHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dKYkP019Bz18SQ for ; Mon, 01 Dec 2025 06:23:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 215b3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 01 Dec 2025 06:23:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jaeyoon Choi Subject: git: 8c35de4982d8 - main - cam/scsi: Add power condition support to START STOP UNIT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jaeyoon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c35de4982d855950a900483513f341643f6158f Auto-Submitted: auto-generated Date: Mon, 01 Dec 2025 06:23:24 +0000 Message-Id: <692d345c.215b3.71d84ece@gitrepo.freebsd.org> The branch main has been updated by jaeyoon: URL: https://cgit.FreeBSD.org/src/commit/?id=8c35de4982d855950a900483513f341643f6158f commit 8c35de4982d855950a900483513f341643f6158f Author: Jaeyoon Choi AuthorDate: 2025-12-01 04:39:35 +0000 Commit: Jaeyoon Choi CommitDate: 2025-12-01 04:40:52 +0000 cam/scsi: Add power condition support to START STOP UNIT This patch adds a power_condition parameter to the scsi_start_stop() function and sets the power condition via SSU. Reviewed by: imp (mentor) Sponsored by: Samsung Electronic Differential Revision: https://reviews.freebsd.org/D53922 --- sbin/camcontrol/camcontrol.c | 1 + sys/cam/cam_periph.c | 1 + sys/cam/scsi/scsi_all.c | 4 +++- sys/cam/scsi/scsi_all.h | 3 ++- sys/cam/scsi/scsi_cd.c | 2 ++ sys/dev/mpr/mpr_sas_lsi.c | 1 + sys/dev/mps/mps_sas_lsi.c | 1 + 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 15a5d42a2ba5..8da0c97b02a9 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -1024,6 +1024,7 @@ scsistart(struct cam_device *device, int startstop, int loadeject, /* start/stop */ startstop, /* load_eject */ loadeject, /* immediate */ 0, + /* power_condition */ SSS_PC_START_VALID, /* sense_len */ SSD_FULL_SIZE, /* timeout */ timeout ? timeout : 120000); diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 730656684e2a..e485ecff8736 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1791,6 +1791,7 @@ camperiphscsisenseerror(union ccb *ccb, union ccb **orig, /*start*/TRUE, /*load/eject*/le, /*immediate*/FALSE, + /*power_condition*/SSS_PC_START_VALID, SSD_FULL_SIZE, /*timeout*/50000); break; diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index fd128e69f1f1..168cd17d3965 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -8984,7 +8984,8 @@ void scsi_start_stop(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int start, int load_eject, - int immediate, uint8_t sense_len, uint32_t timeout) + int immediate, uint8_t power_condition, uint8_t sense_len, + uint32_t timeout) { struct scsi_start_stop_unit *scsi_cmd; int extra_flags = 0; @@ -8999,6 +9000,7 @@ scsi_start_stop(struct ccb_scsiio *csio, uint32_t retries, } if (load_eject != 0) scsi_cmd->how |= SSS_LOEJ; + scsi_cmd->how |= power_condition; if (immediate != 0) scsi_cmd->byte2 |= SSS_IMMED; diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index e50974edac86..fb3ed8ee4458 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -4326,7 +4326,8 @@ void scsi_unmap(struct ccb_scsiio *csio, uint32_t retries, void scsi_start_stop(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int start, int load_eject, - int immediate, uint8_t sense_len, uint32_t timeout); + int immediate, uint8_t power_condition, uint8_t sense_len, + uint32_t timeout); void scsi_read_attribute(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t service_action, diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index e622a96ec77e..bc4634562dc6 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -3406,6 +3406,7 @@ cdstartunit(struct cam_periph *periph, int load) /* start */ TRUE, /* load_eject */ load, /* immediate */ FALSE, + /* power_condition */ SSS_PC_START_VALID, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 50000); @@ -3434,6 +3435,7 @@ cdstopunit(struct cam_periph *periph, uint32_t eject) /* start */ FALSE, /* load_eject */ eject, /* immediate */ FALSE, + /* power_condition */ SSS_PC_START_VALID, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 50000); diff --git a/sys/dev/mpr/mpr_sas_lsi.c b/sys/dev/mpr/mpr_sas_lsi.c index d9744b1054c2..9ba776e49e7a 100644 --- a/sys/dev/mpr/mpr_sas_lsi.c +++ b/sys/dev/mpr/mpr_sas_lsi.c @@ -1517,6 +1517,7 @@ mprsas_SSU_to_SATA_devices(struct mpr_softc *sc, int howto) /*start*/FALSE, /*load/eject*/0, /*immediate*/FALSE, + /*power_condition*/SSS_PC_START_VALID, MPR_SENSE_LEN, /*timeout*/10000); xpt_action(ccb); diff --git a/sys/dev/mps/mps_sas_lsi.c b/sys/dev/mps/mps_sas_lsi.c index e2d1ef2b013a..42119b5c0a43 100644 --- a/sys/dev/mps/mps_sas_lsi.c +++ b/sys/dev/mps/mps_sas_lsi.c @@ -1153,6 +1153,7 @@ mpssas_SSU_to_SATA_devices(struct mps_softc *sc, int howto) /*start*/FALSE, /*load/eject*/0, /*immediate*/FALSE, + /*power_condition*/SSS_PC_START_VALID, MPS_SENSE_LEN, /*timeout*/10000); xpt_action(ccb);