From patchwork Thu Jul 1 06:51:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1499366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GFpnl5k1zz9sWX; Thu, 1 Jul 2021 16:53:15 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lyqZS-0002nh-CR; Thu, 01 Jul 2021 06:53:10 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lyqYM-0001pT-GQ for kernel-team@lists.ubuntu.com; Thu, 01 Jul 2021 06:52:02 +0000 Received: from mail-ej1-f71.google.com ([209.85.218.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lyqYL-0007LD-IM for kernel-team@lists.ubuntu.com; Thu, 01 Jul 2021 06:52:01 +0000 Received: by mail-ej1-f71.google.com with SMTP id k1-20020a17090666c1b029041c273a883dso1739856ejp.3 for ; Wed, 30 Jun 2021 23:52:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fG/dcCSKaUE7V0G5j877FKCDbEL5d2VJepQvEFu+bhE=; b=pDJIvO3jqLVnN9GmTJNBDfHoIx2TRmL5uKF7RE5h0O6kG6Nx2EhibSVGkzWGeNwM7e RIsW+r5tgeWWTnqrUb+Dj3kS8BSXvPSL4MZ0uJaPWmWxsAQbiYUO014AzLyXvPDhHl1x mJ9zim6OUN3EeuoTrQ89IgAEvMStNrMnAinBHDRHd0mEhqjif1tv0Fnh0DnOM/fHkOLN XuysRg8isvlAeD5ZUAvX04CHkoFDNvLOb85b3T0VmlYU6V0aTnb8pMAC+kGSznNOQiWv B8ZQ/DjsIJo0HjDBy3gqYPZLRthISKdUchfkIOBZt0s8r/2wmEHIB8gn9Wdm34p/EUiR nyaA== X-Gm-Message-State: AOAM533jPTaSTo5xYGYsaNYTQD2q9HUXXxT3mDOXYjxyuu2+hz06U1gr zeW/OgnbKz3/dSj0TMnmz+4MU1FSvS3/tHkWj2YXeXvB+ZqGin7O00b5cvzNOhzBphk2GbRCF9p UqdnPoMqxl8l3UZsNg857kQgM0J2TFPwozdccokjx5g== X-Received: by 2002:a50:ff01:: with SMTP id a1mr51170516edu.253.1625122321129; Wed, 30 Jun 2021 23:52:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWwn7xQGsCANOHIiEpF+yKiWLY9x39ajmLpma5mVrfxMTmU0bM1rAPCj6mdwETtTZ1FtCUmQ== X-Received: by 2002:a50:ff01:: with SMTP id a1mr51170500edu.253.1625122320953; Wed, 30 Jun 2021 23:52:00 -0700 (PDT) Received: from localhost.localdomain (xdsl-188-155-177-222.adslplus.ch. [188.155.177.222]) by smtp.gmail.com with ESMTPSA id t15sm10394144ejf.119.2021.06.30.23.52.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 23:52:00 -0700 (PDT) From: Krzysztof Kozlowski To: kernel-team@lists.ubuntu.com Subject: [PATCH][SRU][F-hwe-5.11 23/30] scsi: smartpqi: Update SAS initiator_port_protocols and target_port_protocols Date: Thu, 1 Jul 2021 08:51:34 +0200 Message-Id: <20210701065141.6018-24-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210701065141.6018-1-krzysztof.kozlowski@canonical.com> References: <20210701065141.6018-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Murthy Bhat BugLink: https://bugs.launchpad.net/bugs/1933518 Export valid sas initiator_port_protocols and target_port_protocols to sysfs. Needed for lsscsi to show correct values. Link: https://lore.kernel.org/r/161549384532.25025.1469409935400845385.stgit@brunhilda Reviewed-by: Scott Benesh Reviewed-by: Mike McGowen Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Reviewed-by: Martin Wilck Signed-off-by: Murthy Bhat Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen (cherry picked from commit 55732a46d6c5289fb555bbdbff9c7222efd983c1) Signed-off-by: Krzysztof Kozlowski --- .../scsi/smartpqi/smartpqi_sas_transport.c | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_sas_transport.c b/drivers/scsi/smartpqi/smartpqi_sas_transport.c index 71e83d5fdd02..dd9b784792ef 100644 --- a/drivers/scsi/smartpqi/smartpqi_sas_transport.c +++ b/drivers/scsi/smartpqi/smartpqi_sas_transport.c @@ -65,8 +65,8 @@ static int pqi_sas_port_add_phy(struct pqi_sas_phy *pqi_sas_phy) memset(identify, 0, sizeof(*identify)); identify->sas_address = pqi_sas_port->sas_address; identify->device_type = SAS_END_DEVICE; - identify->initiator_port_protocols = SAS_PROTOCOL_STP; - identify->target_port_protocols = SAS_PROTOCOL_STP; + identify->initiator_port_protocols = SAS_PROTOCOL_ALL; + identify->target_port_protocols = SAS_PROTOCOL_ALL; phy->minimum_linkrate_hw = SAS_LINK_RATE_UNKNOWN; phy->maximum_linkrate_hw = SAS_LINK_RATE_UNKNOWN; phy->minimum_linkrate = SAS_LINK_RATE_UNKNOWN; @@ -94,13 +94,23 @@ static int pqi_sas_port_add_rphy(struct pqi_sas_port *pqi_sas_port, identify->sas_address = pqi_sas_port->sas_address; identify->phy_identifier = pqi_sas_port->device->phy_id; - if (pqi_sas_port->device && - pqi_sas_port->device->is_expander_smp_device) { - identify->initiator_port_protocols = SAS_PROTOCOL_SMP; - identify->target_port_protocols = SAS_PROTOCOL_SMP; - } else { - identify->initiator_port_protocols = SAS_PROTOCOL_STP; - identify->target_port_protocols = SAS_PROTOCOL_STP; + identify->initiator_port_protocols = SAS_PROTOCOL_ALL; + identify->target_port_protocols = SAS_PROTOCOL_STP; + + if (pqi_sas_port->device) { + switch (pqi_sas_port->device->device_type) { + case SA_DEVICE_TYPE_SAS: + case SA_DEVICE_TYPE_SES: + case SA_DEVICE_TYPE_NVME: + identify->target_port_protocols = SAS_PROTOCOL_SSP; + break; + case SA_DEVICE_TYPE_EXPANDER_SMP: + identify->target_port_protocols = SAS_PROTOCOL_SMP; + break; + case SA_DEVICE_TYPE_SATA: + default: + break; + } } return sas_rphy_add(rphy);