From patchwork Fri Apr 15 12:42:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chesnokov Gleb X-Patchwork-Id: 562140 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 7BABBC433FE for ; Fri, 15 Apr 2022 12:43:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353755AbiDOMqK (ORCPT ); Fri, 15 Apr 2022 08:46:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353762AbiDOMqH (ORCPT ); Fri, 15 Apr 2022 08:46:07 -0400 X-Greylist: delayed 67 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 15 Apr 2022 05:43:36 PDT Received: from smtp.digdes.com (smtp.digdes.com [85.114.5.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE27CC7496 for ; Fri, 15 Apr 2022 05:43:36 -0700 (PDT) Received: from DDSM-MAIL01.digdes.com (172.16.100.67) by relay.digdes.com (172.16.96.24) with Microsoft SMTP Server (TLS) id 14.3.498.0; Fri, 15 Apr 2022 15:42:26 +0300 Received: from DDSM-MAIL01.digdes.com (172.16.100.67) by DDSM-MAIL01.digdes.com (172.16.100.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.12; Fri, 15 Apr 2022 15:42:26 +0300 Received: from smtp.digdes.com (172.16.96.56) by DDSM-MAIL01.digdes.com (172.16.100.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.12 via Frontend Transport; Fri, 15 Apr 2022 15:42:26 +0300 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (104.47.17.174) by relay2.digdes.com (172.16.96.56) with Microsoft SMTP Server (TLS) id 14.3.498.0; Fri, 15 Apr 2022 15:42:26 +0300 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJhLoPWIQhiwDVIyrZjBs6/pyPB1sDmJkcsMbdmKyQwlmU3OktO18VqhOtSyKL3MeK3w0xfB8tj6YkLn8cgcwF8/TaO/KF/1ycZ1orEb1Mqn4ZGiFl3sCTNumXm1KYV75G3tMCpnDGdXthpmld43Lj90TU+Hf2URIZpOkV63AjxsOgX1c2/cb00JNnc1jKUglTtUYscp1gCsBJXgLvWnnRgWEeKFq16t9JpHpERp2ochYoqPpgR9RY9OJGhDXiOjpXKuzDJF/WGIT90LsaS0BW/hRtXPaGFrnUa0htMuMI9PmTH0zAtsH1fDdOTJofX6E9JHUmI8kugDwIdVDMkVpw== 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=NBwVL/WQw9H7kOeiROa5jfGWN+5d/fkEQyChIU+mQ/o=; b=aPFFw1D2LNDs34C331Djia49PyMgApSx0okW6x1NFGTkii86X+wxeHz8QlazjeqEWJX3wuUMQukUq8BPH7DxBQ+3EeFsXukLOcn1Nqxtp+3vMinSRAGhROerAUY7Ws8jugWfwxP3hgLMt8f/7pLxCga88+ATS9D2738FbR1Oq1+E2o18KsWgDV+m4KB3lIKm7GoPoFLcs6W8M6ABulh7d/XTUueKEp4+O80oHgRARHOkedDn6CxWwCpMqOahnYt/pN9rqtqiaFhM74GNbKNLAaynL1dfPp6RBYeOPEDL1HDlYzb5PPpG7Rj76sOhYjWYQEWsnpv+LmbAArm9NkJLDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=raidix.com; dmarc=pass action=none header.from=raidix.com; dkim=pass header.d=raidix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digdes.onmicrosoft.com; s=selector2-digdes-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NBwVL/WQw9H7kOeiROa5jfGWN+5d/fkEQyChIU+mQ/o=; b=Cpm8szQ0O0LH/nHxrRhO6fMAx+TYFGKTrksEK28aVrDexUecFru39Orn8k4JyHM7xNi4w/tsdCBd5OQrv16N1hLIlRDkW3Z1aFIjrFzBTk7JaOwOfD8YjDA8DWRsGaw5TBuZP3ASIuhVql92xufjgHAElQDc4iUdnTUbrStn1tA= Received: from AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:403::6) by AS8PR10MB4519.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:2e2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 15 Apr 2022 12:42:25 +0000 Received: from AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM ([fe80::74ca:aa66:a112:d987]) by AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM ([fe80::74ca:aa66:a112:d987%3]) with mapi id 15.20.5164.020; Fri, 15 Apr 2022 12:42:25 +0000 From: Chesnokov Gleb To: "linux-scsi@vger.kernel.org" Subject: [PATCH 1/2] qla2xxx: Remove free_sg command flag Thread-Topic: [PATCH 1/2] qla2xxx: Remove free_sg command flag Thread-Index: AQHYUMYWYkt1LwLtU0eGmzdW21PURA== Date: Fri, 15 Apr 2022 12:42:24 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 8ad1690c-d667-7a20-e5e8-149fb4163c2c authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=raidix.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 85e54aa4-5398-425a-e153-08da1edd6497 x-ms-traffictypediagnostic: AS8PR10MB4519:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K5tkARijj1a416AU0Km1mUAjsb0lDqmqnfrK2FduzZc0Epxzgu1g0IPQhucF0Y5O5aek3Es4nWImNjdbYw/Cv8aRx7OqSUhDe+Kb9m3Bd+kzB/4wn1rDDAeHyg18wdKoKniREwS59kqypPsg5fqWQTo9u69e9WfD/UDE1No3NKLjGrnt1s3fcX6AUfQ9Gofb2fHqbRDFk8KlRjxd+id3aPALPh6RuNvE5iKZgGYZRor0Emdl3U/NdVGIhMM/lOz0JBHf94vVTvwJ8ONZxOrX7fcbNhRqC+0ayUQTd/zffGaiwdNjFgnp47BZD1bFJ8N7q1Q5/wyunxHR1N/xjMUA4kLHnFdd/C9e0FngYiJeuMxHQhSQ2YFZyjldLwwXosAfbvoDK5DHRWaXRhXcbb+KkdsZiAY9Hi1XEV/n8pujH/q3/g7LMpy4W3gz4lB53o7MKvhphQwS6k33zBST6QgwkkfOAh/tZWYAhFGXHx99+1kOKxWnImK7wYA3V9cwTaGGemak1vHWxqZBIquesnYfU7Bva6uh34BZYKs0C0KZahs1QMIYkmt3qhXBg9SUvclNQH7iXE+3Hs+4S1ix9/AEOZFhhzNq0lAUVGMklHTF/yI3Ka4FJqb1+jTCeoWvfdfG2P3fGPFF3vejPcDVO84VX/zeuy3RB+kdR+CD2rPSEAW5xuUqXLDxvMx6J9jHe8b6pgXPFu14926e6nnDQeraEw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(64756008)(66946007)(76116006)(9686003)(2906002)(38070700005)(122000001)(71200400001)(33656002)(55016003)(8936002)(316002)(186003)(5660300002)(52536014)(7696005)(66446008)(26005)(66476007)(8676002)(66556008)(83380400001)(6506007)(91956017)(6916009)(38100700002)(508600001)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?/VEjBCUOSyrroHev21IAhXi?= =?iso-8859-1?q?WMQC1jVHOdpycKIWLt/sQZANHaTKMZOQTMrv1KbQadYSAHx6pcGaLEOYHBrH?= =?iso-8859-1?q?MljPXeBvYI3vOSVA7FV1f5KfWoPGrzNgVKkcFt/kTwFLdXg6OOwNd53oHB4q?= =?iso-8859-1?q?e+tQWlXcRDZm36piWJSa65AaiQpTLg30Zfi17gndBd3FOy6FsYScB/UP821x?= =?iso-8859-1?q?gIoCiKCZQIYyz1FzrjPgC6FyUoVV9Xbt7/rmZsH28NTnREDtBJDd6BPL+/VP?= =?iso-8859-1?q?qp2UIHYoFeCVthd+uAMZDjmw6OlbWnjNf7RQOj/Cq/6DuWeKzSzb0DATPNEk?= =?iso-8859-1?q?tPjqfo8+o9t3YwCm6D4SEHTZjmQj3N6KkBbWivLUU5U6e6Sh8b2q7dSwK/yM?= =?iso-8859-1?q?bxBYQ4IicEDtNoMCr+F41F3W0v81lU+gvzAVgJIwrtA/SMB5PP5C6HJZQtOB?= =?iso-8859-1?q?HsYEPK3z1X5deZSa7ZaOsnw6xevTFqWtbR7NQhClgpLP9kos8qK7bU4WaKx6?= =?iso-8859-1?q?oS7D6p7RuLZTCjWB5HoX2L2Ya38SehlyRW5IGACEAYaD5UuqXwT6TITvBizy?= =?iso-8859-1?q?fTlIhkpkrQLzzhZNGoqAlTtARJ25A/7ViRVhJkBYzLPE3lDXcaA8wE25JBsa?= =?iso-8859-1?q?ylW2LMuM5232AVpSsbvme7td7cXc8tMCTT3ewtwzxE5/Xexm25FVQYOjLKoq?= =?iso-8859-1?q?EFZgj7uveHhfWmEWBKRaV5RPku5DazN7oe7R6xzJ3i3qbDFKzZ21RBXrgcCf?= =?iso-8859-1?q?9LpRA90AB/k7Kwpv1HrTx4Ggl+xNY58yITTYmAg1kWUpltdtwaZLpuuTtIsQ?= =?iso-8859-1?q?l/q4omT1aI20QLbXUZFjmU6noBCYUroOMQTkxRejNmTnd+V3lJ0t0mfzxqjg?= =?iso-8859-1?q?eq2uSElyGfd3sv1GON6dVB7VdCqJrztayuMkRiNN8DE2SAI+OppMtAqyCmvv?= =?iso-8859-1?q?AifeSv5gS6uzOayF5ezF2nMs5+ZEIUBJFjZc6PdxMP15ssbrEFA7neQECYW4?= =?iso-8859-1?q?rkS+/PAMBTtu49Rp4f6IJ+8145ffNR6gn9wej+e0bcmBfB4+U3VE7F2VVOlF?= =?iso-8859-1?q?Slb9vXK5BYRswkCyq01mBNKPDeFtg2/RMmKyyBFPkyyslPLbbCSVc+FWM9hT?= =?iso-8859-1?q?10WUvmVSSulqouLNLJWlKKs+9T35t1AlpzTcU5La+uo9DlxuOKIckTqhAz7O?= =?iso-8859-1?q?fNCI9u5MUBE47/E/whGIUJSogYvVS/WQ0kRtVjB8hjqDnhWftBDnj06IFvqI?= =?iso-8859-1?q?Ww8LCg2BmmUMGwGcU6m6nnWky32uCY8gcEHJWQmqf6MBFm4Na0gbwCTlmZ9q?= =?iso-8859-1?q?+98T6XHB8SIJGS3m5k2JOXFm+8ABUSsOtJCxW7Ec8kGXPMq4FGd3j/dSGcmQ?= =?iso-8859-1?q?huPEhbfEidG5AiaiRJHWQW0VvupEl+1KsetE46J4jQUfcRREtTog0lWm4OWJ?= =?iso-8859-1?q?NJQDA7LnVLWWd02ROaBe3K7hUwas3YYpTm3yKzkbgjRR/wqQmey79OYCmn3Q?= =?iso-8859-1?q?98TxVa+9n/feLeMCl+yFBuvaLWmY6T88f/EMzdvtkkXSCCYGZCMxu+NZNsZC?= =?iso-8859-1?q?3r+jj/pM5mdkXQl3ntgH5IkvDUOXkgqGX3yI54rudoRe0eIt4hXhqHZSO/9I?= =?iso-8859-1?q?KV7APgRiuSFWr1ZwphhCmituJq/XWNmlYXwZvsOgI38Fx8rYDsXEkNQgXXxV?= =?iso-8859-1?q?TlRZl+igelSX3aAMRoQQ5ETjid6OcdR2VKfstjewSsxqSZ0Vpz0xbBhJBbNk?= =?iso-8859-1?q?WmpvcL9AIKVRDlEfFTGf3IsqzXi2Nn8JbWSgqzMVh1Pptrg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 85e54aa4-5398-425a-e153-08da1edd6497 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2022 12:42:24.9065 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70c55e28-9cd7-4753-937e-c751128a9d38 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mYVPy39gxBg5quE7Jqm0Dn1+rn+q/1vHqZXAOToWmDgDFu3/eZwtkQlyROClxhZVqzxtUAEomIHxhkl4WPQ4pw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB4519 X-OriginatorOrg: raidix.com Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The use of the free_sg command flag was dropped in 2c39b5ca2a8c ("qla2xxx: Remove SRR code"). Hence remove this flag and its check. Signed-off-by: Gleb Chesnokov Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 2 -- drivers/scsi/qla2xxx/qla_target.h | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 85dbf81f3204..2d30578aebcf 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3863,8 +3863,6 @@ void qlt_free_cmd(struct qla_tgt_cmd *cmd) BUG_ON(cmd->sg_mapped); cmd->jiffies_at_free = get_jiffies_64(); - if (unlikely(cmd->free_sg)) - kfree(cmd->sg); if (!sess || !sess->se_sess) { WARN_ON(1); diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index 156b950ca7e7..de3942b8efc4 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h @@ -883,7 +883,6 @@ struct qla_tgt_cmd { /* to save extra sess dereferences */ unsigned int conf_compl_supported:1; unsigned int sg_mapped:1; - unsigned int free_sg:1; unsigned int write_data_transferred:1; unsigned int q_full:1; unsigned int term_exchg:1; From patchwork Fri Apr 15 12:42:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chesnokov Gleb X-Patchwork-Id: 562995 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 45602C433F5 for ; Fri, 15 Apr 2022 12:43:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353747AbiDOMqJ (ORCPT ); Fri, 15 Apr 2022 08:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353766AbiDOMqI (ORCPT ); Fri, 15 Apr 2022 08:46:08 -0400 Received: from smtp.digdes.com (smtp.digdes.com [85.114.5.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94AC8C90C7 for ; Fri, 15 Apr 2022 05:43:38 -0700 (PDT) Received: from DDSM-MAIL01.digdes.com (172.16.100.67) by mail.digdes.com (172.16.96.60) with Microsoft SMTP Server (TLS) id 14.3.498.0; Fri, 15 Apr 2022 15:42:31 +0300 Received: from DDSM-MAIL01.digdes.com (172.16.100.67) by DDSM-MAIL01.digdes.com (172.16.100.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.12; Fri, 15 Apr 2022 15:42:31 +0300 Received: from smtp.digdes.com (172.16.96.24) by DDSM-MAIL01.digdes.com (172.16.100.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.12 via Frontend Transport; Fri, 15 Apr 2022 15:42:31 +0300 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (104.47.17.173) by relay.digdes.com (172.16.96.24) with Microsoft SMTP Server (TLS) id 14.3.498.0; Fri, 15 Apr 2022 15:42:31 +0300 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UTHDSfJXEd+ZF6NrQODP61Je0dnjay2ZpwvJNkErUwMR2QUaqvYlRW7ZIVUH/1GrONhO/td7ymOpkt1MGW3tdg/WUuFfk+mJ1m94ApVmHg7FtHNpoTP1nNsnLitxL8JZ0wTUA7o5csN/DWJa+t03nvK6M0PQ0j2ylfKiFHl1q/UVfKJ14akFc/lnEjLll2IKDvAUfEwOjOY2+NtKphKlvnoe/CHtB0pFC8k3Ish5f0gNxez6rBVcXtuDXhVudewF1syD7F6/UCbG4EXyehP921oMCcl3SIOZuJ5uFUoe2A46qi9JmafzKhKQLlSGn0l8to9wLb6nmcfCJdqDDpb3BA== 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=jwnsXjghJMriGNJ40ms1bvXOK0icnKT0if3Ux0OEVwM=; b=jTL5uEFStLeSFwjRRj0CcQytGsbyzt4kmyIQemCoiSOdgB8K6kdXxMMHwq7+cOYy9C8TgG/1lkPhgaUEecngeBCbufuC/NrjCm/0WflaxXd00bBWZ86pnPnA5JGiYbJQAu6vVHy178Ya9Wnq20I197erSYXGLZ3bB5m8nZLMGCQZw0VqJK7ng1HYmbs61FIKxzJCqXoc+q3dwR0uZU2cWiWqzLM4k+FkslbdDLdni3OZjCYMCVqLVcoXcmAwfT7DPsZ27w4t9tqzRIcaHYaZghSYk/j8ZB4027U0kYAOoGj4/xZDG7bpsCfJ1SbyGbQ8H7XVrT5e2tyKex8PYz8DEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=raidix.com; dmarc=pass action=none header.from=raidix.com; dkim=pass header.d=raidix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digdes.onmicrosoft.com; s=selector2-digdes-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jwnsXjghJMriGNJ40ms1bvXOK0icnKT0if3Ux0OEVwM=; b=l3hzL5XbohdO3Fy8S123QQTj/1DhuvY6tDeyY0J2picNf0lBESxRWtO1CQ84xRNOZthzBrCSDBjhG4fOF10q5/KsK0qHyi76vpBiwg1fW/2dUsrvdg0JdR9GQDsVWxaGjnEaol/a185nIKDjy+df9KDlgBXi5DTLWvdG9MCES2s= Received: from AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:403::6) by AS8PR10MB4519.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:2e2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 15 Apr 2022 12:42:29 +0000 Received: from AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM ([fe80::74ca:aa66:a112:d987]) by AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM ([fe80::74ca:aa66:a112:d987%3]) with mapi id 15.20.5164.020; Fri, 15 Apr 2022 12:42:29 +0000 From: Chesnokov Gleb To: "linux-scsi@vger.kernel.org" Subject: [PATCH 2/2] qla2xxx: Fix missed DMA unmap for aborted cmds Thread-Topic: [PATCH 2/2] qla2xxx: Fix missed DMA unmap for aborted cmds Thread-Index: AQHYUMYtkLBbKidY90SJACyXGZHZ2A== Date: Fri, 15 Apr 2022 12:42:29 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: c0caa8e8-5278-c7bb-7451-4ffacdaec45d authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=raidix.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 449a68fe-b835-4be5-31b4-08da1edd6780 x-ms-traffictypediagnostic: AS8PR10MB4519:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gmCIbQoGnEiQrAaNcJSdSYjDjGnHXZjbIH5KNtaLNN1On1DtIOrbtqE/ngZKdHBep/FT/bNXU+Y7qnz8fTFbJ96ITqt3TXp0UcxdkjkEyvfn0Trh62Oh373qKJi/BVBa/ZAmha5HNgjHR3ql1bdVoPEVZT3f2vP/DKJixu3ZQyto4sUMwxBNpPvdhllCBhR66ChzzMotMqGxZFTD7a4paKiZE7tqR+ouv1mfZjBa+BUxgiqbR85AnaULaDNhWKHFIDZTNLhJ5mi0sJAsOSdbF3Tpe221AcXU6kI8IbPKYX75DKFvjn0WuNSAp7V+cab8CfXkAlEcSvCQLCT0Tv1lRu0wPoAkvz9a2uRBl1yMDAWdnB6/gRoGip9E0qczsw9T/9PJ3NnIQgpInycNiIiaeXTWsf1k0qXR5bR9Lppl4kuJNFB+jSioGpTkd3dUZHU008NbGqGTMpb5SoGg2T3uqVw+Peoc5d3sARAPcC9F4k6le2rDTdE2q1RS7DmJTwS0MddwCK/9xmEBAI8KHoNVJIvQc31hAySQj4X87Kncm4oOBN48VSFBvFdYsrvLvMHFaV9KoxTsX2lLCox72m8cbHHjhlpvOJ1e8HVU7oK1HurMriSg2C4t7/m0Y3WVcF/zR/7372J12J2gkBH3vfWboQS6lRtdkR5QyDl6tPgHgCQBP/4NbADYWpfVeuFtsG1FY2My2cRKFF879+a+B/ox+w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(64756008)(66946007)(76116006)(9686003)(2906002)(38070700005)(122000001)(71200400001)(33656002)(55016003)(8936002)(316002)(186003)(5660300002)(52536014)(7696005)(66446008)(26005)(66476007)(8676002)(66556008)(83380400001)(6506007)(91956017)(6916009)(38100700002)(508600001)(86362001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?NInTtHrOM1JZIM1jce6zFcV?= =?iso-8859-1?q?ah10jNeoYmcOyhWzXA2jQEdU8qe+FxdLmrEddj+vvqTWHll6ExMaZRKX6qhW?= =?iso-8859-1?q?TGWpH0BTp2buHzAUMdRp8ZAnddW90O6mQyoYL0GvvoGCwJVH37BD+Ti8z8X8?= =?iso-8859-1?q?FqLE58AwlBCx/8MMx+CahzLEJ1z/id4uvZrlc512QB+wFQhWqbd6Cu+OVUcA?= =?iso-8859-1?q?P49g7NLXFGr5t+8OBzNIAGixNOlQIGgfBMUccZhme5sVac4YupGIu4zlXMaF?= =?iso-8859-1?q?cjThR+9r+BlSYq9Dcm1ULlUOCSZ1Wbl57y/RHMzVGTtA/+6KROxI5kKWiNda?= =?iso-8859-1?q?sNBfLmAhS+Zou9uqa9zcvAcyUJ+cRwcWER7zHNjZh/PVyRpEgkV7XWFHuLY6?= =?iso-8859-1?q?P3B7srjRx5IFRdjAwArulyYcB7IBOqj3p0Q3DcooeaNSmJeHTnhQPy3uoQhT?= =?iso-8859-1?q?Ok/udE20GwVnDyIMtggUVyVOwlRhkLaicEhgS13mPavyrUbqdSF0rNFGEzJy?= =?iso-8859-1?q?3L2H3qIw4BqQvs4fJZwqEPDaEbA4GebUf7jkXEjfrZ7WoEacyAgHrEWRkC78?= =?iso-8859-1?q?fy42RITnrJzuiM2sHZ9aUet6Sy0OPzk1yvOXLihVI+QZcsbLhyf2LJokxKOK?= =?iso-8859-1?q?4z7ZUU90RAWDc072I614iUAtbzwX/asXCKc29QnayAFKQr3X61BcfgcLClwO?= =?iso-8859-1?q?YtlbSEF/Ai12Toca3FUPm68/b8plLR3fLKQDliV+UREE2nPgzDHvA1RB6XYy?= =?iso-8859-1?q?NfrR/TfYwdYleZ0NAShFkTUQyniAQ3EuvHYmX8e7DQwXGJoTFQ1P6kNIMz6/?= =?iso-8859-1?q?WhM3u44cJ4YHwjrnklF5z9X51W9qHROZCNG92+x9KLBfApd6fgGL1t1oZxwF?= =?iso-8859-1?q?inqM7bZgte1E1YucV7tI4z+wR/xupMVkVh8QgsJaBPL79zDl6k/fHefey15i?= =?iso-8859-1?q?yGlLhFFaKQaCUTyA0r0Gtm6hoHj6f5jSpcUc3ICrqS89QOpE++yzhsmsBRpe?= =?iso-8859-1?q?PYhHpTdVkNI/S0fDqjZECtceb3Jb7kMeOKGz3swjWlbHQhedLEjTxkpnmWF0?= =?iso-8859-1?q?04Yaoz7jHXNX6q6aLegtTJQdHpoBWZneUgf+rc+ASj+sPzjoo0bu3OFjogSH?= =?iso-8859-1?q?5cdm1FPQFW6d1GFk7KKVBksPyBjnrr39RoKGkfnowz1DRdgPy6w8f0ZV+TAT?= =?iso-8859-1?q?/QJTLJEW/4h4ePzyI59+RZopzW4RY7Ygn2ojgIlmdVO6EE9CxWR85JRSfJC5?= =?iso-8859-1?q?U/Fb8wOviaIwbLZiwB0Xu56OsOsL2lUbnnXz9O6GSmz+BgNd2zbSbKAATb+C?= =?iso-8859-1?q?K1caCf/ZsIB3baq3zQIYISvSo5XYzIyL3edojAkfiebdO2fPEOTu7VocIIRd?= =?iso-8859-1?q?0sdKGIgFZaPap2qpVPb6Yi6RuTJ3B2OTzgxvBUwMKm7CuryWwHtlLkL1SsbO?= =?iso-8859-1?q?W78P+puE+K9bruQZRPHsth+YCRfEa+28dHk2w/pGcjeEJUPjSbk1ZKNA/MKT?= =?iso-8859-1?q?/nyW1djW4th0V5TsluEHIxmWiJIcknqJUsx44QRP4sW2+FgH1abdMN1XgyIo?= =?iso-8859-1?q?OdHM8wJNzQEaP7yk8id+LMhLN0J+HFw0DtyySNuVtYMyZFWXsGSjXRSnEDsZ?= =?iso-8859-1?q?Gt2aMWFYWl4ki6mkn9ZBla5cV7v8D2bCK/4LK897y+kBBwmT3wKAMgRRjBvf?= =?iso-8859-1?q?BG+UM6hRyE2cEw7gxAbsyScpJ/OG+P2Nqm/ggHJudfkJkOvCv2AA7qqHAaBT?= =?iso-8859-1?q?w5W4o1pi+F+MkdTlo9AzUdCipjpDxMqZ4Dlaw7mSXD3S4ZQ=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR10MB4952.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 449a68fe-b835-4be5-31b4-08da1edd6780 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2022 12:42:29.8781 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70c55e28-9cd7-4753-937e-c751128a9d38 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wbCXgTD2R5nuy4TZiooK8cdskzl6ySnsPX/+nSYltSn6+6TeIMyhpvetyxMfa6XmhpBoMMdl+5ixNP/HTeZWsA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR10MB4519 X-OriginatorOrg: raidix.com Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Aborting commands that have already been sent to the firmware can cause BUG in qlt_free_cmd(): BUG_ON(cmd->sg_mapped) For instance: - command passes rdx_to_xfer state, maps sgl, sends to the fimware - reset occurs, qla2xxx performs ISP error recovery, aborts the command - target stack calls qlt_abort_cmd() and then qlt_free_cmd() - BUG_ON(cmd->sg_mapped) in qlt_free_cmd() occurs because sgl was not unmapped Thus, unmap sgl in qlt_abort_cmd() for commands with the aborted flag set. Signed-off-by: Gleb Chesnokov Reviewed-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 2d30578aebcf..a02235a6a8e9 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -3826,6 +3826,9 @@ int qlt_abort_cmd(struct qla_tgt_cmd *cmd) spin_lock_irqsave(&cmd->cmd_lock, flags); if (cmd->aborted) { + if (cmd->sg_mapped) + qlt_unmap_sg(vha, cmd); + spin_unlock_irqrestore(&cmd->cmd_lock, flags); /* * It's normal to see 2 calls in this path: