From owner-dev-commits-src-main@freebsd.org Sat Jun 19 17:15:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1677F65D178; Sat, 19 Jun 2021 17:15:44 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4G6j9W72ykz4Vpc; Sat, 19 Jun 2021 17:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA1B31A2C1; Sat, 19 Jun 2021 17:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15JHFhGQ027019; Sat, 19 Jun 2021 17:15:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15JHFhiI027018; Sat, 19 Jun 2021 17:15:43 GMT (envelope-from git) Date: Sat, 19 Jun 2021 17:15:43 GMT Message-Id: <202106191715.15JHFhiI027018@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 3386347f65cd - main - mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3386347f65cdcd7c36feec216af05f188f82cf2c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jun 2021 17:15:44 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=3386347f65cdcd7c36feec216af05f188f82cf2c commit 3386347f65cdcd7c36feec216af05f188f82cf2c Author: Emmanuel Vadot AuthorDate: 2021-06-17 18:09:52 +0000 Commit: Emmanuel Vadot CommitDate: 2021-06-19 17:15:25 +0000 mmc_sim: Make XPT_MMC_GET_TRAN_SETTINGS fully async Sponsored by: Diablotin Systems --- sys/cam/mmc/mmc_sim.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/sys/cam/mmc/mmc_sim.c b/sys/cam/mmc/mmc_sim.c index 1500e3f6f1cd..b9a6a852c07f 100644 --- a/sys/cam/mmc/mmc_sim.c +++ b/sys/cam/mmc/mmc_sim.c @@ -63,11 +63,25 @@ mmc_sim_task(void *arg, int pending) return; cts = &mmc_sim->ccb->cts; - rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); - if (rv != 0) - mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; - else - mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + switch (mmc_sim->ccb->ccb_h.func_code) { + case XPT_MMC_GET_TRAN_SETTINGS: + rv = MMC_SIM_GET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; + else + mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_MMC_SET_TRAN_SETTINGS: + rv = MMC_SIM_SET_TRAN_SETTINGS(mmc_sim->dev, &cts->proto_specific.mmc); + if (rv != 0) + mmc_sim->ccb->ccb_h.status = CAM_REQ_INVALID; + else + mmc_sim->ccb->ccb_h.status = CAM_REQ_CMP; + break; + default: + panic("Unsupported ccb func %x\n", mmc_sim->ccb->ccb_h.func_code); + break; + } xpt_done(mmc_sim->ccb); mmc_sim->ccb = NULL; @@ -108,7 +122,6 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) } break; case XPT_GET_TRAN_SETTINGS: - case XPT_MMC_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; @@ -125,6 +138,15 @@ mmc_cam_sim_default_action(struct cam_sim *sim, union ccb *ccb) } break; } + case XPT_MMC_GET_TRAN_SETTINGS: + { + ccb->ccb_h.status = CAM_SIM_QUEUED; + mmc_sim->ccb = ccb; + taskqueue_enqueue(taskqueue_thread, &mmc_sim->sim_task); + return; + /* NOTREACHED */ + break; + } case XPT_SET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts;