Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3477324imu; Sun, 11 Nov 2018 16:01:03 -0800 (PST) X-Google-Smtp-Source: AJdET5fD7aJ14Lqt/e48lrMOUpHH7Ivj2cm6A1qwQUQgs2YI9zth1gjAklywEBmEIMp5DTre6OXx X-Received: by 2002:a63:160d:: with SMTP id w13mr15832082pgl.43.1541980863691; Sun, 11 Nov 2018 16:01:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541980863; cv=none; d=google.com; s=arc-20160816; b=FZsO+KsEWJ9W0YwGSishV9vAFiyHCEJIVStPqzYQVr9mjuqjkBhbrexhtlpvB5t6aP naON7ZcnSwcHwf6jEN9wCyGBoX/jXtp5lk4E1K5+V+P3Xf9C7QWfvsJMmhGyMeEkN8On IdrJShTnFhXYb9+SFxgCijGkfYT9GbXL4sh6SOgN3ogy2Qu0FyOAFzUIAgs5GUC/b2cK ZvcfRvxy5ocGoxl0QVER0dET5QfeJaKSn3D+Isl9l18QnzqNV+CoGwG+rQ7ppEvwtvOR cHt94P2ad7IGpx7Fy8Av8wnnqWVOphokFTBVcQ7T5Md70p2AvqRdTiGFzzFjQQ3sClBt /6yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eIjko9S5EyjerltuCga/eFfqnD+cpSVdYVnBqYmEFsQ=; b=YUorb9Ccxb6h2tMvCPN3Ba/TPBELYm8YiTC2Q+LwyP6sGjAlRFFRo47kBuVWh/PDF1 YGSdyuCY1E8Oqrcdz5VD9+VsnlgHm6X52+IaeUdE7EG80h1bHr/CM20/3hlLBAePzE+G fbtEu5HJ8e8yFWcjNJ/GnoBIIytghKL1AoHRalwo5yAEFchxyKaSsBBKM1ExNQWSVeIj JmwG/bBvBhrzFR2Ru9KGQqz0akxlgpxn2dNISGHgQqB80DpMzrMUXQPBjgysKh7qodNn LqGPDZyMG0O+x2kTFdThwTG+iGU797JBFbowRgfPBCUW+j/VRg6fWjBDfzvZql8BjHqX 5CNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m2jWFKrz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20si15588637pgl.268.2018.11.11.16.00.48; Sun, 11 Nov 2018 16:01:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m2jWFKrz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732490AbeKLJuw (ORCPT + 99 others); Mon, 12 Nov 2018 04:50:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:34210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732294AbeKLISB (ORCPT ); Mon, 12 Nov 2018 03:18:01 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 437B621104; Sun, 11 Nov 2018 22:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975285; bh=+EIKGvAnG5QKeiPYBhjjHx71fi6FCIYR5HOFic0gd1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m2jWFKrznoxcJr5KTM2HtPjVtJ2Vl47fnnFXlgWF4V5wg8c73zAAFZtBr7Hw6Dfct 183fPRGsWDXx9b8lybOYHCLkCQ3Ffj7qCBaorYqQS8XYzplR5L7i+AU6nl9ExwG5GL B2K1PRgqh/3feQ/BrS9dCGKpedppGQgA9lOkxcrg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dick Kennedy , James Smart , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 4.19 181/361] scsi: lpfc: Correct soft lockup when running mds diagnostics Date: Sun, 11 Nov 2018 14:18:48 -0800 Message-Id: <20181111221645.629308111@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: James Smart [ Upstream commit 0ef01a2d95fd62bb4f536e7ce4d5e8e74b97a244 ] When running an mds diagnostic that passes frames with the switch, soft lockups are detected. The driver is in a CQE processing loop and has sufficient amount of traffic that it never exits the ring processing routine, thus the "lockup". Cap the number of elements in the work processing routine to 64 elements. This ensures that the cpu will be given up and the handler reschedule to process additional items. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/lpfc/lpfc_sli.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -3797,6 +3797,7 @@ lpfc_sli_handle_slow_ring_event_s4(struc struct hbq_dmabuf *dmabuf; struct lpfc_cq_event *cq_event; unsigned long iflag; + int count = 0; spin_lock_irqsave(&phba->hbalock, iflag); phba->hba_flag &= ~HBA_SP_QUEUE_EVT; @@ -3818,16 +3819,22 @@ lpfc_sli_handle_slow_ring_event_s4(struc if (irspiocbq) lpfc_sli_sp_handle_rspiocb(phba, pring, irspiocbq); + count++; break; case CQE_CODE_RECEIVE: case CQE_CODE_RECEIVE_V1: dmabuf = container_of(cq_event, struct hbq_dmabuf, cq_event); lpfc_sli4_handle_received_buffer(phba, dmabuf); + count++; break; default: break; } + + /* Limit the number of events to 64 to avoid soft lockups */ + if (count == 64) + break; } }