Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2915741rwb; Mon, 15 Aug 2022 14:00:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR6J7a5fC/0pyV4JLmjO/SOG/5Li1k/E1qUoij2X10m6nIsvElW/Euur2hEgOu5xvs5bVr5c X-Received: by 2002:a05:6a00:1501:b0:52e:67e9:56d7 with SMTP id q1-20020a056a00150100b0052e67e956d7mr18076261pfu.48.1660597229183; Mon, 15 Aug 2022 14:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597229; cv=none; d=google.com; s=arc-20160816; b=e7z/kFtSSs+5fu/5ZOk0R1v4J9E4hoYma1hXPIWJ97expV3oPXI8LFsm9Y5J/CI4i5 ISmqNBRkxHNM6JIo83s7xMcA/EghHuG79+tXLmyf+KF7tzvyhy4CpGKWak3oFSuMzIG4 UgH1lNJcJfNOIRQOS0vWJ9sG2mQt9XvM/U5ntXuXcC/QUOEpYO9M+5Lnr9wmQzb2e24N hhbgDXrqI1UM3KXMrEiIcVabXr+WvYstHeyVHZxyyVvV3nyY1Lmrj/IXttUy+hcyJjfG 47jFK3Jho0Ps1tsFncoiEgWGC1HwDlZinZ46loN7JvhSLIQqoitAV54F9rNfJCI0iGy6 0q5Q== 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=dPHqQ16lWSgSQpFspJ8RYwAM+qtzVtXRVBaaA4JJ8ForSU/eP9k7bDo2j4Xsjw4GRv TmX6LxlE6U9P6xnk7LXs7DSxQjYIuBhubGXMYBgS0fgjNY31qlvYMTX57XpNKw3fQr4K MmaATHe9L479Vz9Chzapp/B2xyYivPKUTzemGQgwuOYvOlpbnZYojRFOHZIP2u2B8jtq PlNypcxc3JgzuY16hzd/vyCSufaoNCFkJUv5fWNgdJCTKZynPTkW+Y0tz8QjI0XANK5m 0n95wS4dsCjGGKlvrxQo1193mn3MKROaVKyDzzlHsMrbLVz+3ZFmu7f3iW9/cpx18GGW Lq0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LaeUnb6O; 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 h63-20020a638342000000b0041b4079be13si153034pge.624.2022.08.15.14.00.18; Mon, 15 Aug 2022 14:00:29 -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=LaeUnb6O; 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 S244632AbiHOUYX (ORCPT + 99 others); Mon, 15 Aug 2022 16:24:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346717AbiHOUQV (ORCPT ); Mon, 15 Aug 2022 16:16:21 -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 064CF33377; Mon, 15 Aug 2022 11:59:46 -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 6E4DA61230; Mon, 15 Aug 2022 18:59:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B6FAC433D6; Mon, 15 Aug 2022 18:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589985; bh=yipSsG5HGqLWCzVO8/t+Fk5ZL9AUOX5sgnOuLHAIuGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LaeUnb6OOTC8/hpSXbSntZRIQ3UzrUaXGEoNVb2WnI+FG/D++gZzxtjv9Py2COpbC HbnmcBY/NJbxVCmDG0DDhDIVWOrX4/qVvPXY3L3C0mj1K40dhXRpLfttLhaMP4HJL2 gP6Ru1EOY9ghTAMfEER5vSSAGciSt+KN1fw0WlME= 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.18 0096/1095] scsi: qla2xxx: Fix incorrect display of max frame size Date: Mon, 15 Aug 2022 19:51:35 +0200 Message-Id: <20220815180433.522636453@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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,