From patchwork Tue Jan 30 23:58:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10192923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 87A8660291 for ; Tue, 30 Jan 2018 23:59:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AACE27F54 for ; Tue, 30 Jan 2018 23:59:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F7F527FAC; Tue, 30 Jan 2018 23:59:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FF3C27F54 for ; Tue, 30 Jan 2018 23:59:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754165AbeA3X70 (ORCPT ); Tue, 30 Jan 2018 18:59:26 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:36612 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753543AbeA3X7W (ORCPT ); Tue, 30 Jan 2018 18:59:22 -0500 Received: by mail-qk0-f196.google.com with SMTP id d21so12538207qkj.3 for ; Tue, 30 Jan 2018 15:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ph3iOTnknYT2fZT5w8anQ+l6j3pIB3xt4N8lZ3KwCFU=; b=LhmQnOS8vEzTySlFal+F0wA24EE7ayE3Vp2N1VN/WrJkhv8xQP7xCE8mYRaurj8NP4 Em3PeVnPUs8WkP8yOpHgMHKHF9GzREeAN/JYenQtrR5zWQq0WO+T+aoyX/suWXN1JGKG O4VmRwR2hEYj3s95H9nVfHvcDV0Wj8XSm1KiSt36QUSDDk24M3MPeqL+834z+4FqDUVm v+JgzTc9J5jXQr8XvT0XQM9k1CkbumNnYJDr0Mpt5PK26RmQHBkdE3tTbhS74ateg6ai eA6SEEP9D49u4yHn2iOzBcOQ5nlv59mg3EDB4ejN4ejjlXj6KO6EgJIDfhO2NgNwdUCU h0dg== 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:in-reply-to :references; bh=ph3iOTnknYT2fZT5w8anQ+l6j3pIB3xt4N8lZ3KwCFU=; b=ET9zcf9BdNvPuvMLMh0AdzxBbKECn9xpK+AsWhGhj1C0iyjVWsyh4vZ9X0ekiwOLsw gMedjR4ulEgTyUcaCMUXUNluV1AhINqW00JKQjEPkZLr4PT1K6hYTHclsbrT6j2e6DqT MqJtINtPPs3nnHvaN3qsCBTsqbOKkPPGoamebfCDC4frXVOLJKwrKDUUROi8HeCHL/0c oJyr0+ZGhUl3a/a30PYCipvjPQV1YmM1LCnBrLOANZ99nhGK9XRurnICbzo0ueoSillo Z7cbMVYc7Y7FR4xWb/HyB8O60j7ylLSusd1DPlfFVhB6EztTCg0X/7b21CR/d50hmfZg /Zag== X-Gm-Message-State: AKwxytdGz0Q+/9U8chaEbv/mrueU35a7Gdgn00vRccHXQ4SzxgNUVwjH 5vqZJ4AuXdt+v2Iva9XLSI4u0w== X-Google-Smtp-Source: AH8x224gy6+SHBV8geMhK2O8m/F5otCJABvIBGw5hhjLMeCf8lTxZofTPxw461Q5do/kyZSuU3zPAQ== X-Received: by 10.55.65.20 with SMTP id o20mr36465412qka.270.1517356761339; Tue, 30 Jan 2018 15:59:21 -0800 (PST) Received: from pallmd1.broadcom.com ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id i39sm12438537qte.19.2018.01.30.15.59.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 Jan 2018 15:59:21 -0800 (PST) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH v3 06/19] lpfc: Fix PRLI handling when topology type changes Date: Tue, 30 Jan 2018 15:58:50 -0800 Message-Id: <20180130235903.5316-7-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180130235903.5316-1-jsmart2021@gmail.com> References: <20180130235903.5316-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The lpfc driver does not discover a target when the topology changes from switched-fabric to direct-connect. The target rejects the PRLI from the initiator in direct-connect as the driver is using the old S_ID from the switched topology. The driver was inappropriately clearing the VP bit to register the VPI, which is what is associated with the S_ID. Fix by leaving the VP bit set (it was set earlier) and as the VFI is being re-registered, set the UPDT bit. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_mbox.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index 81fb92967b11..c32d4a323db2 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c @@ -2170,10 +2170,8 @@ lpfc_reg_vfi(struct lpfcMboxq *mbox, struct lpfc_vport *vport, dma_addr_t phys) /* Only FC supports upd bit */ if ((phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_FC) && (vport->fc_flag & FC_VFI_REGISTERED) && - (!phba->fc_topology_changed)) { - bf_set(lpfc_reg_vfi_vp, reg_vfi, 0); + (!phba->fc_topology_changed)) bf_set(lpfc_reg_vfi_upd, reg_vfi, 1); - } bf_set(lpfc_reg_vfi_bbcr, reg_vfi, 0); bf_set(lpfc_reg_vfi_bbscn, reg_vfi, 0);