From patchwork Thu Dec 29 19:01:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76318C4332F for ; Thu, 29 Dec 2022 19:04:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233290AbiL2TEQ (ORCPT ); Thu, 29 Dec 2022 14:04:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230343AbiL2TEP (ORCPT ); Thu, 29 Dec 2022 14:04:15 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0FCCD9A for ; Thu, 29 Dec 2022 11:04:13 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIwwTY001190; Thu, 29 Dec 2022 19:02:02 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-2022-7-12; bh=EDny0ENvdlXLHVjQLBic469/Ygt3sCIoMnVgxsyFd0U=; b=YttI5cZ5UpNvvk8SSoBPtsRmJhZgXajCYX5B3ow+odO3doA6hTtw8CGV1MQ0+h8N6U/1 pFjyLJLlWd4TLoSzkqjPrH0abPog9fuS3MGzfGY51tScyWhNVY+uvd6NXvxXf96OtxX4 ifk3pY870Cp0KML6wn+NVfqVki+xPZNAmWOwGSQK8T0JQIj2JEfpEstidoRFTBFxBUJL I8O4LxPSXnvXT3/OS6jple8v5H4C4Uu/j3lVejA6Q5fzmUycccXiq2sMDiPOSpiNxXs4 S+glcWuaIKUf3bgSPrH8LD0Z1CN/1gZpOXwWWCyg69RJccK3ZpTWws6CxQSHMmm6aYRu fQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnr73f7qg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:02 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTHNQ7L008629; Thu, 29 Dec 2022 19:02:01 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv77rnn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iOEGK7kxWDra2DZVDPCXp40w+JM+dQg1y6gnsttPkLIKuvdw2ynzWMgUYR1cD5lpWQiKLm8wPXmLZ5tUpNEV2sKu0KAKxf89GY8JtHTfR5RRAwqzzeCaq2M8Ws7Q1/Q06ZyDxZGfir1tgtOWiDHszFrP5TvlASfd7PjpveGHd2qQH2mVyfJDTJpnmlccFxLx5gLO1w1GOCDSYUsmYDJSk9L+N9ZrsjBpjy9WeUQgIFYUHavk2xmnTTL90WahGa7IwoWxqDodeoUg6IbmMh0k9Eiue95UT1nI+KIDAvrwy37b7RwZOEoA8XvCKBVA1pMryoXIPriaFbWPCiXImBqOkA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EDny0ENvdlXLHVjQLBic469/Ygt3sCIoMnVgxsyFd0U=; b=TVY4sTkvr/tHbMLBi6FHcdF+pyhhg4WiJid0P8sCn6kb/nes+njUBorNY+w3AEzlVThQNCi2bxgQSoTlRIQPKDEzLEf+NfZMzKVaS1N3xDmo3+GTMbxfONm+cLBjZsOFSmtMmDxW99SUyFAgssiPxpguiSKwbHd8tbJHs/CNTdb+6WCCoGGeHa1HbaQiLNYAF4Mcj1CFMUFgvPzJ2aaAVd+gREv3Kp2IM9QPxrSNx/ds2TDHUNxfC6g0c3KJ0MS/whpdcn6KpVe79h/+Rwoe+OHR1xSyobH0Cy/E3V1MTuetlK8+IzLzIDIm9gF49/l7vu5wDUAMBzxL/yvZI/OOlw== 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=EDny0ENvdlXLHVjQLBic469/Ygt3sCIoMnVgxsyFd0U=; b=KY5KoLfVJRuB5d0bC1hnYKr0lytv3dw1VoRyK0EPofDiWN1Gy6K3NnFR0aM2AnJLz3FFyWIw6TDJjwE8PLtxKi7vaF35iqH9yJpLAeEslaI77LJlcNuNqbhPNwaPXAj8GaRXvBAd2dt+WlrJPEBxrPaJBCQOjZXuuRDyqAFX0rI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:01:59 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:01:59 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 01/15] scsi: Add struct for args to execution functions Date: Thu, 29 Dec 2022 13:01:40 -0600 Message-Id: <20221229190154.7467-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0400.namprd03.prod.outlook.com (2603:10b6:610:11b::20) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: e169a7ce-9a13-4e08-973b-08dae9cf2988 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XIhisotgBvaGSK8IYCqUA1AN/SUIXsVN+w9y3vRBJ2+JFwdunLCORF4tLsTG21hO3D1Uwj5jZA9UUydgqEHXw8P/j+WAAgnNMYBs9vrESte45RWR/22fcDCbGXcii4MvfzqEib4VSCXsq7m1mrr4RImfHlsltwnwthUNcAXPS3eE4+/ouztq0oYFFeDul58lBYakNF8e7cKNwPVaYQLITsleRhmFBwyTmIa0aIsME1EA0czKFFZWMsMavrMkMQCBYF2ZhtWnAThYxKjn3ZjJYtod4V6sLKc42OQDijQkNpT2B0rzCA+bUldXqKrg1/LTdnr9woBElTtat/Wc6HULFA+HQApSf37lJZX1gggU7c5VOmw3yGXrGQr55NvXkpJet5IwWNfF1Q9o+fE2Sru+vGn0UZOuz4B4E3KCQYO08eWWkNlEpI5c3cMd8i5lX4EvA7b/fATDI7UeIcE4eGE+TVrs8kvkIwZf8u21Vf5cCaOOBrVQo5ciDEnSehdaspuG3YLfeFd72c14Sw+BuKZMeOU84bc9ADziw7ofxmn3j8ukqsW+kNs7Mu4r9qBlA28KcYVyA9Zg4yt0QoARSSSftpUmWDxXkn0kWZcmXwcsM3PwDuIPIfFhwESvJtq3YsYUKVdL7DKVy95kSfLKcUoGnQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZnSHW2eAiMNPQq0pE8U2MWDBEetNvr7aVpXXszzKUijL0VND3BIxnCbo9eyGg9DekwlBH/jpiKWDNfUTS1Jwb1nR7TqWBHo4mdQuLbUXlFhLEbATOiGSB44WPFDUnTnolYMPSmqOBe7Rvt0uzWM4BK6XW7WfjJ/LxqUJKEKUv7VLfE5Gj5TA4+5esl7zYixFww27RJiPC6XIjM/HI2G4pcXWeldaqOdaFbgf/LsbAFxRENLBvH+C0jxHJDE4wTlKqbBesX1/aswz9qE3GDIYVOFYL/KDc7Ani2hVjKfCFcQxaaduhzksNnANQgWdupPesJ6v/l/ZQSGpn+9AJE6U7vGIQCSD+rOTssHggFWVeXLngrrO78aYqDWikpMh1YT8BDkcQXGyEfOnhzZxQUQZyYtyYHcjmwl/PpCBdNub2m/Q6liNA4RPFqZbmGMupAc5NR7XZcmCWb/UDIIPb0LpAUQGDJzcxk9DLw6iFuqum7A/8PbwMvB+6izeoX/XZQL9vyVbXMmyXUuOEG4dTcdV4mG0M4YFA6QqqDf5z3ZQr6ma33SqVNZZpy6lDz7awcCyLFXVs0zUTv9O3wmJeeOZO4eigaGKGD8GiT9WD29SbcbZmLzgRvJKObqE4jKFVtP6nzg/2dJtCyFiy+EJVo/S5GcOvj9Nfak834/jxnC9lUvj/O8DBv3wIV4IUygt89PkZtHouQiq95JLXRj+LzWd4MhW2Dyudhys436uX2iF8C+k6WsMnuM50uI6UFWk9bKJ1hjGvOce5F0Y4zts8nDQ2AN3zs2jYCVI6qRer0pFVtSUTesVSX3q56CYk5lzZGJ2g8Isty8eHdgf+cP4OW+bghY15VQRy1weIr3svqK0k9nRRGha6Xbi4V/DWgyHJNPxWbuf4mD84RUeAnbS4SGJ160LkiKEQF8ONRVFZ62eF23eOIcTXX2tSkNzaJGvAe+74ceVrZxcFsrP95zUMfYgAyeC8ek+0XRUCzjVCKLH095XB/jk3t5xtyU8SKgl0iJCZ91MD2fZYGW3I2/J2SQRQG7qA8XtIJ+1PJcXhmR6Nbva2Vm5gpcF7QxSaISUpnZAXULWeANiFldjxp8FleBNAfgb0HL4ESKpxiKHfagt+Oj7t/Z2y2vjAKWE4aHjrlNCa+wSFns+V13ltmITZaFpdTPYi2+4fmS7fbAb2pJEboKWjtzHu4ImxX+GRsgJPIO/2snrUqBaw8Fs+UJbCxrquWALyHlc30Jz1NESdQKWI2X5MvZZaobHrdd6I0wXuPxJUGDv/hyUnfW0lntjCVsjaBaMSqiBPe8ZNRdVGr+ZmsYsTDqG5auv0Zion+iV3ceiM8lyki4t/AgfSi6YeQrP9HMYbSGC4AFvLGW1lMG2VLuIa7mLAlyZQ2W8DTYQtt4XPt2N/MRJRWNqSQRLDqGbWCZFRQklB+cC/OvlepASp3WpN0Hx1nX6aZA2+KoIsMCIFj8hXDegUrqDawWnEMYG3/KhJmppYlLYZb0j+/AOBsTpRv2coXEb6ncLljt9QL31oqGqMbCRIwPNFnYBLrt0s/+NDMw3fF/6EApeYXYXHzPZ2GzgmBqNq9p76XECWxgTF6NrLpymRMn75hSAfdb5kA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e169a7ce-9a13-4e08-973b-08dae9cf2988 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:01:59.1759 (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: HKvLjFe2+EHxAsgwpNNz6E/FGQwn9FznZcSt7tz8mgh+K8eGfm2LckHZEW43qugfkG6h2vt7+5aKTzFkkFtrqYIpOlCUDhr7cm1wyRB9QLA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: qVEWRopFers8a_8VeFVwwaFtbMYkqBuW X-Proofpoint-ORIG-GUID: qVEWRopFers8a_8VeFVwwaFtbMYkqBuW Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This begins to move the SCSI execution functions to use a struct for passing in optional args. This patch adds the new struct, temporarily converts scsi_execute and scsi_execute_req ands a new helper, scsi_execute_cmd, which takes the scsi_exec_args struct. There should be no change in behavior. We no longer allow users to pass in any request->rq_flags value, but they were only passing in RQF_PM which we do support by allowing users to pass in the BLK_MQ_REQ flags used by blk_mq_alloc_request. The next patches will convert scsi_execute and scsi_execute_req users to the new helpers then remove scsi_execute and scsi_execute_req. Signed-off-by: Mike Christie Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: John Garry --- drivers/scsi/scsi_lib.c | 52 ++++++++++++++++++-------------------- include/scsi/scsi_device.h | 51 +++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 41 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9ed1ebcb7443..7d324db6b2f7 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -185,39 +185,37 @@ void scsi_queue_insert(struct scsi_cmnd *cmd, int reason) __scsi_queue_insert(cmd, reason, true); } - /** - * __scsi_execute - insert request and wait for the result - * @sdev: scsi device + * scsi_execute_cmd - insert request and wait for the result + * @sdev: scsi_device * @cmd: scsi command - * @data_direction: data direction + * @opf: block layer request cmd_flags * @buffer: data buffer * @bufflen: len of buffer - * @sense: optional sense buffer - * @sshdr: optional decoded sense header * @timeout: request timeout in HZ * @retries: number of times to retry request - * @flags: flags for ->cmd_flags - * @rq_flags: flags for ->rq_flags - * @resid: optional residual length + * @args: Optional args. See struct definition for field descriptions * * Returns the scsi_cmnd result field if a command was executed, or a negative * Linux error code if we didn't get that far. */ -int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, - unsigned char *sense, struct scsi_sense_hdr *sshdr, - int timeout, int retries, blk_opf_t flags, - req_flags_t rq_flags, int *resid) +int scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd, + blk_opf_t opf, void *buffer, unsigned int bufflen, + int timeout, int retries, + const struct scsi_exec_args *args) { + static const struct scsi_exec_args default_args; struct request *req; struct scsi_cmnd *scmd; int ret; - req = scsi_alloc_request(sdev->request_queue, - data_direction == DMA_TO_DEVICE ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, - rq_flags & RQF_PM ? BLK_MQ_REQ_PM : 0); + if (!args) + args = &default_args; + else if (WARN_ON_ONCE(args->sense && + args->sense_len != SCSI_SENSE_BUFFERSIZE)) + return -EINVAL; + + req = scsi_alloc_request(sdev->request_queue, opf, args->req_flags); if (IS_ERR(req)) return PTR_ERR(req); @@ -232,8 +230,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, memcpy(scmd->cmnd, cmd, scmd->cmd_len); scmd->allowed = retries; req->timeout = timeout; - req->cmd_flags |= flags; - req->rq_flags |= rq_flags | RQF_QUIET; + req->rq_flags |= RQF_QUIET; /* * head injection *required* here otherwise quiesce won't work @@ -249,20 +246,21 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, if (unlikely(scmd->resid_len > 0 && scmd->resid_len <= bufflen)) memset(buffer + bufflen - scmd->resid_len, 0, scmd->resid_len); - if (resid) - *resid = scmd->resid_len; - if (sense && scmd->sense_len) - memcpy(sense, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); - if (sshdr) + if (args->resid) + *args->resid = scmd->resid_len; + if (args->sense) + memcpy(args->sense, scmd->sense_buffer, SCSI_SENSE_BUFFERSIZE); + if (args->sshdr) scsi_normalize_sense(scmd->sense_buffer, scmd->sense_len, - sshdr); + args->sshdr); + ret = scmd->result; out: blk_mq_free_request(req); return ret; } -EXPORT_SYMBOL(__scsi_execute); +EXPORT_SYMBOL(scsi_execute_cmd); /* * Wake up the error handler if necessary. Avoid as follows that the error diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 3642b8e3928b..f6b33c6c1064 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -455,28 +455,51 @@ extern const char *scsi_device_state_name(enum scsi_device_state); extern int scsi_is_sdev_device(const struct device *); extern int scsi_is_target_device(const struct device *); extern void scsi_sanitize_inquiry_string(unsigned char *s, int len); -extern int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, - int data_direction, void *buffer, unsigned bufflen, - unsigned char *sense, struct scsi_sense_hdr *sshdr, - int timeout, int retries, blk_opf_t flags, - req_flags_t rq_flags, int *resid); + +/* Optional arguments to scsi_execute_cmd */ +struct scsi_exec_args { + unsigned char *sense; /* sense buffer */ + unsigned int sense_len; /* sense buffer len */ + struct scsi_sense_hdr *sshdr; /* decoded sense header */ + blk_mq_req_flags_t req_flags; /* BLK_MQ_REQ flags */ + int *resid; /* residual length */ +}; + +int scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd, + blk_opf_t opf, void *buffer, unsigned int bufflen, + int timeout, int retries, + const struct scsi_exec_args *args); + /* Make sure any sense buffer is the correct size. */ -#define scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense, \ - sshdr, timeout, retries, flags, rq_flags, resid) \ +#define scsi_execute(_sdev, _cmd, _data_dir, _buffer, _bufflen, _sense, \ + _sshdr, _timeout, _retries, _flags, _rq_flags, \ + _resid) \ ({ \ - BUILD_BUG_ON((sense) != NULL && \ - sizeof(sense) != SCSI_SENSE_BUFFERSIZE); \ - __scsi_execute(sdev, cmd, data_direction, buffer, bufflen, \ - sense, sshdr, timeout, retries, flags, rq_flags, \ - resid); \ + scsi_execute_cmd(_sdev, _cmd, (_data_dir == DMA_TO_DEVICE ? \ + REQ_OP_DRV_OUT : REQ_OP_DRV_IN) | _flags, \ + _buffer, _bufflen, _timeout, _retries, \ + &(struct scsi_exec_args) { \ + .sense = _sense, \ + .sshdr = _sshdr, \ + .req_flags = _rq_flags & RQF_PM ? \ + BLK_MQ_REQ_PM : 0, \ + .resid = _resid, \ + }); \ }) + static inline int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, int data_direction, void *buffer, unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout, int retries, int *resid) { - return scsi_execute(sdev, cmd, data_direction, buffer, - bufflen, NULL, sshdr, timeout, retries, 0, 0, resid); + return scsi_execute_cmd(sdev, cmd, + data_direction == DMA_TO_DEVICE ? + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, buffer, + bufflen, timeout, retries, + &(struct scsi_exec_args) { + .sshdr = sshdr, + .resid = resid, + }); } extern void sdev_disable_disk_events(struct scsi_device *sdev); extern void sdev_enable_disk_events(struct scsi_device *sdev); From patchwork Thu Dec 29 19:01:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F391C4332F for ; Thu, 29 Dec 2022 19:02:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbiL2TCn (ORCPT ); Thu, 29 Dec 2022 14:02:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233949AbiL2TCR (ORCPT ); Thu, 29 Dec 2022 14:02:17 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55240D9A for ; Thu, 29 Dec 2022 11:02:15 -0800 (PST) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxEB6002266; Thu, 29 Dec 2022 19:02:04 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-2022-7-12; bh=VODJsb1JedxyYEAFoiUMHndz89Wm1ZP2qfulPNupDUw=; b=VgI73wLcQPPnCrEyt5mDaBvImLly3UToAmggFINbW8j5+4JtgDXmU1vijrvInzKhUYn8 t2eVbPfOQFUvksTlnBoWHeT5ssNAb4JXIXjRaz/QckkXTfihfWWl46BSn0beJYKBALpL gUWxkyCgeJ5tG66IMn9QXuDb0IzolsdfsUs1tJsjiaeeBVdUaLookc63pCe28727AuTW Uw5+w/VlzUNBbL6lruv/FSL1zhtc5H6TZ+D7w+ixYsWJ0KjIb4glnWzkspyAzaSiXSNz WF5xPdrGwOzJEl/yj6UjtP96PGVYQ+tgrKBnXUG5UzH70KqhpIdOAqc4IBeKL+bOtQEp lA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnsfcfa84-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:04 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTGRg96034219; Thu, 29 Dec 2022 19:02:03 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2045.outbound.protection.outlook.com [104.47.51.45]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv6s0g9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=drtK1RrvE/QpmLQh3NSqod+mxzyXKCcwaBPNIGahcWk9LoCdTDTJKhhKzDynbWJ9fgZz2ibNEHsttuSVIGU1IRfiVtaVEelZ1J/mLK6PnSNoDFbK2oBuu9HfWKjumqBGr4ZFrp5onoudjbkr1EGFlUPT2cXXmGcy5HMuukTLy/6skW1if/TzwJtZ6Q06vNRWNPCG/VvYo0HIdW5WgWzY4ZYesT8gWJu2+MA08JOjTnfFElerjNtOCEwGKByqUx72bQvPIoZkOpqKdtKwJA3b5SzUYLPBpxe5RNJQf0zgvF8xRfvGmE1qI6CutzZhNV3ZZE/mJHItlleXXl7wdqzBYA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VODJsb1JedxyYEAFoiUMHndz89Wm1ZP2qfulPNupDUw=; b=J4BmMT+b8EKTujwx8NW9Ofj+GiTPSSHKGQiZL1UVqycB+/ZxL1CaTXRmK2+griIvds0LuoK7dcjW0rSQSfZ0WQ8NSZ0kJb6fj1CTB1Hq5PSi1te5JKQsDL63gWnizwTPU7VXOFyKj3Q2kQO4MD0K+xCwXX+T2yfp6pmSo8Z+JsHQCcADxleFYo/Kfvcw77p/MLSGyw36uOLuqY6/XIFLwzABqgiSbIOqTZgftxJGaI9tPtRSsCcdFCHJhNsecjzq/HpzCXbUVQYDyneiOO7leAZD8ZIvL9S6z35sJ2EczONk1Y1IIUDHh4r3cJD+drMqYTLhsltdm5SI/ofs0Mjmpg== 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=VODJsb1JedxyYEAFoiUMHndz89Wm1ZP2qfulPNupDUw=; b=oGglKUm3Rwo8y6zy5PzAIkvbcmr2/RwtICNuUeZ4Nm0CBhTgHDzF2K/FiybjJGKOv8wydEE7iwlA4hyw/RAJeCQS5Mr5Chd9VYfLskQNXy0lkrJ1Zacoz+OlCdKlZK/BmyQ/mk1sj5nVYlBvI+QShKmEUybOoDMSTKAb83BJaRM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:01 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:01 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie , Damien Le Moal Subject: [PATCH v4 02/15] ata: libata-scsi: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:41 -0600 Message-Id: <20221229190154.7467-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0420.namprd03.prod.outlook.com (2603:10b6:610:11b::25) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f065e24-7571-4ffb-220b-08dae9cf2a9d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zERJBVzM2eMg9bZryEDaKjZie8LgdjbNI5tbjEijOekUt54sefj6t0b4T/NzLG6MMo4XUHm6oO9ObX/nt+L1mU250wqf4g1AJRWKb4oJj4dT0BeFNZrhOQkMeHmZ0X/RRW/g0odaQktg5mtJvSyD88kPcICEOUCpKLr5rxSLuGB4NOSIA1rzvTx1eFO02Ln5w/QG9j1s1wACRqLFEqMpmi5BcM324YzhLEwjqdz2wD/RKObm5Q6ANXMAI2b89h/VRi/oVlS8azx+scewo+YGdpNCTFxcLHn0Q1RvACp/ASIyRfyh2pz0Jh4Y5F0SBHNkx1dSTh01f0XtaH+/WowGVLB72tq85Ha0LId9um8QR6ViTnaIZsSXduNYE2QtzlJ0PUhn7L1qNPuqWScoYAih9o/CzKGfr/++YUJJnzxvBd3jpHKRuFAcGUpGqUGyPS4hSn8nRH3RSLR7l7a5yetAUPtk1GkjnhYA4g6OYK/HDg14va9s376R3GgB2IugSnTn7ETw1/GgC8invs4uWoxIEcpQ349OP/SlLDDghOCGwt4akHG4dmQmRlMOlQF6gClLpenBqWI3FNCn12WtUxgXnlJf5CdXrBEh33+essQsbrbxMLfhI/hbqp+bqi0E4E8+RmVDwuT1BHCJqXISkRLOSg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(54906003)(66946007)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OZ8xJxIvh0nGmCq18aDf/z4ZwkUhUUiQxYEr2xwY3M6t1YxM3NyW1kvhZj8z9GkNca/ixVkUzJqlUAlrgyIAcuCmp12yxA3NpaTLmw+MXD3/ikD3CMFqZ+2VJS6+4IuCYw4IBRXWud2YPaaCo0l6ANKwveHHVSnFR5pz1bI02jT9kRuDCGHEkH2yQEd+NKycc82F5SSA1hwuNSG68w3QisA/BpwTkZZ1BsDrJMdOr614566B54BUvnX3t5+0zv7ynWPM4aSMBLzxjpRlyIMIEqC/UMCPRGQpiqS0NwgOrUUHU/sLqBN3qz+R1Opad3Ag9w4zXrIRfsd4hYrTmxygJEtfDGrj+bSz4UxfHHGXTvVPQw/VGErO/wr8+QA/P+YF38xCq1JKJVW82dOgFg52OYzcw9jzZE8M3XE1dNUCnmg8SFfcTfDrwgIFilL3aCAfGxrKu5LrMASw6e2OkRQ75+lnbIJd01bZctFdWRViN5P8BMNkmF4Dj7StF0WY7TKIZ/pNgYDGJI7MVKJHCXqsq1EPlEpmI83akTNcJimxFjS7pjbBg9xR0uDcvHfc0iSvLfbQDamkepSaGjO5/QA3uPNUV7y7hpVUrNKJYixF7Zz2gdjCDFCc6XpSqp3llfjRvPyAn/fsoduKaOsKI7d37bq0FthlVNPVDI+E3mGBmaaKvrNMeeIZnWhWp4T6Yxw/gk8OjJeuqM6T7cwBqZSDSVYX43p/riThO1JKGtuJ/c9nEresYw0qsYFgl2Em/sIOr/rZUgjVSBgu4dRtRerjONjZUAIbxGSDWyjkYuJ+oWgx1qzr4nWZbbhq0nFr0esTUrbF1eBnAatA1ezV8wa8MN1tu38NCZs8opW2eqk2F90BxZJwXtofVohNhYNlYd4XAxRq0sqI/UaroUTMFOXfF6sDPP5dRgjziHzsh2sc2709McFeYuKL+uxLskA6bsRc1TYMeL2vhA21kIMZvZlz5TjJ/XSd6t+ZZlRO8uQm44qQ4LE70UjcoxYlLXVp1OyRg1de6JaPpM5K0g1f8OnfDTE/NyX7aFs7YvFsPeoVgWtA0jxaT+4XHy8SJTwDk6PGhFJjb8d/6VL/vNuCxomglDRHn7ecUKvGcx38vD8/JKZ06ipAvEmVvo4NVql2WZP66JIvKs1peo14ZM0UPuN0hQwtbv5mawilmxlZAFgzRoNSpEV/d1vsOE/hcv8mNmb9EEdYRt+6Eyl+f8StWPcddVyV5jXEMcoEIrYP9lf2ZFuZidOe3VNqrzWqoNZkVzz1S0YQHrV4jNGqFJbwVwpBQyMdnR3sar1t7BjfbwVIIFGQWHfxcMAntz2bqiX2OVH6gASDnzhvTB7on9yhmhCU16t3j2FSfqBCZdzSj4PkOiPCmqbAOVa0hWP0khPyxFTaMRId1J3GQB2v/+vKwgPSCcyv8B2YnarZMmSr6G4QdKKLfksgIGlKGKyVZsTsPNP00GzaqkHYdPv8O13aGTK3/PgcuYVLop916Z1DYYb+7rrdi0OEcHXSw7hBGyVXIgWUi4N+hnnsWWH7lBFIPyPRln+7BufiuKLFkXdidP0+aTkoBi5e2RDOMZzZEiI9kPM8/lUE3o4FrKr56m1JmIAOtA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f065e24-7571-4ffb-220b-08dae9cf2a9d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:01.0039 (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: rsvJisNVcR3d37xYUWYMLpiyz6CPiFJejKmp//imzX3cjJziyVwKmBm+WgO+yQV4gWO8ZSIscLvvA899OiVWwaDw5SXh1WKr4Umc6ADlYsw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: 0Nq90LbzmAk05nuilSDG_y_oM5WzxWKN X-Proofpoint-ORIG-GUID: 0Nq90LbzmAk05nuilSDG_y_oM5WzxWKN Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert libata to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche Acked-by: Damien Le Moal --- drivers/ata/libata-scsi.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index cbb3a7a50816..0cc1e6d660ad 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -383,8 +383,12 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) u8 scsi_cmd[MAX_COMMAND_SIZE]; u8 args[4], *argbuf = NULL; int argsize = 0; - enum dma_data_direction data_dir; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .sense = sensebuf, + .sense_len = sizeof(sensebuf), + }; int cmd_result; if (arg == NULL) @@ -407,11 +411,9 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) scsi_cmd[1] = (4 << 1); /* PIO Data-in */ scsi_cmd[2] = 0x0e; /* no off.line or cc, read from dev, block count in sector count field */ - data_dir = DMA_FROM_DEVICE; } else { scsi_cmd[1] = (3 << 1); /* Non-data */ scsi_cmd[2] = 0x20; /* cc but no off.line or data xfer */ - data_dir = DMA_NONE; } scsi_cmd[0] = ATA_16; @@ -429,9 +431,8 @@ int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg) /* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result = scsi_execute(scsidev, scsi_cmd, data_dir, argbuf, argsize, - sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL); - + cmd_result = scsi_execute_cmd(scsidev, scsi_cmd, REQ_OP_DRV_IN, argbuf, + argsize, 10 * HZ, 5, &exec_args); if (cmd_result < 0) { rc = cmd_result; goto error; @@ -491,6 +492,11 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) u8 args[7]; struct scsi_sense_hdr sshdr; int cmd_result; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .sense = sensebuf, + .sense_len = sizeof(sensebuf), + }; if (arg == NULL) return -EINVAL; @@ -513,9 +519,8 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) /* Good values for timeout and retries? Values below from scsi_ioctl_send_command() for default case... */ - cmd_result = scsi_execute(scsidev, scsi_cmd, DMA_NONE, NULL, 0, - sensebuf, &sshdr, (10*HZ), 5, 0, 0, NULL); - + cmd_result = scsi_execute_cmd(scsidev, scsi_cmd, REQ_OP_DRV_IN, NULL, + 0, 10 * HZ, 5, &exec_args); if (cmd_result < 0) { rc = cmd_result; goto error; From patchwork Thu Dec 29 19:01:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDA4CC3DA79 for ; Thu, 29 Dec 2022 19:02:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233704AbiL2TCm (ORCPT ); Thu, 29 Dec 2022 14:02:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233946AbiL2TCO (ORCPT ); Thu, 29 Dec 2022 14:02:14 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DB10D9A for ; Thu, 29 Dec 2022 11:02:13 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIwukR001175; Thu, 29 Dec 2022 19:02:05 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-2022-7-12; bh=t1+yz0HnVE9Q8IIwHFqzvAu/rq3h/1oTObmdxTCS/FQ=; b=Ya9aIjlA2YX40InInYy86SOKUJ9cqpzexQZny7/HXD2zTAMv9cbuEhvMMTfw1Y7kQkwL xNg8x3WXgFsX5vtQ6yneLUlN+pdy4YmZe+hIGEzupGBJLY6UoTgmSKLDNwesZc59d8uA tp7sl/1ZexQBgXl7fF2ZvkGZa+bghShB5WzyBKVFVR0u8gVOZr6xyD/xFcXqpLsL5Hma +z4sVaC8jSi2wI24NwgBv67BVo4NiOVkVIoahTI+8jKIo9KPWkmONjlw7sgX3DUCYSY1 GsdHgDDHCNfi7Ie2Ajlmsvg/StIIP3hRE6Ehh1dIdrbhh0EHLwUpJGHKTBzIj4yKhdjV Ow== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnr73f7qh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:05 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTGRg97034219; Thu, 29 Dec 2022 19:02:04 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2045.outbound.protection.outlook.com [104.47.51.45]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv6s0g9-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A6BdSqu0Qib/HmL8cNbzmu1Jqs49blOg6R4oEWcUUDa9wilvhG/YY2xDExh4PH5nnI81vIlNDPZtSUrOcBKhWT3ZlI9ZjX+km6peC8PariWLvm9QhtZEq5jwwAQNfmxeADeot6gOepZ65BzW+EN+W4yRil45PHpr2mozcIxNIB0hj095Z5pRsRyBilsgHJp/AV4Z4BoCyvIYcwJy2OmWwPJkIxW3bQeZt7Y1WkVzDjs2A8ihI9BVTTwwwnSqAnzE5kG1ra6R5vbU+TCUClAYrmVo1joNGp3d83Kjvwt4RFXnUTO82NoGANAvNeIT3d+hn6it2U83zrdDL1Ejx/lpQg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t1+yz0HnVE9Q8IIwHFqzvAu/rq3h/1oTObmdxTCS/FQ=; b=EfAz1d5l34Liv0VsBVtRiCZrGdec2yDXel977F3zZ4yGM5k8Hi2kA2bCx6jYiYd+9qyiDm6qf6l3WimDKlFAGnyCzwtadhmu3QLZHAmQFLjzX/M3q13Xc3VDHnMK8+X+MoYAFG3lXSHc4ZDJZ3iegyCz8IfxY45JlA5pFF3bwidzxdUB9ogXQPf3gr2uP148O4y+s6MDwjaY6PQI8hc2AGMbbAlKp35N0cVcfG+JdOdbQbeaZPiJPjzEx3LX+S/rXeyBACGI4A8vghl+zJsWGsFREVluB5PlNyUd/cTuXtP+ctHeUDNPLb25mbv3BkkNMS61qnHhWK5awOouGclBUA== 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=t1+yz0HnVE9Q8IIwHFqzvAu/rq3h/1oTObmdxTCS/FQ=; b=GLawXc8/ImC3JtDbqTzVdtNUdLkVlpuYpzf4elq+vLXklkDdTZowN8V5z6SqpZ1QSBQy57sZLdEkDbe23zqZ+qY/+66tgOUvFARfffw5z6kB6dA0JHgD1motvdxf2F7/+wVxOEpSlG6QiHZaTPsj8R7hDkeMR5wVHwI5lnZ2dBE= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:02 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:02 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 03/15] hwmon: drivetemp: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:42 -0600 Message-Id: <20221229190154.7467-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0445.namprd03.prod.outlook.com (2603:10b6:610:10e::31) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 550aeda9-71bb-454c-aefa-08dae9cf2b92 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UunTVGXI6fAj+2NE2NTECj1w2uVHkYg162exAjMJuOCaWJvaWJm+89HCyWS5L9KXrf5MI45VoUFFrtlmLHgL3vb+Fk/N1aDGTdt4OzFoJxAWjqJBYZrFdTldxSBmJ3iEUQhAfmhE8X2aw6z3qDFLKKZV15SXCmwi++Yq347ExQEQ1QNerjttbKcyqYpLLxz9ZlBlN/SD545ogplDKMBMEiBee/C443o03+SdUZPiLBMDMYtnLsoetMko9HitSKF752MgaA+o3EyN1t4ONmYEJAxkziVaPa1AEHlIkc0UtH6Be3qXcFFbotYLypuTWKOm+DHpicSTOPhIoXoWEJH3YRtWxH068ngmtCZTzkLniu6bDzGdguqxpgx20zJMnmtvhLlnduPP51hJ08iI8rgnTwXs1R5Gxo7qOloTbL5Zs1b1/0ZyF6F/8iMtb7ygV5YtHEZEJtk4tkzlWrYZ4zds6nu9kkxUTn8+uL/pzb9aeMxEGSno+GcTcYfeVZ2+qPCPyfkYKEjHdkskJq5/VOIXTur+ixPxczHufj1wlG39/wDzjYALNICRhQZYI5g0hqCLATMRD/SkiLDje5oKJ9pyCrzQ9+0T2+KVCYiFC/ZRjGneey+YWzYKhvDpwzLGGxpV9qLyVAkeLKpqGgB+8SNlEA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bswGPBraDTCiPgI34ur6YZSl9vAEfrfBAXHc7wy+ttLfoa3powxvXli/EyHyA0KA71Y/9bsQbhMjqi+xVKRYphYItzfdow2MMm+HiK8ShBJoL6g9A/5BV5ANbCIozI070tyFIw6R6G/op8gu3V4UlYYqXP7Kl0330hsP8t3qdcXvWc4RGCy/sr1FFepfGDu7j3xT5d7zRr5WaF+R9Lut51x5zx1Cu3IvK+ANVXW1CiYLI60pROPTGyz9NP3kxS3XkHmebSmCw+LwDm6kxtY+C0w5RDCCYJ+DI6YLw6gjdIX4B4e6OBYTunQQQ7aDlVuDNLd1UU1T+nkdYYP036jmic8Y7lnuNVOWnyPuoo73pXgVpCXGFczNfN7sadN5dN4Fi8se6IxBPTHFQ6K3PBz/Geal4PetcSqxZhQBGbGrCNIRRkkt0MSHqPIRrbX+yU3J7mwYzRdYYRVueuSqNrFV9v/0TEEC3QUBWylzBvr60CncMiiF06yontUy923NPwJZIx1bLUtb8dyaghJDymdmuVcepT5YEfDmW+KLQigQp0J4nS9348LgKV5XIu3om2Ab/MYsakWzA53i20sVi5MVajBKtbTt+wiqzkb3OM5vIW6HeQP9E4dVEz7lr00ctE5yGV3AQ9/9it8GusEZTzA5wYvWYM95IGtEWq72eC58B4qcvgWAgxS86/ra466JJs8vHFtZAj5Q4Fejn3neJXHrakqoZkKwZA9osmDpspgiJrNdKpqrRHh3S+8e73BnbqXNL7xzP8L/+pAqcKBKBZKIg/bFbyk0xlP9XAL3XsJajO6wd5wSJzEj1HzGZzzJUrLrgPJaDOeX7djkqSRLqwQntG6PLmC7KEDkGAUEwzWB4draz71XBHE+CdEQw5JPwHQ32oBed2jrQhmLAF4BV4wAfXZ6qme1sQv6OkhN3Avz74p3VicI1oThMCCyxMIAaOaiGfACOsWZpHZ8JeDiOh+0Wqp4bMx8qOAX1Np9kklUfMSPfZ9F9OF9bTSGlT356Ct03SpHX8ekKkdLaYLmIOLPV1AnRZ5Pjk1OsNl2/FQfJ7wOj2uLMzexfUcZPHcq6yowOvgp6I6152vch42tkiZ2gMzDdU0DaDwtF6+/jOfV9EtkI3HD71v3Iq6eG4HMNf0PvWwGyuHtnaaosGv0nN6dhDa8moKui+YYq946DeuckYpZTm080hIlJXzXEDetvZvPL/limeI6AXcHjtgF7vebfKqTT8O0eIDBpoBdn6Zy/Y2ybpa2KrH+b8kWFbMvKnx0tXVqE2dXfVGrozY9cr+WH8ElAJzYRsJGNyfEtfKnf8+krLrwFChACZzyCfGm5I5T4Uw3M5EVud0D6qxgMmZvQjVVNthEADr6J97d7hwdm6NsvPmHdd9hMEoKRVZgQ1FGkPwMpnBtgC3drakEMI1+H+J6yp2OC2lmyZYecvLOtwEMCVfe/EnU0QJQ+VpLQq2bmmaqXYu/5hqS7T6dkyqB5U0pvhE0cjIIS/W+EweiKmT0wY1p4VA5z5Hcj1rI+MeGSxw51H06/n40kFSpLemjhosu8n/Ytynb8fVzpoA9y+GeHh8m6yuVkm5cqMUDxuW+YbOu5T6OgchhuREBXanOWA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 550aeda9-71bb-454c-aefa-08dae9cf2b92 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:02.5663 (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: ekzGJzjy6rnt7JzKWU6b4c8UEN7xA947LlLVDflPaZ8eb+oq6pv1/vSR4ez/F+/LEgy0U9V/eYrSr8L4Uvk8s0Se2/WVM1U5cyqdBYh2ZGk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: NMpr5PQYTHUnxXbnRAFjMfuu0qrCQ-_h X-Proofpoint-ORIG-GUID: NMpr5PQYTHUnxXbnRAFjMfuu0qrCQ-_h Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert drivetemp to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/hwmon/drivetemp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c index 5bac2b0fc7bb..8e5759b42390 100644 --- a/drivers/hwmon/drivetemp.c +++ b/drivers/hwmon/drivetemp.c @@ -164,7 +164,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, u8 lba_low, u8 lba_mid, u8 lba_high) { u8 scsi_cmd[MAX_COMMAND_SIZE]; - int data_dir; + enum req_op op; memset(scsi_cmd, 0, sizeof(scsi_cmd)); scsi_cmd[0] = ATA_16; @@ -175,7 +175,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, * field. */ scsi_cmd[2] = 0x06; - data_dir = DMA_TO_DEVICE; + op = REQ_OP_DRV_OUT; } else { scsi_cmd[1] = (4 << 1); /* PIO Data-in */ /* @@ -183,7 +183,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, * field. */ scsi_cmd[2] = 0x0e; - data_dir = DMA_FROM_DEVICE; + op = REQ_OP_DRV_IN; } scsi_cmd[4] = feature; scsi_cmd[6] = 1; /* 1 sector */ @@ -192,9 +192,8 @@ static int drivetemp_scsi_command(struct drivetemp_data *st, scsi_cmd[12] = lba_high; scsi_cmd[14] = ata_command; - return scsi_execute_req(st->sdev, scsi_cmd, data_dir, - st->smartdata, ATA_SECT_SIZE, NULL, HZ, 5, - NULL); + return scsi_execute_cmd(st->sdev, scsi_cmd, op, st->smartdata, + ATA_SECT_SIZE, HZ, 5, NULL); } static int drivetemp_ata_command(struct drivetemp_data *st, u8 feature, From patchwork Thu Dec 29 19:01:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11F72C4167B for ; Thu, 29 Dec 2022 19:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233774AbiL2TCp (ORCPT ); Thu, 29 Dec 2022 14:02:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233959AbiL2TCS (ORCPT ); Thu, 29 Dec 2022 14:02:18 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CAB213EB7 for ; Thu, 29 Dec 2022 11:02:17 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxPuF014152; Thu, 29 Dec 2022 19:02:07 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-2022-7-12; bh=yRqW49R3AX2G10zBW7QJuOU8XCppKlme0z2np6hl9Yw=; b=o/hZP7/J9ZG1bkt+4UVswLs5CESvdd6/hNkNVTfvPLs4nGbsMLJvdmc+h0caVNAewX+L HEnFU+wzbSmXX3bxYYpjreQfncyAuMPcDIUq8cJQ1vgAVOgD+133pqQa6as68jd2XgC8 toCJXvsX4LzTrS3fUZerTx/KOw9r7K8YYJ9B6laa/brpVdoBM/iCxVIp+wOnQDk4VnFL jkOtdZBSPFHzeC40iiN1k0ag6ZYBYWFVRuxgJTJ3Xs7accS0nJD1krHWTQSPcFv2ePel sgbXAowWIsGpdQti77KXZZDEPq+vVRGlWkaXdf9uGUM6vjor+vs5QXsiaKyVnJpZLTGI Yg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnsaa76se-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:07 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTFunmf001312; Thu, 29 Dec 2022 19:02:05 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv7985t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mN4RX0THvcAyB4LG7eKUoLQZ6P/UkRqErN0AG8xFSgDJsasTkMu8atz6MdgK+LNhqZn0l/K2RV+r2QMgJ1fHvNeVgibvzelGp9P0S5cbICH/ZK9bwzIWSlWvKk19hryosMP371jqsICjo5TOYcZsD/e/D+zJ6VErx++tdfDKzACMDfeEjb5pDImw33f+wy33hE4cST36YpInTFN3i61LDMdgxlaMk83uJZYQUsiFv6nw+mNa+SLrl9PjRbD4ploeYshMCpPvmBb5iLveqiGWVj3sn265jeZ6Wgt5eTlHj4tOhi0PXLlyMCpRaGPuexS3zv6r+asMwrKJjcrqFoIcgQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yRqW49R3AX2G10zBW7QJuOU8XCppKlme0z2np6hl9Yw=; b=WvR5A7EZf8LVqFuYajkLYnNVgKZ/HDfRMa53xYSR5KXnHjldYIJaOW66jwpBDLCObyMUusoykY0V0nACh67zE4yA8OPbfH59jnUPf3WC9YDFG+LCsueFfa4JscPR/jXCH1LkPgWVTUyGYwe3s50Rh1vWoinLx0ZGGVxr9lVIh9477m8rNL5qiGRkRZNb4Mrs7rYxVGNY970WgGHWJwbxTAmZ1z4uIGVlF7KWvjyELviSMkPYugZ02RenvLq21alv0TUyeBlcxcRVp/TmPqbTgvWvwQQMNu7ZzwO/2pwqimGnQjRV68etGzqV1lgHBEjTrHXRBmEAFEefMZ0YbBUaWQ== 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=yRqW49R3AX2G10zBW7QJuOU8XCppKlme0z2np6hl9Yw=; b=WTodVsP7BgwtDGbLLLJrnRMsHnzxtqDiJzak8TjLo3J6+D9KrgxGx77+pZiu4b8X8jkWSCnL/rs157ORWXGXhw9ZQnpccP2K8gHT73GetExN1xcS+D95aVKWmo8MUqglmYpRQ6FttSzQ/8pFEH0knWiqrA43qegVLraRF+ldiu8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:04 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:04 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 04/15] scsi: ch: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:43 -0600 Message-Id: <20221229190154.7467-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0446.namprd03.prod.outlook.com (2603:10b6:610:10e::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: fcb27a68-d584-471c-c732-08dae9cf2c72 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SOWYswJwH8F2hsv7eoPhlrYpZsBwrwO9HXbNN761mBqc0cfU63ZQWltWCgYSIdmfdy1tSFnjvQfzAXGpzKhVEYTCQTZu6I1A/nIsXkkoaOf49JLXFrbaiAJzPQB+4KTVWXIoELshQdZ3GikV/w3Am/CeHLYcVtylG85S6R/fN1OSi8Irzac9l0MEdXqZ17+feGeAbaLnNzoexs127rRekNspqN53pzra/2HR7/L/4EkHiwtGtQm4K7b+dTKj7RsNTAIcrD1Awe4uVP6+RRB+GSGK1IBBk/JQpS25eP1Xr7R23Lfmjl09ui877ACo4Y2GqF+cwE3kluz5E/8pYlDBFr+Qh1V3WSya19Wuu9Il8JtzbIB/sTE2tZGsz0s+43NtmXilrqM68RrFVU+LZSzQEVFNeKN59QJs7Ke1va17mzsegTjARjXEReATXQcelyWAU3pLkfYcQGA3IvJNFrQjuFE8d2KR+CWB2TDskk+kKv/XSI72eSX8FzNIhIeJ5P9HZtaoXNR6StgrJ4k4Zw1omj/lJlNldrL5g9UhiQVg9dZMAybVyzF29J6heYqT0QB2Q7twBhi5aMfiEcRxGCgNi4mXuypkVB71KO3QPldtiq31w7D/ui9YR2Qc1WjbAnln2sxtcnP0JJiRNApbO4c17g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OzKaPRiVbPHU9uV1VrsazHHM/3SkwuLiZjXKW9W6qPXstaRliCByL4UkpEYvXhv/KwDQQjcv+5ggUYfP52OOBBTHzbD8lVdjnScKPxKnhOSPKtYAPk44mZvg41Lmc7pLUxVgZ90tu7R0Mq4+QmAU3qDTEqoMMQjbUjt+zmAOmsPKgAKXbeV8QrcW1dF0ptN+/G+by/sVbGLSBMsDEdnYLtHyfTQ5PKj43bNRp/LTGlLBaX4wrKi7LlmW7onUwhxP63ynT85bqNx1mlKKE3HlkppiTsxRYJEAX9W+VbjI5ZqnH7XTUi+xoRyjxGrC4TQYFaF/zFVTdSnVPM8DvENL1+aSbRKq0Q/5ZGqK95cbESC9XXfjfDCT7uQnlpDjjIlLoIsGnzghR3Kt1SgaN7IuprMSWWaK90QfjDBeLzoAgvHq+afywOCczlXT+fisXZ/0QMjomWn8IMcSP6KMsh06zD1gBZ0T5psBkFig4us1PECeT6NepmqYRTEp5W4PoTZjTYr6CBvbQotY9lCcC+vQI2Xnxmwq8JGrxqXwfqNRoftZlSmG3HrhKHHRj0kwPUZQ7O69tPZVAVJ19mTvVrD6kFl4ry7qeHBw6mbJoEVxFhgocVrmE42+xxdc/W3LIgP/Tan1OUxMu2L/w/PiSMsIKm2n/y0V1wLiKXFIhOWNGiDIk9cpJxo4ApOW1etycmFRChbuF0I5+eK2rGBY4TQX64Bk6qP8by4XAhxXIs0TGm7y6oKll0i89Cqi/c8l3qRMd5RTCG3elVuxsheAecz/2YoowKZElajSaXi0UfoHbTiNvk4XybKo1Q07KVnvJVxvR1BpxqSnx7IQk43f/DokdWCr3nX3M4atIgkx00lO+DhjjEBaUncNAEDO1BOtM1c3j6z0/C2nkK3imqa3SeQ5qrW1u/cW9MbjrgCUC6NFKXdXy6bMn9dcjpWWk1mZwfCYKi1IzzYObcxgP5F3vJZ1JQWHBCgYkS9oIbxWxxHaxpRZx9kV0Hx2DoHUBvokcy7iwFcKFr46RaiVQeaKGKSOn2cveK14cQJL/izFLxZqMCwoD5yvtk27Jq5ljLsOks7SQAoVQFebRcwE/uTxoWy2FOLD5mwAcnkrkMcEwVELeEi/9Kte1q5GK9X3Jllhj8AkZtCdtpdAY4SXjd4pL0eiCwhZWhNYNv2jAfsDmxj8+j1S2+XX7fBBo4J0VoFIcnQSxGKDZjQPAmVUz1ffGSuJc3lrBdrVk1MXMCId7CO0szae6gkSyctDTEyZNJxq6MgqZ7ybfBf1GwcbXioLM3X2NEYq5uIHp6tbJiZ2JsvMex+nqNvrys/x2+8EzfJhueb/lXhy1W5MNoKu1lmDT1gCbCCs/3Y7bIQr/wdgV4VrKjrKXaa1WCI+3CtIW2BYMxFfp/9g2di9Cw4vFyQvXPResUsRibdbMMQesIArtRsMlFDuTgukijlVzP5jh0aFgQ3Jni4cIP1E+OQwVddsaftX9yj+hRNmHojHMCpQqvXPP9Kw+iv/WCcrNb8TS1m/0G8rGEC+1z+Ykc08X1EmQ27+y/otEGHqrH7NLjXizSJlZpo/w8TIhkEhxavT+iZBhVfaejBVKG5AAXK8RGgVYXP2lQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcb27a68-d584-471c-c732-08dae9cf2c72 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:04.0974 (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: McqOoedW9Q+Nk7jE8EXeIlpuyvl55reGn1dTP7b0KVRUZsI9mahKSnCxqRBTEy2hW1uIa/1Jf2B/9H0J3+nverkTWosEmWx87+Rt6xRGwy8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 phishscore=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: zjbZc5ZdWh2-bt4S6lOyD3MIulpHbC2P X-Proofpoint-ORIG-GUID: zjbZc5ZdWh2-bt4S6lOyD3MIulpHbC2P Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert ch to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/ch.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 7ab29eaec6f3..72fe6df78bc5 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -184,20 +184,21 @@ static int ch_find_errno(struct scsi_sense_hdr *sshdr) static int ch_do_scsi(scsi_changer *ch, unsigned char *cmd, int cmd_len, - void *buffer, unsigned buflength, - enum dma_data_direction direction) + void *buffer, unsigned int buflength, enum req_op op) { int errno, retries = 0, timeout, result; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; timeout = (cmd[0] == INITIALIZE_ELEMENT_STATUS) ? timeout_init : timeout_move; retry: errno = 0; - result = scsi_execute_req(ch->device, cmd, direction, buffer, - buflength, &sshdr, timeout * HZ, - MAX_RETRIES, NULL); + result = scsi_execute_cmd(ch->device, cmd, op, buffer, buflength, + timeout * HZ, MAX_RETRIES, &exec_args); if (result < 0) return result; if (scsi_sense_valid(&sshdr)) { @@ -254,7 +255,7 @@ ch_read_element_status(scsi_changer *ch, u_int elem, char *data) cmd[5] = 1; cmd[9] = 255; if (0 == (result = ch_do_scsi(ch, cmd, 12, - buffer, 256, DMA_FROM_DEVICE))) { + buffer, 256, REQ_OP_DRV_IN))) { if (((buffer[16] << 8) | buffer[17]) != elem) { DPRINTK("asked for element 0x%02x, got 0x%02x\n", elem,(buffer[16] << 8) | buffer[17]); @@ -284,7 +285,7 @@ ch_init_elem(scsi_changer *ch) memset(cmd,0,sizeof(cmd)); cmd[0] = INITIALIZE_ELEMENT_STATUS; cmd[1] = (ch->device->lun & 0x7) << 5; - err = ch_do_scsi(ch, cmd, 6, NULL, 0, DMA_NONE); + err = ch_do_scsi(ch, cmd, 6, NULL, 0, REQ_OP_DRV_IN); VPRINTK(KERN_INFO, "... finished\n"); return err; } @@ -306,10 +307,10 @@ ch_readconfig(scsi_changer *ch) cmd[1] = (ch->device->lun & 0x7) << 5; cmd[2] = 0x1d; cmd[4] = 255; - result = ch_do_scsi(ch, cmd, 10, buffer, 255, DMA_FROM_DEVICE); + result = ch_do_scsi(ch, cmd, 10, buffer, 255, REQ_OP_DRV_IN); if (0 != result) { cmd[1] |= (1<<3); - result = ch_do_scsi(ch, cmd, 10, buffer, 255, DMA_FROM_DEVICE); + result = ch_do_scsi(ch, cmd, 10, buffer, 255, REQ_OP_DRV_IN); } if (0 == result) { ch->firsts[CHET_MT] = @@ -434,7 +435,7 @@ ch_position(scsi_changer *ch, u_int trans, u_int elem, int rotate) cmd[4] = (elem >> 8) & 0xff; cmd[5] = elem & 0xff; cmd[8] = rotate ? 1 : 0; - return ch_do_scsi(ch, cmd, 10, NULL, 0, DMA_NONE); + return ch_do_scsi(ch, cmd, 10, NULL, 0, REQ_OP_DRV_IN); } static int @@ -455,7 +456,7 @@ ch_move(scsi_changer *ch, u_int trans, u_int src, u_int dest, int rotate) cmd[6] = (dest >> 8) & 0xff; cmd[7] = dest & 0xff; cmd[10] = rotate ? 1 : 0; - return ch_do_scsi(ch, cmd, 12, NULL,0, DMA_NONE); + return ch_do_scsi(ch, cmd, 12, NULL, 0, REQ_OP_DRV_IN); } static int @@ -481,7 +482,7 @@ ch_exchange(scsi_changer *ch, u_int trans, u_int src, cmd[9] = dest2 & 0xff; cmd[10] = (rotate1 ? 1 : 0) | (rotate2 ? 2 : 0); - return ch_do_scsi(ch, cmd, 12, NULL, 0, DMA_NONE); + return ch_do_scsi(ch, cmd, 12, NULL, 0, REQ_OP_DRV_IN); } static void @@ -531,7 +532,7 @@ ch_set_voltag(scsi_changer *ch, u_int elem, memcpy(buffer,tag,32); ch_check_voltag(buffer); - result = ch_do_scsi(ch, cmd, 12, buffer, 256, DMA_TO_DEVICE); + result = ch_do_scsi(ch, cmd, 12, buffer, 256, REQ_OP_DRV_OUT); kfree(buffer); return result; } @@ -799,8 +800,7 @@ static long ch_ioctl(struct file *file, ch_cmd[5] = 1; ch_cmd[9] = 255; - result = ch_do_scsi(ch, ch_cmd, 12, - buffer, 256, DMA_FROM_DEVICE); + result = ch_do_scsi(ch, ch_cmd, 12, buffer, 256, REQ_OP_DRV_IN); if (!result) { cge.cge_status = buffer[18]; cge.cge_flags = 0; From patchwork Thu Dec 29 19:01:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67194C4332F for ; Thu, 29 Dec 2022 19:02:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233877AbiL2TCr (ORCPT ); Thu, 29 Dec 2022 14:02:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233956AbiL2TCS (ORCPT ); Thu, 29 Dec 2022 14:02:18 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55F4213FAF for ; Thu, 29 Dec 2022 11:02:17 -0800 (PST) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTJ05Z4027436; Thu, 29 Dec 2022 19:02:09 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-2022-7-12; bh=Fm1gZxlGjp7RBqRfD7qXpiFWjff/Bspbt8Xeaa5Ksxo=; b=hVZtHCAoRYm4IShVfff4xmuuw2XowbQTwBB/tD1J9dmxWmZgt/zdU0jtazHt8WAV/I/h iGQuGQNplJ3q+2XRukEWtDDeoKXtsywiJme4D9A4fNHoXB/qJpd9XlJUH2+MpRtZvzMk 4C2tQcW9EV+G8calwVmulpHSseBbXwr5T516yQLFlyglpwXTmTTR1fM09UplirUqOKEX +ySWK9Ul8IlgQHkbzdM/vv4JB1wDBuVZ8RRiFccJ8TfgCHN9kn/2pK/GWHEdOr6ScHID 6bIiqH9PqG1pUhX5t6NboBWZQ/VpYr5iQuPvOEKnL0TkGtPfl6kOW4Z43Mdc/QlkU0Tt Ug== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnrbb7apy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:08 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTIuu0J024213; Thu, 29 Dec 2022 19:02:07 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2047.outbound.protection.outlook.com [104.47.51.47]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqvd2cyn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RRZ9eqVRCXUYJw/Tfdci4mI1OTKXWKtNN2yEPr7iBsJl5O3h2/lCq1MBr9oNDbV7gRA97SxMKPi6Se9kxVQ5nkhjleyhWPc4qYesgFY2vVDHVMtfH/PL5UL5GBV0tXI1qmmAG19NOEOJeIAP3ml1w+Oe+U/jQPmHEOCoxt1cRNCa3ya2Iwusx0u1qF7Zr669oHExjSjUCKKmOlN1Y842LDYu3h6dEBRFIf+708kZPIygEbv3e9jzpmuvbq+HCbTo2VTgUVsa1FAfbJJ2HodoWgpwx6EQSaE78hJdyNfVAQswz6VBztUV10QBhT0xhkgR01bFIaARTzFhgt/po6R11A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Fm1gZxlGjp7RBqRfD7qXpiFWjff/Bspbt8Xeaa5Ksxo=; b=cfHt6YxydVa8oakKX/afXh+oGKAVqudTM4xq/xidPfVANsVJ2agIM451w5LgZuHvyJt6IpgNyBAK/hFoBvakLJBEmh4rQuqMa6MpCWFHQ3T1v3w5O4Rcs1Lq8k0kWAmllk6SDjuVxWwZBf0tzi8zHhjbrsEZAWrEymiqAhFv6sOcBY7aFcTYoPSaVDOCru4gcw0cOnxvgTE1u67t3y+9dCI6uUHodKIGVwTZE69lPgw9kYSAi+QvLB5X256pASRUTLlGEyEjiob8iGpo4w03h6qTXEPSacPvczCx7RJ1y4hZ12IVLFiKV6Egzo1GOswdWTbissyAl8GabvZC+a57HA== 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=Fm1gZxlGjp7RBqRfD7qXpiFWjff/Bspbt8Xeaa5Ksxo=; b=MCthX9uOyZUyULd8JFqqsNKTXGdD2qIa0Hbks6iomYrD42m1qoAvomfagM0DFWLVVlahE0IPiy/eTKIDPuJWfqXextEh4HAmYQGYUbgV/GNuouY5L1FRscqxk66085gz5id56nEMLoi9BQCC7WqzaXmqTM5pLn5A1ZwXa7s4vqA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:05 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:05 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 05/15] scsi: scsi_dh: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:44 -0600 Message-Id: <20221229190154.7467-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0444.namprd03.prod.outlook.com (2603:10b6:610:10e::12) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: e9008444-db9d-4fe9-a1e8-08dae9cf2d76 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DlAbbzsl7lICwr0tE8lHUd+cA1nRwRQT/wFtc2nw8Rl4Yub8JCQ0BP/aFFyfjkFIAUC2hxoofJ1OThMyB+yCY69UW+xb/ptUnhK9Des2jwmi7qe3DrXpX80M7sWNzYh3UIgFqmfK/Ir0XSW7762UAs0w1kYo+9K7G5/qyNLRRjf4Jkiqc/qXBgICFPL+zLBOoC4+HsieScOXnUo3DhENGp1WrJzEVP8MfYU09Vj51tqhZjtShuW5pxwpN/OO4sSa8r5FHrN8f5HEVWwVpwpMRrtHulWe5MYmYjR6E8HNIxHDBygHyiH/0Ac6ct3rNkrq8le2YOl9EYdv3I4jJz+uy58OONykMpqKZQ3BXEab+ytFancAfE/G7v1ccmLwj0ERZkWse6cqBpY9bwU9ym9klTKP5H1s0OOyLZdp0Szf3ZNl2l5zLk/kAv1+xYjedHC3MRe3EWmrst3+XK7f/LMQX/DSl4YIKIOs1JkkYdQAJEjN18qJvix1quALZUvwCM5j1crcJ28H7RfLuMMyyvC+anaqSqv2x902uqNmccpK5VrEveHWiCpSiRljz8HmAxLweJanCAfy86/0LA2emAeIOa0DkcL0Q8QUitxurpwEG6RqyVMCtzrNuAkafP2t0OMnKg7yXidW8cPzLGXgT2Wrmw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zOMLIPkjq72ZW02dEtM0F/wXW3tyeYHO+BV7RCpfTYcY3bM2QJ0AfRoKu/+ZAU57tTVuLTJtrA7Kg8PX45JvHspz9052GqEZZFVxJeNDHUVRGwWc3gB4psPIiOFTzadDtv8ko4ISetSXdbrINRyXaNdmVY0/MEGEcqLDTTRE+KLNS5uGIe33lKOeYp09n9WJ3+Cfg8Ubyjlwmfxc/jVpqJiKzhN1LDmKzF4k44bkjjJd2ogqoeA1Hco98gTZJzs9Ph5j1dU5L3T+QNfjE/006ae8BFUaeJqmMbxtwCrpFj8xxx1vTxQcGRws6SfQhtR+Pm6DXOlqVYE1krWJTfki9tpzAI4fIL+zY3LhowA2t9sN5Uo0b8I/qZdLQbuSr8oHzXd/+7ViotmIKmAfrxKwwObMP63azih5Knkn9ZRo89ug2aUwBhVE93QB2x2Hl1HhcVSKJ65jpGY9NFOc3ypo2N59/8mJ4BRgR1dVFrAx8P+q+IXg6X6k00K9lCMd+MUr/3Kj120Szqyfx51L+KK8qK6aC0vWnaDrwzYkmdtu86danARV7H8+OyLB4F6Kb3yXYUHyQGdNMXrFau4d9F/cEwGWXIKvgj9tDxrg65A6uJkkbWf93CUPwza3TzThVMk94MmNFJNPQTHwH5AmPODZn02RMSwuw7i4nwSePDZPCT2LBEVVyWEiMBZtovSGoU29j3MFYSZLSCxqPyQWCxvGcvHtjgfwr5J4gcezTwZ5VWhzcPTHzrUSxC0xJA5xIjn2jgwL3QX+nkXx0bOPogH3XpOp8Ah678X54anXrNEnvLIsJfQLg+FKX1aHrr3ihJyvGi3tZY5+IXHwlnxN0g/rqnEit41niS1k/BS9RL0zBkzbYmN2bzE/asRuBG9GPh4LKAewk2mVFzdTK4D+IJdpw9YLPijQwRPkDaw6yjuEEHOvQb8bNf9ic/S1EA78tuDSYBHyu2DHFv07ABK+1Y1Dq0QjQmEETDTlFp/TUXRhUdp9zYiLB83Pkt66dGNekrNNrNnCBlnxMUiPRCVzdajuAutZkmjwzbJomIbguAloK5OqpSNkm5K8dFGsiXuBx7LQNC/DJFU3lO+Vc5QTo+T1AslGu+xZv2a5opUYu3eiq/5xV+gWz5xOqk1iceQ+A12TtMig6+0h6l7C9DaXYIZHNaRYpxKT1zIhQNIqcrx/rNXuD00nAfg/hyBp6tno6zj+ZCe4jQBQmWboHv5kyYlZXhvSKC6bcVWlVf9/YOUZfk9nKouxzbM0Hmik/2lAImlPwXyMtPfVKKiTVRcleB/6SpP+eyii2XbK6l4g0Bt9oJdDl+pMXYOUwohJnT5BXtvG6KMUJXMAniUH0dLHx+Bupb42bZGhFuAx1sHxTPg00g4KjeBjmtoM1NCE92Q/JfGwXr8bNeUwIKCZThvlRJUtbZBIeGSkoBn6Diu+IUnOQzvSC3TPYtQRbLFKR6YxdgyoLGQ3biy0vA5YUaUuGRbYTHbp+K6MuCK1kUNlMID3eh7IIdoA5QR8PmcJW0f2HXZnxarovhdFb8NcVO+qAP6kpanJMpXt8sAAaOawLaSCgM7tM6iGrxxPywrQBNJQtf259Lc+GyzFzghjsIJwZpbp6A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9008444-db9d-4fe9-a1e8-08dae9cf2d76 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:05.7847 (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: /K1GIWRGCCMVxfVAXiBqv7mfYlYRLT4lLRBwfoE/HrlV/1glZAslnvhR0aoRy510C8hwUw4PdYO5Y5lAAxUfgLZZrQMWQ/el2/AIEYroBi0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: u64bIQ9ftjQ1j-z54xspQGHF0gNp-off X-Proofpoint-ORIG-GUID: u64bIQ9ftjQ1j-z54xspQGHF0gNp-off Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute is going to be removed. Convert the scsi_dh users to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/device_handler/scsi_dh_alua.c | 26 +++++++++++++-------- drivers/scsi/device_handler/scsi_dh_emc.c | 13 +++++++---- drivers/scsi/device_handler/scsi_dh_hp_sw.c | 22 ++++++++++------- drivers/scsi/device_handler/scsi_dh_rdac.c | 12 ++++++---- 4 files changed, 45 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index 49cc18a87473..55a5073248f8 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -127,8 +127,11 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff, int bufflen, struct scsi_sense_hdr *sshdr, int flags) { u8 cdb[MAX_COMMAND_SIZE]; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_IN | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + }; /* Prepare the command. */ memset(cdb, 0x0, MAX_COMMAND_SIZE); @@ -139,9 +142,9 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff, cdb[1] = MI_REPORT_TARGET_PGS; put_unaligned_be32(bufflen, &cdb[6]); - return scsi_execute(sdev, cdb, DMA_FROM_DEVICE, buff, bufflen, NULL, - sshdr, ALUA_FAILOVER_TIMEOUT * HZ, - ALUA_FAILOVER_RETRIES, req_flags, 0, NULL); + return scsi_execute_cmd(sdev, cdb, opf, buff, bufflen, + ALUA_FAILOVER_TIMEOUT * HZ, + ALUA_FAILOVER_RETRIES, &exec_args); } /* @@ -157,8 +160,11 @@ static int submit_stpg(struct scsi_device *sdev, int group_id, u8 cdb[MAX_COMMAND_SIZE]; unsigned char stpg_data[8]; int stpg_len = 8; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_OUT | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + }; /* Prepare the data buffer */ memset(stpg_data, 0, stpg_len); @@ -171,9 +177,9 @@ static int submit_stpg(struct scsi_device *sdev, int group_id, cdb[1] = MO_SET_TARGET_PGS; put_unaligned_be32(stpg_len, &cdb[6]); - return scsi_execute(sdev, cdb, DMA_TO_DEVICE, stpg_data, stpg_len, NULL, - sshdr, ALUA_FAILOVER_TIMEOUT * HZ, - ALUA_FAILOVER_RETRIES, req_flags, 0, NULL); + return scsi_execute_cmd(sdev, cdb, opf, stpg_data, + stpg_len, ALUA_FAILOVER_TIMEOUT * HZ, + ALUA_FAILOVER_RETRIES, &exec_args); } static struct alua_port_group *alua_find_get_pg(char *id_str, size_t id_size, diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index 2e21ab447873..3cf88db2d5b2 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c @@ -239,8 +239,11 @@ static int send_trespass_cmd(struct scsi_device *sdev, unsigned char cdb[MAX_COMMAND_SIZE]; int err, res = SCSI_DH_OK, len; struct scsi_sense_hdr sshdr; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_OUT | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; if (csdev->flags & CLARIION_SHORT_TRESPASS) { page22 = short_trespass; @@ -263,9 +266,9 @@ static int send_trespass_cmd(struct scsi_device *sdev, BUG_ON((len > CLARIION_BUFFER_SIZE)); memcpy(csdev->buffer, page22, len); - err = scsi_execute(sdev, cdb, DMA_TO_DEVICE, csdev->buffer, len, NULL, - &sshdr, CLARIION_TIMEOUT * HZ, CLARIION_RETRIES, - req_flags, 0, NULL); + err = scsi_execute_cmd(sdev, cdb, opf, csdev->buffer, len, + CLARIION_TIMEOUT * HZ, CLARIION_RETRIES, + &exec_args); if (err) { if (scsi_sense_valid(&sshdr)) res = trespass_endio(sdev, &sshdr); diff --git a/drivers/scsi/device_handler/scsi_dh_hp_sw.c b/drivers/scsi/device_handler/scsi_dh_hp_sw.c index 0d2cfa60aa06..5f2f943d926c 100644 --- a/drivers/scsi/device_handler/scsi_dh_hp_sw.c +++ b/drivers/scsi/device_handler/scsi_dh_hp_sw.c @@ -83,12 +83,15 @@ static int hp_sw_tur(struct scsi_device *sdev, struct hp_sw_dh_data *h) unsigned char cmd[6] = { TEST_UNIT_READY }; struct scsi_sense_hdr sshdr; int ret = SCSI_DH_OK, res; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_IN | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; retry: - res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL); + res = scsi_execute_cmd(sdev, cmd, opf, NULL, 0, HP_SW_TIMEOUT, + HP_SW_RETRIES, &exec_args); if (res) { if (scsi_sense_valid(&sshdr)) ret = tur_done(sdev, h, &sshdr); @@ -121,12 +124,15 @@ static int hp_sw_start_stop(struct hp_sw_dh_data *h) struct scsi_device *sdev = h->sdev; int res, rc = SCSI_DH_OK; int retry_cnt = HP_SW_RETRIES; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_IN | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; retry: - res = scsi_execute(sdev, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - HP_SW_TIMEOUT, HP_SW_RETRIES, req_flags, 0, NULL); + res = scsi_execute_cmd(sdev, cmd, opf, NULL, 0, HP_SW_TIMEOUT, + HP_SW_RETRIES, &exec_args); if (res) { if (!scsi_sense_valid(&sshdr)) { sdev_printk(KERN_WARNING, sdev, diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index bf8754741f85..c5538645057a 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -536,8 +536,11 @@ static void send_mode_select(struct work_struct *work) unsigned char cdb[MAX_COMMAND_SIZE]; struct scsi_sense_hdr sshdr; unsigned int data_size; - blk_opf_t req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER; + blk_opf_t opf = REQ_OP_DRV_OUT | REQ_FAILFAST_DEV | + REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; spin_lock(&ctlr->ms_lock); list_splice_init(&ctlr->ms_head, &list); @@ -555,9 +558,8 @@ static void send_mode_select(struct work_struct *work) (char *) h->ctlr->array_name, h->ctlr->index, (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying"); - if (scsi_execute(sdev, cdb, DMA_TO_DEVICE, &h->ctlr->mode_select, - data_size, NULL, &sshdr, RDAC_TIMEOUT * HZ, - RDAC_RETRIES, req_flags, 0, NULL)) { + if (scsi_execute_cmd(sdev, cdb, opf, &h->ctlr->mode_select, data_size, + RDAC_TIMEOUT * HZ, RDAC_RETRIES, &exec_args)) { err = mode_select_handle_sense(sdev, &sshdr); if (err == SCSI_DH_RETRY && retry_cnt--) goto retry; From patchwork Thu Dec 29 19:01:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA7DEC46467 for ; Thu, 29 Dec 2022 19:02:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbiL2TCt (ORCPT ); Thu, 29 Dec 2022 14:02:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233600AbiL2TC2 (ORCPT ); Thu, 29 Dec 2022 14:02:28 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E84AED9A for ; Thu, 29 Dec 2022 11:02:26 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxO1H004154; Thu, 29 Dec 2022 19:02:10 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-2022-7-12; bh=7/Eat9zbDffMIImjWBM5k5yQG4bj0AjQtRb737E+1n0=; b=jAXKYeJqpy7gntDUyno8jT+B2boMSDaJe2BxtB5kbucC/tl+FC1wUppZ4f1sbVEHf4Ff v2BBsS6MOztlncroWWQkIbYqkteKcX8TIvMVXmTIJd7Ty3jnovkB84c2x76Xd9D4cRyx 3x6I5IpqC9pGo6QPAEbfWcq74guoY2T1B1tbE/FLgGyX9mTwb4z4o8qjv3gKoc2pM0qK D7pEyESnm+AALbYiquRNnCuMYryGutlqa8qDWaVCRUPXOxLntSUIZ426ldfwcUkiydSO 3UcdnkZHuhpwc9IESiQj95BnHhTQDK2NXOv6JREJbj5rnCru3eErj9ivWDArVRtdXswF AA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnr11f9ty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:10 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTFkewF034148; Thu, 29 Dec 2022 19:02:10 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2042.outbound.protection.outlook.com [104.47.51.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv6s0k1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hDO0XzmUPN8gLhxaNwiLBx9/s77jj0C/gzeTLN1gbJ7frkW6QPODbE/hC0JdkPP6jRlupJq0zCQLYS+j3MBBnKV13lqI+ECTe3m6vz3owXyk44VMwFROv/D9rl4VXnEOtTy/banE1kbasRY4+jEe7Ggi5VpVklAj9Tz0lsIPE9FEoOfZqrvy3XLMDhhrcjs2o75kMspEkJ4ddlCukFUAzNvOBTzRxC3b0nVtPp3m4tvoUnhoSAimH2Qu1uXrDzdlpCzKSTWrN+GlMI6H19LVZ1+twsettAM7m+g0w6bKJtMceyVV4OFNomz65DZdoox/AYF4y1gGiEUbyUErQdHLiw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7/Eat9zbDffMIImjWBM5k5yQG4bj0AjQtRb737E+1n0=; b=m3k+FrO7/YcxBLrrfWDqR4FR/FUGub9jXVdyXgpYd5y7y6mc7BxA+hHf5mg7IbSDXU9z/6DfjtJ9rFPm9GetpJ+GpBarIhBWFoh7hv2fuSYISwdyw74FQNwk7NawtJD0N8VHrCH/y29o02YLu0PnfA9jv65F9yNH+zPYcrtvJ+yY+YtwiSD6+Rq3lyCeB9TeuZ2d+wmoogXL8afMRQEAknNr5A0q/fVMnnxAfTj8SQ1Q9bw5X1k/4TzZOpr0q/e7PGtmOneUTo0izkCBkPp4q/4HDeb8KusmMvBu4kLAAL49ChVnvzuTr29tor99C03Z0vG5DJUBWfdrqtsf0W7rzw== 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=7/Eat9zbDffMIImjWBM5k5yQG4bj0AjQtRb737E+1n0=; b=KEALOuziOukcJrtX5OmwYlFMIfhxO0SudQY22jezYnXQ/D0LT22e4InTs0/KPCTZXIc43qUqgfzeBtSetV4XxPjSqhQ2SXqiDIXwTq+iE6AQlIy7XFvK3dbbskZ4gLWw0Q0X7on2aQpL1Z7leqQrqmB/54cErpheTae3SS9DMt8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:07 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:07 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 06/15] scsi: core: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:45 -0600 Message-Id: <20221229190154.7467-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0433.namprd03.prod.outlook.com (2603:10b6:610:10e::18) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: d2e67cf9-6cc7-40de-07f7-08dae9cf2e65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SzPiYIDQXCAmMDtVSAn6ZWeGvjsRfnWK/Xw9GaHlQEALe/lP4PGSP8AahL6SaqgIdFTXF6Yhuza3t6XmUAbXYxj5sFTqQ68+56BrS8KRnQpjwphy6wgeQ5UkxXe7MwwBdIoUbDwvA8a+nvm1JNkBIZRC1Oa543FjElwFKat8E0IZtMhrj+ONH4p1stodysgICVya8jWTAQbKqRlzQNQnmD41TLfYrZWRdlJb3HYh70/Rf4rUaq/ntNVr99MKAu6bCT87fQlHNcHeKnYUMPnOKs3GuLt671x5Vg6AvICXRscejbj+yY6X1PIFvfno2CJ+Kx0AEmY2peAKfPzPZPlVtSS/1zsMbXtPFlovSNKgaK4/9Rrl3VyDgc+EBfqQy+7b2MXU+l24zxEql1fD2TSBs6XtFdYN3s7VpYdwBS4/zRWu/n79vRZqYNu6qJLUajb5+mJVh/7exTVJtR4d7toIP+ZfRnnyVr0sVR4iiPi3gr+S5wypaHQ+4ytTi6FFenXzBkro1ya+AHwRv8/p9DN0PIz2wqtDuPGl+PxB9rDiEh+0TTS6TO2QldzWq+Nt+KMwQAVslCMKAtW00s6lCqzFrHGLC+WfwUVlFaUvoM3vRSzWunTEi5i+BHIs67Iocg2dX/3SdN0rH3ahsJwXrmh50A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ydl6F6DBeriuhR2s6SThvWa7RJfvc63oSCk+Wf2Rwmr8NXgcGnieL0TzCWE+lcK0jqZlWLz2R2hE1O3GB+Jw50tIlVGqM+lJfGxM65D79/db3ouWXLF2t08necnspapgUhkt7Eunu8pthgpbT41wu8xkUWmb/dnRlHKzonmm57U1dmMTjhvZaJpmdPbYZDoVN/3zS8cLEWvK8ZptSbc4g/P9+WuHXP4LSF+Vm0wSEGGdeLWeCpLlCVJ1D+L6ANhfrv0xwCmPqfGViF3cWGU3VbHWx/qMMMBhwXTfL7E2S2Pkex0Z7tqEUJorfZfb2CUh40vqCOozJtENqfvtIJJkvAtysK18+a7kbqUSKfNTidbdwcmJD08KkMtFsB0TmXCYNmL7iiMKa2DpYIm7FEBCCQ98KTQsQ79WrWhWTTRRiM6Xj6XdZbgE0ATXo3GLHk38W0k85PA4uPWENM5mgL/AhwjlC302n5FA94Be0+CWEn8vooG1ntYA6tDasBl1qqCfgWBGLgFbpzVqUr+/LXxszicqYKz/vJPcBvvgoYaBH/4IZzljevBE0r6HQQsgWpyId+uX88nbI+5zqh4zw0N2LuRWwN5UXOPcfG3BUuvH/PXA5la6sz5LMfAZLjaT9jqlWWA+9VE5fyneOwIs3oI23k4kX+uB7DMWtwtZJWs5hESWBQYm4/Rz1fCiTlEOR/8aTA3FaXrL9jQGQDDrx6wgCVdVvewvduo0JgnqHiGG7Z+9sDPBgYpw8y4QaofmZAxExvr/PSwyk0JW02nsXzC8yKcciMIXKCzC29fC1LW74rRYgU2NQnLnitDbfvgfmdz9jhmXAByHcaaZBLFrP7p4yjDZAyFvXF2URPo3mjqSh+ziVfVgZ2nmeC1VtNH4drzjzPusmykjXUVyFjAPYjPABLrBmF8Jk1yAWuP1w0qIRGXBoTqgUVx/DwD9dsy9a5bPw5jMqOajyX9YH35uc+PsnrjVyLxTSA3BEcVo0TF9ZJR+vEuG4IkIDwrOCItA+3v2YSYtqOipUtlR9rTpWGFdc+UrIhMKOBH5XCyj9sFP8+6MLNbUNsvJ9KzykjUbEzBcYRczgBJxZme2WgOnaEkGCG1AUvzLVIxDFoCqTNvpMoO7Dl4j35Va7rPIDgl6eVJuq3eUIcz3ynz/8k2WSE4cKeReNfqhk1LQR1wsyRnZVIg4zHCsS59vfMrrXBBSYin47em/vY+pKS+P3mg4dVgicpRHPPNCNcWd8rzSpBVH5/6lHD8XU4AwtS+VK78LptgqU52W7sZ/HSAzwNh5JEXYppbSxSUut40k8FxzNctL08u1lrvMQ/0qZHBKooLLJabFWbSsohxEHGuOU2DtDoCJOCWUH8+6mbFrLvuuaRm1owR+TY/AaEuc3SgqgSDTk6+S5MGcuJHltcEMqugiJ79sMQg6SxV9RVT1KKxWMEYc1mY+orlDPZDdKrNWDWHWXc/DxIRg/BY3kehTRKmtqa2jwl2WeH1OaBIW3U88aucwEbSE1YLRA+olvAeU0aFXoGdFLxD1lalsgYKyBykB5+rbNO5tU+YPlnNrLMk8VBQvzfUISso+vs0/byINpbZoZlET7Bnb+P+J0WEnvw7ULmLJLg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2e67cf9-6cc7-40de-07f7-08dae9cf2e65 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:07.3627 (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: +1akzBPI1OWcN7bKhIeUZhZdicERprdXrdN98q3NF/6HT4EZhRPKMsvgc58gTBwCfomfr3gdaWo1Eh/jaWEOCeFi7ucI7/ENjK4j5DdWeqk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-ORIG-GUID: bldlqqhh3q-s5EBeCZtZdj4-bDs0sX2P X-Proofpoint-GUID: bldlqqhh3q-s5EBeCZtZdj4-bDs0sX2P Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert scsi-ml to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig --- drivers/scsi/scsi.c | 12 +++++++----- drivers/scsi/scsi_ioctl.c | 7 +++++-- drivers/scsi/scsi_lib.c | 26 +++++++++++++++++--------- drivers/scsi/scsi_scan.c | 26 ++++++++++++++++---------- 4 files changed, 45 insertions(+), 26 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 1426b9b03612..00ee47a04403 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -309,8 +309,8 @@ static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer, * I'm not convinced we need to try quite this hard to get VPD, but * all the existing users tried this hard. */ - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, - len, NULL, 30 * HZ, 3, NULL); + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer, len, + 30 * HZ, 3, NULL); if (result) return -EIO; @@ -510,6 +510,9 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, unsigned char cmd[16]; struct scsi_sense_hdr sshdr; int result, request_len; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3) return -EINVAL; @@ -531,9 +534,8 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, put_unaligned_be32(request_len, &cmd[6]); memset(buffer, 0, len); - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, - request_len, &sshdr, 30 * HZ, 3, NULL); - + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer, + request_len, 30 * HZ, 3, &exec_args); if (result < 0) return result; if (result && scsi_sense_valid(&sshdr) && diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 1126a265d5ee..e3b31d32b6a9 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c @@ -69,12 +69,15 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd, { int result; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; SCSI_LOG_IOCTL(1, sdev_printk(KERN_INFO, sdev, "Trying ioctl with scsi command %d\n", *cmd)); - result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, - &sshdr, timeout, retries, NULL); + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, NULL, 0, timeout, + retries, &exec_args); SCSI_LOG_IOCTL(2, sdev_printk(KERN_INFO, sdev, "Ioctl returned 0x%x\n", result)); diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 7d324db6b2f7..abe93ec8b7d0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -2084,6 +2084,9 @@ int scsi_mode_select(struct scsi_device *sdev, int pf, int sp, { unsigned char cmd[10]; unsigned char *real_buffer; + const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + }; int ret; memset(cmd, 0, sizeof(cmd)); @@ -2133,8 +2136,8 @@ int scsi_mode_select(struct scsi_device *sdev, int pf, int sp, cmd[4] = len; } - ret = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, real_buffer, len, - sshdr, timeout, retries, NULL); + ret = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_OUT, real_buffer, len, + timeout, retries, &exec_args); kfree(real_buffer); return ret; } @@ -2165,6 +2168,10 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, int header_length; int result, retry_count = retries; struct scsi_sense_hdr my_sshdr; + const struct scsi_exec_args exec_args = { + /* caller might not be interested in sense, but we need it */ + .sshdr = sshdr ? : &my_sshdr, + }; memset(data, 0, sizeof(*data)); memset(&cmd[0], 0, 12); @@ -2173,9 +2180,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, cmd[1] = dbd & 0x18; /* allows DBD and LLBA bits */ cmd[2] = modepage; - /* caller might not be interested in sense, but we need it */ - if (!sshdr) - sshdr = &my_sshdr; + sshdr = exec_args.sshdr; retry: use_10_for_ms = sdev->use_10_for_ms || len > 255; @@ -2198,8 +2203,8 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, memset(buffer, 0, len); - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, len, - sshdr, timeout, retries, NULL); + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer, len, + timeout, retries, &exec_args); if (result < 0) return result; @@ -2279,12 +2284,15 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries, char cmd[] = { TEST_UNIT_READY, 0, 0, 0, 0, 0, }; + const struct scsi_exec_args exec_args = { + .sshdr = sshdr, + }; int result; /* try to eat the UNIT_ATTENTION if there are enough retries */ do { - result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr, - timeout, 1, NULL); + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, NULL, 0, + timeout, 1, &exec_args); if (sdev->removable && scsi_sense_valid(sshdr) && sshdr->sense_key == UNIT_ATTENTION) sdev->changed = 1; diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 7a6904a3928e..a62925355c2c 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -210,7 +210,7 @@ static void scsi_unlock_floptical(struct scsi_device *sdev, scsi_cmd[3] = 0; scsi_cmd[4] = 0x2a; /* size */ scsi_cmd[5] = 0; - scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, result, 0x2a, NULL, + scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, result, 0x2a, SCSI_TIMEOUT, 3, NULL); } @@ -646,8 +646,12 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, unsigned char scsi_cmd[MAX_COMMAND_SIZE]; int first_inquiry_len, try_inquiry_len, next_inquiry_len; int response_len = 0; - int pass, count, result; + int pass, count, result, resid; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .resid = &resid, + }; *bflags = 0; @@ -665,18 +669,16 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, /* Each pass gets up to three chances to ignore Unit Attention */ for (count = 0; count < 3; ++count) { - int resid; - memset(scsi_cmd, 0, 6); scsi_cmd[0] = INQUIRY; scsi_cmd[4] = (unsigned char) try_inquiry_len; memset(inq_result, 0, try_inquiry_len); - result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, - inq_result, try_inquiry_len, &sshdr, + result = scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, + inq_result, try_inquiry_len, HZ / 2 + HZ * scsi_inq_timeout, 3, - &resid); + &exec_args); SCSI_LOG_SCAN_BUS(3, sdev_printk(KERN_INFO, sdev, "scsi scan: INQUIRY %s with code 0x%x\n", @@ -1402,6 +1404,9 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag struct scsi_sense_hdr sshdr; struct scsi_device *sdev; struct Scsi_Host *shost = dev_to_shost(&starget->dev); + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int ret = 0; /* @@ -1476,9 +1481,10 @@ static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflag "scsi scan: Sending REPORT LUNS to (try %d)\n", retries)); - result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, - lun_data, length, &sshdr, - SCSI_REPORT_LUNS_TIMEOUT, 3, NULL); + result = scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, + lun_data, length, + SCSI_REPORT_LUNS_TIMEOUT, 3, + &exec_args); SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, "scsi scan: REPORT LUNS" From patchwork Thu Dec 29 19:01:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083710 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32B7BC3DA79 for ; Thu, 29 Dec 2022 19:04:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233924AbiL2TEd (ORCPT ); Thu, 29 Dec 2022 14:04:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233670AbiL2TE2 (ORCPT ); Thu, 29 Dec 2022 14:04:28 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51A7213FAF for ; Thu, 29 Dec 2022 11:04:27 -0800 (PST) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIwxBm006161; Thu, 29 Dec 2022 19:02:11 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-2022-7-12; bh=iaPvDD7gszUCyA0JvSDOLLwQteKEP7GgfGXaVHf1rjU=; b=E0+ZLdzLDnIMyB34ni+Cm6XYTUN4BJ0uEmbcA5F+G/7JjiA3iJegqeDcMP6FsXA2yEyE Lb5+MdMSoltks5ewh726VQsravy5ElTK7YxLvazSUejKDpFZIn0GWpobkxC9kkxGBmOk Le6SjlgHz9mthWZX8mIHrkGookOOuDUbrlH3ONO0Tk1uRoCE2HpD3Oq8Rl0VTjYPHvQK eLvfWtGxvFIfRYDWmkI/e8ikgRHbv7aY4+Srr/n73XCic9Q1RRXqZUa9WjSEyIB3Mo2W eoGcnT13R+mhoyhiFmwwKP3rAhsdoTgZKOi25HhpbuHH7ZNIXixSpCrsoDhGRoeDuSZz Vg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnqudf8mf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:11 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTFkewG034148; Thu, 29 Dec 2022 19:02:10 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2042.outbound.protection.outlook.com [104.47.51.42]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv6s0k1-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GhHdmuy41C4eL6uP3Wm1nQtGNj+82wZgtqix7/hJHPpPZ1dZUxkU9K55r1aLN+riLSjlK1Hu5ihy00H3y8EUPezJMFHi8J1TaiCT2LmlhVeOA1myq9v4MYlj/FcyBX8CCzZB3f7bEJtEBHn+Rb2/FGucaVoCjnd1atKx/mYJDnv0PLh8TdwL7nXFFC0IeNJpjuq1mk58bz4QCUlvQwaE8sUG6g83Wv9A1rISjm5Isyn/F9IV9lNpFA7BZ+rARiXgzQbMHQG0z954Nr1ETRMYXRIQefO2KaATvG+82OSG5xHWM/dGx63NgVKR4zSkd3hl+Sx3OzflepxM53luudsxPA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iaPvDD7gszUCyA0JvSDOLLwQteKEP7GgfGXaVHf1rjU=; b=kb4YNlI2D6RJSAKQzrMMtKyxgudd62DFvZFiTlqeQyLEARaf/R6mM0xpj52VISFQpccvTazuEomkaW4jNd5YFMtPFH2SE0lZTGla3wnq/KkkNT9baIjNNiBRO4em8q5YHkWQjfe7S16wtUlDbNzyCBiii7bMW5y28A5ti31of+M+S1Xl1PRqRa8we1Q9g3Y07unBEoeMrCvD7cHbscGPj9204Go8p4rIy3IqmeZXm7nqHJA1u/6kF2vik1OGDWkrGBv+YAD1R1s7EQb6+7fxSspnstVZXLGuKkYOA9wnICEHuYt+mXFtTtWF/PKf+UqzsyuCm48ZurKtQPbpFAUhUw== 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=iaPvDD7gszUCyA0JvSDOLLwQteKEP7GgfGXaVHf1rjU=; b=RQPse2DU7VGDn1Q8mTKTjUBlRrbJFWYRhSm38eaqC+BhVOVrw+G7KNiBpnE2hHlVftC7DODWmQi7mLXuWG083HvYQWer8vGhdTlgNLSgKSsSv1OgQZJYBa0LeWXSnygdYZu540RNC7nfwkEwSMzy0xiH8+rsl+8jE/7R/zFVziQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:09 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:09 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 07/15] scsi: spi: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:46 -0600 Message-Id: <20221229190154.7467-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0050.namprd03.prod.outlook.com (2603:10b6:610:b3::25) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 37861403-3bdd-40ea-099a-08dae9cf2f70 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N+WKNQ83ETonvekLI3FgpvqMRIGZdyz3mf4RIAdRFN0aAko9k537x8oX/4ntX1oR2bznzY047udv7Ioht4icUYQ4GjiOieEny9zpKE7n82ETCBVmu2r928xghR2AbFqlh7IZzrCs0KmekIC+p46iQjHVxUmWfm5GpJKubmtlBHghVV3v0/F8vt6oMoh23CIrFe4TOS09yvpEstI4qxJAdrI5GraeMOHM4bXMu1JwLwvE2FprE7pWMpp3RWROl739HLKHwEkATKbkHthGNUIXEA/sbUL9ZTsG74qwm1NJ7KPCs/HX/2yNLAYU6bZZ6EmIgbXkqdx7DXWo2vU4qTBIMX7AQTi2hSUJ059cUqYWXBabPrQ8u+8u6e3zjdsuSsU+69SaA1lDITvP11zV83sVvN+vA7VEtlkQqT+vXMQ2IllFmYhF69hRzk24SuWmMaymJRp22Mdrmoym6lYX9/Uusf9mj+voMtRyFzBhuYW4U3mJjAZb4NN4QxV8Vpz4TfO0seXb6VspsyYan3FS48HsYNZozjuEoU3TouzT9fySTNOF6RGFgFJyCpSurXfy7zyTyRJLGUkOVS8ICc/KKyMdzGxYobC/CmzNv5YJF+w2o2D546CFdG5qM9Kx2XAl0J8ODFnL79dOu4L4Y8EplcEGuw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NLdwFKWbEQmZddB2BbondPZI5g8DmsPTFxNb6f6nzuduHlqk8FewvT9za4+RM9DJlluwT9J9wH0ndp3ewEGrPRCthUUxe/p96QYAs1ir9I+eMvBgopSuI6NAiWW3yMIlmpsTOhZKZn66OxFjV3rHBd9vI9K1YNxiAhjhwGf78xZo+YTfOBhJNGPWoAG5Skb7fnVPgB3lCiLTCozUVdgwUZ/vRO8Yh6rRZPPluNmaTRMP4QHyvCZEJ9DcLBDkj4nwKlSXMIGX+ZS0Vb2D0vvhJGm1u/w8jtTL9h7Q31CMRelqcijxJDTgKyIJW808BN0gfmcTdSzTVgm+w71iickBbx856iHLigY0B5wKey3Z6eQ0fqyS6K4/9/4b8q0urH0c12X+7S1YhhE402lXDlJnLxk7Pn591MP7hpuyn5ayNMlXg7Q2/u1Spkcg6ZIzMcRsEjWsrUddAm+2X7mAxhdUZKXIhyySw+xjV8fSNNRggMyfC3hfwZzAzWoTNq4AVHcxmSvMTbY9QcXIElWorWplUunKaU6HCcrlm3mvvEUZ0Su78tk7GDudpqKYPsB99HAUKlXX6xshCCJdT5fpDQjyPSI7JruoJKauNafCmrVl5rMIWJUKI2iz4wRb28n/npMbNhtQRofgGPBVSASCFOcyQK4DtAbz+SRiGuFnKLdBlK2mbAUvMwQgSlqZkD4z5E1xB6j2XjRQO+epq0/zbUDhtxBApTW+gax3pxV2aEQb6lBGrsmWzs0xRdWkb7foX+3YbmpffwoGFqi0XbfC+3hiLN24Z2GUCHgXAJSkVDNBtC/1Ze4ZzxVwkKJdPbNayhPddZIsXFxyCp+zTS27+BLfkOk27rzWkJK2KSkj4qpZlkDQmYs2pguZXsRcWoGqFlRuYinI1mgnymnLHcxQyfzwzrjkku2me074nW/D26LHEsaRVmRK5x51J200Xz/uVInNZkblUJhFcTthl+Sem7hUgnqgrkRNwtDOr/coVnyFpPlLF+rCSt1NpqLcYJJxmQ+mjaqHLWDPXk18W5Ib9zn3LqfBAhn6BqjiFgqpeW3K/vSLFsoYkAWNjK9OphDBBrJ5mJhMGjgzFRrzQrpNaBr4k4VTslZ7QfOnrikiEWTRNSdvQRR9Uw/fKVgi2xX6VWReFKfl2U9S4DIlW6gA+eol9no5I5xsfKZsikmUuHDjx8rsmmU2kRAsXx0azPv9FTbZ06nRsMcjW0kYgAEzR+3IHTkgwauDfn4CoyK1nR0hMUy9szUV6GFMuyDIntU2p1+FFt3vWCE86Uxg3uihN6FO+KnugCMEttb9slJGIiniwJOyngiQajkzHSRbi8DRo4odGEDWhlKqc4zbHM9SvY1HzU4SnfCbP98pdtCnyokYzNfcE3gCfOHgGAYBvBEEscoIHZgpAFrnORE/rIsXeYtp413D0NaUp58fqapB9Iq9AH6RRF+5SLD8Bt/vaZ5waws+zLdU3U65sDGCcD3VXEqFTso/9sbAhF2bsDcpZxZP1lk3yThoZtVDpKjJzbp+DrFXgwXOzxOaHROUp9uyju+pkN3LaMSxaxc/eNyX9aDDP/UmOohy8DaHbfPKEfFTfCrNu//9FLBtwwkHTVDA4WOvsw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37861403-3bdd-40ea-099a-08dae9cf2f70 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:09.1282 (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: XsBilfn90IV7qCeJzwjY+oSy6WnwNH4REmuxzGSiPJOojg3CVMg+KyfTTt52lUN+6Dse3yr53DrilX0+5jWBpS8harpwikUAoa2gPoj88Jk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-ORIG-GUID: qrTNhGjdeMwkuuppfsk4MtAUTWeHYPfQ X-Proofpoint-GUID: qrTNhGjdeMwkuuppfsk4MtAUTWeHYPfQ Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute is going to be removed. Convert to the SPI class to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_transport_spi.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index f569cf0095c2..2442d4d2e3f3 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -105,28 +105,27 @@ static int sprint_frac(char *dest, int value, int denom) } static int spi_execute(struct scsi_device *sdev, const void *cmd, - enum dma_data_direction dir, - void *buffer, unsigned bufflen, + enum req_op op, void *buffer, unsigned int bufflen, struct scsi_sense_hdr *sshdr) { int i, result; - unsigned char sense[SCSI_SENSE_BUFFERSIZE]; struct scsi_sense_hdr sshdr_tmp; + blk_opf_t opf = op | REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | + REQ_FAILFAST_DRIVER; + const struct scsi_exec_args exec_args = { + .req_flags = BLK_MQ_REQ_PM, + .sshdr = sshdr ? : &sshdr_tmp, + }; - if (!sshdr) - sshdr = &sshdr_tmp; + sshdr = exec_args.sshdr; for(i = 0; i < DV_RETRIES; i++) { /* * The purpose of the RQF_PM flag below is to bypass the * SDEV_QUIESCE state. */ - result = scsi_execute(sdev, cmd, dir, buffer, bufflen, sense, - sshdr, DV_TIMEOUT, /* retries */ 1, - REQ_FAILFAST_DEV | - REQ_FAILFAST_TRANSPORT | - REQ_FAILFAST_DRIVER, - RQF_PM, NULL); + result = scsi_execute_cmd(sdev, cmd, opf, buffer, bufflen, + DV_TIMEOUT, 1, &exec_args); if (result < 0 || !scsi_sense_valid(sshdr) || sshdr->sense_key != UNIT_ATTENTION) break; @@ -675,7 +674,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 *buffer, } for (r = 0; r < retries; r++) { - result = spi_execute(sdev, spi_write_buffer, DMA_TO_DEVICE, + result = spi_execute(sdev, spi_write_buffer, REQ_OP_DRV_OUT, buffer, len, &sshdr); if(result || !scsi_device_online(sdev)) { @@ -697,7 +696,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 *buffer, } memset(ptr, 0, len); - spi_execute(sdev, spi_read_buffer, DMA_FROM_DEVICE, + spi_execute(sdev, spi_read_buffer, REQ_OP_DRV_IN, ptr, len, NULL); scsi_device_set_state(sdev, SDEV_QUIESCE); @@ -722,7 +721,7 @@ spi_dv_device_compare_inquiry(struct scsi_device *sdev, u8 *buffer, for (r = 0; r < retries; r++) { memset(ptr, 0, len); - result = spi_execute(sdev, spi_inquiry, DMA_FROM_DEVICE, + result = spi_execute(sdev, spi_inquiry, REQ_OP_DRV_IN, ptr, len, NULL); if(result || !scsi_device_online(sdev)) { @@ -828,7 +827,7 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sdev, u8 *buffer) * (reservation conflict, device not ready, etc) just * skip the write tests */ for (l = 0; ; l++) { - result = spi_execute(sdev, spi_test_unit_ready, DMA_NONE, + result = spi_execute(sdev, spi_test_unit_ready, REQ_OP_DRV_IN, NULL, 0, NULL); if(result) { @@ -841,7 +840,7 @@ spi_dv_device_get_echo_buffer(struct scsi_device *sdev, u8 *buffer) } result = spi_execute(sdev, spi_read_buffer_descriptor, - DMA_FROM_DEVICE, buffer, 4, NULL); + REQ_OP_DRV_IN, buffer, 4, NULL); if (result) /* Device has no echo buffer */ From patchwork Thu Dec 29 19:01:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3052EC4332F for ; Thu, 29 Dec 2022 19:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233908AbiL2TEb (ORCPT ); Thu, 29 Dec 2022 14:04:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233504AbiL2TE2 (ORCPT ); Thu, 29 Dec 2022 14:04:28 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 555BD1400E for ; Thu, 29 Dec 2022 11:04:27 -0800 (PST) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxlBS026477; Thu, 29 Dec 2022 19:02:14 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-2022-7-12; bh=eOjPBHj/Sn1oef3lbaZ8B5YOqX59BGSGW8yjUU7cum8=; b=03/ezF4PhbJJv++RpXJe6/t+drNGFnMthiTjz1RRShk6c4Bvl0DJOf0So4enuV+Eze9v /szsVJ/CQp+NYTNkxOMdHKst5ymgCD/t8wj+8Xr/qmJa+WJTko4V0rlu2bX8JQNicPES CF8LK44uJtn+UyuBPmE+WublXdoWeX6Q2568e+53+up46UzAcoJPJkgJEnWvDwVjCLwf 2UuMP9Bnz/DSxRw13ROpxF9Oh15nsAiFGsXEASjagIxCY0gwITlL/41/pZjnVPraCvBH 9I8CKpgyuvmiQUn8D+06133TfStTYz+ItgT0HXeLG6ujLOovi2TOpbp+VsKuOT4xj6iR Qw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnrbb7aq3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:14 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTHiiU9034234; Thu, 29 Dec 2022 19:02:13 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv6s0m2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U2PyG1sx/iJmHDGzD+d9eubdbRVzJuvs5T4Okwy32XgUS9jy+UfmGMTHg9IFfZlr7/14ZG+mxvbYjCORi/E0EmlwkOslwuisi4xztZ2c+kXlpX83+e1BbnCSlgUyHGMUW0z2t70APkidVZY3ErDZHeny/wbUJ2jORbi9NVJmWSFe/Cyc1/l7Jjf2sCehMOTBE+EVhUExji2Et/lQ+bU2abh2LKxBNbKAkQHwTShsW1tou5bj2yzZtdFuV0BPnJ+Sb1E//Zk3i9UGifRO1lOVeTOr8vQPkd2gqxTijzoHYkC/VcVSJtszcqN+Xe+xQNJf389V85MZxAmxu5Jr7xq0dw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eOjPBHj/Sn1oef3lbaZ8B5YOqX59BGSGW8yjUU7cum8=; b=P6gzkdb7u+BE4gnVwPWHwJjn6p9KppXnki+37Iayn7RxCPuyP5OqamWLkGQc3FSI011LeAK7TnA7tPl3YBPM4JC7yKVESJ/tmVNnVE/VL9XatFcs5yTNzKr368cPKbPYeViXC2PNYjucq/lg8LEhPWHQ3b7m4O6PregNWip1sKdV2xpnBrfXsg52dEOCnDC/dOvXeEYhuNQHd4QeE0rc9h4yK94OdYCoaBdJyeeunSn2pRiwiOjSDXe+cP5EEYnwYw01lQpVB6iCQtMcczeh59npz6NiKw0QX5sb/AKrcgS0qFoeNb3Q5a8nKFVGO7i0ePumS+XUErAgVEVGKb1gNw== 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=eOjPBHj/Sn1oef3lbaZ8B5YOqX59BGSGW8yjUU7cum8=; b=D4WXsaOVpLDZQ/xeW7QBzCGe5JZKETFhxbvXmi55DqskhuvOe7WKzObm+rTQhLlxqb30QfiyBO+Q9hNNyEP+a1FyxOKY/Re+8FJO38VKLii2IFNuHZ1AHWqvO4armzvyHbbvATBBtiBOpSmhMOEgc/vli/ENBOLymLwbFBJDu+o= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:10 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:10 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 08/15] scsi: sd: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:47 -0600 Message-Id: <20221229190154.7467-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0016.namprd20.prod.outlook.com (2603:10b6:610:58::26) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 4778ef92-05ce-46eb-aaff-08dae9cf3059 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J8rAUrGpH+26s8hHMySS2ieMOVjOrjWy2R/rccCdcZDvwVK8hMOBGnXHJDulZ45Cz6MdrY0qmlW+s26YiSVi7ER6giL1knHzz/OGZ5cudlc3q4jzWNq2aHYdPTMXf01UBEj7pCjyAmzqkoQgGhMm/pNG44bOS9dYi58qfBKDX1wZJtdPx64mzNy3BrPvoFjLycdptafmBuJGkN5gLBH1lB0qlzctbUFAWaOHXhGQrW234ZZNFtSS8W3oLZjh4v15pHgwcu+rfZlLSx44OQvi9FnIy9E8XFrOS2A/lcwLcw6q9vIkp58X3iCPaN0FqyuDNXr5UaAaw4YrhZuQKv7yssDxfazIkBAML/DdEOSfYUXWcQinEslbY1hv++nlnXO8jmUL+lYtJLivyaud8Tg4S1q9dtMP8um1NqTAilEEqEw5KQa4wBE2Vat7k/CXW3uEXTWn0hHzgq2v6zRL990wR2rEQLEUCsjsW4OzANefDmX8dqqzvYfdHZ90X1Fd5id9XulLEM9oOdoXa9KQ/FI4QjP7qUuzx3hcWaa1MP9bzHkD30rjC8jdZJlKX4kQKeJEc6MMST+cmTDVS2f5pPKteYqYDEcBtMe7v8lqRHTGYyYUkXLPl9/bu3nxfY/5lNro/jaiOiMAiIFvHAkxTV9p3A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /eRS+bFBZpsjyj8XH4HGp9VQJ8zbf092VarG3XunpVDltjEA3wHThKy6p/bP81HX9ZW0xWPPYU8z7++D10OJ8rD5P3CVW3fl+rRaUiCU6sZAaIIZWbgWIifXXGrGTAjRDOuWIEprXDq0A0NRs6VVwJjrpQ55OZ35YJy+a4RWbujd2z2dW/0eWiSb0Q9E1IN0gKFvy1g4nbsCXCCrH5iOqCBuBB2B+72G5dfhSffEBTyQ8hE0kJjwTK+mAUn1hGP+nES1vrGX4DY9RgFpCcj9t6d5wfZwsZ1xc58tN5RBzsDCmceUKfieblhDx2uSYDcWcWduhH5SCCqaugHjCADwsjoMMXwALq82ph38RBEj66kPp2ZGoCm9WnJlu0EKy3vCZdogDfTnjBqYSa+K/4uq5cPFetKZZGsxzk8t60QMjnc725GHeP5vAG+maAIXz0wsfKhNLlAvxKGb42x08CQL2WF39QSF2dgiVJaELrtS2K3CUVKXV9MPctMZ1si6tedJsky8ypyvzQA4eNFiTqgO15gWRooCjfom6s8PqJaTvdJUoQfYXJetrm2aK7sE1O9DCiyCNMyEsFPjuM2xzbOQlbKLqBoXK+bTqeiz9FVcLq9fMTw64bNNh1mpM0IFxy7PKMl/8BHVcpLAeIA8ZFTqEm2V0C+DXsjk+XgBFB0ADLvBhSjJ6khC0MkqMWD9GCkr4Xp7Gcx0aA6JAXa8OoCX66vOe5oNicIp7Yx1/oFpsTahi6YgADVcTWzIOznPpeYs1t0/JvCtrg6lWjwczWWr5a5Xs7J+cn3TvzrTfJDHPz3ZdaF17KDnURWKZRXeZLowS/lWKGwZvos7/hhthYdhJHUGZQEsCTFW2H3j16H9zFPDiT1dR0DQUGzSXxJihcm4z+VzKz0zAN1IwhVnL6+9dwXlAbbOq13/XZ5KTIB9SjTB1Chkd4OcK6LTNGo5rHpINsnC5jjyK9o1vf9Q757BqYRn1IIfZjzJZi5l2dcZoUTBJoxe0phvMbYL+efZh6FVgZdKSxJOUVQelpp44xfA9H9WXfh+sWf7reSb0J6gDU2zw+Sg2QQbpNYK77twHXDAQu+e6SC6A6VuOA2MDCZKXpZpoPCFrWdzZPBQnjxz5ypmlM2Pv3NlKpnTKsFzTYf/9XyY1KPBbea7MXiyfrGGBLHrQIBvBwzYfExoXcXmfmAG6XGeDP8iZ74DNtR0LuYfF6htIhjNRX9a5PAKVJSGJBTObmHWBUlBUbvQnbMi/4Yf2rizsBKysqR7gQ6zO6LxptintsJwyDZMeSJ13a1FouA6hu385cwkTuHqn5N01q1A7uU1tBBckdTB81CUDqwNg3rj/Qc1rwobHFFPfvMl9rhmvyQ0e17+YJAxaoseWuId/bxWVnFhZ8bjDEgLctEhf7xlSoiAIwR2/ETS7M/nDIsrncXY5uc95oB/v5Okh5Nnur0oZMu3cAy5Ebgxgyjh04QQu49RDbb8awxEBQLES6uItn5KfP3n/d3r/x6/LIa0l456rYRqwcOBE3G4tq7zLCf8+DZRxwVbT3MlFS78SgXrYa7vKjPj+6FqS50qu1hEi369nOUqzmmtJSVC419Q56FlAyMSz0zf4aqcZ7Wsxg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4778ef92-05ce-46eb-aaff-08dae9cf3059 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:10.6281 (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: 6ewz8ue5HnOJUtGzjW8PrJK1dEsZV4Lr2eaFHy7MZCChCDqnVkbK0r0Pp/9p2paWPeXRPAUXhmPgf/ppibKWoWsEBwRG3sLR15cwwYp0pjU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: nqI4SwJVQdLdkGC3n3SI6aVYwUREx7f6 X-Proofpoint-ORIG-GUID: nqI4SwJVQdLdkGC3n3SI6aVYwUREx7f6 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert sd_mod to use scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig --- drivers/scsi/sd.c | 83 +++++++++++++++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 28 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 47dafe6b8a66..2aa3b0393b96 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -664,6 +664,9 @@ static int sd_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, struct scsi_disk *sdkp = data; struct scsi_device *sdev = sdkp->device; u8 cdb[12] = { 0, }; + const struct scsi_exec_args exec_args = { + .req_flags = BLK_MQ_REQ_PM, + }; int ret; cdb[0] = send ? SECURITY_PROTOCOL_OUT : SECURITY_PROTOCOL_IN; @@ -671,9 +674,9 @@ static int sd_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, put_unaligned_be16(spsp, &cdb[2]); put_unaligned_be32(len, &cdb[6]); - ret = scsi_execute(sdev, cdb, send ? DMA_TO_DEVICE : DMA_FROM_DEVICE, - buffer, len, NULL, NULL, SD_TIMEOUT, sdkp->max_retries, 0, - RQF_PM, NULL); + ret = scsi_execute_cmd(sdev, cdb, send ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, + buffer, len, SD_TIMEOUT, sdkp->max_retries, + &exec_args); return ret <= 0 ? ret : -EIO; } #endif /* CONFIG_BLK_SED_OPAL */ @@ -1583,13 +1586,16 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) const int timeout = sdp->request_queue->rq_timeout * SD_FLUSH_TIMEOUT_MULTIPLIER; struct scsi_sense_hdr my_sshdr; + const struct scsi_exec_args exec_args = { + .req_flags = BLK_MQ_REQ_PM, + /* caller might not be interested in sense, but we need it */ + .sshdr = sshdr ? : &my_sshdr, + }; if (!scsi_device_online(sdp)) return -ENODEV; - /* caller might not be interested in sense, but we need it */ - if (!sshdr) - sshdr = &my_sshdr; + sshdr = exec_args.sshdr; for (retries = 3; retries > 0; --retries) { unsigned char cmd[16] = { 0 }; @@ -1602,8 +1608,8 @@ static int sd_sync_cache(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr) * Leave the rest of the command zero to indicate * flush everything. */ - res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, sshdr, - timeout, sdkp->max_retries, 0, RQF_PM, NULL); + res = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, NULL, 0, + timeout, sdkp->max_retries, &exec_args); if (res == 0) break; } @@ -1745,6 +1751,9 @@ static int sd_pr_command(struct block_device *bdev, u8 sa, struct scsi_disk *sdkp = scsi_disk(bdev->bd_disk); struct scsi_device *sdev = sdkp->device; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int result; u8 cmd[16] = { 0, }; u8 data[24] = { 0, }; @@ -1758,8 +1767,9 @@ static int sd_pr_command(struct block_device *bdev, u8 sa, put_unaligned_be64(sa_key, &data[8]); data[20] = flags; - result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, &data, sizeof(data), - &sshdr, SD_TIMEOUT, sdkp->max_retries, NULL); + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_OUT, &data, + sizeof(data), SD_TIMEOUT, sdkp->max_retries, + &exec_args); if (scsi_status_is_check_condition(result) && scsi_sense_valid(&sshdr)) { @@ -2088,6 +2098,9 @@ sd_spinup_disk(struct scsi_disk *sdkp) int retries, spintime; unsigned int the_result; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int sense_valid = 0; spintime = 0; @@ -2103,10 +2116,11 @@ sd_spinup_disk(struct scsi_disk *sdkp) cmd[0] = TEST_UNIT_READY; memset((void *) &cmd[1], 0, 9); - the_result = scsi_execute_req(sdkp->device, cmd, - DMA_NONE, NULL, 0, - &sshdr, SD_TIMEOUT, - sdkp->max_retries, NULL); + the_result = scsi_execute_cmd(sdkp->device, cmd, + REQ_OP_DRV_IN, NULL, 0, + SD_TIMEOUT, + sdkp->max_retries, + &exec_args); /* * If the drive has indicated to us that it @@ -2163,10 +2177,10 @@ sd_spinup_disk(struct scsi_disk *sdkp) cmd[4] = 1; /* Start spin cycle */ if (sdkp->device->start_stop_pwr_cond) cmd[4] |= 1 << 4; - scsi_execute_req(sdkp->device, cmd, DMA_NONE, - NULL, 0, &sshdr, + scsi_execute_cmd(sdkp->device, cmd, + REQ_OP_DRV_IN, NULL, 0, SD_TIMEOUT, sdkp->max_retries, - NULL); + &exec_args); spintime_expire = jiffies + 100 * HZ; spintime = 1; } @@ -2296,6 +2310,9 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, { unsigned char cmd[16]; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int sense_valid = 0; int the_result; int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET; @@ -2313,9 +2330,9 @@ static int read_capacity_16(struct scsi_disk *sdkp, struct scsi_device *sdp, cmd[13] = RC16_LEN; memset(buffer, 0, RC16_LEN); - the_result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE, - buffer, RC16_LEN, &sshdr, - SD_TIMEOUT, sdkp->max_retries, NULL); + the_result = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, + buffer, RC16_LEN, SD_TIMEOUT, + sdkp->max_retries, &exec_args); if (media_not_present(sdkp, &sshdr)) return -ENODEV; @@ -2387,6 +2404,9 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, { unsigned char cmd[16]; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int sense_valid = 0; int the_result; int retries = 3, reset_retries = READ_CAPACITY_RETRIES_ON_RESET; @@ -2398,9 +2418,9 @@ static int read_capacity_10(struct scsi_disk *sdkp, struct scsi_device *sdp, memset(&cmd[1], 0, 9); memset(buffer, 0, 8); - the_result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE, - buffer, 8, &sshdr, - SD_TIMEOUT, sdkp->max_retries, NULL); + the_result = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, buffer, + 8, SD_TIMEOUT, sdkp->max_retries, + &exec_args); if (media_not_present(sdkp, &sshdr)) return -ENODEV; @@ -3637,6 +3657,10 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start) { unsigned char cmd[6] = { START_STOP }; /* START_VALID */ struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + .req_flags = BLK_MQ_REQ_PM, + }; struct scsi_device *sdp = sdkp->device; int res; @@ -3649,8 +3673,8 @@ static int sd_start_stop_device(struct scsi_disk *sdkp, int start) if (!scsi_device_online(sdp)) return -ENODEV; - res = scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, &sshdr, - SD_TIMEOUT, sdkp->max_retries, 0, RQF_PM, NULL); + res = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, NULL, 0, SD_TIMEOUT, + sdkp->max_retries, &exec_args); if (res) { sd_print_result(sdkp, "Start/Stop Unit failed", res); if (res > 0 && scsi_sense_valid(&sshdr)) { @@ -3790,10 +3814,13 @@ static int sd_resume_runtime(struct device *dev) if (sdp->ignore_media_change) { /* clear the device's sense data */ static const u8 cmd[10] = { REQUEST_SENSE }; + const struct scsi_exec_args exec_args = { + .req_flags = BLK_MQ_REQ_PM, + }; - if (scsi_execute(sdp, cmd, DMA_NONE, NULL, 0, NULL, - NULL, sdp->request_queue->rq_timeout, 1, 0, - RQF_PM, NULL)) + if (scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, NULL, 0, + sdp->request_queue->rq_timeout, 1, + &exec_args)) sd_printk(KERN_NOTICE, sdkp, "Failed to clear sense data\n"); } From patchwork Thu Dec 29 19:01:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083708 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C8DCC3DA79 for ; Thu, 29 Dec 2022 19:04:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233907AbiL2TEa (ORCPT ); Thu, 29 Dec 2022 14:04:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233651AbiL2TE2 (ORCPT ); Thu, 29 Dec 2022 14:04:28 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5197E13EB7 for ; Thu, 29 Dec 2022 11:04:27 -0800 (PST) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxJgR002285; Thu, 29 Dec 2022 19:02:16 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-2022-7-12; bh=h8UV6YWruBfiRIztZ/CbSAO78+wxDQYMR8ptCya1mVE=; b=FpXn4LeRpka0DHTG/be5r4qPizXFH7g5PDoIessKqNR6BIRCYKFHtGTW3tjIaSGqd+ow VPmrshGG+72+3fOll6YSxLCo0cjTQzaZaSGicE0ex+vYcIxtt4+J318qpgwe6S5jvAyJ Ft9exP0RiBTgZUGJAuRpxDwnnaN8mUSBnwdsniV8BmlNJpL0auWJih4kAwSkgl0nk4yr SfhxuACfJlKYbY0qfFWotzVh0l7yin+NFfTEvkA3QCZASVql/OwOalZfQFTfnhoXBoMP /ACYjcuir4Kfl8bPJFe+hhb3Njr13enjVhmqm13oY7Zfb7fmM9G+wN86ppqFkN5fRGj0 Hg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnsfcfa8b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:16 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTH7LYl020403; Thu, 29 Dec 2022 19:02:15 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2046.outbound.protection.outlook.com [104.47.51.46]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv77kdj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X1YX8B3HqTFgigHZVz8SAk1hpyBsYwhxTfFjJPdsCY7nuSkEW0lflvx4vQNz7mB5zCAI8kbWFSMZ+ZedfHCAn+12YYYNHjJ9Wq3cZoyEBwoXpP2Zu5DZ5Wcf9DAWy849aVYksoqC9vcV6HzjAlpXVjTA7NT79nVrf4U8ytztUlnwqXc9mSMcg28/EnBKPMR6y//ao+gaLJdVRtDXTXqUCC8t8SrTUHy+Ev5ImE9Xd8plHekIL30HLIE46xhLSB8sb6T/3upcS1lChlCn9sLZfRFTZWpsNx2eyZLqIMBT1xVxCQXVxlPybZnPEDhV8Q2mSkPKX6GcTaY3E9XFOCZibg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h8UV6YWruBfiRIztZ/CbSAO78+wxDQYMR8ptCya1mVE=; b=QSeDerSX48Sbw5RUkosHCbO99/RmMl2BFLjkcNx5la4sJb/8BsAev1QSDf/yuDFB+hrMMdF4RL/xD8gQwj3/OUOSmPOA85VHIqgkNEn/8b867EVhkenISFB88taczz35x5E1cclDdkrb6a0HglE01fz/4GL2n9K4JOfpUi713SVRS0Ol+sqmgwTIlaHgMMYhUU4sTzfVzmWdMH4hWu7wL0d6tXOdthh8RDA76D4JiC41gVTUoJJn6USjuUCcci0OEMPmKKCchExq2wyBMi7yCFhihQEVb+d5TcWKXg9OnnfAbG6Kl1m8fEQUViNHGDaek7+l/KfDFJVhlWu7J8MOTw== 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=h8UV6YWruBfiRIztZ/CbSAO78+wxDQYMR8ptCya1mVE=; b=HcQYx3RuasnfOAkEWTU8fwwIDwv6vK6nL2JGMAT50AT7L6YkC0eInqLyuKHbT2sl2MyfJR2SW26/3IJYaJqSELtKrMuvxqzRAfObe7smWrrcqDFOu20VRIFj0a4AsTM2wfvR+LSeR+VDQ6CV7DpMGWygGjVqn+kcCBUoZ3lcIp8= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:13 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:12 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 09/15] scsi: zbc: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:48 -0600 Message-Id: <20221229190154.7467-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0021.namprd20.prod.outlook.com (2603:10b6:610:58::31) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 7806ee8c-a1e4-4079-37ed-08dae9cf314f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rb+x94fxkMv1fX3SZWLxfIn5eaFcQXRwLPn246AxrHQnsSu8tfw8AFLKTpjGpGMbe+Q6IAek4aFMaB9IB/hMQN7dXJD43Ffxdvv8FTSNqXjChaH8yhAux1P3mumtVofnqH8qjGce+JakEW34Ze/tvRkJbUw4CtAzKmzQ78Qlq9qaYU14MOUuvEtvku4NP1doWczyYD9t3qNEcoK1saKDzcAYA2XKQ+PDgym8yHNjOgq1+wD4H3jcTHwii2Ci4v0gCE56DRPOHTlpMlVPcVyAxuCVRPao8WTDCo7XJioFAXFYi4z0BejFgc1puc7BeiAZR51fCYfFvfjjsuxdxAtNSYYFdaQxrVHJV1NJ4wWhCY5TfGs7jFF8shoNyq1akFzllqkUAQYmIYqGXQhdY7lTd5/Gki5r6aO1X2utOziJpg9ihoaOv/zu4lPu0a9UmFVhrgjb5u/xy/txKM1uEz39j62Ocyrbuem65F5XFP4khkvBmPpZsFQBjJkKbpfNH6EqdNAvOkixbR9ZDsX3CTMVt6FDi8ya7JY4JGREXSbyjc1ChNy9e34n8UZGPdAFtXHQhY97lFuBgkHaKzXaSiurWxFfiez+gL8lKyClvZ2WHgkMwZ2rhUzfdKNSvGDqwFxjIlfB8fkgxzNngAPcJ6solQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TeCyGuJgciNcwL1xaRvi0vqVnUETIirzwUChU7HV49tN/FGN1z1rlnAHz2O6QUMUaZU1X+Z2iX58yQXhbhqnqneksqSGmXGrhSIR9GyXWL0/FqTGedKJNDONqjuvkS6EvGe6hWTyM/784O5kR5zDYGOewGRRXd1W8gQfTpL2O7J/E8cWTOWo99BHg7bQ9XKTEeXOpqif2sj8hPPM3NdaNo/DgDBkNn/nAlyMtish7DPrOb4PDtN7IgvK+j82Mv0kYQQfHP3WaFG4OOSw1sf/nA6Pk1UNiw+G1MHaqG3U6XZqaBzSQLiT38wZt6WI3qIIsn1NbjQDSFKMl2FyFL1IXDmIizXen4iFzuPpTUTUfrPmrG4lnVaRLP5Sa6jM3rxfasOJkr6svRSxxj2+xmpvQYhpBDm1C//UvgQdGwHYL7iJVkLxilYrwkfnFuRdXj2SDmCX47Q1OK6H/7eJFZ4IyOa/pS1LA+AG6I4o4Pv0ZRH7g4A7Xxlg9CPeWBpdwJqJQ/poLNaA/hc1oVAIIM2NuLI7M9wYUe+YJmntj979tpGko/tNN4Orl8yk3nq8NHKc5ZX52A4Y9lDGCFIxOC17I58kWpTIQt60nxOwGEvB1zKj79S2L+Hm26GGAxfaA3S6H1llckP/bK3V+3Drpe98TR4PHHQZVQW2gCiqTaPUgHZ4z3KH3NiGhrRYpRv4HyM82w0aNeVIBQcagXF8y3LJJc4tunKMIdjYCewW9XHHQP5SIg8ZUPfTjCIM6JEUeySmiM/aQAVQ7wrbgkmxfrt4RliiOp/oXD1/Xb/s5ZgDVdBlNb9XtmLwUmZoYNHTvBbd49dDMerRcpPe1gsBQLBKgdY61ctQAfXW6Hnu/CVMJ6/jjmxNI/ItLcBJI7TuqogpKbqq3/nCu/9M//tmg8Hl0N24SAhr31glczfxPVV2DEdX3Q5Zw+wx6Xo+BPvgvOzGsOZLrbwLnFo4WHyTylVq5yZwd6rvPItSxdGMi3D3b0qgsZLu655wtG823K0DKMDtOx251M1ZCS+S7881Q59d6lO+UrDzMArKuJBUwlwLFatg4twl2b1e8ZRpMpjco+gZuinJI9COxGmtrDnvo6OQzGh4mqiU+w/07CeVpLamNS+aUTt7YDTzH6dfnxQvodAbrXv63LxO0oFfrkGJAU2yHaZOkacL5WBC2fgpoCFu1o54geh+nYPpfgSQeyX2EpdxG61ZBHUCJkpOEs/FKh8obwrgCr5ElR9BnewNRK8bADmHMcJVa3hx3qQy19DmIqqZGoUbbtcvlG6kHvxULTIdEx4RAjy3/PnPZIkNYAhHS/4a3GS3O3IlQ01yHK/E6bUo1zn8a5klkS5m25Y06objbPYWPvnKGlbXMva/rdrdGPuwmwo6QFfnn2NB2KnU69g7LI2EzQWcBbuAWREKqiBmtrDUCarWbBU6AS4ismxq0Sjw6dABGHRMeg1XrtVvXcqAikPyGpxlu4G2oUoUNDMC9jTz33P4rj+MnxBVKAL8YcDhY4cJZ+42kQW8N27bUd6MIgZsz202JvcSzEQO3CLwQ8sjKsIl/ZCzPe0uRjQC6dXsNp7pNPuTMwgzIVoAuSDgRlrsBdlhz3Rd061Hy3ltXA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7806ee8c-a1e4-4079-37ed-08dae9cf314f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:12.2529 (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: CV8kyifwjSxpiFa2lwwJTWl+wKazPSFk8JykBeA8195d5LVQHsWsCALBahfv+3toKkDfWgAUs4eOqq3sJmFFi8c7hfhG/FOIn8OYbUwwHBk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 mlxscore=0 bulkscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: wDzcTuOPSiqBPBpeItDumJMqyCf7baOM X-Proofpoint-ORIG-GUID: wDzcTuOPSiqBPBpeItDumJMqyCf7baOM Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Conver zbc to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig --- drivers/scsi/sd_zbc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 62abebbaf2e7..6b3a02d4406c 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -148,6 +148,9 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf, struct scsi_device *sdp = sdkp->device; const int timeout = sdp->request_queue->rq_timeout; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; unsigned char cmd[16]; unsigned int rep_len; int result; @@ -160,9 +163,8 @@ static int sd_zbc_do_report_zones(struct scsi_disk *sdkp, unsigned char *buf, if (partial) cmd[14] = ZBC_REPORT_ZONE_PARTIAL; - result = scsi_execute_req(sdp, cmd, DMA_FROM_DEVICE, - buf, buflen, &sshdr, - timeout, SD_MAX_RETRIES, NULL); + result = scsi_execute_cmd(sdp, cmd, REQ_OP_DRV_IN, buf, buflen, + timeout, SD_MAX_RETRIES, &exec_args); if (result) { sd_printk(KERN_ERR, sdkp, "REPORT ZONES start lba %llu failed\n", lba); From patchwork Thu Dec 29 19:01:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D53A9C4332F for ; Thu, 29 Dec 2022 19:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233913AbiL2TEf (ORCPT ); Thu, 29 Dec 2022 14:04:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233841AbiL2TE3 (ORCPT ); Thu, 29 Dec 2022 14:04:29 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86D3814028 for ; Thu, 29 Dec 2022 11:04:27 -0800 (PST) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxKkK014126; Thu, 29 Dec 2022 19:02:17 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-2022-7-12; bh=4odf1ftkPYdTztf8BKOtCtqg7LfyAZ7pMtAdPXHa1g8=; b=qDpAoZSZUYTJTtgGDuvHqxix/7liyfIdLwc4FvDHUFJBa/W7TaeaLqFj33w2p1OT3Oyv UcUq0zW2xaVrTbPYtYpTGh+/M0gMZSYS2vNbVtzHUcLh+2vZPIAxZQNiRCSBr848p0Z7 kA0S0s1xQ//0QkUmewqQYGrzjg+XtG7f2I/lIvgcfivz8XdWZ0/pbXHK5ZPLppAuJap/ bHohGOmZpCkyuvvRzytlUeIBYGjAA5lqR5hQj/pWQ9yq3YEkDUMY8pjdAOPXxckw5NXR H+yeWcd01t3uROwVrYmgjN+rCQ5OiLZEKJ0IXuHhMaCRlr4je8/1T/z4ZMaN9u9ujs6D sw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnsaa76sp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:16 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTH7LYm020403; Thu, 29 Dec 2022 19:02:16 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2046.outbound.protection.outlook.com [104.47.51.46]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv77kdj-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mq7mzdtF18DsGVrwrZv2vmRXSYgUPFBPG5v+UOI/t3G6Nu4aI/WjxpKeQdl0HP44vbt+q7b0rNt6+eWbrTS4UV2p6L9QRPQFpnXu+b4HfHaY6bXy7h/SEErwxkQhHE7ue7ou2PNWoarCGwslBCjbsao54jClj4bod+FsIg9woyp89iUfys9MFNcu2uZfwrZvpjgyNZlvBJjmYmYz5Co9rwUidnWUsOlN1SO0IgxF6lbmaRaokfPeGYpr+DDotIBDkB++nTux7io+AVH12mj3E9T2Z80uuhf7EJbQ3IuwwqJfNy7Xu+D3dORUKVIX1Hk2ZJO/ACyzGzNVV5t/LhOwGg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4odf1ftkPYdTztf8BKOtCtqg7LfyAZ7pMtAdPXHa1g8=; b=NMgv2+VmXzHKrAEMvKjtvCXb1UwTDGXwn15kBsQIzpPP8FWmp8DWYwFxY5jb12SMLSY5haKqzMVKFPLOp+dz4Q1iXCDKYHMqppGZDmbAuQmpH8VmW90tILA+tW0oZrTkX5wSuQ3PC6wVTOPyo+lmQRXkY+0JvaPqtU3QCzemayPt+HSP904CP5vg9TVgRjglJCxS8OFv1pyBADjLIFyKmnSuENiD+X8VhxN01wfWtAdS+BDow/heleytEXDGJ5Qd151ZE96HnATeBqEaj2D1i29ChbzejdIqKJcL6bcEMNTPq5vmatoZmV5zoE/P6o0YuIt7MCYhuQ7/ZtSVOnn++g== 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=4odf1ftkPYdTztf8BKOtCtqg7LfyAZ7pMtAdPXHa1g8=; b=twbc9oXs2CP/mabXYDEXEqmkVxl8sWBZh+Oc61ulIXRwnWZfSDPbb5xUNKmsmGWk0IaX+kiVHEmJgVyO4mnzDHtmtYzToIZDa/B4FeL7FpsPtBYp+hj9+pOwwbbvmBWlnDSNnaRrro3/aqsvOk2YHLPVXFVTAsnTqdiYKFX93XQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:13 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:13 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 10/15] scsi: ses: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:49 -0600 Message-Id: <20221229190154.7467-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0005.namprd20.prod.outlook.com (2603:10b6:610:58::15) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: d8ccd92e-1a2d-4868-3ba3-08dae9cf323b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +4cqZsa3s5lZkgnUsy7Od6FSzrEyMmlmS9uewiu98nJPJpegGdaT6/aA+J0N4kocIQfA5W8eUkBqcsu4PYCRqRL8HjUsdS+aeO9jr2hP9j14ZrTc6OL9+tsF2YGX6Xzh2h/hkpwWfJjdWNem9oCN97IYQuwYxJ84vy/4/iir7I0oPvA6e4HXB89azze9ilmBOecwzF2jc6LgihjtxhMAHaz3Q1KvWbMzOptm6kUgYiVTuL8L4K6AxJca22KnsvtY6BPlxdH8ipeeeF7imYXpLgBvFlokMhjC6Kf3LiYLaT38TRcA3U6UbGlRfRcH71gzqUHC9XVdlWnj5PrrVbKbH9LMQ4uTZmsF1tkY/7DYbJbzWPukPzrwa9UjeaHhncc1wA0ZcPzCS93lZTBsmOAu+qNaXdHCU7u756fV86omiNPl8qTKm/7aRpUTRH7eZ56iY7maniC9v2Q3lLi4EA+VT7wXxc+cL1D5ej0pWp0ktwOjiA3kgit953+vSBFSHkPyhooohsik9eNAMLvp5reBS7HL4kB5V6QyILVJmu2w1dxPoyqj6sqDWzvyU8ldg8yAmhcQzHkPhpZNrOZfGyqV6ZSPPaqCSGM1erVliMi6DhzbssfBzTwjnUvNpIYET3ViSU5IoLtYgV/Bd40gHVWl0g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CHdE0ZlN2TsAHvGf/OHoE8hicE8lTmvrCwF5ZDe31HB65B25fKSmOC5kH/5Kr5wbd+rZkT10G74zvlhplbSc/TWDlbm52ZfJzNhVaJT6awbZOPhOIu6CcQeWle3Jv79zem27XRe7TYpypRqkjlWPXwPHJnbX/qxaum2SIRBLal/HTK/CpjJ1mJDVitkqNxezuuzJyq/XtxBPbFEboFh/cj1hDKM+YPhrSIYuwwKupSB6HRNkNQ22Pt7/zTBmBVsOGfOT33x3/E0TwTE1LDXNXXhYDgyd49WBO+/i8Q5hG0domaw28+4kiSdaZ1HmDZq673wbPp1qDbwFMqKs9K39FI+2dbnhTbQrupIK1gRnZZeet9t/1Qf9C1vcoc6NPnE2DdgDyoHmOlwnThYEDaKdhWF4kEAsjlAyahMMTZmYoCKN6CLRhwCNk+Ju6wRsNwrdpo5Gp7LLLNtDXq/stL6aHO/eFhz+XBKbLy8/Dps8EkFf27vD9M/PwcCNXUyRgYQaTLW9s3gXkehAPEsRIzlKHRXmoTJtWsTEoNdFPMTzDnZ/7HUvexwzAIhpNy1PQ7LipI5jAYF/yQ5/1xz/5JjhkuDB59YphkZGf+OEbSmpkK9uXpplhEFFFeiaoItefyFdMzXOfsykLwCNeR1EOb60nqvJCP7RODHKsTQgcKyQN2mdF+6NYcCWF+Dkmaok6C6Ts5x7NJ8CEZU0fbTAk5L3HFZPXguUkpx7T+i3LxLJ7e0GADvQA4NhfqI04T6WHRWBifJ2pkUYlbE7opY216unZM1T+BDGgP+cpGVQ9L4TdVlj7T/vz2BSEAMN+BDKMiyagARNC4roE0w7Zi5tcy9BbYmmPwJCpnTgGkWSz5RZbDcg2ANS5lPJdWrSldQjPloGW1lNFmc0hTpZMDZn997D1QnJSVJMtqXuuwsj/f0j+cRosJXRp6inEqoyor5V79fkydgAyKNd7EnF9PdVs+3FdPuWFVr8u17oqXTybXbYPBpjvZ3/M9AJkeqWM4Wpwdw6noIFwfLa8kEEL0/dp9nUO7eXJvGKWR8zmI2Jj07JLal/UKzh+TepPXHOndJVihKOwf4Zd8UPz3LUBTG7TNMefb5k39VIFlnfjUHFKKqJmMJi9hFyC6qzNMw1+J2bT4PeIuKHThLdamswYuMKUYp2eakcTw/a/1Ntvnq4ONF0CwlXGFid/zwDuGKHvlqPsjeFDMkG7WjBpr7HBnEuamyayW10BRE2sFx9TsYDJdenHcLmzGqbCEvq67qc/x4e4JwVk8a174SKc4pM/B2ODHKAxcYdK3aIl9M6tepOkElOxOXFJxCAbHyVC+L9ZrBQT8q/I9QwqHFCBkNfpMvV21ATlODqZXLd4v4SfMPrvJWir+eC5/M8azk81/06W9cEEIQRG6l37OZyf68mzZeDYVElo7Z6KISzCYn493o5VPttuUG/sKCU1+EsUvtyZ/I1wxugtWfk5adFeNtICK2WcLwOYw/dgnl76sKLcOCPPiVrpZsBdc29fFnSG4R3ln/3DgEVSwLLHqMYLk4dvOfNZRQNkwsUIFPFL7AgJnetet9DUcPp0QLKrMs8PtYTTVK/qmzl5JVWKga1kaMO2gdcnoO/BQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8ccd92e-1a2d-4868-3ba3-08dae9cf323b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:13.7528 (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: /uvP5hvskXeU1o0U2ubB741qaaH72e/xvR7stDNGYeRNFoJxHFEgyzR2qRA8KD+L7HYo2cZ4tShsPJDZj+MIGEyB+zFl2vAlgOwavZiARqU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 mlxscore=0 bulkscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: E2-Uyv8EGBrSZ2id9F2EWKvldXbLwXYq X-Proofpoint-ORIG-GUID: E2-Uyv8EGBrSZ2id9F2EWKvldXbLwXYq Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert ses to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/ses.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c index 0a1734f34587..869ca9c7f23f 100644 --- a/drivers/scsi/ses.c +++ b/drivers/scsi/ses.c @@ -89,10 +89,13 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code, unsigned char recv_page_code; unsigned int retries = SES_RETRIES; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; do { - ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen, - &sshdr, SES_TIMEOUT, 1, NULL); + ret = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buf, bufflen, + SES_TIMEOUT, 1, &exec_args); } while (ret > 0 && --retries && scsi_sense_valid(&sshdr) && (sshdr.sense_key == NOT_READY || (sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29))); @@ -130,10 +133,13 @@ static int ses_send_diag(struct scsi_device *sdev, int page_code, }; struct scsi_sense_hdr sshdr; unsigned int retries = SES_RETRIES; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; do { - result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, buf, bufflen, - &sshdr, SES_TIMEOUT, 1, NULL); + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_OUT, buf, + bufflen, SES_TIMEOUT, 1, &exec_args); } while (result > 0 && --retries && scsi_sense_valid(&sshdr) && (sshdr.sense_key == NOT_READY || (sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29))); From patchwork Thu Dec 29 19:01:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0269FC3DA79 for ; Thu, 29 Dec 2022 19:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233935AbiL2TEh (ORCPT ); Thu, 29 Dec 2022 14:04:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233856AbiL2TE3 (ORCPT ); Thu, 29 Dec 2022 14:04:29 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 061F814024 for ; Thu, 29 Dec 2022 11:04:27 -0800 (PST) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxEB8002266; Thu, 29 Dec 2022 19:02:18 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-2022-7-12; bh=jcOOF2gJCkC4Gp8uSwowQzR1cQCS5+tCQtNQQOYhrsM=; b=BhkU4RGM/6/90kh6ezNU/n2BpuGc6fSvmW1E71Grx56379CrrcjGN8c2i4IkMyKG30aF 3eicqQ4P+Tj2PMvR1EnrOtYqlXpLIwnNxun17QcZqC/UCR94wyZHlCmjDPIiRe4evKOC B9chhTELTPUZiOqv1eO0vIMt2VC61TKWN6J+OKb8puA2qco9gRVM9kVzxzM/OZiutkqn mXULd/xAySSTkpS9hmmJsdVZr9kE1vRxDmJqoRAmlOGfeyfCBfkQRkqczcTQ5wzZmHaT Z/GuobrupcQGbh0WHsvE4EZriRWtiDSNXCp1yyFV7b0K/vJQtCCZt+/CiTWG2nhiJ1wJ wA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnsfcfa8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:17 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTI72c4001350; Thu, 29 Dec 2022 19:02:17 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2043.outbound.protection.outlook.com [104.47.51.43]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv798ak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DYuwO1ANoYTsB3v1LNYY6GMLR+HLUwmmyv3WJkfMhPQEzYTW42XhO2B8T8A8AwLIEDaR/wSuYzoFSOMYgy0HbZFtamMcCDABz6L4FSsX6hyafoTOQP6wIx5dcxeQSKR0c5eZ1YBnluKp5cPRCYAGWhv+y4B0gqZgyjPYqWRPodYPboaVSOukrU7K9nU3HqADxNrlCsDwdHz8CSXGTAJ/YVClqn95nByK5Kxbk64fQQYdHe9mO69BR6iNa7EPdTSblah1mSKS3zhawRG3cUmVSsNYYkPAHXKGdGZo9s4On9EHsSBuqIh13w0YH6GZPFByHucWGW/zptRLbS2Ibw7QqQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jcOOF2gJCkC4Gp8uSwowQzR1cQCS5+tCQtNQQOYhrsM=; b=lZvNq0FabcIPHRjY7I97eVrgR9jVm4iDIZ9sEStSLlDvyPkuaVFFazTVsGelXrApQZYPwpoe5rb+eMJjmi3TG4Effd1Kh0VNnDSVae5qNHsY1IwfGmRG1ycjldL3kZOrXnDJcAz6n/M9xCJcF0+11l1kS0EAoGNzQLjju7UIFsdj+QrKMkilXfMeI3UtKfcTIuB3gmMXPYiRzufWv/CLQKkiqrLwcKz2L/vLMoS8Xbt77ic+yDpW3hQXfLlGSS6kS0DBpzjogwOR8+wpLn54VwfSIt7Bv7mnWt9/ixCEd+2loBH7Ut3e7mJJk5z38XTMF2yy5E5QzA2eMF74gYKRAA== 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=jcOOF2gJCkC4Gp8uSwowQzR1cQCS5+tCQtNQQOYhrsM=; b=leJaLkQGK3qQnRxjWwm4nvzjLQo6QkpBxVfPrWPf8QyzVAldTGhDkaD3SLiCOoRFDltNN9E3tBVORP7OEjYW+as/bEHvsIOiZ/gnG8me4HDfz4OXh4O722EFrdzJZhZcd5iXsS10sAEp9esl7j978JaNomA0vMNVaYXOG5xm858= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:15 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:15 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 11/15] scsi: sr: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:50 -0600 Message-Id: <20221229190154.7467-12-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0004.namprd20.prod.outlook.com (2603:10b6:610:58::14) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 301d2278-9343-4f4c-165e-08dae9cf333f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CR+eOf1e2I9wmWbIPyKawcwSUwyXzz1jf5k4s+0qQXUhrs+S7TDxp+SGRee0qei8qF23+KoDWwc41ZLf5GwJVR3L9TLs54JGT/LTSHfOn9J4ENSly85DLBIV6Ql5DYm4GodN5mivKIbNdFj6iq3ty5R4ymCnsKJrqIltIaDPBIz41Y34X0nuGTU+3dyb+cniMCBgfmLudqh3ny8tOIsQcaL34UKG7okrKBVP73RlUW1OA1ZQgBXnmqyIHEj/nwG/qt6jlucrUbBDY+/KG2c7kD/6B8asakGHuVb/Xzx02qoG5q7QYDDZd6PY/lwge5h7t74UuNM+q1uljM4mUtSNwv4FboK9/WepXZ4RL6UxcvPLk2czqfDltOa7vzvuSJRCQB8OhnDvo4f64j427UKgeR5Qb1d7PTxtzDcr2OwSUBSJLcKa9Vb67Tefw8rm3j+Y30N1ep+ILETZaiMld9U2b1HmuI6yHuIFl62vNik69ucLn/xH/RYTBfp4mFnaeAWcQCrKIlsM1IInqWdoSyLn1T5lJqSYBdT2MMeZA681F9uuoZ1afdaXt/FlyQ1dDubT76KDhDY56BmgK1qw6R5ZU1/rikY24fi11na1pY3ZTaSSmbsNHjBP2NE7D+JPG+rzVlDbmYQf6Bmiiu8DV0XiIw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /YfURqq4HGEMdpInOAVjdDQsFU2oSTZ1KZZRzRn7fwPmTRNnTAw1fokNrfSxuBEhm3GLszvwjMnC2ekFnVFOsQG/ClHgAFBf8TVojZKW5OXHHdZdeIrnoc25bcVASlWCDuDrhZnzHVFQ4yAGb3Q0BmLNJ/pL3mlntp4awwt4XXcH4ng/W8epUS/yJa3XqLYcR/OBjtq/T7CrUZ7WoSH0tRgX9tPGfvYc/4oW8XkUocYwJvrTdXLe2syAeImNJq1pTMi1drXYBk1NYNC1zTRhQGyRo0xhSGbWyQvbXADZMtFBNsW01bDDzxUTEURubr8hKBu9phFTQaGcgEUZIzXXCOYx+HovS+gm0cz4Rg8qS2oPz9HpfcsvvfSiQXxfj6jBLqLs94kHjTdAMPh1pFApB9Wsm8HiIv3G4KpEn5Z0EqQeeT0MDI8NftIALhSw2T8JpEe3WPMlmWu4+cdWgEMqnCLPao/ucxvuxCmxnXskKOxnGFb4eWtooUKZw4gltgQdeEhgfF5MOvzCddeP2pXeWI/8vt8/uRzxUc2BkGFpmH9U8eorECvtcLc7MOl/4MeFy2sgqiZP9CnnBYaFcwPxvaUM3Y6Mtbf0lWKn9ChsVdgdMibc/i08NFPkmNUFy8XzW5zOt+OW/m9MeovOPN3sqbYm/4aeBYQ1F59zrni7m6ZwLyJj94yh0FANe+7BMD+8/DNc4BhVRmwM1u/u0lfEAbwF4po5HNW8K0ojvWI7ZCgBNMGnkeswNPuTGEMq606cenJBqg0Ov6fP1rorOTu2TjOTLezmqjNH7oZdK2Tbiur6GcmgvVC2J/LG1BwojPnIo3RB1+CnpZXCNDeSKYKNwx8NqtesfmUG96mQAbA/+90n37qL4m4SL5VHlLiiQrVETBq5Je38TTmr9zzGcSrW4cW+QZyXtyBfG/HTUVDDFHee4nEn+m9VLX6DLZEi3dxFrFGpslqFGX0QgLNVmF1zx4e3WjONQP44ej3DR4Onz0MiN/IDcgIj3ltJ9i0XFwMmOfN3eFqQ9ZqaMEXYxR7taVhB5Lx6LLWi/go902BVNVkx9kliVvN5RJ2RvX5u3YaOREih99jtYJn0C7eglUUV5WnEhDvQFm+G0uSSdMVlKXa9M/X6OZeZdFdUahs3lcPVVWksvGJgOuyLhmEKW/WRFYrZFj5vLwZbN5881bAv7nEH8pkFMiPyFUMEjlgaaopnydDVvaBPo2uIPm/nOW1a3SopfBw9RSww2k+wzK4ps8JIUzG53lTpzWReto2hMtTRD+IvW2lcmXINDHVLRBTO1nPWZh0k8MKes/+jWDw7Jo3qRhlh4C4KLLdWV71o3/P39rWaFCO0noI1wO5ERlc3qmPS2rBOP0wtG5jX2GI0/tHoRhW1RS4hClEb97vUpwdfjYy3AgIcGvTIGlVGMeXtZJTe2SyECEUKWWxMkc/NPIAbAfAQSPKHF7qPmweg5Z507nq4FxHRW6ZIq3JdWpTuQ4P9vE+haYabJKZ+RqK7XGAZk4VVJX3WVBSuPftaJvsJ65Hebzi9Ci102ttALwVmkJhAzcvjqLj8G4ByrLfqhBUEfgbZeMGTLfVj96fGCtMNZX1HkmCOSOYAiNrm3YTQwA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 301d2278-9343-4f4c-165e-08dae9cf333f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:15.5027 (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: +Bp20jwYPy56eLVMdIWKIa2ug0BFHW5rVXhSjGm6jUxyl54GnyYkatdkjKMzoTcskbVC8DNsp5Uvz9zLS0mCAfd+cmAkpame3NjXFCFep9Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 phishscore=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: 0jLn31sixM42aD6R9qb_F3UedoEwahc6 X-Proofpoint-ORIG-GUID: 0jLn31sixM42aD6R9qb_F3UedoEwahc6 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute* is going to be removed. Convert sr to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig --- drivers/scsi/sr.c | 11 +++++++---- drivers/scsi/sr_ioctl.c | 17 ++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index a278b739d0c5..9e51dcd30bfd 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -170,10 +170,13 @@ static unsigned int sr_get_events(struct scsi_device *sdev) struct event_header *eh = (void *)buf; struct media_event_desc *med = (void *)(buf + 4); struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; int result; - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, sizeof(buf), - &sshdr, SR_TIMEOUT, MAX_RETRIES, NULL); + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buf, sizeof(buf), + SR_TIMEOUT, MAX_RETRIES, &exec_args); if (scsi_sense_valid(&sshdr) && sshdr.sense_key == UNIT_ATTENTION) return DISK_EVENT_MEDIA_CHANGE; @@ -730,8 +733,8 @@ static void get_sectorsize(struct scsi_cd *cd) memset(buffer, 0, sizeof(buffer)); /* Do the command and wait.. */ - the_result = scsi_execute_req(cd->device, cmd, DMA_FROM_DEVICE, - buffer, sizeof(buffer), NULL, + the_result = scsi_execute_cmd(cd->device, cmd, REQ_OP_DRV_IN, + buffer, sizeof(buffer), SR_TIMEOUT, MAX_RETRIES, NULL); retries--; diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index fbdb5124d7f7..5b0b35e60e61 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c @@ -188,13 +188,15 @@ static int sr_play_trkind(struct cdrom_device_info *cdi, int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) { struct scsi_device *SDev; - struct scsi_sense_hdr local_sshdr, *sshdr = &local_sshdr; + struct scsi_sense_hdr local_sshdr, *sshdr; int result, err = 0, retries = 0; + const struct scsi_exec_args exec_args = { + .sshdr = cgc->sshdr ? : &local_sshdr, + }; SDev = cd->device; - if (cgc->sshdr) - sshdr = cgc->sshdr; + sshdr = exec_args.sshdr; retry: if (!scsi_block_when_processing_errors(SDev)) { @@ -202,10 +204,11 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) goto out; } - result = scsi_execute(SDev, cgc->cmd, cgc->data_direction, - cgc->buffer, cgc->buflen, NULL, sshdr, - cgc->timeout, IOCTL_RETRIES, 0, 0, NULL); - + result = scsi_execute_cmd(SDev, cgc->cmd, + cgc->data_direction == DMA_TO_DEVICE ? + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, cgc->buffer, + cgc->buflen, cgc->timeout, IOCTL_RETRIES, + &exec_args); /* Minimal error checking. Ignore cases we know about, and report the rest. */ if (result < 0) { err = result; From patchwork Thu Dec 29 19:01:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083714 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB5ADC3DA7D for ; Thu, 29 Dec 2022 19:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233939AbiL2TEi (ORCPT ); Thu, 29 Dec 2022 14:04:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233854AbiL2TE3 (ORCPT ); Thu, 29 Dec 2022 14:04:29 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22D771408A for ; Thu, 29 Dec 2022 11:04:28 -0800 (PST) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIx6Rk012472; Thu, 29 Dec 2022 19:02:20 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-2022-7-12; bh=REIguuBRZqH0yEqM5RkwJAsUBscBGAoRYxxKBR1+QEw=; b=Lk1Gs9TBQv6njWsDD9yrTj69p5j/mz+Arb0+t1SD+xctMvyTIRFqAmBrkfEg6qkfWjQg /OuzH6xSgs81UOicw22ulnDO/Q+pW4cIXvQzone053xRA1dlM7aT8LJTuCTJaI4W4h5d 2q+lSOIWpgT1XL/b01gbdo9dUu41S07ThsD19AS81hmIoyGq0aPIb404Aa+VVpsKDlNn MG4Puxi8j1mQBQ99EGFGoIgI9xHGilZwU5A+WXCIbzD8Ij7qzdiHXc+YD5EWsWILjk2L gBOpDOFnZG0hcgeT9Zf0Me54gnCOipkkqASrpRx73dhP4x5VxzGNYA2TSNrex8rIgM4N iA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnsyt76kb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:20 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTHZJ3Q018981; Thu, 29 Dec 2022 19:02:19 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqve10ct-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RxUG1Qt4sDiaQ8ohM2WFlLaYmVaHMQAO9IDerzURFpoDxDMJXIkZ2SFFeXPXLBtrszuEKOIABuXYSZXBcHeEJvVTCVX8aeRP03PV/Y5LDDFzhBSJOi7R/FDmzUPlcvFwECnYmmGu7SEsbP6Oxz0BHU58hPECtd+ZDDpu3wjEpLZkhy2HFozxlC9tD4NYEe1BJxzGHk2DDlcmjgqjhM/2sxQlFZCqwElLPb41iZzmy2nI+5YQ3VaeSEmB+LyLOcAe4jJIABV9OFx6F8IWsNUB/QcAAZAlEVNhANa9Z/YkgWJaXkSoDhf9cJm4uZJjb0Qg6w75wr8lj/VbWYcm5orJqg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=REIguuBRZqH0yEqM5RkwJAsUBscBGAoRYxxKBR1+QEw=; b=WqQUUu0EF1e4IGgqewxRR5U6Ej+4704251ITA53Eu9xJn2Udg4MwYrIC5mAqgOwQ1578CDyZhN7IUu5S9xAcxjwmUkIZtNI1zSorGodJOKArZf9MnXqTVZKNqCAPQNBdeVheaYWgSnofIPPomelpDIT2HB6wmtovxpZc5SKg7Xgim1XqdbBBsBD72/bPP3x/qL8jyUDIBZh5piwt8vliDFG7blN1llZ2sPtc8S5LifF9pUBCU14v5B8UN6DupjHJhtwV7WUh3HtXBfTBRdptKKTiMHrXYuCEADCv4E1a7uXYa8a/2P3Sg5iE1bCg+nL1DPL0MI6Fw2Vj/qop9MV9Xg== 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=REIguuBRZqH0yEqM5RkwJAsUBscBGAoRYxxKBR1+QEw=; b=CbzK8nPz/7XTTVOa27MmvOrJPylXPQbyxoFnggVkzuk3JM6WUbUpfVsZRhV0jVXIkJ1CFa9YDfJ7al9UJ8uI6X58+4aDW40sNRBV+ovjTd3CuDzXJhAqVEVr6FupccplZJkshVMnuOagSteLmDt4tpZxOf5wwODYHNgldAedu10= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:17 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:17 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 12/15] scsi: virtio_scsi: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:51 -0600 Message-Id: <20221229190154.7467-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0016.namprd20.prod.outlook.com (2603:10b6:610:58::26) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 595e8edf-2a34-4cda-90db-08dae9cf3421 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nFUHFEC4gSjZjd3nTXSy03jFjtkfpp93an1EKO64Zxa4jgoOCU1Bu5W87X89S87Fl8j+FzwN2HoZyfo6qmxZ6AWpifM3zbUVLOWxP/BRr31IRtcOz8U1OZzcT3VXg3vEaJAByrXtunO2WNvYkrLPEj4YK8QJGTwRW9+5NNiVrgmTCeQ/UUWhZU41ldE8ODs2xLQYW42SjA4i1/VEVKw26IAiCikorB/Z0XRS2Y8GHBhCWQmOEjOvr6o9dcOi3tS63SWhJb8mryN2DE9Paod+LnZljKRsO9hWO7UFWOIJFSYxo9CLyRz04SQOh+a5vdT0f9Z3JpQ6FgDaL925loY6mUT8B9ybSwZgVS8kGtD4c8fjRzrcfyfjdsE5+biOgoERlocLNsrqtk3Kbt9+DlwZ+8AUoLM2didIZiXKhc5C40RpxmCq8tDroXsF5zBONK4K4DVGMmvzqxmiPlerpgLciris9Eb0zcpkut8LbvzkOwpsV5tQSvwtj/pEtqkRmm9+kOJyYsYDzgsN6ZKPklOFhi4gR+rxX+D62dTAioDPYNwrk+Lw6PDXn953xQNhgcDiTBH6NNLLdTWwVEk1Iu6uvEZ2fks4Y0LoEwRf7/hsv2yX//v9gDQG0OVD3PZElhnismCGXbcyNGxRYppYPaeflg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(4744005)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cmdUbQcw79WiDSk60ADEJW3NBSX3GqZWJNZBad4Hi1Dim/Kttkw8FogyDGIbUSWG1RTAuyJF0whUfZAfg23/DsBe/ei4C1CmKbBYAnogVshVCiGmy76r2epSsQzrJdWNGeAEWoOMTSlP5JKV/K6yQ2/ZVQlIyt+WlY1E7aq3w6L+qN0irhEniwk+lFNLW2egh+gKhDjm2t1Bk1MAj5f6eApfPer8XOEvHvAdmXlVYdZkad1tXS4b3YxljjU7IFngTe2px15L35foZUmaaND46xM2AhV9+PeqELftYAs08L1/rc9rANsU52kyfKhL7vaobdxcsP6hzUUFfbjBFeHtOhHnJIrYjab8ikkl5r4A8sQCMwZXW9MfXTXYpyjHzQI/TGagiPOHauFs4JO1TGfY/63uN1xm4POwc6wYixxY8kT7Cxi4PoSZmCCev1XlYChTxtLGgyWzAZfq02mSRGiOl++Rba5dexp4zBQDgsT9AJ/c60HHABUVyNp8oebgYRa3Jwj7eoL/Uu5qHIxCHvQl2kgOYTsI40hAujo7DkMbuqmcZkSym1BX8YO2kYU+9do/WuXWSWq9QXJE2VmYIB8GzNFWNdC2SwNNWIU3fkx9OGlBQpvRvZgVOwA7DnuqpE453frkmukd1VSw8kEX4okhzi4v2mZVGnsqOWCFgZmTR6VTk8WmEftWynDNLxAIbS7+ipkEcQf/JzR/yjnEJnECdG1lKitkApB7FoTVhvhA/z3ZZjucbfnt4FGS383m3QjrJXjHWfR7U2uB326RPzVtmUMNoQi2tE+5bXTdQeHtOwr6TioZ203hi+LCFw37VuVSRkiYxv+v5Mc+6tYPO27j5yn+ghNtBJzc/1tiUMe2shE0mAFgODGQseCkM1s/BB8GI1oDr6NdE3JF4YET9mdZvuzWRYu4NZZ6UQQrmYNJXEHE303aSPAtV3yFdr5NYj1gshsESzb72NnPAMI64e+G+DfeYsYvkPb7CqQVtYqVQdJ89EzEuy7jUB8JWR7I4jVq9VGVrHhC2NUwR6BezCaqyC8vRBmS39ZWNsyxd7z7xB1NrO9Kx22iBVWCMct5AF1VBGvviPmV1JdwIzaQx9vXNphXD4SASEr3fOaEIEjvhq07CNylpKL/YIf1TZNZPlN3ALWJgKciX88QafTnv+v13xqdenyT/yl4oUa/FzolIbGE1478y6YWqQWWN0o9YGyCylDdJSZxe10fxJvROKQuqCnWBGcyhV4qvs7d8aqhz54F1k3VHH5WMdorNa7Zg+u498eo3xm3sQ8jo0vjot3pvXHrPYjaDayQbklTZze+/7LPYq3fzsko72RrKQcn95k3FkwlKYmXEX+aAtmeVhDpnFsVOa1cMgs0yOXGxTPvLwCXajfI/hE7dbiU202zVhN0ozfFSq+q+6pWSKu0xDIWaeE6KK5onkRRKvz0s8hvG2qL/P++6FxsfTJUF6uhg6dh2SpLsOpUHrNFftdIeF1C8IfD3ebn47S1kFc91/hzfIEvHg9ceCtAECmfGQNq2hN9SQIv6/DIqSuVvfvdZmzcBM0UaQa5yYh4RG6FGE32rfl/GREOP/xHUmfCudnLLnCP4ORVPmVKwZVHAiiRwiosxw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 595e8edf-2a34-4cda-90db-08dae9cf3421 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:16.9713 (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: CY1PLeicX+xjTzl8iPfuo3y2Q6VnXu7NgXDVByb3feeAmNWVjLk3KaGJt42DVoBAuETSqJJv+0gNdkDlNTsYS6z+eR+GhsccX7tG4aeIhlk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: zvzXI-3KJoQLtvKlz2eAh3VCyhJwd7K3 X-Proofpoint-ORIG-GUID: zvzXI-3KJoQLtvKlz2eAh3VCyhJwd7K3 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert virtio_scsi to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/virtio_scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d07d24c06b54..b221c3c99320 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -347,8 +347,8 @@ static void virtscsi_rescan_hotunplug(struct virtio_scsi *vscsi) memset(inq_result, 0, inq_result_len); - result = scsi_execute_req(sdev, scsi_cmd, DMA_FROM_DEVICE, - inq_result, inquiry_len, NULL, + result = scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, + inq_result, inquiry_len, SD_TIMEOUT, SD_MAX_RETRIES, NULL); if (result == 0 && inq_result[0] >> 5) { From patchwork Thu Dec 29 19:01:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA52DC4708E for ; Thu, 29 Dec 2022 19:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233803AbiL2TEj (ORCPT ); Thu, 29 Dec 2022 14:04:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233886AbiL2TE3 (ORCPT ); Thu, 29 Dec 2022 14:04:29 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CF5214094 for ; Thu, 29 Dec 2022 11:04:28 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxTur011785; Thu, 29 Dec 2022 19:02:21 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-2022-7-12; bh=8ffsmSpVEceiJ//dJjA2viheiVTnveuV/3Eyu5l4smQ=; b=UziH+sEggsjfVX5Pu34kI5mjab5QDV+Q74YYOu7Y4x+a8qbMCvjFeQ1aeATebROvZvDQ LzyKc1iNsn8hbEQC7RpjLofzQ23fNfrFhLpKS6SC+kEMn/nOBM315jgRiCWSt2D0enYr 7P3LWCZJeYhWMlah1gggVQIKL5pIFMQZmZr5DgH1RDSSn3cTbZZUIngLgFZ7RKWQaWqP Pf7SE5kIZZ80yi5/mhe2qtNCNaZFaCxeI+Iv0e91UTtMT6E7+nHegb4digjuWUE/pe8L bp5WaLn8uHzn+uOuQZ3SI5Vm4gcu4/GVpQzSRIN87vmtiMKhn+wVhgEmpqP0dXBllnJi 5g== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mns1tf7fk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:21 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTI72c5001350; Thu, 29 Dec 2022 19:02:20 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqv798bp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jy8y4XFqhhECC5YORkDI6II+KPzrJbvYNqfA/tLmRnWGpwVtbfN5yJAlHD8wZOeCa3aJuJ45PUfwW6/3pKHRoCBJ+pyJo1aTlU/a+6XvMTuootMYSHJHSoAhFJN/J1oquO3tp/BQ6Ox11tGaJRpEj7GGy4Q76meTsxRgRFzX+mUZGXWM3zzClqJBkq9Mh6HvC0lfqTUSXuTA4yuhLPNxydYgCKR9n4ZkJPVfIBj9KHwzDQsCXD4SBk0shbNqaPG/Ezs9jQVf/rW3ds48u9QQ8i6v+oKcswGpJCLF/C5jFxWCN9gzdx5ga7Wq78qCHhNch/I0FyGNrmCECbbr8oSx2A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8ffsmSpVEceiJ//dJjA2viheiVTnveuV/3Eyu5l4smQ=; b=PCLFn3YRgs3/xkyhd07GlQLCmjszcRGqXV9YauxpZAOaHNSNL40D0AlOSKwwBD07LRTrDsbhNr/17QCSB3ZpooCOQtt0xM9m3T+cPgD+VKdWPBHGPXxaRvQXY+qyWdLs0GvM7tMiBb4BOA3wHjCnf0jQjGeCB3Ty5I62R+AGSMfIWWse93Podf7DOKVIWhyC1oOmzzV2R7uhMa1Un/45QiQwtbCo3v0QOnwH5Yim/obKNKIxPRn/HmohKNU5AZqCURMY/7siCs/oWJhWFQgJrj10C4BNyRyFBxjxKL9lsElvAiiqsVveMMg8dUjcrObbMGw8Lm6GWvdurlD6MJyQqQ== 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=8ffsmSpVEceiJ//dJjA2viheiVTnveuV/3Eyu5l4smQ=; b=IObCAvyMtJ404OcDYLqv7MtYBB5OcPGm0nkuPZemoWItVuqdhcfZCYy9r+JVj9dZZr7stWYus2nF9Is3KtuOyE4WjVjxF/gKklMQS18h7KmJ0GBzZOUZO4an85LUXD+9YQoCt8bTMa2z9/IPZ71/BH8AUDSOdX/YMsxkap942ok= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:19 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:19 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 13/15] scsi: target_core_pscsi: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:52 -0600 Message-Id: <20221229190154.7467-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR11CA0019.namprd11.prod.outlook.com (2603:10b6:610:54::29) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bd081da-57e7-4e2d-de3a-08dae9cf3559 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BS6b2WRwbPqhh5WsniH+zWo3E3PQlnfmPzFnOlnooQBeR1OJZ8dQPB//BjZ/WsSsBreDLfElCCbGuhWX7SuGocQVphkza14h6njOsYmvW08i2Ozd39uVV34Q36kLeHeplV+BwyoTENCGt8JfzSBWem5P3yLyD0aBJPt2XVQ61adHn80FAd5Lh3FueffliOzgMSTuEQLogfL5vrghEvgNtu2bKc+CrPdHReqQ7hZSuc4uG+umI54S2vRYkZWtNfH1dXUizpjlMndBjTcGgvHdFMS0mciX3mOlm6rAElHyy2OJi0Y+NJ8udGycXTyiAemYMBOkW36rhW2EGTOx5qic84Y7gPLAO5GECtLAOq7u7chc0WnvNa7ZD1E3+Zz6cSfbJ1QeN5H4sitM6pb7Dd1UoRE2l9MTvGMF4yZFrMm90hWQi1WYmb+uNeMJmLqsNVOPFdM4nNwWxn/YTLZvW/T7OrffOBDamnBFN3JAaXLlmf87mXSMXLK7j0J7OPU16cD+uLfQOZTrzhph9YkK1v5miLZ/LhTT92nnA/Qc2s8gCLT0FsjyFr/eFFHXOufImFf4bQrtm2BOIrerJn1ZJY4LzT2Jcn00syhbQaPkr7Adtg4pEy6vW3v/l0DZejsVeK07BvPiM4BhtWk0H3UZjsObsg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LSSQLZqfyvSGLrn0Vqjm7Jkk9KknnBPk9RUr30tsEKfO5AA8kzRSsLSBRi7mMssswSpFYZJJXogCZ0s3bTg+8UaEortaF40r+gi4ClqREtJzZmiCi37/xwFydUglu2zqikBcZmYnUHbtt9ndr455O4Qd8HvtqBaR7zK9WaEkFmC0NH74gZSEsP97j6LEF3L0hXhIjymNugi5/wURlTR5A7zDQ3GEO2Y4aBdAyaGUhXowxjbZ+CGgSPE5CboPgyy1Goi7UktJYD9i2hBB7LdwhKHAzvw3tBs6xwdXiMlR97hmdsKGCfwoK860FBx3f/BrWmJYHQcQ8v8KmAmPtXHyKcgwISqSENXM1O3mchhQ7Cb6BV1yq9OPF/VvkfsUxmLmvjqFRQij03bX5nwQdn+tR3RORZjMMqcZP2gkMe7ul8XPob0srfTa7mYCDueXYRIXjErVQ5K5ZSr8npIdFn297OXlcLn9J87wLuvYLFztD63GvhNJth805RHVIAP1d8gliwCxvSQz0BZlGdRXi2YNbftqpU8CJtPe2fHjU1BFVebuZZ4tr4r8+bpe+qVHgNByh9nIyGdy9TipdCgBhAxdbAjglksoLh5DonWjJxkttFfffK6PNxO/9HrTQL514GODdkK7jATI+gyWUb2URoROGR3pkHYbGu+hgECuxaIoXdaeYINpWLuRUTtP2iyoJCFFNZFhKpDaRpWCPAqLUoOvQVcA7nUv56xvHFm9XznqNXBprrqgxQ/Af4fEfze/IBsdS8PIXSp89jPRFHqgCI1HWEL5LqUR+Po/zBRnDvrNa+HIH7B96GozBytBqMpSeCeuguy2D49Mkmfcm3oxIYKs7QC9yw3vLFIF2NXkkdpyyKDGj4m6/0/pQ/DHJo39brmW4q6DyT6sCLCn7akzhbQIrvsDfOU14TH3CNz47KRiN16W3dK3jcBfmtSkv1Ne9oHHNQWeXNzLqmoRIFRExQ6bLhgS/G03mWT6heezqxmeGx22QmRq8n4WJkrTV1YKAtTduNHfu3mub4UIyWSGtRLraUKnRG6lcyYSV8yCfafsPOOoussdkh1UNHmg3dvm3gThw+kX14oAQtApe8z0Xh9rWlE3V27vS7oAzntHlPMx2C/H40khQWlbjvEogF3KtKySeQYGJthYpI/LSY4MgyZhyRRBSXNBlz3NURWrEd6Z3m168/3Abiujr52qzr1UkvFI8zbFVu/lwDi+DQySe1Qf+8aVRI/XIyDUpSdKdQAPW1qodOgD5Qs+OfVMpOdLpwcKwKtAnPIpazKV9Vx3ybFbRrmsCuotf7tbkgw1mFlYLkiJfq4PqskxW5iZugs42fv9pxb+HztkWGxDipOWSSQJmwKyaNNFlxAwtyrfXUCU0Tk1OgK6ZSsMEc0IBPPqprf9cMSnk7UfidRONCtqJSmrj20rIfURB8+zt++k/HSxYKf+/g3bWGcIiq65vfrp6xS3S+DaoYTX9VeGcWCGu+l6V0M9VJVrzn4PHFphqMN1SWcXehyUSzNdgFWshU3cdaH6DgOqsel+jPae1gkH2RlIzu5IRBSbTa5X+Rufyo0AxABhITB4LdyBlrud5CeqqV7uiQmzJ0Tafm2SRwUP+WICrw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bd081da-57e7-4e2d-de3a-08dae9cf3559 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:18.9711 (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: r1xEXyPfHp21ykrG5KhmP2gm+RjKqEUI6rRNkdfbhzjstj/zojo4b/42d/GoaU3jQbezmccR597I68yOPkLAgQF1R01GkLfqDCu9s52NcUU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 phishscore=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: Vl4LhAVe1-VuTPTgfimpSVSy6qoNeqC7 X-Proofpoint-ORIG-GUID: Vl4LhAVe1-VuTPTgfimpSVSy6qoNeqC7 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute_req is going to be removed. Convert pscsi to scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/target/target_core_pscsi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 69a4c9581e80..e7425549e39c 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -144,8 +144,7 @@ static void pscsi_tape_read_blocksize(struct se_device *dev, cdb[0] = MODE_SENSE; cdb[4] = 0x0c; /* 12 bytes */ - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, 12, NULL, - HZ, 1, NULL); + ret = scsi_execute_cmd(sdev, cdb, REQ_OP_DRV_IN, buf, 12, HZ, 1, NULL); if (ret) goto out_free; @@ -195,8 +194,8 @@ pscsi_get_inquiry_vpd_serial(struct scsi_device *sdev, struct t10_wwn *wwn) cdb[2] = 0x80; /* Unit Serial Number */ put_unaligned_be16(INQUIRY_VPD_SERIAL_LEN, &cdb[3]); - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, - INQUIRY_VPD_SERIAL_LEN, NULL, HZ, 1, NULL); + ret = scsi_execute_cmd(sdev, cdb, REQ_OP_DRV_IN, buf, + INQUIRY_VPD_SERIAL_LEN, HZ, 1, NULL); if (ret) goto out_free; @@ -230,9 +229,8 @@ pscsi_get_inquiry_vpd_device_ident(struct scsi_device *sdev, cdb[2] = 0x83; /* Device Identifier */ put_unaligned_be16(INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, &cdb[3]); - ret = scsi_execute_req(sdev, cdb, DMA_FROM_DEVICE, buf, - INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, - NULL, HZ, 1, NULL); + ret = scsi_execute_cmd(sdev, cdb, REQ_OP_DRV_IN, buf, + INQUIRY_VPD_DEVICE_IDENTIFIER_LEN, HZ, 1, NULL); if (ret) goto out; From patchwork Thu Dec 29 19:01:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E08DC4332F for ; Thu, 29 Dec 2022 19:04:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233856AbiL2TEl (ORCPT ); Thu, 29 Dec 2022 14:04:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233915AbiL2TEd (ORCPT ); Thu, 29 Dec 2022 14:04:33 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CCC9D9A for ; Thu, 29 Dec 2022 11:04:30 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIwqT0000392; Thu, 29 Dec 2022 19:02:23 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-2022-7-12; bh=S9IfsMYSeF3M4JrFom+b3k0PUjXzoQOIqi26pEpqvsU=; b=o2JaBiJ4HGK3opTHu2volVkDiiKMcbR0X52Tbl5D5eCv1H8WIlqeMHxUB6HCv424wCrA yIeeRYdCkAjuuIOpDfm8h9JEJ/vjCvxxsaLHK7v2aOFe4yqSkMHYIfzfvhPRPL5vmOD1 0V859CHhWWc7sAgkqfG7W2hgDo5LQ8h4rzR/nvYoBlHHIujlFVLmUMziiqbxTYM4KLzU jE/kOEVTfNFqteuVX9IclXJSSRcz6/MV8/58VyJJhVpbZAl5vceHU8fBRy8SzsEKKIWN zesqdt32BEZEoOGhIGI3fOADwcEDtvyxix0tq3lgPHefFak3m46sFeoNYR/GlebS4cTO 8A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnr73f7qu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:23 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTH7v4D024094; Thu, 29 Dec 2022 19:02:22 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2176.outbound.protection.outlook.com [104.47.57.176]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqvd2d4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZGmQAWNm1Rv0x+8leCWvYpZjQ49ndOofeI3AdoKmVkxoE0qObNplo6n7TJ5sQb9gxDsLj1Tbl5ZJ3G1VIs0zliMCE5BPvLneKa0cINRwMPrvRZcUfHHbNfaruMNUJ2Yvsw1qXOJQ5Muwv/A3RLN9jEZSATWsKaUiPHT9z3Md7/7A353xj4dBLv3IWENC5opgz+IlqhP1Nxm8pJ1vFsrUsZlufkVS+gSxBunILlH1QNsht31WF7gmr76zh9PyU6nhaybsXiDEqsRT9GvvfWlqLVp1M4xFug5Tr5zaXtpQXsrhobXtuuPDVbIssmYVSNiqeiPkkoFqiQrGwAkBJ1g4kg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S9IfsMYSeF3M4JrFom+b3k0PUjXzoQOIqi26pEpqvsU=; b=khjApRJ4znOlBrwzasZGfn02/RZ+Zm7NS7pFSqoz2Ehsr/+Qj+Fnf/vywHzGyW+UyF/isHhdboZXkZrI2gqzYaYZXidtbcIvguhoxLSNFNZjLyKfx9sA2RjoMLE1Bkc0ZC21mqwgPlO9Lup+ru2D6VYQOZRjg8KnqytqQjbCDavB4Ltgx3C/i0QW3igZXtG6eHPJ9P2eF4aFy56WHNue5rCjiuqqBWnDlM7KphltSKLSiBcVPVXn/6Y/IL5TM5NXzKD/33IjNYbOQbltIDzPxZkC1mZ2nyuCk1KVNPuJ3GtWTQQJDpIJcNW3MUOoIxEVwJLKDEFKgAcSXymymFLwZg== 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=S9IfsMYSeF3M4JrFom+b3k0PUjXzoQOIqi26pEpqvsU=; b=sAJ4pdzeYGaemSGoyDeyjVTR51e/9EEQA9RLfkIE60PFCpdgHVZH/Wikd41tViaRVp3FWMJ8SeH5IXsucma/H96HaFvs9A4vIj5Rjk279QHYHSgDPq6JZsiT46k9e92mCf8VfuzE4J05HKqxHvjKPEGJhNec3wLStVxUhzDwJYk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by CO6PR10MB5570.namprd10.prod.outlook.com (2603:10b6:303:145::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:20 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:20 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 14/15] scsi: cxlflash: Convert to scsi_execute_cmd Date: Thu, 29 Dec 2022 13:01:53 -0600 Message-Id: <20221229190154.7467-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0059.namprd05.prod.outlook.com (2603:10b6:610:38::36) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|CO6PR10MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b9b95c2-fa3e-4fab-7fa5-08dae9cf3643 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x8/IUvtQm6HmeIpE/wBba9LUxWUHzv0O6jBO6FLu0/Jv8+DIgpmOZiecotefRhVEIVVXNBc3ETI9YGM7ckiZ4P/XDblqK2UQrQzfvq5yi5SSg6HOlt+0HjkzghHAzxYssC2ao8GhlHhYiCJsbAywWuMcL5oGF91L20aokCCaD4y6Da9L/4CePovbrhyWDbliNsVvSEzVu6+6BmtzXMGDIc8YruRNtq+tCfoUmL0cyuo6SMsJ0ZIXGRLliBi5atlBuxYqJ0qjf11P2XadSXKPhH0dOZ0XsIj/qjuAxRV3YVZiQoa0AEb/Th8FHK+dyRSke4em/Yi8XrpO+wBuiTMyndc7J6DGkGaZa+DIWP387wBPxRl7h2D3g2SQnk5xZv8v9SH+jDai/osEknzmDMvwFPH4+52yalaQJfdFxe+Y3mWux8k7mvRFMFo5IB3QHgG9z3qdtGHvyITP4mp0Iy7wnicqVBaZ6wWOLzn7vErRq/rBWvKFtQNQo2VcLBYALw3V/w+/MxAX1iTrcQaOogniZBMCawxby2TLrKobwrfgIl/KMDSpVmuqzz0yqQAJBcnUnox0eap8Od10hWdYWSynaEL20MTAS7V3l863jM9YZmk02inO9yJOaB0TX6MOa+3a+rp8Enz49nqDLj7DCj6AQw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(396003)(346002)(366004)(39860400002)(376002)(451199015)(36756003)(2906002)(38100700002)(8936002)(41300700001)(5660300002)(86362001)(83380400001)(66476007)(66556008)(66946007)(107886003)(6666004)(478600001)(6506007)(1076003)(4326008)(316002)(8676002)(6512007)(26005)(6486002)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BT8CWc3VBcj1H6KW0lWpHYRwCewHLRFd3LdPceJ3Pf30PqMyyr0VKrOpUwTuiN7W1/rq7gCmCGkvF1wOBbnxz63JbrzYuIOxVTOZXCfIOuo7bGu4gZUfeGsVz1wl4d0bHLbVlxhSBRsUyy29k2xtRO974BfCQHRnCJmoc49xpd+C0jCEg9N1g1WSFWhm+kMecRpvuVpvKywdGF0C8KngOHU1y8z0f9BJ6rmvLD931dpPQYT78w0EdwN92NaV1yVui80M2NsBS3pSDfhP5zOJop267AZ07rHfTvIBirHGCcAZB6SQqgMmtCq2rSyWW2hqfQNBSdCwLI8h2yNMliEgfKqE5mGubTrIOZ5y/ahJZtUnaWU0b59DbiSPgUtRaBKrnzzatcYvLZAFTPtvtpYpABNaDNVd4x9M+5uva7SsbDJW734COEeeYvOm/lgy7oKdMb488B5dJR+cKFqV6XPROAf3hOk3uiravtL9byso4PXcwTV1+N3dkbilV0XzTV6y/i4dpxG+ked8R+w4mTPtCGWiLYQtg7Q8TN7K2RI/HGyeppY6aiIkiqLK8LBmFVCDqfoH20jAX7vDgOMxlTo6FKCYU2A+XXe7nEytdDvU75jMOfrMNWpl/4MeOxu/fiQpW3gCxw0oZF2Yg73BEAOzI06OK12hfokBHiVFsL75mkFmtESYfUEzyBcLAX05QFcor41iDdXzx7gKAnZNtvu2j+Z+jIJu/JNfLa2obbDguZ8pnWndl2sNShPZTcSzSXDdrmiTBXdLV3Owr9rk+2M48DXWLZB5DSAPzbDoiOQ/jSzTrB9GugMOaYNvKCI/pDr+8SDNCKLUMuSHJ2OarHCWuSlPkBHqL6dizlomVshbmjkHewZfeZOId1XoY/mIgFY4kx9Lv5u0cAwsISjcG42JsykA2/OqpWVeCyDuOoBmLw1tr8R5PiOf44Be3mrw53F4Hls4R6d81aEe/woC94fp/oHnqeuj2tB6stYPwlvFHCWIs67gxsin8Zqd5RALrZRfs3BFR7QsBGELM/ZJLsqaXx88KJEDVgn08OdpGinYlD55kR3hR0n+XFtt6ZxIabJNcDkB+jpzR5So5s9LklmvyxPizUpH4H8LSXk++hFg0Uqo5VpwwdeqR5yxeJJvCEvMbEJecarpenpE9db7zgoS3hMsIU1mPQPmvy8v1Dotjn+Zg2ikZ4aMEQWZvF4dlB2YYg+PQcFWsbfpkKKWGdIRyQ3YHUtZlJD+ix54ghpBH5ZGl1onsHfmNo3O7l7mexmXO4+CawswtPnKRkTrdt6TKg+SATp0VarbEzn9JSZbbR5B5NTuh9njGmShn3+iAc4QoIMtJ9V+Rs9mRreq/JatnPSDQFBwcL003xUJRh2lOXNIhLqUohJlOWvaSIdilC1q18ygqKZYLShQr0/rOYwM9kNyHQSN5Bafj97SuUMIfttzRX8hR0Wm/tbtVdxDYRhsIOAnnpW3L7iDgj8ygl6ndZ8CHdXo/F0WQMIAcx5RBGf+NMucO9rqhk+YNDeEeCrE1SmPxkFjwK6PdtKT/9IzvfHSvrSwIBExJu64S4QTJecJuZ44b0wT2vtaSQVMI6KE+YkfdkrUBhpvuZwV6UNOYw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b9b95c2-fa3e-4fab-7fa5-08dae9cf3643 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:20.5491 (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: Px5cIkA0GEklHnPzfYClmc1JdeWACRFje//xp7mBQvzPRVTRgWfCj2umzMQxY0y7GxNUITGb1vgkyPa6EY5yCZa/X5bN4BpMipM4ALPlkrE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5570 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: StgKLXpTI9LTUYojzN57QxvvRLekhhJO X-Proofpoint-ORIG-GUID: StgKLXpTI9LTUYojzN57QxvvRLekhhJO Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute is going to be removed. Convert cxlflash to use scsi_execute_cmd. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche --- drivers/scsi/cxlflash/superpipe.c | 34 ++++++++++++++++--------------- drivers/scsi/cxlflash/vlun.c | 32 ++++++++++++++--------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash/superpipe.c index df0ebabbf387..9935c47712dc 100644 --- a/drivers/scsi/cxlflash/superpipe.c +++ b/drivers/scsi/cxlflash/superpipe.c @@ -308,19 +308,19 @@ static int afu_attach(struct cxlflash_cfg *cfg, struct ctx_info *ctxi) * @lli: LUN destined for capacity request. * * The READ_CAP16 can take quite a while to complete. Should an EEH occur while - * in scsi_execute(), the EEH handler will attempt to recover. As part of the - * recovery, the handler drains all currently running ioctls, waiting until they - * have completed before proceeding with a reset. As this routine is used on the - * ioctl path, this can create a condition where the EEH handler becomes stuck, - * infinitely waiting for this ioctl thread. To avoid this behavior, temporarily - * unmark this thread as an ioctl thread by releasing the ioctl read semaphore. - * This will allow the EEH handler to proceed with a recovery while this thread - * is still running. Once the scsi_execute() returns, reacquire the ioctl read - * semaphore and check the adapter state in case it changed while inside of - * scsi_execute(). The state check will wait if the adapter is still being - * recovered or return a failure if the recovery failed. In the event that the - * adapter reset failed, simply return the failure as the ioctl would be unable - * to continue. + * in scsi_execute_cmd(), the EEH handler will attempt to recover. As part of + * the recovery, the handler drains all currently running ioctls, waiting until + * they have completed before proceeding with a reset. As this routine is used + * on the ioctl path, this can create a condition where the EEH handler becomes + * stuck, infinitely waiting for this ioctl thread. To avoid this behavior, + * temporarily unmark this thread as an ioctl thread by releasing the ioctl + * read semaphore. This will allow the EEH handler to proceed with a recovery + * while this thread is still running. Once the scsi_execute_cmd() returns, + * reacquire the ioctl read semaphore and check the adapter state in case it + * changed while inside of scsi_execute_cmd(). The state check will wait if the + * adapter is still being recovered or return a failure if the recovery failed. + * In the event that the adapter reset failed, simply return the failure as the + * ioctl would be unable to continue. * * Note that the above puts a requirement on this routine to only be called on * an ioctl thread. @@ -333,6 +333,9 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) struct device *dev = &cfg->dev->dev; struct glun_info *gli = lli->parent; struct scsi_sense_hdr sshdr; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; u8 *cmd_buf = NULL; u8 *scsi_cmd = NULL; int rc = 0; @@ -357,9 +360,8 @@ static int read_cap16(struct scsi_device *sdev, struct llun_info *lli) /* Drop the ioctl read semahpore across lengthy call */ up_read(&cfg->ioctl_rwsem); - result = scsi_execute(sdev, scsi_cmd, DMA_FROM_DEVICE, cmd_buf, - CMD_BUFSIZE, NULL, &sshdr, to, CMD_RETRIES, - 0, 0, NULL); + result = scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_IN, cmd_buf, + CMD_BUFSIZE, to, CMD_RETRIES, exec_args); down_read(&cfg->ioctl_rwsem); rc = check_state(cfg); if (rc) { diff --git a/drivers/scsi/cxlflash/vlun.c b/drivers/scsi/cxlflash/vlun.c index 5c74dc7c2288..9caabf550436 100644 --- a/drivers/scsi/cxlflash/vlun.c +++ b/drivers/scsi/cxlflash/vlun.c @@ -397,19 +397,19 @@ static int init_vlun(struct llun_info *lli) * @nblks: Number of logical blocks to write same. * * The SCSI WRITE_SAME16 can take quite a while to complete. Should an EEH occur - * while in scsi_execute(), the EEH handler will attempt to recover. As part of - * the recovery, the handler drains all currently running ioctls, waiting until - * they have completed before proceeding with a reset. As this routine is used - * on the ioctl path, this can create a condition where the EEH handler becomes - * stuck, infinitely waiting for this ioctl thread. To avoid this behavior, - * temporarily unmark this thread as an ioctl thread by releasing the ioctl read - * semaphore. This will allow the EEH handler to proceed with a recovery while - * this thread is still running. Once the scsi_execute() returns, reacquire the - * ioctl read semaphore and check the adapter state in case it changed while - * inside of scsi_execute(). The state check will wait if the adapter is still - * being recovered or return a failure if the recovery failed. In the event that - * the adapter reset failed, simply return the failure as the ioctl would be - * unable to continue. + * while in scsi_execute_cmd(), the EEH handler will attempt to recover. As + * part of the recovery, the handler drains all currently running ioctls, + * waiting until they have completed before proceeding with a reset. As this + * routine is used on the ioctl path, this can create a condition where the + * EEH handler becomes stuck, infinitely waiting for this ioctl thread. To + * avoid this behavior, temporarily unmark this thread as an ioctl thread by + * releasing the ioctl read semaphore. This will allow the EEH handler to + * proceed with a recovery while this thread is still running. Once the + * scsi_execute_cmd() returns, reacquire the ioctl read semaphore and check the + * adapter state in case it changed while inside of scsi_execute_cmd(). The + * state check will wait if the adapter is still being recovered or return a + * failure if the recovery failed. In the event that the adapter reset failed, + * simply return the failure as the ioctl would be unable to continue. * * Note that the above puts a requirement on this routine to only be called on * an ioctl thread. @@ -450,9 +450,9 @@ static int write_same16(struct scsi_device *sdev, /* Drop the ioctl read semahpore across lengthy call */ up_read(&cfg->ioctl_rwsem); - result = scsi_execute(sdev, scsi_cmd, DMA_TO_DEVICE, cmd_buf, - CMD_BUFSIZE, NULL, NULL, to, - CMD_RETRIES, 0, 0, NULL); + result = scsi_execute_cmd(sdev, scsi_cmd, REQ_OP_DRV_OUT, + cmd_buf, CMD_BUFSIZE, to, + CMD_RETRIES, NULL); down_read(&cfg->ioctl_rwsem); rc = check_state(cfg); if (rc) { From patchwork Thu Dec 29 19:01:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13083716 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDD9BC4332F for ; Thu, 29 Dec 2022 19:04:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233922AbiL2TEn (ORCPT ); Thu, 29 Dec 2022 14:04:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233920AbiL2TEh (ORCPT ); Thu, 29 Dec 2022 14:04:37 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FF7BD9A for ; Thu, 29 Dec 2022 11:04:36 -0800 (PST) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BTIxlvD026482; Thu, 29 Dec 2022 19:02:27 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-2022-7-12; bh=kSIl4oR03dTCjKvm/u7nwT2jpvXvfUROV0G6Z3X4yCE=; b=v49/BqEPiWyCG6T9DnUOHev0bd7lMoK3UCJg42qi0K6DQdtpGvf7UoQAXmcojUYLYKZl v9hAEw/zF1SRR/VVFT2siiQfI5xH8ZRyYurMn66WHHqnuFcxanzC52B4oo18B9AmT4K+ OS63IOBsbBiPFRgQYjhXbOJgxEXzvtjJksUUHSmFpBcClSPHN1U+aXvU2266KA5GQmUu wmjYSTcBfkD9bFdX0MEDfXD/ARLJEork7OkK1LWDdqnOF6TymWOcF3uR+QXuSM/lTlQo RkSJMpjzWmXIhOV864nB6ymOvQlmsU8vYhfyQh/KnMJMJMYItKgQSDWWjt+cGAC47dSO DA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mnrbb7aq8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:26 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2BTFddqh024216; Thu, 29 Dec 2022 19:02:25 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2104.outbound.protection.outlook.com [104.47.55.104]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3mnqvd2d5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Dec 2022 19:02:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ieXAMMbFYbiihPpNGHLfSjQxnYKQtw9BnqC+c0nkpRMQdZqURMthjJZyacGusJVc7YNsI+qhxKm8YRqFqvJW3u8jGgQQhaVxhmx5wtvpHaDaf+5Kj3QSIqfYXoqv2HP+nkitfhxdYhaIKaAdPWnQDBlVSu5ETXvPm39rYuW4+yXCl3BI4s/vIYSfkU+QKlJkI2YtzxOTvR8VIhF+qGX9tWsB97jRb47A7QQ3bb+m0P9vN3IRiRSnKs7r+EWxyUP2q0yd4EF+s8GQ4wcvaslg+cL3qTIIzPHIEStGvtx0a8yh/56Mvq9U3rTxCB9VrYc41i4ObEd2Nr4TfKM3/nVwtg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kSIl4oR03dTCjKvm/u7nwT2jpvXvfUROV0G6Z3X4yCE=; b=FB0pITS7spVgIPnqGKM/L3JxBJ3wO7LsSoM9s3CBMonMfZ/1CKuBWAiKTu66VIB1LyGFE+BujFrQFk6rE40oPe2HnPfghkeB1ypsx0x2xvbym9tYCBBJVwLvO/RWftd+Fcxq5JnrJ4oS6OkGMeIv8eWpYojdNWyBlsj3d+LER7etmhelyoVbW7hSswj2ck0LCqm63ayLlHuZGRDxK1V4F0VsnoZL6j3xKgRtiKlaSo/uaPYgmHSVt7jWV6AYRvXOdbR6ejrWBLMhPXjB++tzKAcImoLQjRJ4m8VNlT3mN93yhPanDuvVkvallmohvn/7pjhXS/DiCn+GplHW/A29rQ== 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=kSIl4oR03dTCjKvm/u7nwT2jpvXvfUROV0G6Z3X4yCE=; b=dait8/nyCgSwCr/VNPy2j5dX9PlkS3CKVAZfX01XKmW2JLOwiCt5Q/ta4oW96caVjHjt5TLkgN/qACOEWvsvHzbKP4D7rLt8fM9PnECBVoQqFgeuNpbb+H92IG9DE0rLYHKc3mbJBPIb1ML6EPv1jcBhu5Zss1QIs9QkxmRguKo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH8PR10MB6289.namprd10.prod.outlook.com (2603:10b6:510:1c0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.16; Thu, 29 Dec 2022 19:02:22 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%5]) with mapi id 15.20.5944.016; Thu, 29 Dec 2022 19:02:22 +0000 From: Mike Christie To: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com, hch@lst.de, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, james.bottomley@hansenpartnership.com Cc: Mike Christie Subject: [PATCH v4 15/15] scsi: Remove scsi_execute_req/scsi_execute functions Date: Thu, 29 Dec 2022 13:01:54 -0600 Message-Id: <20221229190154.7467-16-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221229190154.7467-1-michael.christie@oracle.com> References: <20221229190154.7467-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0058.namprd05.prod.outlook.com (2603:10b6:610:38::35) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH8PR10MB6289:EE_ X-MS-Office365-Filtering-Correlation-Id: cf3acdd8-c236-4f78-5a66-08dae9cf3747 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BwUcga1LdQHhaPjNReEZNaAwtaUUSuuLQ8cIWM4MaTPiX1rSCIJ5bjTs9lmnW3e1RAo/AHvshmkDkMAE1hOAxi/r4mvnD8KyZqPFircQ1MuN/0Hc2biWB51A3zcn9pW//Eq0cn2e0ztm7Gw0565pwXurHDU2UqMD6XsOEClfqwOPUi+u9LPWMKbsi0fS2ozLyD+j7vOrxO7IotLUPa6HxSqpPvz1uNwxOiYrgbDify9keiNbOLweRsJX5ca3SkFHPWOpVWdESjPjz5AagmZn4GKYFLSfsXk1CmseOiABIYXQeuxzZVoBMBAiqJ3H5eLcvympZ0JJBil8E2BplScwCrKAS2pEASQ+J0rMcqUIHu8r9BredAfG5uSdcgUamjLD2qn4P4JMyCJh6LtORWcITT+AWFyuaK3hT1pr7WF7oMDAw2O1vdJH/WdNnDPK9O2zgRj+zDdhqCGVuUsgGIz+qHqgTXbF5UaJpBjyCC4o31eaMmN8/vPbUFjsIdRqiDeGJ8DU/ULrsWA56sT9FZKRzm1M1isuBimB+9j+TZ+gWS0xXlrFovcZsyHFCemlP4NAm5VCY3izR4tUTCBCslb+xEqvp/IwN75/2hK8dvdpiu3jTCxC2x4dVnO3e0rf+Fb5oNJ85usvgkNYot7lKgiHAA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR10MB1466.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(366004)(396003)(376002)(136003)(39860400002)(451199015)(36756003)(86362001)(66476007)(66946007)(41300700001)(66556008)(4326008)(8676002)(38100700002)(83380400001)(6506007)(6666004)(107886003)(6486002)(478600001)(2906002)(5660300002)(8936002)(316002)(6512007)(186003)(26005)(2616005)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ccjDXJUQK4tddiCkG5sjVncc3eIRPmIHAMTCW/tqwfNxp/eSFuktJLeiorlJOYlUuFu3qa3QVV7VJ61HCxJfZYV3GmFIIysjDoV60zG0OeoOHGyxoaVxFoIoBw9mdvVJ2LWU2e2FTktRUJrn5lor30k5phkEJFlSpx7NPM/n4i+h4OP6LzwpIIRenNrJBAwk+nTYwF3bGt1Gw8J/SBN2F++SZMSJLrJ+iqGZYnSK3u/ouhdOm5+wOZvZjhDkOg0vfvguVbzwZU/xxgpmfeNVDJRrXTccLyByEFZk6R0nVXhA82kmFPOTOxzUvwTqTFG2Kmb3Ek9oaCjOyFsiEZhjLZCsIIstN7ev2iwAjjwmMUUNv7doY43pF2eCHkUzG7znLH7FFM0hpwES6mwlnarVSFoOqPq0a88C17Qg82Lbi9RNr/O/zZvL2WfoDIaLIjGDzZNLzYH+lJ8fTEDmPyiL9fQZhi/YPm0VKsbxgaxatBj02drdihrStaqCIxV7zCnOpbrk8yX1NfhmSuzC+TfVzxaIXp0M6Jk0rvFUuc01IOwCrh+6pHuqxPRuzI0IVJIZHH9vXLwqjoTTxiKIDMDjO5ptfJKpDUjoRKaW2b+WTw+WDw6a27rQw4aksqjvXqNkJh/0R2upk65Dj3llIIs2XnaQR/CT+dTUoQqvZKNVA4xbETzVdoTHsf5cUMdnFONtttQxNV7/+L2moUXMmLOfTuDIEuDLwo3CRmIM3DJOUAi1HMidE44amTnFJewx9aKYKjnnqWGfqaBu8lQmMrPuJGxNZoGAmSjPDTN4fIVdA8Cv6Mxt45Bq5g0fEnOQyHKs2keVW/2+BSM6PiUTVue0rTv+OzbGlK8di+WcMH6sLAgaUJduM4tiR0gCGdiZ8LOMOW3XYWvD7tQADrE+3gdZrVYaxsl4l8Bq6ipcNcm51Nl8A37QCFIbckia7M+Uql8UXXGtn85sXX4U7lh3hYHym0ZZfvHgqt4/tq/LfwuHaURR0dlfnV5aP1udURy9W++ricyUTZIdheIVhFFg+gDYJzyFAhIOTkwaZmqh2OzvtkkGMRS86u0yVt9re7/Can/vgl5epB79IqcGzT/vsQ30d4xgjf+oh5KsjwldroOCLwIj27mx33BxSLw1ETv5fTij8+F2i0ofa/JTCa8FvaoEptXCBGxwKrAUOH52nqQXxey6X1K2WSdTRc9cXP1EwZWLQL6WqOVi9/u9Jm/T8HdeKa1xDRL9c8JZblFbLd9idJWGtLmcdMScekph28WPLcr5/XnnyR8c+OZb7ENo/Irrmp7dyFa+9TsWjTkK8buVxucwzSbyYMpAtlz6QUSMLtOVLgviP6v/PcMxpxUDfI/xPEddRcfWU501f4TKrO0I09MGhvlKWepyONjL2UoBBQ8/F5+Cr6WoEI5BFywB+XnjKIi4Hpk/l2TVarn+EOWpChVa2E+8HYowE1Z1eGJla/RjF3Z0+CVQXr54fR61kMoStkk2tVu0qzGa75usHmhPoJEXL9dDzQlgyNK7l0MZtDFlnCQd8AaO/OL1AhvkJpqE7z4vZoXty5WkRG7zBp6YJDHEAlrEOBVK5pSx6XIs8ATJk11REbW1MSpLhw53TNOPJQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf3acdd8-c236-4f78-5a66-08dae9cf3747 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Dec 2022 19:02:22.2052 (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: t+jpf4rQDqgAT3XzKNqXHP92SGANBoM2qTOp6x2pvfIz+F/niuWWyZ+zfKQxJ7Hfn9O5dz4f8lPOrdkZ269yyMbyF1Uk+dllFh6gOBLx/+M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR10MB6289 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-29_10,2022-12-29_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290157 X-Proofpoint-GUID: N3cckSQiIvrKuFrVzpZ8_pfEmUJfcx7B X-Proofpoint-ORIG-GUID: N3cckSQiIvrKuFrVzpZ8_pfEmUJfcx7B Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org scsi_execute and scsi_execute_req are no longer used so remove them. Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig --- include/scsi/scsi_device.h | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index f6b33c6c1064..7e95ec45138f 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -470,37 +470,6 @@ int scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd, int timeout, int retries, const struct scsi_exec_args *args); -/* Make sure any sense buffer is the correct size. */ -#define scsi_execute(_sdev, _cmd, _data_dir, _buffer, _bufflen, _sense, \ - _sshdr, _timeout, _retries, _flags, _rq_flags, \ - _resid) \ -({ \ - scsi_execute_cmd(_sdev, _cmd, (_data_dir == DMA_TO_DEVICE ? \ - REQ_OP_DRV_OUT : REQ_OP_DRV_IN) | _flags, \ - _buffer, _bufflen, _timeout, _retries, \ - &(struct scsi_exec_args) { \ - .sense = _sense, \ - .sshdr = _sshdr, \ - .req_flags = _rq_flags & RQF_PM ? \ - BLK_MQ_REQ_PM : 0, \ - .resid = _resid, \ - }); \ -}) - -static inline int scsi_execute_req(struct scsi_device *sdev, - const unsigned char *cmd, int data_direction, void *buffer, - unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout, - int retries, int *resid) -{ - return scsi_execute_cmd(sdev, cmd, - data_direction == DMA_TO_DEVICE ? - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, buffer, - bufflen, timeout, retries, - &(struct scsi_exec_args) { - .sshdr = sshdr, - .resid = resid, - }); -} extern void sdev_disable_disk_events(struct scsi_device *sdev); extern void sdev_enable_disk_events(struct scsi_device *sdev); extern int scsi_vpd_lun_id(struct scsi_device *, char *, size_t);