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: 413533 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 82BEDC433DB 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 44E52619AB for ; Tue, 30 Mar 2021 10:47:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231743AbhC3Kqu (ORCPT ); Tue, 30 Mar 2021 06:46:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231529AbhC3Kqt (ORCPT ); Tue, 30 Mar 2021 06:46:49 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9A5FC061762 for ; Tue, 30 Mar 2021 03:46:48 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id gb6so7563263pjb.0 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=mXVQVZcGs9qABHasjGWHz82U0f9sDniBq4Dopkc/Jjc=; b=LxyBr6iUn4HKYRKlHQ1NZDlNM8mLnQrHEU6u3bySOcUwucUwh/a50KC4g5f7N2tjuk ui+LDltusBw44zesFgKl/JSf6KeQJk+OoipQddRbF7/CQGDbNTKF0RuFtIMZ7ABQlv0f JPIMIeSablSLzA2f6lFqW1T2hAFyrJdtKsx7o= 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=mXVQVZcGs9qABHasjGWHz82U0f9sDniBq4Dopkc/Jjc=; b=GHO60j3nzbH+6X++7Cbpqkz3CKWcDenJVqE4x+fH8sIQZ1fzVltoRsgTmEU8gJ5s0C pbInrMAX0kaA33wEHv5Rh5BCZRh0Iz7zgVYcMk2m0Pf1sf3KzmhKcND1Vfe54BUCW8ZS 9jT+1AspEokGhsOxRQ9t9eVh4A7wl3zwxjZvH+4eBp2eZ1eSneB4kf2MfNNCVl0qn5+8 e+rJInINuE3tBA2oDF8WgTdDUlkFnI6okHfqK7GJVYOEpr51zPUvAthTrekKvSl2a6GL Z0drtOt0UFrCsFyoGq+TCPNRa+mnbl9zwPIQloGFWuIrWEnXeC1rX1rkuSvmii+ZaQGu Xc1Q== X-Gm-Message-State: AOAM530nPPQeH+JB6l5FFvsjdg1ktE5nhk8XJafnl+RnGENLEi43n5Y5 Et+xSWvJ3t5vsfPAVUAmHWPQ+A== 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: stable@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,