From patchwork Mon Mar 11 11:35:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 779975 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (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 6991329CEB for ; Mon, 11 Mar 2024 11:37:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710157065; cv=none; b=Zsk9UqRF9Giv6zTZ0BsVT3R3FSYAjY1QYwZKZy/p85t5OKG4Finma/x73HSaQ/dUkD9GIpLzuGnN9zUz49/pCZlMmBMRD/j0/TKimD9SOvf4aX93XbOb2dcMl9p3wxogLetCTzavsK5ZjMi6FRLIjmCkkUiNUTxl9Sw3jRZ5bnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710157065; c=relaxed/simple; bh=ZgCuepGiEpfP0d0YxICknUfvTQq34RgnwbDfWyb9qMw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=i10aU5lPnWupQEDSJiI9QzM8MoZrQHgrW0awrPUGXvn8ppuSduQMvAUyih9nb4arE8shRCGsCxwb3sXNAF1KneIF+zDv8owguLK/SohSZOfNDEm5ndRRtzsXHhQDneeBS/+hTb8CpxhAlS+taO6hcwIYDTdEpz/6hAnCZzaevnM= 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=DYHLCprh; arc=none smtp.client-ip=209.85.216.52 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="DYHLCprh" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-29bb5bec0e4so1892070a91.1 for ; Mon, 11 Mar 2024 04:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1710157062; x=1710761862; 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=sjsIAy1QU36zUQILe2Nr75U9vZP/HJuFe3OEsik6Ilw=; b=DYHLCprhbq6BIQqeWecVBfiTri5fjhm2LgUmCFyudy8VL6ekxQdA/89iSdRh4SDnrh Z8tf2dWfGRavt4/P2++MAdM5BgjuEWWXZqT2AGM60pRoCWkU2jCppTuXQ5Oy8b6lcCzB mLra0pYQrpMNTuwbe16elLOrREwHoV6vIi5fU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710157062; x=1710761862; 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=sjsIAy1QU36zUQILe2Nr75U9vZP/HJuFe3OEsik6Ilw=; b=JNdF53G9FUkL1WpOFSstiqWgPkOD3+2rc956HkgTnWHlOJnzKa9fwvU/mhkoiI5I7D 6EtnAwhgEqqYIw0WBtk0X2JYs0Ny0+kqAuIrSqBXDMLRYFG8ZgIan8NzM/ZknIxZEB1Q ML1boHdZHpiB4bYBYVX/YjpB21dV0Rjjo7IIrhzWnZYQ2y5l9McdPb66VjlNmGo9umzx JtHmrSbvRxibOfC7IsoBuVOVtZfOd1lyrshWJoCUxV07jr/PxBLcmVbEUb9z6c8QF7eT ncJafDN99o67fWDAuoGwDelWNktYnsdjO+wJyktiPM8yrIZkot2Iz/C6yKFu9wuFSNXH j0bw== X-Gm-Message-State: AOJu0YwyeG9fwXG4piH4X12WNKyKEn1igvxFdgZD/ra6Rd9u+bo87dpx kpVKejLhKEYzi49LfWtJVmCof1k54pAXACAW9xD4s8Smm6kqNMKN2hutRpKHTmhYZY7JvU5fuFy 2PRk4FmwH3ojC9k5aNqnYc9rSHMAXN5u2Ke3VgsPtwDu0YDIOgOfvbb6l97D1eRIgSaju9e7a5p 4JCIPObdVX8yeeZ6Xjtv4iVGMs8gTI/L85ZP5gj25q8cM7EQ== X-Google-Smtp-Source: AGHT+IE91F0RGvzXBqhEfDz5vqhXiukXcqNO3dga+sGkkRErdURAFeTm8sAYM3dB0ZTZ/hl4TwzSPA== X-Received: by 2002:a17:90a:9a97:b0:299:300c:4c71 with SMTP id e23-20020a17090a9a9700b00299300c4c71mr3550755pjp.28.1710157061688; Mon, 11 Mar 2024 04:37:41 -0700 (PDT) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id ay3-20020a17090b030300b0029ba5f434a8sm3982655pjb.26.2024.03.11.04.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 04:37: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, chandrakanth.patil@broadcom.com, prayas.patel@broadcom.com, Ranjan Kumar Subject: [PATCH v3 1/7] mpi3mr: Block devices are not removed from OS even vd's are offlined Date: Mon, 11 Mar 2024 17:05:08 +0530 Message-Id: <20240311113514.108795-2-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240311113514.108795-1-ranjan.kumar@broadcom.com> References: <20240311113514.108795-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;