Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2936768pxb; Mon, 4 Apr 2022 03:30:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt7JYo3oZZeZpTtZGPAuSGmweaxie5JDm/wxG2AtOVQ+6aWvBb1vt6hLmRiFYmFZUb/Evy X-Received: by 2002:a17:902:f551:b0:153:b179:291a with SMTP id h17-20020a170902f55100b00153b179291amr58127195plf.13.1649068251094; Mon, 04 Apr 2022 03:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649068251; cv=none; d=google.com; s=arc-20160816; b=OSXdBGF9XaIsCiqL9hsOYL+LodAuZPPwavJgsHZzoj0ZGG2T88FJKhdOhSETYAoaz/ P5fIk7u+RYLlI6M24iXCX3F6xOPVwOusLLFxidedU0jBbrsXv9UNU572QUEoncI5YzR2 S2HCrv283jo+Ek/end8pjPaHorUQaIZSX02CWL15MrJUgZ87Z0cEfcpEacCIHNR8RUhy MdVE/J3EYFbTZgYhl+6JRq8hyUPvonEATEt36K2Lf9qs2kf/584yLyTFsfM/Am8RbgXI NkNIQtXuAYHQDLottPcfABsCH5sJVPNcugEbu+Xf1t+aEGHhkagmHIA3ez2dpJz+8rxJ gSqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OqsQqZ4jSAEn3Faux+NptNZqoVM/+dGPooQb+uufGT0=; b=FxPcXbcJq//3/Icdg+0y1eJs4jNCM2KGBWDwUSU7QzSmVh4qTZ4wwuxpOakxSONryH K2MHB0qUtwhvFRmP4Q7gAk9fS3OJn6RWj6VxcbTk+U9ONet48nQuQp6iZ7DVZqsRi17v hRGNAPHk6XCMtxP1zspJvlQndUuKmlpz5T7Cu7qogSun6T8uS5lEK/E5r8K0dj6Ckbsb /cAHpkzDksWdTBic0xqbhKMabT0n41b97jeyFKdXsruTtI5ETS4X/SFsTW6j27iTsQDZ +VrQ/TRmPwXyJGKkdYTct3c/btGh04bwZ4PB0EzPa+KorVOqtXarbNrVMEP0i1qe459e UZ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NdymqHEj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me3-20020a17090b17c300b001c1171b611fsi4295826pjb.22.2022.04.04.03.30.38; Mon, 04 Apr 2022 03:30:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NdymqHEj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348931AbiDAOyf (ORCPT + 99 others); Fri, 1 Apr 2022 10:54:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347719AbiDAOda (ORCPT ); Fri, 1 Apr 2022 10:33:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DBCD282B11; Fri, 1 Apr 2022 07:30:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 14E9861CDA; Fri, 1 Apr 2022 14:30:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6125FC340EE; Fri, 1 Apr 2022 14:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648823436; bh=z66njuYd49OjwlU7JlCFlw3vri+eSHfebYnmc3OsGac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NdymqHEjhomJfYFUvOp7K1QPF5Qy+mBPy3ITDW6Z2k6tMRCBCDVFodHZZCvAmzkw7 dlTK1VaU2rg2xLTzP/wfXmq+Ckzs4G0RTNx2vfxHxal8sWBfZhUJ51J6vFRhqrDjCO pVtRnS8o5op6ZeGIv+x5aqR9PZbAp0Gb7QM6ToZv6xT5FrBGOUn2vNJSPSKOkv8Fby 2jZKwaMG49dWizpqiGRmcb/zWr2V2Oy6WdkjehvI5LFmpGXayvcBUAyZN55o7LehB2 fb89skAXf1Fi/hmglDw8OGoc5m6JiDYDsvvT+KAEGOF4btdIcYOkNL6Zcxy7L+/As4 9nXXsKeRmQFfA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Damien Le Moal , Jack Wang , "Martin K . Petersen" , Sasha Levin , jinpu.wang@cloud.ionos.com, jejb@linux.ibm.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.17 094/149] scsi: pm8001: Fix pm8001_mpi_task_abort_resp() Date: Fri, 1 Apr 2022 10:24:41 -0400 Message-Id: <20220401142536.1948161-94-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401142536.1948161-1-sashal@kernel.org> References: <20220401142536.1948161-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Damien Le Moal [ Upstream commit 7e6b7e740addcea450041b5be8e42f0a4ceece0f ] The call to pm8001_ccb_task_free() at the end of pm8001_mpi_task_abort_resp() already frees the ccb tag. So when the device NCQ_ABORT_ALL_FLAG is set, the tag should not be freed again. Also change the hardcoded 0xBFFFFFFF value to ~NCQ_ABORT_ALL_FLAG as it ought to be. Link: https://lore.kernel.org/r/20220220031810.738362-19-damien.lemoal@opensource.wdc.com Reviewed-by: Jack Wang Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/pm8001/pm8001_hwi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 9ec310b795c3..da9cac6671a3 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c @@ -3703,12 +3703,11 @@ int pm8001_mpi_task_abort_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) mb(); if (pm8001_dev->id & NCQ_ABORT_ALL_FLAG) { - pm8001_tag_free(pm8001_ha, tag); sas_free_task(t); - /* clear the flag */ - pm8001_dev->id &= 0xBFFFFFFF; - } else + pm8001_dev->id &= ~NCQ_ABORT_ALL_FLAG; + } else { t->task_done(t); + } return 0; } -- 2.34.1