From patchwork Mon Dec 20 14:11:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 526252 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 3907DC433EF for ; Mon, 20 Dec 2021 14:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233444AbhLTOET (ORCPT ); Mon, 20 Dec 2021 09:04:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233424AbhLTOES (ORCPT ); Mon, 20 Dec 2021 09:04:18 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE5BDC061574 for ; Mon, 20 Dec 2021 06:04:17 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id f18-20020a17090aa79200b001ad9cb23022so10243183pjq.4 for ; Mon, 20 Dec 2021 06:04:17 -0800 (PST) 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=puunVJnID0DLdjbEKd6m/mYP4H547Y4NwYbC5COE0Xc=; b=MXvIQcEYk0eeyzaIRzagVMNmKE7JIGqDjWSWlbpWg34peruQTdMSAm0jpKPlZNuATs amga6Or21AXJCm3L6ceP81sjYJDW0v9RXqE+8xwPqM5S9XJBCXGFIJ+9SLql7Z8iuLAS PmeVtJoXdrmFQ27WVYWFTiB9632J7zZxj+KdM= 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=puunVJnID0DLdjbEKd6m/mYP4H547Y4NwYbC5COE0Xc=; b=Bks37iJ0k8KQEHv1C8IPQiWVtKCZVmmejCL7OtoF85xlzjukpgtkP1oYTmhS7SgFpS t0qfl0fTOJZrOeVpp0HV5EBANmUhR9iaC704NurLZuRa8d4BcGvvHlOtdfMuNQqrxQ91 +S7Z2+qDqrXvRgCKJv76HTr/SzkJuyQcekfuHLIcT/mvlqXZm3KJC/i6ulHZv5uoDvau n1L/M+Vtl7l3ZTymvTh0Hv9i4LAoM7lEZTukW/lQvl2xCV0vFTF8Efeay79shNaSlBKC sWfsDJsv+vom8GuaNWoaEbQMSVSgQ0DlBZe8T/fkZFnDUVDMgJSuHmtYTuKxjouHcGjp nP+Q== X-Gm-Message-State: AOAM533dGnLhBsMSwByiL9afVBVyxPjBp3eWqPefDWdgusOySyTkwJt6 EjjuwkIoHNFhaRofebmD7pme2dwyepmg1CpP8l256PNOsF67/OybI2fsNM3Vn0gNImlxvHmKdVc 7f2FTLz9Sa8yF/raGompRxK63fdWXlj8enJUFVdRDAouQLFwLAihA6ysDi/u34glImfLaJtws65 0Xiqp7NSU1 X-Google-Smtp-Source: ABdhPJwwWH37XIGFicHmwJ8OzQoIVyTfPs0l2XZBdsmazEyCI0gr+VS4vGdxwtXLoYg1VXPgpgFGQA== X-Received: by 2002:a17:902:c947:b0:149:92d:fc44 with SMTP id i7-20020a170902c94700b00149092dfc44mr6873013pla.139.1640009056744; Mon, 20 Dec 2021 06:04:16 -0800 (PST) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id b4sm5434180pjm.17.2021.12.20.06.04.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 06:04:16 -0800 (PST) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, mpi3mr-linuxdrv.pdl@broadcom.com, Sreekanth Reddy Subject: [PATCH 07/25] mpi3mr: Do access status validation before adding devices Date: Mon, 20 Dec 2021 19:41:41 +0530 Message-Id: <20211220141159.16117-8-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211220141159.16117-1-sreekanth.reddy@broadcom.com> References: <20211220141159.16117-1-sreekanth.reddy@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Added validation for various access statuses prior to exposing attached target device to the operating system. Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpi3mr/mpi3mr_os.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 14621dc..2fe7fcb 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -831,6 +831,17 @@ static void mpi3mr_update_tgtdev(struct mpi3mr_ioc *mrioc, scsi_tgt_priv_data->dev_type = tgtdev->dev_type; } + switch (dev_pg0->access_status) { + case MPI3_DEVICE0_ASTATUS_NO_ERRORS: + case MPI3_DEVICE0_ASTATUS_PREPARE: + case MPI3_DEVICE0_ASTATUS_NEEDS_INITIALIZATION: + case MPI3_DEVICE0_ASTATUS_DEVICE_MISSING_DELAY: + break; + default: + tgtdev->is_hidden = 1; + break; + } + switch (tgtdev->dev_type) { case MPI3_DEVICE_DEVFORM_SAS_SATA: {