From patchwork Tue Nov 22 03:25: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: 13051891 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 685E6C43219 for ; Tue, 22 Nov 2022 03:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbiKVD0m (ORCPT ); Mon, 21 Nov 2022 22:26:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231948AbiKVD0d (ORCPT ); Mon, 21 Nov 2022 22:26:33 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA52B23EB9; Mon, 21 Nov 2022 19:26:32 -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 2AM3PV54005007; Tue, 22 Nov 2022 03:26:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=Er/VgwqdkY1DGlRlbjJQSiy074jnTDSmfxArJvxyMCM=; b=knsvxqUWAQlFS19ITnd0//1N58cMk5sn++JRCi06KuHIFh2wihyj23w1WgW+UJd2wFh7 GLhtDzy8cMGWpX0tWa/lixWeYL6KASLWo+2IThuBuyqQi+QByrq+z9Sr805EryxqKxou O48txQqa/m2uV1NdJy0EXfhCWubVKbat7hBPOVTpIxqBH7CQUGnqWhr5RvtdmZA131VM 7K5qyHilf+Dt5RUzKgzoREdsLrfYMuwua+CRAUMl29zLnaQ4oYIF+KyLKxCHTNxB+ogZ BmJ+3H+RATcbIPVuixRRG+kIsdk2P5szIq6VzcxButDjQt4BcbXAIlAT2pq89BRavCcY 3Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3m0gas0wy8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Nov 2022 03:26:09 +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 2AM0tgI8008247; Tue, 22 Nov 2022 03:26:08 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kxnk46qyx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Nov 2022 03:26:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gEN9/twg7q52mL2V5onktMmYo9LGOVHP/O/tR2jfKzPtxEBSWA85zPkKw2lyh8yI+GVkPrTmdrmsPXTjNo+SL4949U4fwZMtwJMR/VsXmcyXc9gP57B2vzTdAFTdykrvdPfeAdWunbNeyPXf+KPIJOChsR3mdFici7LESZnqgL+H3cvRATQRDBvsBwMk51cBR50bmnAVGHYffOvsewJxa7YnA8b1l3f/gI1CCIJUABGurDYc7ac704tcvGVwynIrcvUi3msDU2TvEyIztzmygGiVqNRqOhf3QlwZAqu8a7UlFgFaJW+9EMensfEIAkE8Zs/DQ/rILm4CXtdWlnBUpw== 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=Er/VgwqdkY1DGlRlbjJQSiy074jnTDSmfxArJvxyMCM=; b=LIM18s+iyFD0+ilOPIKPXb2ejPJeQBi5gC9/t0wZJedF5drjQPAJJPosGh7C33ZeLNgaiSxg1+S3/vAnrx9aQPTMK50xTvZh+Y6vTW3K4ssOW/3sQbiNK7Jy0qoARJSY0U1HICUIpUJRtNpkXR3PjprHm1/2Kw2fyo3LQFBWhqgqRNapNDpKtJVjTDo4WKZaKw+mgIu3eJHPLwTi26lfUeaxdTtlmG0M6/Wl+6DTLZc5+JMczpJEjGp56UI7KS/stecTIV3eQ5xT3IW4ZbmVhYb5R1SIqgDe7CfrCie7aRdh6804fx47HNcHDoEwxStvYKBh97WgKlf/nvkSQcrM+Q== 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=Er/VgwqdkY1DGlRlbjJQSiy074jnTDSmfxArJvxyMCM=; b=fJyT/LapNcLA6DkOl6G1kzP9S8+EYdOVuUDtXM75Bv6ssVOd36PJasJwObSa+l/iXrhKbypW9d9Eu4DT8gNbpJxRCfWwZZHDM2bHBE3G9WYhz1s/qbn87gesOai8YCD/P9MMsjUeTdqM4d2BTxznWC1M5rQ89T4CV8zH8cUcpmI= Received: from DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) by PH7PR10MB6130.namprd10.prod.outlook.com (2603:10b6:510:1f6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Tue, 22 Nov 2022 03:26:06 +0000 Received: from DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df]) by DM5PR10MB1466.namprd10.prod.outlook.com ([fe80::19f7:e081:85b4:c5df%7]) with mapi id 15.20.5834.015; Tue, 22 Nov 2022 03:26:06 +0000 From: Mike Christie To: chaitanyak@nvidia.com, kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me, martin.petersen@oracle.com, jejb@linux.ibm.com, linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org Subject: [PATCH v3 0/4] block/scsi/nvme: Add error codes for PR ops Date: Mon, 21 Nov 2022 21:25:59 -0600 Message-Id: <20221122032603.32766-1-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: CH2PR12CA0002.namprd12.prod.outlook.com (2603:10b6:610:57::12) To DM5PR10MB1466.namprd10.prod.outlook.com (2603:10b6:3:b::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR10MB1466:EE_|PH7PR10MB6130:EE_ X-MS-Office365-Filtering-Correlation-Id: 915a3e22-811a-4aba-2e75-08dacc394a6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UZtU0sCOK30itO2b1yFEHystqDkHCy6b/ES3yqjyM23WFaxV/up0R3HBukpAE57VxZ6iziASwM9e1RXNs3E98yfASOAefkXbE9XyXFNtM3npZnNelYjr2lrdydO0aIYO7djDMjl4bxDHLZfNZ9hpwA5tk2mpF/jgA2tG+5HHnIk7qzkSZDr+Wc+EBPyrd5uEW2HP7KAAD4f7VY/D9UNouZxWdQpbxp2h6iZTKCq+mE4jOkCeFur6nv4Rr/xdm9pP3g4eSgjrmB8du24x8AZ5ruJGVf+hydz+KbPUMJiR+Z6lcAXQxs9uxqDs1WX44CLdBkM6HZHLn4EHGqubUFFY6qRhyBtx7zvwUEQF3vnbAOuhaNGsLy5JEoPteDxK+lYr72DF1xj9E1MzdEtMkGm/LFaY6qZQe9W2KxVAEhd4I/g1njtF9VLTw9jCgqbA01/j3jLhNIwXeRurYlELedljeqHy5Ve6eptuaqMAo5fFItVjoZl1JfpUiPhEzpNm/yzfD3lYFlBryoxTYdS2d8Mchfqgj3N32uCIgfG7mWdloE9L64QV57vYylD/ABGsF9QGu84cr0ICkaIMMReHfVVFkaj70Yrf1ttWAZS4cchTYk9lSCDNRVYrQI+7AyPQ4ize5biUOAq3NTQ0jXMtyZxC5BBLXLBF39TjGBlnLuIt3h3jsI3nZz2brNhZ/UK5Mmif 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)(366004)(39860400002)(376002)(346002)(136003)(396003)(451199015)(8676002)(36756003)(86362001)(66556008)(66946007)(316002)(66476007)(26005)(478600001)(6486002)(6512007)(6506007)(6666004)(1076003)(186003)(2616005)(2906002)(38100700002)(41300700001)(4744005)(5660300002)(921005)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uUgOrMBrqIGuRxLw926evM/bZNZM1e/C+M+iTdijwFbfVgrVV075kgMmXpVRdeg3ghI4RLwPUhbbUJpKrWmMsnHR1G+eDMrclYRhRuHQ9IC1pN6rvrR5PQVG6vj+MZavRiJVx0SEn/x8HFJwLvYFOJ8UifJtBP4DBY1ONMSvzMfW2bFOXg5DU5o65nvM+EKyI9dc1kn+MmXcQLvZ/v77nfMb8HFqgvBI1rNngfgtCt56QodQkJPrQf/eExIH7zcAMxQjKf5LYl5SO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HC0BwaHGs8orQXoFgsuvC0HCgH4p7MQM2Kgnx69XFAH+BrmmVt+wMuBMKPoT8hEc6MXisEiB8yj91hvGDLHxUhx07SA4wYSA71yu5OzT+abebVQ+Mj9zYJnk+5g32CPyb7wj7GGX9Wu+JK3+e86RSyAd2qo98Vu90fmc08CB0fYZjIZxhizl05D/f9aBG8462kPw/0oJd2W9EtYbuC2i9UEBDjA2nbcMDE2V/cJCmn9gZ7LaUT0CzlPD94Br6tabp0LD5368EtAVvg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +BpPwCFDHpgs54j1aEfv464idThQCfPHbp9YTrqPOd++Qrq1V00DwdGFMCn4QGpR+lWhECYlqb0xJDVFpax9v2s8ekaYWBHvJTtbtxeTGmrvJEygeTwug567ENFZnAvcwQtYxQkOqPve7ajtoVYG6ZTVWB0p3EVRqd2cAsn7iCq5OWMX5Jt60W37tWhPIl4DaPfDRnayKhH/93DjO0pQ0hHrH2xFFJy9jiymydqQqJ/O5m268QWsDBnF/QW+yhilbZK87Xv9UHgOYAt7OCvovGXDk74FTCHEO+MV3prYyYfp7o8k1ZYAX04FLy1aO3OzoJPUgKBzsk8KllRxSgQMrWq9KqGnzqCqVXH9q6H8WuyeDFWC1NWOLOx5g9FgX4DbyB1QzOWjWvLCSIJ+JMNFEMJQeON+gXiecIi5fc3FZLpAGf/kk6va6uwF4mDZTmzmtWn7Jo1dN9ZANywJ9KcsCPgD9sc09jqFPexI3hNMLuCKgICtpLpjix5PWVp8sI0iu38xucH2HUC1V7fxCPAqOraDqwmpIfIqfXnoLDbGhUyMANMSX89iTS6351vj5EVEPxayn5PZ+I7wKjzlzaHD2RnPElary6fRdHLwDXSsSo6Ee0vrvWIRug4aTkslONDAKCwu//JWsAkzud7XMy4dPa9//Ks/H2rLDFPYunB5FVBMGM/gh5hFckohCVCNvVRb+nO8er+8SJVsPYNHgicf37muzeZDG1RZcIhsyRednysK+BEmFsye+urQDnidrmEcTjuYXbqwPMk4w/z4xLuMgq7KODoixGca8vBACOTPHle7zWJZt8MRZS2jg66A7SBsZtk70H4dMURBripSYr0P+/TcVJqswZiSjh1P071NY4kfaUB+rFI3PJGW5IqiizmjD1TCesG3OordLAJWGkAjx81ZyZzB6dSW53SCRkK4hNDt3S18OZpnTW6DF+DZ/Zv/lsUoNeYPEODo3kpQdf/N8ODVzVxH0N4g1orm23vr2CvYzVH9Vf7oBWd/6mlrmLnVfetRboAQFAjVgdKcZE9hoQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 915a3e22-811a-4aba-2e75-08dacc394a6f X-MS-Exchange-CrossTenant-AuthSource: DM5PR10MB1466.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 03:26:06.1598 (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: 7bXaQyCbTsSF4Ph639rfDM8upfzeKtZPFsGf9vKYxi4ZPxa8NTx1phlmZucjkItUxl9lB4jdg1FOwYrBgjQA+mYWAyl8qPUAxAHRrAey+Ro= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6130 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-21_18,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 suspectscore=0 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211220022 X-Proofpoint-GUID: 4dYzkTa6iwoBftotHX8axV4m26xdqxZO X-Proofpoint-ORIG-GUID: 4dYzkTa6iwoBftotHX8axV4m26xdqxZO Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The following patches were made over Linus's tree and allow the PR/pr_ops users to handle errors without having to know the device type and also for SCSI handle devices that require the sense code. Currently, we return a -Exyz type of error code if the PR call fails before the drivers can send the command and a device specific error code if it's queued. The problem is that the callers don't always know the device type so they can't check for specific errors like reservation conflicts, or transport errors or invalid operations. These patches add common error codes which callers can check for. v3: - Rework nvme_sc_to_pr_err so it returns directly instead of using a local variable. Also do the same for scsi's converter. v2: - Drop PR_STS_OP_NOT_SUPP and PR_STS_OP_INVALID. - Drop dependence on scsi_exeucte patchset and include status_byte patch in this patchset. - Check for all nvme path errors with nvme_is_path_error. Acked-by: Martin K. Petersen