From patchwork Mon Mar 13 08:44:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662956 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 12C06C61DA4 for ; Mon, 13 Mar 2023 08:45:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230129AbjCMIpd (ORCPT ); Mon, 13 Mar 2023 04:45:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230047AbjCMIp3 (ORCPT ); Mon, 13 Mar 2023 04:45:29 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 480D222798; Mon, 13 Mar 2023 01:45:27 -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 32D0Ighh020044; Mon, 13 Mar 2023 08:45:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=RpfwjlR5NSIsbG1LgT3/6b8EwaISwikIKxQsBbflVmc=; b=nuRF5nZUQ05zR3tyMP3qTZHnNZkUJBdR7ndxrdr8Tw1uEPncn7+WgErkCIW8+WDg9wYa Fir9wUZjuS5LPZSIfJgA63xVPRCMCsw+2h9F7t24x1J5XRjJgQuINUio1mALO6o4b8G/ MgWYFClW/SPHadySxZpHpITAEQ/WtGQBCqDXrQLhyGzkuY6pXPTcI11oLnXxy65Xpbp3 e9Tg1ueSqWoounXRSJ9VJQtqCwVytDawrMqL4uaiTdvM05q1Vw+K/8uFtRCYpciTFtMv ms14UoMUmdIKTqcdQnQmZRUZQjbPlMaIplDjn8IfN09iTwASCW3W0fqCTQaFSDW3CnRS Fg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8ge2u99p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:24 +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 32D6q9Lg008306; Mon, 13 Mar 2023 08:45:23 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g34b4d9-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lMhF3GzFuIWy2xy9aoiVhZanI9vtvMhrkdTEKI+F1qRHgVXN1K/5tkwNwJBWcFyp496rJtyj6xuVWP2TL3WHqyrbWT6mPSf/BlrqbsQg6MIT73kCFtLEjjmOxNINqXJlTyYKdaDzOCqFxPxNXF5ZROiY87F2tpUx0BMFn0j1cW8ez0ICfOlkdST8OoSz8wURnOGQd9M61uu2pp6cWvb2Y714GpVBMam0y21Ysz3pgrB7pAkMs0KEK6q083K8+xfd01vAyRv4HOatwUxwrnOAve8XLjDxZssZEbCTTpgUl5eMM0AEA+QnCMTastBE5khJnMGYOUP3W4kxS1cjvtX62A== 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=RpfwjlR5NSIsbG1LgT3/6b8EwaISwikIKxQsBbflVmc=; b=J8i5nXSVfDiA9Zr+7+2hEegBX8tNskL4ocKYtdQHzBa45Mbx2MN/ImQPUVeXuEpODcI2CiXff2ijUTFXpLXtIW9tgSSkJPO66h+kAeUILemPHwx26vyBW7G/f3tKuz8Q32hX2P80H4RL+/X0ummDjerYl9wy+iMuRIyg7CqGpXXmVXfLaIlaC16qNZMQh9/UNtKtER+hgUD1DmdOKdVyM4Uu7IZ1PhOpmCW1D2k/+PxRpLLLLHp3jSxu4vp7ioxejXGnQ3tzmrG9EH0EG1USlYLt9vuCv5jrj+DOVBKNYKICeAh2qCkKp0hWwl9nblQtg99rn9aQz43KnSMls4M5LQ== 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=RpfwjlR5NSIsbG1LgT3/6b8EwaISwikIKxQsBbflVmc=; b=k8FfmTs5u3Jwd62kW0fTf1AviBGLNBvIV29Xa9kq40wa+lv+cIn9md2Uq5TSXfXQPkceXfUdLf5dj8mFooSGqyr18zI87q4sT32+LuYXEeYQ7VenwZjXR23P7zgofaqbft0oiYC27ySdHy9KhC1jhhT4IcSEQ4F7Wl49eOJGuv4= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SJ0PR10MB4703.namprd10.prod.outlook.com (2603:10b6:a03:2d3::17) 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 08:45:21 +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 08:45:21 +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 v2 01/11] scsi: scsi_debug: Don't hold driver host struct pointer in host->hostdata[] Date: Mon, 13 Mar 2023 08:44:56 +0000 Message-Id: <20230313084505.1487337-2-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313084505.1487337-1-john.g.garry@oracle.com> References: <20230313084505.1487337-1-john.g.garry@oracle.com> X-ClientProxiedBy: BL0PR02CA0060.namprd02.prod.outlook.com (2603:10b6:207:3d::37) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SJ0PR10MB4703:EE_ X-MS-Office365-Filtering-Correlation-Id: 1078707f-7070-46d8-b06e-08db239f4774 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5tx02ZKeb0GPo39Nez8mJLyAy+hSbCB+ivU422hHaufcinkz5e2WWgbomUT8nrK2/kccph0s7/46WrWf5fZKF+CR7wOHODP9dhZBuQT8vcTbwEaEDsXHVtmQPjRa2LIq0nlZBVz9O9vsZVflipMrVkEcNnuJ3pzbLrqtqxR0gJSnN+vTMucFuCFlkKHvk7oXt3FYAz8OgZpPIAVbIuhVeudF3enDrgWosZ3ZNeULx1AeLT8ZGSrER2jOQ+6QI5kt2RejwzPQpr1Y6+oUB9YQxEu7eNeRGLkLjs8MMsa4a4er9xrRWnYVIP+zIgmoZXYbIDTQZRVTzOmPLY+EPB34qm0JD19dUZ5mCxVAprbgx+S+jEBOqTQTDsKi/t6HRNnHxLFfRXM0MNXQYPqOUl+wSds/5UrZtuHfgehb0lnqjqTs4Og6+r/RdxQkQ+f5vwZrFNN5CCqSC4E59csRmmzHjprrjla7KG1GIYZtfTmwvD0hKdL9dCWbOjfjM8SPwrcGrCqGfclFgoi8qxBv5G4ZZeRJibbYf7ehO4wB1Gy/E+Xzj2oJyU5tkBgqWqf2BwzRydZZqTRivBFBEyL++meRXhN4RUgsdf7KjPZb2WYOjG3Nli3WnwYT6esDRcKd3an+kefHdSC9mFqFXNs8ICnaUw== 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)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199018)(2906002)(83380400001)(36756003)(5660300002)(66946007)(66556008)(41300700001)(8936002)(4326008)(103116003)(8676002)(66476007)(38100700002)(6636002)(86362001)(316002)(478600001)(186003)(2616005)(6486002)(26005)(107886003)(6666004)(6506007)(1076003)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0iT/Qh5MP2OH4i7wA9hb5cNK4KABdvGN1w7Yvt/ggJOgFYbV9SFwYj6sokPsCSmp5mOSYcsz6anvnJU+To+aaAgUsWnIQJgyWf955D8t3mJNnzaoetD2bvWVKG/EEuOq2STnTDveXGehHKmw3ZMyANjFpUa24rUdZG+I9W6qyBvoBWaokpWnolAZ3dBVjp18SYWfnk529DgZfOEcyh+4sOktSvb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4bQGT01v7lURuTfobOkfSnORxLKWjbUsrhylaO9o4mSWdNhuxbUwQp0UAX7/zDmvqYrYyt3ifqvX02nPqLNi+5ac9qPQL/fd5LFLU2EhOjr8LTpH/liaWiWHjpOb/ZIijl2OKsENFAI5q7jurc5xEPHVGASk4il59OpVZt+Ftpy22mLpDiHj+kGAcD+w7No104wSQMOOQHRhaNk12fG3+c7ioOnqa/kyCErgNJPFbBBrp/RnO10Kfjeb+jJzf6hOMj87CDKdEPeN/5SBKe/Xqf1TTHi21qNOrBphUDlZKkNjnf94tPIBv6bsk+fQLwZo9VgAO1m1oqcKmC3FZ2A== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: gI01dK+0s2LGgWw9pmbgZGX0PLYQXUnSCNTGFttgYVTd1vbfOByXwbXwxQsLZyPuYIGwzh0H5DGyH1VrAkMrLqvV/8ESdd1YBtXRnhD+o/aiCfPUBzpcHp20z3MOeELLhE0s5YJNnnaG94fYvPoVas9S44AKx6hz8NyGidHXUp7iQSHuvEi44jB545GRtUhU6DDcMRwQzTSaAOOsjOCHoBteI25IzjWj/OdVVcD7GsqXE24I4W4cLLOhC4f8BVFfKHfCiNAoJC7oND8H9NkWkYlSFxohK+EVq/33dTXBju9tODsGmJi+33f0QMHY0odPy1RliHyyHXA4rLsxWZuXdznZXPw1gVPfWWv2eVPsIeccE8YHOnWTc5FkbEpsZemJDgmki11JHjd6+Yb73QzkZK4AqRKC+vIORwzGlitj8VqfsrtmsvCEXw/4E40kWFllvvPHu8SEQkeU06tWQraltudwrxwWeLKvsLl8MGN32GM3j7sFLRvel5Xa8uqQ4nAD0SefeNsyFIVAbXdJrZCb6AqOOk49f9XPgaiW7dMkk0ZORK759hziuYA+D7EhCMrtKPUpgB+9fO6XXrrdG71U5+wgseCllLC9Ob1OiIulW775hy59Y+896Z7N5z42Dz/4jpPcdEl1o/yGXFcVg1K2tijSJl7yUIH9nSmKC7ue8hA3sD/7bx5YemTDNaJtdH/4pY68O01CY3prTwqcXp3fQTa0jJc71/ZSEprgmRnbsr1cXzYlzKJvwlMpWN5vWn30tM5N2gKc64DDJZFFOq/undks9IbPiuS56O9HJgPSJtV3yxxNkVvUYaWm/nnvvXWukqbz2S64FjOJUyqiqo2B149uq2KKK5hr0hms04zJfXA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1078707f-7070-46d8-b06e-08db239f4774 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:45:21.0064 (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: A0VAIiaRZsqPtE0qsH3izsGfjM9RvMMHs3lnrQFaZRD3FdRr27nBab1oPWSDaZpQNbpqrLB9xP4Y3F5ppw1Hzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4703 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_01,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130070 X-Proofpoint-GUID: ycAC7iXlbxVkNKE7CkMKYkcldaedcqI- X-Proofpoint-ORIG-GUID: ycAC7iXlbxVkNKE7CkMKYkcldaedcqI- Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This driver stores just a pointer to the driver host structure in host->hostdata[]. Most other drivers actually have the driver host structure allocated in host->hostdata[], but this driver is different as we allocate that memory separately before allocating the shost memory. However there is no need to allocate this memory only in host->hostdata[] when we can already look up the driver host structure from shost->dma_dev, so add a macro for this - shost_to_sdebug_host(). Rename to_sdebug_host() -> dev_to_sdebug_host() to avoid ambiguity. Also remove a check for !sdbg_host in find_build_dev_info(), as this cannot be true. Other similar checks will be later removed. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 72149eeee6e6..554c03d7a648 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -324,9 +324,12 @@ struct sdeb_store_info { void *map_storep; /* provisioning map */ }; -#define to_sdebug_host(d) \ +#define dev_to_sdebug_host(d) \ container_of(d, struct sdebug_host_info, dev) +#define shost_to_sdebug_host(shost) \ + dev_to_sdebug_host(shost->dma_dev) + enum sdeb_defer_type {SDEB_DEFER_NONE = 0, SDEB_DEFER_HRT = 1, SDEB_DEFER_WQ = 2, SDEB_DEFER_POLL = 3}; @@ -5166,11 +5169,7 @@ static struct sdebug_dev_info *find_build_dev_info(struct scsi_device *sdev) struct sdebug_dev_info *open_devip = NULL; struct sdebug_dev_info *devip; - sdbg_host = *(struct sdebug_host_info **)shost_priv(sdev->host); - if (!sdbg_host) { - pr_err("Host info NULL\n"); - return NULL; - } + sdbg_host = shost_to_sdebug_host(sdev->host); list_for_each_entry(devip, &sdbg_host->dev_info_list, dev_list) { if ((devip->used) && (devip->channel == sdev->channel) && @@ -5407,7 +5406,7 @@ static int scsi_debug_target_reset(struct scsi_cmnd *SCpnt) hp = sdp->host; if (!hp) goto lie; - sdbg_host = *(struct sdebug_host_info **)shost_priv(hp); + sdbg_host = shost_to_sdebug_host(hp); if (sdbg_host) { list_for_each_entry(devip, &sdbg_host->dev_info_list, @@ -5440,7 +5439,7 @@ static int scsi_debug_bus_reset(struct scsi_cmnd *SCpnt) sdev_printk(KERN_INFO, sdp, "%s\n", __func__); hp = sdp->host; if (hp) { - sdbg_host = *(struct sdebug_host_info **)shost_priv(hp); + sdbg_host = shost_to_sdebug_host(hp); if (sdbg_host) { list_for_each_entry(devip, &sdbg_host->dev_info_list, @@ -7165,7 +7164,7 @@ static void sdebug_release_adapter(struct device *dev) { struct sdebug_host_info *sdbg_host; - sdbg_host = to_sdebug_host(dev); + sdbg_host = dev_to_sdebug_host(dev); kfree(sdbg_host); } @@ -7812,14 +7811,14 @@ static int sdebug_driver_probe(struct device *dev) struct Scsi_Host *hpnt; int hprot; - sdbg_host = to_sdebug_host(dev); + sdbg_host = dev_to_sdebug_host(dev); sdebug_driver_template.can_queue = sdebug_max_queue; sdebug_driver_template.cmd_per_lun = sdebug_max_queue; if (!sdebug_clustering) sdebug_driver_template.dma_boundary = PAGE_SIZE - 1; - hpnt = scsi_host_alloc(&sdebug_driver_template, sizeof(sdbg_host)); + hpnt = scsi_host_alloc(&sdebug_driver_template, 0); if (NULL == hpnt) { pr_err("scsi_host_alloc failed\n"); error = -ENODEV; @@ -7862,7 +7861,6 @@ static int sdebug_driver_probe(struct device *dev) hpnt->nr_maps = 3; sdbg_host->shost = hpnt; - *((struct sdebug_host_info **)hpnt->hostdata) = sdbg_host; if ((hpnt->this_id >= 0) && (sdebug_num_tgts > hpnt->this_id)) hpnt->max_id = sdebug_num_tgts + 1; else @@ -7936,7 +7934,7 @@ static void sdebug_driver_remove(struct device *dev) struct sdebug_host_info *sdbg_host; struct sdebug_dev_info *sdbg_devinfo, *tmp; - sdbg_host = to_sdebug_host(dev); + sdbg_host = dev_to_sdebug_host(dev); scsi_remove_host(sdbg_host->shost); From patchwork Mon Mar 13 08:44:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662954 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 63D98C61DA4 for ; Mon, 13 Mar 2023 08:45:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbjCMIpt (ORCPT ); Mon, 13 Mar 2023 04:45:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbjCMIph (ORCPT ); Mon, 13 Mar 2023 04:45:37 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4000927D72; Mon, 13 Mar 2023 01:45:36 -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 32CN2mh6027099; Mon, 13 Mar 2023 08:45: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=Ls6Eo1X9j6h+D+hYtYNKhPBOnQyjqpjONeX+CFfSem4=; b=D6rWCbfGb/EHwGBt9kW9QrNP8Ecw/rCtFGlSIS8qV/ItBqe+BQfUfr2GUAld1vzUrVYQ atN8m2QlYNlBdoiy++lhaL5ZxhuR83v+73dKltxmbIaNO8wMii+k7BbE6+r/48IAdZXY Vba5T+itYwE66qUDSMYJkUs2sKZYJFrG6WQNxMZkz5V7uxLosl5uXGbz+Nytj4fMRJw6 QeHeeEkD0Vaptl04rupewePed0S52bq3ZIloPvfQSBnsJVubJzT7NTzCcZ1rc4U9un0Y fzpAbqAI1eMtNtGKo/XlnfHo4lN40h8gbuKUGY8zCfNG8dovhAkBz4ZmGdqjYIDHr5+r LA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8j6u3833-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:32 +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 32D7NBK0024989; Mon, 13 Mar 2023 08:45:32 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g34bjuf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VhQKI+7N2KG+JrtsGnoTTRQdOkAM4DVUOpGPtCCCnMw+sngyKAVbFx9SjcCGxkDWVMJXSNfNx3p4sQtGmQCz747qJUDKCGlg++uy8hI9JbhE2fHKLWqlWHXlHDo3vqPnAWdu4AwbKq1MQZFtjs9tw9CLpWxFAW0+4N/PKk806Nzw1ItbbhGBzC/qxVAYy8uplLlJqh41UjUdrLT87FIey0lQVKvAgmeGWKKijuZQDoT/uecNS8uEth47NXYNRvjzGd6KmXZIq+X5jGS/TeBcfhEBw+IJqVUqpjdS7aXXf6/Z7nJHBwEB7Bq/eG84qZLF6DfW/EElYyUN+apHJ9ewBw== 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=JiauRJusdu7F2u9dU7S1U6+HSN9/0WtPeKwyo1XAeBmxuhAGPsJpNHzT0CtR7lLht6TqHK1ciB/wBsN77cOCFfFSa7GZ9XnK8j7J98f0Tv9z2apsc+4vIfSmUtCXEexuKWtgDotQMBsiTt3+vdLvS6lQshn+2IM2yIZocQaW+1o0cPQ6bK/rqXW5aXNw+1zziwjYvUPqrHhP5XBwa1dSFxD5ppVdzM48k06XO38eoeNy8kZf6fwFZpiFfLCiv8cxfTyMjmmQXnOkwZvKbBV3wD1ssjl3VWfFtjxpNEploggyDAGsVE6b13YfJmO3sJDUiQ4Ep2ngRH6SfAb4FpEl2Q== 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=BbNFGKoXAZNWQ4nava+Q3KEdedjzlJT/iVAwpQN+tWmgzFyDwJJPIFfeXg9A+S384EMcG/F6JBQL9L1xE8NXw7hfIiW4EshrQRx8X3me5RTE7eASbLlUw/FxfY26t5LB75v5coDFJ5fMg5a+2jqzwz48OkfWKbuo9lL98eljZhI= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SJ0PR10MB4703.namprd10.prod.outlook.com (2603:10b6:a03:2d3::17) 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 08:45:30 +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 08:45:30 +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 v2 03/11] scsi: scsi_debug: Drop scsi_debug_abort() NULL pointer checks Date: Mon, 13 Mar 2023 08:44:58 +0000 Message-Id: <20230313084505.1487337-4-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313084505.1487337-1-john.g.garry@oracle.com> References: <20230313084505.1487337-1-john.g.garry@oracle.com> X-ClientProxiedBy: BL0PR03CA0009.namprd03.prod.outlook.com (2603:10b6:208:2d::22) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SJ0PR10MB4703:EE_ X-MS-Office365-Filtering-Correlation-Id: d1f9de51-a273-48b5-d925-08db239f4ce0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j/SZwNHXBiRJPLubvBlpKKbL+k80os4fkU/q+iZRoOXjRLJXzcUcGh/FjPcWYcn9/g8K03lmb1c9R6fIsWSmFM0vHKapX74y+OPbORojLMUlt+tSOfhoMvx7taOLvMbJljfOl1L6Ox8u9SRLOEtMdwXgq6dBP6Cz5XWvbqn066m3cJGu6Yow3uLlG0Gzb6AF4D42L4ASC06cGfR62uL3H+jTR14XLWPCVEgoO8PGeNyHhpzLX0SxLgsD8dAfeK4ODF05QOzBty4I7F86teIozyEkvwh1RcL0o9f/v9Z9L4l37KQ7lBOLpOnsiKVEnKnW1x75V2k0Kl5lRs/ZxP/NPvWgpOUt89l1SHcIBwjfIOYlrq98SzQcx2NkGa9b7jcyoSNW9XtxOBQZ9XV9fNeNkbcB1KHZD0uDF+FvCxFQzxyOlehaS8uXGmC6iFD8FvxNh9Ldv/XW7nB9MNfcuDyVNEM+eaucB7KFhN+fnrfrt+ACRZ7dfjW8KqZGZDXkmEgcrPhT7eJvGuli3RJAgyex+MFmFdsUc6RWHSD1+DmS3f8EX6GDHCADWm401PzWPP6OIosJ97Ha4uNwnvw/QH/L7+zufWEJhKeFELbLTwVXRipIjHE2tyJjqGdh4ilHKcU3fJO3gp6pXubCu8NH29MKGw== 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)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199018)(2906002)(83380400001)(36756003)(5660300002)(66946007)(66556008)(41300700001)(8936002)(4326008)(103116003)(8676002)(66476007)(38100700002)(6636002)(86362001)(316002)(478600001)(186003)(2616005)(6486002)(26005)(107886003)(6666004)(6506007)(1076003)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6lLIezmgAuvPjzS5vFZWqBVIfq/YxhEEjg7aSwQOqC8qOzTEToOiPo+ogpc1eUsN3bR3rxwslrQSbLCBA+RXKLQHUYx/OFmmp46ojJRhTtv8OhG9qf2aIQffZVHw/Ndte4GprBC7mc2Ln+a8gHA/8woq9C+RXTdnOqnzPNWQqx262CXPNMkrvDddR4YfKZaVkJp1ZCXbGawAcklPZnU8QgMol3XXuRW2NjgweYaVnX5QrmEb3EVSz6AFb+ChTo4P0OugFvFGDtQRFhcz9jwDI4XIRF5u6LQwYpMn0FpwIqTxDN9Lk4x2ntjk72r50h2CFHS/bO6IQl3A2LybBt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VECCXWfnsJg4IGQWQVXcc5KeybKWs5KFj4KCaP4z+gB70pdWuuNfzEP3WCADg5D8ObNOgofwbjOWFn5S/otJ9EnH+pbyT+M= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1f9de51-a273-48b5-d925-08db239f4ce0 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:45:30.1039 (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: /V7RLdfG/t+Q97FN2Sh+gb7EiOjXxBapVdhV5YSsJ9FI6pgL6nfa9acY+53bZQqsiPs/JhbGVLQKZOnv4OoGEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4703 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-12_10,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-2303130070 X-Proofpoint-GUID: l0aqOz1-sYPi-MlXSGfLUOcIvDaqs4za X-Proofpoint-ORIG-GUID: l0aqOz1-sYPi-MlXSGfLUOcIvDaqs4za 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 08:44:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662955 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 DDE7CC74A4B for ; Mon, 13 Mar 2023 08:45:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbjCMIpm (ORCPT ); Mon, 13 Mar 2023 04:45:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbjCMIpj (ORCPT ); Mon, 13 Mar 2023 04:45:39 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DBE027482; Mon, 13 Mar 2023 01:45:37 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32D3TCIY005465; Mon, 13 Mar 2023 08:45: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=36dDPHXcLpMsV0S9kqXd6k2T64d3FwQN/6vyDHhEMCU=; b=hfbvr1NcqkHsRWPtpCd9+dzKUWu6GxFjZEtiv897j/C+2vAEcGisO1Flok9awSBPVOng q1uU+vfStudfF2BazB9cQj+w/bgtt+S+46I+qM0pR6WcxQr68QaLH5OuF6XvSwHjGzaM 5ehpbxot1UPfwYx0T8BWtgATHiBObDmv2eWDKCqp860ESipIPZ+1EL6uP/azyS406NiJ tHNaOlPUGq2rfyroDsT7/M3tBuK+9kgjL8lajVV7cjI8MTMZ/F+0SPL1aqBUhZB+2Unt 3qoFJWFF88yTIjE3a+CuJwsJKbzwNe4WibxQGsgfGD3LAVgVhy0o45MSqzCJYJ3+uw6W 5w== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8hpcu8vw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:33 +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 32D6Kkq2008353; Mon, 13 Mar 2023 08:45:33 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g3b40ct-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jlbJT1boRP9J095/j5evBqv+YnRfMQGZMaPfaW0eH13+YiAJ+t9NHCdefUpkmatpbLMvUUx2U9JRY5j2wfundYVG0xii/qPHln8eHyg6/WRdkbXnWV6i4KvbJvEvE7wMkyXcOf2BEvDoF7kSm9ZfWdwq1AV3zASETPRdOqN+tzq6s2KHHJN0wO5+k95vIPeZkzCRR93cOK2h4QojxS8r38dyfdabaMdF3rEAv9XH7jiNWIlpl2aDtEm6FYMc6BZlczUPku3YRiZuq59R10wKcL3i1rLyoVQaVsBqrAUEYOHRM7NBvDAftGYll6Y6/GJ5Ces86yCn3wr4qK/Smz/1DQ== 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=36dDPHXcLpMsV0S9kqXd6k2T64d3FwQN/6vyDHhEMCU=; b=kcusEdNR8pmmT4XY+NSo624517mlpLFBjfyvlaRfyWF5PB4nhsvCJfwJhiAVBmqo82xpVBtJvdujPEFAJUKBhWNs8fle00qZQ5wqT7TogYClWQuZch312arAm4jGO6RmEh+Vgc8vnS7Aveu89QTuDPikI9spZwJqATmdg8l/wTugdLgVIoMijJ51kXOyiXyTF9Hl58bCEJS35AoVxFyhhmjpGav6ofo9a3VXoJMaH4U6x4/UxwUP6i6pAbb4RRxd5zAjsH0HxNpFE2Kw/UoZm8Bj5ZND4eSbGvS5FahiHqDPhkq3TndPjzZKV7fp9/n/MupLfZ/8vYD0FVTswrNcfw== 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=36dDPHXcLpMsV0S9kqXd6k2T64d3FwQN/6vyDHhEMCU=; b=rB4t+65phqIpDWUvaFiQpYghSGmAdHiO9Tcn9IZVq56I1XUpJ7wlpEsBfJn+zqBq3e6rd/L6/VcWK2AQTk9UEdmxhWvN/vAEQQQvy24k4htsuei3oGQ7SNzUCkWK4GZDHB6FFKlhn1r68UFPfNRXk9o5j6vslkBQhDYtKi/O8PI= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SJ0PR10MB4703.namprd10.prod.outlook.com (2603:10b6:a03:2d3::17) 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 08:45: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 08:45: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 v2 04/11] scsi: scsi_debug: Drop scsi_debug_device_reset() NULL pointer checks Date: Mon, 13 Mar 2023 08:44:59 +0000 Message-Id: <20230313084505.1487337-5-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313084505.1487337-1-john.g.garry@oracle.com> References: <20230313084505.1487337-1-john.g.garry@oracle.com> X-ClientProxiedBy: BLAPR03CA0006.namprd03.prod.outlook.com (2603:10b6:208:32b::11) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SJ0PR10MB4703:EE_ X-MS-Office365-Filtering-Correlation-Id: ec1e1ca1-f5be-428b-0da8-08db239f4d9d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iCZIZ+Plyynxr8nNnEauARMgmGf+GZHPnjPt5Y0App2wmZoVWo9MebjJThbOVXbpiMpdPvylCCBMQTWDFb0ne/TfKLl2xaGT5WLU2w0g9Zr0dqAlbnLW2vZz5mhwn7jDKb79rGOYUrEc8fuyLj6r8IEqgdpa+ImAEDna8MAKpzvPgd1ESi5oayNiOYg+bA/cMcVmIiQfcN2opf0C9fGTSPtyRzX+nJPpDWizUV3ucN5h2UdFXnlS7u/cXmFc/x5CXqkoNGavjovgA6dUZ/ye+86Lvzh7wtV1vUp17Zv8YnJUKf30SXeFfARkSni2RiDHDbT4J9NruKFVrlvYGjDDcC1t6OsMMeUSsD4NbQS4TFWginmUuMuowo7FLXQQ4YHDDe3alsISyWjyJN+xMtk/1vriZ7Qm3kugKkkETrzWx6FBUOdCqjND5V5rilCu4bh7MY75o4ZVX8tIqdVUicriJXXOiFrukGxgO2b/KmVhyE6Q1+Q6v304CJ8uTNzdbt5XR3qTcRQaXgqs76SU4zAC9f/0Du1iXCLRAzqxLsywQ0kBVMNwKjzUtk34HF17Eq8fgmI5HNfKXAW3KfSbVLex9gkS7RK88BJ4T+tQTxNyMJR/Soo2huN0Eh5TCUpjfeYJAot4zkP7oHhgVu4sU95P3Q== 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)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199018)(2906002)(83380400001)(36756003)(5660300002)(66946007)(66556008)(41300700001)(8936002)(4326008)(103116003)(8676002)(66476007)(38100700002)(6636002)(86362001)(316002)(478600001)(186003)(2616005)(6486002)(26005)(107886003)(6666004)(6506007)(1076003)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /dtY9QIMpc4KLNRsEymw80tCLRpH4a1DXvqtfzJ2wJgToRTu/cgfiDsBlPok2RqAmngc1cbbuJpcHx0YbnAyve2RZBfth4skADicpFLpvmx/ynBqS0eVbRs+A0pGTFG2QXpppgA6mFpg8llHM2JgGZvVzZZw6ZSHkhc7jSkPbPhAfQ8iHHwHuHXOy2mrY8J0INtNItom3J7yGVSQyY8+D6It2+cAILQKf9E7pXUxpEy19rruXYrBVs3kHdw+Nfvucft5/rRsWZgipVJbhhdJ6aR5ogd/PmiMr2d6hBpLmAJ0YxwtGr5mGDvP9X6Bnsc5EVUJ1+Clh72fZpTOScyMX+BFoh8J7PgLIwJ0WNVUVC8fu4a2VTmf9WDUTuDctuYNN+T1HoFwJvUEqMXbZYIN21sbKMBfZ4r1x7gkhKjS2z6rGIkIhV8KcHHuXMAW+6I/KSa6CCeqKkxjZJUdQgjx3kIhVbfIXqFJFLV4WKimw+f102QM8SAWIpL6pILSKWjYlyq9eBACeRXQctjC0SvgyZKfRdK1CslLT0KoDcIhE+BhtIg0mp8Q52HYrQpFjE7oqa5cuD2IFvnjz/izb7gZ5HIFrhULaCo8Om/AoBYgC7/bI+xVLuyOrpQoVmYnnjG5RmWgnOn/uEUuxugp+05ICo+0gOL/fH8/c6tKZGqTyI5saQ6U08wyeKv5PeH5W0wF29qnZrw9wjO+FEl2pifS7q+AUsEJsxSvgtHferGOTZhU8iX7LW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X+seG0VcCD0BUgsiqI2trriHakVmgQqqub7ER6Rg32nJanPx5UrPFEORgftXUUeVOTv2Qcd6U+wg3mCfAStbqZEtH4ujhDtBTlkpes+c9FHfJnzK+26bJ90DQEHy/cpad89Of86KOpTBvrQJnWYsETd4+19EdzQpI/buPqTk6Kmr9jqmAY/DXM/7dWUmXOdUZS+7+/z0qGfr/T15DryMIopS3Evka5tIraNacGZBWGGbRCjMa2wM9ik/avEd0Af6R+CgBXCaVZYhJ/ivSotC9yllx0SOxUGdCy6YgX9j2RXNeFiuIK/0dkJAvAsKXYswidK7xZeF6oRMNXUESGcdXXgEkETu2kWQKnhdCLQugmDEKyfDmW8Bw+arW6Ec7sVzKrxJPbngR6k8b52yALwCFvQL14781K7p6ohNfIzFhuT2N5fLQGk6SNlzA5ERRjzmYZ0o+IaCsXJecIt3KVBYTQGZSsdnFCa+5f2kYD3k1uih2o46zsfYx2QkH3QEOnm19uHr9Dpzm/olI3sulFm+5OfhgMhwEVugg+wkjqS8g8Q/qw0dORSoGQqMeg6K+ni+wD4PadiPseWbHlpYYrwmNEOJd+9OkQIEdyIrCgYPdkiX83n/DhozBCIaUZUV4g7tAG/F+MyH+tpbwuydSyc2MPSxMU7xfLAb8Gfftld4eacBSKBsbfZl0GkMBa9KGi8lpMTF9xcAiWRpGTVgkX/5jDh67RaoP/w= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec1e1ca1-f5be-428b-0da8-08db239f4d9d X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:45:31.3373 (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: 60lB09Y5lrJW3i+ma59tWaqq8YeiLF88nf1kxv1aWRG2yO26vskq5v8UYltjimPlD3PYMbJFrRcQoLm/bRrK8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4703 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_01,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-2303130070 X-Proofpoint-ORIG-GUID: uVVhkcZXxnlo_Y6wJcFeWKHF-JQJ7RzT X-Proofpoint-GUID: uVVhkcZXxnlo_Y6wJcFeWKHF-JQJ7RzT 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 (so drop that check also). The only caller is scsi_try_bus_device_reset(), and the command and its device pointer could not be NULL when calling eh_device_reset_handler() there. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 2c2a41b99641..5b51c24f7d09 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5372,17 +5372,16 @@ static int scsi_debug_abort(struct scsi_cmnd *SCpnt) static int scsi_debug_device_reset(struct scsi_cmnd *SCpnt) { + struct scsi_device *sdp = SCpnt->device; + struct sdebug_dev_info *devip = sdp->hostdata; + ++num_dev_resets; - if (SCpnt && SCpnt->device) { - struct scsi_device *sdp = SCpnt->device; - struct sdebug_dev_info *devip = - (struct sdebug_dev_info *)sdp->hostdata; - if (SDEBUG_OPT_ALL_NOISE & sdebug_opts) - sdev_printk(KERN_INFO, sdp, "%s\n", __func__); - if (devip) - set_bit(SDEBUG_UA_POR, devip->uas_bm); - } + if (SDEBUG_OPT_ALL_NOISE & sdebug_opts) + sdev_printk(KERN_INFO, sdp, "%s\n", __func__); + if (devip) + set_bit(SDEBUG_UA_POR, devip->uas_bm); + return SUCCESS; } From patchwork Mon Mar 13 08:45:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662953 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 7FEDEC74A5B for ; Mon, 13 Mar 2023 08:46:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229688AbjCMIp7 (ORCPT ); Mon, 13 Mar 2023 04:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbjCMIpm (ORCPT ); Mon, 13 Mar 2023 04:45:42 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34DB329145; Mon, 13 Mar 2023 01:45:42 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32CN0lJp005179; Mon, 13 Mar 2023 08:45:39 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=eDVmQs8pZsbPMF2/eV/3LFDfrallp3jh9pAkxhi/zNVu9h18OOg9sv/1i3slpv8mJ4Rq qljfbzo6Qw1I/kPe54idA3YFOjleAz10cD84JgoR925ae23fosnJa7oROb5J2AbuIybd AyKuTl3DATwN7qJq60PQNHvLyrtZwx5QC0FXn2VKoGA0wSKyarssA4tGGbQFpnZxcaXL odwL2kAsj6AqwAcs+gwS+n+Nf5yOcrgiRxijXhCquYG4Ce3YXe4oC7Breumo5fMLPmwG 8svMAC1+QxE8/67zv3wUtW8X07soaRz2NBUuMtNZyK9FJ9asTL9r6xhIJIiqA/xLMkKN AQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8hhab7rw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:39 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32D6tIlO033575; Mon, 13 Mar 2023 08:45:39 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g343a9u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8cZFvaupNFNgvT9ctBxFpBixW3qqm1P/f2KCeJdk9R6Fx+jWs0pIRxtrGa3TszYnptQe+f4KH3npmNpiwTW8onP+zLIwhFETenOtEjeT9M6rk66oApOoiiOOg3FOjj1Vvd5LkiFq+2AqlRfcNVxhEzESaZ3JwXUSxzYdI60IZo/638jbWCatRwPSDsvyjvXteDZdeKA/9YgKRs56CEwqTpvlVFDg0AfNtRtk6roFcCuvnqUaIqY56U4VNM8xkCZLrmJiYEI3w28+EerF9UFnQCcLpQpTi0KcGJQWSn0q1C3gnKg5NkerB8EJi+y5Byo8SWmk1YdMbIHNiGob+QFEQ== 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=A/f0ZMSTgLK35fhKjtpGl8gzNwRr6g6hxd7mWpuZo89IoCJPJPEbtZNsNkPwSwKDWyEoxtV9Hz881+y32XrrQtRhG9X3B2NYgD3uFg2/4giFkF21C6lz94pGM1gpjqnBl0c2ltdZwMiUttrRmpKUi/dvMCKO00oQ/fK3LNXbpVTy6uf08Cad0KzA6a4GOrNaPJaxmocuBwd2A4+Ubjw53fjy/ydNluP+AkD0ByWPyI2QoUpD2VuVk1Twt/4tK/Ps/gzh+9bh8i+2GLjBqqm0I8C+aCsq98iJZ9STRzzqAZft1c1qEeUjGrk6iyu0Wwk6VelW8sZIADx21tE/wS1iRg== 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=JSvyn+0kGpcL+CsA7zpx37LFXPXd38lrfH6Txx/cRsQNBwkAn+EMFw38LRVte7uP/K01MuBn32nqJULHuhyw2xab8145p+DGl7GnDnzsuQUNHi5nlhSkPQRHWLTB36YW/rcDHlPB9Oktrl3NUvG59vOP6qtdSExIxbd5v6ECLqw= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SJ0PR10MB4703.namprd10.prod.outlook.com (2603:10b6:a03:2d3::17) 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 08:45:37 +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 08:45:36 +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 v2 07/11] scsi: scsi_debug: Drop scsi_debug_host_reset() device NULL pointer check Date: Mon, 13 Mar 2023 08:45:02 +0000 Message-Id: <20230313084505.1487337-8-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313084505.1487337-1-john.g.garry@oracle.com> References: <20230313084505.1487337-1-john.g.garry@oracle.com> X-ClientProxiedBy: MN2PR07CA0015.namprd07.prod.outlook.com (2603:10b6:208:1a0::25) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SJ0PR10MB4703:EE_ X-MS-Office365-Filtering-Correlation-Id: 963c57e3-06cb-4e49-b129-08db239f50e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sa0hnsDNumlO8WxN9NHlgMAgvds1D66TrcDPyAAbdr/HHZ6NZfDFWW+hu0XmgyDgNjzMPPoHYYHPQJZOVL8I7ZPuC2OPW+L2BMaDqx9xlEZf3N/XNE3cqGcwvRiDihBqQgMAv1is29EaBZxa2Jbq8miCrZwt874FoPuvDzvqvCG5F+BTXs9SGq1kg5/fO+cOneiSTochx7j+nGOX8EkzqZfvpHHf5pTULTMwMpJ4/807lJJbHwg/Utkx2Ls1gby+7UKkTvC0oBteuGlMJ/zUD73Ur8WvLTRrPyMP92N1dzxeQGHpzo/8q7mTJJkZhEMrAyzNbuwsh/jDMzfiIAjb46pzf+zmmwQE5uVKQ/LFx6ElT2GxncGxF51bXBwcSluEUX0C9Ccfw5L2WmmGL00Jp/VBx1nSDSngFpTPkexl0xCZWGlWV9gyP2MzbVV9MPZ8knpOkzwENGRoQvAUMQrOIjQVNdHJbsCG7ARf6YIV4hN41jOChLQ1Od7/cw4fHk2g0wmjz5tOOa7DPUVS5AKolf85S5xz4QAYhFCoohYcXppSJYrdZGc4bCkYVfcGmthbQsFrCt4iBBCANesWS+gqfthF0NDBhP+0vXHUJTqtr/Jw6LbT6x4z1CePKRnR07ZrGuBHREl4RzNa+3yK6OFL6A== 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)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199018)(2906002)(83380400001)(4744005)(36756003)(5660300002)(66946007)(66556008)(41300700001)(8936002)(4326008)(103116003)(8676002)(66476007)(38100700002)(6636002)(86362001)(316002)(478600001)(186003)(2616005)(6486002)(26005)(107886003)(6666004)(6506007)(1076003)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CJd7QllXxuSmpmVeRGSHID1XyyOFqeMNDTsdyEu8v0YWj8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/0zB/Ky4tvOl7os2NG6Omp39BRrhnS/TDORbBpirsQ01vp/HDDVh1Hs9q37HeNgxt0dWL9e7q43lloqDEVwCVY8Z/uG1xA6h+Fhk+5U7fXdBbCA9hoZ7IzTWVmMNKYAQVY6Dew22SQBRdltFg/TVZtOO3h7dUZT1v19BPTF0gfvML43i3QynlI8qNE+GZQfNWbennWxDE5lkEX2ERBM5rDP2uwyCRVT4amB/46zSpduuNIczqWnCCAQ6uptA9yLe0/Z5xCl4O6tf2RXjF3dvLj8ryEBpXAwHc3/2NjVMcnPuNZY8ZWZPJLICFqpzcsbztnyM2jKy8KtwuaB1oTvM1VL/v2kgRPVv03k= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 963c57e3-06cb-4e49-b129-08db239f50e4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:45:36.8400 (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: xw/n6Fq7JTlFGkpmDAz3mhsiWB/VuzCKuRS9t0N7bEHmke/RWAziDFhDCb35S+aiuwXCJ6QNp5enjUl0TnxogA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4703 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_01,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130070 X-Proofpoint-GUID: KnIuZP1N7orhC0GPR893yP3L2NMVBYk7 X-Proofpoint-ORIG-GUID: KnIuZP1N7orhC0GPR893yP3L2NMVBYk7 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 08:45:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 662952 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 76D37C6FD19 for ; Mon, 13 Mar 2023 08:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230300AbjCMIqy (ORCPT ); Mon, 13 Mar 2023 04:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbjCMIq1 (ORCPT ); Mon, 13 Mar 2023 04:46:27 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394084D621; Mon, 13 Mar 2023 01:45:44 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32CN0lJq005179; Mon, 13 Mar 2023 08:45:40 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=l5emtnqnAuF5rngG5kvp0R7AJJUPTkH1GIQnJU5Z4ZM=; b=JgTlblEnUA64VVgC8ItR16lB7yl4gQ40uyjs7QY5m2CGU7q71GDjBK2IRJLJPynoowEA dXnudo7IZGOYrSy2DokU30vqOEeVJvDKA16vC3VxpKnJa8ME7gxaoEyG1vuT76kb+Lqz HdRp3f2Xu+uSNGq/jbKHGNXqNCLHZluX1f164moDWInfMiRf8xhxYR1S70/IyPTgCOQJ DLxhrWmn0eoJPaG3BvUzB6K5gkKEc6r9l02AANV1hlTR96Z2hCO/XufUYhbEh58t7yPD 2TEfV1DUIq/UqIsguMAEUTKDx8SJKBLLHbKIPytEduuRG/7FWwE2NKxgf1zR/IOxgIQY hg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8hhab7s0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:40 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32D6tIlP033575; Mon, 13 Mar 2023 08:45:39 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g343a9u-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CJdbHvAenDNGseKvsW/INdbzy3UkuOrRv/TWxcfNcsLrJoTR+kkT/As76AitkrgRGmg0JhtnQncBOER4ClFISkJZqd/XBakFvlXHfw9eUXv934mdtkfJrBSXU71rutqCb3TGPwjHPOiFB78o9+prpN97Ic/R3fZ3tBJ4kWoJ/v18it+K6neTp5pc0HrCodbmdGKCQxV6mGEjynu7MN1yYL1xvHy2ZSZIw3tEn3eGi99c1gikSMLqSDjO4PKKgtfZcid4JN5vkOVIMwwJKepJfK0UqcvK+sP22nyDzNaJX9PYRL+NvE/pMw8d2fDIH4NsiEC48uCSyi0nxooUrLMaww== 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=l5emtnqnAuF5rngG5kvp0R7AJJUPTkH1GIQnJU5Z4ZM=; b=C9+SrCk2MK3z7ftwvlGpMt9GAlrXpWq6j374cmjizyE96H6LXfgVMg7GJ75TV+bxUwtuPUSvGJ9WyKKXhiswCYUMH02BsBMJtr3EDRThMtlkYWeEbEUVbrUY2KJBzAB0N02P1qYmUDMArkGsWK9J0xNEAWssh9+ow5YgIFY0Tm2NACltfCdOMZiqxmW9OXtL+kH6LfSHKX5KNz4hLTvnuTW5jQ2vNVjJZQ39HdsAzm0jg6SmoEY+XJKDcY6FDMsOUIm/V6wL88mlzO0Ezn+16Ajf5GMvw4KQrFlvWzEI9GJZ0I6869vnLkHSelKS96svLjpFYRdB/P6e6GtWgDWbag== 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=l5emtnqnAuF5rngG5kvp0R7AJJUPTkH1GIQnJU5Z4ZM=; b=dReOhmijTS4IvDFP0g0VfHQKpF44I/T/zDq+ZauqJP2NFG2Jc0/Do2ehEJCjZamVVIEnL5ViK+U5ZP66Kr20kK+vvE7hKh2pbaexR8DTIjgmmkiMGm4gcBe94qmceFDszpmdJMxkzVkObBpEsdtXHcQf+nua1wQUYnmLjQI7NGo= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SJ0PR10MB4703.namprd10.prod.outlook.com (2603:10b6:a03:2d3::17) 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 08:45: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 08:45: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 v2 08/11] scsi: scsi_debug: Drop check for num_in_q exceeding queue depth Date: Mon, 13 Mar 2023 08:45:03 +0000 Message-Id: <20230313084505.1487337-9-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313084505.1487337-1-john.g.garry@oracle.com> References: <20230313084505.1487337-1-john.g.garry@oracle.com> X-ClientProxiedBy: MN2PR03CA0019.namprd03.prod.outlook.com (2603:10b6:208:23a::24) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SJ0PR10MB4703:EE_ X-MS-Office365-Filtering-Correlation-Id: dfb11cb2-30f1-48f3-d9b1-08db239f51b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: roo+oVVXyaQOFLS1F8JmmIJaW7/b3p5vI9g6CGg+F0a5jGUVfaikD3yfaWm6rDTOEIwBfjqkgi/261u0H73f38iDRUwqsf70KHfJJgIVn8Rh+dcKjjfQ3hdNC/7Ws6ttw2Y8l2fUktjplx4fSeT402nBFODK4WYkZisMR1/VNz9aXuY0pzZzHrv8/iJ7AGf16ixc9+ZBRSrhnrmCp273BGxBJKm85kCiw8Jl2JjXnWFunhDGPGkmug4+SMS1asvKkwRhd9Qcuv11hqOy0cKo1Sj2WnIzWDjBttOqDLrPq68ymhiDWvdv96y4AkHvGghWwE0mZI/7S1f94Ry0XS1VxrBmOgMCN6+o4EvWetccFNgSb+oEYtoseHUOnSiC3pmDsDrg5d7TdK8AGzO1YUDyBJtp3m0tM3rc24smHMkaEAwBJis6Ntblv2nST2W5oQ9t4PhC+7FGufsa2w+GkqwzpR5owguEpvN17MmL+crQwXrBU7T6pD20uM4SGfzOo/lM2HQnskkUIAz8+JZLPeljde23IbN9UzUMLF7B1rp+n8BqXleschEf31W3RU1xYUiJkQYFI3/iTWST9wwYuSteJcxATDfjBy0P2br95BTOM8pZLHgWic6yPRY3qEq2F5LTWV8NuPUf+grgvyVA2ZUlRA== 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)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199018)(2906002)(83380400001)(36756003)(5660300002)(66946007)(66556008)(41300700001)(8936002)(4326008)(103116003)(8676002)(66476007)(38100700002)(6636002)(86362001)(316002)(478600001)(186003)(2616005)(6486002)(26005)(107886003)(6666004)(6506007)(1076003)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /ABESVRRZaBi429z+cEjXe6ipBr1OwdKQs0po2jUxWPmKXWwaqyJA8waA/qcocelp9Ffoh4XslvwtHWqz4p0DekKJDrQzYIwf1vGyR3Gw2ID2OOtOlXQK6DLACU+WKcNbJPk+LNNuoFHZnMuq1DDGaodkLrj/peeQV6Qr4klZYbtD90YlaMLrUfYd1pwymKAaWoz4eaat3cE+Oe0pqu8x8eAOPAWpZoVbM4kyZtiNu6umfn+mCAHVFiNavwcaKYD29BzrKMF9fkZpB+Knlxg3+z0aYmAJjn0tv/5n59dVPZvzvUznpeQVhE5RoPR79mSsmGM73+fQ0R1gmJwu3mTNEmgZ5+t8ZtMAdGvALNvmqk462aTm7PsfqWJb2KxD8nOfpmQjz9ChaLHIc52QaCm3uPPTQrF7iPaxe9cijjcfguyCrKhmaSE/RpU/15nx0m9MPssRgaT0FfJ7PA9ktC1/dNbHSdcgI99y/Y8gFjv/UJiycpguwzndP4ZlakGxgilZpcYiDSdYIcYDwlBr0wcLHXDoGu+JGuHrJoa0PzYnAoyj5u41ynGwhWzwStdfkYoCSHGOMJ89/etva//18wSJ+xau9Cbw/nysrMflE6lTCVbV4LnOwAxJosecdjqzSuxdzvtjKAsrfB4c650KQL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qL1qRcm8iGPTzMjcmsaNyB8WQj+17yU8MJZ+gRlXsJh4DsMc1Rv6txyRb2OMiiiePFmozI3sb3zh1TxnzHZAdHTxo6Q87jGA8R7BMB6LRZVlel+ykv1/wXC1bCB2dqxJ2SxtKH4VjGdsSXJ7KqknJdzw6a93j4bRMtMXCKI48dy3Q1lHUxE57WPPp2VA9XfHHjNjS3on4AWs9n9OURikHIY/UR328x8Mm+7J/PcKPWlITArBQH8V0g7/pHIJvNUjOpAVCXtj0QNcc2mJnMV8GGmFPKqno8rjaPeriavyhmMMFPT6Uu7RLQeqYVx9sx8Gdtm/ad8RfrxxDuTpude4oZuKepjQjBQUh2xtNEWfDLr1jt8hpkJjaacupo/Uf+hw1aRqK1ymBOueJdQdSMVOtXnRzaySMSZRQcnYUxWUSo/PLq5haPe481DkV1eTzu4kawl+iebN6Mkftd1Ldti6UZvBOBGqKGSTwUrwuTaDByPw8sXWR93h3/dhBtq333SGmWZJKKnqP80RXB9owz60gWI93pVSwVGcjjDv62ScNTxVjh7toc2CqNvi9Y80TdTSS1eH6oBx58mCkMrwn0f5wz4d9IqmRhTwsaXlEFWW4wNDPq9fNUcS5ZB4HxX8pmPaHykC72qB+ecHv607zmPuZsrG+J8M/4lCHnqiB1lVxZPclecUQnKmXiTVCcGKgfg2LI0KzZYXgq2URCoTu9fjVCf7k2Pfs9KnxfkDVlZprTFT6vKC0tNHSpZnmwCj97pS0fPbyZJCQomJ7DeeebIntiFUqXM/OPFYsbEZVIUtIPSPoAkfaNZgZ6v4+d0557trwDI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dfb11cb2-30f1-48f3-d9b1-08db239f51b8 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:45:38.2304 (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: cteYM1yuskwtI+ZSd25KaQv+MBQFj5q0d8E/v9+K6UBBTv9aCul6INcKsfWsvzXGM2QfP6NBpUts/hbQxqF05w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4703 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_01,2023-03-10_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxscore=0 phishscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130070 X-Proofpoint-GUID: R7Nq09oVXTi_-u0l8i0ICIjv9Bp-U_qP X-Proofpoint-ORIG-GUID: R7Nq09oVXTi_-u0l8i0ICIjv9Bp-U_qP Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The per-device num_in_q value cannot exceed the device queue depth, so drop the check. Signed-off-by: John Garry --- drivers/scsi/scsi_debug.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 47820b9f6326..0d515bac93bf 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -5593,15 +5593,8 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, } num_in_q = atomic_read(&devip->num_in_q); qdepth = cmnd->device->queue_depth; - if (unlikely((qdepth > 0) && (num_in_q >= qdepth))) { - if (scsi_result) { - spin_unlock_irqrestore(&sqp->qc_lock, iflags); - goto respond_in_thread; - } else - scsi_result = device_qfull_result; - } else if (unlikely(sdebug_every_nth && - (SDEBUG_OPT_RARE_TSF & sdebug_opts) && - (scsi_result == 0))) { + if (unlikely(sdebug_every_nth && (SDEBUG_OPT_RARE_TSF & sdebug_opts) && + (scsi_result == 0))) { if ((num_in_q == (qdepth - 1)) && (atomic_inc_return(&sdebug_a_tsf) >= abs(sdebug_every_nth))) { From patchwork Mon Mar 13 08:45: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: 662951 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 AED2FC6FD19 for ; Mon, 13 Mar 2023 08:47:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230240AbjCMIrL (ORCPT ); Mon, 13 Mar 2023 04:47:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbjCMIqs (ORCPT ); Mon, 13 Mar 2023 04:46:48 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7247E4FA9C; Mon, 13 Mar 2023 01:45:49 -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 32CNs1kb029642; Mon, 13 Mar 2023 08:45:44 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=26rGXgIJXd3NPR1eXA8mbNVNmg3HXE5Z7WYqE69dFytBuRstziiH+/svbDyhRCC0l4+k fU3RBiXJebJImOp0X9io5mbD7oHCqdijAoDi4O+bKnT356hwR44Dv2Bq/njdCMv7TFkU /xnMe4rfFQgndXcmiDwK36vMhc6MWATimXKi5aDhg+iU6n/vqr5GYMOV/xu1pfwQgAYP UNA7qX3OSTm+KQZRine4GDx+zzgDv9zGAcaTB36lTGInDo0Coc8CifXpC6Y6PVb1nLQe S3v2LWHLQgdbzGD1KAPdBAd3NxzhQYYrgjTOEQ7vzPRIEiEVakod7mA5HVUe5T0UEMb1 jw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3p8g2dk9h6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:43 +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 32D6qLeA008167; Mon, 13 Mar 2023 08:45:43 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3p8g3b40ky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Mar 2023 08:45:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iFBobgykvfExvtTFiTOQFSTZWkVl4Nhdmb+lXb1tCw8te0xo/gd9hLmF53coGujyhG59NDmH3byoEYGnvqQFeKHRL+tHcEU46Gc6IvP+EgyJX3SwDMCU/gFqyo0MjRyhpJGRBgDzuiMye0KbBfrW//YciC5rcBd59kN6Gbqau16UlbGYQHViG9QNGfwykr77v5p6C4lZWkKuO33HSjMTl9wHRPO0pmlhEctBzBEaNs+jMzJtQnNgUeLULxWD7AemD4r7nbExvnN/0brgeH8VFmosDaRNM30Q2Rx/e9yFot2armVkH2RMGz//tCyBcFULCpHzfhvgHy/v+6HOr5Zong== 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=R1ZOYzdjBnlM2PI/3JNz5oS0O1iRXFikrtIwTQUjSVstALU8ZdGta243WVwSr9Cg1R16xSY8yzSXtYD1sLk28e+EMVXTyDP2/vipiMV7Ih3+AyEXpekNUof4Y27PXRUtjxjaGMvzqJXwORqis3PYV4WvkhfDB0myeJ/+Ygl46DidiIE5XtSPvsS67gFp2sTTrvvQIsvI77qowoPO8cTErZeCVIdtogITpWzLDcje30rLnPAA2f+CT4KLs2kI/7RE2Fsd/u6kpgxyzEyuQ0308ETbtRTha7r4nQaEyOCXGvBPp28zNgeAKv00H3n2FjZURKBV8VV8p2qu4/nH1DEJJw== 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=zzoCHqF+MRnn4JBAadTx8ph/hrJ2pDDRTphf/Q3MB3kClakFsVVMDWJiY0wkmD7xYTXW6RRbYjsFcJ4QqVyfeeCxQu6bWSQqMxPZsDGUl5+Ih1h8O8fRAcishOJV36+7Mvyo019ib1AvLKYFSByGvmSQGyozlBfnHrjZaLnyZqU= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by SJ0PR10MB4703.namprd10.prod.outlook.com (2603:10b6:a03:2d3::17) 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 08:45:41 +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 08:45:41 +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 v2 11/11] scsi: scsi_debug: Add poll mode deferred completions to statistics Date: Mon, 13 Mar 2023 08:45:05 +0000 Message-Id: <20230313084505.1487337-11-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230313084505.1487337-1-john.g.garry@oracle.com> References: <20230313084505.1487337-1-john.g.garry@oracle.com> X-ClientProxiedBy: MN2PR03CA0030.namprd03.prod.outlook.com (2603:10b6:208:23a::35) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|SJ0PR10MB4703:EE_ X-MS-Office365-Filtering-Correlation-Id: a6c94330-84ca-4ab7-e252-08db239f5371 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uMoBSzkFDbgjeBQKG/eEDPG8jQ98UpPjLddqdWYRTXW7QCyDhWMHMZpM/Eih1Jq+xIltFL/PhGEO6cubUHXf6ZXnSKl5qs4Dra8KDrpyFn5Tk8nzIWRXMQ/iK4Epo5c4wjg7i2f2CzQ0Cmz5QivBhk72HzgsnQjc6Dupz1GDHe3oTiSlvtu8em2/QAXd4XPtwZvjHdz2+cFqz+jtaSVrAd497RbKm/L2iylFNZ/mFgavVgXv8zwzzQCJaYCQXJozPScRr0ZtTXHEjB4iMfzArKcOwH44JG1ZBlNEYZZ4cD5ScgzfKdKG1BNU4Bp5UpblFke/I5Mqu+ClPLjXWabCotyhV2MvxRcEAFtAl+2v0/MQM/fwkTOONVxirfqnCAurrajuPlyql5ljhGlFae7vzn2r5tKVIOngmGTUUgxtrU/cy9vKWuDMqb/so06UbFdA6DeHT1iyK9C03c5fkxWb2r4qSotJblhd0rpAuy5TfkuTXWlpZrAejRv54uX8Dzk5cWhkyddXl9WA6DL5DiFm6A+ck3HlGSWyV8oLQi6DrtXN7wiHeeSrUIvIZ8O6yCFQxBcc5EEuRPQEVmi+CYGPiRB4Gptg+4TWuq30gVIrrUnGFBmrnD5RT6dM5cQn9AP8tkX+g6qCuCp3S5UUvcn2cw== 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)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199018)(2906002)(83380400001)(36756003)(5660300002)(66946007)(66556008)(41300700001)(8936002)(4326008)(103116003)(8676002)(66476007)(38100700002)(6636002)(86362001)(316002)(478600001)(186003)(2616005)(6486002)(26005)(107886003)(6666004)(6506007)(1076003)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KsdeJ6JNLPUiM+vqvqgjx0c4QS4RHkf/cVVy8/KovxyFBeaIV8EFu7gKS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3SUDc1ciWrcsKoNo0ORN5EX+wgfqYc2Qrhe2qoVrMDB4QD7Z4KIgV5akSeNGfi9Da5BcthqCiBqAUS7QUwc6ygXvNWmoMbDgnHGZm11LRgHiQ6bgooYSfzj2LSS+geH7rSc3cFx92bbi8NXQlEir7epduHKKqgTuBsparlKNDCUNkCnj5mlP2n9ba6exxNeVgRw/Zga+zpwDstUACZk1jrb+wPCv8F9+84WF9+fFPe0VN/qjbUnkiDVbgNMoYtc6Ru0F08JcVnp9qzQ+nId5eBCqlB84PNRM/VXZJ9+tjCL6dwrHRPtnH1kJ9QGqmFh9/PG9TJlE37DYd8EPuDb3ixxQWVrnXHDePLSY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6c94330-84ca-4ab7-e252-08db239f5371 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:45:41.1363 (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: Bxrl/grSJ97Cvd9QkwfZWQn8IcPnQ9GfNDbK+EcpRdHCrczAYrflZzY8JqsNztT7qMT3BOaAhrhzhW/tqFJ7jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4703 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_01,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-2303130070 X-Proofpoint-GUID: XuDan-Ux_XKbNY9uY49hEaVuO7KOG6mD X-Proofpoint-ORIG-GUID: XuDan-Ux_XKbNY9uY49hEaVuO7KOG6mD 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);