From patchwork Wed Dec 14 23:49: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: 634123 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 09B2BC4167B for ; Wed, 14 Dec 2022 23:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbiLNXuU (ORCPT ); Wed, 14 Dec 2022 18:50:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229530AbiLNXuR (ORCPT ); Wed, 14 Dec 2022 18:50:17 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09D1846659 for ; Wed, 14 Dec 2022 15:50:16 -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 2BEMwmke025815; Wed, 14 Dec 2022 23:50: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=9+cE67WzofeCnO814dtrZv6j8MFFN4aUGWehf9HlcJc=; b=SMo6JLmr7E/0AFcdSc//PbSzAKaj6h/SuQdo//+Rg4AzX1SJJ0GRUbxhNNTv+CDwF4+X G4qvj4ggLpEb9n1tRiFeIgVVbQfy2+wok3vWf6MmAX4y6uCiwKRu1f0LC/21CR7AxZ1V YtpGVYsp1Cun083BWGFRwsKecvwiXI1Ojs9MfuUDtP/zpbsZUinn7Iv6qQTw8U8iXbIN RK44Jw6SGrLN3quzHIH4EBqXwbPlqjLQRnBQUuNR4F8WVc+p4KTplKkJkBIDULzh/wLn 4eZPVMEnPN5oonxQembr+CJ0DZ409ceWQImzDrCkWE7Zy5DbOvKgIo4hsX541VMoLpjH 9Q== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyewuq90-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:08 +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 2BEMGp1L004050; Wed, 14 Dec 2022 23:50:06 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3meyewunma-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mYn1YQrHWA2jWxJwxmNDm/YAG82qoz65d14ZAbyAQh43/jeFgpnEUtqQHOTgtw3XoHLpYWTOCTe6EsJnUFQhItQuiwfqwksL4RpQMHFg2pY+5KLM1VoN3TNQHjA7wWODLGJBbIvm+Hnauu4kjyWOpIcR3Z468Thl8oHZYr4DPCRjtFROjsbl7kI5itcz9U4N1I7u6hj4CcQWQ5jgZnh6+LnFCSwVMb2qppifwEzOSQcnC09X72doUUlb4b1f8BOyvF2n0IzS6dgAJzDHugZClm8jKRY/A5eO1FAoQgzDxfNLBcCccVMNXVj64D8a9OqifekyCJQ/nKNmOasE0GtmqA== 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=9+cE67WzofeCnO814dtrZv6j8MFFN4aUGWehf9HlcJc=; b=Per0Q5WThj8DRIXLOHR/82PsOwRblRJYeOCzAwq85SkqS1hLl8KpJX8eC5jEEhTuyx2Gp7ehBrRf78FiL4S+TjMOLg0ArYfvas4bnzqhilzPQQ7xGmbSyG/KBrarj9QD68dNwJLxEMYOavCqQBzHx/6fY36S6+KNpZUGYWsWWa+mbrX8rtNIht0qODzuTPd7LTf939JhQDjD4zTMqBiba4/AKAFh/r5wF7ASfBPCHWiFYMtbKSJ26vXAL686AACAsfVFQv9ibNv+PGfX5/kAis7mTW93Nx1LJta/INOiACxvHgDSdLmAX/NpMasZ6ItFPadPPryPBtGEt90+Y5WsYw== 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=9+cE67WzofeCnO814dtrZv6j8MFFN4aUGWehf9HlcJc=; b=Lbu2e2P985XpZ8Pyz9XJhwkppP2UHD+8n5DBZhbQQSrInC3YavHa3U5ax2u54ZiPi140XHH4KSvgl91HA9rh80ZlmP8unNhOFH0xtRJOfCqH5HLkbP8nKSg0qVyQj65GrIvIkWFjWjh8oPgJlQIZqBRTISGThqnQ5JLLlpRKerA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50: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%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 v3 01/15] scsi: Add struct for args to execution functions Date: Wed, 14 Dec 2022 17:49:47 -0600 Message-Id: <20221214235001.57267-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0072.namprd05.prod.outlook.com (2603:10b6:610:38::49) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 00578149-efc7-434d-25e2-08dade2decdf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T9j9YJVJHKuS8IKR8sRlLe02XMm9ecLUiMW+3ljKclgTL+MPkkXyHentFfvjRHhDnlC4NCRI8o4mAb0n+N0wI2R9LOnPrtLW+KXWUJCWDaXTQKJMXsqLyYAbfg5I8mvAqLPn4I4BWsEI2Y6TLMdAXMzmUuiGU/aEwUkWKHaUCPl4LChvzSLhH9GS2/BKoqcHEeaLtTYCWlM8WFKugh3SpoYoorTwsoeiJaob1hxrlRd3Vop4HeIz7YHUXmP7yGwJSnCr99cMY0rq15E80zwTiLL/qVu2IokkiO6UtQT1aFrQhxE4lISi/SYYRLkZOxIr3MSzbQaOfZR/UtmCyd+VznFQB1LGhlqJCFHKLbH1cCAWpPXkSA2BamGjWGUY4s9BUfJUogPSyj1OHhuNelqwqntOFYUJ9mv8ZBjP2qWbOwVQWLgXgH6FUu12YNRWLwLxZUXkjlA1zKodVSYtMO3PPc5gT4U8yJxB+CoCO6cbCgD0GWUqCHKUGowFaCzJdhJ+IyWT3rJrsXpNGlG3nrEXRHEGhd+ijN+36uEhf+0RlWqutgsixqYTbVBYBerVq7vVA8jkeMeF6A+PmX+kxLxYMoN0iq6ZTWW4s7OPsSC/IFcEc5Erc1hWQ6U+B7KfdTqvEMhyQRgEM6XGUrTzpg8aww== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7ScV7WuOh/nm0o0r2Y1XXozfWpVso4t7vPd5Jzw1KIG3RJP0O1Z/L67xGU9UWFIiM/ilqOU5jWpBOAfmBNhonZAymXeLbHesYLdfpXS2ljZAHbviMp7i3+lNqkfbb3l8CXZLEhZtjANirxX6ngNRgNM/R+30eSYJabd+R0yp3ICSkKJAL7vQbV0Yq76/3rvE+MQNWkiFySLCDzPZ5UvEMCOwlMcb2oGZd1pswhTeWHOVQ88LSVI6O/kCdbFVmSENXLfrKa6IZlucujxdbPdpvexYdiJWivp6Cr+ZKXdwoDQbZbKhMjRU0B0gWwf3OXnVbRDb52PnJVEkH634JhaHqbqMhuc56yYq276CYIUI+QWZIXCvRqA69Qf2CE7GKJ+LZRKCG0NAisLHE2q5yz5SOktVcPkD0sfx42oyKaHqgWy+QrQb6qXgBlK2nd+3abWhI6Srb3BhE8X7jfqwj1ADxr7KUulK+Q/kJcjVViNaAb1G8Tnwvzosmw265MCAUh58mHG1YKUeFRDcaZds9Y3TIskaoBD7sGA+Rnikb9NSMg/QR6rFXrEEqOdbsPY8E+TIUIYpWnHecL5psPFZ7Qacvel8VsmEdjUG9Ac9Dgz06YF3N9RokR+OyyMj5rlvE8nrZ69W1AYaPfhLaaXXuV1mi65zfQqa6tgbjQHsQxKawy5AWUBLnLHZ9w6xKzFcJat0xLPywRDXmRvfXrHK8zxbqF2ecWvtGp2Mzb7eykxUlWGUYi0U8n1l7ca4Cme+BW1g93Wpv7g4IFhncAaOu1cDxky8D8aGyzwoM3lC/KMNReWnXHk7DV7ji1MqIybeKpibKrC2L72UHOXyKMTMSqacy0sAJsx36KY8UpaSXjhQoRirkBJyaQgMDUd1hAmPPKpNHZKYs4IPTzw5LdgZqzjJDVA8qfBTqcjVKDFsX1STYc2qeb3GO4W8Lp7ySlB/JL7qCK1OuRvZUL9mQuLfYKwopBS5ElXx38jLw89Ifslaiia0lcNd8lVinH7v10pzPODoczrG4wpLBP4id36VSUnhyeCpntlWNK//Pv5YgazucIfKA0BVlhYdMSZQoljWFOFruh0mwqQ9Q2mGCXpaKDhOG7iva1DD3HR9S6f1Pqk2ELkj+Syyk196RdnR+9wv/irmSVlAtVeaLwA2bum8ruswrOwNxxNnnpp1gmPBNxOF2YmdG+AcZrDNs52uImVkQ85Mc6nxEKglg9vxZbpPmCSUhfRHTSp7fQmYZp1sKIfQnRtOJ3AUlrgIBppn5ktvYs/heWuberNX59ArQD17MKPVcyo4do8V9+C4CSLzqFdra9UZK0ATOUZGq0ZQfzzjZdennze9qg7x74oEuDkhRIPI02GqhlfAI2LQ/QtxGwlvdJwSjTel9sjkiTveYrgxLlvTI2UBP2k2dLFxXsP5N9FW+Fca+ROQmueyGeYFtAZLCYe/Avsv9/Tf5k2rRfJd5/GxlQzDHzYXjOPwen4fT+9VtpHgmwy+ZQ0n7eyyAZJhEzfkrbXuAY19ufCeCTZfeb6+HEEdIgWRpoiBq/8Y+s7B0HeTk8Kdo/a3+OZCHVIieNpdwdO2JoWVvhAC7ClIbuRdU+93ZtWrthIqGAmPGt8wCw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00578149-efc7-434d-25e2-08dade2decdf X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:05.7319 (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: Ay0U2R6FSZy09cxtLoE7LOwWeNaTUwRqVL/ERmUKNCQ9Maa1I1/m/7nKiKCGbBDvmDEJT4OmqKpEQkHxjYhyJ7C8yuPmpSX+I8C4xaTZWrs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: rleV-Wv1e5E4kY1ai2-gN6O4td-O8-qf X-Proofpoint-GUID: rleV-Wv1e5E4kY1ai2-gN6O4td-O8-qf 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 alilow users to pass in any request->rq_flags valu, but they were only passing in RQF_QUIET 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 a29d87e57430..7baad7ec8887 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 Wed Dec 14 23:49: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: 634758 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 C55A5C10F31 for ; Wed, 14 Dec 2022 23:50:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbiLNXuX (ORCPT ); Wed, 14 Dec 2022 18:50:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbiLNXuT (ORCPT ); Wed, 14 Dec 2022 18:50:19 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8DBE37224 for ; Wed, 14 Dec 2022 15:50:18 -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 2BEMwhII024225; Wed, 14 Dec 2022 23:50: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=2tFmdTKPwf/YIm4FvpBFQ36XRGVs1Ba8812i1m3ldCA=; b=eH6cgIWZTSkcdMHqmbsP8zPLKzUzwPnsdVPd0W04OutfOoxOIDEbgurMRpOYXEq5oBk+ Bf6vOk0s8MVeyb881DSyF6CtnS+Ohh2zfaGJU3Oor7AgxsNoxUz8jq4EBszcBAAam0FQ Bkmv27kOmyaI5xY2VvlXzPX+sXBy5m23Q2lPYPB/Bcah4TF6l9l/wfaTYvgf9SWNo1fm x/JakKA4O74XsUGFuIGwWAfjstw8KBLyNxXjxVCaN++uwY0tttYnoRJh4b03lhzwnU4m Vy814Q3K3e3F4CfJU81G1ZEPAQ72WXJfs4MJX71Gk96jzvRhJXmd8W+lDT6cp0t+Wzyg Hg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyeu3r14-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:10 +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 2BEMYoet025161; Wed, 14 Dec 2022 23:50:09 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3meyen35h5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V7852c2roC0HYlT2lNU0yqJ9x0+k/bviuEeGz6u2BCbl1wISZdt891wlNUI1R+C5xx+PnT9gNYnafX9+dUW91Zx6NetSXNYWHKSfAOSr90u9RBtGlfUU5fON3au4dg+tenT0KmqUs/mv19+THarip7zI5NA+piKKaK93UnsQAu/LIv5PX3xWI7Ch2IZ7PfpQ9VOaYfmZX786KrupWyL6kexZp+0byJ79PWQTPl4FjEHDblnjV1QzpHDWUk/2frZWOH2cqAqT84gUwuYUV6/hTPNw6v71kghGSMArwYcw8ijNSF0J/UQm7egt+HhXTH5fylNTBzgpuiskKDL8bcji9A== 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=2tFmdTKPwf/YIm4FvpBFQ36XRGVs1Ba8812i1m3ldCA=; b=fZZfagOazKT6+svr+AIS6lbcL0f7gNDDcIhVZxB8fn9XbywnJZ5rutbjR6gejKs8jQvo9A1IQSphLMRLXlUjOZvwlkjlBRkccTiLkL9peIITQBlVx4k7r6mXSiPEXeX63gfUHgs6csL2NuyVNxJBienOs7dJwqyNf+ZnWNj/p7fnLqpiYv4r2GbwzLN88IrrXskkg5aa7f/s9Uz1qn7L5egMRQ8SsZzviHZxmCB6L+187JcUwHn9y7rbgtDULAAFuZQJNjVIx6xXEhGv2u+BHNoWeswYgrT37K/6v8ZpvPGj7HSWlqXpekZRJVu5OwyxbsjnC3nyUxUdSfWZTzkHmQ== 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=2tFmdTKPwf/YIm4FvpBFQ36XRGVs1Ba8812i1m3ldCA=; b=OVt/79diGm9ugFVmTScPnMFW+tDSkptfIIkqXOA8syArt/l1B9my2Lw0BNRpb+ktsalCjJQN9x5hH+I7pW9AhGb6UIHaweFVGP0iEvTxZTwpro9l3tHUlmGs7EOZCinmOdMh+SVIwembzHIuhH39ds92JrRWIubsG4ZDwow5c5g= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50: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%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 , Damien Le Moal Subject: [PATCH v3 02/15] ata: libata-scsi: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:48 -0600 Message-Id: <20221214235001.57267-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR05CA0055.namprd05.prod.outlook.com (2603:10b6:610:38::32) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: ea5c461c-9bbd-49d5-ec61-08dade2dedee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g29BT9c9+/P+zOjdYn0cHR/60wY2ngmFXfIauudAc4frexh1VZjj6MRXzkEzusjySBQW34c13bH1Jdb9fN0iWUFXccm/6qNNiVBg4fEZ79xAE43v6lj5e0XQ1IbdcuBcg8jTrYNdKlF4ThXVcjeYbFJoiH8nbZFJx0OJqw7jcnayli/qSOYk1ehuSJAPEkoyqXXIWWgnwW4ozDoIprvYhVBsaEsrNMqVcF2KmkBAaPI3Ay1XWyzqL4Mg+Ds2+00d8dsPbTMvf8qZOsosYdJDeC2WdEhTyUzDXyBFEVeo5D7qCL0Ywh42IcVGyWNqUjvIyKhUg0zckW2Om9dohhdL7jn9yKuBhw1d+U+7FpKXkZ0I4A4hgS5CdCJux1ZAhGt+blcXNNCukhCX0+mcdwRjLYVWJCAzzV968820KtGmclMuRPiYi7lK9KBu4KTgFwktckAev9hcvngK1XJcpbXUnSeOEiOfeeV3ng6CJUUYLudnVdswXOQT4EOvo0WEZV3dv5OUfcHGHfA+wllL3WHTYDR1nVcmHf1DNErvZFfEpa2Lj/4i9q/Wxi0uc/q+byLH7vp6hgq66X4XwpwFSczsukOzt2GAfavBBObxl9ZGg7NyTRpWmur9nzr24BIDtGkHFzhzxd9V0hO4WthfD6OfMQ== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(54906003)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8RB3uPu+4MMtcM6Gx+c4rvj/VyjGhy3QL/nWHLp/vB7IPu04IpDfkBwOzdrekMcwc6tQoRSQeDOo+RNik79uTZ2cyiQqX9DVZ03SfbhT7tJH4HmpaUVwwUwWJR1iZSK/tYStLhSom7B5AFAC5DO7tra3j8/YnMue/OyE5nInSvr4cq6M3wGX6f/0XFymSnqo0qsJ0CSA7bLUmoDMeErIctGQvO7ByxTOiSpujCKIaTAl5Dp0581f7tEBaSvnT/K/g8ICZDV/vAPzXmmkWNisph8r+w91TCJvtA60YjG328macrIkMgBAj5+PoVyxaofAzZ1l5B/ROrxV6puCSed7UIOe3EenV5PmkuqpMKfBtCb2EO9WI3GKUAmWflEO+nqVYCs3hiWiRX0ITjuHdi0sCn0DtrTe3QkbuHIjpGXjYw1zq/bjSnVbZNujrvNm9oHitckgyhmxRwMQp0dcTKbnsGahD/4Z13UehgTbkZZs1czPmk6cOGDhf/jh2Lgy7MOTWplAXX0eLGEKtKM/qnA0tc7BjQdv+KWs5dHCchHXa1qQO9jFkOV2K9S5yvl2y7ipNsl3UxwaJgRkqqum+tb5lKF7XHdi8RecHzy0CCCA/j5Xkh2GbqDC2ToIvzMQIyTZFF0GNxj4c6ZtjZ6HGz3P6/wOOq6/QW42KIJQcY2e9BPh1ac935UG7tzZy2gKA6KCzEtZm+x7qH3tBthkMLs3GiGkgXz1RoV71zWtEcAeNJLEGwaLGThGL/UQNmdIz5XMykY2E26CuG/kwkYcmLuQqWpsUEwuQ1g3l8e+7Sig0zBOhn3VLGUwD4SJIh9Y3gIqFInx2+vIWJzHA2A143ZZLHDe2tPmK/UgUhdYw5ANeK3A6PCetY/B6EyWWCQBuk1Kqr2pFSUqt+vd5qayr1X09D4/BTnYvgLM/JRAhD0jnMCWjKyGmOeGTuRuGm6B3OzqvfJyZNE6V9Z6yYEzkl0+TkLMoWNqzat3pSgraRtkNn1c1RWW6fDFYMybJKBj/2aGsfjFRFS66H25IYqF8J055ozvrJKVHDnaTjvIWyq1NOwSPcrSOQiz9KAxOx5dA1QExJruRmVf68oay2scyjzuqzhMjisvH9meEs8oF/tNawVoVvyXXJz7lsjILHlW6Cu5wKIgD2+/TbjtA12j+PFAfI89Wb5ThX2ac4RtRfgoCR+pQnztvVa0zFaMjUfyjBij/Loc0/NExItfBecw72d28r0YAwf/eJUWXE3FMvMhAwbXqhUiO7ophGZEZe7jQwOI4i6YMeSj3be0RtYNrmMBYBj2eu/X22H3us73WkRYMuEzKi9imn4lbsBrcZIyoK2hdQJJhRQz02BSUFdXBrUD4jlln1sMU2TjKDEDP05WdHg9Y49WGqwHq4L+KGNHNrHB9GagasavtqQ6LBhZ+Z0t9mtDYh81x+PWRlyN67wuBt7WPTUGi4SLpnzsZL9a6JI1abmCKzE4qlrpYMgBcD0AdYxw+xZB1K7XOXc9TsqJk3ZH1LvKpx83PJkNN8cGZ+1DGz6JMyDoepALpca4AIWo3MFG/bzeQi+bOy5M/ErVXXmOXIDkOgGOyA3q9D58d0IrC29uHXGr7HcSEzaFaYr7RQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea5c461c-9bbd-49d5-ec61-08dade2dedee X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:07.4349 (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: GfErKFZ/D5wrLj9AQUC1sW9EF4zFw7zol/LHUKZ3laF7PC3ZzsUcbsCxpdnqgOXG4kRxkFLlB+rP5WDpJ5MPZ/b1HcnrxneNlqmaY8DpuHU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: fYZwYfwAz-UhvexObbdzVACOcC-9Z51l X-Proofpoint-GUID: fYZwYfwAz-UhvexObbdzVACOcC-9Z51l 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 06a3d95ed8f9..d143d80b1f03 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -367,8 +367,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) @@ -391,11 +395,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; @@ -413,9 +415,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; @@ -475,6 +476,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; @@ -497,9 +503,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 Wed Dec 14 23:49: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: 634122 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 AF650C4332F for ; Wed, 14 Dec 2022 23:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbiLNXuY (ORCPT ); Wed, 14 Dec 2022 18:50:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiLNXuU (ORCPT ); Wed, 14 Dec 2022 18:50:20 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8255B43854 for ; Wed, 14 Dec 2022 15:50:19 -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 2BEMwnkf026698; Wed, 14 Dec 2022 23:50: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=t1+yz0HnVE9Q8IIwHFqzvAu/rq3h/1oTObmdxTCS/FQ=; b=wKSKqNP53X+SqyB1bHvhade+eYWvaislgOvehIWxlRPidfEe5p09DhYbml/y42joyk1t MB81/EyxVTBGOKTYZ/+l42ycdN/1bYW5TBMquC5ZQCKzzfXmxtkA5mHfHJOCOhEfzbTo 61ouX3OTOyZliCLhg6RX9xL6wM+N+16nTqv55Rjy0mrNaL07M5xO3xcnXEHxHtur9WZK f9svNEOBA2D0eRUoftoRX/anfX4czqWjurNnJIhidJFIF5hWhdPxeRgnJIf619+53Jth v6g8drv2FGTn+R6vi+3E4+e9v+++BQVCz62kWPdxH5Kp7PyBqpkftywkY08l/QSMbC8n PA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyeruq5h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:11 +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 2BENF41H025499; Wed, 14 Dec 2022 23:50:10 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3meyen35j5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Apncv6m3Zgw0dBxuks/pxjqKpXtoDgkAD2j1GmNRHItieHfKCunIkNpYzcNsPVifh0tWj+yCHTO/7k2RurcoA2L1ZW9BLsk0S0c8AEAZZ9m4dsGyKPMCxfD017VjrEI4nAUZc3CPQTthyy2fbV6CphiFEtc+rTJUzsTtDWYScwzbAaFwaRGxWMhknLf7fBoIE8UfVFSP3t1d/4aRyWkKLDFhs5hmH3a4yajk9wKK7gTkqoW6wfgC0n/Izs9baTcLGFFuYhds/UOrWNSf2v2VY5Xu84ZlMbjFIVQ1AzLc+LPsWTg/d4B1BpCajg3T36AusYjJ95XnMdcnQueGaMpvRw== 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=QRDOF8j6sbE/sYRcbWpOuIVaI1LPDyZxx8ENEsvlqyqkpt9GzO7L4X7mtQmJGz42z6tg8Hb7iHSLkTRXRw5htaCwZ7kfTCYx2VKooIFqNQBMDv/CTQfdNYkEqOeHtnZSHUntIqh9Dra8QlG3/iTHA2U/f6PMpXI/dnda9zEu8T0ZbBDTM7Ar2Oj5jvMXM87fX8mKw96MdEFFRHZn1zfo25DU9dldZH2OZB7/KdJaWp12gt1KofhxdhbwVP70kDPWZZVNsY5vnrm0LDkpfmHQuSVixYIMYaCpCKc4jICDbJ6cbYfb8tTIkhNlDVM/B4LXpA4GmMXPvQeeS+jGzfauCw== 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=zQu3oMb+1Rl9H2dhso/erBV3a9g6hzxsqF0vMWNB7clr3L9zb1Xsy4nTIFPKer4epfE0gvnfdueokQ3jNOGnu9RhQBcANpMSktd7U1BUmp4cJe4zqP5Ot3eymkPYdDB0vgOF5AkUKEYMQBzJJtr6/gZdIY4P2DmTyVFTZH6CIkQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50: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%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 v3 03/15] hwmon: drivetemp: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:49 -0600 Message-Id: <20221214235001.57267-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR19CA0025.namprd19.prod.outlook.com (2603:10b6:610:4d::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_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f8e713e-5629-4844-3e1b-08dade2deee9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VtjTNEHmZnp5RyvCliUnp3Q0ljUld00C/Z6Mjvm4ZAD7TY0DE88CHQBOcexvrEK1XgnUR81npXcHJ/HgeygVprUT/dCZtIm7Ww8EvmCf1C82G7F8A6h7UUzUEQA3bcxCi7TminMKtRwUEMZjMQQUopxXlkhWYlX6PUuQLkA17KohoJG8gXlPXf6aZO+lZhvdgetV5L9KizoaeQ/NjMKWkPC9WqUwUzAwC36r4HfXpjTIEPRuWibTTAGXGiJ8p/V+zGHDh3NR5+zXWq18QTcLN9AsQHHDrNWKg8ubiK3ctzmjUNn6LSgLQRVpL4MgMweA1pRYqLciUOLalLj0lDE1dVhLBnVyks68BVw6Cp1TqYLEhKKDBQGflmxaoQnwq5EkZnvlVideLk681I9YJOtg6PtpJejn/TCpjtvdHK71p7q3aF3EP7abIBBr5+vYLK1bYKhSm9Ps8gocX/gtYEmaxkg02AKfjKDhjED1Zsgt6HSndr3FG8HWtz/b7GNQFo8xVHYSWfr8byG4fhdizTXhrH3ClE3yqMdbtnLmkERwbS+6JioZ+pGdZiyK3PClWuIDTdCExLk/Wz4z8WaT9swPSO/482FiddxrIGWcE70uwdOBj6/m9CDFkq2MnYStSChRBIj9x0JrkZC7D/QUtQwi9Q== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z8W2cEBn7XAprGLr4Tnd6PMfPZOTPXKIKkqCBbUGy1tcXBWmoaftJddyp1ipKNjpMqRSoNZexUJVy3BoKUkX4yGu+q9k3I5ivfXAGdP7F2o2JeTJewHIig6IH7V9cO6GBiPcrgCztDCIoaBJL1gdGhm1XtHs/I0qJ2Kgz3bbBVKhgt6vNNJ1s7mGZXYo9U9QPjxgakDJIVOX2dMDuVR4XLJDSYd373n6jxI/dygj0UnkLjTJGiCpRmb7ZMAnKojpGELMZD2JnodzMfkExru2phc81awMOjfXW12iPLONaFu01MV6go7lGHGBD/2G4jjcsrjB4iNRLFtbC1TvGSJzlKffJCCVNOsIM0lLC/8WpnvysO9zaZZMQikCXkYThJxXsO7VS0HDNEs8CTvFY8OiWkPR6sCYa/mWF4Z4p3vfien8dfBlpmsONyHVWxBGi304U5S61d401Nk6BfhyZKe4KvD9YuXFt78w3o/G9riGYEt9gQR1ryFiNxdykpSJ1CoKoF5x3i3Iv1DHGM+pMUte5EsZa2hGTTx2SVSJyp4Ep+G3VE+N4BMm9/vCw75Vj5AJIwPck97Vnly3ED619TcHjdnPtXJpQGIGF5FSzlBVxjIa7rlGqU+H9jHtILTUiNOz9One+sRTYTgLTdAOAp9lyDYkqfwkxjV3BKEusHKfZJfuJbxPdnFDZQogzjhpiEyt3ag4CUFFDieTEjepso2TC8tHXUG+vMgQJgbP9NCt3dNSRjB4GSvI/yw3YIIX47F8pSvHDI8fHOs8c7i5ZRHOaBQ0gvIrFkJhX8sGqtEmgh09tAWCN+KhfKyER9pZivEV+H+YNBW+JMmuPqQgi0hKgdobA08TAuD26m+rZ42+c5IaS0oIpSJtUm2ygeHdqEBdu50BfzGoeI5XrCbHV2MTEyzBKJ16Acw5QaIURHjIlKGUPHd7HWhJMRULv2Up9we2IounxrTtMLHln7REuoLAAB0sfY318Qi7vgTn/6jHXZGlCPPZknpDGf3hNUBUzGWMRkscuMka8kx6B6vjslTZSSFHG5X9uRYURwHPHxODutkuTWzjqnET/qxtbtmdCbysCDEBxR7v/ugwHApNYByC4e1MSP8ti71wcTBsSwk2sLCKZ+HcpvtO0YL7WXlufzwcDkG7ZBa/nTI2V4lnFUFzipyx62cfOgyw1Ji8wVY0fcMkMtMZTC10o5EYN3yaaGTwr9QtRpBdj2AbKDChbhk03vWVbYOoQ8CnGLvdjFYLP4aA6+OiSUrX9o+cJx7ID9bQ8PuhLlPAEY9ZvS6Atvkiiufk5Ha3vLq9/wvVOIQy0uPmvJ+cW/n6xIryV+SHZfyOA/qYtMvUNGCZePQpeTu5zEdquoAuIUL2t3P/W4IZyXX9v10r9YrHJvybkDxAaCQ/1QqpQTSIQ1JWtvF8FgkWh4XRzJIw+bLi3JQZ0J/kyGCo86ogRgeNYL8FVUstYCwc8U68sX8RRWrZUD3wgSnAbPuRcaeNAjOXb+BEtgSwHbHJqB0JLkKzTWz1KvlIgbB2NKMd5S4sYAxuhQmwGvBTYZg9bEV+b54LRp0AC+3B1mmVJFnkD4YUZCrh0GqJtl2SFj67Fd1/PZaRdVdUuW0fHw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f8e713e-5629-4844-3e1b-08dade2deee9 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:09.0441 (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: Tu7xAwBFOQdQ3UjuvpD83PeeKnmww1OFrZTMSDYYGhQz37ZJa2xAMZ/v9eZJre+YxRZqjcZOuD7UMXwIXlok9iTVsI4L8cV2ZBbXDU42MI4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: _pUuc1UnwXQIqAb3J7U7_MbFlu64N1mz X-Proofpoint-GUID: _pUuc1UnwXQIqAb3J7U7_MbFlu64N1mz 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 Wed Dec 14 23:49: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: 634756 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 AF4E3C4332F for ; Wed, 14 Dec 2022 23:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiLNXwZ (ORCPT ); Wed, 14 Dec 2022 18:52:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiLNXwX (ORCPT ); Wed, 14 Dec 2022 18:52:23 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5B38187 for ; Wed, 14 Dec 2022 15:52:22 -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 2BEMwnkg026698; Wed, 14 Dec 2022 23:50:13 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=i9QZGEfXu4ruFLHBD4ICo4VdrBHsrc/rMMWglIpyerU183oiuqKUK/DlM0OTmOSPBZ+Q rzg1/WNfphiXfxKtY94TGyxqJ+FnZL6QZa8qS3pRfugj9kPl8/6PZi/2JIroaWqY95VF n2Z9mAAzWyJkPOXrDR5XWzy6VaNUiqeCY1au0f4UhSr8Qf4ZHVpjgKTd/kPmw5k1irXD p+I0TCyIQaUKjXxEnhfU1yrvdqaEKHqd3Q6nni2vYQOdDzbuAnqNic2Cl+rHBuJXTdel 2c6eHxaFW4LuCpm8QOp5o8U2cTqSwknoPb9qYzUnvhMlNrxwWgmhXnXCX5KaIVcVIZoS kA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyeruq5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:13 +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 2BEN2QLg025131; Wed, 14 Dec 2022 23:50:12 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3meyen35kh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tjc4eMc7VpXZ0B4fEOvq4L4EXavuyFuOqDMuwLZRda41W3ahQ9MPzjrMcbkvUNrzt/LOz7N0Hf9vhmjc7Y6cuoWbc/Q8n8BNEkuUFG6ExAyFzaQSR0VZbAYDNUL35TY7FW5DhZd6eNFoCfwYD+AcShVEsSwVIaw2urld1xXVB2HRsEvsKUWiQoCgxwxAULqe65M9n7a2AvO3k5WzgDcvBByh4g6auioGlEHQlrCIunUWnT+sI5Wo5DzTgIr5uVcvmykNUi6xauNz33Q454m15IdIdikGvww5MgW4aIuK7HVwsYr/PE3mpJXE86eoMpHXdyvLiK3u6j0RVWcLXnQzDw== 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=ZMMaJKHCVnEvmIhokXOUCbIsWf0eLMuWrQiy8iwXpIVPJ5cgkvBAQYP1OkWABGspHqUchxo/AUUI75kwi68LPidF1Ym4cLpKduQPPMqc/JqbpyL6bJB4kGirejMHtKZL7Y+JwhpKKKg8uPRGa2HB0sRkqGIzE1HA2yKV2rY/7DpYs9w+ReR15G9K2b/w6LukLcs59svBFicEJtxI3xjymEdaVYpnFnls6rWlM+ET2Qx319FioO0BT+fmxa9S3T/CXj7p4EAaTlNXcxcB/tMyEPuhAnHKVbAR552OSv7X7UCj5WX1gVOAlMwoNidT7aaF7VWIFCv3ItJAPYa1Ig9QOg== 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=b0uQhgXKyiLLMvvxZ/0V/JynkI0mXzg0r33ngQ8u+wxA6b+fMqHJB/zyfB6k0sM3g/KwQFXdKknJycKi1VYdTLlBDKqKbB+XOpECD/u+2NSMaglV2ge6CRFSgrZ1VeyUUwjJsSInFXBz1Sg3eyHFqOQHE+FwVHtw3n+Nr4+R1L4= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50: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%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 v3 04/15] scsi: ch: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:50 -0600 Message-Id: <20221214235001.57267-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0001.namprd20.prod.outlook.com (2603:10b6:610:58::11) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 75700287-62ee-4c30-1b20-08dade2defce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BekB2UUQaSLYPbJbbkC2wO7F8Zq/Ga+umKD74yOiv3fSCqk2sVEC76YoNSsUlGLlKJOLPBVVu0diniw9LR/rSaFxjZ+BWZmk1s/OdaxCCEgT2ZIhSpGKoeGQPqH0UZhRDtVku84XkgMpcHQq/J0aUS+6RgP2YX/CpJQf4hh8s+LwLuGFWbLTcYEn65J3Hl55OSllaKkzduBzRa0BFRqGN1a/ooy78ewAlFJM5dn7LBuKWYILq2qSRob2D52fjhEBN/M0EZZYAlNvxRcUsxUIzH/OUDi50YFpgFeC9fqOhxlld3Ezila0YJq9YVz6PTw4f+7gSByWQJExZ3M72OSjYML7JxF+T8MGw1/BdGPX5Kwjk1+vSi05yvZZAvFiAzZIxJYPBEcGxMYymn/mjWHD+EZ6m5gK+1P+Ur61rqG5pCOSSlPYhzDru5Pex3wxehQxwjm6d49xECvDiltP8hMemQwNYMT3OUuGfsJsdpPY8yeGQvbUoBHCpvAAHmG5Xdn3jqMQI7RcorHPgDT3SohNSTxid/0t1X5Nfj2DS8cKwIeeByz5EG5C1MJCub9ShPGCkQU7S69qTr7BsuCPdxhMHDmh72tdwKCkyGEfPywfL4ZUB/dd0AGIRQiOMVL7xnVwzPo+3/jkeemHhRWnESAfww== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6CCcZ38/C/3xvq6q4MdEIOnV0Kj+7VkveBnaqz23sol/D414Mp0oFOLt5NnSM5XyTWr+Vecu+i6D7iMWRORukB3dVaYUFz48evWJYtt2CW42Ii9a6OFGX875u0cLkseF0Z8Op40Ex7grWDP2IPlatm8BaqAAJMuaDHckB+zPnVVNOuZSi8cXaaTdf5wMusS7DxsdZilq0bW31O1k0Z+8o5Gwsp49/U1STSXcsSnyzKDQHqYg3U73WBoJ4gmtAweziN/MmdB6H+FhYvKlFigwWJiT3FjKmsfRQISBg+uIZFm/LfoqcPSb/yutXheGmtufqjFnnAfpret/OW97M4QVDcM7yFxwzsNY2e1ZPqlXCoNAWUWTvDkp+dcrdCC7F6X37z2MZrIICedmlCfebVBGhEqIVZCduJgihFfHlBv8jL49ghdpjCS108wMKnKSWyusiMNtPeQALgSS5gL1dJ7zQVm+PrgiPAGJLoBMLhBT80YpyqxMcTAHELy2Cew4oatqUybdZ/rfJopSEqR1plAY85XcKaStVh3Q1oZRZgRQuFcIqLWqWQ7egKeryU6JjYnI5AKfXdsSyRTm1welMy28I0+YS2l9vCWefT9CxAaDSyIu9eAT/XocVVi/hZ22H7QMkC2F9D4lDQ+pjJebbRQt+8a56jtjHXPAr4Z89H2XKCqnaw4W0T0jyA4shbbHn1aZWQmkgb786uF6+jh0Pq6p9oNvVgFfyxy3lZUWOE7mWb9AACfoOIlWSQ+9sDrx/I2t1lPHygBHD/TVd6pb/CMWJy776OypMNlwQbBGB2xyHB0A5uWzxhC7OiSP6kEuLAgjLsWKkswQZ1nIijxA4MC2IO76ex4bo2wYNocbx+kcPoSoeJwoUrcJkOiAnnKJfVEVpAteImp4lprOoRLGR06Mixsk8/go/Uit0c9kdKs3/5GR3AV/31avbowidlB3gSCG4Cv/ViAqah9w9cbnHHo90+8lVTFmPAK/aYfwgd70WlwYe0WNxq3WfkjyqQ83t5m7NsPVq6xCnhn69n6zeFO8S5zD0Ibjv0d96+25VsarmE4kbHsOPeHcbobCzpBiE3pBOCTN1Ko2Nk3Pzh+yuYrpI8xZKtw+kebXnc3sZWBzkGb/morG7C0YjNuOeTE0iwCaGYAmwGsf6AlCbOarKQu/scm9zKthRP5zEWqM4SegMHfpJBBOKtnEXiJKt1DEOOJOXpWLp9eCM0wyBlXa+RSOZL5wHTblJryo5wQH7tSQI5xIKv8marmoIuQIEHfaopMU8Itp82TIRpiLXoyruAN0DaXn0siFCnyiToMjPAz77j0xUiJN1EngTUQf+KRDg/zej1azkrJUelQGpykeLJ1pPW4X0jQQejdZSyZ6MGNNrWoZEIlhSkPTrI8mf8ytxOjgihk4mGQNph+FaVYhGvIj2VQVxvf7UstggdxjVV1KdBRhsbawhCTMJ4rVRwBN8X7zgmhSPAM7EPtnJnC1bJ+22J3rsPLBRFQXt0BwjfsM10c1zasz76TXNIXHfF+WeOm9VLAWzmbk1qXZ9/TilOmoH74BOajAWwav3MFs10QXyxc5VDe/f46PAJK08VxzRZZ22JQyUc+fBHFTG+Bdm0uY+A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75700287-62ee-4c30-1b20-08dade2defce X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:10.5909 (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: LZsUExJ3JMSS+f8wltJz7vRcqfgGnUJpL2t+/OIS4pl6wVDhcUv9VUynEjzaeQevXXHxByEnEebEBcsFiYRhgM5BbTtigWUq4ZRSVA3+MLM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: 1Y2MTnWXLfIYmFckaj6LcYLSE9OZmP9X X-Proofpoint-GUID: 1Y2MTnWXLfIYmFckaj6LcYLSE9OZmP9X 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 Wed Dec 14 23:49: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: 634757 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 2D6B5C4332F for ; Wed, 14 Dec 2022 23:50:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229694AbiLNXuz (ORCPT ); Wed, 14 Dec 2022 18:50:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbiLNXum (ORCPT ); Wed, 14 Dec 2022 18:50:42 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9F3E4874D for ; Wed, 14 Dec 2022 15:50:25 -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 2BEMwdaP010417; Wed, 14 Dec 2022 23:50:15 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=wiWWBQgrNBZNOxrT0le4Yeljr0KAjssSDD002Y+F5WAg/BtqbW/HlO6kBcwOc4zpvz6Z I1/DfqGz20Ogh5Ebb0JZawSBOb3W1svjH6veS3O6cnd8ON4/owWkG38VXYWHIlXIb7pQ 2HsgY3DNJrNTzEJikIGZ3Mb/mdKihUneogAj72Ws0T8QQPpfenWxDNA7BegkFSsjH8VQ U5SrT3B+Bl/CsKXH25YiGfmKYckghsJ2AmGN4IhW7M3LmpMGW9izJsKAVfBvGF567+J7 rNsbYWVolxZR5AjRMliQxyPTe5cb3t7c66Uh4b35VWU6y7BuIudcidEl3jnCbAzsENIh ZQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyewbpmc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:15 +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 2BEMAxs9004031; Wed, 14 Dec 2022 23:50:14 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2172.outbound.protection.outlook.com [104.47.59.172]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3meyewunr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VzpbwK79mefPaI75ynxE/MtpzUWBlupKLMPZ0pHhNegkYhb0DaObq8IEBW9T6J96f5+M59CrBkxDBxHlOr8g2yzmGBg6sthD2Mogfn4ji0ebPNfmmnZCJ8okTifBn+JELTNNEd3aWuGazS1P4cwtGJXhD2Pl9WCAGsrNypP1GIYzWV2FYJslF1hLVqErBK+KFlMzI+kO1Bp/YVTnCtJkwwaEyCR63S86AoydeiAKclvBiLRtPYYsYsnykHKiyON79BoB6mK7a1ppnD7qHF1YLXLe73gx1TjdjP9ab4zF6JwK8bhRDlD/GD7+V4gefBd7Xkp6oxvESQXO9TLB8BW+yg== 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=GCE7kVASjeatfgZzQod5atLPVFQCE4pNElGhAoD1gDT2zg6h0AcphlouS7NqxMIXQUdigjeA1bUyOGVXbVazFYtPM7dpBAV4s8r3qf7Sw2Vp2eJVL+Ub52TQHuDlwsN0PDmcuOqjhpZZDDsJicu4GIXjIe6+PRzqeUP2kLQTXI4uOwNvJJWwF2G8B5xC0KsR6xORUjJnWt7RVrsbkxv0sRt2dCGGtD/xB5mys40yNR5MqOF0phWv9eCdJR+y9f/WSD7zfOCfyr1n5AwQ/0Vgvd26BkfYo2tOnREZa5fi/5IBrdS6WwOgdSO23amJJy2F/LVVU86bMmyVx7hc1aQhUA== 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=I2dm+PcbR4AQaiGMbUnuYIUgBe9FNGuW6iNdo6FSyuRjKVguKnxK4CTyhK9Xc0LvB4WiKYB0abQ7UC/gTE89MsH9q88i86RLN7yEdMY4fhAL2ZavLAtGUkzyu5kojUrmACp61sQk85GycjdOJ3aXpwuXAqOCyJfXXZhHyGLCa60= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50:12 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 v3 05/15] scsi: scsi_dh: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:51 -0600 Message-Id: <20221214235001.57267-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0028.namprd20.prod.outlook.com (2603:10b6:610:58::38) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 56f56778-faea-41fb-6f02-08dade2df0a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sfWD+MKpBAwqLu/SO+d/Qwu05mBLMtZ0sje7nt16rPmSTJu51xCRA7l++OK1jVraZPzKp1g1IO3dtFCJKEHyn5pOyzXk4/XpGd6L/yn9DzIJQS9dasq+ZoAb0zQ69TB8np69KHHuclYxwTWfszbDnTUiUIW49nblI6lvD8WwxdK/huQFtBGhiJrYATPO89Bqvy4ghzjl5INKlqf4IG/7X12to/szZOXwh9yggY0tO0WitOvdhq6A3xUlhIKsTHdCCpuZsg4I0LnrEvpvTyJgs5SW1SMpCCF5h4KmBy5iJCtRiqNT2qJKjiWFbM6GNWvcPXp21hI5ada2vtPGXxDeca2SBHKxmTP2Y+Akrozx3VvrgrFiJ2HoOuWHReB15djuaJkGYeGFFpz+90ARWwpoRz1vgFc+ScgXhVUcD9NtoXnnWlCKcjU9bWOQPmKQ2cmDRgUgFsBjYHl/feQ/QKEzvLNixy+7RmTecf3Jh6DOdC0KfK5HOxc0zppSi4RPksAKdWQph0LW0gjtIQOc/IFP3UK58UYDeIzrUoF2dXsZlN9eWOoI/QF7RIVpF4dD7hPcRCswaSb9XlgTSP+kp1xszyiaiqbz3EV9Gzp1XK+MG7z+zWpbEcMjIM2XhZc9BNNuTGMJ6FQ00GepZTEQ/gRatA== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZD6Bcb8D+HjqYW1UPejg/ey0Ig9jweKF4aMBWC8SdkBAPsjuucagt4z9RhM49eReI7MGAshYfxZh/0NCaU166WSpsUS/hzpCBy3Y3BGPfwjCqIAVtUrK90XzzjgCUbo+H7HJJ0uYZuTyUe0nET7AerKIFf+vL5oraA3Q1JExTxMQ7ctlrOYa86ATChhCgvxlUaZnd4MnkwNCW2Ac3w4zaDEY/iRlzZK0aZ9HwvDHZKLdnmun7pr237HcXu9tWThmF3WHlPuV/uWHK7a/0bjpI83PlNRWfYJS6GFPNrcG0SkTQFO+56blsHw0h+1L7PIuGKN9RupHna1VeQUguOJXzdW13Qee3PEHWp3fIG+NbcpMCrT0CwVSkiPPZwODJoDZgYqkMnLvUTw6E6iEFGF7LHWU8TcyMvjQjzMlYniq7FPsBq+0PVI4qjNiCwXCiO0E7QnRmRVNsihr1URACs3jXb2Y28BZYwg3V7FV6p2uYJoZxpypcQc9x3TAmfQWUe70IgQFo8q3ItGFafUYGqUD51pHpVaAiTxR2tvZwh8VmGUPgGcKm14jEaQo3dbgupw/XyJP2yrLlUOJZpPFMZdosrs1SEOf5lOoBGMgfQ+GR3lHlUENweL2YSlV25zfDuOOCuTHIpF91ClVrHmbLZxUNhI5BZqM6hXPw56U/cMfvtKg+po/MFaxVS+Gqoj45WDwdme4abRTRbIjU6vO8Fj6j/q1x3O/MGa0lmjT0YEidLGJVF8xIABbNZnHuSWubeTSi0VyibnwbEqLKN4yX6ckdx7uN1doae/liQQnRO5mLXtVRF1PSdpSRzhs3PTjdmgY/y0NTEpTgtpsynxZFYtwToVYtGZBlm0Q2Y+iDfuzTIGELMxF0V7nk9yFm4nLMH0N7NwenzfwYqAv977eHTawf7yHKuGFqGC0gg6rnNsK2bXNjYWieNfi25MmGdBwMvW8AxdOKY1qOLKYC3i5h7E7BvC2A422fjkoKFFo/yDyZR1GBb7vtKULd0DVRCfjYHWOU/UsTKWs4KuIZby0pAqW6/ucG0zjgiFM62gqbkkMaX7G/Tmozpn3231wePB+JpA32XMJHAu8Glc+dKTpSNK6tI+v05d+Hp9jiKwAveDzZQHdCl4cEmVr34ZpeJR1YDaeXV2pPJQBrClrJZ/QdY3seJ1yhnC7XSPbNJH0yws74ucLlMYz6i54oUqqIWr/5Mmfnb9/VnS9WUojzeLdYl/knZaLGbK6VDuPflKmg5HirulDPs1MTR6xhONa1MSUgFbonMiBW5gd0LS1njEAZzq3IpJ2yUVoLP8lRDtZB5NEbhNQKcof348pvyRhKR2U3Ah6/hSVOdH7E6lTkSM6lP3mBIUN4tQvRUrcv3C7N0L8S+Qu/GfhzxFF4X4uuNYPVAp3GXS6/IypBOIwJ5f4Fjn6WmoV/SWhUhUv4idfTQC9EeRNEg7Zu7Jx0fnMoyoWpljN0divB6KxXAiRBm8q1SwoQVi7fbWhjHdKyTCkhtAlphAK8Q0VFMYx5Z/D22WTRZbSKr7RtYwc6QErSb2XRTpY0t1WXqugxaPT3EdbCXxR+tm7NjSdswNwYTDubZ4VE/oEU0UaRdTFEpVIK3lTDP8g7A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56f56778-faea-41fb-6f02-08dade2df0a9 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:12.0126 (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: wh97KNXoF0ikQyknuXfdUeb03eNabyb4pAeCj58GBjgAIUZDPPp91kqAxjKm5b1g9GHF3nGqc52ZsmbYaib0s5elTQsfyqY8Z+pshLDCGrs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-GUID: oeZP7vEE57bnJ5BjjRmcxJj4b0PRmQpt X-Proofpoint-ORIG-GUID: oeZP7vEE57bnJ5BjjRmcxJj4b0PRmQpt 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 Wed Dec 14 23:49: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: 634121 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 06D39C4167B for ; Wed, 14 Dec 2022 23:50:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbiLNXu5 (ORCPT ); Wed, 14 Dec 2022 18:50:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbiLNXum (ORCPT ); Wed, 14 Dec 2022 18:50:42 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 402484874E for ; Wed, 14 Dec 2022 15:50: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 2BEMx7OH000616; Wed, 14 Dec 2022 23:50: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=Didlr3hOCl54gPWFPXYCkcabz0z8XfYqU051YAwPV+M=; b=XGAObBREqNRSkTSAJzmlily6Hbp75nnlxMcdoB5rl6c3E3/h3iqONonDg8bFtaCY01mj lekDIn4FmkO45K6rZsozdQuop87/uq0I5AcJF41ZXhc5sL9JyfpOqi2cSb22PqXqBpBa s8G0dS7gRt6ECC68GTaK2vS8QWyw1IlaMvfGipmGYrgHxdHB/cUle429FjBzH39QB8/c jK+6savNmOgK9ktEcS3rWXWpu7bixLigKTO+tJW6o3bbmX2zdT3FwdvwqcJ/4Ssi+Bgx NmPbCLj5Y8bzFXgL1lHMexO8vW3W8p3BhVzTj3XY3TWkxGlrnQXwmpxUwUVjFD5f2wmN 1g== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyewuqt5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:16 +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 2BEMosUT007120; Wed, 14 Dec 2022 23:50:15 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3meyeqkkmg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iV7b/lQaTH4maGnoCccJohnl+qzn3WDDtVqZj+3bovrTubPpqEPQ3Sjyq38WymbFJCCOKIjkxlP/h2MYyiWMCWJ7EyICR/JAb64Rh7ttLjs5O7GmIxokKsvuFDSl9Xa3kXuBDKDnriRjYpiC36EquV8flemk/Asu6UTimQg5f8JN+nmyaYsfCTd4hDoqUVmodejmN2tF64vcllUZNn3xbeBtvYX8s3ZaX/EIBSMuxU7ak0CGYSLMZGE14bPnHCVy33KsEzFucaNBXagQkdf/Zq3n02BVrU4Dxg1mkuX5Tv7TIoJ47bQzX4Js7yzy8B6g/oKRsQARD9ovBcU3vo7hSQ== 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=Didlr3hOCl54gPWFPXYCkcabz0z8XfYqU051YAwPV+M=; b=PpURDFjR6EtFCoTLo1JXKYLyT6GCtmo8qInibV+4onIj6q2aXdDJLAeWSULmgEjvzYX36YG3O6VXMqJZmwXn4XeZWkDtoWaTnA+tmM8zQjr2sHiinloZeb3MM2buvtIaoQTKEdup+WMxu/rcIpKQFUvhDMfQS4LTP93o7nujGGy0mKd+5fC0daSZaBH/s3Y/kzqLhlMXWJfv40JrUXwGgknU7T0ChiBtADsL1evneAJzDJua7fhU58EN6rhWBYMl4NpaN+ymAgA1bTluEltcD/IjRIkrGM0srNLOZhov8X/2p+yRtzeWVHuy5XtUpYpsUWYo5BNtjbt8SKakdgmPHQ== 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=Didlr3hOCl54gPWFPXYCkcabz0z8XfYqU051YAwPV+M=; b=wioyO3kz0NZNufGaMJaePlJSBHMxRnUsM5cExU7XqhMZiH9opg3WjvqzPaWrDb87e7yhh83vMTtZLPisR6VLeyKSp8sR5Vs28kJBO2m8ra2xKms+fwTrypUWXwtIFyUx+QBM6TiKbbH4o03vUA2bdSyF8Cimidqq6gFVYIz47oY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50: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%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 v3 06/15] scsi: core: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:52 -0600 Message-Id: <20221214235001.57267-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0024.namprd20.prod.outlook.com (2603:10b6:610:58::34) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: afce1f77-4ec4-4169-5e75-08dade2df1a1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l+iskyd0AwgBauZ5ZqkQgGFwItBVtQ9ctw5mK73hQ2Qt7xSGcE5TF71gWhAGtoA6eOSgYGhKtrB6lrp0v+/fGtEK7X1mLEslovbL2xB4AOHU95zeMsy7eoxR+A+fqVQ5oZpECZ5tMszSdKc0gX8TDhNyXI7F9cinh4atWdnZsUBCyZ8Rst8Bat4DVcJCyhTN4P5iTfLN6sunGjloE7SVlsn13wQOVri+qZzc/ftV2BhL9vLcXUTs/HRJ20k0SWV7o0H1TxXg5Sv1hymKdunUo/o6dZzHBZzk9NyLSOOEBPj2d8z86t7VsFr1VvSsaYTcD2CAWVDv+LNPhHP+DFS05gUavBF4VldEjYSXJf1zTwAWsWmOFmmp9k7u2SWhUuE2UZ4FwsBAwqHX0Wj9LDZJYOpujOwSi6SN1w40TBuJmg93prJWO2ao46OZWMMIq0qrJpKN9iI+8A9wwESP9eUVbjDcMAY3Om+WaOAYanxBrfQcQbjtRD3V9fFI2LHW4HxuE1KRfcErIyMIHIueQIk491JticG59Km1QRfGWXMfPDan+QzII58zawaQ5TqpmefyS4ddW4uEZsFHC9abX97kSWYZvnKb+8d0M/6Ur29U3qjPZkDTfq/dwX4OyLKAMZT2mABAMaoPXnX9XRcbDaoxoA== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mQw8YisxzLBTrTYGA0jc3D1vnLT2SOHMw0zkouJixEZnhkY73XE/SPQkENea+hEWmIzVhwK2oLH4iL+0QO1iAUzc5wANMf7/kUPOx8ImsnHyWg03B59LZE0AaMJguN80g5OdrAyXmBFz2iIncfwZM7iSIKn8uVWzHGfL3JsAL/YIPXRw4i4j7GVfM7MXbBVJT8bGmUIeZc7uM8H8rgIF2NO1YcBxC7BQKQWSKysFT/WZxIffa2UYT+wW9VKm6C83uznrUxiLKfUUpBOxUXkireaY/I5UddVDzAdpBQDxdkvYS9sUy6cjBGS5fls7Hi+B24GKuv7z7Gc8Fz7aNM2dG340HgTRxiJpfB3Jmlm7ASCt+fzxS3ebMzNqAOxeiNZOKCmc2v9ZwdkZpbHauB9+avBjA48VFfyN3pZjm2IddjWgG2vDwcxzgKiJgbme9oW5513zWfnFYURx/yFy1a8cQLVgfvoHmhKnyggH1V5D8JIP/59hqgB6pD5U6KCrhn8LJ7vaItsr2NSfM/Oi7Vq0goeULOsbl+JEUbcdZhboSwFS/rLlZzROnO2kNPWVp0IsQnYdH5kYF+YtMufkWe8vEMRcRSxIzo3CozRBcEaYyzQJOknr//+PXslRGuGMLBc525+i6ECL/3LnCXFrJtRudccNITeQFkpNcESZOjNNgKs0QMjbEMCRcDUxfckC2OaUsaewl+G8HlCxoBIQW3a/BgIh6rRRFX246tL/z6fc8vQFlePMAuTAWUFED8uiw/frGRI1Sad7Y7URJ8aSckwXYCL7JiWtYEJFGFQQKF0PM0tVWZT8Aog9D28wi51fDo4UyLYHurV1d7uPfLs28ZscR8hnF9QowiA39gWs4i5dvyd7xOwK1RWUReeMaW27//dc0bLa9vcu/rfi8vNCOmmgCcEJQQQ9vaiVRLx3nHD7kcPK/N503XA+47O5mrl29AlgOP7np45yWUMj5Snj6FelomA9La9xFUHuVR555uCqTQm0qCyBi+PnyM+TduZXQjYZfEDOJMrxCN5edR+KEz01xkxXEJ1VuOtHE+kj/WkNUKfRZ+J7YHgiv+SE2ntophtejnVtF9UysEnezbRg1TnzDtORDFPBrnWVQuleQfGySmGbj5etyzNw5SQbGG1GM5a1Zhc5RK5t73SCfWnA/YXUT1UiMXixzd3VaBKhCxwLOntArlxvgHgBsAodv01XxDHhcYZr25dceslAhc5j0jS3TplRG9brSLZSz3+2ickL5J4tTkssn71ebI1q/3Qll+pO0ZFhE6l4ki/YGS9fzey2C+qySy81XIHfoVRrR9S+0wOaDwB+BYzXW0VW0Q5JfzNzozoeXPkUts+9ijff6TZyvIeou7kAzR17NdCoa4yyOa+Wn6sdzb1NIKTi4xt7mSYKqp5kmFx6OY4UOIWosVurCTIcCMDmQ7dJH25GCMh4Rn2HylySDjD6Ll9B8mVfsJ4R5G5rzVykefrIZ9JKGXbamRgoRQLgqxFrOL7j7VxVnEuiNfrLt35jf2qoCtjwRRAr41SSQfE0QHHSAiw0x8754qjy2pfrIXaZwc83g/xovb6nxKlAvg61HP3/VpsMwfUXDh+QY9cVYMmLKUJQ7TKg+A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: afce1f77-4ec4-4169-5e75-08dade2df1a1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:13.6375 (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: e0d3tftCSazwG+yshKz1fJklSSGX+hFRVCaU/mKqHcLwJQQgptzxtNbZOVsnitoITJ9suwkhagijRkJwy8a2c07L1IFLdQ33txw4FSxpL+k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-GUID: kKEMdGXKdMlSw9ceSX4Wqi0qxXNi7C9r X-Proofpoint-ORIG-GUID: kKEMdGXKdMlSw9ceSX4Wqi0qxXNi7C9r 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 7baad7ec8887..9a8ca20dd015 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 920b145f80b7..844b3cb556ab 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); } @@ -647,8 +647,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; @@ -666,18 +670,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", @@ -1403,6 +1405,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; /* @@ -1477,9 +1482,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 Wed Dec 14 23:49: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: 634120 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 11378C4332F for ; Wed, 14 Dec 2022 23:52:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbiLNXwd (ORCPT ); Wed, 14 Dec 2022 18:52:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiLNXw1 (ORCPT ); Wed, 14 Dec 2022 18:52:27 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B9CE167F3 for ; Wed, 14 Dec 2022 15:52:27 -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 2BEMx7OI000616; Wed, 14 Dec 2022 23:50:19 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=tL1VtX/efEYNs5c7rsIDSfuahhRAROk1zh6UaBHTPQgacg9QOLOGaDsOyTmJSM64HFFV TEf9MjPcXzwTl7JlkFol/MbrQmV61Q+Np9wfUcFF8869Mo88ecHyQANsgBekibYk+3of Zr2M1kYfA75SuL4ahbd/2BQLEjTCb0h4pOPZC+OacWx15vYe6fdYcscxljMfuwlPbEhv CSv0oqAxym3mH97joLTK+HBij5tJm3rNwdUwsgiQsBUWsTE8hihCZBQ0OqJUNDOvgZCH v0GxtLQ9OPsOX3ub5iFi1C3vQgAkkkBrxUN5Y9sKSf8/VuAkZL9qccrcqLsyImG1O7aG VQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyewuqt6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:18 +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 2BEN19qb039139; Wed, 14 Dec 2022 23:50:17 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3meyeuump7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C7ibkhqdPO5TlAOR3jfpDvyOsx1klIzTHMnnwSf4snZTFsOloKCR1H0dnC+ISgznYnoo2G0PN6KvaLfLMuoYBBzxob6mczsLAxsXGkkfPnsQOe5tzCrHtFliO5Z06kLLpszQYSFR4dVhG/a1VvdFNiQr28LAWlsamDI/U/naLBFZ9nkTns5WtJ7LK7o62P7FKCL+2hY1qydz72euwFPtWFKZlmYlT6JwHAV0ee3fVjPOFv1EsbNBgS8syDbl3aLrHkz0iZAAuhGnyCD2ZAF/fCQuxWSYRNRUqxuf7ZQXVYAfiYLQAr9sFjUBfBtsbY/v9aJwh/ztXY3AlBMLZ7X49g== 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=Ea9YMUV/N6UT4OpUK3HxPh6I8cPXkQw2Eo0ROBN9GotYmLx1RvJPjATorxed0y2k28SqYHRNq3vGjD9BMuh7lvfTN5rKstIGP9YzYWsPgT6pdu9AyW5kVQezH8M75qagGt00ptgISthhizPzNpgXwhnezCTDJgNfxisNV4rMHPIVROUFQo2Zoo2kTCKTonJUI0yB9nbwWynV9/A7Yv0qFePYv1lMG97HHxLhJ95CW01NOFNbtRj6LguhyOpKdsrWOafgxwWNPEeN5eLc0I4fpX/79v1Z/UyuZQRRg0Svk6jd82g2ImFEeDT3fOG0teaNCjCnWOeSfy92/psduB8Yig== 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=u3bmP7oyY/klpl6yyziw2w3FladnCfOh6ZIDVYIGxkC+ygvFaUDqflo6a8J2lCwjlnwknCkOmUAJjfISq2tAVygFbQGZxUJopk0TA56mucfZ8JQimlpU5pLU1Y2bjVaVHa5pAvV+qHIQZtPLUlnlxgvcwp0Mr2WnqwLp+1zowmQ= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50: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%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 v3 07/15] scsi: spi: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:53 -0600 Message-Id: <20221214235001.57267-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR20CA0013.namprd20.prod.outlook.com (2603:10b6:610:58::23) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 78512807-c81d-4a27-4de5-08dade2df299 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GtBZIp52c1o8LLcRxKh74NPNp9UhEItzZ2nafOCymLNWJuTMLGpF3a+5jzVWNeJ1+k4QnOOz73hp/n28D5hOs+W+GrCTTXWpkDLcsVjlNXHBNuM2a5C26qmY3gVgwudv6zoUoBGQcqXkn0y1Dpt95NkqYI3YxDDlju0YcnvIypfb5EDGk550CMuINxVq+Tl7snrI+GrkR/ZiMJvfj7UmkerLn1fyiiKByEISorw/uYdwviMVemZVxxmNTvr5xn7tsMTuQYO9bJuVc74lKFawDO26q20+BMGeWSxDpEjG5g3DC87JYBwqN8ArByD55TlYWuX026o9jnFkAkcvrutr8mox1oM1eV2JBJu+7TVI/ihVF9WrxIU7l/+A/Cbym98BT7U2WcsKNMlI6WkOijO6KqhcOQ8vUOvVpNrPjBvhe/XwySxa+wKb0Ug4n86FxDxPfapkALKoJUup0ho+1AvStPpnGZ6Gir2+Ddiuhfv7tLZrKD3WjHaZniVhHCv4qRy4bEQGRERtZVpKV2YtlUd5stoFzfwFXSB2xoZ5KP6GxQ4EsdHdO1cHvPFLU6WGBW1rxcP5lWT/mwGwallMqcfmPotw40v9N8RZzF8VUynsoJIj0l8Dt40Jnw1BxGnXevn+facGKIDwOaLIeJvIT+UgQA== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tIdpZ148AGgYOwdMqHKz+g/WBa4q/Pm1f1kyWmMAR+SrjuRhR4vOnR1wqm9QvH51TB0s8oci9AaW60dykm2LAgg/GkTYP6yAoOW8qXTW1BBHCF/PtcEESZ7CVtkuxHGOZ185z2CsDwn46qhDhOAKtq2CowD8Q00CiagUn2yTya1GCCev+Y3vmwmL6Nb6u7+ksCwPNT43k+3TnBfPVCASxyXHm57+bJyVBwff/xaYks/5j+qO43OvF/4dmpClVTOun2gTlUByviHLG2u0Z2AIhhUkddBAD7wPci/+S8c2PhHq+njeUTQcl5jlIVlzykNC9XG3CVvlEjz0OLfQjcMv08Opxq+Yjg9RUYoa4Obz01x+vOkeY2qS7VehJZX7kSQfd3I81l+S2fIQWQwCZMJj7wqdXMhyFXeUeXO6BDyWX/4RKvdRFiZY3e3sBgv/O1jccgi+pmiFJfxr6euVRkCOTRlDgzQFTa02yPxHkIykaaGFTfzFA+GPvRo6h80djMIP7vnDL1f0FmMeoq4rYkB3yoKoaXarfAkA4Z+/YK/CLvdy2YGXmzNvzqaDWvLQVvGkkp+QwNgmnsWPDcGSoDQjvGti0V54I5sXK0q7A7ujUt5EmJSh8zu2FTrbqpinDev/Edkl9a8SPLUN5B88E/SGJfyNLkLafRFEqM+N2Y8rWDEHu8BmYYCZ2sEmWrKoenJdfagfEAK2dApnJC2v16hhda4lMWM1Dv9gbJXedZg7va38DGOUmPwEztMm5/RmCpji0PsjJd2aap/fRAmtnJqF5o9jd4d3ZjLA+6AuDVPaspul5QAiPkizzTOZP3nxPLt1nALqfKGLMOrw004S7GrHBcq4ZB6kAeK7rbM7PiWXa0hapsEosAYl+k0ZHBgmdcEqxyE/njSP+e0rwmalaSHzPaTt/RE31NBNvtu/hOkC8d+2ZKEQf+0nKsdXyopJiqV+goskfDA3nX/BKtO7WvENdjLcWczjvG88PghAqqF6yOkm1ncE0CuIhsVsnSy7J2LNr1j5/rrjed6DWpwqRpBL0/VwF5zJYCH0naUPi2sGy/MGAQ21A2Nx+rd07hXeoA18aJ9Xtk+yMFTtYWcijQnP4NJPXuTK8XrRfJVqv68UvNkbhCRdEDYjDoJx3LAGVbZOwMtp+XJZNHrECIObc+1P7wTmOq6XGQ7upYLi6awygjieL/QcWtu78UJ9tqzLU3RZydwlTtPED1deev+NA0xGkukRpJD/e93+zKZ0+A4N1y/HiKiZ3mLq38dou3Ki8vRmv3/eg4xVLbqbGZKjVlzrt1Pa8zjjrS8YgLe9GF8iRih6P8Hz1uHN/WySVbJq1tJamifw/aIkSvxsAAmCpJFE4E4J76TCLuEQdZxl02ZXbM8RAkW1sWaRTtD3c4azDV5+3z8AchkBCZAF0qxiUnNoSnw/8o3v2OT1VmpW9P5Y/wJF7SGH7rHhIgcZr2dLUjYftBS/OvWkmgAAgFiT4xaGpVxcNgaiQ0dAFjZz0K1N8LH4ua22iofS5U+mpCci0BJuKH/XoeFdj/ffwX0ojEy+OsekHR7trHMIdjb+1qsyzE1ik8l3c4X1eqo+i/DKB2aOSJ25oPLsmeFwXjsBzcmP4Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78512807-c81d-4a27-4de5-08dade2df299 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:15.2624 (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: KMlFzfC6HAP+/FTu5j3wEAvljIeQhhIycjINIUHO9vwwUOenwudVa0mYauVosLTF18Dipn+Diu9OscEvAHnF4CLu82plT+5P4WePSAQGjxc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-GUID: LmFGmpq0f2-Nw0Lux95Wf1V3xCCsm56A X-Proofpoint-ORIG-GUID: LmFGmpq0f2-Nw0Lux95Wf1V3xCCsm56A 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 Wed Dec 14 23:49: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: 634119 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 052C6C4167B for ; Wed, 14 Dec 2022 23:52:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbiLNXwh (ORCPT ); Wed, 14 Dec 2022 18:52:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbiLNXw2 (ORCPT ); Wed, 14 Dec 2022 18:52:28 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 553DA2AE07 for ; Wed, 14 Dec 2022 15:52: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 2BEMwmJt007258; Wed, 14 Dec 2022 23:50: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=xldZibIvBP4vebk504Q+fxS7SW/++se5eYfY/9kh4+I=; b=m4WNeiz0/CxfZn+K0dtb7ElRf6L+jAO63Ci50QwxLoauuwYvSZmZcWCEpZWRY0q5dUhs oIHmc8e/1Cf8tTn6Rh8DnakFmImWvSAMwcAzX2JGoADuaAOk1PUWBazjVw4sMlZXzl4u ZsEcUK+ZgkaAqcwff4+wpfHnxpRDG9wAPzqYbhuNMZ2g1UNYnE2ciSmcF5HIB4yHShzJ UgDhtCUl5bSDBPMkQPoD6KZvnIj3qAwiBrGwlCF3Bi0XXMwmHLOV9Ws9JLsikaevXsBe FIsQvfpSyWciHROq7klGSRnM0MPgPBoHYKrIxUgGWocSr6Sy1cvBsX9/BP8LnKwbX13U EQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyex3qtr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:20 +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 2BEN3VNx039262; Wed, 14 Dec 2022 23:50:18 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3meyeuumqs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FDoRfkGkKmAB0CUL35aZPdRij4bDcigNVcF6YEcNzLpdcfc5NUGzcA1uaH6gIwr3+dIaRTIzQ7et62BKMJPbOypozudjJYM/ScS63TERsOtHwx0DcDtwG6x609ws0iexxIhGvfGivRto8dxslPckzB03H+yeI0EwZDCCUKOLSVPKGgK8fDm+BUyZ7HCiJMM314WC1Q45J9Q5w+9kEih0NH4qAow62FOQXt5/c/Ajp2Wcp+AaCv9xKFvtq9mYgqL9jeze3y9iOQZW9vouPUB8WW+bJ4A4xSKhRghFhL7kl056WZX2/jiOQPP6sx7YiPdfD4TzQ7MRivr9AxWldiEMRw== 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=xldZibIvBP4vebk504Q+fxS7SW/++se5eYfY/9kh4+I=; b=h6HokjDVJel5ktfCZby7eGHzebDraSM+qrza6+GfqcxmKofmyeUxeNoWrcEPHLcgFm1vlIoyDJNhZ+/2W7wUO5WPj1gr/xuK+/yWQfsmO1pZK3TF3Ds+CkWaF3T67IE3CB3Iy/WkfekH+kF4YUfqvQXgKJCqiAdOF0fOEY4Xca0+ddjbHk9/VpKDFqFM/qDR3NmpV5hUxebJKjBnqX1bIlaE1RV/wvQHWpx6+2XC9ODH3WGUOMRgZbv9vV7I2wZu7ZfHz37H5G85ox4iNdejjGIRssjdE0NgdBe1T+lVoGyNbyfhTQNypUDIFgNmleqDX9wLOp7odTu6e3bxo7JPpQ== 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=xldZibIvBP4vebk504Q+fxS7SW/++se5eYfY/9kh4+I=; b=CgP6iJU0h2mhRY2ly9DTbuadhrzjAN2yBiczshnJno7I4kXs94HTWsNu1tDXeOmVyf96v0NjS6Mfa4nEqFJ4gAmLH1GtVVFZK/tpq3Y2APSEouCoAIfusONQL5ITUDXUF3Tp6bexnLYJVzDE1hvJqTmc3O0G+2yA1klNdpGgVzo= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50:16 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50:16 +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 v3 08/15] scsi: sd: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:54 -0600 Message-Id: <20221214235001.57267-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR02CA0026.namprd02.prod.outlook.com (2603:10b6:610:4e::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_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f7001cf-5b88-41bb-78c1-08dade2df38c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xnwWz96wkBkeGRaDakVE1MZgH4WPht2abT9WVkhsdeHGF+FeaIsFSv1wPwQwYb1vt3KLcomc/brSdXhQFJgDrgKgkfaRa0Bo7VAJfSNifEQYTQeKJTthobQ9O0ta4vL8LBCxGvMZnbhUQuZCMUlA0BfGBe1tXlQjR9y5V4Vkx1HEKtPpgrjgmr8LT0nCa27aG3Ev87+N4fDeHXelTRNyWZFMST9mUMT+K6VHTCOmlYkkYSPh6ylOXTOQ/bcmSBa85WZndhiPhpblZemEGuMnSqSatxZpmKFP4Y6ilmn+lPTnBuRltAqrv6iOHwitrtvURqMrB5OOFMzdsPK8u/BTGABj/jd3mAzNTC1VNxGzwCtebcPDmEvxh30ogLCDQWiE7yy71X/kOEd66Gweo103HamOAEI6aVYojp1fNlEXlasJrKu1GNQeEeQ+KUEx8bKzWTn2fc+vUSxtHjYHj6V1ubB/xnet/kbFBbTG5UV/fOuT/ylw0HxZ2BwGB5QkGH2x810Ilgbx0uxZ6sLtb2QyjV7XkTse69lfKMzN9QVG7zVCeYj6RFZDOkVy2rScBfBTIs9kx6SMKeBGcL/yVQRZi22m6mwwZeqvoDaRBXfk4DCK2IPtxQZZS6VzxRbe8saf6fq0j1FIri7n4cGDIWjeKQ== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rNB0bp6A9KdpFc2x0xZN/eVkKf9WDeYXk2UzKT4JyROJPcnfDP7X8D8Hn8pQbYjxNi2wis42P2p7dH87wrChmfF0NgcvLFv5PLyy7KV++q1ctuatdX4qeEHEAfpBb49t+ATs6OwWboRovCkdpysHOwPNyuUd56JnH1cF6a8I+aCcn7NVV3g3XU2FWnJToo4+rgVBn0mVpZ6VWmOa9d68qkGdDHSJsbfwwhWINqO+wnZ85JaqieF+dckyjJydatdjwlSVya4BYh13biKvpIxKaedKXo+2fn9PW+3ljUjFMq7TN2ZxhEhuOWFtIg+az1yVSXAXzsd5wAZvhZSF4S7hLcCZRK6WQV1HKlAOFSSORQ8uM/wEbgLcZDO9J73Q76qUeBJfP5HH8NFUaExrmMQWKw0OFgfQb6oMjmKGU7zKETlIsuciyVFF9xGd0iroeDhXZ1/qEsrj7gBtIq+l9cJEzHM0cf1aZw3aC0ZeOp8POoulgMA7DTPHV3d5gRLAy8ZQb5sKfyoEcfQ2JjZWkanHeXW+8puvvtF576It+ReqfDeSOjdW3uq9PPIIVsVOF3F2UNXrdl4feH1q+EKHdpINBNYOn33EKgVyo84bQFap2PZyuLZoVtwAFCymw/NiCzXIJZrGFzCaBtpwSEzsKGvwFWbaFCWrawr1dJS/G2zvBCPrxJajn/oNeLpD5yL47wMiNHEqaP5mLaqm9qiHtrdmoQfPLpe055gHN3xpkJGjWeJ15RFBISahjTEFI10ZKPCnROOHL8YV8xdZjfEN+4srKrr9UWnLs5vtBxyvgF7ZA8N8/e8FgPNeFUkjNjSpbkZQF1t/WHpQoUF7PKbin3+XaDphhbSt2plbeiQbbabQ+n5hiLv1St8HyV5cb1KyhZ97bCgYbEXFjXePre4BCh1ENf9lW/x/Lf1w/mlyRxajg8cgPPg6H45sbZh7hPKVvj8D4v2Tv/B9HkVmg4I79FqlnQaQ1/0an62DydOOc/DVjKCxq3G/eWJAzZ9NMzBl9x+T62CjKsh11HD1L+UBCbwY2Ol0DyyXA5R7L+uioSpKBxDOP+qJMHtnic4GyvKoIM5g5UzUWxBDkHS/EjsD0drIMmlOZ7MYS4E8r2foBiI4N9J7aAT/bKVrf5Q1jt1JiyRl7S2fGjATnT1guCXwsW6FB4Aaf1ziorY9WHJrTA2VvI6Egff/ugY9zBQcZdQUjXlqdvYLb/mLFDBqEOxJCbZU7Boyn40ULlviStdAee2cahrkNhP7ufdgNlHzi+AjbExwKWiXs4SIHLlBTeX34D4kHzHgIl3AVve9umGdlpQcP82hRmpv1UM9D47T1KwTouBDW0voOX3pNJ/0NauDokKk+AMOBJbx7Fwifg4+WPfFPITFkgl5TfyfxS4szAn2EsVvYvPwqt1OAIuLA0lwazNa5wka5jMzMaEnLz2cJxpvSDy9N3RZbCTxfGc8Xa3nA015TUK95L19k935WjRTW84jwoQUa+6gf7c8gu1Y7iwpOaT9n2weqXomVMo4+6J6dJ9ZP4lTikgfrivzHHMQhXUH+b+W26eLajGSEd0AcgChUZaWFMrVuPeg9eT7K6gQ1KJ3Dtlcx4nBcc18Y8aw4bv2dg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f7001cf-5b88-41bb-78c1-08dade2df38c X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:16.8560 (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: JxpToJ8EHjE9SAI01vJoO/Q2cZzVQ97r9/56hNPknF8NW2Y5zm9GwY7r03ElMaGddnY3lvG7vWrJD/qvxDVxM19nh6g7omreYyHEhse4ofA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-GUID: UsaKmuQv7ild1kgFqsoLfV3wfQkSx17- X-Proofpoint-ORIG-GUID: UsaKmuQv7ild1kgFqsoLfV3wfQkSx17- 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 Wed Dec 14 23:49:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 634755 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 8A4E2C4332F for ; Wed, 14 Dec 2022 23:52:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbiLNXwf (ORCPT ); Wed, 14 Dec 2022 18:52:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbiLNXw2 (ORCPT ); Wed, 14 Dec 2022 18:52:28 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7974E2E9EC for ; Wed, 14 Dec 2022 15:52:27 -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 2BEMwaa9009159; Wed, 14 Dec 2022 23:50: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=jlNOiZQUQlde1GP0KqLYkfyobLjLTy+CPpfH/jLBiiQ=; b=EZAXJeIZUPb08YpE109AH2EzsBEW6c3WlljagxXleoph7Ld/OAPRAe9SOzcUXasnPHHG vTQIvQTBOuvJ6tArik6siwVAnLdZeCQU3eVITUe/qNWtwBdn36OJOk/G12K8AlqnbenQ yOCSsL8TSbdCrmiWLIQzYz1ama/Pe3rcCwLQNOy1xDLyNWu7ro5i43tD9p/OmGuQ8V3x p/0CgDi6N46Wm9IrGnusVgvBikaIQDuvccATD5qvTyqVG607R2Q7+PahnXMy/XslTU01 qT2t8H/YHEvIis8HSIyn018oy07XPz4Lby2sDJcOm/GeWME0RsoL0b4D47SLBl/VvnYn Rg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyeubp6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:20 +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 2BELUOVY018783; Wed, 14 Dec 2022 23:50:19 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3meyeqtkgq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KiEADQLTfQlGbH4WeJhrBXTxthcE6wapkpJxt3MJp2KFJyfaEcz/CE0NK+LMY1ruhVKX/3Sv+GEH3sKNKcHjZuyH9flkZEcNhv2eezlMrUcp0aaMyw0brcise79TUdyzFYjic73MVGVTnB7Mzbxnif7WpY3GPph2jptru02kjZz1B9YzspSvnmYz0YBpKtExFxhMrh1pfqv/v988uU+Odt0gZ7NqWcUUQdvMej27nLrCmKtGElVo+0qTP8Ra6+Qf63Y5eEf1qSm5xM9Fi0jlHqHzR/VTOq/b3qxL2+YBYdtJFA6CvGB+4Chje42XvgW0wDFqb9vZjpp9x1rPDkGXfA== 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=jlNOiZQUQlde1GP0KqLYkfyobLjLTy+CPpfH/jLBiiQ=; b=VmWrZbt3490u7pewdzzuj9j6s69zUuXvbfNrNqb9ETF2Xc4n9iGAEZx0tDR3OT72C763/zysKLN1KTfXocKt3Sl9TQCqVMmMSYdkyWQAQSahhVxWTC/tKan40vbIm5u5EI8m4r/eoQXhwvfNiTU9DxcHBbmrCd4IsvZ42Qpx+MN0OQsICx03VsJm0+mLWG+3ob6+7g1Xzm1/Wuv7kCZuzLb8IYxwUhHD9b3Hs+8wCy8IchGM3+t+iTaEPexe2gY7fG6xoF04w+ge8C7pYkP7vPbFa2mDEaRxW5ulo8940sygvmz9GdIGJzmcYnOBJMxRDbn5HMgEchije5a9E9IzNQ== 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=jlNOiZQUQlde1GP0KqLYkfyobLjLTy+CPpfH/jLBiiQ=; b=oltmgPMfmcYR0Go5AwMi33sfC1MKqRk+87N8WTJgWOq+RDR6IF9YCYwMnw5S+XuMUyR18i7dTsqnHXQHovSt1bfISQhioGJnvO76tKQDLQ3fGuP7JwjHtHluiMBu3sFMhmr+nZleDlKRfGbbbaS4pRbWKhoxvAeRZ7qOItEZrTk= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50:18 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50:18 +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 v3 09/15] scsi: zbc: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:55 -0600 Message-Id: <20221214235001.57267-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0018.namprd08.prod.outlook.com (2603:10b6:610:5a::28) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 5649f208-cc91-4942-435d-08dade2df45e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3hZ0D3uTkeS9/OWB+eLvLIrzXL/XRSAA0KRhlJZEpp4ekmk8VOHy8iHqzxhmOqSW5f0zy/BXqgSqOsM2hheWMSaCOU6DSBOytWtzmdvkp1KnpspA9BP8qHcLmy6PAl4tboamp5NPqOEog0WN8rDoijLXhieqXuw3f+9nNGqLNivKoZDioruH07HpbtwLqOVehs1XhTxA/2Q6HVa204ne2m+TEmzylK8IafCJCx+kcXOdPwEp1ASqKSSfIqEigMbltKEVF4Xlr6fRfDkEptMSVo+MTQpwtb5VHpusBAd73Ti6acD9ZHI8zZWk/fly3X3UaxKLvUrp7+//+Ax0UxrUDZwu7YgvlNa4wzmPgVN39J7XjU8YfrzKhhPqWi9J8eAUHNgKOan4Hxy3O+x37BkyHhZttNEmgLqNft2drkEtt6083BgdpHdl5kdiZ11yO8t2V5OaGu2N6Htm/TrzT41bDkx6abI6+2Cnjw85rr37KO8NUuvRCqScvjrF9KP7NvogMMVPZnvNa4E0UJvnU7hqjKQHdAXoLl7bStqh24UoTMcy40peQH419fum+SpUxEvfWjMpBDaq+OLFfHOoj9Ag1J96+5waXDMKtoCD4u2XDREf2cqxE2qaTTS2g2wRWvilkuKINv5fRELtlXQ/MtkeRg== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DJ3zr7Nxvf+7B6APj+1la1AifmVeKRRUhmhq2w3iuln7UIwfxq1vw3dAUNk2GHfbf5favgNj2AclasUOk4W62O7wvB+dp5HiDVkcqITfgg+T3nVeK8qKlB0rNv2AMr9T9ip789kURH7fsC2VKUR2x1loHODGjJ0Qe5iTB5wo9WOqWZ2kDHbSFsaWmZYhLN1eb8yKWgJ8KdEcwBz/St4gpx2r63qu017IAWuhV2nzdfUff+KjnVamuWG+wjnHsjB4oBER3DYWkZuexGK7VKNd2hs/LQT5rTafeg647oYAG2Vfq0AXXl3CIsWc5KebrtEJ4Nca3shb7UAB+vRjD1gk97pfwCAJiSaOx0p4xq6GA3/ggPvdwRzik8aULbAVikY0m/dcqxCvWc5c/jqRDB9qnzPwUBVRvERSk4uv1sPjedyqpwGOQ6el236WZ9CTYmA+EWdkYtD58eDX7veS60xTYkkWOrZ24vplkXxtHJqPNI2HdhV0KUz6v5t4vKq/RruQOLqwc9xb8rCWi11kjhUhRHGCzn3CBmlwMc8QPuUUYNCOj48XIMA5OsCh2jEB2FZoKyoqjD5i8DjlfibSRF8q+ntlFnyVSQ6Zqv8sPDFSTeAgaOXW9oVA5gt7Ik9VdtnqaDnqgINEev/DPCVC5IB97CAbLthcYECw9Y79NkBKCRMpx36c8L0BNy0j3O/qv2yOOREJOqSaZHmW2ys5zj5ke76vn0G5+GyQxTRtEXLUS6QCVwK3spLyjpqSUxA7FhDGqdMiGhNT6AP//NcrC4fpGopip51Qamb498yCPxlzc2A/nBSDhneTwVHX0ypcKaN+am4o8xFOOh6KKp8NzAfTFXnjhpfKrcF96Hb/2BotSdwqhH8AbcJldiZKDZRtz8MJjC0KYlmOiFVtSoMjDZGMT0T9sxa39xkYQT5dIP3GK8PMLlRQTzksKrofDNrwxfIR+/9u4Bpy0fX8/z0ObtWkbFQMT7IIs65ZUYBe8LSOwsv4Xvar5lEIgiHCYsgfaEOnBFowPQh/UbLCfsQA5KJfossNe6J4fxXjG2z07ZdeQYnd+A/5U6kxPDst6cM9uQChLTq4aP/V8v76wsh5dCJWFp7EF6QCs2rcoBwRg0niZ3Q81Y/aCTsHGxB/JzT6f/uedb92HdcbbxKntr1FIQftWpwZA99s6BbM0/7bUDq6ZKWXaSn7WtdO/u1Blm/NQ9sAY0qWzysdbotYvMBgg4410OTbPGGoD63zT61+1JTXZvK0M45SdH3ZQ4/mP6kviOAeXHC11l60QI+QZg5fGNbJbrzvudGUC2FULRjmOyDwEufzlEMtKnDaJn9pAaNjOALXtI8TK+9BbEmH92OZCSB4Hoztj63CrQxgYtJQQc6Yz6Dx9INpjzGKg0YPKAlnSeW9SBYmPRjO4mG73CswZPIfQ0w2J6BtRWvJtPpFN3QQeHSxYYmaUqJz9jsIZFasVL0YHayge9nGuaxK63GOFb2s+x64p40JCFyAJdjRyebitzd2amIfmTZUkjd8LWoTWzqrOg62kO4yIh80GOKH/491Jffz3/dG+PxVQlDLeAnB9FTLcdadzhtJuJTrbmi5zHmjTYZ8iRA6EHbz4BOlEWHElQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5649f208-cc91-4942-435d-08dade2df45e X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:18.2465 (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: 65aTcEjWCTfVeamo2tBwgddgkBIPd0G6ASlvODLgEoZpJcWtEt8HqGSOjYzIKhcjGEZpbERx8ER+dW31wMcBV5++ZKzTEK5uYCdeV90kpJc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: l3YLGMcU5Q2BQ1oJz0J0FDnUjimAH_k3 X-Proofpoint-GUID: l3YLGMcU5Q2BQ1oJz0J0FDnUjimAH_k3 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 --- 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 Wed Dec 14 23:49:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 634754 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 829E6C4167B for ; Wed, 14 Dec 2022 23:52:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229719AbiLNXwl (ORCPT ); Wed, 14 Dec 2022 18:52:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbiLNXwc (ORCPT ); Wed, 14 Dec 2022 18:52:32 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 582F0167F3 for ; Wed, 14 Dec 2022 15:52:31 -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 2BEMwrO3000481; Wed, 14 Dec 2022 23:50: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=4odf1ftkPYdTztf8BKOtCtqg7LfyAZ7pMtAdPXHa1g8=; b=H8ELS+rCLjn65IvV9eDv1NrIULa1ISCMjSBGiEwZYAQEzIQvr5smX1SWGb8nkx/Z0kYo cwbIzhu+cHyOi9nUjhPuFUbZUQRbHz0fXgHlaHMja24t4oXqIO21ZMZK70ehudwczBv/ GqThJeZRci/P9u4RUUkPX7Ur5ubT4Xq0CzO5k5YcYuoO+iiIYy98LAGe9fu8f0q2jGyB rzYFhxrSlucjTfH2G5Eprur4V9OkNnHqY9O5y/yxmLCi7SjJaYCvswRsm5ZgRv0MbJ01 MhSkusKYn+2HSA341QQ6NLuUOLZrAi9yhLeWjSXDezJeCBFhvAdB8R/0R+/sEPTMaxRB 1A== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyewuqt8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:22 +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 2BENSaKf003943; Wed, 14 Dec 2022 23:50:21 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3meyewunx9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MSZeHmHAmUWI7qr479r0KmGcj0XV8joWS9Rs+AX5Ve5LJYeKCdbwgTHJ0xGPxdkxBy2O9oOXrutCmO4QUY3L0OQiwrZepZbl5bw8rmy0IsGfRP2pYj05K8ssYwVUQW+idWbrfDu8ktz+WGb3gmJIJzJ2DCZLDrCVu0+36IriREGQxugKkzq2fkrCZWoPzEhEoyCRwqK1VEOPB2n1JpDB4B79ihVX2c6jJf8QhyYAI1cGpHCbETuepu43AoiLyRpUyrTOJtosMAVXNxIW8X6eWu4ZkQ7RQ+I/IcSB+hlkCuKU+6svQ77LNK58LgQT9FCo4dEfD6cMfkcTyc0CcKr0Bg== 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=a//NmTTsCr1pJsfRCL6496AtRGQRQRRLL/4rYAHy/9L23ad3A0TTxHbMTvbmyiLm/Ry0wlzLZdjxOjM1oNEchfe1NKSaQgeQxZwCFbhTixMkk9+B2tWsTO8/hsY1FsBQjX7MORAXorLKshtqDw00Sg4j68E+V0XTNsmy4pS1Zxk/9EKq+Pqtx/6BwnqhaPm0+WfVFxMLExmHSd6eby8MloH7E0coiJcM/6ALhT7S+HGwmdjEK6yrcQKDhB+cVQQJP+l8SysPydy4NVuPFe18Un9Y40ex0rSnGI+FVVVHYChP1xX3J8mcuxGOMiHqPKBiolcCcP4l4JGzg2iOL4ClQw== 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=g8a0z514VvMH/PEa6xzuFapn+ZB1JpsD8mo+gCSj/H8zyUvRZU0wvzT02ui6YROsPdSAiZ6V2zqsokMJ3YjpjSELpulDd6+PIbG9a5xBMINdAqxaeP6/wPsGp88qFEpigm8/GFerKaDyMxD/UyoIBvAJmclGZXifys6H/xjeETA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50: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%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 v3 10/15] scsi: ses: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:56 -0600 Message-Id: <20221214235001.57267-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0027.namprd08.prod.outlook.com (2603:10b6:610:5a::37) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: c8a87a93-2a50-4654-f97e-08dade2df53b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a6MMkwzevjgkLoppg4/uyIMyxCk1xVrBFhGVmxt+Wdm8reBm/b4/Y1XhEPV8EQlqSeuav3XiSynlPS3m3wpn3HuBpd7bnuefWH6kD6hjbmKUUukupjNbo0hm0tCnI0RKgLPuoelS38VUUzhi1HLg2/gevGFoi2eK4uUrPgZgErBBeeRjVkKxsQJZXAc8zfAVRFFhkDDm4uB33bZSM4Nt6spQcpJAHzXqVJBgjyZp9kJscvLddlK4e0l85I/rUn7fykjq0eMLjFJ6QFSxMsFl7D39WFC0LUeAzRaXyLm4XnxegN9vtz3N8Lre5XlHnph7hQmJixHBArGBqU0Vv1hzuFQLOQRgJ1LyMQpv8GXDPCYGfxAUiUa+u32MhLnHvVd2OmkIavin8qlo3rLw0bOG0cbpJiC2YeQNVXKZE6+aJ8sHJA5y2ptw4CMSaUvk8TUH5jt02iNbUtEEfsvDJEtcnWzaPv61j/1BByXod1PTiibWB/w0pnv2ELkxKGYPR65+wT30kFa2TKzhG8MeSP6Q9/7kAjaDXIjQwEnV/vQEKcNVa8wHPGam6EuiQMa06rFHmp9tPQ/uDKJt7qR5kgZJRKSGUmhT6u1iJF4CKZfCqWlUJ8i3TeOY5I/rt6ZxOvi67fwdiUoRHCt8vd2+wTgxrg== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sB/YcgpqDqZKfsmk1HtVTjPyFL9ZgjZDS6iv+iA3neNdVNRjuklBIRVDJtf8/p+IwiS0d7PoVC67dsBJTjHJvpiVTAFDnkO4BnvdZ+y6OlsH1nHKyvWPlQtfeE5bYcKJmm6wNZRTKFyLHX5mOksvZ0qSU6Q3DTiXDE3cphAfCEblAcOQBHQYZZJmD6X0os2LTWmiCBMBqv9NS2AtLsjEdTwHikqhIdQzPx1FRYC5tpvd+HqM0GkMYa1eEfVFv4UaDjr0EEiaJbfKCrU0vnv89jrJa95V+wdSWWgw5MhIcGLWchlMAFcDAnpr6LGYQ4qWq8quVtFa98IbMAtMbrFy/TyJO0HQH1amIifapmP1FdJ7LTjj6TJ52Vb/L8qw+vUXPaiOBTBOxFu5y/QZT8wH4WFsFoM1ZuWjzQzgDFBD0o6vSxoi0GebvK3oNDWK64y4cTwGeH7HfpudUW65ak4ShkBNNlpQ2jPv+UL073wmDADP75F5ysUbRiCfZqfA7O7nhFwZiulxRHrguIj6S5HfPeeMBYFD1mHVnzjvNa2JU8pKvZ0PrcjAzVHegB1Suoy1KfRAzWp+CxUQi7JdUeiaTP0/YRLh+fKeC0mf4ojCu7hUpbQLAc75diYy2xKJCzO6a8GVzLvwSLO7dDPWq7FxMlfyJAZub70ArCIqyue1yxfjnMFpOsUs4nhtRSafIDGOYa97QveXrZY2jj7TemxJjKdF8v3f4Ydr9FhVJDlgva4yQbQBhmWsbFuxYF9jQWSdcJSlZQ8ZEn5br2G8uN6+bg7EIUFgTahXpqRMGgubKePCsxBDTcfuM9T8obqcmZJeC9UoZbVxzaDEVwjdMqANbAHtJzAprVK2UtNEfG6y0lwKEDLxzIizbwyglVHNqY69JhwfDXt9eM7ReC7XM9ZSB/JPovxqxESLeL7OJPajyEYdfU3C1/M5VHmVb0uVEZvn8o6atCX4OTRzdeJEYDQSACkVqm9tgDxB04NVVM1bnmYVS+PRKj60DMwFWnDyMWaWj0rGeWsAr213r/morWWcPg0h9SFfcEvCdoIMBdYDB906THBdUSBAupuO/Qi0doyr9Me1MIBTEVE3n75XsieH7mMaMDQelnqr0DQO/LU2aMZEfhy3MAkcxltPTQdLsGO5moSEkb8ONrXC9bG05KaT4GVJoMUiO2aYH9vr6Ucn5WlWCMTu+3gIm1hEzxQ6d/qjePO3qDnh+qRJPHZjlUfIvLLED86dgslFWNPbZStHuPWyxeT4Ol777zV6qVVSfOF6f1NvGVXHUqn7J8W7DdHV3ki3/ColmONy7QC9Pj2tbopPnrSHv9AVnZ0ID9zcgoZ38RhdJDhTdEi1qIVF4NFwfHgBFctWF1K3YP8H8GY7PWj+XL+z7IIwoPuD7qKu3UBJnLBX+38XkUDuSSygazagxI10lDmmdXhGBoT3kQopRL/hGvNjIZRzSPiurMdLCZEojCINJAOsT2DEaQaktejcsNyjudh5wEu0/3l0aMfBMGR+gaPY7osK5Jn4j5NEKa+S1PqwtLYHrwkydzRv/7iTCVHENsoh7+EAJVr5upwV1fasNpnR55B9nk36xiIHdyT0LsDki2XQFzq6g415U2x7dw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8a87a93-2a50-4654-f97e-08dade2df53b X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:19.6683 (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: qCSzcnNf6eVnzM23uC21lHZLEV3sUQURFzGX1ZiT5FlgzjhZVj8+GbH0Zk8TCWEfBSTYbeBRUXcklvfjXCaXbx6kuDpTf1PSxy0SdAhhBBo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-GUID: AJO3ZW9QfaRgs7pvJOfCYzfs2Cb1-J-c X-Proofpoint-ORIG-GUID: AJO3ZW9QfaRgs7pvJOfCYzfs2Cb1-J-c 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 Wed Dec 14 23:49:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 634753 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 AC45CC4332F for ; Wed, 14 Dec 2022 23:52:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbiLNXwj (ORCPT ); Wed, 14 Dec 2022 18:52:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbiLNXwc (ORCPT ); Wed, 14 Dec 2022 18:52:32 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE8C547337 for ; Wed, 14 Dec 2022 15:52:31 -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 2BEMwjwJ024233; Wed, 14 Dec 2022 23:50:24 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=YVdrphivGF9b4JOglVVv2SZxqug0ZMKHrbk7QbRmuXI=; b=NyRcwM+a1v2ggt1WLhGMscU9GkQNFnK2w07M5exElT1XZ/d7V2z/z4p/Z6KgiTIwJC3z JVmoWkCIFfNT6Ru8rG1R1exnu26MCsY0wkiUGI+IohEAEXNTUKsYPevAhWjwGr30dxvN V9tIZ6OaTvT1+mve0UP7+PfhFoNyRTcViEtOPxfycTmxbrPXLpdOV9NPjKgIhfEFsJBs lTCcNmiUHmpXgHUFljJ5pDa3XaAtifMHCPh5YujCWZO/B0Samb9TLNXqL9J13M7MRBN8 +vNROCrFSG6jnN3XzTfItVQU+K1m6MyrTfin8O+5MAnV69gnDWwJJztg8wnwF4M1FyTm uA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyeu3r1d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:23 +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 2BENCo6l031169; Wed, 14 Dec 2022 23:50:23 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3meyeptep9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PhG1RDOcRRFlZ8CRn4PgQlbZD+mjguBT6KvdgSwJ9HqRNSzWCpcITSnpfX6a7hRBt1aXcXo6G2ZKXuKkXSOagy5Q1FS5qDt3cpFoPyMSr5tih6F9qHNcECCpQ7CE1C8aPDamZ986p2MLhQ5zc1uE7kIdQ64wun10plt6WVmJVD/nzEWl8nbE+LlYkqWafvqCbm8TEg9wXg5gwhowceW7LNHKZv4R4QHH0a5wy9LOwEnc7xd+2tPuJT2OhlfA96r0vRTbLnsrIIOjx1Nu382IfX1Ghh0Usr5wf5cVilJQn3jfm6jHqq5CYrl3iL4B8maTkeQi+UiHjPnNoxOF6T6M4w== 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=YVdrphivGF9b4JOglVVv2SZxqug0ZMKHrbk7QbRmuXI=; b=K4muhw+GcnXdkI8JgEPkSW9hgRLZZXVc/sieLKkn+O4f+V0B9/C3R2a34CYVOVv6PDJe9saRaYtow9qILrDChLhOYR42LXlkf7Z8tGiFqxPUvQZjM27GpdsTC7t6Fu3yDOt49XfnF61q1iyPDcRvjGWjc4JS/Dc2B7S3CNE7AT47QFIwQi9Q7PN6XGJRLM3vGZOkZZNdmY1I6qoYugFiB5vGE5GyvEgVvQVu9FcjgKrU1+W9LQhcfhCDkIKsTJGWkgf1MyfuTuBZSpYvOjicQWw7Y9Btx3LAyzFoyHvMgi56ujCKfYTcdICaYJvu4LBZW0Lpd3MTMARMav28McWYIA== 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=YVdrphivGF9b4JOglVVv2SZxqug0ZMKHrbk7QbRmuXI=; b=wWTh1DFh4SIaXC1st1/mjURPoWjCsZGfsyUKDMnaFFS5yZmpVhGwm8M4fiO3OBMUaGwi/F4zz4AT68/BTCGGUosL3CuHSJPMlI2iwoC6ggygvcxtafvwEPefI1rTmK7NAfNSZGUP9mtv4sfdT148hRot4r2cQ9wyqN2HUs947nM= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50:21 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50:21 +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 v3 11/15] scsi: sr: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:57 -0600 Message-Id: <20221214235001.57267-12-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0012.namprd08.prod.outlook.com (2603:10b6:610:5a::22) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 553a0b61-67f4-4875-7443-08dade2df61e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2LxSXQjO6Y4yJymiS91j6Z1h1v3ErBqOgeox3rEsdPHeimAgOj19YWCf+xP3UhWQpUHOegZrUvR5Ab8jJHaVLBsZObxBFAUP8jEqBdwojJWAA7HN7JE77lPkVixMYqE3wUt1tcwDi+JvF4GbwrDqxD8w5M0sE7TPYlTo+L/YyMQafk7TuAptoPwt0fBFNO5hztP6pA7SkMtK3t7vSWLf7jqssbo9KLp/aqnXpnSi81ODYDaLbbznxFzWUl6j1GT2ytLlyeO9RxGev1PwIeR1VJBEZx856mB6taw6j8jnyUa8pN7ax2EJSD7ctqE3ikEtsM107mzpz+fw63YqW0h9m+sDpBtpb/BoJTKCbAU2cF5BBhMUNw44CHB/m55gJ1EKgWCi7oXZ7Q79FLkQyxEY8z+dPwA3ZdwAsxeNux7L3MUF+ko21HuacpwO96/nyGezYxk2wt6qws8Pb+uQYC+kft3TBZfcp6I2NERm66kiEouF983YqrTBy+NKFJnEC9CtQpuFTQsP6XkOH6cyKpQ/u3CCC4YKWAHCEvD1bGPMTWsAxixs4W/B5nHpZUXAaG7ovZP2gnvFLOwL5dIyMkTsT0EhebtiQIcRqWNT+cikUO9wNvGIpKCa1mmwDl71+IsdWcYPP3VkpG4+NnEQFLYeNw== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kqqzXiOcrzrpgdGqK7hvet9M3XaKZI0GOkRVpa8qaHTEc76MhGz/AGmMdkhiYE+/Yx9oCsj2w3DzyHDMspWU5r88CwYqDltqydPstdvi5oQqEJWLmpa1AY5AhpjNTMCdhLgRE/TOxaBFsYFwK2IB8IkN6EWqRmNlwQpvaNG9z6rWXJM8kYjj5/zByAnZ59YoCJFnHaWoBOm0rMwjgfBhFT5cTkBC/U11Oeagzs5hWfX8abQh1Olc46qBSGQFNZ3Z/djiNKAgBrZIvIF18W/yLwKGpM3TOLJXpGoLRnSDK6VLmvwNcW9T8GJ8p8+vGDcSP9WCUqVB4keLaDOcUmBR8GHkeQ+UHn6GO66sbDNr6KaN8eS+N+fjuzB9imD7zuAuA4HhZkZldkrPWCVFk1gteAufYtI9m8/nIk7D8lxHkngQHDcaYmKVeyFU5zyDnwa5XXe0t7P3kOohqF6O1J9ibw1yFxG9V8CrUo7eWsNskRRozQ3lVehns6oIPWnOHDzWunyOM+WW6yCxc1Q/+wMlJr+uqGbh0IyZNL1FDfM81in6dmbck7Yzhj8peEC5NgNogMhzX3BiNZ4JsG3LpifIqwhT180xJwKgYBlzxC3NZISqKonZ7hLB2JaP1xXf9WI5Un7PihLpFuiXo2zeZW6ZrgF0XMsc0U1jd/P5EwWESdrkQjbjHejEYfpnh0E9EwyG50P5XWtq1G2FZkWDWaulO05nTtOSD922z+tzB67aK8ODkz9Mu84S4SxTzjq3/yw9qCjUfUJaD0LG4QncCR7YCvLXPKMOdNd0czFrgEfG/56PDOdan0yabJ4dDin4ljs6lvczWUADvWpXdyF0y/P3kDt6fJvEJphYm3itR0hxf3rSMhrQUVuYiIoXvU8hIUMIIXOFaW/zdt0NK7i2XS8YysCEy3b+5rQ8i4r+bG9eJ0XO3+3tuYcHQy/K+XKw+zh621MWclDoXHOp+ABD5n7PkEL+zLi34u4wbxR4Cg2DnsxoXOGmSVne6to0Tz8FnPzaC6yLvKvCt2xQKw1A/vEkBrQXdokX4+KItVepohvqnqGzFqxb5i8A+dZCNztWPWDlWJsIxUhjp+TSx32IXdLcsps1FmZKSaDvQybR5yJP+NQYXWNJUR/h9KalSBhEdnS91dx3HnCLqV8QQUQgo5Nq3dedYLtOfiVkY20kR296sF2UC+JWpBpkl8HdHEEuS3c/1nTOE3qh+nGicIFKd58LY+4gP+SmwBVuHv66zvOHGm5NCZoXDz7BpqnCoVvTaOBBQfto3vZBsiEpZq6p0sgyJCii4sjk/5zVxNa6sFMLa0BALv4E2ap3KZipIYNHQZVA8OZKGfJklDFf6AWKPBTv7h0nzPo4uz5qWfZ9I60nGQmoSefuwcf2dGwcdjXafa+KI/LB14nLUq6+5q6QaJ6w9A06Fs/z0X1m/NNlm9m1yVYpLG9jfgAtGHt0FI2NWQuKHxlp8GXjVnMJ+K87krqzZ55cBh0y11/PqLj0PUKtg7QI17y5XZZ8cE+r8KVVhsSjtLLn/WwwLZ578HwheonS3U+YKXZYLm4VSoNoxVr8K7tGwCg3yP3v2bHrHmtOG+hJUuxNKVQfR68H/awKTKITIA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 553a0b61-67f4-4875-7443-08dade2df61e X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:21.1838 (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: wZO8SvrzdgLO315BaY3aE6tw9Sg1yWm6DPHhAa/DRXDdqvfF7tAkA3oTptSf4N9oq+xoY65YLj1tCaqjzcnPoyzsq7CSo161nQ1qTnd0EPw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: cvGuo6y-eiuCAII5Sf3kZVQAyCfAZJy3 X-Proofpoint-GUID: cvGuo6y-eiuCAII5Sf3kZVQAyCfAZJy3 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 --- 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 Wed Dec 14 23:49:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 634117 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 E2293C4332F for ; Wed, 14 Dec 2022 23:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbiLNXwp (ORCPT ); Wed, 14 Dec 2022 18:52:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbiLNXwh (ORCPT ); Wed, 14 Dec 2022 18:52:37 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42ACB167F3 for ; Wed, 14 Dec 2022 15:52: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 2BEMxC96008159; Wed, 14 Dec 2022 23:50:28 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=R8CxZo5OMl0eALW/QEOlwXrJhXPZYWXi0UlLpPqP4p1t+EFZ0CDubhNK4J0AvEnbc2T0 n00JjTV+xPtBA6UvG8rJG8VleovuN8rsQBR882nyzjjfWvTFXnKypydB7hfmykX4HkCY cASg9SWh8Hv08TvRjSn2DLHYSC/Ch6FttQ+uzubVI1Zsc2u8oldh9eQhpfIvxqO15NAH kpdqKiqq2BZKkhCkLziaR+FjnflHRQEchmbrdd1kOxGwCCdVUlIoxQ6NNaMTbDQK5/S9 VweCy9K1NMWis+LDCHuuXSqAw8k8XM7yOE3XQeUwFKO03i40Vcokp0U7fLI+YH8jif9S 8Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyex3qtu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:27 +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 2BENOWuu007273; Wed, 14 Dec 2022 23:50:26 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2172.outbound.protection.outlook.com [104.47.59.172]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3meyeqkkv2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CLgW3osab35f6f+4Acr1TqA3Ql5lAFSmM+K6YOBhpfF5I1DX3fshOCbDEgcdUTixOPgJ/CytiJ2Z9P0C7vpnKajsMKOypfJ2n6RmlvzvBfzMneN4zsgSzvGwRuTqcY6I3guUgM0QhwvULendeK9QMWPxdyMnegwHZ/sp2pxgJA2JXCTzZK1vujMPk+EpDLdmsYzImLHTBA9EMvDs7fRuWUgFyebI5VAApZwJ88OJhg9RT8n8J5BRWh7W35YUNzctNVihfwPdi6FFfS3lUZaMf4Tn087PwTKXjU1HOqRb+XmNEjTbwqKCoTWCI5s9RQzLnwDKpST/1nkzEj1ACJHUmg== 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=X2cUNOarz2iizC3NFgVP3f8H3eGhMHaTOmhLKAlKjEQyqEVewHYSmWmFTumLPM/9L0r9vk3XwhqfLTDmRFOmY5xQnGyepX8ncjEcViOWFYY+LwvzAu01u/J8cKBjhbg66qWPssEe8OIU0PVgHiLanMPU351XqEyUtBPDyJMO8U+DFgH7apJ1GppFj+f2nIiCyAc1jvdxPM/LdbfTeaYfCYxRPxOyfXF6VEZn/w09i0qHpj42DSQzCEyY8htEP+GbKnouvmsb4aqc0oF2mK7gR4HscZVC5A1zrKjOc4EAXnzMnpUl3BInVrhg2x2anATPaFKD4PSXs7q4jaFI1Wyy7w== 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=Wp5/MTeQo0uYZWI1YvGtd8zrYzU35Whw43P/fcjWJbZU9MiAXYL5MtykdAGviudOA9iJY25cDJ6tk8NwpkQwf97Y8RpBphmkUdG/NG5c5C+rUz6hgBit+Gobqy+AiCRo4hioWyC7x4c/YVbnkPZPuoGeTLwJHu3fgFFSNgB+H7Q= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50: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%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50: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 v3 12/15] scsi: virtio_scsi: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:58 -0600 Message-Id: <20221214235001.57267-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0014.namprd08.prod.outlook.com (2603:10b6:610:5a::24) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 36e18053-6582-43d9-8a98-08dade2df71d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AZ/ZnCZtnrm5wMX6O7OzBextSYUqNRJ3DmOXNEIK7hzLeqPmdNHha6DDpmYayLFUcJ3US4LpXQ0Bv3izNbsyrtAdu9kZRR+ttz3sSgGNFtxNXzcNQC/ESw+w3dNjEDs3TQV7lWN4nLbBRwBp5usBs6rsHgTES5VP69uSu9MR8V75TD5ceBVLGmCshkxyncMxFy0sGh0xFcWOJkVE2hj2asYu9Xc1NImwzX4GdmYKhT+UZn3H9ueZuAoa1wIWNh/xcPk2Q9UlEIHMsODOgHq5G2qpK3UCsJU2V9ghbtVyzsXyR7t4DHXctSb+s1c+zIMsj81+7ImulF8/J4LvgMJ7pihTxdNg4l0Uc4m4duNOGxnS858o7m0EKDnqSyjdmSOzm/VpDwAKP64OK62NECP7iFh3z/ZQloXvWxNv7A1h9jx1pYTSOTDUU6x5iBcDDIJZ0+StDeXdK27C13tv8W1XiA48Ke3JYj+cgDRo1XnjvBJRsRoWWYmQUb1aOCQZtNc7UDhqD0okp2UFiN7PVdJZZFp5OULebTqnHTXHZ731gdsvwQXAls7FJmi10jm3gKQlsHE8u0qzYJI1q2DuCOde+AALdwRbAm48R8S0UgQb80HOx1G2KfBVUTcXE2tvmdVP1tCyDHY5fkzc7WEqLYodvA== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(4744005)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dFTqxvK1ux9LYrbD3CbXbkNhnKYThn8NqZKxparpxpfAwtiRjCLz0DOzej2n7/bJZoyS7G0th2Nd8XE7TPClN1tNFllT4ym0vq82X3yzw46kyKszUa2i8OGzln5IUAwm519+cTYWeRc03N3CqBkwJgbwULDqc6ykhttCN+SRfO2GdCiYcGuaFdoB3KeyJ8WjHCTTrGnYzRz4IOXCfmOILeyaHawESCkFdZvi9nPTrPEG3WhCpfnyyyOJfDSWFNgfdRCxppzG2kofsBDY6w/WnXBLUrMaHAbFj9Cc0z1s6bQAB9r7a6p7Vq7aHN/GFycFsrlhDI2rT8hk8vS0Gem1Y704jSEPQVW542yoB0WZbbe+r3T7Knuc93ibqi8LlG1WyRvS4NEGQVPkwR8a2msQdVUxluPdpwxw8YnRKSWUnkI7p2onQghq1u1QsMb23nT1JJYQU4jmh42xsmfNujY7aLnv945YWM2ZrNNzlLTmdRwWosmdLFKfl3CHJuOUnF/gy0kYEXXpBCUKIU/RuLrwpugsVc5502GcGfNAHnjbeauTaOGczurgE5JFqiWnCAYFO5FpIsm5PsKW1JNCgy53phBba0JYDj6/bO5YcTtAaFfoPYGAYMNTBdFjhbfSptKnH6/R9ZtOTnhpnkontDLJhnkOOgjbF5jOfJT/h+eP4Aa5y7Rp6N0p2EJD3KdW+aH4TgPI7LzUabNR6kkGLNNMaSEkNMChhYhg5bS1zjftaLgLMnXeUsvdmUQ6cwJ15kLez9pxMB64wDOTsepJ4e7z/p/pCFsb/zVjZWVm/TqYeXiZ0OGvEBHTuAm/QLwJ4/NPzO0ns84T3ttM1G2wO856yL6OFgDLbDcpB4XYrkNhn6I4vgDWS2Qz5too3yhxHio0sMIo/DWAByF+xGtTZuCWtiDB4LRNHus6DewLZwblA7VWhYo9DEWAX+UxYx+7Ru48nIRM+LyNHyn73sYvE9aoWm9PuMXzojZ+YfBfSQF1RWlEYRXbL4luEbWwrLhezMUAMQL8w6jIYwFmZ6kQZzZ1qukCU27G8cj8QaoANjaUNBC5rHvPXzBgu6ffM+nDoxmE4fv+6eQtPXS6Tl7JtqfVVWi82knwK/xPDB3GzVVDpVshmd/LxotBsHi3n3MmPjxyzJ5R6+6fS/D9E5kURosQs5RL+002vnDaqZXMAF6163LAHAYq0VrovGjplqxC6Y4KpoEk/C4+35OGleRVkMISYl8mfGRRJy3dm6+CS8rErln1CbvbK4lqITiGcSjNz4jkABQhXOVjs5CN96rSBfdskUK09aK8coj7WId+zFZS7ZKnXpQMhFXPWMmjoD7rPClYCdvnU9Gxih3qr7rGw3lm3BPN7NN529ETu21lrLa/yBkTXQj7t7vYig33ChyYRIPSiSUBQlMQXduB0XIbvAtrOuM7q5ikSNFhVXBaLMrvR6K5LRc8PDPHVYTdMwyNUP02fobo5dZHv9Z9IOIQ6IH9PQZWKOJIVO+kfr61tmng7YN5aJ8+ZLD6W9aQOazRp2X32kpkoTHHYoZ/tgOBWm28bf9OfQQ0xhZVUGIT/1dfhNwplnfvIz7UyqQ9Dlt2DgGkqb5fVj5Nmt1n+ZHqBpie9g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36e18053-6582-43d9-8a98-08dade2df71d X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:22.8555 (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: y+/QSBn/dxkRj8CYEjV7DNM4ZUPTMImyDTzab3g3IEsLYRU5JKYwy6IgXdNMtwvPIPPda5LQAogW4lCgEGE0dp8jBtl33tMf1UdOaXqErzs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-GUID: Cb2Une2_JoPkEu2kmD_cm0slLszgtplz X-Proofpoint-ORIG-GUID: Cb2Une2_JoPkEu2kmD_cm0slLszgtplz 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 Wed Dec 14 23:49:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 634118 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 5D9EFC001B2 for ; Wed, 14 Dec 2022 23:52:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbiLNXwn (ORCPT ); Wed, 14 Dec 2022 18:52:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbiLNXwh (ORCPT ); Wed, 14 Dec 2022 18:52:37 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D22837218 for ; Wed, 14 Dec 2022 15:52:35 -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 2BEMwnkh026698; Wed, 14 Dec 2022 23:50:28 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=r2vDdC2eTfOrSDPoowi9GP8F5+zgD4pO0M8OVYBW1MXGMDep+D7ec/vqH1j2rzv+b2A2 v2AFxYnZIZV5k8LCCT3dHqCPS3w2tGzq5dfHU9tvCUraBrSH0gSZHBhDPaPw5lGmf7J9 9vRfAIxM1ceCeKWkzACTMaC+DkRmxTH5JKHna1RM27ZPQ7nLhbMpTSON5FJrbZdRZbmF L5D8oM8/6j9phl4rP9y4+2nERQv3X3/bFzq+hbKr1qzKsHbGA0vNs4rvsSV4B/fRj/1E zXPw+A2BifvuB6Q4KJlkpppXvMJJDY5OVL9qUIrh4DEm9QmcW+zBcGGiY8v6Faa9MMfH cg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyeruq5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:28 +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 2BENQxcI031216; Wed, 14 Dec 2022 23:50:27 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3meyeptesu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dotNyPy9EV+R3M6FWApzDwJpveQHkh4e3DwMDcqxTwbjQl88HDjlOOsLnOzV22UNmP+2cHt1+qZSVafQhU9nNZ3nnyX0KvVdrprE1AClP+uc1MekGCNnTaw6V91MsB/R62kl8lvBtoAzzHuM6W/tiMXx0dmj8M1QDLLbXE7btIuibRSolfZkD85Gvw9hfMa1uz8ksJYIDBhQBZAO8e8SZUze6Ce/YZjl9+VShfF9y5aXhSgbNgbTc+nAKMfEp5VpQSB8RHT+Rr9mc114CAmw7WDJXvuswdMMxGiSq2pw9I1r7tH2iCHWXlPdh6BP0S/2LKj2+WniKRNWaB+Bn7/66w== 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=Fz3myowEjwBu8gS235hkBni5VLVtCVBwvg1F/1e8RxahLbS/E7KEGYb3K9KkCya6nZtuioPg6TUKVvQn7bRNwQFtF0Y1Xtscwh605eaLGLmlojoDl3Fp8Ue+lRk14fR46Ti6SeYufe5N8/0qB4lLHR6yr3QSUDKoNpXlHsbUoYVp5dzELlGRIXgEEbJuFu22bfsCOd3gsd3PeQ2UVsO8EzZRCCotJ3S3jxPRJmd8fy0H2Y0EYIXT7+pElx+GPkMpz/PIjk5rZiDBG5wXPlXF6mFcwW5xTk/ZyjiMEqAxR+0vVmsBMhT7eCR3qISBoJ//Jq/Nf2U9PIYYTfZ+0Xo3jA== 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=X2hBvRXlOKWUst7GeD4k/qeybg5IHM8U0uOa+m2R/ahlwKFXiu84J74hbIroLj7sVoQf5IbFv7zNJf/+oYEeuPVtAUWu6F4Tg86bDlEKZguYEocad04Z9ufCEYbe6s26P5TArSfrsOjYCS3LkNBgMzVlv9QBcHddkErlSdICsBA= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by DS0PR10MB6800.namprd10.prod.outlook.com (2603:10b6:8:13b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50:26 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50:24 +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 v3 13/15] scsi: target_core_pscsi: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:49:59 -0600 Message-Id: <20221214235001.57267-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0018.namprd08.prod.outlook.com (2603:10b6:610:5a::28) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|DS0PR10MB6800:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f7193c0-a172-4009-69ad-08dade2df7e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M6/1e6g5lWpwSlOAJTnfYm91+womK+cSOys/1ZhuSo9z/uNjy+TYlBIfi5iuuFBxevxdvduYTK3zZzc1sBJ1KQ4bYF7hTupxDTf8SCpHsXsHTi7M+dOKgqpEKxY5MFoOm1ON9F3+FQxrnbWblX0u2vPdZmIkRpKjvsX9SMi1UNxvI0FXpNsQa/1yEHFL78nvt175epFCsUbbuNRf/x0UZH9FguSLX9JeUv4iX4AfyqPXOhXjvoCWZ0GkxfbLFZVa4RdqMcp/rOfIEO3glJ3TdZJCcS4u2nqUIGxEXv6sNCf5hOrkgT0icY5lZ8mIUTvolmTzzd8sgO4Yjj+e2kJWWOnzdQWYnWQeJPyaL970+g6CQvhxeOxeEG5yDga9M+crdMMSbrpBUIvMn8t0aiA2ScVu+dwtPkTC/VAZgYYGVIgW4J6LAHOtF7SfYGTDJB8wLQOTAJfI93i7ZnzFEgByhILRAhhG2X2Rj3IuPfTrXzSl5tszscpTWZvJifeZgcNeJKLHAr9jS/GGtPl7LOZtVIeR1RPAFe+uKtp/sOvCS3QaU4FYVVrbJjG+mxw4lEUYHa2S3WVQB3nrbRORxN7/ZHwirI9r7yUircbrRLmN1DqsorgcJQA/XR4mDZOSvxGCAqCoQGnL5RBMAW65HWOOuQ== 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)(376002)(136003)(39860400002)(366004)(396003)(346002)(451199015)(5660300002)(36756003)(2906002)(66476007)(66556008)(86362001)(316002)(2616005)(478600001)(83380400001)(4326008)(6486002)(38100700002)(1076003)(26005)(41300700001)(8936002)(8676002)(6512007)(6666004)(6506007)(107886003)(186003)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nVEL1wloVLbeYemMiHmj7vtZtE622bwwNxGSzzEtj7EtuLF51UHqS0f2nT0H93qd7Bw6B1wBa8xbDX1c8CZQsdhQ1XmzlppQVjpPhRYBQmLa0Y3/2Bj86msnI+tV8spjEACnnyk9BEZopoT/UlkBga4zWP9D0Q+RAXggCeJRLTwMfD6oxCEIRmuzEDxy9wvTCE+w7ZXpY0eio5CdZG/aPCIpNQ2bk7UP5QTZa7egyHDA8ftuDw3hM/5phEqM2XtZhC4Waup0ytw/oF6QRYJF8XHWklyvBnFrTBu9YOkByW9F60vyeyahPzAsEC20hpY3JA04TPf6vVPbTrp+x87QGHcpqYW22Eana9DNVSwzEUFSessK/J7YbHkdGa9ykeKu9zwE3fEuiU8rW6YmS4Pei5yc53S3wJzpCNcLaadM3KtqPT6o4atZg5+c+VnHek6gTownsbR7EfcOuV685p6Lk1brIKjI3r1xMS7a02fRgcXvGmolSKfJWoC0wvst0JbVTqKRFQX60n3Teo/FvkztBBxXYedWkuWpruZ/4RLLqxhnB1wk9T9ZAzogkKqpaefO4IFvvZhZgEkr7/w6g74/ZuJ3U5HuDP2or4sqt4E54DHjMV09mYRA9hBEOUvWAQJD3ZAmxU311MrZFaz2vCdD5uXkUW/nYLAALdmScGffk6Su8gqevDm0u0t1QDz5VhqHqGMRV4Hwq2yapI2oYoeDpEI8Jw51YezzYU6Y1nP4HG1OuXx+VcslfJ+2bA4qByRPqYaGSTyYyPJHmddhqed7DZ1y0QBuJngpUatXcLys3d0PcMmu9/MtR6COoeClpqNSLzkNNRnrsMm8qfbwAn30m3rVp0NeumWTx2hkvJhg+xu1AWAxX4LexWOQYiVYChh/7Hi90Y4K3WAzdauCcE4gTDovrR+JIdNbM9iC/1Egqila+ODSuoAuwecsJnZmEADDgcDc5BE1xrV6ysKEOBbQcey1l10xhf6J7slsnYykld77sTzUnciqAMM3FeBvd9ui2/8wEgWESFRoZBbV7F376Jhh1dreh7Y/SmCyCohnEE346G4KjamEmaDJfqej3jvDDx7j/3YGOHV3Uu4AsVYRelQgErHazDwJow2ymXdkzlFNYsvt3LX+ceIgjBcEmFQljJMnFFBme/E+sIv05EHeYogYRsRSIZSOSbmAeFqHj4Ieufz6kxSyEh4a1EXGTvcb9rZG9Q5u/tDNzwYGcNCM6QEGPviNi4BRsRWdVoJjsnFv9hAYx2x32tPrtIj5fPQTCd7wZrEccdhDgQNU8A2WJiJvlupV3Kk53j3uNHX84oaJ43pNEem0Cb+O1YWb4qzHNtToGk5wFk/Vk1XRNU1Zz0k1YADBCgbfWugUllLv4tOuiPQf+CiyEYNeSMJtpiJcyPj+KsnKkXTy0w+r9m3vfuH0AogOkklHNAGtdKkWcUrwc147Leen9vmAXhCHWek1qRyngGqq6UD9a2GuW51IZ2HRSxnk0krVsRrQl9XszqB0xqN/9tiLqT2joKZlR56ApIaN/ZbcgsIFedyxbSDWKu+ZrT/Y0icwgZSkRuxV1us0KOJ6tW04+KOddRZxAdAjGQwK1A4E4EWH5lNmHDROpg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f7193c0-a172-4009-69ad-08dade2df7e3 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:24.1523 (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: GXuKh0epi5ndNEMn9MFAKY5Itxr6vDT4H5zb7R7NQ3sjK5XtTJQ+DeDp7Dtf+Bl8jt1w9m2mGvn9yUTjl0mf8MTHIKInHnKonRkIplcE/DE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6800 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: OkcI6KW9Zp3lmUslHokkycmV2gSiaxAi X-Proofpoint-GUID: OkcI6KW9Zp3lmUslHokkycmV2gSiaxAi 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 Wed Dec 14 23:50:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 634116 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 2CBD6C4332F for ; Wed, 14 Dec 2022 23:53:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbiLNXxI (ORCPT ); Wed, 14 Dec 2022 18:53:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229708AbiLNXwj (ORCPT ); Wed, 14 Dec 2022 18:52:39 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9085218AB for ; Wed, 14 Dec 2022 15:52:37 -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 2BEMwgF5024209; Wed, 14 Dec 2022 23:50:30 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=T/8o0WI2/A/LexpiHqjDI4J+OvSeSgX5z3w5hhkY9OP4QrAKbNaZxcxXDAgbgwgTnXJ+ XEqg6KgfOZP5Cwmvjlz1tpboYxt2zj50gn8t/8nH5Kb4ITqye/GcgIOSXc6iNygsJrV5 UPH0hvwrLw5vpawtT8w/wnmYpg5bOJi5wVm4P8MQ9HFD3T27KezZKVmTgHvTWe7WBctR odb6AHZ2P+M0a0ad1HhqUp33kKFGEqVI8hukR+Wk0yQQhMvINIs79T2ytZBpkeB1La98 vYTpjattyRm+sszXherc797jpLO+NRJFH3/yc2o5ejmnEVqdCsYVoB435qiexlOYHTiH og== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyeu3r1g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:29 +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 2BEM8a45025159; Wed, 14 Dec 2022 23:50:29 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2046.outbound.protection.outlook.com [104.47.56.46]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3meyen35ye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RphzpuGRPI14LAFFGbRoYglRMW+ztvFqQsO4v9UnF0JBpS7lMjXffF60Vx/vt3ufkD56FABiQJetUn7qxQHIwyR1gbJyrJ/oBnxt0C56ywMggmsAMFTGVTUZbccisVGbHf1eR25snCVkFfM8Mxiip1HO/IBI0tfS85IeBH6h2m3SgT4SeMRwjhSoI/Xie/MXunOMmDuD5kyQkc1zHKMqT4OmtOHVg8GLQ4Qtyd+OuRhJ0/KDEa1CjOV64Eih2BpMB84hljWLqae3rJoExgxDeOLLHR4zoamxHoY9BzwqqedyAovHh8pp64BHzLNWZYoFyylDdku9YWX7Z2bDTFjUbw== 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=Fah8n1Py3xQ+8of1oiaaZfw0ztxR8Se0va8Kmo/zIxStqnoJkaxOE0044KWxjmHjB3k4DKQnSzZ66qOAXL9UGQPlq8dJgto2WX7xawxyZlQA0UVKOWcqQ2kM9PumHG3p22e237XXF9LPDuUBK9m0JmbXhBsS2JUhVgw1jAm/i4uBgZZ7O0sEr5ADUHZ6kFWBDYngfhNzQ1Xasorty34uK2PoFFQHYAKgFurMK0GhRW71PmKYLtnWGu0GYQdmkrnPk3EEpy2HcpjFCjoAqNz030986Mpk7hiqfdrzoXmA5yY11jDqSRHswm+FjVReY64asOwkZoUZFbJ8QHl241GqXw== 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=qx/Ay3CG23fZM7cSZiEGncO/YMi6tfg1m+f6GZYnpo+I3Wcamwb+Vne2eidQ9Tg7tGF14bmKv8EM0wRVzFY3+xss5KNFWEUPZvM/g8IuAt6HWN+kx0lnapUbRYBbnlHZzwKIY0wucnaYh1Ra9fNzESnY/hHjzC4OkYjOCcbV6KI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by IA0PR10MB6699.namprd10.prod.outlook.com (2603:10b6:208:441::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50:26 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50:26 +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 v3 14/15] scsi: cxlflash: Convert to scsi_execute_cmd Date: Wed, 14 Dec 2022 17:50:00 -0600 Message-Id: <20221214235001.57267-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR08CA0022.namprd08.prod.outlook.com (2603:10b6:610:5a::32) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|IA0PR10MB6699:EE_ X-MS-Office365-Filtering-Correlation-Id: 386d94e3-e00b-45e6-cde0-08dade2df8f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W+79VlyHOQ670ESRapEVDCGdIUll+B+lkisN3ytNJA32qeUflSe/bkweLawgYe/4zO/DFNyiPmmI2j+fbTvW/D5GEhlqGiGlZOQP2uSiHl6bQ5KbpTnLxRVN6DsnWsyUr/83JZyqVh7kQaVYjvq3xj+91xf8D0lmVi6BYH0i50ShcJvd/ajiPPEda6ublSefS34prVaADhoLBY5D91LKebdAzf9mi+VwTi91KQj6klondepa7fCasp+lxAjz7uSb/SiYYeOsU6JF14JKUIlbDBK7zA1/+uOWIndY+WGCXzA0YsUWzKEvAsdNeOc2vWVLjxHeU7J54ntaY77WpAdkva2iX2Nmqbz1BdQ0yP8VYZAyf+17mX6rhZntklCGvFodAXTR87LBN3mDBXIx55tMYC5EqOoAV1ThcEtbBGMLNleBOLi4Rgek3YzW9wGRNyIjbI7NK5DHDEhyNMTf1B4jPTvei4M0yCNnu4GFHGPiiGVa7ZpnbZpCLkcb3+YaOWD40NLwGvOZlz4xhoy67ohdr/xkJKlEp7K2y6E4vFrMSZguY85j3Q0+eX+39VTUDgIbonSYk85q7ypOYyiuhurA8EfJ14zzDFXVu9O+h/HNBHorPLe920y6GvHGAAOmkvEx0fL6cIRTodS6J6ne0ynuvw== 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)(39860400002)(346002)(396003)(366004)(376002)(136003)(451199015)(36756003)(6486002)(86362001)(478600001)(316002)(38100700002)(6512007)(107886003)(1076003)(186003)(6666004)(6506007)(2616005)(26005)(66556008)(66946007)(41300700001)(8936002)(66476007)(2906002)(83380400001)(5660300002)(8676002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WCDczPLMbzkQSUHMIIoUSmMDY+Ok83gx3DRPgSmdrXe4tpITaROzZ6qYNazeswj0A8TDdeoVfhb2kt8pQEjsezjgEccgUkvWe0FQjwZw5OHh9iqf1WB5lKB6F+b8m2unfz9+zPYhUqSY/CfbpzokdjqH+rfhLPzYguUGxZN94RlRHwLt2IE9EB7P3KrFGK4+ZSxHgO97ryfvxeSSdXtg8P2PN7+sVzWZVHaaFsTpetbiMLI9+sxGfgzaQ5O03Y0oB8XWgI1P2aW20jO6S/SsV+Qeh/SWEHPi//4/xtjRgguuny5/XfXepgWL8HilAdRNNww9NfcYj8DdPb8itAr8R3l/PQqIvTg9QrzI1224xQyqaajrxK870GBQRuqmf38X2hiv94pSeCRl+Q/uzbf7N4+ZDJNCx6gdNCu2nPf8bHLUKoPkrrm6g7vGtLo4zUrBb31KdR10ufUX0hmqaOrJIVBFn6HUWKkNMCY2AOJxEH64DhvvbADrc8GfOVWJz68TS4bCbr+/A6UQkqhhhYaC5zkXc13EBxmkfrPj7O4KV7psG3wdvjvxBjXL0GGswXCL4j851NpEAEzzfMxsEbFMWqE8zhFtzfGgPrDd91bQ/PcnzaE8ksW4q0oGDxIrW01FS3SNBsbgbwJGzhbxrQlvRGS1w3QCQFkD1qoYLTq73ayO1KVVwpDdlkIxlvDKgNDSorB/rldlARD3/nwyS4zfWphlhsMCSEbBII378g7hwGd8apu+ZdpKBsj9h3XNAMZT4eMaM2Txz1PqBDDArx7erxG0x1InfDsjur22dmuhHJ9q55oADdJChRdmhBoEjjnoumhgCngxKpPhL1E7gtHo/RTATrZOQiHGOKWl6lF3MgbjY+1mPyhWIx6algjW04n6rxTPjeBTbremTkSPnV9RA4rB0/KQ5MVSSRoTRhwkxV2/ujQVyZuFST6aNEkiH509mIAiwijtL3IdzeWIQh2BTt/SqUeBWekDu7xxhpuD0wWVl9CQvd6EIp7SzFLwP0d8axTQw/Q5oYzbsrNM43Eci78frcJH2p5BE0RZqjrNTl/9sVkMs1M9fICBobEFsvEZpRYn+PddIpJUcR1LQKS5HerpinfvA/86Jtz8zG6/APbnx+W/SdBdOXfDONyQyoATvjphiW5PR0zZB/EgWmKrnJ/1cotz11YkyP1n2AffLr+KkNqhD5x/9aMxn5jgqpMdxktPznmpvL62j3tiUdAN5jum9rLLjNURtl7nH1oTenaVq4VU713rcm6YgjbFwbOEupsNT04MEVd2SIaIT1V6DelaEUf0w/JegTQvQTsbsLwOb8vcrKT5LkpuzL4l+5tLzcrU2gwARQnq5BDpfGtV3szMdQ2t+zumHmtE2QAZ3NP8ffNHBi1B4k25kFGtYQq0YpT2D9TuNYZxc4GZOwhNfbc4AEZD+qmPzT2dC3YxcJs4ktekF5aZWHVF/AKxNK3onu4MYTb00tooEWRvhoUcKwjPJAtAp88M4VgsssaP4liPaKIQwtpLTF2xFmG9YwT+orqx5k+00/mDDPmlCFJUDtFpSzQ8HCzPZwC66zvk9VHfjYDqRv7lDdJM3CZOc6dO3jSmu5XdgjDTA018fyTWaw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 386d94e3-e00b-45e6-cde0-08dade2df8f0 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:25.9490 (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: NAueykV1Fsp3hjQ0YPB6Gn1FadOitux6OZArTKkplepzW4GufcVB/AhSvNMcWPa9jfhDm5axNiQQY+HG4jurXO7ohNeKwDC6w7ln0qa0+5c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6699 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: exVDFGGovHLI6YiD5tY6PwojbrbGbz8F X-Proofpoint-GUID: exVDFGGovHLI6YiD5tY6PwojbrbGbz8F 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 Wed Dec 14 23:50:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 634752 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 961EBC4332F for ; Wed, 14 Dec 2022 23:52:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229737AbiLNXw7 (ORCPT ); Wed, 14 Dec 2022 18:52:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbiLNXwi (ORCPT ); Wed, 14 Dec 2022 18:52:38 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C7424874E for ; Wed, 14 Dec 2022 15:52:36 -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 2BEMwiBc026674; Wed, 14 Dec 2022 23:50:30 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=U9YUbYXckhFwNyf/bt2t7bKxycCmtnjgtYOSa0JGfuI=; b=nnbfeYlSWB3UiSKFAStMOK3144xsU++fmncL299ZREs8xvrhPKOuFKrDLk4/nVCJSMZU 2hv1ZjHwjztxGX20yo8vlRQG0EzTJ05O7OsO34k6cmrIBClFXLBcU5Qk0O0Xlb31l3GU bKb2jUx1sMC1JMWDypA40lXp4FcdKEnHRsLWuy2s0hoiCgkGnrPUv3SPhPmRQCD/8i9e hUIq8PYhkmUdpfCzgm9renVJHcjarXPVa47J9qWXNY6LmfHACqX0unFoBJ2QzBd31hIL MdFqilT8Oz2gEQBmBb+4zbm58oS7b9y3RxvaSHsOfHzHr1Nrk/8hKaD8GPKV6wIJmoL+ 3A== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3meyeruq5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:30 +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 2BEM8a46025159; Wed, 14 Dec 2022 23:50:29 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2046.outbound.protection.outlook.com [104.47.56.46]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3meyen35ye-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Dec 2022 23:50:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=frfyheT1SXCdACIlEa0YFJEaQqr9ef5+Nz728FtmBtCXvroeWp21F/znbtIAb2AkNoRDDhkRZcpXoH1Kjrf2c98SXSExf9sj5fR9KSZ7hhTP2XRtFRyyGxuoqOjDBSpKlX9/asD8ASwrL98bQD9+stJyzqdUSaaJiV0FKAc6ZpW/uinHpIsoryqonWTKSQj/q3pEUBXU5bBctj08I8yAESQ/ZlpK1/Pk8SMtWMkk8tU5FVBj/6f0FS38Nw47YxLx+YP13UDvRwqLSARb6xRuOhVB1s/07VSdvciwvXgtb5EVD6nxq+1B/Xrs+A2AWsD4KQrQYbmqf4n1XoONtMtyVg== 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=U9YUbYXckhFwNyf/bt2t7bKxycCmtnjgtYOSa0JGfuI=; b=Zget2j4igtqhfOOohbzalU3osRKnBhDZyBXf0EI0TYgG1DsHoBAjykaN3a2y6kArAJSqK7UiNcHHZv+QqSNvivnISBclZsI5S34Vo79BPHjFQksd5Z3lH/bPfEOgTf03jjWV7Pucrguie9MpDxObCw8YYrFq3f4gDinQpLqWt/wFH4WP1SpACvH8ZQlTE/cue/qRs78FsKSSPmnxItBHXrzG0hbhyZdaKljSb88EB0L5CzIoOQfNP/uYinJLtR6UL1a5J1tgCLac7BK17s1YAXOL2S0oWHfEayzY+2+gRikr5D8WUZgj/f60bSpve4mdpQyO8/uja7kcIr1W8OfRMw== 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=U9YUbYXckhFwNyf/bt2t7bKxycCmtnjgtYOSa0JGfuI=; b=WA+4zPZCHU4KgPqveCOmSVLBZBy+qyuuRJBIWZDuwCSHcPyGTLvE24xjXrhKx7GPYtlyPn+yjXDMAjY9Rp8WAmId9835rxAAlPvgq3L5RkCc/MI5Mw1Sd5HIuSB5w1+uHel41vIgTukJ9feMLayhDRTbhs7YyP2L6xy3enKwBYY= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by IA0PR10MB6699.namprd10.prod.outlook.com (2603:10b6:208:441::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Wed, 14 Dec 2022 23:50:27 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::c888:aca:1eb9:ca4f%4]) with mapi id 15.20.5924.011; Wed, 14 Dec 2022 23:50:27 +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 v3 15/15] scsi: Remove scsi_execute_req/scsi_execute functions Date: Wed, 14 Dec 2022 17:50:01 -0600 Message-Id: <20221214235001.57267-16-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221214235001.57267-1-michael.christie@oracle.com> References: <20221214235001.57267-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0377.namprd03.prod.outlook.com (2603:10b6:610:119::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_|IA0PR10MB6699:EE_ X-MS-Office365-Filtering-Correlation-Id: aa66285f-6aec-48e3-0b23-08dade2df9f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9pnGDd5zYc3OSTCJUFaGKwPPL1YU8Tg1rZTTUyHgwAIBtQZXnG620jrS/R3aGTAqlrEH4AEFlZX7h5u8PGIPAxm95nlFK6UgwOx0eZJgqVfkj/hdSwXjCBkToQongaUzHsw8wk7+hFt6+AE4NIgY3u8cOSYd8tmoKagjEI6dlagUxXHHseHwRu6puBZLdkaZPBovEtfg8GBsBihNu/mX+AY7dgTrMJUQw40a1orDf+WjBESY14OFkn57IsI3ozMLnjb0eOK2vSE6+fsin2EREmEe4KTX0v8ohX77FAhNYqiFmW3wbTKhB/f7PUTWNWQ+CWl9ECOS903txuoYooYg9DIpBhGpwdhNelkmSXmjLXT8r1OUGQZ5RZvbfl4dkIT8N3wiQeCePFTRXpIvUNqOD9IfnLaeBLpUDq9hlrE3lOiEVcxdyg5+4DsYJNqXNJ50Wz6l/gJyPEw+Zte+yshwqDy6/X8tFD9Dokc/gSzP3O/gDewJ8diVDr6lW10hIb1a6pnduG4zeT9+baRLk261Pe6ZzXhpy/cNFjN+juxXEQptcFJxDVFvJFHfJ0WbCi93L3W0crcSkN/3rq19erU8+AFVPnGtPuN6rrJ32U+OFvWyQpTOfykqI3SR7EltqYn9XxlJBzc6KbP1NX3raMf9UQ== 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)(39860400002)(346002)(396003)(366004)(376002)(136003)(451199015)(36756003)(6486002)(86362001)(478600001)(316002)(38100700002)(6512007)(107886003)(1076003)(186003)(6666004)(6506007)(2616005)(26005)(66556008)(66946007)(41300700001)(8936002)(66476007)(2906002)(83380400001)(5660300002)(8676002)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: af9RZc8kz16wVyyCd5j+x04IWX0YXO4y0knTUHV2iP+bfZU5jgPbcS91weloMtGzc05sE+paLcHzDcNJnz4tXSRyJGFTqocA1GYa4csXSqEXKHIRmCEAB3LP35hdvKv2jMelgrfg2KZIIGeYGo/KiUcgliEi/AIOeam1PSYbskz8SXnLSoiLSRVkM/6lGxa+pWuImWjCKLA10e1hVhqPJxHu0WIVrJ4SSkUOvFbyNeBsFMKcKGZMudlBYMvBU9Z18lqoaXbz89KKrY++PcRfBUiHI56qB4MXVVGzRgiTuDNYKpfdjuJ2Y1XTe1aFRMXDzmTM5Pdu3/ziKECN3im47hZd2whFxKW5Gs0lD20iuM4xY9YW8QKV4zLq3IVmSm1lztPhcounRcLWKTIFn6MahqweEoT2dDNL+FLnulyTX78UUfUjzIvmdMhaSOaT0nDNPP/7x1qpXZ/NNiY7GYUMpgLo5En1RelU6D8UQuQ150MaPLgzbicruohNy9AGRoenv83+00JGZeNGHTbwWaOSaM5zNyccJYWEr1qC72hfnciVKEZEPyYw0KdbWVplrT3NKafX0m8nbmQZuDVa4MkkfxQfEzVZrVrrpYO8qIjU+Dm2x7bEgwzywH4k4KTkAbdzgO2lxruViSDkVi2Gl3/SbeJFH739rnB+cFOWtVutwEp3GdGZWLSb1YpiS1bXZZRGpzXReMKxB9m88++LPQeCshOI6G0MxG25p3iJOmn+5v2a9Y04xiXm1ZXD0JO+Nw2xns0ETgfAg4npNBQst5VbqYbjwc2UrsULAR9hGfE2Z+CIAd+zi4EPoE5LSRTwqDQrX3wODX7le3RcseSJZKf8LsUZnu8SvyoN6JiJSybPiYIeUb/5nxk/g8yDpPOzaLir1c9mpHIVvNHbJb046/71JUyccLn2BBIus5yczy25og8xepz0VmfQnMkCnA/YULDh2RqM2KryMI1VfWZZretpt3Hs3JwMOOafNiLXV5J4qLcfKERzpJzVUDXcV8u8MQ2VaF26m8YR3+Ep+A/ujrYnjlh7V01CGixqo9IdFsZtsF3mQJrsi7no6gaYT58qfq9K167XEALDlSiW2H4k2aTzbpzSW7SaRgwcPNlw0EDMits2N2X8bXjAq1yQdP3Wz6nSdxXEi2zD17UoAFFOQCRS4dLlq7OENc0B0l1s6Jc5mo5KtXTo3Up1tbg88iWBDDpUXqdZ9cCTY/b4g4ZqWMqcfNGGcfSitM3GlsDMgFk/W1Ol0RhDxNBGcl8HrP1RdJSDq2j4EnT9diPpVaLzvhTsXH9evxOyOtzRhc7Q7r1LPwHmxL6OXAZmYx4pj6kXyg8uwYyX+c2jhnCvpziksmcCeO8CqihtvxknJANWQ2/qU+JXlVAcwpT07C/isbVmQCZ2Idp4vsoaKidCMKBYcP8TgdHHeK0b0mhk1YCAVJ4nfSX94NTDJg88WHAHzXfqlivC4rwE/eQU1b/8A9A/dU5mBdEWp1PlbH2D3psVfzXT1/CQWw296NolmmZuRL5dJtEbvM6DM8SU4L6108qhdD1dV8oGJjS4STT9j4XUnw0DVND9EktHXQDQmqx1tb7kkoGoFYKlqRyFoCOweyVqaREMzA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa66285f-6aec-48e3-0b23-08dade2df9f7 X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2022 23:50:27.6051 (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: kqzKvDdwKuRw5q9ClDBfnbw7HQij8gWOTG8Zd35RN9crtB6Yk4a45Cjzq36hg2imTMCMSECOgvOCRqImdzGsJWT2bpVuZz6mcp3v8tKHOsE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6699 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-14_11,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212140196 X-Proofpoint-ORIG-GUID: 0pTHgezhKofC8jVCbRplfmfs7sylF3X1 X-Proofpoint-GUID: 0pTHgezhKofC8jVCbRplfmfs7sylF3X1 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 --- 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);