From patchwork Wed Mar 13 10:07:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 780462 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F760125CF for ; Wed, 13 Mar 2024 10:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324629; cv=none; b=SYrbQiCCvAF4VXjDUbWBTjUsqlWWoi2/Hnh/+hlA4HTzr+/s/ThFEceKMmJSxUuUDRv+rT0skD+L2c7IUn6BewKMXnri6kvEavJpvw69tEuKDUbKWk5sbfSjPChpACjacmpyR3dXMEmJGYNNNqllR20km2IzflQm2VxTAufP0Qs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710324629; c=relaxed/simple; bh=v5pEK2tlG1N+Spdq6ueyxLlHOzKg96Ga5+re19ZQ8x4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=UG9iYjEf40bvm1QIRq9j3hAgRZAGSlTlg8iVk2W1GzIgAlvfKVGA0j0IX9LXw1DSrZI6O6ZwwpFN9qI01rJovnjZEeyuq64Pjmv29u0DECUCg2E6UUkdEwlUASupJhO3Q1En+ITMZd3h0VpqQQw2fJQ7WvYL79NiQHsQQxdNpVA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=QWqRRfA7; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="QWqRRfA7" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e6adf257fdso1356103b3a.0 for ; Wed, 13 Mar 2024 03:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1710324626; x=1710929426; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=sCJmMNSq9HH/dOQ4h4/2xFRtDqp9JhaV38tysWIaTTs=; b=QWqRRfA7n3yIqVhfUbUOWqXJk/ryVky0Psjq1gseb6nqiOvpJnwgOF78xtCzuX8wt8 4KitqauTE9gPp2xSaHmtj+SZ5ipn5q0dNyH+UZFRjYzEOe6yJnGZkyP03K2kocGLfre/ GaTjSEdp7QAOQA//BoO/DJiruasjZm3ibWwrc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710324626; x=1710929426; 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=sCJmMNSq9HH/dOQ4h4/2xFRtDqp9JhaV38tysWIaTTs=; b=ILftT3sBZ65EpkhTI9iS5IaVKC9q+aUZc86+eYcQ4VLZcLL72/2rVBW1to1yI6IETh O9b9Tai0NthSjvqvjv9Yu4tsTMikRNDrXGLH3+IoMTHLktN2WwrsFGYXjyFGMPQ4E4dS C4VxyjGYUIsVuDt1aFnv52JSwX5ClmaPb32TEVt3JvCnK+0QLRGLgrufaPgeamR77d3Q UJo7EtLAzATTMHAC34KkEIk+0IDCGw3fN0AUJY6WYl3Lcx7TdMdwpD16P7LHUWJG5kys tEqy2zFA2SYHO/sOhPl5JGLtz9Iz/pC8wi8JNXZn5HMWxrfRAH4UBcAbVU+AYK6rbUgX pmtQ== X-Gm-Message-State: AOJu0YxNy5faIlHueDKzz9paDbKE+tcol/Xi15No4Te6YCLkCumAJC2A 99H7XIlcPz10uonLkYfUzybxYr3Wep0mFyEjL2h/JiEqJQ9WvlBX9fZuCnpPP4R5lABKXQ9p9Wv lv1uLIeXk0FwRvxdQxAk47Q8v4NThNqxBgA39e/F/N7EqI9e/pnyALG9UbgNkemfJ+Dt8IvX7/5 Cw0Zmb0/rhs4GEG6S8U2BLdQ3fFHeMU4Sv6vjApo4O+KG9QQ== X-Google-Smtp-Source: AGHT+IGimHPEC87SwFHdriTB/Vner6yu4b0jVY5RXsXN0uRI1bvoz7NON3/Q8IYLFrsE4LyYtGcwhQ== X-Received: by 2002:a05:6a00:23d2:b0:6e6:9ff1:31b7 with SMTP id g18-20020a056a0023d200b006e69ff131b7mr2039260pfc.16.1710324623733; Wed, 13 Mar 2024 03:10:23 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id j18-20020a056a00175200b006e5af565b1dsm7570337pfc.201.2024.03.13.03.10.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 03:10:22 -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, chandrakanth.patil@broadcom.com, prayas.patel@broadcom.com, Ranjan Kumar Subject: [PATCH v4 1/7] mpi3mr: Block devices are not removed from OS even vd's are offlined Date: Wed, 13 Mar 2024 15:37:40 +0530 Message-Id: <20240313100746.128951-2-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240313100746.128951-1-ranjan.kumar@broadcom.com> References: <20240313100746.128951-1-ranjan.kumar@broadcom.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The driver did not remove the virtual disk that was exposed as hidden and offline after the controller was reset. Drive is removed from OS when firmware sends "device added" event with hidden bit set or access status indicating inability to accept I/Os. Signed-off-by: Ranjan Kumar Signed-off-by: Sathya Prakash --- drivers/scsi/mpi3mr/mpi3mr.h | 2 +- drivers/scsi/mpi3mr/mpi3mr_os.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr.h b/drivers/scsi/mpi3mr/mpi3mr.h index 3de1ee05c44e..06359915a48d 100644 --- a/drivers/scsi/mpi3mr/mpi3mr.h +++ b/drivers/scsi/mpi3mr/mpi3mr.h @@ -1348,7 +1348,7 @@ void mpi3mr_wait_for_host_io(struct mpi3mr_ioc *mrioc, u32 timeout); void mpi3mr_cleanup_fwevt_list(struct mpi3mr_ioc *mrioc); void mpi3mr_flush_host_io(struct mpi3mr_ioc *mrioc); void mpi3mr_invalidate_devhandles(struct mpi3mr_ioc *mrioc); -void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc); +void mpi3mr_refresh_tgtdevs(struct mpi3mr_ioc *mrioc); void mpi3mr_flush_delayed_cmd_lists(struct mpi3mr_ioc *mrioc); void mpi3mr_check_rh_fault_ioc(struct mpi3mr_ioc *mrioc, u32 reason_code); void mpi3mr_print_fault_info(struct mpi3mr_ioc *mrioc); diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 73c831a97d27..bfd32354b662 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -1029,7 +1029,7 @@ mpi3mr_update_sdev(struct scsi_device *sdev, void *data) } /** - * mpi3mr_rfresh_tgtdevs - Refresh target device exposure + * mpi3mr_refresh_tgtdevs - Refresh target device exposure * @mrioc: Adapter instance reference * * This is executed post controller reset to identify any @@ -1039,7 +1039,7 @@ mpi3mr_update_sdev(struct scsi_device *sdev, void *data) * Return: Nothing. */ -void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc) +void mpi3mr_refresh_tgtdevs(struct mpi3mr_ioc *mrioc) { struct mpi3mr_tgt_dev *tgtdev, *tgtdev_next; struct mpi3mr_stgt_priv_data *tgt_priv; @@ -1047,8 +1047,8 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc) dprint_reset(mrioc, "refresh target devices: check for removals\n"); list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list, list) { - if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) && - tgtdev->is_hidden && + if (((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) || + tgtdev->is_hidden) && tgtdev->host_exposed && tgtdev->starget && tgtdev->starget->hostdata) { tgt_priv = tgtdev->starget->hostdata; @@ -2010,7 +2010,7 @@ static void mpi3mr_fwevt_bh(struct mpi3mr_ioc *mrioc, mpi3mr_refresh_sas_ports(mrioc); mpi3mr_refresh_expanders(mrioc); } - mpi3mr_rfresh_tgtdevs(mrioc); + mpi3mr_refresh_tgtdevs(mrioc); ioc_info(mrioc, "scan for non responding and newly added devices after soft reset completed\n"); break;