From patchwork Fri Jul 14 21:34:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13314245 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 91703EB64DC for ; Fri, 14 Jul 2023 21:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230371AbjGNVij (ORCPT ); Fri, 14 Jul 2023 17:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbjGNVi3 (ORCPT ); Fri, 14 Jul 2023 17:38:29 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F33E35BB for ; Fri, 14 Jul 2023 14:38:20 -0700 (PDT) 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 36EL4bNJ014926; Fri, 14 Jul 2023 21:35:12 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-2023-03-30; bh=m92yvgf0SoTmqBy5CyfW+waaXUiO+ASPolyL+wf7mHY=; b=nStnpEhYpfWLuVOFuQgOvsX2Zo7ntyR0j6I/gG35H2fuuvwcKx/m3+sIp5ydgnK9RkEv uABN2NLHegfX1SUfkJhBztPq1K0gxbUD4e5wA3MwlHmUd/PXBnZpMWx/8ufolNfeWbsN 6DwXZJgmrBNnm4CTgr9gY8Q7903uAzCot1DtmQ+6BXbc5x3nvD+0Xeb07kOPBLh/dCic qNriIDLKHNIA8EQRwVK3KLB/bw/e38nneRRtW9jdughHwG4NSta9Cq2UoXIPLJ4mEs7m 6gzY/mt7pdg6VGalr1yjYdjJ9EUZF2P0JzFX3GUPpQKUt6yaj8r0nLLv20IFVs/+kCNd NA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rtptx2f6y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jul 2023 21:35:11 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36EK7HeG007622; Fri, 14 Jul 2023 21:35:11 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rtpvsrw6r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jul 2023 21:35:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B7x87TnGadGC04B7EiY7G0TuiXMyJU7/BXjIbL0/5zQK7jMLc4BwtsXj34spW9Nz873sanWSoltVcWfjH9SfX0Kisf7GCZE6teVS6JSLtWVj287ksIzENwdkoMRg7psXf+hI0Edr3Ek1QePPTptaYu0yALmNko/BEQaAB8KW9388FpTpCHWcH9V7EjEit5c3LslIlg6sJPIpTkxDyaPndmseX0allOI7cBglLUVuU0zakI0bI5L+iy21uwFi6jtFaUhDCJDOhLo5XEmYYA95mf5od+PfVVVRUwlufab9MIcKX+ct0ZcIB15qEE1+YGob9P2LOJpEt7a0mJ2Tn3p2rA== 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=m92yvgf0SoTmqBy5CyfW+waaXUiO+ASPolyL+wf7mHY=; b=ZHF7Mn3mruHEwLcDvi0hJzIzSiQStw/AY1+tLitTrxtdGOS4NKDHhnEUpYG1/eTUwTEvkE6GSY08htQX3Nvws7tbp/A3BBl2Ut//fjVa5Fwyo5SFWZON727zcMKY50fqKtUy6pvlSBEwUhsIHAgwKMGDv+ZbXdiONt+ON/cwonJXpJL2VKVxJK+N+ih+q59sFqXSh+CrkUUaaTPLrpASLvlPtUjBUfhQiECiZkx5qWrpLds2KKIyijQi+wgFfGFEYLsrnmmov5pdGikdK/r0MvaFsrUm5YlcIeupVS4VakHX4FYS0yCMCeSn2CxAty0PnftA+UAoVEG/JsHN1mERMQ== 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=m92yvgf0SoTmqBy5CyfW+waaXUiO+ASPolyL+wf7mHY=; b=t4ibPB9coboWncJMB89xLf3N+4K8pRvHl9V9WE87MiD9qKrnv+vjFo7VYL3qDXZWQJljDxoHMhD/67nFcUwSM6Pi7XtNS+7vnKV8u8pIN2Amub7iPFHHOQMMrpoxsN9kFVUgClhv0fYbCXe9MDF1ukZ+VimWtwPJnWzeKcKGxDg= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by CH0PR10MB4921.namprd10.prod.outlook.com (2603:10b6:610:c2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.28; Fri, 14 Jul 2023 21:35:08 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::f5ac:d576:d989:34fa]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::f5ac:d576:d989:34fa%4]) with mapi id 15.20.6588.028; Fri, 14 Jul 2023 21:35:08 +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 v10 28/33] scsi: ufs: Have scsi-ml retry start stop errors Date: Fri, 14 Jul 2023 16:34:14 -0500 Message-Id: <20230714213419.95492-29-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230714213419.95492-1-michael.christie@oracle.com> References: <20230714213419.95492-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR06CA0102.namprd06.prod.outlook.com (2603:10b6:5:336::35) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|CH0PR10MB4921:EE_ X-MS-Office365-Filtering-Correlation-Id: 30f807d5-d155-4e73-0c08-08db84b23255 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IzTTyDSoymWOr0sPxQfxVejpH3VqF2h9Fl0MzaLo0whbRTOim1nS7jO1Epw4azKKbtDqqExX7qkc+9LOZNtavm9c+l6luQVhtOJONOmudoq80d+WobdCC4uBP61Vi5ojnfZYASqNx5UJN+VOOpv9XG4lS12diIGo61eqOfTB5/ThnNXzfVGly4Kkbs1hS2edQ1ZWPd72Tvm4HOREHmyonvxckmwhEOGMqjbTTsftKIEmy2wJieye9GE9U6nCeaW5VAVlK6fH7eEs16Otg2KQkequzkrGaNhN0wa+o+mo499f7Om4qKuMKVUhqFPZ5w72v/pu/ZoBMbkyUBdlC9OUfLX/STMMJ9OLzhO475K1l85Np5+Zg9R9rryUyUhB9z8Lng/3hHe+fclUYhhH8HJpeNphultnBk1BIdW/ZCYjIxFzvC3a739jeldeReNEpk0Csxs8iLIDK1PfGZ4s+PSBZThlf0lejw0PoKWFhwcLDOx+EWWE9IM/UjfAA9gR6n2sgyd0wCIfcXl5vv/HZO8TTQ+i/B1yzdxB4Z7FMDrRufqkQyGsdCCxJ3xwzWZEldpG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(376002)(396003)(366004)(346002)(39860400002)(136003)(451199021)(5660300002)(38100700002)(41300700001)(8936002)(8676002)(316002)(86362001)(2906002)(6512007)(26005)(6506007)(1076003)(107886003)(6486002)(6666004)(478600001)(2616005)(83380400001)(36756003)(186003)(4326008)(66476007)(66556008)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fBvyZqMml1yNRR80i0V4r48d3j+rLKUV3oAQAJuMP+LgN2nHpPPxArnpcNV6bVF6pQlLVz2zlLcLfqXv8cVTYsf6pmnF/s5PKJZdV9m3WsiRv55XYRErUE7sOWvDobA7/yudl7Vu+lBYkf4GtzqzpnxV83de7Gn4O3rtBNsgmCW8SlixmQ8JUrSF/cH9q1rwt0NCQlWY7VmVDH3xJyq7v12M8ERy0BvQtzAnKj/4zgu1LuTZbV0ntd2Uz6bODRJbpO8GTVzpKQTf1izYRcbDJgB6ylCZShG6L+fP64Afcpml9+r5Ni84xeEWLn1SuAUGFsu2fpKygfbH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HHDrWdGPyvkhHB6KQAMcxYYN5vrsGRktbQgq9G4EGlqkVlPC3Pvvoe61VN8mQCqUIzfJLZlC+iMdIhSqM1EBnywgfUZEdpku8HllaJ5xqMB X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30f807d5-d155-4e73-0c08-08db84b23255 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 21:35:08.7928 (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: Cr2dZvvW4NOF5e74ieZ3URMwB/bYs1W0PQY0ZYKPXT100JtZc2WsNE4of+fX4efQRVlaNxdRUk9e+vV39aSi6Q1ngG/mJREBLNGQptVSrbA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4921 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-14_10,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 mlxlogscore=999 spamscore=0 phishscore=0 mlxscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307140198 X-Proofpoint-ORIG-GUID: sGVr7fxev82uYO8mLbCIExK8dYH-kVJx X-Proofpoint-GUID: sGVr7fxev82uYO8mLbCIExK8dYH-kVJx Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This has scsi-ml retry errors instead of driving them itself. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche --- drivers/ufs/core/ufshcd.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 983fae84d9e8..267c24c57396 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -9291,7 +9291,14 @@ static int ufshcd_execute_start_stop(struct scsi_device *sdev, struct scsi_sense_hdr *sshdr) { const unsigned char cdb[6] = { START_STOP, 0, 0, 0, pwr_mode << 4, 0 }; + struct scsi_failure failures[] = { + { + .allowed = 2, + .result = SCMD_FAILURE_RESULT_ANY, + }, + }; const struct scsi_exec_args args = { + .failures = failures, .sshdr = sshdr, .req_flags = BLK_MQ_REQ_PM, .scmd_flags = SCMD_FAIL_IF_RECOVERING, @@ -9317,7 +9324,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, struct scsi_sense_hdr sshdr; struct scsi_device *sdp; unsigned long flags; - int ret, retries; + int ret; spin_lock_irqsave(hba->host->host_lock, flags); sdp = hba->ufs_device_wlun; @@ -9343,15 +9350,7 @@ static int ufshcd_set_dev_pwr_mode(struct ufs_hba *hba, * callbacks hence set the RQF_PM flag so that it doesn't resume the * already suspended childs. */ - for (retries = 3; retries > 0; --retries) { - ret = ufshcd_execute_start_stop(sdp, pwr_mode, &sshdr); - /* - * scsi_execute() only returns a negative value if the request - * queue is dying. - */ - if (ret <= 0) - break; - } + ret = ufshcd_execute_start_stop(sdp, pwr_mode, &sshdr); if (ret) { sdev_printk(KERN_WARNING, sdp, "START_STOP failed for power mode: %d, result %x\n",