From patchwork Tue Mar 30 10:50:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 412156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_NO_TEXT, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65239C433E0 for ; Tue, 30 Mar 2021 10:47:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BE7D61985 for ; Tue, 30 Mar 2021 10:47:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231637AbhC3Kqu (ORCPT ); Tue, 30 Mar 2021 06:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231675AbhC3Kqt (ORCPT ); Tue, 30 Mar 2021 06:46:49 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0008C061574 for ; Tue, 30 Mar 2021 03:46:48 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id v8so5948849plz.10 for ; Tue, 30 Mar 2021 03:46:48 -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:mime-version; bh=itNGqfzjBjsXKHftKXGJ56052ylA1QwACNB8iPOgTwk=; b=K69dBeRhM9K3OmGHBglafmmEwaqI/wdXI3PMfiwEKQ5lAwOelwbk+RwRZ+OjagZqaq f2Rbt8hOPMomTECjVaqeoJrfb92yjb0iaXi86KcxQc686zjYUjSitBkVC0VIim1Ulu0l LS4h1KZDWx3j02VcliNT5AkfzqV9AaehEpt70= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=itNGqfzjBjsXKHftKXGJ56052ylA1QwACNB8iPOgTwk=; b=ay2yscW9CS2Z7PGEiZukYYmXJB3UVQvVxnhGqpAEveV1+CXyONEZCJ75E4EoEONAxK mz38oL9RQCyTCN3UpSgCLkAIZESX02FDWJ1Eeb18qDVzVN2tw1bA1bxoNqmkFTZQ+So2 djBUiQ1PWe6KOiG4pczZVXbH6CRahr7UlrjbSjGjyjQWEPEFXZwNliWDuL1UlPyFliEC 1w8mf2IHmaHSEyZLB/x+jhlAS95py5knBt162RaPJEJH9GgnuUrgDZzEcCGSvJ5Zz4E/ Be/r6oZBKmSklE2Yumt0UqaZU1oaKW5l2S16NAvmKcqWcJYZbEvcNqWQ7Z4B14Smbu2e q6iw== X-Gm-Message-State: AOAM533KjaGpIrhI8WVJw89a32jF2W/bgOa+n/6GiHD41vXzrms0PPJU W/v/lm4qBT5T/miw9XrLdI7I8TMSv4c1Lw== X-Google-Smtp-Source: ABdhPJzzrwf6DcR51UtuY0kdz8zepbTCCNWt1xTNxpp5q3mOxXL4U8sNaW1jArL8usjurLjyRDTppA== X-Received: by 2002:a17:902:7c0d:b029:e6:f006:fd02 with SMTP id x13-20020a1709027c0db02900e6f006fd02mr32003554pll.46.1617101208304; Tue, 30 Mar 2021 03:46:48 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id g10sm18913963pgh.36.2021.03.30.03.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 03:46:47 -0700 (PDT) From: Sreekanth Reddy To: martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, sathya.prakash@broadcom.com, suganath-prabu.subramani@broadcom.com, Sreekanth Reddy , stable@vger.kernel.org Subject: [PATCH] mpt3sas: only one vSES is handy even IOC has multi vSES Date: Tue, 30 Mar 2021 16:20:04 +0530 Message-Id: <20210330105004.20413-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Whenever the driver is adding the vSES to virtual-phys list then the driver is reinitializing this list every time. Hence those vSES devices which were added earlier to this same list are lost. So, Even though multiple vSES devices are configured in IOC; but while scanning the vSES devices driver finds only one vSES device in the list and hence adds only that device to SML. So, don't reinitialize this list every time a new vSES device is added to it. Cc: stable@vger.kernel.org #v5.11.10+ Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 6aa6de729187..ae1973878cc7 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -6483,6 +6483,9 @@ _scsih_alloc_vphy(struct MPT3SAS_ADAPTER *ioc, u8 port_id, u8 phy_num) if (!vphy) return NULL; + if (!port->vphys_mask) + INIT_LIST_HEAD(&port->vphys_list); + /* * Enable bit corresponding to HBA phy number on its * parent hba_port object's vphys_mask field. @@ -6490,7 +6493,6 @@ _scsih_alloc_vphy(struct MPT3SAS_ADAPTER *ioc, u8 port_id, u8 phy_num) port->vphys_mask |= (1 << phy_num); vphy->phy_mask |= (1 << phy_num); - INIT_LIST_HEAD(&port->vphys_list); list_add_tail(&vphy->list, &port->vphys_list); ioc_info(ioc,