From patchwork Thu Mar 7 15:08:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ranjan Kumar X-Patchwork-Id: 779627 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 2C47342052 for ; Thu, 7 Mar 2024 15:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709824252; cv=none; b=jPIkRY/RFlAII0+/cCTRp5N6s2/ZmPk22H8+jBrvL/uOyqenlo46hlnw5LniGWNS1T+j47P0T8joVAn1ilRJ5Jwql9AI2QAp1ZZDaFlBUh2zDe63k3EOvaA5NnK+o23AOnN7DSIAxOEDQmt0d2PNdlf6xIQhxMbqLNZ5KJ+ufDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709824252; c=relaxed/simple; bh=IT2Uh+qtJciGwMdkWs+7aTImk1+zqNNFH0miQSBjkqc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=iP1yo6VfVmPUvT0vP+o7+t6seeluHLkxrpszxoWgz3NoC173NwASPEb0t2mf9flVmJD1UOBjlUdIqwADBi+/jqYlSKfLUXqpBCb4UB8sBnbrwp6bgi96GHMy13YxKZHvrSaj1YxFf3/F5qXQdA8ToWQcKyy68A1ti0aQylD4prQ= 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=VOnrT6y4; arc=none smtp.client-ip=209.85.210.176 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="VOnrT6y4" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6e6277f72d8so777469b3a.1 for ; Thu, 07 Mar 2024 07:10:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1709824250; x=1710429050; 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=t2F6ObH7f7OoMNiPnJz4Aq+i55mfMlJFYFepqfMYAeU=; b=VOnrT6y4YAP561FySLCYJk0tDVmLXP67m8H6jCG/atskTWgTU99xunsgnhuBMr//K6 Z3tGR88wa6jptETnDKwRdZmpPM4kY/lYX6q2pcEmvUnTU200u6bBnm5QWWDvnxaha9y2 HkwTC7Lk5dBpboQq5cOUjziZJbhSIbmF08ylg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709824250; x=1710429050; 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=t2F6ObH7f7OoMNiPnJz4Aq+i55mfMlJFYFepqfMYAeU=; b=athGHZqw8MWHXTV42X2PhyKChpzXLDIhr48GAVMVQU6Z1C/0VT3fcEq62SHKPIXl28 xT9QUBFkYw2LOsdOLWfH3JMdfUEfABpt86IdDLV6RO9dK1S4L5A671YEOz2gq6A436rd 0Mp25grgisQpdIwzFg0h2UPg75LvA3FW9SIpTj68jVdjk31Y/r/1/zx8eUTePlXqZTNm 6NtpLo7tDRb++it+F/6/OPjR7+zlj4MQcMFvKNCnJLJZuzsYdNeN6JV4Yt7J2B5bl5Uf Q9HHnYRGpLECFCSU1DK3k2wYS4bTC1yxCE6T8w2CDRLMXazENL7WvyCFP0TjCVa43oTO 8VEg== X-Gm-Message-State: AOJu0YylDOBGTITr+c9MU8TYaq1H3mDPFodq2GhshwlpbBW16aKtugW1 5DTbv8fuAP1LJhXIgh9C3jrORmM5lugnfNt6Qtga3DkN2kBnH3e7bkbIUcaGoppDaG+AVyrunjQ RUcWkVFOgXHmEOOpcdZ76roBaFedgMbJ1Tmh8He8ak+Y+ZWIUEX+rjp6o3Vk/UXRxvWZ1VouWYV GRd+Jcd/DObIx9XVWPfjAT0JBB79ycJ5Hm6xgh14L22VzD1G8P X-Google-Smtp-Source: AGHT+IHVQ0jX9z/mI1WSrIIeT+BYJwAuJXesSnWkdtMRhAQra6BHr6PiE5bzHOLV5PhfXZpH2EylVA== X-Received: by 2002:a05:6a00:9294:b0:6e5:56b5:606a with SMTP id jw20-20020a056a00929400b006e556b5606amr21383454pfb.11.1709824249810; Thu, 07 Mar 2024 07:10:49 -0800 (PST) Received: from localhost.localdomain ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id w17-20020a056a0014d100b006e58da8bb6asm12009906pfu.132.2024.03.07.07.10.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 07:10:49 -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, chandrakanth.patil@broadcom.com, prayas.patel@broadcom.com, Ranjan Kumar Subject: [PATCH v2 1/7] mpi3mr: Block devices are not removed from OS even vd's are offlined Date: Thu, 7 Mar 2024 20:38:19 +0530 Message-Id: <20240307150825.7613-2-ranjan.kumar@broadcom.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240307150825.7613-1-ranjan.kumar@broadcom.com> References: <20240307150825.7613-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;