From patchwork Sat Apr 10 18:40:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 419088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ABC6C433B4 for ; Sat, 10 Apr 2021 18:40:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43A4E610FB for ; Sat, 10 Apr 2021 18:40:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234856AbhDJSk4 (ORCPT ); Sat, 10 Apr 2021 14:40:56 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:49856 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234768AbhDJSkz (ORCPT ); Sat, 10 Apr 2021 14:40:55 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIWGAt167501; Sat, 10 Apr 2021 18:40:28 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-2020-01-29; bh=BuZ46RMQmFLVlY0N9hRVWy2/HAn/qB2ILyIh5aO05w4=; b=l2V3XzLHjp1lHyMI401tO8d3ek7fiVdAmdciE1z7lx+ka3Olr/2pjAi8AjAU9nzrHYO1 aVNRH+ZKQ/A1WkgTqs1iXnfivmicjN16PMxEElqOQK3vMNkRK/RWR67KoTePil5NHo9N Q1XlQZy7SGZtQ1mWTOrSlTx7JP6YRiSAoQEIb4EEQmf6hQVVAoYMuwcjCAN3rpr0ZJ1H TZbqtNPYPQJaKcaU6RW2LkgbFbMRdhiGuF/UKGytMVqcK6m1rG3XaUNi3WpODzxqm/gk b6dJLDAddkF5x0CvAsEuf5nEzc7cdbbPunZ9h5Y2HZzN5KLhOu1eRSHO7lzXPrPH1VLY pQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 37u1hb8vj8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:28 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIThCR176756; Sat, 10 Apr 2021 18:40:28 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by aserp3020.oracle.com with ESMTP id 37u3u1q4cu-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BFNjuy8a5HdR7V2MLln8fdeJQyO6bB2pDgNl3LIXDqdgEwalWsK75Ts9mnNqesG6U39ucfXakRnkQw23M66X8OCe5tVmNiCH5PjZIezr+iconskX+9I/v5yTr1bTWcAbP1OJNgM3ft/DYIxHC6GSNoHw5u4IsncHD9jWVMNJCWvmNPlypKBHD7HW+/h9jyZgD4u8eElnlQUoGY+Z+yRleZuM1nnNWuc9hXKu1J4jGudtXT6MwMrbKGgzwSd4PeGZM/ti9L4F3kl07VUptfKPPYTyshEuDKdvIpv8lDQBSOQKpqLverfnDylLnH2TxjvsSZHdlw0mr/dyIFJL7KqIkQ== 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-SenderADCheck; bh=BuZ46RMQmFLVlY0N9hRVWy2/HAn/qB2ILyIh5aO05w4=; b=Fu6ouIgrvb8mjpaFWNloU6YRsJzNf5zzRaZUmynPEmd/pr0f/fcKtt0GUHclNCKyXkKenQ24XTExUeGPwpqwR2N5DmKEkdTeh9tHx8Yd2EEnK/rkippWpr00ka3BqVOK3jEaVSn17BxgZuQBsM1yPvNbGkqZmGGJI7FW5rGQSYShEy+LhXqaStD/9HSPbK13LedzNnDdUridw48oBuAR2X/fVskgRhtUWzs7rvVH1WdKbglWaKB2TBl0PyHtj8sGjC/aa5TZAdS8HZ63ddpCkhvvywiQn9YwasDgXwoZRPO1xSRoR5LAuplabpwj9+PrQz18aiRJgDhID5Q9L0Nq8w== 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=BuZ46RMQmFLVlY0N9hRVWy2/HAn/qB2ILyIh5aO05w4=; b=A0W95+fF+okQIN9ap8Cln4OwxxQCqFKKsPxJRjPBIiAsd2RxGQetN+vbtCCmpoHRs534qMBKyQNcMRgKkvWHyiZpbbvYCbPv8MT61+rbw3xBq5lAUT5mC2ZqNgJ6G5CZ8xTJ8bVZhYSxdcp5kBVQmFUMMUcrZ3KutmvH3N2iT4Q= Authentication-Results: suse.com; dkim=none (message not signed) header.d=none; suse.com; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4324.namprd10.prod.outlook.com (2603:10b6:a03:205::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Sat, 10 Apr 2021 18:40:26 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4%7]) with mapi id 15.20.4020.018; Sat, 10 Apr 2021 18:40:26 +0000 From: Mike Christie To: lduncan@suse.com, martin.petersen@oracle.com, mrangankar@marvell.com, svernekar@marvell.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 01/13] scsi: iscsi: revert Perform connection failure entirely in kernel space Date: Sat, 10 Apr 2021 13:40:04 -0500 Message-Id: <20210410184016.21603-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410184016.21603-1-michael.christie@oracle.com> References: <20210410184016.21603-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Sat, 10 Apr 2021 18:40:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0bd29e8-9e8e-4caf-ec99-08d8fc501b73 X-MS-TrafficTypeDiagnostic: BY5PR10MB4324: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3QlvsjdhKzMBoHwWlgEAIAWjJlMHBwfhiSuOjuuw9Gmbzm+D8JoQ/tlqiZUFw4v2lPVYGdIrb9ZXXpiJgeVW/SwDYAz4ezSOZWkfmGD9i7u/oks7woPKOB6l/f3cr8wJN+Rj2K6uoOGpiZR1f68j8ijMiUbEwS2CX/pdBVonp9YT+GLuPu0FtuE7n763JvUDEvhEFtrDfxKe30Nu+5Na1R7emakrSqwheTeHBgFCOEiu1KD2pmPPAv6Fw4HXitVJ+bUj+Tyn+AgAX5GXlCcManuoyE6Jx7aAM2go0ifcfCNYSCeZNWqECapp0lYnr6w+OTgJPjKucyrSJoGasaujA5xUOY0WMB2nTntFFcctLcEEUxNRE3FuPEI1lp/QZj0XA3/Q2xYL1Czr4klE31p1mmM579rL92cOMXHCZzOP+i//CmXnsTqjMg+znjk6tAfcf8BGjfFgaSyVeKOCSqqrZyI+dYE0Ukn8BNTzrQMPSDtVEpcOvKm+o1O4Zy3G9QKykEkrTFGWfT8JGkjqMNqZFOmzUfrnMRUDafJlQAz2QFA+Q0wDPCeLdx0oafdmGAhxvE04KkD7inzL5HS8lofGqgqlvyAVmd9vYK0tyBfHK+P0UGaMSqOzLAcB6HPdyBlXGswgka6XwJCooDc3eyVSusNVUbNz1J9dB+W313sWKZPb8TSF2oLH56le+PgQQ7D4 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(376002)(366004)(346002)(136003)(66946007)(66556008)(66476007)(69590400012)(6486002)(83380400001)(2616005)(8676002)(8936002)(16526019)(186003)(956004)(38100700002)(38350700002)(316002)(6512007)(1076003)(478600001)(52116002)(107886003)(26005)(4326008)(6666004)(86362001)(6506007)(5660300002)(36756003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: gP2ztaHlhhyEjYusCwjoENlAJ7gQzj/yFL6iXMqQf8kLZMIbcURBXI/qhfn6Fhsdl5U4FPeieJ+kQ96xcqULC5bj0w5FuHZpbb39QEqH9Bbk/BizHJrh4eVwyUks0BIMlkUvx3GBcfGuSSV/czmCvkPOa2T6k0bAoH2U6SJBY7MVtujmaCbENqKsUw36bvkHFRfr8c2AAaLzSvFkl/yEkbNMV3WWWg3XDzeaahn105A3QhuufT2LelyQ55nZQ0QFiPJCWW02GJDYlV5WnpWbU+p87Ax0oF/O2EXNPLIyYu7DUjUggqB0bgDlInFqZOg1Uitiv0bvxEcgdc6JBAcS1Dphh547o+ZLuZwV6MlWVDJV5fQxlEBwmyBKXQSHg9sc9Gu0ZdYklQfYNAvKq1u28MCuRAbu6Ae34GpiHzAKkXwx8OtTyugwMnJzvZzQzmBUqcPWSqdMDh9oJ2zmbj20SMOqD+J5kV+dAEL063D2V8a+6+tk0HYX1XBEA8/SbDjuDy/Xp6QbPhY3EO16VtQYymZ7HZpT1cVu0vlbZy1UoxxGpffNCTkMB5gg+dUIDKBoZ2Tz3UWpt/SWtaxd26Jid0azBk5lboaBgtGvt59qCTYio9gK/AR+HtJgZq4CC+cQs29UOKk0PA1ahniFY6ZkD0JZasVBkh4qb7ZZwbfvDxEnuzhO5huh/V6l7v4GAzfzU2RtkDWqOKFW7uIyik7BwVVUKI0VHZ25faBeoYefezBXnc4Z8m7cRBQdOEXTD2+t+OsiAzchQDTVG+wpgAZEOTN0KbUhVqaUbaJcSrSNkkffhhsrSDG5pOBmzpju2oPwWsvSEwPiJzCUAcBBpFPvKOkA18fzGhdJDZHaqF9nERWpJtEM9npW/ioXvRBPsWP1qgIxIpaMezmmgvJdpsXal6LPAKefoONSbseFeyK2VfjRfDR8GL8pxvVYL7AmzK4WjuVs6v/6ku+bOavKIBcspOXVp1LPnoHsPaU/SJy46DWhL/lsI6Tzz8uz7O2gR19BMF7x6Zw9Iq5QCoMhRHbvFvU4XzSF9sAXq03gb95/w41hZ7lgwgYc7IzRfyhL0NkAOkXmw9AzodkJxPxLTilX9ukh9uxZwi43YHQV8kuJsG/OJUMQgL4+KFqo6cRxHhVNfiflurfra4wp7UYURwCUKNnomdn7lcNwruBx19QmoUQrtip+4adaWA12VEEze+5LsonKFze7S0JPP31JOHDreNUiY+eFs3ksknfwkFSuluq5n6zTugk6wawtEU0CPy+pzXiVDLFkBCbhX3wn+QS/ZukeegYJskZLniV5OHWKXs6yFNwtAMidzVt7CZ8YDPQa X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0bd29e8-9e8e-4caf-ec99-08d8fc501b73 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2021 18:40:26.2869 (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: M0c8ZgKpWJOUSnZ9kjpWjr8pH/ERmulb/R9E4pHJWuc0o+YquYVokbH9JnfUt/y1plmNkkiGPdHHgPX0BM7irVDGlwpvWgTk6xuYtqgsyLo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4324 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 X-Proofpoint-GUID: 3Cmn7fE2OUL-48aa_C1mZm34yaCLiEQs X-Proofpoint-ORIG-GUID: 3Cmn7fE2OUL-48aa_C1mZm34yaCLiEQs X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The patch 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") has the following regressions or bugs: 1. It can return cmds to upper layers like dm-multipath where that can retry them. After they are successful the fs/app can send new IO to the same sectors, but we've left the cmds running in FW or in the net layer. We need to be calling ep_disconnect. And for iscsi_tcp which does not have a ep_disconnect we need one to close the socket so IO is not still retransmitting in the net layer when the upper layers are now retrying the cmd and sending new IO. 2. The drivers that implement ep_disconnect expect that it's called before conn_stop. Besides crashes, if the cleanup_task callout is called before ep_disconnect it might free up driver/card resources for session1 then they could be allocated for session2. But because the driver's ep_disconnect is not called it has not cleaned up the firmware so the card is still using the resources for the original cmd. 3. The system shutdown case does not work for the eh path. Passing stop_conn STOP_CONN_TERM will never block the session and start the recovery timer, because for that flag userspace will do the unbind and destroy events which would remove the devices and wake up and kill the eh. We should be using STOP_CONN_RECOVER. 4. The stop_conn_work_fn can run after userspace has done it's recovery and we are happily using the session. We will then end up with various bugs depending on what is going on at the time. When we add ep_disconnect we need to make sure they only exec once and exec in order. 5. returning -EAGAIN in iscsi_if_destroy_conn if we haven't yet run the in kernel stop_conn function is breaking userspace. We should have been doing this for the caller. This patch fixes the following issues by just reverting the patch because I'm worried about the possible data corruption vs how long it will take to fix all the bugs. If reverting the patch is ok, then we should look into doing this properly and maybe redoing the interface because there seem to be several issues with it. Fixes: 0ab710458da1 ("scsi: iscsi: Perform connection failure entirely in kernel space") Signed-off-by: Mike Christie --- drivers/scsi/scsi_transport_iscsi.c | 55 ----------------------------- include/scsi/scsi_transport_iscsi.h | 1 - 2 files changed, 56 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index f4bf62b007a0..2821cd3ddbde 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -86,12 +86,6 @@ struct iscsi_internal { struct transport_container session_cont; }; -/* Worker to perform connection failure on unresponsive connections - * completely in kernel space. - */ -static void stop_conn_work_fn(struct work_struct *work); -static DECLARE_WORK(stop_conn_work, stop_conn_work_fn); - static atomic_t iscsi_session_nr; /* sysfs session id for next new session */ static struct workqueue_struct *iscsi_eh_timer_workq; @@ -1629,7 +1623,6 @@ static DEFINE_MUTEX(conn_mutex); static LIST_HEAD(sesslist); static DEFINE_SPINLOCK(sesslock); static LIST_HEAD(connlist); -static LIST_HEAD(connlist_err); static DEFINE_SPINLOCK(connlock); static uint32_t iscsi_conn_get_sid(struct iscsi_cls_conn *conn) @@ -2281,7 +2274,6 @@ iscsi_create_conn(struct iscsi_cls_session *session, int dd_size, uint32_t cid) mutex_init(&conn->ep_mutex); INIT_LIST_HEAD(&conn->conn_list); - INIT_LIST_HEAD(&conn->conn_list_err); conn->transport = transport; conn->cid = cid; conn->state = ISCSI_CONN_DOWN; @@ -2338,7 +2330,6 @@ int iscsi_destroy_conn(struct iscsi_cls_conn *conn) spin_lock_irqsave(&connlock, flags); list_del(&conn->conn_list); - list_del(&conn->conn_list_err); spin_unlock_irqrestore(&connlock, flags); transport_unregister_device(&conn->dev); @@ -2480,38 +2471,6 @@ static void iscsi_if_stop_conn(struct iscsi_cls_conn *conn, int flag) } -static void stop_conn_work_fn(struct work_struct *work) -{ - struct iscsi_cls_conn *conn, *tmp; - unsigned long flags; - LIST_HEAD(recovery_list); - - spin_lock_irqsave(&connlock, flags); - if (list_empty(&connlist_err)) { - spin_unlock_irqrestore(&connlock, flags); - return; - } - list_splice_init(&connlist_err, &recovery_list); - spin_unlock_irqrestore(&connlock, flags); - - list_for_each_entry_safe(conn, tmp, &recovery_list, conn_list_err) { - uint32_t sid = iscsi_conn_get_sid(conn); - struct iscsi_cls_session *session; - - session = iscsi_session_lookup(sid); - if (session) { - if (system_state != SYSTEM_RUNNING) { - session->recovery_tmo = 0; - iscsi_if_stop_conn(conn, STOP_CONN_TERM); - } else { - iscsi_if_stop_conn(conn, STOP_CONN_RECOVER); - } - } - - list_del_init(&conn->conn_list_err); - } -} - void iscsi_conn_error_event(struct iscsi_cls_conn *conn, enum iscsi_err error) { struct nlmsghdr *nlh; @@ -2519,12 +2478,6 @@ void iscsi_conn_error_event(struct iscsi_cls_conn *conn, enum iscsi_err error) struct iscsi_uevent *ev; struct iscsi_internal *priv; int len = nlmsg_total_size(sizeof(*ev)); - unsigned long flags; - - spin_lock_irqsave(&connlock, flags); - list_add(&conn->conn_list_err, &connlist_err); - spin_unlock_irqrestore(&connlock, flags); - queue_work(system_unbound_wq, &stop_conn_work); priv = iscsi_if_transport_lookup(conn->transport); if (!priv) @@ -2854,19 +2807,11 @@ static int iscsi_if_destroy_conn(struct iscsi_transport *transport, struct iscsi_uevent *ev) { struct iscsi_cls_conn *conn; - unsigned long flags; conn = iscsi_conn_lookup(ev->u.d_conn.sid, ev->u.d_conn.cid); if (!conn) return -EINVAL; - spin_lock_irqsave(&connlock, flags); - if (!list_empty(&conn->conn_list_err)) { - spin_unlock_irqrestore(&connlock, flags); - return -EAGAIN; - } - spin_unlock_irqrestore(&connlock, flags); - ISCSI_DBG_TRANS_CONN(conn, "Destroying transport conn\n"); mutex_lock(&conn_mutex); diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index fc5a39839b4b..36e2c1dcb059 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -198,7 +198,6 @@ enum iscsi_connection_state { struct iscsi_cls_conn { struct list_head conn_list; /* item in connlist */ - struct list_head conn_list_err; /* item in connlist_err */ void *dd_data; /* LLD private data */ struct iscsi_transport *transport; uint32_t cid; /* connection id */ From patchwork Sat Apr 10 18:40:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 419086 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EE05C433B4 for ; Sat, 10 Apr 2021 18:40:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E6F4610A6 for ; Sat, 10 Apr 2021 18:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234928AbhDJSlC (ORCPT ); Sat, 10 Apr 2021 14:41:02 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:47596 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234903AbhDJSlB (ORCPT ); Sat, 10 Apr 2021 14:41:01 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIeTcH066784; Sat, 10 Apr 2021 18:40:29 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-2020-01-29; bh=v1jLrcZyeDZK/Caaq8C1jQgHu7GV9NQ5XyRZwNBf6i4=; b=R+Qv2fu2rALtDWFt7OuOluqekIltIZQCGIR5o26MK+aHNK0dj8Wz1yYMo71nsjFS7R2r 7sLJ2D35XfriYsUV0UHlf9jRg5Ucxcy1wufZSThpCy/FlRSHpIh7lB2eo4FVXXmk4WJY MDVRhN4i5ul1zNxeOoeXHbKziOu3ZtYOVTr9p46IuoVBUk29IpHt1e1MQEAyWYgj24vx 3VGCNtrePtBmaWl9jirmOEj37N2+p3H5XnHyhPqo1alZLfOT16aUc/dBXXBnxFtRB5/q Mmv+oIJZnTviEVxDktguQvlXgbGTDpHjuEm/cE2sJdDrVhnQpbJl54R3CxEDZrgrXt5W Hg== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 37u3er8stk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:29 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIThCS176756; Sat, 10 Apr 2021 18:40:28 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by aserp3020.oracle.com with ESMTP id 37u3u1q4cu-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K83MP8iO6qpTX1OX5hj5HhL9ia5OV66toLHMInM3xMH2lasG3/IBcmxHI6Da1FH1ddS35Ea1tN6/9dDW5EL2Fhnb/oeU0KmTgnQQeJB1Il8lRQ4IgbnlnUMXpv89PBSPl2K9gIJuvQj82zGcmGvS7GqrjU25Ty/vLU6rjZh+4+kTK6eZHKnmtoVuIxWwCxu3cFX9Qe55E2wWPtKSL/g8dh4jjXrZpJdTxpfoRr4gDSnsHkrmUDvTdnU6ru9t7s3gSaJr9aB9zPlSgPEOUcMYxZI33KwP5zCE/qVCa8ZH9CVteu0ukZunvE6EnKuPmLQ41WQq6KiMpBYI2rzKFa5E3g== 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-SenderADCheck; bh=v1jLrcZyeDZK/Caaq8C1jQgHu7GV9NQ5XyRZwNBf6i4=; b=RzsRlPcDBhg65dAqULyvqOkdq06f2T1TENoKloxRlzzg5oK8v/O/WsOtUFDjJb+kZ3+zkfdw++Wggfyc5lqepKvbF6UWVGejN/fPEVYLvNHXK0WhaSY3oCWCYeIwDCYpm4KdmuUiodjvjNCLshuRZHR4jbC06L2LRZB/hXUzwXYunBGO292TaQ/y/wBwiCZkA7OhfeGvmzCwZNYAyEQG1JwchdjeIgrjWYl2+1aD9cuOj45q1SB4H4Na6xaUCugEk7Rb3sahIlk3N27N3haJ5MMlpu2whUrg++OF0TT1wx0L/l8IDPTqr4CY5+/9vtz9sBheh5/NmlG2WIbJ6Zlx9A== 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=v1jLrcZyeDZK/Caaq8C1jQgHu7GV9NQ5XyRZwNBf6i4=; b=xzuBQrvEfwAnrCzl9YnAibj7BwKfU150Zn5OcQW9HlY8811/X+wEK27kTCFK+XfbWQO2RbLFOMUGiH/QyKCRcVdITAWN0phG73oq8dLpc/S9w5azZrp4fTrONT1v2WgZkJ/DhGMuLZbLbKs6ZsJqLAVEr1bKbLBPZahi5E+Wn68= Authentication-Results: suse.com; dkim=none (message not signed) header.d=none; suse.com; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4324.namprd10.prod.outlook.com (2603:10b6:a03:205::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Sat, 10 Apr 2021 18:40:27 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4%7]) with mapi id 15.20.4020.018; Sat, 10 Apr 2021 18:40:27 +0000 From: Mike Christie To: lduncan@suse.com, martin.petersen@oracle.com, mrangankar@marvell.com, svernekar@marvell.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 02/13] scsi: qedi: fix null ref during abort handling Date: Sat, 10 Apr 2021 13:40:05 -0500 Message-Id: <20210410184016.21603-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410184016.21603-1-michael.christie@oracle.com> References: <20210410184016.21603-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Sat, 10 Apr 2021 18:40:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 71c32172-cbd9-416c-a18f-08d8fc501c06 X-MS-TrafficTypeDiagnostic: BY5PR10MB4324: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P5DYMh7kzCaAfK/Ntj2IlvgX8rHdn9gkIOtdI+v+miABiBGBgZ+ob6IdkLSMceESruWn3H7zdXr36B3Q/suFtK6yhBQYWlSkUO56wOLTUdhUV7RFmwhXFEy0VYMpTwioRbWb6DWlmFReok3qbs3qbDj6Numnqe20kN8VKLAnSzEFJhmjiT4hYkC1nudhQXsIVhb49N06TKk7Qv22eB8HTsDJUiwaNpU0uUG5+0VmlH7nJbFF37rsriAL+9UQt3jSTUvs/tQXwLplmk+FtJ9u/oGKKVW6QEDZef39B62yRskxMMRBnn37hcFKtSjRr6rPesV04Vi8lw7LRLhKZIls0t/iz7+2Qmpko+f6wLeg0v0HaekIriS576AkWxFn0+7THcoKlDaE/kGc+hTRiaqjGT4c69g0CIZb8RD1uFO+5FpybsWHTAn7bIkEFMpiSuVxntsSixjMS1DQ5tl6SwSeqDzC6w84JqUKZen9y04CgYI+yRXxE27/jrndJzqfDaZ0XNPQh+Mxg4J5fvqfqpSvcMyoCEU97wNcJ8wlvJcwHGMGdHcptlKUeB/e1zHJ0s2mdfOACulbzq3fNFI32hwAO5/BVyYNdKpvzBpr2epTqtzqdXXStjsX7JYR18lECXjux9hUSkAKuxCGZP24Is59tkxjiAGoABmtio90LONgcqcRyl0s0fKSRKUeIJJ7Y/P5 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(376002)(366004)(346002)(136003)(66946007)(66556008)(66476007)(69590400012)(6486002)(83380400001)(2616005)(8676002)(8936002)(16526019)(186003)(956004)(38100700002)(38350700002)(316002)(6512007)(1076003)(478600001)(52116002)(107886003)(4744005)(26005)(4326008)(6666004)(86362001)(6506007)(5660300002)(36756003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3ZmL22l3VJWuvJxOwmfSq/Ie0V1txUVZzLE4fsrAybp/UbVzyPeE+3qT23VfW+zPiXrl2ukJg/2i9HzL6ytQGihE1B/uxutB+VPH1sRrIecPchzL2iipYOaxVfafjHikNQgr9erzpqJCuonAfo1IqUDUzRr4e5sBn2h1VlAt1fMiBZDKRbvim24W3l7UTlTcWx7RPPF7ghEzfeAeOfIRFB/NBYKDoQAcESNFxGXZcJBKXAsrVdg6AKZFlLrsC1Q22u4/6zumnqo3qMex4Bc4Iqh/KznabKgUUQlw3GwiXATWpvW2PFR3KSiGdqC8RGcH+7pf5RKTbIuxewsAdR3EsRdMYJBfHqTvlhFLrYTeYm9wbzhUbE7HMBPSUoq+cdyInOktotLyPiCiJRlzSmqZqpidnhMnONXF3WKXcqXUvvI4OgIeHagjNj7Xd8asKtY1U1afnF4y7xLvJZrKOet2KEx+RaoQudpRVTfqbLiy+xMaqH0M8Xsb+T7rPTovDlGwXhaz/fGe5bHWfzRpZCtfSvkTN5iqnCOWnRDkgXvuxAUkRcW80ELIspb2vque10vnbuN8jpGAolnFOjqmIFm7vwIliXuzz5qLeWuBBvvQGddu5et+J4FrGfGxZ9ZuOZH0jLezbQyKOOx7MZM65VCyEJFcLFwM1DTlIzOnulf5hKsY97py/TvTOfhnLFR2ChTQOABCgo/PR4GfUC75cSBMZItzLmodLddwWVjPsY6suiVXIu31+O5jU1+VrdS9KRn5rNbbX0e02+PJ6JUKmwwNuS3cUC3kD3cbNMxipguNk7HMDebQ/oVwnOiLGWBNFgFDHjRKmit1bylCgcklvHvktsvFgoFCppP7JWrW2iX2APMJCaCiTNMLxYjijTuJpL6hfYfzaAzB1UR9p1v4I5NC8OmHKCfukhCGP6soen2Q3CeXv7GfEij10OQEifUTAEVL9vf1tM6gKhGoOwtcdMeTABL6pnQpEvVuLPpjAkhaNia3KP+OUKulVKALEZwwRtBo4JVpuTD2qXKYwiOpi047S0kW/8a1h/5Or2pGkZh768v7TmlpvkG8RNTcrbSG2sTc2rKRbJEaOsp4knWOLJRcW6GNJyLdZLiN4e/pHK6iVsdaZhnOjlMTvOxG6+ZQ898TuQcmgSxZPq7+SIzAdRYDAX8cfEfOD2Lmkp4jFu0giUjL5zPwnSTw44zPbSJqDqqmvWqnk0b0paQY+lyfHS4vwSfjRq39TK2G5wKWqO6mFhxMnqW/IZWT8fjxAWGxQmZNUTDd3OLurhobdgK/B7yp6JmE28jA7jp8ncxxCaoMlUcdrUY2P3fI+cBSo4L8iuIZ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71c32172-cbd9-416c-a18f-08d8fc501c06 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2021 18:40:27.2643 (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: fH7qumOeA1CO1viw6/S4cdqGonhFYjbwdT/H1zvQR0ksJZZ4MxfNNJV797hQqzb3FxyvHPj0EWx05/tRuz8rJfx/lImyVHsypvAxFAWpJF8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4324 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 X-Proofpoint-ORIG-GUID: FT6npkWuq5n70-o4TncaXYZdzZp0G9tP X-Proofpoint-GUID: FT6npkWuq5n70-o4TncaXYZdzZp0G9tP X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If qedi_process_cmd_cleanup_resp finds the cmd it frees the work and sets list_tmf_work to NULL, so qedi_tmf_work should check if list_tmf_work is non-NULL when it wants to force cleanup. Signed-off-by: Mike Christie Reviewed-by: Manish Rangankar --- drivers/scsi/qedi/qedi_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c index 440ddd2309f1..cf57b4e49700 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -1453,7 +1453,7 @@ static void qedi_tmf_work(struct work_struct *work) ldel_exit: spin_lock_bh(&qedi_conn->tmf_work_lock); - if (!qedi_cmd->list_tmf_work) { + if (qedi_cmd->list_tmf_work) { list_del_init(&list_work->list); qedi_cmd->list_tmf_work = NULL; kfree(list_work); From patchwork Sat Apr 10 18:40:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 419084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF402C433ED for ; Sat, 10 Apr 2021 18:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 990F860FED for ; Sat, 10 Apr 2021 18:40:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234969AbhDJSlH (ORCPT ); Sat, 10 Apr 2021 14:41:07 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:41986 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234911AbhDJSlE (ORCPT ); Sat, 10 Apr 2021 14:41:04 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIY0TA007849; Sat, 10 Apr 2021 18:40: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-2020-01-29; bh=qGYOd4dDWIfBfGK7m5i1lx1pmsIPaW+4NzfN408mE0A=; b=GOUX6ajXVCug5Sryh3Az5tIQD5FAj69wyT/dPlw64NuM5KtCFaT26fWIS2s/UAn0K3Fr Ui1mWs2KBOSWG96u2khwvZlb/QvAVPIh8Ckf16Q75QPL75yh88xXxlie6xwFt1wCgybT H5Xws8bF3djrEi1kwP51in5XumI3W3pSRpwtlz3hRe+07JLJLNf/Nl1aKe69Qp3AefHk 5yzfPCXeu6ZZSnj1vPTfG66cLDwFLAG7XQTIhiU7H6hIQs7dMJK9zHjgZH52MFWTR7lk eAMwyRgS9tfqncIiX0kM0ohnLW4WwNQqGXu/F1rqoakNgSfTrmxEBU0zyur0wj/7VlmF OA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 37u4nn8r85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:34 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIThia176766; Sat, 10 Apr 2021 18:40:33 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2106.outbound.protection.outlook.com [104.47.70.106]) by aserp3020.oracle.com with ESMTP id 37u3u1q4dr-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DOEn9kQ//AhmavZTZfBmoao166kgvqnR7QOYxmD1WykinpjGzdeqL3Twf/aGtPZIiHflQ1JNN10yoK+jHhbafVBfa/2ScBosWY4gmJhnETg1xM/9Am0giqh+3SXqwqUhAGjfxw2Ym72HcBVy+vnRNFvjdXCJ1bSGWc4VCgFx5PqWJxdZ5Z4BkBMj3vohGEKehUWIm5DFwKa5IlTCH3RZwm2mSXAH/3+MI6pUYkM/P5Rjiwc2BpOTsZ+kf0US7TX6Uby6yE1PMsL0wSq+U92lRk15ZJyenGtmwYu9r/Bl+PZ9jWuHpEI7MEz9/Lc9g8GsppxZnfm0Qv+6iRoVrvzMSA== 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-SenderADCheck; bh=qGYOd4dDWIfBfGK7m5i1lx1pmsIPaW+4NzfN408mE0A=; b=Rln2VQR4pG4qAF5+EoLO+Nom+15PS8KddtOK9liYThfVAriRR7QwV7CPb3rFjIoxs3WH403dmANmURWBPeKh30emGAdwkXEyPn/krr3pNj9lbdjHmFFJI/8KPUpQ9a3vxn7/y0VuIIADjdgJZkAwUltlQC6OTtu4nY/XRz/RSEkb8rfnCxEbk3CReMiw/yEeR5FMeYx8+oOQGtQSJdOshC08oSHK5BhzUQd+0fo9g97j+IMjFyRZ/alqXoqHaBANnqYbEpamx+wfQh3Xv2/Pmb9zRcliWz90VWHlQaXlure6HnabwvFB6jHAqg/8xjSXTBY4bgmJg/6L3a1S9z5JgA== 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=qGYOd4dDWIfBfGK7m5i1lx1pmsIPaW+4NzfN408mE0A=; b=lzUvpVCoIYvALUgOzn09ZQjNP3sz3PnFPem9D13eh3F2NpbxN/cRwgSqhD+s0TSznEr23yyXgBH0/96uM8SJhQfiX0mt4PVX2bb3nSFRQ3d0WACaCFJ4qM/SVv6jVeeIQFPMYmhAw3+O+b0z8cg8yN9eh2eif5cVQoxr1KxxUbA= Authentication-Results: suse.com; dkim=none (message not signed) header.d=none; suse.com; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4324.namprd10.prod.outlook.com (2603:10b6:a03:205::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Sat, 10 Apr 2021 18:40:32 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4%7]) with mapi id 15.20.4020.018; Sat, 10 Apr 2021 18:40:32 +0000 From: Mike Christie To: lduncan@suse.com, martin.petersen@oracle.com, mrangankar@marvell.com, svernekar@marvell.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 06/13] scsi: qedi: fix tmf tid allocation Date: Sat, 10 Apr 2021 13:40:09 -0500 Message-Id: <20210410184016.21603-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410184016.21603-1-michael.christie@oracle.com> References: <20210410184016.21603-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Sat, 10 Apr 2021 18:40:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 466ab399-18de-4fdd-2d96-08d8fc501ef4 X-MS-TrafficTypeDiagnostic: BY5PR10MB4324: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YlaND1PeWSlXB52xlbh5HpHxKJurT6EVM56PfynI9p68ZuZP7zwbvaff6LA+dWEBqWJahkuU8xkhtsMKvd6effn7Y+hk884ie85zZYC8lehT78Rl5FaZWJMaiOSf5IuOYF3g4dkmnwrKUlmg6EvtV0csRTJiQfnBVwk9wF8zq93DlZH51ZqKjXD/5yM+GYKIx9uHqdO+cny7tS2+i2umTldYXWVWZ+laCt329UYQdVU2/wZ5xe4XiAgYOl9MtlnAuokR6yiGyi8N91h5Dxls+UxduJk/ra718SO/yT1XaXRj3SrzojNDFwoHLj72pBZo+BomqXlPMJCo1ld2VzS0lOzQfSWzuYXbnfttBo4b/7VAidaYBMrlm05wSF7dgmVwT+PIvAZvmuwbjZpljkzySWlaMBoTyq/dyb81/mnQq2iqMfjp1HYimxejNXf8YJkgqAYHv41y9AK4bA5BisWIMkVgDV3go7oKSWmmCvdLSdtr9OxUkVqQfyEuRLbQlC2RuO2uYPfBUPaUTyGLWhATpHvHU/dbHAV2iVIgBwIJ52N5ch5/sR4CLtkZmou0rtmX5BJE1+fxWzKjV/JBsGPSQ0iiHrax02skzKUDkK9NZwRyxten/01OsL2qUokvdgVLeZRZpVO/mCT18PoYXSFNLeNZ/o4TW3FFsb/XnrHVyXLXH4D/ODcBtreAHZeWi4Bl X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(376002)(366004)(346002)(136003)(66946007)(66556008)(66476007)(69590400012)(6486002)(83380400001)(2616005)(8676002)(8936002)(16526019)(186003)(956004)(38100700002)(38350700002)(316002)(6512007)(1076003)(478600001)(52116002)(107886003)(26005)(4326008)(6666004)(86362001)(6506007)(5660300002)(36756003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: rBamCyle9wbcZuHdVu2NFenElgzYuckxTMIzeXOhCmlobHB7Hl1dvrdsNNPHr4MHkldHUhi0phcnTWzEnfXOy5hgEWSN7O0iLirij74Rznt7K2C2e6wFb99BNhNgNoVqVeqPyBQhPRLBC0fmfUIHN8r2NCOKOB5ZB2Qg8+2BXHmY9jgzdCN9QZI4WeABp8UYxv4YPHDVaQM7ZfcqUlLKDkYrBYzCScWhs2gEJc8fUo4cgO7wdPWem3ttez9mz0c+AANfkE6eInChI6lnzBAowByCigHEzDOCcsifMZZ5wjo4Are+h58CleHcpUCUkvpWnpDKKU9URyf5OQpJrQGedEU0wjwnO4rjWRyJLOJrxjis4QCZRfKzfIAVx4FIU8K9RMaQul2BkxIEq7EbRuJR+Np6P7ZaVo3xG8DAA7Laj0DC3bnV6weEvgXNJlmSCaUj/9cZ5NeA+YUp9rjYKeCS57wNMOaL+ddTyu0Fyh+ZMH+lj2nxp/nle9trxjeb06wk76hOPQ5bMU2HYfgmS/rgDN1tFERjipCMYpiIR1p+RGsovVjCbUr/jWm64jbyx1sWdlqaUPf29aSKrYQNIJS6oFLnMb1VULN+LqQVxYO2upjN3EhXuqxWb7dcwnySFnaJUnYm8aweqKGBIkRbZbhWCy7miWbI4/gtQGfOSY94T4bYFRs4WcN2mR/oEwoZPezFL2KgdQZQYa/7il8YC1M5WGMee7mbyjAcgu+Ot8y+ZeIHzB/MJAUJ8+XQrf81tquW2gicdvzipC6u0RCk7JOw3Tu3TAbrf1D6yL9Z0duygOKTFid2bVKAzsNND6kLyM3tLzAkb3NXY4yGHL9yuc+bVo2aoBYSp1E3FWKo+XEvj1FE544C3MOz/wIB0T/JhFL7Gkn2fIBrN0mvTCZZPwO5pM52GeaFbQay8tp8gSfiF+rjy96MbdvY+VjXrn/nI3BmWTllyJGJ81/Ufu08/xChn/xG361g+MWv8P/JF6uHC1jD2OLZVO9PHqNzE1HZ2RLSrexYsb4zY3DIP1Wwgdxt6GBVQEWr0EhQDPTDBQaBM10QeFziLn29k8lWj7snYzTaKQyvUn3YdpwRBB0ZhP+N0SPyLaqGhgFtzfNwvTqKT6zSa7GXEaT+nK6q+qoaJsDwAVvARpFbjhFEPtpf0CjMLmB4TPyk5bss+GiA90R0THvDm5NkvZYIDv0kS0GLY+ZVLxJHqi2rqqYCXocEU139+ouWXEgS3Sdt0u3EXkxnnxUa8z7CZ8XhMxDow9kqYaW5ww+MZ5biLuvt6RYHmJM7BUPYI+2VDkNgN7kDpMDx3Wd11vFnoc3RTm88rShXysbA X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 466ab399-18de-4fdd-2d96-08d8fc501ef4 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2021 18:40:32.1716 (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: 9LVRK4RVhVYTDTgjkvVBVcg734cl9UZEqgK3x8zubRGyoiTUAieFfitiChgoGafh9dptBi8a36cZrqufpBdO7wGZXV9TyI5caawOlswXaZQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4324 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 X-Proofpoint-ORIG-GUID: 2kTWpnsd4INXBzftpnHUNK_oYVWLrLkt X-Proofpoint-GUID: 2kTWpnsd4INXBzftpnHUNK_oYVWLrLkt X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 lowpriorityscore=0 spamscore=0 impostorscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org qedi_iscsi_abort_work and qedi_tmf_work allocates a tid then calls qedi_send_iscsi_tmf which also allcoates a tid. This removes the tid allocation from the callers. Signed-off-by: Mike Christie Reviewed-by: Manish Rangankar --- drivers/scsi/qedi/qedi_fw.c | 76 ++++++++++------------------------ drivers/scsi/qedi/qedi_gbl.h | 3 +- drivers/scsi/qedi/qedi_iscsi.c | 2 +- 3 files changed, 25 insertions(+), 56 deletions(-) diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c index c5699421ec37..542255c94d96 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -14,8 +14,8 @@ #include "qedi_fw_iscsi.h" #include "qedi_fw_scsi.h" -static int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, - struct iscsi_task *mtask); +static int send_iscsi_tmf(struct qedi_conn *qedi_conn, + struct iscsi_task *mtask); void qedi_iscsi_unmap_sg_list(struct qedi_cmd *cmd) { @@ -1350,7 +1350,7 @@ static int qedi_wait_for_cleanup_request(struct qedi_ctx *qedi, return 0; } -static void qedi_tmf_work(struct work_struct *work) +static void qedi_abort_work(struct work_struct *work) { struct qedi_cmd *qedi_cmd = container_of(work, struct qedi_cmd, tmf_work); @@ -1363,7 +1363,6 @@ static void qedi_tmf_work(struct work_struct *work) struct iscsi_task *ctask; struct iscsi_tm *tmf_hdr; s16 rval = 0; - s16 tid = 0; mtask = qedi_cmd->task; tmf_hdr = (struct iscsi_tm *)mtask->hdr; @@ -1404,6 +1403,7 @@ static void qedi_tmf_work(struct work_struct *work) } qedi_cmd->type = TYPEIO; + qedi_cmd->state = CLEANUP_WAIT; list_work->qedi_cmd = qedi_cmd; list_work->rtid = cmd->task_id; list_work->state = QEDI_WORK_SCHEDULED; @@ -1430,15 +1430,7 @@ static void qedi_tmf_work(struct work_struct *work) goto ldel_exit; } - tid = qedi_get_task_idx(qedi); - if (tid == -1) { - QEDI_ERR(&qedi->dbg_ctx, "Invalid tid, cid=0x%x\n", - qedi_conn->iscsi_conn_id); - goto ldel_exit; - } - - qedi_cmd->task_id = tid; - qedi_send_iscsi_tmf(qedi_conn, qedi_cmd->task); + send_iscsi_tmf(qedi_conn, qedi_cmd->task); put_task: iscsi_put_task(ctask); @@ -1468,8 +1460,7 @@ static void qedi_tmf_work(struct work_struct *work) clear_bit(QEDI_CONN_FW_CLEANUP, &qedi_conn->flags); } -static int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, - struct iscsi_task *mtask) +static int send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask) { struct iscsi_tmf_request_hdr tmf_pdu_header; struct iscsi_task_params task_params; @@ -1484,7 +1475,6 @@ static int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, u32 scsi_lun[2]; s16 tid = 0; u16 sq_idx = 0; - int rval = 0; tmf_hdr = (struct iscsi_tm *)mtask->hdr; qedi_cmd = (struct qedi_cmd *)mtask->dd_data; @@ -1548,10 +1538,7 @@ static int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, task_params.sqe = &ep->sq[sq_idx]; memset(task_params.sqe, 0, sizeof(struct iscsi_wqe)); - rval = init_initiator_tmf_request_task(&task_params, - &tmf_pdu_header); - if (rval) - return -1; + init_initiator_tmf_request_task(&task_params, &tmf_pdu_header); spin_lock(&qedi_conn->list_lock); list_add_tail(&qedi_cmd->io_cmd, &qedi_conn->active_cmd_list); @@ -1563,47 +1550,30 @@ static int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, return 0; } -int qedi_iscsi_abort_work(struct qedi_conn *qedi_conn, - struct iscsi_task *mtask) +int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask) { + struct iscsi_tm *tmf_hdr = (struct iscsi_tm *)mtask->hdr; + struct qedi_cmd *qedi_cmd = mtask->dd_data; struct qedi_ctx *qedi = qedi_conn->qedi; - struct iscsi_tm *tmf_hdr; - struct qedi_cmd *qedi_cmd = (struct qedi_cmd *)mtask->dd_data; - s16 tid = 0; + int rc = 0; - tmf_hdr = (struct iscsi_tm *)mtask->hdr; - qedi_cmd->task = mtask; - - /* If abort task then schedule the work and return */ - if ((tmf_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) == - ISCSI_TM_FUNC_ABORT_TASK) { - qedi_cmd->state = CLEANUP_WAIT; - INIT_WORK(&qedi_cmd->tmf_work, qedi_tmf_work); + switch (tmf_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) { + case ISCSI_TM_FUNC_ABORT_TASK: + INIT_WORK(&qedi_cmd->tmf_work, qedi_abort_work); queue_work(qedi->tmf_thread, &qedi_cmd->tmf_work); - - } else if (((tmf_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) == - ISCSI_TM_FUNC_LOGICAL_UNIT_RESET) || - ((tmf_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) == - ISCSI_TM_FUNC_TARGET_WARM_RESET) || - ((tmf_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) == - ISCSI_TM_FUNC_TARGET_COLD_RESET)) { - tid = qedi_get_task_idx(qedi); - if (tid == -1) { - QEDI_ERR(&qedi->dbg_ctx, "Invalid tid, cid=0x%x\n", - qedi_conn->iscsi_conn_id); - return -1; - } - qedi_cmd->task_id = tid; - - qedi_send_iscsi_tmf(qedi_conn, qedi_cmd->task); - - } else { + break; + case ISCSI_TM_FUNC_LOGICAL_UNIT_RESET: + case ISCSI_TM_FUNC_TARGET_WARM_RESET: + case ISCSI_TM_FUNC_TARGET_COLD_RESET: + rc = send_iscsi_tmf(qedi_conn, mtask); + break; + default: QEDI_ERR(&qedi->dbg_ctx, "Invalid tmf, cid=0x%x\n", qedi_conn->iscsi_conn_id); - return -1; + return -EINVAL; } - return 0; + return rc; } int qedi_send_iscsi_text(struct qedi_conn *qedi_conn, diff --git a/drivers/scsi/qedi/qedi_gbl.h b/drivers/scsi/qedi/qedi_gbl.h index 116645c08c71..fb44a282613e 100644 --- a/drivers/scsi/qedi/qedi_gbl.h +++ b/drivers/scsi/qedi/qedi_gbl.h @@ -31,8 +31,7 @@ int qedi_send_iscsi_login(struct qedi_conn *qedi_conn, struct iscsi_task *task); int qedi_send_iscsi_logout(struct qedi_conn *qedi_conn, struct iscsi_task *task); -int qedi_iscsi_abort_work(struct qedi_conn *qedi_conn, - struct iscsi_task *mtask); +int qedi_send_iscsi_tmf(struct qedi_conn *qedi_conn, struct iscsi_task *mtask); int qedi_send_iscsi_text(struct qedi_conn *qedi_conn, struct iscsi_task *task); int qedi_send_iscsi_nopout(struct qedi_conn *qedi_conn, diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c index d1da34a938da..821225f9beb0 100644 --- a/drivers/scsi/qedi/qedi_iscsi.c +++ b/drivers/scsi/qedi/qedi_iscsi.c @@ -742,7 +742,7 @@ static int qedi_iscsi_send_generic_request(struct iscsi_task *task) rc = qedi_send_iscsi_logout(qedi_conn, task); break; case ISCSI_OP_SCSI_TMFUNC: - rc = qedi_iscsi_abort_work(qedi_conn, task); + rc = qedi_send_iscsi_tmf(qedi_conn, task); break; case ISCSI_OP_TEXT: rc = qedi_send_iscsi_text(qedi_conn, task); From patchwork Sat Apr 10 18:40:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 419083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30755C433B4 for ; Sat, 10 Apr 2021 18:41:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 068BA610A6 for ; Sat, 10 Apr 2021 18:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234956AbhDJSlP (ORCPT ); Sat, 10 Apr 2021 14:41:15 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:47632 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234963AbhDJSlH (ORCPT ); Sat, 10 Apr 2021 14:41:07 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIWvmr062886; Sat, 10 Apr 2021 18:40:36 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-2020-01-29; bh=ISn7D1tnp+l+n9AyUewEqsxwOqlBE2LpAyd/Vn0A4mQ=; b=fIPFeDXqr0BDkpYoVA8lMD5NISKrvmuXB+Pp4MWT4DUDBBPrLHmF+Ozwo2yxxSg8c7HH 06OfoojdwRyZG+JHBg/55ZNCLrka+PlgpHpc4x/fFZZBw+G9yigIZchKV9Mfr1099+6P z47IJpgAlEaWnhQHMdvPbjst2kZUd15o4+qGAOvj9+/clLXotZSC7xNsHu9kuHcRdytN m2jokInI8rY5NJHjuCF4ZbbjGzNeTgWkc6Fc1XpkKefVo/0LjttiwekW0aQnYNv9fsaL i2s9oxrBU6jYkk9mQll1mymQ4fJzr5upSXwwOvGDRqglJVPKHFWo4Ar/OIP0OnYdOdQG Zw== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 37u3er8stp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:36 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIThid176766; Sat, 10 Apr 2021 18:40:35 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2106.outbound.protection.outlook.com [104.47.70.106]) by aserp3020.oracle.com with ESMTP id 37u3u1q4dr-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=am0rXoSPyPSLsGx0cDxM4PXuiLwP9YE/5/HKpBxivKULbQhQTdoRyiTBsaGrlv+CjIAyM2XJIuj8yvYibvfpsmU0F9kM21lniP88BTTpCnQlKc0uXNWD724RW8VV8jGE4pgyDzMYtMVGYhLTlQEdj8Hx5hBDFGNXIjGz9L+kDyaPehcIrBy0aXGnW4+lai3nys/mdmxC9rtkQE3wgxg/7y/xcUolQ5mP7zoGaYpwtUIj7bFTbkjg3jJAvYlDsPu3Z56wTTtAB8D3lcFx0Re4f5HKkpK9AlvZw3If1OqkiNEl4MTFhiYx2JgpScnrj6XKr2q4VgSXD6RJXKPG3xm++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-SenderADCheck; bh=ISn7D1tnp+l+n9AyUewEqsxwOqlBE2LpAyd/Vn0A4mQ=; b=aBoyw5EpbWngGgGxnh/miSYJ13oQBASIL5iNZXDhUnwPayUBabWLpolLgxmvTsd8X5HkL0BJ2RGNpOwAG6arN8sBmls3UVOcZGww3Ptd88t/pk4SSEbwzAdC6/DLYpBOA8zl+gx+lSbcW1XOAQULrSh/CiwASdO424caCNhfMde8YacIz304MCWqIwWlAFUKugJFuUCPEr6TqgWhcZUAtXdI1r1/K01HSqcZwgOcqwCmoSwgq1kvjyqFxPS49weTn4IsFT5y9LVjFy4EsQtXoJnhuRdnKLs3mhnJTj29d3bmz3jb+r8gRb3Fcz9e35BkHt8o54U15Qk0HDlxx5fAHw== 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=ISn7D1tnp+l+n9AyUewEqsxwOqlBE2LpAyd/Vn0A4mQ=; b=goXffA8HRKkywNMuU+780/J49ygYFPW/oilsvs8IS5eGzfkjz/iYWHsQ05dVu8xG4FKh6Q/dpQtt/RD4UcbT5ufm9u/zr4yXCbF8GPNkOW3X6k/jDuXKsCzKinGZj26VfhbJ7kaXDMFz34fTGcr2ESjC1s+jpqbjz7iNKLj59Hg= Authentication-Results: suse.com; dkim=none (message not signed) header.d=none; suse.com; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4324.namprd10.prod.outlook.com (2603:10b6:a03:205::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Sat, 10 Apr 2021 18:40:34 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4%7]) with mapi id 15.20.4020.018; Sat, 10 Apr 2021 18:40:34 +0000 From: Mike Christie To: lduncan@suse.com, martin.petersen@oracle.com, mrangankar@marvell.com, svernekar@marvell.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 08/13] scsi: iscsi: fix lun/target reset cmd cleanup handling Date: Sat, 10 Apr 2021 13:40:11 -0500 Message-Id: <20210410184016.21603-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410184016.21603-1-michael.christie@oracle.com> References: <20210410184016.21603-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Sat, 10 Apr 2021 18:40:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b14394cb-a264-4ffa-859b-08d8fc502021 X-MS-TrafficTypeDiagnostic: BY5PR10MB4324: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uSnv9b9TlQcR6ffe1sIzJD4J2fz4QHj60I+9YcDbLuGsXgE4yO8OSQWtcFwBZ2JLQWAdWpj14Nyk7VdjAlWs7j5lYen9RKlD9MzQdH/aPiQcSpoJIPZ4qFMnyWG6gAYbpYVwvsC7PReVWPgF/YGf6ryHN7X4TJNpmRtLRKmEYrNoJefu4apdbN0OeUj3JP0AfioSpKq8aX267N2EAYF0Yiyz1GV6T26/bYdUE/l3u8JHRGj6o+t511Lq6gW7t0b0f2ywy6jBuyqUx3qxfgDfqmkHY6o8qFQDFRZpdd62ssI37DeJpcN6db4YE1kRwbpCaYoOmsuEyDMPVzj15r52VFKetQBkyxzTkDBybjzmG8kmfsoKOh94f3+hGSLAtEgj5OKEIYo8I8IaJFt5Vqvou/f6gOV/k/LWX2apQxgaCK8H4+p7yHpUgO/eRZm/cEJ2gkrH+j3Zp0fC7YjiqUPVleOanAcxsf6ioqJ18nBwYj0a/QdnOVh6lFZoc7SQLLwu3MI0gLcEEiZvt2BYBkZuhgYYS2snnQC2cTnhXogIHXdlOaUHd1vRwsi/2oG8NV7qiH/spwJua5SyaSpNvyKRKxPMipKc6G6rGshVOOUaMLKLdMTP4rGNVIsI7fWqtsw0DQoRpJT4PWjiw1hHhB95gWEpTlfy6dYqBlJs2jjZL8LF2W0iYOWGjUx70KaQfalb X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(376002)(366004)(346002)(136003)(66946007)(66556008)(66476007)(69590400012)(6486002)(83380400001)(2616005)(8676002)(8936002)(16526019)(186003)(956004)(38100700002)(38350700002)(316002)(6512007)(1076003)(478600001)(52116002)(107886003)(26005)(4326008)(6666004)(86362001)(6506007)(5660300002)(36756003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: IUHuhZbFUQC2RtoRbpk2s0988QECdL4WW0R4MnEygxmudjRM2h7OZN13ZTrZ0NI0fCRbZz47C+WuoH6kcCImNvj+9hpREesHyjh+Vx5nsV1WulR5ZUh3Rr9AXi5vip7wRjPyDExhT6YMycwOqX5iP2FWPuY1Pl3akYTxT2Tc0YUY/iHmrIdjtDz7Wb4cMYbDQ2OzRkiWpBuqRj5BZGnrsRyxG3izQbyDdM4i3+gYeVQ/ltBM3A8GNCMMTMmtSbL5csBXQpjrxINFkix8pzwhc1EVAiQdQoxJdOxU0hd15rvVjXWRp+VW1zVfMnln4lnCLzvZ8izAOg9pNIr+P80B+tqNiuwQBB3oEMUtF5gFoobeElDvyzpWeptQPeyxfr0Qbp7+4yB6JrfWdpsSvIfetJjJLaeV2/1imWTmkXnCYRKMCbqFkDM6XYSZLIdeDIDnRmyBHWHX/kEQsRfpyzM/X2LiQ53zl51pe5hG+pSrbySf9EE2sLMjFtzOpfmgnjogjtTsWGZ9KpQBmKGFWfk+FodCLC+NmJbo9x28KieLfz2/SYzTFkc2I+L7QZWJ2CkbBqCivdHdcvcXSxNrN3QfPAt0OlwOgGGFfWUbX9e7ilUqneRj3o0dF70WCcCxnNeNqjBfla2uFXb7TiXHjDjX3g5IjyAxdjpA0D1JIQJ8V61CnDsWBFjAZffHe7a8uDKdTpi5L63XYHPviN5HkO3IOovVLG5MCk/bJ5Fb0XEawz/THFw2liaSEGe02J3ecQSCjY7USPXSBhzy35Fe3tnUJ8HKwnOA64/wf3T2V67GI7tJoq+4CwQDbU4Ubydohdk78Yskbqk5w6ujtLAd91LXpY/juf4HtmL5i+2doKDqN82c+l4obartSMmloZdtyiKxVoJgU9NKnVGP11hthiAH58rRi651yH5LXSIkPUAhKavD+sT/uv1Ve+V9++SZtiPPLSQPywF1MoHWCJsYeI8PYmY9UYzkojraA8kseoEBrTxXDTNvBhezMQSCWCyRY+LGq0kVXTyzK2c+GfHy5W1P+Oa66UX1I8D/c+qgirut3JuXruhkQhTvZx67Z3DtrWuaKIEOGuvey72ikwpBbEPrLXR37z9AilE4B7XJXRNKWwc07pcTKZ+ipV6VPARZLCKzUgmMMCgcRulOmasoMYKQApn3AtFfBqViCk0uexmh43hD2gTWclblF7MHDzORN76PzTWeKV7u5OyaUtryZyL9f0rUdBG6ZXn7nGE9DUsWkVbH2gn4QYl9/f5OHn/Rk7uCEESNRfJ2GoYh6ZTRDAuDPygibPcFGRbZZK+DCdlUY3yfbv8z+za6wszt1ZQyVu1Z X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b14394cb-a264-4ffa-859b-08d8fc502021 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2021 18:40:34.1295 (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: 2Hy2L3shB20mqIjlOcvW/ePoHGFlzErik/1tRFNMh08lYxue8R9AzcSY7xK3/VCE2E9yCRatT+0QKcJlA7rH9Sm45AJag9cYCmJ22F9K+6I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4324 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 X-Proofpoint-ORIG-GUID: KMRjVygtAVY6HGbmxtEzsF2JcmfNKImS X-Proofpoint-GUID: KMRjVygtAVY6HGbmxtEzsF2JcmfNKImS X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If we are handling a sg io reset new cmds can be queued to the driver while we are executing the reset. If the TMF completes ok, then when we cleanup the running tasks the driver and libiscsi might disagree on what commands were running, and one layer might cleanup cmds the other didn't. This has us block our queuecommand while we process the reset, so both layers know what cmds are running. Signed-off-by: Mike Christie --- drivers/scsi/libiscsi.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 04633e5157e9..c68afcca51a0 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -1922,12 +1922,11 @@ static void fail_scsi_tasks(struct iscsi_conn *conn, u64 lun, int error) * iscsi_suspend_queue - suspend iscsi_queuecommand * @conn: iscsi conn to stop queueing IO on * - * This grabs the session frwd_lock to make sure no one is in - * xmit_task/queuecommand, and then sets suspend to prevent - * new commands from being queued. This only needs to be called - * by offload drivers that need to sync a path like ep disconnect - * with the iscsi_queuecommand/xmit_task. To start IO again libiscsi - * will call iscsi_start_tx and iscsi_unblock_session when in FFP. + * This grabs the session frwd_lock to make sure no one is in queuecommand, and + * then sets suspend to prevent new commands from being queued. This only needs + * to be called by libiscsi or offload drivers that need to sync a path like + * ep disconnect with the iscsi_queuecommand. To start IO again libiscsi will + * call iscsi_start_tx and/or iscsi_unblock_session when in FFP. */ void iscsi_suspend_queue(struct iscsi_conn *conn) { @@ -2365,6 +2364,13 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc) if (conn->tmf_state != TMF_INITIAL) goto unlock; conn->tmf_state = TMF_QUEUED; + /* + * For sg based ioctls stop IO so we can sync up with the drivers + * on what commands need to be cleaned up. If this function fails + * we can leave suspended since the session will be droppped or + * has already dropped. + */ + set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); hdr = &conn->tmhdr; iscsi_prep_lun_reset_pdu(sc, hdr); @@ -2384,6 +2390,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc) goto done; default: conn->tmf_state = TMF_INITIAL; + iscsi_start_tx(conn); goto unlock; } @@ -2528,6 +2535,13 @@ static int iscsi_eh_target_reset(struct scsi_cmnd *sc) if (conn->tmf_state != TMF_INITIAL) goto unlock; conn->tmf_state = TMF_QUEUED; + /* + * For sg based ioctls stop IO so we can sync up with the drivers + * on what commands need to be cleaned up. If this function fails + * we can leave suspended since the session will be droppped or + * has already dropped. + */ + set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx); hdr = &conn->tmhdr; iscsi_prep_tgt_reset_pdu(sc, hdr); @@ -2547,6 +2561,7 @@ static int iscsi_eh_target_reset(struct scsi_cmnd *sc) goto done; default: conn->tmf_state = TMF_INITIAL; + iscsi_start_tx(conn); goto unlock; } From patchwork Sat Apr 10 18:40:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 419085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25431C433B4 for ; Sat, 10 Apr 2021 18:40:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCAE5610A2 for ; Sat, 10 Apr 2021 18:40:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234961AbhDJSlF (ORCPT ); Sat, 10 Apr 2021 14:41:05 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:47606 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234948AbhDJSlC (ORCPT ); Sat, 10 Apr 2021 14:41:02 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIbv0T065632; Sat, 10 Apr 2021 18:40:36 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-2020-01-29; bh=O0+NfpKK2dCjXmpUhwt4656fIwdjZodhomcBJgH8SaU=; b=qFQNTWlDtXNnRmw5hWZxeoFNnFl+hDXa8uD70xnzATus54r8KWEVJXj17cdPYRKLa/eV Kee4w/Nuh29piRKoIAi5j6VpqTHbhnNHxhjcEifNeT98HKuurjjrl5yZ4p+86SAYIRql FR3Mok4y+5gsuccR8AERWnVrft8wiuvD2s3TWC2/Hfp7cxQjFnDSQIsq6OtxGm9bSMB9 y6jIXcFuIRcOSX1y+5FApUWAwGSDwoFAWugWTKAL93pzT7/U1dc7HtHMJAMpJdFdEXXx BnlclB7p7WS/Q8MqFwUfXuYR1nxa//IBVw96zSAinevC1dHymVv0e9z03GDKquUjvtGz uA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 37u3er8str-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:36 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIThie176766; Sat, 10 Apr 2021 18:40:36 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2106.outbound.protection.outlook.com [104.47.70.106]) by aserp3020.oracle.com with ESMTP id 37u3u1q4dr-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L7EDi5e0AK4b+8+r/0KE08Nd6v/m+s776j+48fiJNF4Y5lwJChq9UdfUxRBBsxzz+7HQKqm+4VfYMm1tpuyjw8wlKMYZiRkiBHoyhv2wQQafkqK4X3eoVYBadG3ero2Z3p2v5uaM6kCVVqYzPnZ92m2JbN1xS8n6dX7UTMuQbv/tA7v4fRxtkRidFUFZh5Z12msrfb1d/irH1HGAITNprlUpUYdt1Lc8YmaTiWaWWR9vNjBDjQ/8G2iYa1t11SOvAqF24dp9YfWe9oGyT7m2/NpLVYCxb2MfYbavHHY0w8LUOiK66jMSIVqt0Iu0N2oJK3EPcioSq1VD3ikFKSjaSw== 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-SenderADCheck; bh=O0+NfpKK2dCjXmpUhwt4656fIwdjZodhomcBJgH8SaU=; b=PnU1Etsp2QQ0nK7VpvZ+9mC5wHf1ej9apqGJ5HFGWbT6bAEwK0Hf27x+YuTVRurtdh+YHuwgSTa3kuP1AJTecj0OrcC+KBcHOEea8NhQ7djQ+4qhCGTEfYdmsm2FRoFOylAN4MjUkQctukW6Ogcyl0uGLD+0Er5KbupSk6tTcAwEDGi8I62Iu8DAiFGZ+c33A5/r6J/Ola9SAD/VlFtU/5ftch30OxOBFEfEEY9lxIvmjgZVPFwrk+G+FZhL58HnJKZZiPgQBoPA0+kLwZhB4Kmcw3KwW62xJcT54qZCLayst3mXc+UXj6rx5gqFmzAeQTg5PqPrU6irua92w23k5w== 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=O0+NfpKK2dCjXmpUhwt4656fIwdjZodhomcBJgH8SaU=; b=QY94EPfN/Oif0RvVo9bTnAapKIjSBVs3WyYbFg49vkEyhQC28AS7AvxKiD+siYwiEA9pRZJRWj/CfnBANhglKvJ71lY20l+fqAl2LszJdyhKERb29+WsG9nKvZScxwY3AGJ0mG92sFeHrBQgVM1P4X+shykTSiWfTLvpLxdt2aI= Authentication-Results: suse.com; dkim=none (message not signed) header.d=none; suse.com; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4324.namprd10.prod.outlook.com (2603:10b6:a03:205::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Sat, 10 Apr 2021 18:40:35 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4%7]) with mapi id 15.20.4020.018; Sat, 10 Apr 2021 18:40:35 +0000 From: Mike Christie To: lduncan@suse.com, martin.petersen@oracle.com, mrangankar@marvell.com, svernekar@marvell.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 09/13] scsi: qedi: fix session block/unblock abuse during tmf handling Date: Sat, 10 Apr 2021 13:40:12 -0500 Message-Id: <20210410184016.21603-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410184016.21603-1-michael.christie@oracle.com> References: <20210410184016.21603-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Sat, 10 Apr 2021 18:40:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5018b7c-387e-462b-ec7a-08d8fc5020b3 X-MS-TrafficTypeDiagnostic: BY5PR10MB4324: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q8eLzU+x4VmFJi6mpaMiXnTQTkqg78xGvLpqFT9XcFuoFvjlCjZxI4BGTNPYldPBbQvpWqY2TCRdVG/kf+EyxtwAAxQPHBs/iqz88zw/MAWYy8S0uwkFrhUxU+aRvPcj2jHZ95mBGNIkmj5Al/UUTrQHOXSEc22YYxzop1GCOUa9mcg6dzitBXcnNJdwYKB1PZQQqJ4eoySkReQzJ22pxex5ekPGfXOE17eIHcARkaPNnD0XTpFfdfGP3gfwhuVkb+alNEUB0DOcOFamsaEgnS3LYdgPYaWV0dfsf0RGyb/mk10Xu3AQWoEQtyhcVhKKVXLnyvbu95IwwxjDCniSKOdrgraLgTKxec3sDrwybmdVNKcvkK4KCNlclqOZpw4ptIbGmmg/FgKW5ASmYyoEbe3Qjr9cYQXu5AI0IkCvjtKwnj3fX+s01JQhKizOVdIpLTnNcOTJKbJilLKGGGWR2LsXYyvhTXKb/C5s19i1u2eLl1ri13aGdNrz0MjdyYNOT65LcEdyOnD10hGb9Myj2mtFNGdAr85TkM7gfe+24jcVvGJC8N1XcgKOLDrVJ7OPfmNB5ks+O4VECYOb9lUGMNGQrunQ+QhGt5HDOyStWTL9PZsGqZU0Cz8JsVBrENf2bIYhQCGFZ8BkPn/Asxn4MsSNSzqvBR+qfojg61TUIDpaWDgfPuC8SiAupMcn8gGY X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(376002)(366004)(346002)(136003)(66946007)(66556008)(66476007)(69590400012)(6486002)(83380400001)(2616005)(8676002)(8936002)(16526019)(186003)(956004)(38100700002)(38350700002)(316002)(6512007)(1076003)(478600001)(52116002)(107886003)(26005)(4326008)(6666004)(86362001)(6506007)(5660300002)(36756003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ukL0vDSYNR4QGxKEvuEeskcPV3LT3VBeDdXFmN7/j//HQtWj+kwYNi8mWxAwvweRe2/cr4dbPGB4oacffd3dhhOJF1+PA8PTEmVrS0xJZ6NaOG8zFSvL9SDy/GTMrVFYDuYLZrMeWaAvLrDxrBmo8ReGUOu6PXGKfTn/nL0QWdMSHsKH1PFmYclgBG0Tjg2gdBS2o2BN07qd0FznSqxwcQI2N6eLlrsWAEio2FlotNPlEcyeRcmbDzC7FVdLhk7oT4pXs/Ue2ZSuTPZGfJFcSQyn81MfvvM5imGE/vnPVpwaH6JCov9SzMszbVe87zjL7WKhY89O9aR6LynOsnS5VMzTQA2uQwCyCLs5fdZnfHmquB6HAaWXI0WtVKjxwc1Cnwu+uFELT3Nl9hV/j4eTLvzhu3+p6LlfrYtF7h7xMZKpg0PnaEGDZajERc/5Z0JsxPyhf6GVuhx09OZ7Pb2bWlvR+p3+p1lmAkU6ARfHb0SbiYz0tSOSp3syCjDCHmqQp72r4JzHj86N6hcaXLyS8B1L1crHOUzqsCyZsZqd1M2AnOPJ6gyM6ixzf9yPZ+AoETWPQq729ofF9uUvQhjgKxH1XZZOAjnIlLq6TlUHIan83+eV3vSQGufMb4xtIDN3Rtc/8CM38LEhyXqwX+M7L2cCfwb7tgHEWKznc+rlu7uhHpYzXllXEbGvTonMui1bqEOHIeIuyDGNt7piQ0hWaJNHeaB5EuXGaODXwegmTp3Yajqfb43z+vFyXMu8hznQ1YlaOm1+q7xp5hr9QkyP4pQnWDI6+OTx52iacl3cMBYSUhNHyLnDKlqqKiuwmIjsFxM+UAx9ipXr1JJZSdSUFiqyZhUy3CNqhACkASVLAxQt6Gf+YYLYGWibc6I/MMOy6mb2StGWOP1ucehafElFfN7xeFaIyuz0jN0mn0QthfNvbyGz0XfYq/Q9sHH7Vxue7FWJ3jNYpv61Ue0UjqzsGTok/213GXJZc1rcfZgPPTygEV99MuNAWJhr58nWETDAkTke8UJ3DHG1Ev/qWjKmXi5OM3jhDlmiQV/5x0XzyLb0tOlg5rcJbhNZRsSzH2f2Of5xKkJSptox5RaPfLSWvJxowm5hqnC4O0VFsXPr4VxPLsQuCRSxCiTF88XujHwCPf2K5Cd7cuKerVoeROYw/CidgexQSS4xnlkwjONyv/UtyYvu/i2N2RWuel/LtCX0CEIrG/Xb/dNyrKAkRb20nIVPymERtaETHPySuF1xRE3NSBbDijITQvtYg52U0S3T9QepPvVaf7yEy88YOxjhsil3Rb00QTgekkQOGCvrgUKl4IkGoWAoq7bixltrGgAO X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5018b7c-387e-462b-ec7a-08d8fc5020b3 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2021 18:40:35.1179 (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: tLJEU2uimz204JlYqVO3UEEsyeW7tg3A/p5XWJETezgZZRV+BR2sQNV61k7BkYml3sbbIOWhDec/jdKx91ZGnf4cubt5TrfCbEcnVk6GNQw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4324 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 X-Proofpoint-ORIG-GUID: usY8HImPDdP1oCA_oCghbK97JmY77X7c X-Proofpoint-GUID: usY8HImPDdP1oCA_oCghbK97JmY77X7c X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Drivers shouldn't be calling block/unblock session for tmf handling because the functions can change the session state from under libiscsi. We now block the session for the drivers during tmf processing, so we can remove these calls. Signed-off-by: Mike Christie Reviewed-by: Manish Rangankar --- drivers/scsi/qedi/qedi_fw.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c index 84402e827d42..f13f8af6d931 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -159,14 +159,9 @@ static void qedi_tmf_resp_work(struct work_struct *work) set_bit(QEDI_CONN_FW_CLEANUP, &qedi_conn->flags); resp_hdr_ptr = (struct iscsi_tm_rsp *)qedi_cmd->tmf_resp_buf; - iscsi_block_session(session->cls_session); rval = qedi_cleanup_all_io(qedi, qedi_conn, qedi_cmd->task, true); - if (rval) { - iscsi_unblock_session(session->cls_session); + if (rval) goto exit_tmf_resp; - } - - iscsi_unblock_session(session->cls_session); spin_lock(&session->back_lock); __iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr_ptr, NULL, 0); From patchwork Sat Apr 10 18:40:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 419082 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3441EC433ED for ; Sat, 10 Apr 2021 18:41:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E639610A6 for ; Sat, 10 Apr 2021 18:41:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234987AbhDJSlQ (ORCPT ); Sat, 10 Apr 2021 14:41:16 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:47666 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234979AbhDJSlM (ORCPT ); Sat, 10 Apr 2021 14:41:12 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIVWQL061789; Sat, 10 Apr 2021 18:40:46 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-2020-01-29; bh=H0L+idsUyGGnntyXnzdbJG8jPmadYFQhLi55rqjMp+U=; b=Aokt1DCKADPkfBYIwSZpXd+7Di50txJL60SolJWHEju2R8J7SYTJ+0eT/rYVXShDRHuW vbQxlbgRh8pSWlCRdioArsDCkaAzpOTcI3p/SayfA2ejJlRp91Fn2Rdmt7qmmKO8ajAs IkRot8HNsvJmxqAxutK0L1VS/VSjbyq/I9hqQuin4VwWjrg6k5o1Bbiakue4HqWL5hTu JpxtVek8NBGC7kGq7bWsWWSoFnCM6AyJtKmGDilmTnrnp62jKPcjEluFHX02RNPx+w1e t4fSmiI2cueg+F8JeCzpfRtGaF4c1U4X9j7LOMoI1/LmP9npjuzVExqaga6JodqMPV+d bw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 37u3er8stt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:46 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13AIUZZa190276; Sat, 10 Apr 2021 18:40:45 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2103.outbound.protection.outlook.com [104.47.70.103]) by aserp3030.oracle.com with ESMTP id 37u3g0fee1-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 10 Apr 2021 18:40:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dhtZzEJpMfTwNIxnitvknaEJajz/p4sKKo/LeuewbnCv34Z7HPtjAspix6EX/QtZxkh+G1961gRC/Aat4WAxLEQLau863WBWaPVDAX541K9/n0PmOrXhGjcYtKQqOWsuaiMVNQ+v2lYDWGFk2JAFiB+ZrX2IBHGJsRof9MYEMsuAuGF/KZHRyevqi1Cg7LPcdNUGBg8nn/Y/FKkYIXjfEP2qfX9nnH0a3NZZDjJyfxO/vPK7GVOT3u5EVzy91yJaTlWZaF2EsWHRi6gbbNITKdzCIfw1frvPJ6K+MxSwjIJ7yobEzUCGFwzBFPZv2AbUVIYgjzXg+YoXvck+Gl5IHA== 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-SenderADCheck; bh=H0L+idsUyGGnntyXnzdbJG8jPmadYFQhLi55rqjMp+U=; b=IF6YG34GbpxtXOXeddtT5FMfOzfuVdzOLyXKfsLFv1ph7FAoS76fL3SUaBr76TydN7J91j781qP++SypNVuWenV16QkMaMo9kceYg8qhmYAFj7/pXzXxywzi6Zghs81jaLBrOxygORKox3/2fQmCoogz4SpEmTG6FPRy4hgJbVLL3vD3MprKxzkOlj8hNAyGPkEPpfSUxMF3/Enooo0WpxrlaTUW0ytKM/GhaMS2KLt/gtpj0wUi8xQ9bmHzyiEix1sZyC/HbnACCtGq2uBEvfW22Hivsm5U9ip96z4hKl/7oCoVHMXvBdl0hm5rSIBjnptLPSDz/N9koJxmivwGGQ== 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=H0L+idsUyGGnntyXnzdbJG8jPmadYFQhLi55rqjMp+U=; b=gdVJImUDy0TD9fYx25h3oAb/czHk3GiZ2dlCJfIisiAH/rQzvSw7Rad4P05fjvD0+jhlc3WGfb/AXoHd//ycQiRMGt0kNK/7eBxw+hgSOFkaauwwXdlWsMnJrUzbTtb3VgsHWFYAYKgKmh6uYXOmGH/jEnxgGMI8ntCiuekbbtE= Authentication-Results: suse.com; dkim=none (message not signed) header.d=none; suse.com; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4324.namprd10.prod.outlook.com (2603:10b6:a03:205::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Sat, 10 Apr 2021 18:40:42 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::50bb:7b66:35ee:4a4%7]) with mapi id 15.20.4020.018; Sat, 10 Apr 2021 18:40:42 +0000 From: Mike Christie To: lduncan@suse.com, martin.petersen@oracle.com, mrangankar@marvell.com, svernekar@marvell.com, linux-scsi@vger.kernel.org, jejb@linux.ibm.com Cc: Mike Christie Subject: [PATCH 13/13] scsi: qedi: always wake up if cmd_cleanup_req is set Date: Sat, 10 Apr 2021 13:40:16 -0500 Message-Id: <20210410184016.21603-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210410184016.21603-1-michael.christie@oracle.com> References: <20210410184016.21603-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by DM5PR15CA0036.namprd15.prod.outlook.com (2603:10b6:4:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Sat, 10 Apr 2021 18:40:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fdd8e03-9f57-42ec-b244-08d8fc50230d X-MS-TrafficTypeDiagnostic: BY5PR10MB4324: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c1EUfu6nXlCBgX4fZulymCvefegAeunn4QGLnkMyPfcfKUc/jsmzNK/ONQkh9rmkhbgzdekjx0Tdnoj/ooqOq9BvnteaUIGvFBjsXIEUALJWgZUn/mpAJF3KqVTp6U2NobekKZVDqLtNyqdjGxTZ9ezmz9XICF8r8uzPpjwlllQBHLI44KMJ2YMI9cZN/FjcogmQt6IIYIHu2CtCL2TSbnethLxDhtBpD9TiLhJzCwEYhKfEmma8hVGvgVut4ctPiGnwYI2LfUlxpPubDDEaDP5ihj6z+k5qo0mYffRRUiJL6NMAwLb1TSq/SZ4ruLFe62PO2w6nRFWMJdW/lysUmdaof+p11drm3VkjKFAzmju7rX0CKxL8urefasHeVFZTX7BE07YBk4920GYOJD0/dSIW2e3CZ6ke4agG5RYpgE3v/o3Z/KztAmOTwnVFTTtA3p94CBeWrkrKl/uz84hHdDpXJe69dfdrqA/Vm48XZLL1aBUEuNoKpFmiC4BOFEk+RiqcVUGFlIv9+VOMCKzFl9cM3AVeOyHT9c/C0nAqAivLj+83+05p5xZaSSURyNWhvMsbsnQt5dDzVmTdhBN7EPI4VWHbEDnzT5bvyhpqN+Gr8ac3evhG8J6qmI7c4VynSF/4GmcJ4m8d8PsTd3X1DmYgs/znkubdPFawflXcafe3Dg+qyJU4CJWjeGb4pf7D X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR10MB3573.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(396003)(39860400002)(376002)(366004)(346002)(136003)(66946007)(66556008)(66476007)(69590400012)(6486002)(83380400001)(2616005)(8676002)(8936002)(16526019)(186003)(956004)(38100700002)(38350700002)(316002)(6512007)(1076003)(478600001)(52116002)(107886003)(26005)(4326008)(6666004)(86362001)(6506007)(5660300002)(36756003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: qmImkUM1WTL+GvdAF5DS0BaHZuva7/j33bMCz3NNaqFxSDsXILR2f96YJMXEvQgs2pzppl1ayu2r6kkvcRiOFhXTG5i8ljKfXT/SGczc2NN8a4qd/UHTfGYPhSQtqHF4wxkEsPby+aFBSqOhiZldlVsABsgnFZAXkI0X7DEU1Dh9Qjj55KRDFaG1QFTdLBJNCr0m2hs8hcSHgtRDJ1SBoF+gkprtqbFQ3Tq9i4tjvmRAKYoskLh3+gxvTXN9ICaHtAg78sVpN1u9nIBZlpBScGlmcvz6kyhFM+iN9fZF9nbsSZajWlDk33PERDo+bi+HSwpgp64NnAL1UEzSbsud7h9vl82Cvvxs+prWd6T6obPI9rngs7rGIffvzgU711T4M6Ad4s6LSPYc1ifZ3t39RUGJK5UfGgXx92z0+00+r+cJVwdfD/0sLhCX2TnZDXaF2r6mfPyMFJoK5bZXsBPw8UGOCboj7rRWUsKotDMQH12ZApOSUU08PRhvHt/vw7JtE3DuAdjh2/gw9/g2PL8bnlpnHkajuFgpw7ji7cft8xMojYwfDwLPpEm2iL9kgLbjhDvieMxXtMEjv0rxz7KwfQxRVvwCmE0JTurfisy/gdhWwcTHUmejRamZEULhWCYQPsnrjDSToFuazeAuDfsE/vr+Hal2jC06YKpCD6nzBHE/ZVIGhXVwEYEyVE8+GrHNkPhj1LCo1J/AzFPxJMXDVhnnU/t3ieEw9Adr67cpUdy+EzY8Q87MiSXJLCMuZvQeuiurwT/iOOu79h3kKg1WDuYso1ROlVHMp4qtiR47L/t1BSqLDlK58ExsCPTftO5bnyoVDphZoKITNi/0Dx5kShRE2Amsht5rstwKp9TtCfG/ztTS9BG6nGaZ/cpwQ5hXUFh4+7JT1Ty42h4XkzA1om26doGva1dce6tbecNVsg6bdbNxbyD4TmYRnMWP0Z0SPYY4j9AsSo8FRa/GHAxZjd52upCaH3b6/mFUf4CWfo8vSp9chPyilXKWng67yBaH57C5a78B8Tk4EhgWZ1CBCRLN+B4K4wmt9LmxzIFnMvIgKTAcZzvWesXMA8Arg4RC+u0//mYc71c3diaMv2nocN6DF2IxoSbGooG0uphU0ISoJBIh08bDrV3gTWAPqQaGvbIeD+UrQN2aIi7y8mHsj0GUzipZjb2sD9xwAU/IsYr4lcRBF+6ARGNa42It8Dn01YLmenTZDW3WRTmz2d6q/7E0W2ecxT058mAM3AzDqksvKxpvF4U2WbjIRmUdYcmWOIN3J3fkHOZxLAu9LzPxFCNMEd0xdxz+26x48WrjwhQkOsb4ChlQhr+cv8C7c1BN X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8fdd8e03-9f57-42ec-b244-08d8fc50230d X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2021 18:40:39.0307 (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: tRyNEAekpJNImDOCPBiTNahr0tRfQIxmpLxvsVjky4amXm2dSaNsYRmv1TfMbQkg+IH8qKTif19t+PCDyvrAIdHGDXyZ2oDGW/BKFgT0cK0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4324 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 X-Proofpoint-ORIG-GUID: OXbbuleHTu4u4O53JnXmTIlg8NxkEFpA X-Proofpoint-GUID: OXbbuleHTu4u4O53JnXmTIlg8NxkEFpA X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9950 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104100140 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If we got a response then we should always wake up the conn. For both the cmd_cleanup_req == 0 or cmd_cleanup_req > 0, we shouldn't dig into iscsi_itt_to_task because we don't know what the upper layers are doing. We can also remove the qedi_clear_task_idx call here because once we signal success libiscsi will loop over the affected commands and end up calling the cleanup_task callout which will release it. Signed-off-by: Mike Christie Reviewed-by: Manish Rangankar --- drivers/scsi/qedi/qedi_fw.c | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c index 13dd06915d74..13d1250951a6 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -739,7 +739,6 @@ static void qedi_process_cmd_cleanup_resp(struct qedi_ctx *qedi, { struct qedi_work_map *work, *work_tmp; u32 proto_itt = cqe->itid; - u32 ptmp_itt = 0; itt_t protoitt = 0; int found = 0; struct qedi_cmd *qedi_cmd = NULL; @@ -823,37 +822,15 @@ static void qedi_process_cmd_cleanup_resp(struct qedi_ctx *qedi, check_cleanup_reqs: if (qedi_conn->cmd_cleanup_req > 0) { - spin_lock_bh(&conn->session->back_lock); - qedi_get_proto_itt(qedi, cqe->itid, &ptmp_itt); - protoitt = build_itt(ptmp_itt, conn->session->age); - task = iscsi_itt_to_task(conn, protoitt); - QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_SCSI_TM, - "cleanup io itid=0x%x, protoitt=0x%x, cmd_cleanup_cmpl=%d, cid=0x%x\n", - cqe->itid, protoitt, qedi_conn->cmd_cleanup_cmpl, - qedi_conn->iscsi_conn_id); - - spin_unlock_bh(&conn->session->back_lock); - if (!task) { - QEDI_NOTICE(&qedi->dbg_ctx, - "task is null, itid=0x%x, cid=0x%x\n", - cqe->itid, qedi_conn->iscsi_conn_id); - return; - } - qedi_conn->cmd_cleanup_cmpl++; - wake_up(&qedi_conn->wait_queue); - QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_TID, "Freeing tid=0x%x for cid=0x%x\n", cqe->itid, qedi_conn->iscsi_conn_id); - qedi_clear_task_idx(qedi_conn->qedi, cqe->itid); - + qedi_conn->cmd_cleanup_cmpl++; + wake_up(&qedi_conn->wait_queue); } else { - qedi_get_proto_itt(qedi, cqe->itid, &ptmp_itt); - protoitt = build_itt(ptmp_itt, conn->session->age); - task = iscsi_itt_to_task(conn, protoitt); QEDI_ERR(&qedi->dbg_ctx, - "Delayed or untracked cleanup response, itt=0x%x, tid=0x%x, cid=0x%x, task=%p\n", - protoitt, cqe->itid, qedi_conn->iscsi_conn_id, task); + "Delayed or untracked cleanup response, itt=0x%x, tid=0x%x, cid=0x%x\n", + protoitt, cqe->itid, qedi_conn->iscsi_conn_id); } }