From patchwork Thu Feb 11 12:27:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 381444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22DEBC433E0 for ; Thu, 11 Feb 2021 12:33:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E264864E2E for ; Thu, 11 Feb 2021 12:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231497AbhBKMcX (ORCPT ); Thu, 11 Feb 2021 07:32:23 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:43208 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231401AbhBKM2j (ORCPT ); Thu, 11 Feb 2021 07:28:39 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOwJB050824; Thu, 11 Feb 2021 12:27:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=mJLOM170UOVxs6KEy9JlX5oB6OXlJ1nwsdmN9GE7Xx8=; b=eeWCdI9yUuIo3hqtcAvLexW92oMUg4gO1ITkypFfw/h9WU3cLFxVOn3urZK7mWxuQ6f6 TrL/lIZgZ6TOFXrF/N7DvxQstUbEtaQdCWYYZAFTs0eIty2KOsxcHVgj9kq1QP0DSETW iVffMg3eI81OVwjSO+QQKw2WsIfobQ4kZCxZjRitPBhxQuenE58029C3RwSddBauHXGi 9MbxOamm3R9Owms3sqhjdy7j5JKLISimCxLKaKeqq74hQLJagOb9p4NZeoEVCuwnUgdS MJWex/8tw71m61VYeo6XLM4v+z+lvtmeBKyeI943qeuHOMMSfk5iFw9Ma65XNK9qwp/N yw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 36mv9dsej5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:43 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOn9u068569; Thu, 11 Feb 2021 12:27:42 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by userp3020.oracle.com with ESMTP id 36j4vu69v3-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Skh+cTACdZXDqr9s9221snHcz4UAKW1W39MT27tpi4cm52QZcLiIgdYY5zaYeOJd+NGaXXbErJCiRHVDU27tzjxEfOG9L7XqFMdP2Z9k0iV6651XgywyL2zmi7h13XGM2BNQczZCc9gEiVWYbnI9i87Ts3EmN5WfeDqT1+zcFzP1z6axeHVGVM5GSAC2uUs19Wqkc2SWEW2atJ9izPbbZ1UHvh5hsbvpdNs3RUIvlDduRB+lWQaE3dVN7cjQ+A7GJbWVKsyTqElP8CQcblfOvY7FKM6WeLt4Sl2P9mvsEeuHMsZxXDpw4QjEVyIKyYVplDZxGVDwCPCY/OBpVhdnPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mJLOM170UOVxs6KEy9JlX5oB6OXlJ1nwsdmN9GE7Xx8=; b=PZeptEGtGVZ+X34JdARPQtc4+N1mztUIvEEtw+WF6TGCa+ogEmC2Em5HRgIqr31RIvnVTB9tqDweblKO2AV6BhU3WOwFP60tBvv6wEhFDKnGKlLbq0+CWpDFUdMtluxOeH07kxixuE2WL98FDqVKHyQf5GCpy+db1Dvwbjyctz384TObO3+jcgmh2t2Z3FqaVBQY18OB2o11Fo09FY7RbtQAOSpFZqDANAyemKwupdK/lGQY48QOvf+bs6RainoQmATp68F1e177tY+o++dcTZCsGrRHxSW4gH+pQNZsM+xOyezggyX8vy5e5jVuGXYz0ShtHT0j/edt1IB1iBgSHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mJLOM170UOVxs6KEy9JlX5oB6OXlJ1nwsdmN9GE7Xx8=; b=OGQDabzVEL2Qhhw3iBwPILG9bO1N+wTLQj4t5jklYYEnLAQZUQ/BOsxg9yvvAteZV7iXEzIzF5eb0oJslLd3yE9VyhjvAwdHknjyAYvudbfo/rrfBYvImHuSsTbI6riskzNV0sxGmWlyAkpTAXOvNDDgn2HQokBlQXzpRCoOfX8= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none; lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:41 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:41 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 03/14] target: rename transport_init_se_cmd Date: Thu, 11 Feb 2021 06:27:17 -0600 Message-Id: <20210211122728.31721-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 591a21bc-70ac-4574-33a4-08d8ce886cfd X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4pvLOWCkuWgD4wjbQs+SlF3AdxSPULLvl0ZmlbglM7z/63mhjWK9XC+DXCw/fWOMeUbvd23Y6BfpcUydPbmMGVNVy6zVNTRCruracKI44393jaIBu90gsfUnPtYd/kr81jxWNx0XO7V50xUxYWE+dKN3/dMRHD8EYKjKtlgBxKJZmZiZltur8fZo3QLN1Yju3wTRXbc/ndF++lBQu3muhgGOuuIX4jz76nxtEhXi6tL04GzoVKdXH5OLhJfxlEUPTg2XrXDhaq8qJfjNaKo/WtNxhE6+2rd73P2kt7sNhqnxu0oziaiHWvONCKH9LIED/wvW5IsU0pCtD2V5DayfzMDUKXi6EdGQRaog4hp/qdH/w8HsUSdmEq2ZJJqpdimoWI9yMImqaDtWtyFEfDVOtcsGrup555U8zXSMs04v1cQ46ncY1t0FU4cA8siR/zsUTStMEYTHwxh1DojGGLT3uzYOc0JhJqEvrXjtsOcl4Ikgw0emtFoksu2gVZLqcbhLSiA6STFIlZOlobnEtMXKVGAtNw5XybnY4NYdJYF8qZTneo3R0h7I3o+Dev81Enzv3ZoBGic503YEIIb9176J5A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: GJBG6e/J+9G1UumfKC2aLq5mD4XL0InYTh+LSbkV7kmsEGTMt+54wjymy0pH7Zi365CieDhHkNFpuXqxES6hfcFkWX1L1k/n4AZhxuuRMOsP6Pduq5ESx+yz3z6nE2QhGEcESOVuZCZIGmaZBb79eU5sb+CaEx5AnBi4TbB7aZ2DRSKBwCgnegtbZeQmBx+uF4iJRc6chBCut6DsVIF2ZadJHs+fgr5hLBh9Q7nzNouJqnrHJzb3Mlpy8qc5dRjffPliY/f7bjaBj71N2Dxjy7kPR6UF8/PRziRRmqFWVrV+92Yg7mWisXxzFKerqgVEn/3FpKM8rliXcCqveV9UFg0UrEbJ9TV4sScLr+g0LVZTLvvBzDx8m5Xn5IKSq4RlyF3ryM+IT7EGnkNRV29ZHpdz4u4JvLRlhHFfP990YTXga+E7+qpTHRtgKUfDi2tmc70LCErRJapz5CAD3NB4aUGkW8+GOe96Q+Kepfc2CzTbeaC93wVZDEZp17OqySB0XEefKvcRIisKm9oXWvIP5wjhShd7D+EPrHu1UWedOrAMh49yChfkh9mwvyjxeT3HYIb6DueCDQLiMVNrqfQb3Ay1XloMekDBrGk2KRK6wkoe6W5s1htYdU/tD7ok1AqzM/N2ensBp+A34Neik/hv4Lzw67GpqYuy3Z3W9C3iUp4JQdW0++/T3cTTAMTO/9LUOGupx7gZEpFdQe+sUYYxHnHq+u59d/u5r5N71m924KL7SkYMemnZPxvY9g9nT3o2uaUnrcNCeAg4QmgikEuvI7ESDVBZpiJyDS/s1y3nAQmr+O+OZ6Jy0Jsrdio6uriAkjqML/yFhJe3sFJcWbFz2u9wo/3RqW4rnPE4PlYqYoZZ7YKl/MAgYMXtYEUgkbjM/WKHDSDQAfZ0rEkVwjNTWxsxmkwLeXjtzJgZF4nyvez3KuZGUg77lmtoYkP4kUicn+fvFzpYmhLMOKuwD/HphSDy3kZrHtHho2HJR4uohSpiMe0ay0PhYOqvnGFLFRMpUQLuiDh2NwFHB3jKnjMF282AEpHbrSyrhc54rPdXaOkK2XBtr8wpntHwcVEBgqVxQqEyJ9RX1fHotICC3ndOqMjctj32RTPSwwCE2fCJQFF1MmMpXDEW0BXmYRXwyMFr5N7N7DAf0uct3y+C0abpaG27aVf+I2LHoKcD5EIUr8jRsBz9JtxCYuNrUZe17p2rHQnPp7DV7oTXrY4vfTCk6Zv/0e8MkfW9kfgumWHP4FlS7p0JgGFQrzbIpWV2j3Vc/K7avybX+uHKeakzJjkTFXPEhkWsSKP9b1Mj6V0eY7UICGbmBhD1CUWScHe5hZ1S X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 591a21bc-70ac-4574-33a4-08d8ce886cfd X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:41.4251 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wb0Dwfw2tKNqydXUAA0LaLw+PkwJapr00JkXVEnhdb+yMiWXo5HsQG/mma/cLk9aqTbt329tFvMcaVMrru2pXisXGhdjOaJxB4aOBNYru3Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 impostorscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Rename transport_init_se_cmd to __target_init_cmd to reflect that it's more of an internal function that drivers should normally not use (usb seems to use it wrong and iscsi is that weird guy), and because we are going to add a new init function in the next patches. Signed-off-by: Mike Christie --- drivers/target/iscsi/iscsi_target.c | 16 ++++++++-------- drivers/target/target_core_transport.c | 16 ++++++++-------- drivers/target/target_core_xcopy.c | 8 ++++---- drivers/usb/gadget/function/f_tcm.c | 20 ++++++++++---------- include/target/target_core_fabric.h | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 518fac4864cf..f2107705f2ea 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1154,10 +1154,10 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, /* * Initialize struct se_cmd descriptor from target_core_mod infrastructure */ - transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops, - conn->sess->se_sess, be32_to_cpu(hdr->data_length), - cmd->data_direction, sam_task_attr, - cmd->sense_buffer + 2, scsilun_to_int(&hdr->lun)); + __target_init_cmd(&cmd->se_cmd, &iscsi_ops, + conn->sess->se_sess, be32_to_cpu(hdr->data_length), + cmd->data_direction, sam_task_attr, + cmd->sense_buffer + 2, scsilun_to_int(&hdr->lun)); pr_debug("Got SCSI Command, ITT: 0x%08x, CmdSN: 0x%08x," " ExpXferLen: %u, Length: %u, CID: %hu\n", hdr->itt, @@ -2013,10 +2013,10 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, buf); } - transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops, - conn->sess->se_sess, 0, DMA_NONE, - TCM_SIMPLE_TAG, cmd->sense_buffer + 2, - scsilun_to_int(&hdr->lun)); + __target_init_cmd(&cmd->se_cmd, &iscsi_ops, + conn->sess->se_sess, 0, DMA_NONE, + TCM_SIMPLE_TAG, cmd->sense_buffer + 2, + scsilun_to_int(&hdr->lun)); target_get_sess_cmd(&cmd->se_cmd, true); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index b5427e26187b..013f4a5e8972 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1297,7 +1297,7 @@ target_check_max_data_sg_nents(struct se_cmd *cmd, struct se_device *dev, * Compare the data buffer size from the CDB with the data buffer limit from the transport * header. Set @cmd->residual_count and SCF_OVERFLOW_BIT or SCF_UNDERFLOW_BIT if necessary. * - * Note: target drivers set @cmd->data_length by calling transport_init_se_cmd(). + * Note: target drivers set @cmd->data_length by calling __target_init_cmd(). * * Return: TCM_NO_SENSE */ @@ -1369,7 +1369,7 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size) * * Preserves the value of @cmd->tag. */ -void transport_init_se_cmd( +void __target_init_cmd( struct se_cmd *cmd, const struct target_core_fabric_ops *tfo, struct se_session *se_sess, @@ -1403,7 +1403,7 @@ void transport_init_se_cmd( cmd->state_active = false; } -EXPORT_SYMBOL(transport_init_se_cmd); +EXPORT_SYMBOL(__target_init_cmd); static sense_reason_t transport_check_alloc_task_attr(struct se_cmd *cmd) @@ -1623,9 +1623,9 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess * exceptions are handled by sending exception status via * target_core_fabric_ops->queue_status() callback */ - transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, - data_length, data_dir, task_attr, sense, - unpacked_lun); + __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, + data_length, data_dir, task_attr, sense, + unpacked_lun); if (flags & TARGET_SCF_UNKNOWN_SIZE) se_cmd->unknown_data_length = 1; @@ -1797,8 +1797,8 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, se_tpg = se_sess->se_tpg; BUG_ON(!se_tpg); - transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, - 0, DMA_NONE, TCM_SIMPLE_TAG, sense, unpacked_lun); + __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, + 0, DMA_NONE, TCM_SIMPLE_TAG, sense, unpacked_lun); /* * FIXME: Currently expect caller to handle se_cmd->se_tmr_req * allocation failure. diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 66d6f1d06f21..e86cc6135587 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -615,8 +615,8 @@ static int target_xcopy_read_source( pr_debug("XCOPY: Built READ_16: LBA: %llu Sectors: %u Length: %u\n", (unsigned long long)src_lba, src_sectors, length); - transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length, - DMA_FROM_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); + __target_init_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length, + DMA_FROM_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); rc = target_xcopy_setup_pt_cmd(&xpt_cmd, xop, src_dev, &cdb[0], remote_port); @@ -660,8 +660,8 @@ static int target_xcopy_write_destination( pr_debug("XCOPY: Built WRITE_16: LBA: %llu Sectors: %u Length: %u\n", (unsigned long long)dst_lba, dst_sectors, length); - transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length, - DMA_TO_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); + __target_init_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length, + DMA_TO_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); rc = target_xcopy_setup_pt_cmd(&xpt_cmd, xop, dst_dev, &cdb[0], remote_port); diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 410fa89eae8f..dcce6e2605f5 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1050,11 +1050,11 @@ static void usbg_cmd_work(struct work_struct *work) tv_nexus = tpg->tpg_nexus; dir = get_cmd_dir(cmd->cmd_buf); if (dir < 0) { - transport_init_se_cmd(se_cmd, - tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, - tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, - cmd->prio_attr, cmd->sense_iu.sense, - cmd->unpacked_lun); + __target_init_cmd(se_cmd, + tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, + tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, + cmd->prio_attr, cmd->sense_iu.sense, + cmd->unpacked_lun); goto out; } @@ -1181,11 +1181,11 @@ static void bot_cmd_work(struct work_struct *work) tv_nexus = tpg->tpg_nexus; dir = get_cmd_dir(cmd->cmd_buf); if (dir < 0) { - transport_init_se_cmd(se_cmd, - tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, - tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, - cmd->prio_attr, cmd->sense_iu.sense, - cmd->unpacked_lun); + __target_init_cmd(se_cmd, + tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, + tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, + cmd->prio_attr, cmd->sense_iu.sense, + cmd->unpacked_lun); goto out; } diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index d60a3eb7517a..4975c4d2a933 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -148,7 +148,7 @@ void transport_deregister_session_configfs(struct se_session *); void transport_deregister_session(struct se_session *); -void transport_init_se_cmd(struct se_cmd *, +void __target_init_cmd(struct se_cmd *, const struct target_core_fabric_ops *, struct se_session *, u32, int, int, unsigned char *, u64); sense_reason_t transport_lookup_cmd_lun(struct se_cmd *); From patchwork Thu Feb 11 12:27:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 381445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA073C433DB for ; Thu, 11 Feb 2021 12:32:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 909D964E79 for ; Thu, 11 Feb 2021 12:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231403AbhBKMcC (ORCPT ); Thu, 11 Feb 2021 07:32:02 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:40414 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbhBKM2i (ORCPT ); Thu, 11 Feb 2021 07:28:38 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCO13n097781; Thu, 11 Feb 2021 12:27:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=F+aFqwutfhlKA5d+xVW2njaqXGESiPHOWifQWDUFqR4=; b=oPf7FcJEcsXizhV30c4lJibjdDl04NJCsI4/Ep/r54DN2n4VBYkFYXFPdbKksllzArtb +VzW/t5O4DDiHiiEMI2HtcP4t+sAGXnIOYq1jwfKx5tSsWvI8GiDw49OIebCexS4jXHT RMxARhYuqA+n5YTD1GG9tfJWYJ/e1JM1xynCIULiMB6eU2by1tutlKeuP1I8qeBgdKCi lM7vGKZV1HzvcGYYAleW/T1gGA39vMLPrgQP2f9Ys/FdcQwRS8GwAUrSdRb+zQw9EMXo GV/zGH8+OM7Dtp0X7veL/rpbNCWeLvx0PNPm39WNcJZzOwj6nSXDwzj54uRhVud/pMV7 4A== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 36hgmaqby5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:47 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCP7qP052228; Thu, 11 Feb 2021 12:27:46 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2104.outbound.protection.outlook.com [104.47.55.104]) by userp3030.oracle.com with ESMTP id 36j51yxtx1-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D/1jDd4KJvPsxa/9tgwH1vKAXSBE7XPwdXSFc9ci0DDhoib4vjAldX3KbuR2zW1tCJSr5NmBu4tNqcgSxkeabJiT7vrJslNiWSkgFeI/PchVHXgCM6UoUhWaK057/Ikw6GQdF3FTSFt9EIoDK2Ek31+5xPlYAhskCPIkpSskPayneJoU83vuuMrCjFHJ+h3U6OQjur/cla2LjueLydW2tRK8UvNu3FXi+DQfdOthyWxMYNlkzQG421mej+UJs1gBF2L13KbWwZWsFdtntxhwKrI+fURm9iOkNI4ljD+ko1mtiUJSH+2ARAUaQRMasuiU2UJXg6+TAQXwOrt6+Y8RGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F+aFqwutfhlKA5d+xVW2njaqXGESiPHOWifQWDUFqR4=; b=hR13FIxeCmzFBcA3kPsaB9bIlw99ooy2billsp9fRJE04045ckmi1ZSwnGp7ZCG00QfPcRap9Nk1IlQ5/14kszP/InBqDt+13RMKxq7w828cYto4uuzaUATFtuG34i/ThFoVv+bby4Hg1jEsJ5lfFPtE8CW9LWf5FeET2An3mugUNnTNSRTsqtfZ4MLDcmXueu6LXG9VX3R7uzjXe1Z8DVKmcMmey0euPb7m0JuhMGRsf0dzqphWt0A2d/1jpteK/t9esp/QfJ4Qr5Yo5dsWuhY3ATfG6Y/dof3SZM3Z2BA5eH4/YIzeBj5rI+MpT8qPKyPws2OCcDfU1LKJvKItIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F+aFqwutfhlKA5d+xVW2njaqXGESiPHOWifQWDUFqR4=; b=zjgJjeUxT+T7ips/sAT3Ba2+Xdit5e26Evq1N1g8pt+sBmWjCJEFcdo0MF2z9HyDDCsie+NjbeaAqE+190e0AMF7KAIPd5oCdmwCSI7C7XsCc0YPiyn3XwHMIV/HiFPWlPKLxd76t6t3WR1Bfn2a9QLQIyptNQDEBilXakNiQeo= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none; lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:45 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:45 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Michael Cyr Subject: [PATCH 06/14] ibmvscsi_tgt: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:20 -0600 Message-Id: <20210211122728.31721-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 59699fee-181f-4603-c95c-08d8ce886f5a X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bqA8wYa64d7QDJBUu8eSYCI5qJNhvAdgwZTChHO/f6qYbDNF8f5ceMlPYfuFUuUINJihPQd0CxXy/fwsBrNgJPS9IULz9bPGfRWRG5uRlUb4lCFYgA3UfPera3YHD4hyjsEk3f4vSKOyJMfe6DsWpGGUmm2J08JMmFA2iKZakNbA0CcLgFVBOth/PMGQxTa59XnLUJhwxA+kXPm0jjawMFGp70t7HmSRovOCan/6qAcMaXOH+1v0GAOdtE6jjE+rVComyaobtpQHaN6pJF9Ug4Y0ffP9tvOJ34dPZzpbgF0D/z5BrC/DtrD1w8YYD08ff+6XEdCAxYgU6LRdAwpYuKV9SJIBum4aFYSk/grROg+5uhzEcqIKgB+0FdYTwmocn+eb7zg3/VPNdNnxzjz8d63jSqRbCo/eLx7SAh3+3Dpw3ZeBi46h9zMi2WydVliAWwSIro4SKx9qJLAbnSRQ9OssMMCA5DQAZCFMti/3h/pOvvp4NzWrTADaad/CyqUX2kuOonRZpSK07tA/JIlGMoAAMkjjk48pUE+KLHbR9w9pHsxF0oFeE19qQgpenfZygSLcxC9MEaKLo5YNUmchZw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: TOZnqHPszNxJb5O5AVnOTC2ZSfChqQV4uj/O8JgJXvEWOGrYgXhefPEA/trU8zRhvUdTzsB1tu0u8kcGPY925WqHn3Z0R48OABYZp1HbfhBQQfNMHYznikFqZNCKSba0X4aSwFswy+R5Gu9mcUty7QRB15mP0tzaIcYzDYCC/M/kJ7rrQJYZRahvwLMZvySGjuJhqPmQBW7aNCv4EA6s4MIJP+2Cuhf659XoL9RmyBtXRg808ooevfrb6qaGpNlA+gIGd2V1ijKQGUnL2TILpNK0TTvnyaqbMVL7br0Z15RZO50m7mVJNYhczPfj3AViIBv2m9KJvARPJsvbNza9ZoJ6cB5npFxtMFdVWPiETflG9jprYDnv7w/VXiTFXJ1Kzux7ASkQuINxqMVvG5uhGDJ3Wkhdb27s8LDyali4UWR2wXHEDbZQabvYVamlpRv1E3fqxJKBKEljaPAP2t19DNWqXLzui47OiAMMm+ap4Xj2eQoy5EXN2yC6jsWZjmC1UO+whtnJJB1HVjYUEifRKWW059WrWEcXX9hC8IO+tWpk0BosEwSmncIacXsL1G0GmesD9AII66lmjTiWxRlKHIC0GPhFl2uLf6aESpIs7TUETG5y9s7VJcIa1Qu4x4mkqbZ7yXU5HhgsgqfyY7M2ME6zEvn58omup00yDCFKQjMqqeBtOzKgmjIyS6a+WYmsgalRA1q75YdD3kg4oTGLvEOUuYehqilMlOmExHLmpKmUlM30ZGXJVAyeN6tl6gGmVZjyBOay1lVbFQ+622/uvmNb+EIL4/uG5LuyqxdqQdQebjXJz/itCjV88O1tvr9Iab8Xp52LnCxKqRKIyPfpqVGIU0Smt4QEwBCZOnCmmBzUYWq35GJIRdFW3gGQjpn9wihfNCsBI1gkmgAJ30JpSfHXHNUlpI/aHFzn9yv9T7c1qRipb/Oo3JKTBAzACNDCJZSfFBOSViasN3p7DNx+LprmkC7ypvyFQ3wYd7NJ7WK5gSiM9WRmPBAFApN8/eb/exCxssSt4c/a4my+xv8XIUW/5civJkoRAVK2v4nXhRCGoNcUr5rN7ZbcMDkk+jRlMmFwFnjJ+ov0V/C+oub3JrYMTLotzocq1sPXZeyxN9+i6qcuAP7Ye9XAogdGI7nwPtCY/5yx70nwZpWjNuiWp3VklsHjnJXRgnMhD8Ep5VgqSyahytn5ktib8QnSF+4RXLoOVj7O5s/O8/+WqK80xJCRtVh+rzYu6rs6d86vi0oFk9VLxuHZLQsstKivoYmvsf4vv5wEPgglVBme4mj1bUISRVhx5+GFjyg76yYVPbOZmTWiB6hLtAuYYtRdHx0e X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59699fee-181f-4603-c95c-08d8ce886f5a X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:45.4878 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MweyURyEpKjjiACuX/JBmSUFGdlVjmZ9AEIEoyHL7Le8t1CqAOdE+UNRE3o0ywVLrmczf0lFREzD89Ped2JgBGSLYACsAZyIg5dOGFUlkeY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org target_submit_cmd is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session. It will never return a failure, so we can remove that code from the driver. Cc: Michael Cyr Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index cc3908c2d2f9..cfc54532402c 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -2670,7 +2670,6 @@ static void ibmvscsis_parse_cmd(struct scsi_info *vscsi, u64 data_len = 0; enum dma_data_direction dir; int attr = 0; - int rc = 0; nexus = vscsi->tport.ibmv_nexus; /* @@ -2725,17 +2724,9 @@ static void ibmvscsis_parse_cmd(struct scsi_info *vscsi, srp->lun.scsi_lun[0] &= 0x3f; - rc = target_submit_cmd(&cmd->se_cmd, nexus->se_sess, srp->cdb, - cmd->sense_buf, scsilun_to_int(&srp->lun), - data_len, attr, dir, 0); - if (rc) { - dev_err(&vscsi->dev, "target_submit_cmd failed, rc %d\n", rc); - spin_lock_bh(&vscsi->intr_lock); - list_del(&cmd->list); - ibmvscsis_free_cmd_resources(vscsi, cmd); - spin_unlock_bh(&vscsi->intr_lock); - goto fail; - } + target_submit_cmd(&cmd->se_cmd, nexus->se_sess, srp->cdb, + cmd->sense_buf, scsilun_to_int(&srp->lun), + data_len, attr, dir, 0); return; fail: From patchwork Thu Feb 11 12:27:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 381440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43E01C433E0 for ; Thu, 11 Feb 2021 12:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 139BA64E2E for ; Thu, 11 Feb 2021 12:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbhBKMfJ (ORCPT ); Thu, 11 Feb 2021 07:35:09 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:44222 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbhBKMam (ORCPT ); Thu, 11 Feb 2021 07:30:42 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOSvA139843; Thu, 11 Feb 2021 12:27:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=o6Hv2gBirkeYKVwgzTvTppNqSRlSbrrnR80U5rxBOBw=; b=gnG3SIqts091n6Bxnq7HEOJrioacq6svALjFG26Y5REOcjJ02502SoUIgLB3X/vEpUBc T34kbKDmzrK4lD1dP1i4JGEufvWpusZo1JrDd6YdmADVYiO/x8v0cb7OCXZ/PAfU6oNB 25VuPs69YY1A6YDmPry9snFjGQ814++4cu1p3L7Gz4+f76SxF4MzREi4SPzBnfybVhPD 11KSxCRt6ygFhrI31kASXe+dODwZ/kRbu8qFXEO2aZD8fYc4xEb/Fojny71ELKj70Q+v GEJ4noFYVcCooOnImDEZCrQx6JZzE3HNpIWaJ5fv7wkRyvwTb5ve8IvMlFEnxczNBD3C zg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 36hkrn76f0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:52 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ4nH193915; Thu, 11 Feb 2021 12:27:51 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by aserp3030.oracle.com with ESMTP id 36j4prg58e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQ5n27nkSSnr7auILVMKKsnsiRayR4BJqgYpDusYntio6mHgOVA4Mdk2rM4xA+7js5UXWxi1mNRMUbLEWWwYhcI7K52E8aCIxdbNbofiCQoLSklc6OV5XEaruJv8n60sBTBQt4VRO4XX6+wuSbO6yC2pcSf4EHUoro4VyqSKSqOG9q1GGa3Af9hSybttOJOM2ow3esagj5Qj0zDUTJ64GnMw6+UH1GxndX1mhUlSnlHefpOeE1+AEjXIx/l3Az5pG9YfVHYl3e0x2VDmIfCmi1YrFj293RCHX3Cc44H4y2FNCjZA16leM9YJfJyc0X02kRypv0lVVfbHC/Y/nQniTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o6Hv2gBirkeYKVwgzTvTppNqSRlSbrrnR80U5rxBOBw=; b=WF9AH1o3w+K9aI8m2MaP6b05Q3e2ih1r5L618m/oFXsXOQjHg/F4Xnr3vilQnlH2u1xzW7U/km8i7tAXOtdsHfR8Zejx5Gq0v6C1rVXCt9QUTlELsJ3E59jBju9ao+oSGZ/TxWQ0ljhb2LwZbgEnnD882HHH4CYitWpyZ5UuDstdwZFQNL7IOMBEKuU6QMyqOOUnnp4JIAopa8lfi6crvJ3z//6n6Jznz9xKCGL+uREGRk9UrVt6QAAt2djrPwAVwqhtzerYHx62NNqp7gruOXu7QIWCHonVmTXUkWt5Pdedi23r6Fr0bcr9jSia5341wN72gm3dlNa3ggodW84vNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o6Hv2gBirkeYKVwgzTvTppNqSRlSbrrnR80U5rxBOBw=; b=y2i1FiICKNcQZVIvWWBRybuFjLj6ODoAex2HHngq3oXfNBlrwF8oBGqybSL1ZasPt1XAsCPO/wn8V14ZwDsRQN6Bv5zszne/Tu/NGlEPKLAvVY0TmE84uGbNfXueNfT9frvZzXHscSYeDYQquYxMPrZ48RAJKI8ezHmpFkcbbnQ= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none; lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:49 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:49 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Chris Boot Subject: [PATCH 09/14] sbp_target: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:23 -0600 Message-Id: <20210211122728.31721-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f64c7ec-f532-4301-04d9-08d8ce8871ac X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TrIdeI75KYrYCKUbpT/R3UvpDON7UUGCRBi5qW9+YHBMVX5U5PYq50IJnPCGrYMIrJkG3oR82MA+fLo7YY8wCiFS5cafJisoRwuM19Soq3OdxWhNV4yZOXWnSgxnPd5msfRZSwECCtAZpR+aFzF6Q9mx0bu8LTrZ/0VlLjv6vvDxyWxORXGeuwG5KkQua2utzwZ+UW7T6uUoT072TcX0Pa9a24Nan+0MowgMx5dnKPs+C+sGEETJ6oN1CLLDXNKC16yiqDqgawJEF/2cVrHjpkWu5h+uw0ycPZ3i3KOGPJ/tZv9qsKnXjlIMwSc1fkiMRXQ26tyV8s75eqtw2v/7dvWqkf/lHDwciAk4XEWBxme5nzN8BXgs2taM2C5OzC9vXlBcUKX08SyrZBrQECv2IiD3kR5jHlAMJMVrz5sc8VtqG2kimTB/7qsNdB8gdwP1HWQ8Ck9Qy+TG974danzNSbCBofIPIGRkB2/LsWuVKQdt8DuJkP2lRi4xrDIG5OhIs/P5dB2uQ2qMgs7s3EhiACw8hiQn4q3vgnBcKvMOHIEesSnqPWfkW55y/8FgIUOS/BNRQcJhBrXMhfobczEDMg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Ks/+Fm0Zq5GsVpksZoCF9p3EGvvLjilxWei/vu1Kk2HcUCCC2vBd1vGQ8MYhrSAX5dP8/7UlqCn2Wjxb6ST4sHj9Xcuribos54nDUQztn93XaoSrszNyj2oE7hB8LU8cegESF4fV9YNWb52tNvrEyFyZLaoR6WWSx5y/hXWQaDem/Vbm2MKybs4GlSsEvfm+hBpjg4I0mQRu42nspavQbsOysk6735J3lBOtqtBhcaaZMei49wfnqrdZRLGcGyfyKZu8sE9V5n5CqQajkrexPFGhnrs4zYGrqPBjFegIJYdhNKR/1AcXkr++Ggnbxqhur2aYM0c8D6ZaDR8KBrRsdwdmky71x0bhph2jReu1JxEQd3LkmS4JcelBPgOIy+288e1XzlSjsVfMsY5kn0G+iUNx1XIO/fW0C70lWOMjgS6PNG3pilrDcRyCphMMGj3CkJ9w9seElj4RaCLQxHpnTDUnZv2nlN9I7q3Vo1zvSzVVMUmEcC5oHrxK5+T+e4db4buhDU10ic3zv9oJ2YPyeFpPcNgH0s2e/I8aaHhGvillY5dw1DgrcHYHv1tZ8HleEySMArY3DMvoYbm7Dx1VdwHXwS1sw3fQfNTF0/jYCH6hRfMT8e6DiZXuqzKVql3neGTcDRKyzsGSLQ5TaSoTZ5Xm8zZDaBHPM7+O/+U/Xnne4+3s1OaavumBRupUq0HAeufCJrlQn5Sl5OIebFepaYUGN517F27ebfkvisIXAfF61HYm2+rOZZeI4kC5CfNZNnhfSXsXcD8pvDHsbaumCqUCrPs5M+iXmL0TZTgrg9RMZs1gv3hUx2fcwdvzg0LrI64nMymWai45NTr59O6IA7kygaETCIjc9n7bByrjbh3ib5oJJB1GC6TkHR6Sms3HPfzpwIV/JQBPZoYsWGfgBydsa0UT8LgfiaTCAaxhEAlXviyOmeb7QpK2QAwjMn5XioM9tV/8JV5//8v9Ui9xgzbpsaQ2VEj6UxPWbxufRdUu+++mF5ms1cHenK+w1n3dFbRVhcSmAlzBRcVm6yV77yiRQsBQKPfX5RIHzqhEpPTJsWmAmc/Ra8GWHplT+bR3Kj+16imnUA0oDTLuN8iQzE3Toy82Vp+ePDq7YZlkysMKTODKk+MehfDZ5eKdmxpfwGVM4JdJBiNBRin2Ne6SrRM2ZmhRBRGc4glg9dUI8PgNyTI1P77bqE5/aBa0iKfrSAVNTA5LnA0im93ggeMCD+rOYY6U6DSpFIw1g6IZDiEFpPx78UVd5rAnYnGACQsI1p+gqT8tmcFzNW+yoGhk92hnaKcAhpxUu/6bAuka3CjIeMLzr8fgW0k3REO6gcgd X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f64c7ec-f532-4301-04d9-08d8ce8871ac X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:49.3146 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BQ+Ng0DIlA40BYxw1hYfPljUwLKLAswpjjhbcUb4t1MmspfXhQ0H45zVMBynLsUJkWuBEB970T+L/TiMYu3BrzYxo2ostiRsd417keWau+Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org target_submit_cmd is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session. It will never return a failure, so we can remove that code from the driver. Cc: Chris Boot Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/sbp/sbp_target.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index e4a9b9fe3dfb..f467c50aee08 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c @@ -1218,11 +1218,9 @@ static void sbp_handle_command(struct sbp_target_request *req) /* only used for printk until we do TMRs */ req->se_cmd.tag = req->orb_pointer; - if (target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf, - req->sense_buf, unpacked_lun, data_length, - TCM_SIMPLE_TAG, data_dir, TARGET_SCF_ACK_KREF)) - goto err; - + target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf, + req->sense_buf, unpacked_lun, data_length, + TCM_SIMPLE_TAG, data_dir, TARGET_SCF_ACK_KREF); return; err: From patchwork Thu Feb 11 12:27:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 381443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BC40C433E9 for ; Thu, 11 Feb 2021 12:33:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 666D064E8A for ; Thu, 11 Feb 2021 12:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231665AbhBKMc5 (ORCPT ); Thu, 11 Feb 2021 07:32:57 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:43062 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbhBKM2l (ORCPT ); Thu, 11 Feb 2021 07:28:41 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOGfA139808; Thu, 11 Feb 2021 12:27:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=uwPzet92S7R8c6C4fWnQUmHmjuehLZix74TyPdaTFPU=; b=0hlOqY6Dx6mwGqnFtaiEwvKAJ0oWRfdYekfM7eS9ngasOLKXrKOE3GJf6sgqD6uukjaN eCweEqKRo8WaBN4QjscjcVQqAlkDdHL1ChRH/z9AxCgMdbnIJkXNc89T0wkFGm5cbzL0 DTC8uclg28EB/BzAG379Mt75nCXNmr810mbdb1aVXK3vPIvHol7eHn17D6Qagws8afYf 8yQTh9QUX9+Ju0QoVMfgebHtgn/00wz8frXQr+EAoLSigCFGyGGcA/iQwrEbNCQPSS7A O8BVzwdPu+PcKRDQGEOZdJSlZirLB4+xxU6Ok1BvNKr42VGHaZSqufR2lWP8v2ygPPBM gw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 36hkrn76f2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:52 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ4nI193915; Thu, 11 Feb 2021 12:27:52 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by aserp3030.oracle.com with ESMTP id 36j4prg58e-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/8+CZzJXW4pMZDw0rNHHD8i6v8pwzAQ4qoyoXflZ3LgUR4TShgwu/Ih9DR4Cj8YtcZJA2oWHWZDulpTt6Kpw29VWqLmMUdcRLO2cK+VeDXBDuqLuDnetcy8pQH9Hqf/i99Z83nlziCQqUc1NyBGJCGvYgn73yqU395fSo3ODa3/99UISyivoUV33DUwpvEinzi46JxPLllKNv4Ne3lsnYbYYXxZ9BEdLatRf+c+Al67sGcd1mIUF/lLo0mVtDuyiXgWd6QfQEGSH+0Jf/fcvqpZi9rqRhKiCIdGVocxZyTdyEkmF4z14v21yZZiCePLUEBekazi+Bz0BlT/QPuclg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uwPzet92S7R8c6C4fWnQUmHmjuehLZix74TyPdaTFPU=; b=MWSIFAFxU97TZDiNGpgeLvGDNdkOOJwv80q/AEPQ+wRP7Wuvy9ze7bjSRCJaH3x/M13qn/mpQmBS5j1eKZRL1JS7wm9MJyFhuMIjHKVSHf29+y/DOYVkip9zmmrPlQslByNYjf3Y0ty8pU9AkJ1pto95GoCcagj2/otkPkq2vSNQi7xOqDCRF3+ybS5IunOIdVIuTXOtN7dvFj+Pg2hOQhC9az3/Lp5A/bL/e+vkuuc4s+OZqhwG+MVQ+8uDbGt/eXVoWIGX/tr43DR6CUAQyjPfOl/CvygHXbKv2I5xcG7DYAXeqfN4MJif3NKLOppXcrTqDR9lLYyp5xv9rZQ9Zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uwPzet92S7R8c6C4fWnQUmHmjuehLZix74TyPdaTFPU=; b=STL3oKDEWNeET2zhOcVR5ot0ydBav93gf1k+OVATecCy8C6STKkvDABfS9GH2kSylpbQ+5qOb3neGNRteg4aTC5UXR48JDCL3B2WzzIGDX5lH4kmahNPt69nrOt76KreBRSeijBxqrCC9NJDT83rGqYxd3rqGCVyFErE98XcDXM= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none; lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:50 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:50 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Felipe Balbi Subject: [PATCH 10/14] usb gadget: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:24 -0600 Message-Id: <20210211122728.31721-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2fbfea1-fec0-4382-9d1a-08d8ce887265 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tYucBx8aybDGZ7om8TznshbFYDecFdpD70yBkICp/XJWfOqLXeEcXMigPHoPhfABX4n+l/qh5gt7vMyblWC7V8a1JEVDMOzUY89ZijiX1XC8Oh2uvdIJPtt5tPeJgJ1lKcTIb1ZdUk+w+8Sw6dx26SNr/lxdXzM8pYqazYBo9wEg2E2nfwlJQFA3N5E0ByjrRrkZ2ak8osHQa+MeQ1ik/GFjV8Q6YLZY52LtyZegcJsqBnRr1WEiwA0IhUFWnjwF0P62URM2U0vwx2we7qbAqUiCu6h6Ce1oZTECE0DFc5PnMVT4xfTeQfovrmzvTk9tJXmJybZexFELuAx+FyNcUAKYdBJsG/YQ/YxjM0zlFys9KMLP4VgocEyOhOoU4rFG7jplCfY+88U7F5FA4rAWjsd7dD0mnYtEHh84SrURdkaimMvE1bNVWhW91DAPBVjlrCmvxCLf19h28ouKncSr8rvJqk2QrgesfDdYLEg2CXJmCBJfuL7ES9e9mViXtFITuXWADvm1q/dP5cLGh3wYy8EBmWl6NX/UGd9lsmNHm9rFzPztpcnFYYA8vHzB/AX/PbB7WG+PwYnQyUYNMtX8rA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: NlAMMggqetPq+GXeaLG9X4ivl88xdZ/+GfHsfEDiCPXn1h84igJDwfUSvAT4Shd1YwmWR8Z0O8CCesED2SjQpao6KlJUXjcLdpwLnPPM3yLXAnAYN90w86wSLJUomJoHdaV6mqQPaqLrG0ddI3DMPgsy8z5s+pCK1apxOSHFLsiPbnjJFgh9bAFWJdj2zHJbN7MI5492BckE6o2tBLXaNMw5kHAozu8tBdUA5lyQYq9rUn2dcGkdWlorxobeDwhEhxVhP9QUE2E3KYycz6w5hr7vMSdZSwOQ0xhz5j23tL+QRPssTNS2xZ0bOZ+l7aS7y+cMl30wDBX3c7EYgkHQlOCgHaPRLqV1aa5+h+TXhZh0YYxNjWoJdRdmM2wM0uzCQK4Ljs/Sof3S7RSUVgaFC2KEEklgO8SMm+fMY75GknmcvuuUom1EDRtrxY2REPZqQea8s3naVbEwVkTkMQXuujEaB6bDBcUjTVTdXtYqduUpUwTKBSLL+2M7L3SHE5jwDcBtyDA1vPIEDMF7/cvbfYqbFW5tLrapJH8IIlS5qN3ZfOrLBlKRmnkeJxeTOy+9tzMOGdN08OftmCBrggsz6eKN+U9PCKEdRWE75bCkZOnLhPs8WvEUPKuUXz4ajz6g1zpsnhgRCQxN17O0+lne0vimAjkKF49MWWUe/XPrmdidWsahXROdNAwQpqG0uPd2VQLVAVH97CZbpxAC+HPdWPrP63PtsgY3VOAo04kGb9cqWdekPIAVfFJQ9Q7RNUxWrWlfIe2mJYh7i8Un5UrqQISlVICb+p/lUrhbZIxS0wVpXbThHdWHwFoMiz2d2CphvJq4MKAOzJrfqbE1GirznizO/jZUy9KVRR4D5qLOC4G+ps7Kg/ANPVy63Fn5nUvPEmDJeid6RRPVM81g4y6XlGXzvkdbWXsRp2hK59BruBhsHTG9ME5GAPhomavXbbrDvebt5r6QyMSvd7z6hw+4ZbxDwgLyTPLT+GAsaouGuEBcYIsMCGwaKnKSTQYIxDNEC4AVeCfIUssVJ8Q5iKGc5u/t3nKsP7jhjr9iLUPn9nAL4+PIcVRw3EZb2lma+j/Ow5OB0k3nTlIgA8oCXIFllreK0rW1Z5mnzFJ5aZhlsEBO90Bf5HhqSVnjNM+uCB869y5lHFFGcSxBSeshM/7gUAYBKHNMOoXcTwbH1UbFT70Ed3DAflpI/SjH542FVeLhPNZ0h5WCZL63qhpbMSYjItRWrmAgGh2sVkKOGWFvEwcv0VHF6kCB62itVDy1TPpVTcwr3rnZ0LA6PJvlcbzvvlZvZCRxoy5lziegMlnnn98nJDrikxqtdKCEGr/Xe10r X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2fbfea1-fec0-4382-9d1a-08d8ce887265 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:50.6469 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: v3Df94DS+WXKxitx623+cNfr5MfLlre0lpzW/5uQ/x0dwjE90gXovpg4fYiS3B9nzhwxvde3pizzoj69NwemMQVXYbDTGh171pLnjr1PQyE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org target_submit_cmd is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session. It will never return a failure, so we can remove that code from the driver. Note: Before these patches target_submit_cmd would never return an error for usb since it does not use target_stop_session. If it did then we would have hit a refcount error here: transport_send_check_condition_and_sense(se_cmd, TCM_UNSUPPORTED_SCSI_OPCODE, 1); transport_generic_free_cmd(&cmd->se_cmd, 0); transport_send_check_condition_and_sense calls queue_status and the driver can sometimes do transport_generic_free_cmd from there via uasp_status_data_cmpl. In that case, the above transport_generic_free_cmd would then hit a refcount error. So that other use of the above error path in the driver is also probably wrong, but someone with the hardware needs to fix that. Cc: Felipe Balbi Signed-off-by: Mike Christie --- drivers/usb/gadget/function/f_tcm.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index dcce6e2605f5..7acb507946e6 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1058,11 +1058,9 @@ static void usbg_cmd_work(struct work_struct *work) goto out; } - if (target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf, - cmd->sense_iu.sense, cmd->unpacked_lun, 0, - cmd->prio_attr, dir, flags) < 0) - goto out; - + target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf, + cmd->sense_iu.sense, cmd->unpacked_lun, 0, + cmd->prio_attr, dir, flags); return; out: @@ -1189,11 +1187,9 @@ static void bot_cmd_work(struct work_struct *work) goto out; } - if (target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, - cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun, - cmd->data_len, cmd->prio_attr, dir, 0) < 0) - goto out; - + target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, + cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun, + cmd->data_len, cmd->prio_attr, dir, 0); return; out: From patchwork Thu Feb 11 12:27:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 381442 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA621C433DB for ; Thu, 11 Feb 2021 12:33:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A14C064E05 for ; Thu, 11 Feb 2021 12:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbhBKMde (ORCPT ); Thu, 11 Feb 2021 07:33:34 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:43096 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231618AbhBKM2n (ORCPT ); Thu, 11 Feb 2021 07:28:43 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCNxaX139125; Thu, 11 Feb 2021 12:27:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=+IvQR5zqlrgeoGPiEmEK6qTv1WxOD4Xt6+pPgvpzIWo=; b=WGm290YhZKQg3VjY5E8zk2Dju7AhZ8lCldke/NWLXgubJ+a8rqzTJIyNHnBEz0NxnyBk qnUnw6yUQIQ+eDGjUrUE7YIOlL3EYyKySFCf8rIUD/5VtVLd68xrhyX8hQn0KCmdB7Q2 qrqt1RRj8T+ZXMVM7/wle6TsiaeJbMNpUAheFc7Al4BXKp4M4zv7TGy3amrFtA0AtLXR bFOvSgU8lueD3CqK3+Rb7Z6s+lQ2kLBV4PJKaehRkM8nJFuU0xYdeOvPApi5Zt4eGPUS rwwvpQlWt0qtHNGQj/2vPdJF/m8L5WGXyPfT8G+7zEq+DiXQ481kAk384VIMi0GuTeyW 9w== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 36hkrn76f4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:55 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ2iE193594; Thu, 11 Feb 2021 12:27:54 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by aserp3030.oracle.com with ESMTP id 36j4prg59f-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k62/e5S31BidUppTZJyWfRIv4wRFstSRfVAsE14AwKIRZjN5cFg1DUWbfkUx9HOEORgYYZ2Ybyj1sASnO5N+da+q346XRvqxcI60HvgDZkCBaUeo+kjFQfnojgOJUt2MbiNXt+dITyVZkYXaHXtUbcngmvgniiXct3mssWYNkZc7CXHFt9NDoEJU0OvoHxblS0sY4mssRv8nhxiKzSh3UdCVBX9v5FV/d7Qd2rXWgyRRs/YIhl7x43E730bGcOWBaxI3w+YnR/MXjpphSfWbcA3AifpVGODfkOsuIjr6iUyAGdBjpd683W1yDL7tJAUAJ0rI9JYbwy/IU8CQ1QXqGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+IvQR5zqlrgeoGPiEmEK6qTv1WxOD4Xt6+pPgvpzIWo=; b=KgWFlYpL+Lt3ineha389HcWVgplF4GsML/hO8t1nMGLMSjQCxyL+hbq6gfks/GccN4oSeLY6b0ILt/ZMpRL8xKjnvB22mDOM6DLBbqKQ13sqPLy7vxFkWgmBloqYI4oxdf8XKr2PcAcs2uXfkD7GbmqC4RlkTek6bp8wG6FBQG1LZB7m+rfXlWZQ03SGnh0UkK1xQ/YgkY3EeKG1TQMbKHRmCSBsJheVh8xwBLZ8xgmYpM1Q9DwGx41VZjSxuWRdxbvBeGjsfCrQzQ+4zauYGczmqfgRZJ3hoI09ZZuR8Mzb6JvRX3BF8upoezIQNgmoX5gK5grF6v/lnyyJx/8RIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+IvQR5zqlrgeoGPiEmEK6qTv1WxOD4Xt6+pPgvpzIWo=; b=AUNX/lFGWuUsm8s8friD5zGcmioOGoeNNqBx2+BATszM31n/orfFx5hShB0MHYd32zKPFQIih9DvTK6z+eDz76N0Bb8yvLZOkqGCPeUKdzOPCfqVNjxMs6a8221gjZCp3an8qoVzaAiid+n83dcxBVyDH79RYKIAeva6KO9wj2M= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none; lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:53 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:53 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 12/14] xen-scsiback: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:26 -0600 Message-Id: <20210211122728.31721-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d27c5ee6-1ea6-426e-5bc7-08d8ce8873e8 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:415; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f4/3wNj8K3h1VrvL7ryrUDqUg6AQFCJekvh7gPgucOUl9AESA1Q7pN3tiICbu2BsE0wlzzCCsJzsCTRiynzgKXsOyWxGKapiS/JAl7CSPgl8FyZUXsZZRSGgHAiw7S1lo65YcxpjNWG6XDIprT5H4PR5t/tFzRndbKvT9XRmWhtmGKnEiGNEc8j/HhNQ+IS602z0GRplnPk7ZVrtVxVGgOZAKctvgMwc+kR6y6GwRlIOBWKmtvlUw+0fwej4Ex9rlkFMjvplKT/g6eCqkviFHPiCJxFN8HXdtTd9PxeRfwFE2cqVkQPkhaAXgf52QFFMe/rfsB1jFtHpLUBlaRt6C+yLmoX5P7syddAjvXhIceqjF7wIY1XpY/chT4hxpKNI4GzKLpBMD5/sX0LjDiULETUJAz5i7zRTxNNFynJx3pS0qshCKg7DmUU1HRBHm8eJo8l6HzLaqLxZJTsP5DPntiQ2InBV0Uyn7dvt5VX9J0kwBwYr1Y39n1P7AB2J2OgG9uD7wmqfNsZQBTz4EU871pwCP2dHI56D1nF15fBhwV+yRPy/19xKWDPL3ahnqW+bny0TmOPuYu1cD4SfhE+c7A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: f80awwCajoa5GURkqTOy9StPvxuyLyFFc9yoXOzAUj+TsOD+V9343+NaLyvXEfiy1UzG5bi6jv9UGWoV65Zkbvt/CqCEnnGRxSYYtEHRfb3CoSopASJYsFd3ujF5Rfa8Bl5C6AhhESRAe1I9CVKYqZDfvvrquz34KYqPm2Wq6QmnPWpo2SaTT6TCBeVgk08eVauH8UPX6UNwpw1Kl6iqYlmn/cJ6kc2FhRUgATj8BIiYNjDkXLj3sm+b2NTFqwNJ0OyEWwY8N+SdChvwR3+EJBwfgdLwRwCrR4M/QUwMYYpHZD7MsrxFy+vsYWo81/nu7UBaH0uCi5VXAYZ184IjavB0b+f3HzAZ3JErIahYG583w/XO3uJw+jW68FgTjBDV9Ok2J1ZOIdzzuTZCsvHU7oNCpgtgVQ1EZ7oNQUAsXw7PzqUyt5BNC+8R46nOiwxf3Xbh/EGXHm5fC9ljEp/FcZtP27nAuVEI4g+iF1EvSm9qSa4R7d9MB8tyd10VvhCKgNp9FcYn0mrlMyRIyy0AKV1Ws6IbeVtXTCUCO8lrlLiNE5sK7w+35YoctqYE2HGoW7A/LK+Fg9kwo5PlZzDZTuAoCaXEap1MGbPwrBNAOkYUkMHL13wGJK9NBGhbSAZUPoeTPEwzYDtAe3o7ehmn40jV8CyKUjoG1jW3ZS9fO3zFRn0iyH7B8CGfLg8cSz5W2wHSC0KRB1/7UZCQmzZgmQwzXZ7cNU3JoULzKD55xYICCRMVtiFMa+/1Ydv/B/Jsl5h7Xay6ZeYkW0aFYdrRoqfo1nzzhJUM7w4BAo52eZdI5u6Pver8O7IKyAmp8vL7/ExqCJpJAz6uI0C0KJ35OUMeThxhJGsYGvOS/dGuIp710O9mvWu4IP2DrrqI4aATqU59Lge/U7ANlfbfGEmIreSEUtIkBkZH96JO4i0fF+x5JQOtwkuCEnKZpXZvsqUCCWey0pulvbi918wsxlVOsJNYBtweegnwCKM8HA+Gw/IAoEfDAcV117eUixgmDOImZP3Syyu+QOzzsk8rCKh8c/toSgY1jsX4TanPcnBfbuFiDO8VhmaRnwhzlt40xT/1myl+e9aGRnh/GUbnXuHKe9JTD32nJej4lm9qqirRfHE5cL9ny+eLI/uUHEkt3PglK7tEjyKGmnt9R24oV5opkyOwF5cNY/3z+2sEY31oNc8iFRftiI3b9FFq2JkYPtT752ZdnscYHQa90e9ZsUh4tWBDG0sfetODd2yhQlMqogs73cxZpLJkzmuJHguELCzbb7fD1PYqNab64dUmHQhxsuxWMfR4g7vlfytPhYdo0KxRQL+GSOB99BvY+Hd5DH3b X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d27c5ee6-1ea6-426e-5bc7-08d8ce8873e8 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:53.0735 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2RvhDXMsWCQrBTHL6ouU4qVo3bYJsBchywuxNPp/7mzp5ufD1MLcDmTq0C67Eu2XQDcPG/O/v0E7kvXg9kVs8xOzA4sB8tvHjZdITFnbr/A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org target_submit_cmd_map_sgls is being removed, so convert xen to the new submission API. This has it use target_init_cmd/target_submit_prep/target_submit because we need to have lio core map sgls which is now done in target_submit_prep. target_init_cmd will never fail for xen because it does it's own sync during session shutdown, so we can remove that code. Note: xen ever calls target_stop_session so target_submit_cmd_map_sgls never failed (in the new API target_init_cmd handles target_stop_session being called when cmds are being submitted). If it were to have used target_stop_session and got an error, we would have hit a refcount bug like xen and usb, because it does: if (rc < 0) { transport_send_check_condition_and_sense(se_cmd, TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); transport_generic_free_cmd(se_cmd, 0); } transport_send_check_condition_and_sense calls queue_status which calls scsiback_cmd_done->target_put_sess_cmd. We do an extra transport_generic_free_cmd call above which would have dropped the refcount to -1 and the refcount code would spit out errors. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/xen/xen-scsiback.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 862162dca33c..cf6d45f2931b 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -360,21 +360,18 @@ static void scsiback_cmd_exec(struct vscsibk_pend *pending_req) { struct se_cmd *se_cmd = &pending_req->se_cmd; struct se_session *sess = pending_req->v2p->tpg->tpg_nexus->tvn_se_sess; - int rc; scsiback_get(pending_req->info); se_cmd->tag = pending_req->rqid; - rc = target_submit_cmd_map_sgls(se_cmd, sess, pending_req->cmnd, - pending_req->sense_buffer, pending_req->v2p->lun, - pending_req->data_len, 0, - pending_req->sc_data_direction, TARGET_SCF_ACK_KREF, - pending_req->sgl, pending_req->n_sg, - NULL, 0, NULL, 0); - if (rc < 0) { - transport_send_check_condition_and_sense(se_cmd, - TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); - transport_generic_free_cmd(se_cmd, 0); - } + target_init_cmd(se_cmd, sess, pending_req->sense_buffer, + pending_req->v2p->lun, pending_req->data_len, 0, + pending_req->sc_data_direction, TARGET_SCF_ACK_KREF); + + if (target_submit_prep(se_cmd, pending_req->cmnd, pending_req->sgl, + pending_req->n_sg, NULL, 0, NULL, 0)) + return; + + target_submit(se_cmd); } static int scsiback_gnttab_data_map_batch(struct gnttab_map_grant_ref *map, From patchwork Thu Feb 11 12:27:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 381441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B60AC433DB for ; Thu, 11 Feb 2021 12:34:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 223D364D79 for ; Thu, 11 Feb 2021 12:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230523AbhBKMeR (ORCPT ); Thu, 11 Feb 2021 07:34:17 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:43144 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230418AbhBKMan (ORCPT ); Thu, 11 Feb 2021 07:30:43 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCPwwP050964; Thu, 11 Feb 2021 12:27:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=QSXy+u4wfxMoiI3PlQFsQTziZQjSgeni3stxI0PcGdE=; b=YYfR6Oin3/O7gwSZFZdf4cqZOLVkfOwI/ax/70tXd4JKUs7WB8M/FGyYm665nqigGJDq CBzXIG1G9s6AOZHnmR8gX4S8W16nrVQZTWMX5Ps91aSa/+IqFeSOftC/dhZ/sZw+OpsV zQjfQzDVy64a8GGIN2DP2sWifGiTil8DXCGF8wC9XGscJtrK4k3tg6jjvGuLkSxmAeqg AqApRqzeHm26nBYWMIQIO6Mjnj2QdAUd7aos1J2oGXIW30kbnfo+vskYzgbqeuMxAFqk qK4qME2JXnjVZYiqLtnj285KAXs3ggz74WL1LqSU+Tq9vPZHbFa7hLBzzLKEDUCfsq5F tA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 36m4upws4y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:57 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ2iG193594; Thu, 11 Feb 2021 12:27:57 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3030.oracle.com with ESMTP id 36j4prg5ak-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q8kjf84axy5SbsmYLWpQ8KOw8dUPSMx5MWhCEOnUXBFla2FHq/673jYXqtvQ6PfF4LrJWoxiGycgHcHWwYlSms8vw/BrIpIXj9SFvLKgeo2Fo16Qt2bMnPAT2gP1RNhGsdvFa3JiQ9pVGVbXt0hl78J27oHTLA2n3FBo1tdVJ0Ae1XcizmUl2KLZijz4tdefhLq1LcJlnHVNtfQGV+BwECLhw72kzJ8tEMgu3/cfQF9WmyiUeI7Pv50vYodM8IxvVZEo1MdeVbmshFUnyOqU0R+AnMiS6tn3QSWv//xpaXbhR/Y3UIRcMfq21TyCum+3cGxFBxVEQD1BdQo1gr0RdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QSXy+u4wfxMoiI3PlQFsQTziZQjSgeni3stxI0PcGdE=; b=eBPE7HcYqgwy30dNXbWoVrZ0uZqhWrQO8s66U8WvZHOaliw40VNBqvjVtw2rcYOVhotzE/mMjGVMD1q1a+w9DLFODIPC+EhD5lx9Tgwa/AsBnlbfFcrynFRt9Lu5Nu5sscWlX364dHXhYJkEkewo/dI3lSosYrWcOw+kDnY2sRaAldUWJTtcSRG4qIfUbK8nCEWR9SO0Wtt9M0Sbdq0QXxdQqwf3L00i7DO5JB239N58AMSC7KF2IcUQOViAOmLjhaU6mcwG/RyvTS03fC4fhuhMMTQDaC0G+dpQtynLSfZGNvi0YY/Y5PKt5BCPC/Ah0BMmetoELnZHhSMMVDp2hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QSXy+u4wfxMoiI3PlQFsQTziZQjSgeni3stxI0PcGdE=; b=KzC3Kg81ghkImhUO1u6yYWOpK6lnBSEhviRy2WVWsDXMEXxegD2QAqfvRLUo/A3CfM6UEvuqUPM2OfPVEXZzR/rC/dfFdaW7dtHdQjal+3cVI+z4F0msRzJjA1xFX/pWlpKojtVQ7wMSjiBSTD4+b41zRJEjfpYapCrD0ewKROU= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none; lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:55 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:55 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 14/14] target: remove target_submit_cmd_map_sgls Date: Thu, 11 Feb 2021 06:27:28 -0600 Message-Id: <20210211122728.31721-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 48a133f4-0ff6-4660-7cd8-08d8ce88753f X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b+UtDyH/BRZo3sNVfpC3sqIJ6ZzexeRZWZBWvRqkJuxLSLCwCpGS8yMm241qTLVqsrHeukdxmeuIbEYbnGZJMtRd56CGG4MFIqRQsf6U8KEVIfjX1xN11hDsdLnZUCDYf6Sne+z8FCDfXsiRYr9fuNe33ZmWiracVwHAAqW3TDa8AllLfac446d2bstyY/Lc9ot61T8LXdBXEm2ovIZgIcLyEQrzeZiC66Ibow7gQ+x8O1zgIP0z4nUZoh49VmIN+TTGDbnDqn+ru22Q74TK10QEVAYxGq1xJ2t/mbx6hQnNAifNPuZUseLqjY2kXz9zYser4SPx89KHZY4jsaxYJvc8Idanrv0p/EukVZeOB2EEN59CmkFO6NVxPjQ6Ng3iqSDW2AnYZhOdsIBxGmNOeYyuClP1hU3gJM4MZ01YaFRCMzIbUJNIwsWWv+PCWtXLXJrtjnblsGJjGh1pFZRCrfJoFxekQU2/gF+nLyDFF4ec3htcIxBcgbEBhkCKmSVXUWgp4P/rZnRSJ4DuKeXMGTHbLvI1Hnm68eLIsMrPqNsMkww8QbM+wJy0Is15glb802+Nn8pvSb40srN2PKH7xg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: fdJLrVr5UwBK8qfKhQbAodlCSAVWkr0TE6s7F2cvoqxzCuMo0juqZHzG6RlaD2K80Lega97q7iym9nTfrAlhcFP/1JtBVI1KTOj1KUt6GiFSKLf+oq5wZlvaSVRrRbuAkgqTRteoZnoqiBMdizqLmTJ3eBqgZQNCAus6Mq+V4hFFU9RPJfrdAOHsn5kfAYWZ53sJ7jL7QLNyhgl6UVoOzCE/YRnNA3tJtk6qGHs5mUIK3/jaNXkF8/tinodv2B1ySHimq3/bMmRF9WGe1lq8NHhGqQhIq4acUSt4PhrVqcQ0wZnrnmvmj1MwGJqFAgGFA6qKUDMyG8ffWa3GnfWLtnNNJMuVyH6EQIUZGC3w09I6Fz9b+ybef3WU0XQH3o8x7HolmQIg0X+hLH/hhQmQezUmtmVWUdHjEx0j+CGNuf6gXwgxFTy/UPsvFNzOEG1S4XIudFt/ZygyG1qmS+w0kT9NDIjTNbe6AP8KvCZsQXKpUJ4Zck5/1+C/dmMD0nYHbpFu/mJvInYM07EYmaj5VlvUENoaezdydpluOwTd4LV4HZCXc2UoMeMT+tE9uevmOAnSXRrJoLkdZJj27XsGMtdfmIJhDHfKfdqqIq99O9MwVwn1uK+Jo3yEiPTORljPMJNZcICckPTcmBdTd9Er659eGnarrfZt3PteM3eR9M4cDZ92iJoE252r9zTl9svT9FFeF8pPk2i9GwmQSUdrckX1N5TA6KulMl2ACmvEP0tPuYO0ajhvjxqnlgZzKLkZEmNHAvh/1U3bwJLHsdpcs1djIBCY/JppOz2oF9VwmyC6Y2+GXgUwmYlpdwPOMeKnva9Z4HQ9IrOgtScPbNS73E+gfpetNvkqzepkqVW/xTdfy2GEqrwaqkWHuBuZ8GH0UATi/wF58oQ7MrX9BcscVmPWpJCd0NRZ4iTVFmRlDORloZDYnKbIdG/WHigldIeZF7ItsmsdfxCOYPbFZomCoUVgKYJ+TZzo8fs3vuDxGmA/7HVV47s2sCSa030aL5q2lum+9I+aOXW2w2TNiqJEK4jDoI2vPLORQETNLad1gd5oqnLjCwrPGtt4Wd1z+Fx3TtsLjGX5VS/kZoPTX2TZQAbOdzqrXYQx8I5FWJROo3wZPZ1XNpQ5mLudEoTiIdV16m8z/7zUFgjX+DMxvG+W1WRUv+Uk60xYi92ZPdkiDzxUbV3EPRLKlf7Cdxq9iySUcg7XlaMQBO/Y7C9SgndLWye/Q5iRdyF0yTliC+eBMYOzXZ4WSAIazjHvyxE597Ifrfu4Q7mmfwRwkpEYFteqMjOnJBoWxfn2FFzPf/C8qcvn+UoeZdEJARqmgXPI3OlH X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48a133f4-0ff6-4660-7cd8-08d8ce88753f X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:55.3033 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EhDYrCWvS56abdnSAYpDJBJhx/iZLglHu+KVvYegwpop4muEWLG/Qb5qudnBsSuJb5pDRwYRjinA/zKDLtfS64ylZM3MrRJ87d/OTZMfFuY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Convert target_submit_cmd to do its own calls and then reomve target_submit_cmd_map_sgls since no one uses it. Signed-off-by: Mike Christie --- drivers/target/target_core_transport.c | 69 ++++---------------------- include/target/target_core_fabric.h | 6 +-- 2 files changed, 11 insertions(+), 64 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index a82b7da09872..ad30a99a5cb2 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1751,57 +1751,6 @@ void target_submit(struct se_cmd *se_cmd) } EXPORT_SYMBOL_GPL(target_submit); -/** - * target_submit_cmd_map_sgls - lookup unpacked lun and submit uninitialized - * se_cmd + use pre-allocated SGL memory. - * - * @se_cmd: command descriptor to submit - * @se_sess: associated se_sess for endpoint - * @cdb: pointer to SCSI CDB - * @sense: pointer to SCSI sense buffer - * @unpacked_lun: unpacked LUN to reference for struct se_lun - * @data_length: fabric expected data transfer length - * @task_attr: SAM task attribute - * @data_dir: DMA data direction - * @flags: flags for command submission from target_sc_flags_tables - * @sgl: struct scatterlist memory for unidirectional mapping - * @sgl_count: scatterlist count for unidirectional mapping - * @sgl_bidi: struct scatterlist memory for bidirectional READ mapping - * @sgl_bidi_count: scatterlist count for bidirectional READ mapping - * @sgl_prot: struct scatterlist memory protection information - * @sgl_prot_count: scatterlist count for protection information - * - * Task tags are supported if the caller has set @se_cmd->tag. - * - * Returns non zero to signal active I/O shutdown failure. All other - * setup exceptions will be returned as a SCSI CHECK_CONDITION response, - * but still return zero here. - * - * This may only be called from process context, and also currently - * assumes internal allocation of fabric payload buffer by target-core. - */ -int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess, - unsigned char *cdb, unsigned char *sense, u64 unpacked_lun, - u32 data_length, int task_attr, int data_dir, int flags, - struct scatterlist *sgl, u32 sgl_count, - struct scatterlist *sgl_bidi, u32 sgl_bidi_count, - struct scatterlist *sgl_prot, u32 sgl_prot_count) -{ - int rc; - - rc = target_init_cmd(se_cmd, se_sess, sense, unpacked_lun, - data_length, task_attr, data_dir, flags); - if (rc < 0) - return rc; - - - target_submit_prep(se_cmd, cdb, sgl, sgl_count, sgl_bidi, - sgl_bidi_count, sgl_prot, sgl_prot_count); - target_submit(se_cmd); - return 0; -} -EXPORT_SYMBOL(target_submit_cmd_map_sgls); - /** * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd * @@ -1817,22 +1766,24 @@ EXPORT_SYMBOL(target_submit_cmd_map_sgls); * * Task tags are supported if the caller has set @se_cmd->tag. * - * Returns non zero to signal active I/O shutdown failure. All other - * setup exceptions will be returned as a SCSI CHECK_CONDITION response, - * but still return zero here. - * * This may only be called from process context, and also currently * assumes internal allocation of fabric payload buffer by target-core. * * It also assumes interal target core SGL memory allocation. + * + * This function must only be used by drivers that do their own + * sync during shutdown and does not use target_stop_session. If there + * is a failure this function will call into the fabric driver's + * queue_status with a CHECK_CONDITION. */ -int target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, +void target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *cdb, unsigned char *sense, u64 unpacked_lun, u32 data_length, int task_attr, int data_dir, int flags) { - return target_submit_cmd_map_sgls(se_cmd, se_sess, cdb, sense, - unpacked_lun, data_length, task_attr, data_dir, - flags, NULL, 0, NULL, 0, NULL, 0); + target_init_cmd(se_cmd, se_sess, sense, unpacked_lun, data_length, + task_attr, data_dir, flags); + target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0); + target_submit(se_cmd); } EXPORT_SYMBOL(target_submit_cmd); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 4b5f6687393a..86b0d4a7df92 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -162,11 +162,7 @@ void target_submit(struct se_cmd *se_cmd); sense_reason_t transport_lookup_cmd_lun(struct se_cmd *); sense_reason_t target_cmd_init_cdb(struct se_cmd *, unsigned char *); sense_reason_t target_cmd_parse_cdb(struct se_cmd *); -int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *, - unsigned char *, unsigned char *, u64, u32, int, int, int, - struct scatterlist *, u32, struct scatterlist *, u32, - struct scatterlist *, u32); -int target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *, +void target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *, unsigned char *, u64, u32, int, int, int); int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *sense, u64 unpacked_lun,