From patchwork Mon Mar 13 09:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662950 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 48598C74A4B for ; Mon, 13 Mar 2023 09:31:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbjCMJbk (ORCPT ); Mon, 13 Mar 2023 05:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229813AbjCMJbg (ORCPT ); Mon, 13 Mar 2023 05:31:36 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03C291DB9B; Mon, 13 Mar 2023 02:31:34 -0700 (PDT) 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 32D0798f001750; Mon, 13 Mar 2023 09:31:32 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=F7DOKRf4GwxnVrEMQXHFYO8VfuWsdW4fBG+9/Nk6PJ8=; b=Wd5IiUB9427/YuSVzNlaLAu63BdeH1B1Bv0E296UMURnF1PpIrAdmqWk+rPqr4F04RDh LL1i/018+hye2kcIcbdAsD3E7MsXXIDCqvph1H7o+M9BiYQepakT5Br2EjhnM41iwDJD lYkzsCKhmNsemcjjxwmuA+BHx2ukaeHoALYGXg6gGcC1Ga1Dzs4Nb8Jw7canWFJmPd2P zFaIYeaD8hpV3qezKsxsisugDtm9TuQEynMKdgABbmVdIJ+JQ3PkYBeISGQ3wQzq99B/ voF2Z+fb1/Iywd8AjvAzM0H1NkctAcvxsneP5qAwLOVuff4r54ekis652hyqAiJRYppZ 4Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8ge2uc3h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:31:31 +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 32D846UZ024963; Mon, 13 Mar 2023 09:31:31 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g34d2cr-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:31:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nAZPsCc+XjHAuzlrr8gCmIk3V0LE6uovBR12zk70f/D22xnBp3f281Temnl46jsM99t6Y9AV9tb6m4vMgyNjEMOVyVEcQQ+2K9wkURKk1fP6DrTX8P5DbK+oULDODdFEd9/gBvg5hBPxzjHx9sd7ako1u0jZSclyW79gkrRXmu/Ko43KMhzYSoqWZva4ZwL8lv7joipMrnXONBXnorEdUBRUYy27M9J6XiG7b9OdK+5In1Z4iJmUNYUtM/biAvvFh3k3GYZgQS3a4UaYTs9TcqAUupcCAbV0FClwaDvQNnFZG/l0DMWYoGbkofoB8jJ0csY64OTwXRD7OsmHDgpaOA== 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=F7DOKRf4GwxnVrEMQXHFYO8VfuWsdW4fBG+9/Nk6PJ8=; b=ShNjboTMxhxPyIbuQz3UG+o2vqJbg90P0ZOJl9iwDgjYUgT47qUa9A2QzeKeo8TykndIu0E/sVhRQddUB+Npfb6rni3fkM5uWn/NPyDpm3I7SoQJ6qWhkB25uRbA4j5FS1GTJlyeJTJYg/J3O8jCu0N59GaWyBduKDj2LvCfmM5JHWPD/kP9YRBGz+j60HYwwO52fWAFylTlQbqPmUYJVl7TuV5dzXJ246xMb20oHkKet8hcnoTI1pZWUA30qVKBv9MIxIZA+12Prt+aCrQyaQfC3yvasQjOBb93ohsGwEI6PreT+SKwXJN6vHek7+Lu220za6C/G3SDilwQgu9nzw== 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=F7DOKRf4GwxnVrEMQXHFYO8VfuWsdW4fBG+9/Nk6PJ8=; b=KUnYzN7gHvpUkzbDMgqZmTBRnUQ8SVTleNTKmY2+FTkw1ZoBqnqtWtpoJYUapnjQ/8qaEPmhC+JOIf1s97nXHKUzWcv3P43sNYwOjsjpruz9XagHbTtGZOoaf9TkhIKHBX+ubbFzSPYN4bUNVg/ozVEqYUbfsg67LcgN+97SZiI= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SN7PR10MB7048.namprd10.prod.outlook.com (2603:10b6:806:347::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 09:31:29 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 09:31:29 +0000 From: John Garry To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, bvanassche@acm.org, linux-kernel@vger.kernel.org, dgilbert@interlog.com, John Garry Subject: [PATCH RESEND v2 02/11] scsi: scsi_debug: Stop setting devip->sdbg_host twice Date: Mon, 13 Mar 2023 09:31:05 +0000 Message-Id: <20230313093114.1498305-3-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313093114.1498305-1-john.g.garry@oracle.com> References: <20230313093114.1498305-1-john.g.garry@oracle.com> X-ClientProxiedBy: MN2PR19CA0070.namprd19.prod.outlook.com (2603:10b6:208:19b::47) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SN7PR10MB7048:EE_ X-MS-Office365-Filtering-Correlation-Id: bf1925fd-5e8e-43bd-a798-08db23a5b9c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bzQfC1bCusqZbYnAADQdoVx4x34HBlLtLeyM/9VC4szcN3qNzWJi29dUuUtUPArCxAMRBTvWNExmVvapc2jnfzPfpJJxPDwZRQEZ+nvsZMPjTAanKVFGl1luKfhN+Chkd6SdqrhL+/qkGPH3PVRXKScVIRPhk2Wj/L8zBa2xMO91zoEavPLf0P9YWpI486azL1IvSrvRmF0wiclGEwe5eDb0VrKp0IyvsDZtyyBJ9hhthGfQwdPDWoFaEd+dayxDHcMCDa66TdfdN9Am4w1CiatUIeM+EzdiH+i9HDS6OkEgYNDHAyIFu1T5c7RjWZOYoyAbgS5QjSB7012xYwH7jxbaVKgOKAzt4ekzmorTloEjFSJc2b/rjsLqzhYF7VwtKqUo3IPYrmvghPEJr/AnOG5l2yRsVJXVOaYzmQkAeUkkr29S++Pv9GvtqQq/Qyo7v76CwX69YS8N4FegF+wRkbFpSZwSw5cJLTRpWkKOnaREc2BUvxdTKlpP0b0xQ6ndjKJN74M8arMxnf9eryujCuuiLjEtxwieMdrwh0esLDPSaqny2w45tUMg8qBWpYQmuIBSee2aC7aY5BUN5141z8jPYarIMi5DrC2H3aJoUkofuWrHCnWAWM8+Y+cCzWTYgIaNlVcnP5uC/6e/gXeaHg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB4313.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(346002)(396003)(136003)(376002)(366004)(451199018)(2616005)(186003)(6506007)(26005)(1076003)(6512007)(103116003)(6486002)(478600001)(83380400001)(6636002)(316002)(2906002)(41300700001)(8676002)(66476007)(66556008)(86362001)(4326008)(66946007)(8936002)(6666004)(107886003)(36756003)(5660300002)(38100700002)(4744005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oRE+eSNNHT5pWn9g6Jkq1X4k4/FyMXgi9vlFJSdY+aqTVBUASQWFOVHK93SgtTYESZUSgIeCh7TnrDesFoeCN3PfbBtUPRg7XCeRKje2fnGm4mB9z2C1hlGvGqj9vgxrfxrvFsfeCQfntEXtiCl6wh7Pdqbsni/WjQSkuLJoxoIxauI2OFwmojENzkK1hoJNlCTrDk+BYKu6Q+KJht3FpYNTFCNa6whiY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RExGqg5TeKQC+MclhA2YqYAZou7Hs3hb5q0vuyCzrbt8OWY3U9TPbb6331xb6XViJV0ZOEEUNXdkA+ubMufNo3SW3m9PTjEeN2tzVEsnYQEkFPJjVTajnXSKJBQ3vLRA48LOZ+QGjhRp0TEJdNtSDXimrjeuwXr1TwBra4xU6kU0BTaHTRiAFztLRHaF/TKmu8laK+SuP6bL88SOAvXBB18y1TE2jO+wwM1qDw0BDCSnoRgC6ZxVAvYY9bbH7vw4tm1ZZHwU5MOQArWm9el1k4zDZVhh2B+CYSDZ24Ay8R8a+Qe6DJFURotLWZDyV7TQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: TOVpu2EkCU9JEIWQGDFK+hkh3FDEykrEPesDHnZBnYZs+0APecRCeUJ93ODoPIVKuz3n4ZrUVyP9870wllb+ELAawVPdmiGDdaAfztAUdMy+okGFdYnJDvKhrnxI2+dQuCKGoYpE4qNz7tvHqQsKj0WCzX4yLOW783lC570+GKg9nX+Kul45aR8NK7RgEnLhT4TQoKDZzYdLfwhOWMh8+tZ0FXpmXIkKjqzz09KsKpH9n51HqDljsv0Twmk3AjdwK4MehQVF6rs1zxnURlPal/pDWpkWQTq5vz+ZvRARioWzLUpnVFSeJECpHN9L+IecSM7ytelUj9q2s17+LYQbCFXcNPgDdBc9uWfNWf7xfb44L+GMggSgmqnkqM5yLk5xwuyh1XVOV3jebFIoxx1O18wRQbyIs/lVnmTmgYS6DPkpvpHWVCffBSophPTF/Na6kD+nDYAY0c/8bX1wL/GTeevQgaNL1on4bgR7wuKmgLCj7JRBRMASMHX89LyosGl596Vx37PlO+vUvEKY66b2uyShPx5Z4ocd86WFSSRiOwzvVaGae3dS8t2uOk02ty6GfuKWP760+cV6VStDmgcR0Is4EBJ2K0pNN431rhB9oDkDx1OeGuUK93/nkVEh3SmC76Un52PpB8gAeQOaKROmQjDEGsHhuz11dbeQOkTWeIit1EJMocJeQ2mjNIjGweSuXYBI2y/kx5QS7Jd1X5hgz8QE9EbngDpd6FdBV/uSTGG9rpiqogMjQU7LOza+uyovN++PCi98okitqGtb1i09sNQFXeY/yY1b9Mot0pmXGcOkFhA+5ePYrq00rDhR9tTHkIR2M44urlSrDMxAcJp6ZTcmTgqpQ6zPypqy+djP7pc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf1925fd-5e8e-43bd-a798-08db23a5b9c4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 09:31:29.7087 (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: L57DM6P8t3a9CZcDUdP4L6MWcDghrM+xDwKxltEKF16Yz2qzG7UUC3yws5mBnQuYxOZFJoNp9pOX+LPeIjTbYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB7048 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-13_02,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=987 mlxscore=0 suspectscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130077 X-Proofpoint-GUID: XpNiwspGpqbG4txIujBCDLmCre3bMs4b X-Proofpoint-ORIG-GUID: XpNiwspGpqbG4txIujBCDLmCre3bMs4b Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In sdebug_device_create(), the devip->sdbg_host pointer is needlessly set twice, so stop doing that. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 554c03d7a648..4c60a055610a 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5155,7 +5155,6 @@ static struct sdebug_dev_info *sdebug_device_create( } else { devip->zmodel = BLK_ZONED_NONE; } - devip->sdbg_host = sdbg_host; devip->create_ts = ktime_get_boottime(); atomic_set(&devip->stopped, (sdeb_tur_ms_to_ready > 0 ? 2 : 0)); list_add_tail(&devip->dev_list, &sdbg_host->dev_info_list); From patchwork Mon Mar 13 09:31:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662949 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 73C31C6FD19 for ; Mon, 13 Mar 2023 09:31:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230483AbjCMJbo (ORCPT ); Mon, 13 Mar 2023 05:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230311AbjCMJbi (ORCPT ); Mon, 13 Mar 2023 05:31:38 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C032E1EFEC; Mon, 13 Mar 2023 02:31:37 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32D105p7014367; Mon, 13 Mar 2023 09:31:34 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=Ls6Eo1X9j6h+D+hYtYNKhPBOnQyjqpjONeX+CFfSem4=; b=XrzkAfQMJltlga3tgWE+C9rnP4E5VHrSdOR01P1BxB8S0tkhmHFQup4UC8VaAe4O2juU 5Jdmonxj7LohozBKiwvyZPBp0fay7ZMBF5+YH2W4mVxusPSsayh/m/nJsfNEUTIBIfJ4 3h2ZDTJWFNcg9/kZ1cX2RvLqAbS639c5twUrev5Th7Nwvzkr+58ITQxeY+eTVMQP+kNs rwj0WZlPIvfVP6SCgAuJskI6fgb/4V0JTEQQ7EjfsjI0dA3eJQ1e3hpx0lwvNDBqD+gu t2dW1oTzAMSn94uUt5ZAX6DotQK8IUow5s8YAhlr+1ii33h0aO6TcSPfOIy5UOL2ENFQ 6w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8g2dkc9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:31:34 +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 32D9TO78025159; Mon, 13 Mar 2023 09:31:33 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g34d2e9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:31:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hO5buSSP8fmR429oSb2GSW2Uf6OgQ8JQ1Q7hxUEFJSIFnTDlNOYjggObblLPT7EfUoixcYzTBRAkuPpInsqLK88A53oFgHMVYpo5WLV/EQNfngsGo4E7yohqFN+cX/uLHQZilfRzY3hAe3Woyc+0X2WZ+9TkHNgaaDOi1S+bdqZfJGFRg+d6VxjMdEH6dPnIbDhEP4meXV+ylTBaRATrcrWqWS+jxWXnVJh6kZjmAzEALnDMcU6wcwNzh1xJ5D6sS9jjhOounRSfBmP0NZuixjsNvR8kHGNHU+0Qojhlopno2EN0NaFruAA0lNg0LT7Iiagfueic24AdQyzX4v2/7w== 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=Ls6Eo1X9j6h+D+hYtYNKhPBOnQyjqpjONeX+CFfSem4=; b=ZACXNghWlsWvEAzGNQIsopN7O2RlWry++hk3KrF2KYzoJDtykI7bDA59K96AB5Uk75VctXB5K+zehOJa2rQHtj+sOfZsAqPlnGFFrQhVoTXrWkpXn/PGigf1AfH69+M+3zHTQMtOxli7XMqwI6KybrvXjQoTDUBoBinfl2yf4GDqWpCEEU6bOJAxrdsIgmB0IukV0400IQuqlkWpxuBN4Wd3c7aZyXbWNB6ahojsHKwAHrP3Nn7sk9Temly4zjd/xdOUkzQUdsSSQ++BhIrl/9HH3qJXA5L7INM94upH/nGjgCUbvcX8S58Ul3VBta3bDNPx1funffUkdPWOOULZ4Q== 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=Ls6Eo1X9j6h+D+hYtYNKhPBOnQyjqpjONeX+CFfSem4=; b=NjU2RclpRY9ZicHj0ZYxBUDSfCHqTRg5yGxe8kbVMk78AYGJ8uuaJZW4bRpttcYUEq6Z664flhmJ4FL936Fhm5xF5FXdvB2l5TNls/1GM2vyB99iLbsH7ueslox0tKEjDmBXNP9pfhXNYDJI7GunDBqZDJghfEzw7YoQj/H7ELk= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SN7PR10MB7048.namprd10.prod.outlook.com (2603:10b6:806:347::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 09:31:31 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 09:31:31 +0000 From: John Garry To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, bvanassche@acm.org, linux-kernel@vger.kernel.org, dgilbert@interlog.com, John Garry Subject: [PATCH RESEND v2 03/11] scsi: scsi_debug: Drop scsi_debug_abort() NULL pointer checks Date: Mon, 13 Mar 2023 09:31:06 +0000 Message-Id: <20230313093114.1498305-4-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313093114.1498305-1-john.g.garry@oracle.com> References: <20230313093114.1498305-1-john.g.garry@oracle.com> X-ClientProxiedBy: BL1PR13CA0373.namprd13.prod.outlook.com (2603:10b6:208:2c0::18) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SN7PR10MB7048:EE_ X-MS-Office365-Filtering-Correlation-Id: 6435751c-812b-440b-ce19-08db23a5badd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yM+/Tgo5uELOm45O9p0X1YxlxHnUOoNmKdWfY/Mt01K8GiZjZFgG6BxBkWlEKdnXyBkQWSwiPMQT9e7qNFZjzfBvmwPMvbaqReEr4yCWGnrL6e8vZ20OHl9f3DI4TH2/qDfvrhqSXKISPe5NH56MgKq9JDvCgzndUV/zPlJpYKbYnkHMK+fWQolRk6ZzacMN/kEjHui6nkxZzZb8mCZb1HiCbt08edPhnUO/LVpWrU8W14NWRNSkSTP1FUoVO8ADuu/krgmW1G4L4L6i49LzO/Y/ADnYcns0ZC3qbTnChPJPl/72oOqR5AqWUYK6rHv2U8cbaJhGUspa50Wz1K9JJxY1c6eiJijAZR7NUo9EmKHeU+ARzr0fH3E9gOFUXOMMTOtFaGyOHXJXNM3WEUtR7LQOLx8cbwvBnuUYRhoUyeCCXLeVbqYPl+8gSIGJVb5Eza9G8bcy5+ME5gyCK29J+R+WEYJJyqiRzvS4BwE0jV/sfb2vNqKBtwXBi6HKI9r4ZEecN1+xA7QX5Ki1nadH9zep/+iD8iBHh14s/y40L8y3vNsucwH9nnc0O65MDv2pOpGV5ab/VHTGcdi0n64/dSBONsadP91sWhwie18pcRTPKUcER1vZcPBxOYRfHi+9Mvhx3cS9U/qKxDPRIiAA7Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB4313.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(346002)(396003)(136003)(376002)(366004)(451199018)(2616005)(186003)(6506007)(26005)(1076003)(6512007)(103116003)(6486002)(478600001)(83380400001)(6636002)(316002)(2906002)(41300700001)(8676002)(66476007)(66556008)(86362001)(4326008)(66946007)(8936002)(6666004)(107886003)(36756003)(5660300002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bGLkFR0EeGTGEmKg1x6eMCZSUh2JiuGWhcf0KUEV2eZ/8svKjaj3NMEuARXATiaGfMzJrqMsbZ5OdD8JQr9QRdg9l2jAXfph7crgAAf9sskPgZl2SQF8xhHvC4W0JUEL7bbNsZbwhIFXPL9o6gaFX3Zc2MJQ0xZwgFDDcB8HwkAylHEwpb0BaL/Yc3ZYH0vYyxlLGPRefHzl2AqUVeTI+RSIenEHTWeA6lByqNKvulAtg4xskNWi6B2/GGpZOhdeY0RpyBYzOrbpxhYm8mlRUVzF3GrUZmTaLTAtJl4SJ7cxIF4NH4i8ak4Zj4KezQx198qxTHjMbi4TCffD9z1S6nvi49rJeY395ELHjnUpI+e4pTU5daDYvLGU+VxaCZR5hhG7kcObCPXWHivEyYIVzSQTHlv7RLRqDfVstwuOkohL/cwF2j6cgnPiIjqN3JraD2FZMHvgCvuubqODmFipw4dKTCUKUESJtkucU+OmNWijlwAmLTw9tioPa/d1n5/890CBclN0cGcpwWPCMZ3jmKpXb5of7fkBybAuHCQe2KZIiFRAKVpAbpo6DhNdrnpwlnIgBlMzvSPKyqk4GkCG8nAYdjksRzAgi/SCxG/gvLrCoGwADzRrG6RB71MPp0wyQmHVB7ly8zIsuLHQDz8Hl+oPi6dUblG+Vdfg8xdupDD2/CGHOyKxs5E20uYAV5bPbRNLSgEGvzjQhNlEjxqRdm2EEigxuDw8T867yb5gx7aJ5zWINRZgQOXFSGQBc6Dc/IZuQcJj7vEQFLreVKdLH7LMQwg+HLXOVacozitGl0w1E0YlQ+h2PfB/Q7YfqPfkJHqGfH16bB9qqT0hSah3B5qjOa7VVINo6tPwjugIqdjPLBREE9fvw4o/YFCFOfWWllCwVorOsdzsxqNSM+GmOusLuIkoWbzyGdcv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nLkP7T9joqwrIg8cXSJG2PLh5HysPJatwQmfFDy0VBRl48hbRYDVTUd0+bkAYaHis4ZgzVIoAmLeJ3eZiv+bpYdYBMbI6K47l+sQE/ZWx66INgP50u02pZua8eGt1qTm1UFx78yOjdPOBXfJRQID8DDYLJH9vjwzSuMBqqQU+gDHgDpNHeitF0DmDQPbmNYAzogal+F23b7i/Gds6rfGdYWo6uGr8mZzMIdhgihxlCA/yISvR/r7JfPU84HNY+f7OJ65XG9g2Pz+BBO+ctFMpbFCOFS+nEMUwAQ24zxRV72iE1rrY98tBo1AEXUZd2BemNhBYu0qK6KJ5ckXZnouU4CR+DodFGvJVNw084jbfcf3/rtjGI0jdS7RBmc+vCQzliA44JfXbUvaNPIyfxE416GJXe80vALmWBRtX+CQLb7lSrAn1iyjFspxNw428AVSaqpF/fd4ll81EZRwxDtn8jUg3AvIw/yLXhmGZ5NCveuRwKyaVbVTj2JsdLTkeaKHl4mglPxnrt72gaX10Q4e2A5reSVvahuxNKN7O5TQJrn5g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6435751c-812b-440b-ce19-08db23a5badd X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 09:31:31.5826 (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: c02aMqbPmCaBdn8bb6zdFs4uBdQfupKaiXWPOxZ0EG0LkcEsmw6H0xFXqWSu5HCiCp7XgpmXbGzD/hSwFOF5tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB7048 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-13_02,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130077 X-Proofpoint-GUID: zt0XdEMowFbyx7_w2JKmwrin3L_f3gBX X-Proofpoint-ORIG-GUID: zt0XdEMowFbyx7_w2JKmwrin3L_f3gBX Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The SCSI cmnd pointer arg would never be NULL, so drop the check. In addition, its SCSI device pointer would never be NULL. The only caller is scsi_send_eh_cmnd() -> scsi_abort_eh_cmnd() -> scsi_try_to_abort_cmd() -> scsi_try_to_abort_cmd(), and in the origin of that chain those pointers cannot be NULL. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 4c60a055610a..2c2a41b99641 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5360,13 +5360,13 @@ static int scsi_debug_abort(struct scsi_cmnd *SCpnt) bool ok; ++num_aborts; - if (SCpnt) { - ok = stop_queued_cmnd(SCpnt); - if (SCpnt->device && (SDEBUG_OPT_ALL_NOISE & sdebug_opts)) - sdev_printk(KERN_INFO, SCpnt->device, - "%s: command%s found\n", __func__, - ok ? "" : " not"); - } + + ok = stop_queued_cmnd(SCpnt); + if (SDEBUG_OPT_ALL_NOISE & sdebug_opts) + sdev_printk(KERN_INFO, SCpnt->device, + "%s: command%s found\n", __func__, + ok ? "" : " not"); + return SUCCESS; } From patchwork Mon Mar 13 09:31:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662948 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 E13E2C6FD19 for ; Mon, 13 Mar 2023 09:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231162AbjCMJcZ (ORCPT ); Mon, 13 Mar 2023 05:32:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230311AbjCMJby (ORCPT ); Mon, 13 Mar 2023 05:31:54 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07DB3498B9; Mon, 13 Mar 2023 02:31:44 -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 32CMFvgG003364; Mon, 13 Mar 2023 09:31:41 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=xBVeTvLzBsoJHRKo7CEnffiNcOIz9zRSdm+Wg+Lq5Qs=; b=Bk+ykmbt/fD8KG2oeZ9lbrQarrTPvfVtiPPgu4VuZeRVXlfU3lAjP5FRiVD2tWo0PV1h xmCWJZ04eQ7ANkCufrP2YYJP4TsJEJPiYKGoOIFqGqYr0JEWsoW5ReVoJPBnj53+vPYB JQiHqT9RiqSM8rmPJC/Hf3xP1jjlT2mooZymBK1aGjb1BmG0L12oaLOD9lLjU+67u5Ew F9IqXNda3lOWgiqSRrklf1/izfqyEg+SLv8Z5ye68Tme7PTcoCSv5+k2omZdKyd5WVnX 9hc1J2lqpN6uDlRMPciB3YeCiJd4eZiYTV8L0Wgkq0WPXXFz5MSqGs+pDPjCBVoz+ShF 2w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8gjbbdf7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:31:40 +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 32D7l0H7025093; Mon, 13 Mar 2023 09:31:40 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g34d2hh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:31:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+M0QPphzzVy5DlWg9FLD1dektY48uUVuwgrOz3yUvtgROg7yPK7h1bgnV83l46Et8oeNG8+3CmFT4kH8vL9L/zBrbsPb8+/F7kIX/FWzdqyZudv8vBKYowccNQj5QSJ57JjQbeh6SMMRAHYq7JBI2pSNggGmel7fPbLCuJ0QbU82G0RNUPxlgrU0wN2eQpVStvzWxy4HKMmJGf07hqFfxdaMHo4KX1i5q+GjFAVQPpf1uUUkdkDOx41JvnrShuPF5NKfnBIBT1huleZPSvvftkwNn5kkWxEnl0giAIUjlrCL2PG8l+U3fKlLc4BmmZdB3uQZ0FeYC+gtoPZl4CA+A== 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=xBVeTvLzBsoJHRKo7CEnffiNcOIz9zRSdm+Wg+Lq5Qs=; b=FxvFkgKuzM8Hdrh0RgDCpw+A1tm703925wCkMIONj2yK0sFkTjslrOVRqyB086yoEM232e5hNDH4XYHU5Qe471ifxhnMibBqoy/kYHxiV5AP51SbrXGYn5IJ6EAC1lod1xLllw0T1J+M0roqaKKun+FqBT9dCGiZ5nYvUdtPY08XhjQtgsSQp5tlC5QbnCChIk0pXSD8OnS7d7Cj6Ea5nToHN81xS4qJViWWoABe57HK03tmi227eU9gb5gOV6FePCBoOOWpnguRofKtnSD+oo8daMMIBbe2pZU+xSJc0HaAP7eu1H+TEaTkuR4syetVym8d8wZdgey63mDJ5AXMQA== 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=xBVeTvLzBsoJHRKo7CEnffiNcOIz9zRSdm+Wg+Lq5Qs=; b=H6iJHM2RX1yI62W0zesdWg/oRlN0CoC/betKzQrGXwdFqSEIwwjTMBeEvPE/45oD/5uKJzRTdesXa6AM+ke10LV/hy5UXLA6KN4iUnAnfixWO2ot1D9ApIsQMAj94fWiPmoXy5IOzHAD86qHqrx8xDQYJ0GvjQ0ZPHkKPGjWL50= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SN7PR10MB7048.namprd10.prod.outlook.com (2603:10b6:806:347::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 09:31:38 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 09:31:38 +0000 From: John Garry To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, bvanassche@acm.org, linux-kernel@vger.kernel.org, dgilbert@interlog.com, John Garry Subject: [PATCH RESEND v2 05/11] scsi: scsi_debug: Drop scsi_debug_target_reset() NULL pointer checks Date: Mon, 13 Mar 2023 09:31:08 +0000 Message-Id: <20230313093114.1498305-6-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313093114.1498305-1-john.g.garry@oracle.com> References: <20230313093114.1498305-1-john.g.garry@oracle.com> X-ClientProxiedBy: LO6P123CA0005.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:338::10) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SN7PR10MB7048:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d97eb86-3b83-4b81-cfe6-08db23a5becf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: abwqERINt/rRyUuU/KuFxJL4cMf/tlIFLe0O62ts5cWbylPQ/5wyLk3yyhp/DnAQgrbbyXA+T17mPRMwXQDrKxCz0Vh5Viy6bdNUDlCAIjub2bUrWIUvuHyZTIJ3Ro11LMv3PY1aJ+bTkFTOo7eSwDzmivHRoxgx/1P5D8BHEW7IBS13g/sf1EKWIzjvzs36N/90ErewwB4GpgcM/weQj5NwqBI7qYMrqDUpoKjBeQQDx6qzOi77+Weue4xCDu6DXv75YmJlAaRi7Uu5N70Zwfao03SnAH2jGlpX+BTsuwaWfw/chdjr2Rgj8qlMvb2a38QJ1kdjIDgzhVM8gmbg2tX1XpfSETKnsSsRio/rcA0n5YcIsJp3v6xkMo2u2ADM5OKnHOPjDbtKrAZooS5RKURZziZBjPgPyFxlhc/fU+a1bmMPL+BpGgZoq22Yf07Y+zxE+CHpjGlDJM43xIhEONgDr77Jl1KM/0Eo78c1Hm/rbTrixMNao/S5u9rgAucP9ahSTISk3f8IttupkPUdjVV9YqBkkTuLu2OL1lTgj01Ify3lWYC9YFdOiiuPclP5e8reCYGoGLu+cIWD2v2cAjZ33yMKiduvuMjQ7KiU9bIPW+1Cesjmh+yzREexvHfp0nwMdCj7gasdh4xqY/840Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB4313.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(346002)(396003)(136003)(376002)(366004)(451199018)(2616005)(186003)(6506007)(26005)(1076003)(6512007)(103116003)(6486002)(478600001)(83380400001)(6636002)(316002)(2906002)(41300700001)(8676002)(66476007)(66556008)(86362001)(4326008)(66946007)(8936002)(6666004)(107886003)(36756003)(5660300002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6ZuEquCTA0j6GJflog5viVeQB8YPl+Z5j6Lj/95sSD280LwKHT40MkSn4MSHZcK09sfZh4SFLahKPFq9I8UurP90A7r/wYs3+OubgP3XUYTFRXzN6K1mxDXzRWfg7dtuDdQ4gQNFOJQ6mddl6TeYi+hPpEaBbP9ve82iQbS4Lzx3BmLGLS0Pw83eXNImnUW4CNO6zh1Ag9lDTSvenD7SFLUbmsoLfbQFQ71kAU19KIk0/4vvVeCAiz84CskSC5m870EZFjQ/XMXpC2QCppTJpaacO/jd2+Pq5iiYnj1tseb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YiiUfUYagFHOqEbM60ZTNToxnQRqcEn9k1HFF2N7na335SPmZWy7Rt/b0MSc8hlBB674+XOcKKKx8RD3Gp1FowWprBZNcAWAUeUoYHqT593KoL9uSzssEXxSZEsOfNELEJS8S1BT5Y= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d97eb86-3b83-4b81-cfe6-08db23a5becf X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 09:31:38.2641 (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: K32TcK0+JUtJhwYux6BOsZtQeLalHNWhoH1b2/gzw8RCOs/AAJevLpPupEltHZHyOscTejl+4g7UsQ7YgSSMeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB7048 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-13_02,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130077 X-Proofpoint-ORIG-GUID: B6paqOCrczLEfvQCI1X8yFgYJBfuEPMB X-Proofpoint-GUID: B6paqOCrczLEfvQCI1X8yFgYJBfuEPMB Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The checks for SCSI cmnd, SCSI device, and SCSI host are unnecessary, so drop them. Likewise, drop the NULL check for sdbg_host. The only caller is scsi_try_target_reset() -> eh_target_reset_handler(), and there those pointers cannot be NULL. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 5b51c24f7d09..6364d6f08861 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5387,37 +5387,26 @@ static int scsi_debug_device_reset(struct scsi_cmnd *SCpnt) static int scsi_debug_target_reset(struct scsi_cmnd *SCpnt) { - struct sdebug_host_info *sdbg_host; + struct scsi_device *sdp = SCpnt->device; + struct sdebug_host_info *sdbg_host = shost_to_sdebug_host(sdp->host); struct sdebug_dev_info *devip; - struct scsi_device *sdp; - struct Scsi_Host *hp; int k = 0; ++num_target_resets; - if (!SCpnt) - goto lie; - sdp = SCpnt->device; - if (!sdp) - goto lie; if (SDEBUG_OPT_ALL_NOISE & sdebug_opts) sdev_printk(KERN_INFO, sdp, "%s\n", __func__); - hp = sdp->host; - if (!hp) - goto lie; - sdbg_host = shost_to_sdebug_host(hp); - if (sdbg_host) { - list_for_each_entry(devip, - &sdbg_host->dev_info_list, - dev_list) - if (devip->target == sdp->id) { - set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); - ++k; - } + + list_for_each_entry(devip, &sdbg_host->dev_info_list, dev_list) { + if (devip->target == sdp->id) { + set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); + ++k; + } } + if (SDEBUG_OPT_RESET_NOISE & sdebug_opts) sdev_printk(KERN_INFO, sdp, "%s: %d device(s) found in target\n", __func__, k); -lie: + return SUCCESS; } From patchwork Mon Mar 13 09:31:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662947 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 64CB0C74A4B for ; Mon, 13 Mar 2023 09:33:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231288AbjCMJdW (ORCPT ); Mon, 13 Mar 2023 05:33:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230420AbjCMJcn (ORCPT ); Mon, 13 Mar 2023 05:32:43 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5D3753D96; Mon, 13 Mar 2023 02:31:56 -0700 (PDT) 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 32CMo832004881; Mon, 13 Mar 2023 09:31:51 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=JT0I1lmBwY2/I26xELUpQi/FnxBeftdM885RAyK68YI=; b=Zf60wYcVpeba03dA6L0eUIylZSpPuEDoXAA+li9wp76HHmj6SiyD4FxJV7qOnFVZ3rS5 KJGvEyqLi/BzyZYXnP2mGPULC8i3cpmXG2e0WUjXFbK8vTMGIh4U1v6iGpaam1bwWGjP pNI6kiEzgYHQF5CflDERUluT4zjn1NU/oBsS/kFqkrl2SKM+hKxIWBrGh6zXTlzAoIFL YPOu9dN/xpOMvcuk0aZslbe8n+i6er9ZxNGoqezSOVJNBk0z4R5Tk83qssfqK9bhJiHS Yut88J2QhxttId2SVo0bYrVqIOZDJ8aD+DnV/DfXxVhDXuge9oe61TZMhQjx7GECF5D6 nQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8j6u3b6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:31:51 +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 32D7v6bO002392; Mon, 13 Mar 2023 09:31:49 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g3awer7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:31:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+FvIMMBEs2JsS9iCXVLe78lLwEhb2j8rtm3ut7AbxYlJP2wkaKU8XhCUX9DYPbVrXq9ETdxAknbRJ/a6KV/q8KA69joIW1Tk8VgZFPKcwI/in2PXWVMP+pyZ4Bha4lhkrVwa7nwuWaQEg6Ug6FwdWwBtgZcVwtXthZsSeCiYFLkY+Vl+jHnFV2fPjrLg3Eu0wueMkldHdGKR8bmrjWMHnC0MuUw3nKLx9RJ1AKxQdg9QQ2itSkbxzBQWCrIEfiyMo8EbIvAgIauaM5txy1tROHVELwzxrYyK4/EaH+YFcvRwPmbh4ywjPui2y863J9PMlco/a9eJJNDayFoQkQa8Q== 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=JT0I1lmBwY2/I26xELUpQi/FnxBeftdM885RAyK68YI=; b=mi7b+oRU8A3aEOwoE7pIzNheDitUoBT98ziY+I7rJT42FXLHUXlwL3uqIcrkRZofV6MWNTpVRtvx2QYvOxX6hw32nSXZ5/xdEKn9jwUr3CV0PzCUA4je7E3jG6BK4ipp9ZkdPYv00AiaFDWuRC9X1Xpt0vtvqCqwMKvBR/GOwVssjXH0dsnVnjb0Q/45OtDLgtV+qIfAgzX3pNw6LxyjllSuelsc4Ol619rrn5XF8Qhwckkcolul5Y19aPmi5uuccOUxWC2c64S4hq1eYdh60ow2HHwZh6fUpz5MgOMMa5JtITDEv6bhP0/bvC5JXHQ/lDg9ttyOz2fEyUk+CXcvsQ== 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=JT0I1lmBwY2/I26xELUpQi/FnxBeftdM885RAyK68YI=; b=wnQhRW9c7Qj3dMtacreo/v9NgVgBQclkgF0Npnc2yOVrY8r9O4ZijireAAUBs9lcHq3N8Hb0HxgooiRcdfjIcNInWUjlrXYEhAQEhZbAiUP49Tzd/mM5Qnh/fug+iX8HksMhrcxDVHr+yD0XwsnoDhpJOT264jFcpWAg682cc9o= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SN7PR10MB7048.namprd10.prod.outlook.com (2603:10b6:806:347::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 09:31:47 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 09:31:47 +0000 From: John Garry To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, bvanassche@acm.org, linux-kernel@vger.kernel.org, dgilbert@interlog.com, John Garry Subject: [PATCH RESEND v2 07/11] scsi: scsi_debug: Drop scsi_debug_host_reset() device NULL pointer check Date: Mon, 13 Mar 2023 09:31:10 +0000 Message-Id: <20230313093114.1498305-8-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313093114.1498305-1-john.g.garry@oracle.com> References: <20230313093114.1498305-1-john.g.garry@oracle.com> X-ClientProxiedBy: LO4P123CA0682.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:351::7) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SN7PR10MB7048:EE_ X-MS-Office365-Filtering-Correlation-Id: aacc9396-bd30-4d3b-0fc7-08db23a5c46c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NVJoFjCLM5mB5X+rppvplF3hZpogxm/LyOGoSPNtDYDF4+hVkT6Z1vuIITrG9LOFDwII78jqMprE0Bb7RsSZAiUjLedFUmsHyQuajzogWdZ5NYt8b31oIydljOXZyg/zI3PdaK89NLsZhUbVgALRqzU9wCYH3Eh6zvUBi/HmTV/EDpICPUE2Yq7JKVRKy2PolV8r+E5XVL3F+u7x0fkciBwqr/tXZpp6sC8bXhiup8QlR4PJ0CKdCDKq24KDZ+VZh017kgJttyfrvHn3UbTnQrTRror4F3EL62bxIYnVQJvj/H4rz3APv9pD2l1/ZOV8yD29865e+AgTzni0Wiqf+k6QtpbOSxyBYmI6aIB3u0pO35se2ktuVsQA18I7lx6dCHsK836LjM2wQzPKT5r5174lNKgvwkRIMRMREdyzRxYe6Y7f8XLuiMxikmClrCSjiUtW6E/kkrIwVtwLMtl4q+MMtP540I/Jvad/vS+0Ov6c8oU+goUi6sM8QTFU+XeFS+0Q0clAKCeKd71gYshszm70wDeiQhWY7JWnpYXc6jSetjfU0YPi4OXeLYZH1wsanvPXUosWmnS//4At1SEGrcfDq0Y55Q6VMjPu5r8QteWThe3fSsrlTu1yPL2Df3SSQW+1twurplvc2dDFtQ8LhQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB4313.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(346002)(396003)(136003)(376002)(366004)(451199018)(2616005)(186003)(6506007)(26005)(1076003)(6512007)(103116003)(6486002)(478600001)(83380400001)(6636002)(316002)(2906002)(41300700001)(8676002)(66476007)(66556008)(86362001)(4326008)(66946007)(8936002)(6666004)(107886003)(36756003)(5660300002)(38100700002)(4744005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MHAe0pSjkfL25HxWv5SjmWlElu7nvta/dTiCqUm/xRY5vElGbFR/+DPi3qIh1b5aFiBpmDM6MnptZ4TbACxwliR0rdJmV/OfV9kKjUDzS3BmxOE6EBstbita+1/fKVHBU74mXsfCPYEWGDAyxY6UFoJuseTAlZjpzvVzO4LM0Zctck4KnSVf6TJZGPvBJtD5TzjMV3tIARHcx86WcFNmmd1tV7Y4ht01quGbBtOMsdCXdYd2eNWdDb0vYJnstx4LvTyGsL93u8KFgKAuOGIDyR8cJNovMhHrs8zcdZ25DirWM2zCJbDF9J6z1f/ZETq1nREu9jDXC4d+6jdWkSAyunAOVI1RiR4+uH3jZiN8UWfA9bpFjjmgTlOwVi568hPI2kLPeNo9sAX1BxGXo7SDwehEqF847KwX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= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aacc9396-bd30-4d3b-0fc7-08db23a5c46c X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 09:31:47.5830 (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: OhudysfflbxL1t0htYilXv0zP+JwL2wxmB/flFdMn0iVCC0NaSK9FcRkAsd7sYILgYlEL3lsNfrJ6PeHwkusMw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB7048 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-13_02,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130077 X-Proofpoint-GUID: OqJSCrVDfQRIQlztVg8oyO1jE88XGOW0 X-Proofpoint-ORIG-GUID: OqJSCrVDfQRIQlztVg8oyO1jE88XGOW0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The check for device pointer for the SCSI command is unnecessary, so drop it. The only caller is scsi_try_host_reset() -> eh_host_reset_handler(), and there that pointer cannot be NULL. Indeed, there is already code later in the same function which does not check the device pointer for the SCSI command. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 749358b48335..47820b9f6326 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5440,7 +5440,7 @@ static int scsi_debug_host_reset(struct scsi_cmnd *SCpnt) int k = 0; ++num_host_resets; - if ((SCpnt->device) && (SDEBUG_OPT_ALL_NOISE & sdebug_opts)) + if (SDEBUG_OPT_ALL_NOISE & sdebug_opts) sdev_printk(KERN_INFO, SCpnt->device, "%s\n", __func__); spin_lock(&sdebug_host_list_lock); list_for_each_entry(sdbg_host, &sdebug_host_list, host_list) { From patchwork Mon Mar 13 09:31:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662946 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 09D57C6FD19 for ; Mon, 13 Mar 2023 09:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231331AbjCMJeL (ORCPT ); Mon, 13 Mar 2023 05:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230192AbjCMJdT (ORCPT ); Mon, 13 Mar 2023 05:33:19 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 604AE56163; Mon, 13 Mar 2023 02:32:16 -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 32CNEIgH024676; Mon, 13 Mar 2023 09:32:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=iS3oQQgc7Zn8ODNsyFBZug+VoRiFIqNLNpm4/xSdDHU=; b=NVa4BXiNqwUYB6tQzhbtt8AdZAaC8exhZxO9Qah0/nLOu9+GrpvK9shZMxTm9orDGe0d Ji1h9hR15KRCb1jRWy5EhxEXUPGGsNBBmlxaacrqv97a04sDEf+mnSegvP7uVYSs4tUi 7Hne+cYzf5gF4E/vVPFeHJ0xi3lgjGrfgZkONLvTaO+//XQtBMmH4//LCM2TPU03SVIs 0+aT+xn7HDswtuNv+cVAFpTQ56SuwpMgUOU8pG7JBRV9T7vdneoUZq0+3dJwJHXkTzu9 Cgv961VrJfMpN5B8d3zX6tpF7/2mpHPaOyBx0gEYL3Ol/qqxebjOksMMjbRW1uB4BKvN Sg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8gjbbdfu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:32:01 +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 32D8gK1m007336; Mon, 13 Mar 2023 09:32:00 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g3b5fvn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:32:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S2RkFAnRpophrLUSPjKsstgDOYDC0faIwVTJXdMxfTfTmANTjpdjOY+AJPPCeYPsA/18feYx32CEtHDbtotPm9Bz/yCHTitNkP/SOIkV1rPhz+FQx3X/aZHeJfZKyuS3G1Yv80IbcbyZpqkp6G/n5N5z9ACaBLnFPZSGkwoWB+NDp8kSgzjJS3sbBdJPeVqmNjvrawb7kivtFqFKomilAcTQMq8VSKgYZHsXYAVumOfRyB47dS6Op3RRKRO2GX8yhyG3O6hKgcZIL0ajpKWUGLihe2nWR6F/Jo4qz1xFOdfRBlZU/m30iwP7YTcxOGXNw7kDLkMeiusE5BjzE0sjTw== 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=iS3oQQgc7Zn8ODNsyFBZug+VoRiFIqNLNpm4/xSdDHU=; b=koZVQYtrK8C/zNaIwNDDxNUnzk6ifIMv5u6ciPuCDthvWppaQy/utjqmj6tsPhAVyDKeaLDwKZn9qL60Osmpt9YqNAfhkXASRQpuCk151N7a+THZwu/Nj75nYdWRuGTC1WtAct6iD+M2J3FNz7clXKndEdezyINAz96S8u41EkH4Necp5nbT803yFuNcIlRWzgXzvdh82/6X34bsudbdRazDFOe1ue7F3DWehd3SFyENo3urqk00aeIyORx8ER+p8+0UNY2vlrVkfnd1IT8I57hc/JOsbhRmGnKLKLyyFueqxZciEVmcTDvV5naBGuzsFuvAjxf9JHeD5zDTlxoA3g== 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=iS3oQQgc7Zn8ODNsyFBZug+VoRiFIqNLNpm4/xSdDHU=; b=JJJbbIHAXtB4rLiDuRiDiTSFd/OXByWvE9kCIXC5TexhqhkkIwP9fZrlzT4n7w8NzOl5JZREiPXUy0ve4Zl9KHR1p+adu52zaQuIwP9pnbzO5IXHirzqalToEDmtJhDe5Ttnqv234GW5Q+EAFPWNZRQwDPFYb7Iw424UXbzye1w= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SN7PR10MB7048.namprd10.prod.outlook.com (2603:10b6:806:347::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 09:31:58 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 09:31:58 +0000 From: John Garry To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, bvanassche@acm.org, linux-kernel@vger.kernel.org, dgilbert@interlog.com, John Garry Subject: [PATCH RESEND v2 09/11] scsi: scsi_debug: Drop sdebug_dev_info.num_in_q Date: Mon, 13 Mar 2023 09:31:12 +0000 Message-Id: <20230313093114.1498305-10-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313093114.1498305-1-john.g.garry@oracle.com> References: <20230313093114.1498305-1-john.g.garry@oracle.com> X-ClientProxiedBy: LO4P123CA0331.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18c::12) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SN7PR10MB7048:EE_ X-MS-Office365-Filtering-Correlation-Id: c25c24bf-1c10-4d9e-1d22-08db23a5ca7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ccj8S8ng+r4lKwKf+kJm/S0ffCBr2H4IlPtngbUR6/5HbatWy7oBVUldjnZsiAK8KS5cFeL+Pt7f5NteNSAi49LGAd1sKVA742rKEdLWpZflEOAEVkaqI7SefXlNWIXD/P0pw/tMjBegXw6NeobK+Cm6mA/rJuTSSLSED0aUd3vy3i2o70v4TqsmyVkLJiX66rjWGy6vjKCK1FnH+NqW8vrn9pXoUelC4tJGubhBJDrdhNSvRzxnMozSNacJBU1lbYitP79FazdnxgUYZOLG++03ZpDRxH5IRcnEkHMgkdpj46BXukvgno1AKbRenZgX5BfDtV93i9nBvD+zuRzGAdOy1CQ/vl5HMCzP6UDmcV/voGisL8bTq9jwazUMU23pR1/seIXCW5sVEW56Ow2tdMpykUnw5xYdZYJH/xnprHQHqQMkIhwJQMA1AsLD190Y/FzNKMwRQBGQJhbPa0t2LepgMpte9sHW8FA95vT41aN5Rsj2jRoTjV0fPknM4xvtpCmigSsQpBgM/GsspRCtFMmtruWA22rRSBQ4b710ws97Njy57q+pHaL1SBFkw0FJBBQ1pU07MqJhaDsLEZB9YWSjsrEsmNDCb40x0nOVZPgB0llPNvY44104klRUogrt2vqpj1n9nZqak77jMLbeHg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB4313.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(346002)(396003)(136003)(376002)(366004)(451199018)(2616005)(186003)(6506007)(26005)(1076003)(6512007)(103116003)(6486002)(478600001)(83380400001)(6636002)(316002)(2906002)(41300700001)(8676002)(66476007)(66556008)(86362001)(4326008)(66946007)(8936002)(6666004)(107886003)(36756003)(5660300002)(38100700002); DIR:OUT; SFP:1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W3VqCa6T/nnwui1Iue9zGz1trZeQNb7gv2ApX7o0myP7FQsd463V1euGPXa21cRf3hyny3tmFxk7AOgzd7x69+NXyUc8dniz0BC+43ssxK4muWkDSh+qfiETEScgkLOAJL9R3XDY/5szHvCbflIvN2J6bjMhMGlPsS6/Cih09C0+QFX1GyIztxEs5FnaU+0iPVSbxih3JF3e05/OQKHbAnWw3I0OWpDIy/No86oSOjB5/a7dDwtWH+0wX52uiYXAfS+YSl6q5gNBw0iKgH/nXPZlzpWQqqfq4R6DVBy9a5fUAOjoOVXMmvx0q3sxcttvc1gEif7sQXIK1wS0TrtV/GgROilA5KlG89pd+y3tWBUMTXqvdDdpo45BcVES6dmhOIDQaEpuI3AFleoVlhLqopCNRNy3bUNRg6cLGboLiQkd6qCY9neYiDNMn98tn0V8Fsd+88omGPK630adWBQvzStV1AmHIeX/x2vkxpUfq6K5EZPBEnxN9xhR996viR4wzlAMEWQQPo0BICeeEqdyj6NvutUlarAGBj6788Th8Wg4a93zB0NOlMRgF1vMj/bhlik0pYO3uQU1DkBa8EEh2nRFYGMdg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: qBP7176wihnTZPOgCYtzF9VvDaMUaMTuPgxD6m+1wddS0MdQlIq6Vlau37MDs8ivpdsTz/3ZD5FkyVNUqDYT2Spc1OCQly3wbkKlvoaJ1kGQqtVskiHQToS4yy/Dc5T5gx7zCghlLGBQlgbvXFeTJ3ALjdgK/S6uCUn2uI3P78ibBVYEwWnGyViKizSYJqpdv/5l5J2AV1mx4BP8d9vF0Cq9eF1YQqhDVmj74VY7GsapEAnjgUdq6NphHkgvgOJ7IMNo5JJaA24M7s0pxerOOC3yGZTHDcTb4lVsg0BVQDIjSavy+1klikEOwEn6y1qCr9yVQghkx7r77+r0c4A8cdFjAbFyly8/q2k5A5usshyl/eB6WGTOCzw4zE6fIrcSXIPImb/LW/sykbiBbhYFJrwc3XUWLTUO/ww2MCcVSTKZlolHC5Zus799/T6a3REAa069BiJxsNrvIqfrahI4cqd5uIiYR5wQsoOiCqfFI5ctsrfu4P5uuccOiNA2OTeo/7Y8LPe28Zm5RNBzkgyLPX3+zCDFAde5rYcEuz97yfJ/vNymdkJmqX1ywhtxQxcCDDttA4AlIvQMsBnZhNPRLlvdn0bEJG66e2F9p1NR4nTdlMDHYmA5aBynieFjiUdf5owjOujjC7vyMFBChIeVOg37yCyvV7a8l8EMA7lqmW6gmtNzjiSj5MVQNBeK7P0KOF4bg39mHs4KXasKc6PHIMVO+M4mIraAfaFEJ0dBCvPoTYziBpi+7KVkr+ZJj9Il6tYrQ9Scd3YSVkIW+rgErYrLTgU1HwfvdO6PvN0MD6qMfaUw2GSRNYW4lURvo6qtYBHxLQFP55lAMR4+oFhPsiltOz2AsaJrZ5pb3VJuIag= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c25c24bf-1c10-4d9e-1d22-08db23a5ca7f X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 09:31:57.8679 (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: DMnogREw4vL8yiKSsOsgvg6ib3+nD3k5dM2LZqr91DW0lJ4Fo3kNYGysw8pnFrX1TaCkG7UVdUXoAMU1Mt4z5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB7048 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-13_02,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130077 X-Proofpoint-ORIG-GUID: us49QNoRhyJ68M7972DdxVZL8VKIebW- X-Proofpoint-GUID: us49QNoRhyJ68M7972DdxVZL8VKIebW- Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In schedule_resp(), under certain conditions we check whether the per-device queue is full (num_in_q == queue depth - 1) and we may inject a "task set full" (TSF) error if it is. However how we read num_in_q is racy - many threads may see the same "queue is full" value (and also issue a TSF). There is per-queue locking in reading per-device num_in_q, but that would not help. Replace how we read num_in_q at this location with a call to scsi_device_busy(). Calling scsi_device_busy() is likewise racy (as reading num_in_q), so nothing lost or gained. Calling scsi_device_busy() is also slow as it needs to read all bits in the per-device budget bitmap, but we can live with that since we're just a simulator and it's only under a certain configs which we would see this. Also move the "task set full" print earlier as it would only be called now under this condition. However, previously it may not have been called - like returning early - but keep it simple and always call it. At this point we can drop sdebug_dev_info.num_in_q - it is difficult to maintain properly and adds extra normal case command processing. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 63 ++++++++++----------------------------- 1 file changed, 16 insertions(+), 47 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 0d515bac93bf..449b460e4c1b 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -288,7 +288,6 @@ struct sdebug_dev_info { uuid_t lu_name; struct sdebug_host_info *sdbg_host; unsigned long uas_bm[1]; - atomic_t num_in_q; atomic_t stopped; /* 1: by SSU, 2: device start */ bool used; @@ -4931,7 +4930,6 @@ static void sdebug_q_cmd_complete(struct sdebug_defer *sd_dp) struct sdebug_queue *sqp; struct sdebug_queued_cmd *sqcp; struct scsi_cmnd *scp; - struct sdebug_dev_info *devip; if (unlikely(aborted)) sd_dp->aborted = false; @@ -4956,11 +4954,7 @@ static void sdebug_q_cmd_complete(struct sdebug_defer *sd_dp) sd_dp->sqa_idx, qc_idx, sd_dp->hc_idx); return; } - devip = (struct sdebug_dev_info *)scp->device->hostdata; - if (likely(devip)) - atomic_dec(&devip->num_in_q); - else - pr_err("devip=NULL\n"); + if (unlikely(atomic_read(&retired_max_queue) > 0)) retiring = 1; @@ -5192,7 +5186,6 @@ static struct sdebug_dev_info *find_build_dev_info(struct scsi_device *sdev) open_devip->target = sdev->id; open_devip->lun = sdev->lun; open_devip->sdbg_host = sdbg_host; - atomic_set(&open_devip->num_in_q, 0); set_bit(SDEBUG_UA_POOCCUR, open_devip->uas_bm); open_devip->used = true; return open_devip; @@ -5263,7 +5256,6 @@ static bool stop_queued_cmnd(struct scsi_cmnd *cmnd) enum sdeb_defer_type l_defer_t; struct sdebug_queue *sqp; struct sdebug_queued_cmd *sqcp; - struct sdebug_dev_info *devip; struct sdebug_defer *sd_dp; for (j = 0, sqp = sdebug_q_arr; j < submit_queues; ++j, ++sqp) { @@ -5278,10 +5270,6 @@ static bool stop_queued_cmnd(struct scsi_cmnd *cmnd) if (cmnd != sqcp->a_cmnd) continue; /* found */ - devip = (struct sdebug_dev_info *) - cmnd->device->hostdata; - if (devip) - atomic_dec(&devip->num_in_q); sqcp->a_cmnd = NULL; sd_dp = sqcp->sd_dp; if (sd_dp) { @@ -5308,7 +5296,6 @@ static void stop_all_queued(void) enum sdeb_defer_type l_defer_t; struct sdebug_queue *sqp; struct sdebug_queued_cmd *sqcp; - struct sdebug_dev_info *devip; struct sdebug_defer *sd_dp; for (j = 0, sqp = sdebug_q_arr; j < submit_queues; ++j, ++sqp) { @@ -5318,10 +5305,6 @@ static void stop_all_queued(void) sqcp = &sqp->qc_arr[k]; if (sqcp->a_cmnd == NULL) continue; - devip = (struct sdebug_dev_info *) - sqcp->a_cmnd->device->hostdata; - if (devip) - atomic_dec(&devip->num_in_q); sqcp->a_cmnd = NULL; sd_dp = sqcp->sd_dp; if (sd_dp) { @@ -5565,9 +5548,8 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, int delta_jiff, int ndelay) { bool new_sd_dp; - bool inject = false; bool polled = scsi_cmd_to_rq(cmnd)->cmd_flags & REQ_POLLED; - int k, num_in_q, qdepth; + int k; unsigned long iflags; u64 ns_from_boot = 0; struct sdebug_queue *sqp; @@ -5591,16 +5573,21 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, spin_unlock_irqrestore(&sqp->qc_lock, iflags); return SCSI_MLQUEUE_HOST_BUSY; } - num_in_q = atomic_read(&devip->num_in_q); - qdepth = cmnd->device->queue_depth; + if (unlikely(sdebug_every_nth && (SDEBUG_OPT_RARE_TSF & sdebug_opts) && (scsi_result == 0))) { + int num_in_q = scsi_device_busy(sdp); + int qdepth = cmnd->device->queue_depth; + if ((num_in_q == (qdepth - 1)) && (atomic_inc_return(&sdebug_a_tsf) >= abs(sdebug_every_nth))) { atomic_set(&sdebug_a_tsf, 0); - inject = true; scsi_result = device_qfull_result; + + if (unlikely(SDEBUG_OPT_Q_NOISE & sdebug_opts)) + sdev_printk(KERN_INFO, sdp, "%s: num_in_q=%d +1, status: TASK SET FULL\n", + __func__, num_in_q); } } @@ -5616,7 +5603,6 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, goto respond_in_thread; } set_bit(k, sqp->in_use_bm); - atomic_inc(&devip->num_in_q); sqcp = &sqp->qc_arr[k]; sqcp->a_cmnd = cmnd; cmnd->host_scribble = (unsigned char *)sqcp; @@ -5626,7 +5612,6 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, if (!sd_dp) { sd_dp = kzalloc(sizeof(*sd_dp), GFP_ATOMIC); if (!sd_dp) { - atomic_dec(&devip->num_in_q); clear_bit(k, sqp->in_use_bm); return SCSI_MLQUEUE_HOST_BUSY; } @@ -5686,7 +5671,6 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, if (kt <= d) { /* elapsed duration >= kt */ spin_lock_irqsave(&sqp->qc_lock, iflags); sqcp->a_cmnd = NULL; - atomic_dec(&devip->num_in_q); clear_bit(k, sqp->in_use_bm); spin_unlock_irqrestore(&sqp->qc_lock, iflags); if (new_sd_dp) @@ -5762,9 +5746,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, sd_dp->aborted = false; } } - if (unlikely((SDEBUG_OPT_Q_NOISE & sdebug_opts) && scsi_result == device_qfull_result)) - sdev_printk(KERN_INFO, sdp, "%s: num_in_q=%d +1, %s%s\n", __func__, - num_in_q, (inject ? " " : ""), "status: TASK SET FULL"); + return 0; respond_in_thread: /* call back to mid-layer using invocation thread */ @@ -7369,17 +7351,12 @@ static void sdebug_do_remove_host(bool the_end) static int sdebug_change_qdepth(struct scsi_device *sdev, int qdepth) { - int num_in_q = 0; - struct sdebug_dev_info *devip; + struct sdebug_dev_info *devip = sdev->hostdata; - block_unblock_all_queues(true); - devip = (struct sdebug_dev_info *)sdev->hostdata; - if (NULL == devip) { - block_unblock_all_queues(false); + if (!devip) return -ENODEV; - } - num_in_q = atomic_read(&devip->num_in_q); + block_unblock_all_queues(true); if (qdepth > SDEBUG_CANQUEUE) { qdepth = SDEBUG_CANQUEUE; pr_warn("%s: requested qdepth [%d] exceeds canqueue [%d], trim\n", __func__, @@ -7390,10 +7367,8 @@ static int sdebug_change_qdepth(struct scsi_device *sdev, int qdepth) if (qdepth != sdev->queue_depth) scsi_change_queue_depth(sdev, qdepth); - if (SDEBUG_OPT_Q_NOISE & sdebug_opts) { - sdev_printk(KERN_INFO, sdev, "%s: qdepth=%d, num_in_q=%d\n", - __func__, qdepth, num_in_q); - } + if (SDEBUG_OPT_Q_NOISE & sdebug_opts) + sdev_printk(KERN_INFO, sdev, "%s: qdepth=%d\n", __func__, qdepth); block_unblock_all_queues(false); return sdev->queue_depth; } @@ -7495,7 +7470,6 @@ static int sdebug_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num) struct sdebug_queue *sqp; struct sdebug_queued_cmd *sqcp; struct scsi_cmnd *scp; - struct sdebug_dev_info *devip; struct sdebug_defer *sd_dp; sqp = sdebug_q_arr + queue_num; @@ -7533,11 +7507,6 @@ static int sdebug_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num) } else /* ignoring non REQ_POLLED requests */ continue; - devip = (struct sdebug_dev_info *)scp->device->hostdata; - if (likely(devip)) - atomic_dec(&devip->num_in_q); - else - pr_err("devip=NULL from %s\n", __func__); if (unlikely(atomic_read(&retired_max_queue) > 0)) retiring = true; From patchwork Mon Mar 13 09:31:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662945 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 7F934C6FD19 for ; Mon, 13 Mar 2023 09:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231262AbjCMJed (ORCPT ); Mon, 13 Mar 2023 05:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231312AbjCMJdj (ORCPT ); Mon, 13 Mar 2023 05:33:39 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7B1722DC8; Mon, 13 Mar 2023 02:32:28 -0700 (PDT) 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 32CNEtuP011324; Mon, 13 Mar 2023 09:32: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-2022-7-12; bh=71CBl6OUE/KdEwxSdcAvNYP0lkXTQJ/ovxP3w8FCjgg=; b=OpxEZAsJ44aUhiFLr6rsZGXgPpxkbJ2oWeONAh+d05Xt7I+mfvd1ATV0to/IKIPe5jla SmJxIgnRjHR1xhNYa//qprgDG+7yd6ZIR5ts2tkGgQgHGN1DxkozgeFryk8U95olylpK qiyQ2PSCOAK30JStZDpiG0RshSIRPMvLsDYecCuj2SwkoopUAbtpMKx5RHKZBeE1FCh1 YihLU57rwHerw7vTKZZwzeBObRE1vvzhJxLiKz4S7M24hfL4vb3g1MWrOvYoWJbcWlWW RhyJ21+jF9EHPyQO1yVRA+30xEEfjDcWvVH0bq15xrTA5/vCJWG3lEJmOlvW9xZdXu9E bQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8ge2uc4m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:32:12 +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 32D7PpAp007433; Mon, 13 Mar 2023 09:32:11 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g3b5g2h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 09:32:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d7xRbXvEqLeJuIR7peVSklzAWA+8B6vU1vAVJU0YH+qUyfWmsu1pQMv96I3TPpF3EXKbtrRuXk1eM2RJ6juSo1DFDo30dWWWlB/Li9GJ2ikP5JeDJ71T5Vva2hUPrIWAtdYbcWqFoqkWIyVbQiNtaNls/zfl8Ayp7/zJXfFB608nxAJGMdybiXMz01KZFarpAEwBbPN+16EFnKJ9sXzcfJn4G/yjCLvo4q6WT+a0ttvpo7Ux06uv+21928kKIkszvJ7Q5IMb1Tlv1uLhwK5x4TMsb3RTPnDcc/WlqcisB8xcGZuW/F2u8xEOlwdXooiEUkpRbKO84exm503XwRk0SQ== 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=71CBl6OUE/KdEwxSdcAvNYP0lkXTQJ/ovxP3w8FCjgg=; b=U8OQIcM/QiPlp1pT8Jjlegf2grbMxMXJR3uP3VXQa4ciw9BezpoNWcT+avSbRQOp5dbp+3L0ietMhARmBc/MMV6SDmrhUcbT5rJHqsIjUvB7wRskarwAYFDQ6MhI9fCzYVVv7WdqGLDWfnXmgPbvBV/dS7zmpEOcRK5LzejfARNLrI8UqkyefTRjsUjDa599p5zUO+3szLjnflSbaXjcOhBHSMxk1OX1wpbvzAaNfWPBVE0Qm7/rDc9mAfQkDK3Gj6RS5Rhk5nmyizmBSgAiFQa3AhvOkLHK/UTimF9RD6viz6DhNHeVYu4wh0cz3ckpQTmX3Ns5abJCJCHjhuEflw== 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=71CBl6OUE/KdEwxSdcAvNYP0lkXTQJ/ovxP3w8FCjgg=; b=SXx8qe4/yfN8sdFQbc1NcQCT0gmHueSq9PD4lyY1Tdh9ISHm8pDgO3aXjccPZd94/girC0cLPc66YLxuCtTJvxXAlx73rwVc/NIFIeGSaE4VyjQCEqMOtrhNQkMMaInJljnmx5zTn0lRH2l9AvYlCGNqPLn2h3B08Ow4gGXkkQ8= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SN7PR10MB7048.namprd10.prod.outlook.com (2603:10b6:806:347::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 09:32:09 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::7276:bc4c:17a0:7267%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 09:32:08 +0000 From: John Garry To: jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, bvanassche@acm.org, linux-kernel@vger.kernel.org, dgilbert@interlog.com, John Garry Subject: [PATCH RESEND v2 11/11] scsi: scsi_debug: Add poll mode deferred completions to statistics Date: Mon, 13 Mar 2023 09:31:14 +0000 Message-Id: <20230313093114.1498305-12-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313093114.1498305-1-john.g.garry@oracle.com> References: <20230313093114.1498305-1-john.g.garry@oracle.com> X-ClientProxiedBy: LO2P123CA0075.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:138::8) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SN7PR10MB7048:EE_ X-MS-Office365-Filtering-Correlation-Id: bbfd535b-a787-47cf-a741-08db23a5d0f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6aQInVxRCWB8zWfEhDinIDJoba7c6SGTYQiGRhaPKlRYHHr8UXB/l7PtmJNyVbi2G/W4PGQ4cYbSZPlkJeuIKcUXv7f1v7WvI4VFswG0wlBETGppvOy7xbhyn4WKMIZ7QSoqltqlDa5ETlei/eJED8eS4rUjUg1OOMkSFTzBqeFTjEWVkqrCpaoowXhTa6Mc7hwYiLuFumE+dEEYIqPAM+k+JwYUgdnhnM6/d2wKyNpb4Gne5JsBEyRj3fFJlV3rJvhvS5B9Rkm6wyuIazD5eOsIIqiseecWiT1Oji9pqRCcYw2s3rwzh8BQw4U0O7P56YsQ8pdupljMA/fHViVlAajZO6rN8pmVQjCHdyTIxDaY8NUHFqNhfoVa91wYSZLlX8Rc0X4eLjQjdKRvcFQxlWZW+iGoIsDCXByvNJZehTl1f3SAR4SOoMlKyw2ajyj3nUb1PfVaqXPi0Wl3zmcBz9zKsaaeZrGOVl8202sDz012+qRXEFIRdbZwJHExOIa2ppf54PlOpZE6b3unvVm4K/9d5dUhqh0preezmLjprQ8aoLlNe6vXfHJ4Lah2aRbLVZhB2ZGJk5A6wF04M9R3E9zZWbdZ98JaVR3TLYW7iku4paj3q/5mTXHSJiQ7oauvTrHL9PybEqpo9qEkciuFuQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR10MB4313.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(346002)(396003)(136003)(376002)(366004)(451199018)(2616005)(186003)(6506007)(26005)(1076003)(6512007)(103116003)(6486002)(478600001)(83380400001)(6636002)(316002)(2906002)(41300700001)(8676002)(66476007)(66556008)(86362001)(4326008)(66946007)(8936002)(6666004)(107886003)(36756003)(5660300002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8wDt/idR29r3P5Fi9/CunsAbuKcxJnpZprLIrpfNlFebSDqdsYL9VevkiXX7J8eXZ6CYz80WkNTSNjSPN+xuJh/5Rr7w4YlP31quJALo4omPf6QxYfR9LmQ8ggY5oiIWpaX1/WQUZfUrR+Z3gAl1dI2mCuQeMlPVgICj0kPuveS/DnUgtZdiyvYJv/Ch4f8qKKmhWMFmbgLws0IR/9h3KHFpPaxwaY3ko9gz6NCnb7RtWgpizkISPuFS+W36TZwqkuOmcUaBrnP33UXwRzdLvqrYZPBqFMXqXsGz3pJ4BHfgEglB8Qc7L8cU6qdiJziHgESWe2JNOT/0XMjQtz6Zyo4Amu4tgo5pg/1y6zywG/3Vb/6FuVDvtvEHw1FeknFYSZg4bJlzUOklJ3PGmsRug2J9dWgVY/iexX9bhBuHZ9aaW4yb5fhvzfihSLdFa/YTrDnybeHe8c6qfUBDrCD4DIR17kQa/l3e2f3QtYP3KV+rLBviSTYrlP6YnF2swmSh4Dj2OoR/z3riOUdPiUIkQujYyyfdy0pmZ2PVgg80kGGh81BjpcxJT8J3bjaGuUticsCO/xfGEmqaYP5cwzQF/KiAEsuBid4w4nmIhJn3rnDPWAWesjrQUrDkd1+nNT6Xa1c+3D+WHKMp2OhPdRzudBANi/j/cv1g3TVqxFfQ2GcDhDTt3tI6K2AP6v/6M43reem5pWYKpE94xTqSglMl8IPByBCBHiuP7Hc5XvncwwRrbL2AUswCWXc+5BTDRxkAfnJTHOFdxFMvfHGvT8bKn4DcPjtgoYSHkd5ADVEFFWmFGW69fGPzFMmobG5Bf3m1WSWp/HZxweH67oYr8I5pZD8CwIgl/pInOjsh0d6+IS01wqRa5bgZmrmZNDnaUVqTjBBKj9vwz1B8I2Klrqi12cFLg2YZEL6a6DgEoyTTqN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yi9UU2kwbubgmiKskKi+AlgWk3Vsi2Bl8NmSms1aVmQMhOITEXj+tJsgpFjgbjEhlYvrwpJbtKi0tjwzLF5UOdALt4oIaEEC3HfoGcCNwRdrmiYKbNWGlG/G2xTrT8iEc/ij/rMBCmplanKPmMx84TfEHe5aXYQt+XQCUsLDaS9tm/lZCSLJq0MVijMJPcAqLn8JjrgJG4V6aPt/dHkoXcARHfJTaO0J+Lnh0jo0ac8S09kEwVOk+I3ppnvu2BVxVkndFF58ETBu8Bj/QGM6hiu4YugnmJW2twSi7zSrNKAkyPUJ2rVOVDYG2bUkIwD7uOXqJb8SQHKR+p/CG/NxE7Vt8yNWnX7c/fLyArSKFdyg7YehFYIVChDonwywZ1rk32ZCBIuUMH2HlFMWOdryanUNZoywDP2aO1050iwexeOdsrwAG/QJQ+3ahcYSW/7oFhJbrip1BhlEH6DcvIdAvqTMYDHKz/ZZhG6jrk5dxU0idxCfXfsYp8tSGt3Vkn2zV99EstLehTdQ+vlYr0YpVBD9EmHnlobthnB81ZutoUXr9M= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbfd535b-a787-47cf-a741-08db23a5d0f3 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 09:32:08.6199 (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: 6EKN1ity3l7qjeSQ2cI0UgXwygxYDX3vULtBPxK93ocfoK0qTxmBiQAcF4K+UKpIuwx6Sryt+4AvrX3bb/N5Sw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB7048 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-13_02,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130077 X-Proofpoint-GUID: vAwTx6WtlGugOwCUGLogDmpfMiZSuRRF X-Proofpoint-ORIG-GUID: vAwTx6WtlGugOwCUGLogDmpfMiZSuRRF Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Currently commands completed via poll mode are not included in the statistics gathering for deferred completions and missed CPUs. Poll mode completions should be treated the same as other deferred completion types, so add poll mode completions to the statistics. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 1463e54179bf..073fc02f9fed 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -7531,6 +7531,13 @@ static int sdebug_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num) } WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_NONE); spin_unlock_irqrestore(&sqp->qc_lock, iflags); + + if (sdebug_statistics) { + atomic_inc(&sdebug_completions); + if (raw_smp_processor_id() != sd_dp->issuing_cpu) + atomic_inc(&sdebug_miss_cpus); + } + scsi_done(scp); /* callback to mid level */ num_entries++; spin_lock_irqsave(&sqp->qc_lock, iflags);