From patchwork Fri Feb 24 14:43:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 656392 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 DF023C678D5 for ; Fri, 24 Feb 2023 14:45:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230040AbjBXOpF (ORCPT ); Fri, 24 Feb 2023 09:45:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230034AbjBXOow (ORCPT ); Fri, 24 Feb 2023 09:44:52 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38F8A26586 for ; Fri, 24 Feb 2023 06:44:51 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id h17-20020a17090aea9100b0023739b10792so2943233pjz.1 for ; Fri, 24 Feb 2023 06:44:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=PufpVu5hUml4du78szGYeulS3qNwbQ3Ik3VnnjXGg6A=; b=PqkW6BUp0WejiDHLS75h+XyBAD0BUoLNtMY7wV2gU3IGUc6MHiR1m7dhp+x2OPmDYu 7PVTjntX/H+JZlfQ0W8Nglp8cGbGcMFRJv2hGrTwE7X1o1SioIzilXsZvOBlVU+AEeWu Kq0RU7Qpaj608siOWqFGDuy8kHOkjOTyv9ZRA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PufpVu5hUml4du78szGYeulS3qNwbQ3Ik3VnnjXGg6A=; b=Ae+qw+HWxg6sFDslOF2QJU6z7jMFUGg3L1OOJwamDIUaw8t2ub2kZU5ngNq59mITTi 2BFc72VWdXirPC3WCAK172WjuJKQsvpFJLhmws62LMSpha3JoGJZAzJy2ktVGUhpReAw XNks5demOr2Qzb9XcoFroxR7xZ87Ct3HdzIGC+6dP0pnxWNf1g1JNl2gnpeWOMNVmxSR 3HwzixSYCDw/UEs+KE7n17mXzyNI0G2vYpVmgYZjEBqomOlPHjQondTUb+H+9jzPlYc/ Nr/Ll4xnPYjV05OLiFxiXBUJBUFghKE6FIpaCWO16YIz+7Pa5ks/GbFySB9l2VT9Zuwv rpMw== X-Gm-Message-State: AO0yUKX10lZwn9k+5ApnHUipW0Us4KUzonEDbdCeSF7uxxyWnH2qkUiA dgH3Vjjuj84BAmPcoZd4o5GROkitxpDLKfzap77yGrer/bs+QGHePJ6OvNKYgegKnFqwFNUTwnM nA2upm0XKZ/uc0aKcoT+b8umORWjg7sAOi7cBCWGJ3yctlbHgGEFY/UuOsoCs7kbg++U0lGfFSe nPfrqOrFM= X-Google-Smtp-Source: AK7set8ZgufrarZBhxt9d2dTsPDgJeTvigPK4ksCD9Qbqg4tpV/jqYtDU39IJxlLdwL5cpy7N5qtwg== X-Received: by 2002:a17:903:27c5:b0:196:191b:6b22 with SMTP id km5-20020a17090327c500b00196191b6b22mr13356250plb.59.1677249890355; Fri, 24 Feb 2023 06:44:50 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b5-20020a170902a9c500b00186748fe6ccsm8911549plr.214.2023.02.24.06.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Feb 2023 06:44:50 -0800 (PST) From: Ranjan Kumar To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: rajsekhar.chundru@broadcom.com, sathya.prakash@broadcom.com, sumit.saxena@broadcom.com, Ranjan Kumar , Sreekanth Reddy Subject: [PATCH 14/15] mpi3mr: fix admin queues memory leak upon soft reset Date: Fri, 24 Feb 2023 06:43:19 -0800 Message-Id: <20230224144320.10601-15-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230224144320.10601-1-ranjan.kumar@broadcom.com> References: <20230224144320.10601-1-ranjan.kumar@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org After soft reset, while setting up admin queue pairs driver initially sets admin request base and admin reply base addresses to NULL. It leads to DMA memory pointed by these pointers getting leaked. Signed-off-by: Ranjan Kumar Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index a2998893835b..ab8326b532e7 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -2623,14 +2623,13 @@ static int mpi3mr_setup_admin_qpair(struct mpi3mr_ioc *mrioc) mrioc->num_admin_req = mrioc->admin_req_q_sz / MPI3MR_ADMIN_REQ_FRAME_SZ; mrioc->admin_req_ci = mrioc->admin_req_pi = 0; - mrioc->admin_req_base = NULL; mrioc->admin_reply_q_sz = MPI3MR_ADMIN_REPLY_Q_SIZE; mrioc->num_admin_replies = mrioc->admin_reply_q_sz / MPI3MR_ADMIN_REPLY_FRAME_SZ; mrioc->admin_reply_ci = 0; mrioc->admin_reply_ephase = 1; - mrioc->admin_reply_base = NULL; + atomic_set(&mrioc->admin_reply_q_in_use, 0); if (!mrioc->admin_req_base) {