From patchwork Thu Mar 16 11:02:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 13177378 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 8DFEFC6FD19 for ; Thu, 16 Mar 2023 11:02:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbjCPLCn (ORCPT ); Thu, 16 Mar 2023 07:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjCPLCm (ORCPT ); Thu, 16 Mar 2023 07:02:42 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B2C5497EF for ; Thu, 16 Mar 2023 04:02:41 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id gp15-20020a17090adf0f00b0023d1bbd9f9eso4970393pjb.0 for ; Thu, 16 Mar 2023 04:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1678964561; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=l3qOOiEywtyE2UuGBQVQWoHeKjT9ByiYMBk4GpO1Qb0=; b=YnW0v0ZdfChKyYsfHgW+4umwdFXpWUiWXjomOAzl/SZCJejPoMeuRiP8TFzZRK4JBj v1m2K3kOWguV2UpCSJwM1LaZZWLw1GjtFSaCYFrRh942aF5axZ8fycA7wuoehfddNtIk 8B0l/z6NUeW09R5SMoZHbhYupO6qtzasIJDkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678964561; 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=l3qOOiEywtyE2UuGBQVQWoHeKjT9ByiYMBk4GpO1Qb0=; b=Pz1L6wmH0xpHnH2uvQ+fhk2MyfKbcdeGtNCvbacEMAcf1gZ5QoZ7KZ1HlSSgs+CdQ9 a3THr93VgdJOflbnpA8EhpCZEG0SB+b09i/9x0k/z4yrYIoNYj++ff2f0R4Wmg5EJLQn WXXZ+fjjvRzN8a5AwooHu32i9W89V5pja9Ke5iwxLNQArYrthS/ihiqeF0qHwa7kivFV Yla0SA+SeNzBOXs+6On6SJJYZYC9r8HYQBm3rnqGR2Kbs3VktP2APuSpITm2YfzwoHDl v43YvN4/KZ7P5MO0sm1a08IyZh8MFNJ07VK0OfedUe9+OCwlByyplA/MJOt7t6L7xOGU 5H5w== X-Gm-Message-State: AO0yUKUSvPQ4sMfwzQ132Ep9eoGhDuWl0sj06jYOiySDECRb5bvkUNJf BcP+9qBUPIZpSy0hXyAwCVRjcntls/eRCKQLOyaeCJWlMq7zk+NQRwf2XBh2vOTcd5Wv8K+1i6F mpiFiPqr0+XInPWPmT1RnkKwiD9kNV40HpTmw5c4c0+rqGLc2VJH6d0JMAOQYHgmTEkYxBmfEGN Rvm7aPG28TVQ== X-Google-Smtp-Source: AK7set+JkydwoZbMT3OYZcysY9k5KN+p7vvsGu7JCeyo+lR2uViAPirLdf6lP6efXCNhRVNW97hP7w== X-Received: by 2002:a17:902:c40c:b0:19e:2eb5:712d with SMTP id k12-20020a170902c40c00b0019e2eb5712dmr2955896plk.25.1678964560797; Thu, 16 Mar 2023 04:02:40 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id kb5-20020a170903338500b0019a6cce2060sm5343590plb.57.2023.03.16.04.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Mar 2023 04:02:40 -0700 (PDT) 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 2/8] mpi3mr: fix admin queues memory leak upon soft reset Date: Thu, 16 Mar 2023 16:32:03 +0530 Message-Id: <20230316110209.60145-3-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230316110209.60145-1-ranjan.kumar@broadcom.com> References: <20230316110209.60145-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 | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c index 758f7ca9e0ee..25ac3bc597f5 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_fw.c +++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c @@ -2597,14 +2597,12 @@ 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; if (!mrioc->admin_req_base) { mrioc->admin_req_base = dma_alloc_coherent(&mrioc->pdev->dev,