Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3026351rwb; Mon, 15 Aug 2022 16:24:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4v0fP/UUs9iLw1AsQe2Xx7q6ECFH5KhJuW97upCYFTi9cq0hE5a9Od+w+RlnXGpK2z1j93 X-Received: by 2002:a17:907:a218:b0:731:2b2b:f34 with SMTP id qp24-20020a170907a21800b007312b2b0f34mr11858622ejc.404.1660605866286; Mon, 15 Aug 2022 16:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605866; cv=none; d=google.com; s=arc-20160816; b=ZeZY2SiLZowxCNPAjSmOw3ks8/pNUA8BBSvw6sucGJeEx+PGIomzk7xV3YoOSBvlJN RxZ2WVDKENlvGXr/XUYX4l+VrzbvbaQ4q9hDEJtVQkKWZfRQtGSKd4o8L+vpZLIOdHZC cg3w6qduu8btsN85z8wyhMa6cOb5qZ0lHOHUKyngisCiaD6Mmzk5eZlHoUEDndcHYEXF rLdjZ27m4NrvZjli4PbExghw/Y5OPg/x5QZniJjELGdZOO+azKOENVJbEH34PzlYmbHy YL7+2Nyv9FpYcC+OqjIe8koDxEP7L6GT7cn+neCdnNc/YXqP9NAnIhLxvGW6arQgqbkK BJOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ygeurznhHgdWeiqYOndn7P0YDZe6PIzeLxsDFjF1HOE=; b=RiEXvSXfZj2WOrlQklM+yKFr7FyLOhZmVxLq6pC0WRmS/tMVAmVfMyxT8LlCSpu6HU 9FVWvIYSTIPSpvJ8zqa7bntNsSd1/OsqONUVJR+TmGqBlsyel6MfEz7mRqBFPR+bUGqc +N9pKVx+orGjFuuDxjbrGmAVXO4WPwRmNyYFno6UfQExzJbhSbq7uY11/NEjOaLdCJu1 tyoJsh5hLMtrGToafiW5ULjhMUc6S+N4fNS2oDeho2C8oTO/rPmjQd71i6f74+oBZ8bi vWFJ0+6KnQzFuND77sipi1wVmlXdivLMd13JKRUxRJm0jveMiPjpzUO3b3r2I5p0fVUP 4oMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AXmVsw9j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a056402270600b0043e72fe84bdsi10303689edd.44.2022.08.15.16.24.01; Mon, 15 Aug 2022 16:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AXmVsw9j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348303AbiHOWUx (ORCPT + 99 others); Mon, 15 Aug 2022 18:20:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348641AbiHOWQm (ORCPT ); Mon, 15 Aug 2022 18:16:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69F327A74F; Mon, 15 Aug 2022 12:40:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 38D9061089; Mon, 15 Aug 2022 19:40:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27795C433D6; Mon, 15 Aug 2022 19:40:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592403; bh=yipSsG5HGqLWCzVO8/t+Fk5ZL9AUOX5sgnOuLHAIuGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AXmVsw9jvsxjm3oHGkwUrhUdriP2i1h4qScUP0lO+A4gyIORO5KGqixQ9i+MdRtJx e+wK13mYLWNwXiedKvZ9cnkEk/MN9kQdqOgVNOjehDPaZsIYijgMezIH01rToC5I6R DNx5upYpN72AClPUqD0R8MxuWXOYQ1IR0W+faUe0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Himanshu Madhani , Bikash Hazarika , Nilesh Javali , "Martin K. Petersen" Subject: [PATCH 5.19 0105/1157] scsi: qla2xxx: Fix incorrect display of max frame size Date: Mon, 15 Aug 2022 19:51:01 +0200 Message-Id: <20220815180443.837213586@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bikash Hazarika commit cf3b4fb655796674e605268bd4bfb47a47c8bce6 upstream. Replace display field with the correct field. Link: https://lore.kernel.org/r/20220713052045.10683-3-njavali@marvell.com Fixes: 8777e4314d39 ("scsi: qla2xxx: Migrate NVME N2N handling into state machine") Cc: stable@vger.kernel.org Reviewed-by: Himanshu Madhani Signed-off-by: Bikash Hazarika Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_def.h | 1 + drivers/scsi/qla2xxx/qla_gs.c | 9 +++------ drivers/scsi/qla2xxx/qla_init.c | 2 ++ drivers/scsi/qla2xxx/qla_isr.c | 4 +--- 4 files changed, 7 insertions(+), 9 deletions(-) --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -3975,6 +3975,7 @@ struct qla_hw_data { /* SRB cache. */ #define SRB_MIN_REQ 128 mempool_t *srb_mempool; + u8 port_name[WWN_SIZE]; volatile struct { uint32_t mbox_int :1; --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -1596,7 +1596,6 @@ qla2x00_hba_attributes(scsi_qla_host_t * unsigned int callopt) { struct qla_hw_data *ha = vha->hw; - struct init_cb_24xx *icb24 = (void *)ha->init_cb; struct new_utsname *p_sysid = utsname(); struct ct_fdmi_hba_attr *eiter; uint16_t alen; @@ -1758,8 +1757,8 @@ qla2x00_hba_attributes(scsi_qla_host_t * /* MAX CT Payload Length */ eiter = entries + size; eiter->type = cpu_to_be16(FDMI_HBA_MAXIMUM_CT_PAYLOAD_LENGTH); - eiter->a.max_ct_len = cpu_to_be32(le16_to_cpu(IS_FWI2_CAPABLE(ha) ? - icb24->frame_payload_size : ha->init_cb->frame_payload_size)); + eiter->a.max_ct_len = cpu_to_be32(ha->frame_payload_size >> 2); + alen = sizeof(eiter->a.max_ct_len); alen += FDMI_ATTR_TYPELEN(eiter); eiter->len = cpu_to_be16(alen); @@ -1851,7 +1850,6 @@ qla2x00_port_attributes(scsi_qla_host_t unsigned int callopt) { struct qla_hw_data *ha = vha->hw; - struct init_cb_24xx *icb24 = (void *)ha->init_cb; struct new_utsname *p_sysid = utsname(); char *hostname = p_sysid ? p_sysid->nodename : fc_host_system_hostname(vha->host); @@ -1903,8 +1901,7 @@ qla2x00_port_attributes(scsi_qla_host_t /* Max frame size. */ eiter = entries + size; eiter->type = cpu_to_be16(FDMI_PORT_MAX_FRAME_SIZE); - eiter->a.max_frame_size = cpu_to_be32(le16_to_cpu(IS_FWI2_CAPABLE(ha) ? - icb24->frame_payload_size : ha->init_cb->frame_payload_size)); + eiter->a.max_frame_size = cpu_to_be32(ha->frame_payload_size); alen = sizeof(eiter->a.max_frame_size); alen += FDMI_ATTR_TYPELEN(eiter); eiter->len = cpu_to_be16(alen); --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -4509,6 +4509,8 @@ qla2x00_init_rings(scsi_qla_host_t *vha) BIT_6) != 0; ql_dbg(ql_dbg_init, vha, 0x00bc, "FA-WWPN Support: %s.\n", (ha->flags.fawwpn_enabled) ? "enabled" : "disabled"); + /* Init_cb will be reused for other command(s). Save a backup copy of port_name */ + memcpy(ha->port_name, ha->init_cb->port_name, WWN_SIZE); } /* ELS pass through payload is limit by frame size. */ --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -1354,9 +1354,7 @@ skip_rio: if (!vha->vp_idx) { if (ha->flags.fawwpn_enabled && (ha->current_topology == ISP_CFG_F)) { - void *wwpn = ha->init_cb->port_name; - - memcpy(vha->port_name, wwpn, WWN_SIZE); + memcpy(vha->port_name, ha->port_name, WWN_SIZE); fc_host_port_name(vha->host) = wwn_to_u64(vha->port_name); ql_dbg(ql_dbg_init + ql_dbg_verbose,