From patchwork Wed Dec 16 23:11:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 7866601 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 952C99F387 for ; Wed, 16 Dec 2015 23:12:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B903C20396 for ; Wed, 16 Dec 2015 23:12:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DBBCF202FF for ; Wed, 16 Dec 2015 23:12:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754880AbbLPXMN (ORCPT ); Wed, 16 Dec 2015 18:12:13 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:34143 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752743AbbLPXMK (ORCPT ); Wed, 16 Dec 2015 18:12:10 -0500 Received: by mail-pf0-f179.google.com with SMTP id 68so19521147pfc.1 for ; Wed, 16 Dec 2015 15:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=date:from:to:subject:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=yCsVkpM814AYBcKXW+W67PettwKzdG0gpUyPzJykq2A=; b=sKGznbsLjl56CTgCFDOyQ8Tp3RQIuxFzwNqPI1Lf8sF1jV3xolvLqqqh3KGN52kU0C zWj75Gzkhyj3cVN+e5zd2v1Qz2t1EYqhoKCVZHbztGd0fWyKvGkjBz1O0eCaM/Q+/YTM Aez/b8Yd9C/oUIzg/Xb3rvhjmdz4/pbqjLb1U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=yCsVkpM814AYBcKXW+W67PettwKzdG0gpUyPzJykq2A=; b=knCeHDDLGdbWTsqD3Q0FwHy01u1b4wbZg3DLl6tWW9QVkJ9oxZvE/Yp+AR80zf1FU8 BIJ+ojbop5vDsDm0RBKAom0y8o1FIGK/U2eSFGojp2jz5V4vi67gR7o0u09bX+scawDZ DPVDRu+dZ2hxRp4BuoyAXJVhrdN8AadT59gjA7uI80EubvHiUEM9/DB4D5diIBDPb5wt bV9yogqS7g7jnEyoZljvGe07po6apiyRJTlsPhne0cjhkPs+gJgQEoFwD75Eq1j2iNNI uLC+jFdGJbuz2ylRrqlsblrkJBnt2NjxEo+NwcZFuGc+4eVvLD3VS42m72Q37fviQllh ldfg== X-Gm-Message-State: ALoCoQmZ2h6/6+G4ZpY9fGxfe2Yhq7g1C9jYNK97Td+2n+xpDNi8BhJno7nI1pKl5GpIBWe+Yx31m0FYZC8LCwVcJ6+0y2EqIA== X-Received: by 10.98.18.130 with SMTP id 2mr9538636pfs.62.1450307530202; Wed, 16 Dec 2015 15:12:10 -0800 (PST) Received: from myfc17 (cm-wififw.emulex.com. [138.239.220.50]) by smtp.gmail.com with ESMTPSA id n64sm7006457pfi.19.2015.12.16.15.12.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 16 Dec 2015 15:12:09 -0800 (PST) Date: Wed, 16 Dec 2015 18:11:52 -0500 From: james.smart@avagotech.com (James Smart) To: linux-scsi@vger.kernel.org Subject: [PATCH 01/17] lpfc: Fix FCF Infinite loop in lpfc_sli4_fcf_rr_next_index_get. Message-ID: <5671efb8.g2wO8LGtpHquAYxc%james.smart@avagotech.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix FCF Infinite loop in lpfc_sli4_fcf_rr_next_index_get. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_sli.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index f9585cd..6aae828 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -16173,7 +16173,7 @@ fail_fcf_read: } /** - * lpfc_check_next_fcf_pri + * lpfc_check_next_fcf_pri_level * phba pointer to the lpfc_hba struct for this port. * This routine is called from the lpfc_sli4_fcf_rr_next_index_get * routine when the rr_bmask is empty. The FCF indecies are put into the @@ -16329,8 +16329,12 @@ next_priority: if (next_fcf_index < LPFC_SLI4_FCF_TBL_INDX_MAX && phba->fcf.fcf_pri[next_fcf_index].fcf_rec.flag & - LPFC_FCF_FLOGI_FAILED) + LPFC_FCF_FLOGI_FAILED) { + if (list_is_singular(&phba->fcf.fcf_pri_list)) + return LPFC_FCOE_FCF_NEXT_NONE; + goto next_priority; + } lpfc_printf_log(phba, KERN_INFO, LOG_FIP, "2845 Get next roundrobin failover FCF (x%x)\n",