From patchwork Tue Sep 5 23:15:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 721422 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 3E903CCF9E2 for ; Tue, 5 Sep 2023 23:22:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235535AbjIEXWR (ORCPT ); Tue, 5 Sep 2023 19:22:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241424AbjIEXWQ (ORCPT ); Tue, 5 Sep 2023 19:22:16 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B7A69E for ; Tue, 5 Sep 2023 16:22:12 -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 385NLEmW030783; Tue, 5 Sep 2023 23:22:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=oxAQ3FNjkqjMOl2csKjPoDHXUWG5w43B2A78nnG3u6o=; b=FiuOBQHgGCZD15IX6gIqoQK6XCMJyDf0hetPn6vdGFBmevxtDMgoAJXxcwGMZEaev0dc D+7LwoZIT6b8ksaDREIygkJYb8t87CdRZqwjLZtzce0jCsx7gEYQIZ2aX17qj6q63qL4 kXnH1kMuRiWaFSm+TV1mX8k2CUKdgeFM6Lf+qzh60sgB7xtgZFkSOu6KwGLxqLiY73Yd n3QB7fx6ccmKyXxQvoI6OobqzxnXJlJv2FgpYsUECgkGMuvX1P5odTDuuQmq+X+6eXkN uTYIkDpXTVGoDNVTJNcM8+LDCTQSrVHj/tYJJRXx3rkKBUmXgBKnOWyB/kAbgEOIU4YK Kw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3sxdwu801w-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Sep 2023 23:22:04 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 385M5Hmv006596; Tue, 5 Sep 2023 23:16:00 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3suug5wywa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Sep 2023 23:16:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IjFq9DEA7kbWl7uATW0S6StnnkRZNspWBwZ/chddKHjQ/WAIhCHQBycErngzwvgFJ7rcT2spd951t15S0b6bvLfM47G9f90MGuKMkz2Twb4GPzzUBvl7v18/4COUqxnFQ+rSnOozWjoIYKbvuYrNM3q5GrlSwRVc8MUmVVFYvhXhbcyoAJfo+rQ+X0EEj8yb1P3f3qtLANM/bTKSLZ7oMyMCqRiC4M/SvLb9UH4+iDSS6rNh+kycYS3cLBi9b3e2DeH8l37xiPUSFy+42eyn6isvwQMKQz3WtAZn/VlWvxb5xdqjP9t5aX/N1laZv7Bo2Frml7pp7is/MQ9zrJhwVw== 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=oxAQ3FNjkqjMOl2csKjPoDHXUWG5w43B2A78nnG3u6o=; b=G5lc0Ufm0QjluRTwKSphb1XYzR0G92UnM2lFOdlePVPYroSQLLRNgfmrloyTYO0QH3WrUnpy6xGKZdpwB+CjiOXACV8D3Mwr75/IIfyALLMCXU7TyGprNp8o6cvtoqD5JvC+1ICSqS2vftpUas3yWRGea818zpIyQ3o+jOUM4+J5otNLHhXNpetFVC1nTF6bP/QlI3oLeOFCqkensFNpJ5t/Gb0CtY0DdWe+57t4vLI02AAIAahfAF6kSbVts3XBy3Ow6QpyBL9VIPEYcYQ4UjmeUf6niQFRfrrLLBMAkMuCmhSjmneZ2tpseXgZpo7q3z+rfEFGfZ1J+DwFPsZrUQ== 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=oxAQ3FNjkqjMOl2csKjPoDHXUWG5w43B2A78nnG3u6o=; b=b1pkgN9Dj0YDYINTGv6VXYtFB/XuIbAp1dq322OU5NsYOerkmWFIU5i7fFyDokSt8xpv+nvH8wwlLol+BEFutzMX2zP3s7Um3FHEJg0lMPVx5UqlDHmVqvoungRZ1C/rVmGYaXO43QIKqWfC9ZSryrvZVso1xbQfI+Pz2NltHfA= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by BLAPR10MB4849.namprd10.prod.outlook.com (2603:10b6:208:321::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Tue, 5 Sep 2023 23:15:57 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::2a3e:cf81:52db:a66a]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::2a3e:cf81:52db:a66a%4]) with mapi id 15.20.6745.030; Tue, 5 Sep 2023 23:15:57 +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 v11 05/34] scsi: retry INQUIRY after timeout Date: Tue, 5 Sep 2023 18:15:18 -0500 Message-Id: <20230905231547.83945-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230905231547.83945-1-michael.christie@oracle.com> References: <20230905231547.83945-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR03CA0086.namprd03.prod.outlook.com (2603:10b6:5:333::19) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|BLAPR10MB4849:EE_ X-MS-Office365-Filtering-Correlation-Id: 51d9070a-f980-43af-8df4-08dbae660f54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WrnJbPDa1bRnk6IDhOO/gdx64N+H9CYTXqXnnG6K3MnYs6tCQWaZhEQQlpFqvfavzozebBOd3zh3vVui7W0bYOoZ6sgz7/2KJ7IMajduFEUbUAP9mUhkXfY9M+UHxSXp1ddR36IfqV8gPXloqVPS3BoqB1+nKD8klwCx90s8wYKFkO3VTbPtkg2H3OCbaPW12RWEPm/fh1Iiei5q2XfFHlXj6hcR8+WdE0LKIAPzyEYgqTXeU8+hUsGOmZeDaKhFGPurx3oiNg4Srpl6dip5tBbP/c1C09jjCw/g6zK5OhS0gQf6u2tukceaM19OQGyLsQml/ZBuElrps3A+agCHQAHSDVGkjaLJ2O+UOfAIFnGPDF/Aez0kYTbX3vAsUMazdpNKyBTijuRpqCgtJoA3yXEbVx6ejHfl4Ps6vIcVxapx5REuCYgpD3T4PEEAqjKiA8N9FMSHIPXr1j/CJoVL3wBl/zzXkCZ268ifeOxwjKuabPJujJnZmmFvSehpb3wDPVYGiwABiyTPjmeObXrY4o3emJti5JFJJnLcajCcUJ5Fo+FgBAMf4WKSuGbgGtps 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:(13230031)(346002)(376002)(396003)(366004)(136003)(39860400002)(451199024)(186009)(1800799009)(41300700001)(36756003)(8936002)(8676002)(4326008)(86362001)(38100700002)(66556008)(66946007)(66476007)(316002)(5660300002)(4744005)(478600001)(2906002)(6666004)(6512007)(6506007)(6486002)(1076003)(2616005)(107886003)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xrrMIGQOSA5QmnHlHHfs6EGVvnwW+okcOFLFNMi/iCbaXDHROalMYZoP2j2sbdOFg3BRgDkiflKNEnyaAIvRXALki025F3yFTSrBt3GpnGqaabOTfjRzt+Y+FfcgGyOMGy4Bxl8wvfS4F07wkgtOFt4L7s1W0Q0kWrEkOZ5XCvmzicaEktto05VmHiffTw/da5tqgKCjLh958Ob8h98hK4GUBbvkwdJyy5RIjxTyw5UuogiPfQVlbAKaH4AYxprWcAX9jV42uzb0hjTylh4NqIl2VVMYMuOTBpfVLRPvBMBLhSpalitu9XPC516iIiqfoMs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UbqNajUH4fB/A+zAk1k6RrjyiJDDvxtzpUGvard1Ub/Y58Rbn21MLnOCOlI77fTVClLdVORWIe9sk1IEhyjemLRKPYfOoyyNYH+gtRi X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51d9070a-f980-43af-8df4-08dbae660f54 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 23:15:57.1694 (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: L1GIdxS9CR3RcZu2RY0iCakRoolKi3OjOweLj2LrFM1mYQRNwFBcg0RA/8EbitoERmwq9uQO5JzuVx3IQNFuBWH6aNpvABRlihCIBYvY7Hc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4849 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-05_13,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309050201 X-Proofpoint-ORIG-GUID: NurYix2dwdLn_V1H1WEbCju6oHkzD4mx X-Proofpoint-GUID: NurYix2dwdLn_V1H1WEbCju6oHkzD4mx Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Description from: Martin Wilck : The SCSI mid layer doesn't retry commands after DID_TIME_OUT (see scsi_noretry_cmd()). Packet loss in the fabric can cause spurious timeouts during SCSI device probing, causing device probing to fail. This has been observed in FCoE uplink failover tests, for example. This patch fixes the issue by retrying the INQUIRY. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig Reviewed-by: Martin Wilck --- drivers/scsi/scsi_scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 0accd2f0f295..c27b64a1b239 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -665,6 +665,10 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, .allowed = 3, .result = SAM_STAT_CHECK_CONDITION, }, + { + .allowed = 1, + .result = DID_TIME_OUT << 16, + }, {} }; const struct scsi_exec_args exec_args = {