From patchwork Thu May 5 18:48:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 570153 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 1F13DC433F5 for ; Thu, 5 May 2022 18:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384150AbiEESrm (ORCPT ); Thu, 5 May 2022 14:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384257AbiEESrV (ORCPT ); Thu, 5 May 2022 14:47:21 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C06FC606C4 for ; Thu, 5 May 2022 11:37:49 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id c14so4322525pfn.2 for ; Thu, 05 May 2022 11:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version; bh=FSQYakCEv1rrLqYb6g7hBavsxbn3irhnv0IdpOvrpOE=; b=iJkhjSzgjD0vkh1U0otTkte4Rvt6kgEbwXzOvOc5mqmRPl3xM781jWhEicneh1PRpc a3UqmEOgLlsEkyAFcAJHZYZ4NjT/TqsW8MgRbSmlu6FeKUKS4aH5HAHaupLZ9YeaRUjn dAkD7/v4EbVmTGU6Y2Q1dkrKlfDqZ/RpDQw4g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=FSQYakCEv1rrLqYb6g7hBavsxbn3irhnv0IdpOvrpOE=; b=aAwFSOGNAIGyJ7As4lg7pmK/aLFHnyZU4h3WuMydOn/4dyr0FelSoWxYh1NX2jzvVf H/Jf4B7sjHza3nTEXXpqdg6KmCESWvB/K7r1XmYdEO7LEl0Lc796HcJ4IqeH9EVHNU5S c+otou1cVHce/1JDXzZ+xgUksxYMGBp0FByX9XFhpWQ0l+7Jp1e+qijldE/28srIVkM5 SKKKPCm8vNHU2FBQkGgHckzEDsl54eMrXyhHVYF0qc+NB49US9ASF9xvqKpPF/DKfPE2 A3oTnIFvClAGhBiOThQ6O/KOtGd0XHLQF5ENjkhneOBa0bH4gTsB3VBiwNA2fQly1Ows dSEg== X-Gm-Message-State: AOAM531AvwbFvHvnDW+s6R2olgE+AzgTRv9QU2lKnpEanOsirVtkrgye AfArbXdLGmj9yyk8a8a2QeW8fA2vFF0Vr9NcNshc8+ypjBhGkL+BQpXXHFnXUYhDPBj4yuTxl2f naYBmx07wBnXiQFPIZVZeGsnG1Kb4d2YbBxpPjGwDkWYDCZug6LCCULQuTv7Grbm0zTVIjahBwK 6gRfzYmZb8TAk= X-Google-Smtp-Source: ABdhPJzZmSwjg6aCzCoVyAS6aGWuacVpThK0UjltJBp7x9PoMbjfF8CAj22Ih9IAQN4ImXQlZYvxnA== X-Received: by 2002:a05:6a00:4197:b0:510:671d:709c with SMTP id ca23-20020a056a00419700b00510671d709cmr3258810pfb.61.1651775868530; Thu, 05 May 2022 11:37:48 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 4-20020a170902c24400b0015edb22aba1sm1696166plg.270.2022.05.05.11.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 11:37:47 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, Sreekanth Reddy Subject: [PATCH] mpi3mr: Hidden drives not removed during soft reset Date: Fri, 6 May 2022 00:18:07 +0530 Message-Id: <20220505184808.24049-2-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220505184808.24049-1-sreekanth.reddy@broadcom.com> References: <20220505184808.24049-1-sreekanth.reddy@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If any drive is missing during the reset, the driver checks whether the device is exposed to the OS and if it is, then only it removes the device from the OS and its own internal list. For hidden devices even if they are found as missing during reset the driver is not removing them from its internal list. Modified driver to remove hidden devices from the driver's target device list if they are missing during soft reset. Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpi3mr/mpi3mr_os.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 5c57519..5ba490c 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -911,9 +911,11 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc) list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list, list) { - if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) && - tgtdev->host_exposed) { - mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev); + if (tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) { + dprint_reset(mrioc, "removing target device with perst_id(%d)\n", + tgtdev->perst_id); + if (tgtdev->host_exposed) + mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev); mpi3mr_tgtdev_del_from_list(mrioc, tgtdev); mpi3mr_tgtdev_put(tgtdev); }