Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3432143imu; Sun, 11 Nov 2018 14:59:36 -0800 (PST) X-Google-Smtp-Source: AJdET5fU6RWjxlf3i55ZtfIAih39/hk4hpAoJTqisrpgq56zEPN0JnMSHiMEWnX0Brl3QEO292cN X-Received: by 2002:a63:e445:: with SMTP id i5mr15409758pgk.307.1541977176907; Sun, 11 Nov 2018 14:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977176; cv=none; d=google.com; s=arc-20160816; b=T7XyoT+Y23RPCuNmnUyXjFJqt2kVbIhGfJzxoAODF5SHsHkihCbQUIpsDGMk9OlOEo UG4NSeZcCzf/19B7LrCHsx3+LTUWie3+zhZZ7gVy3/v50o6Pujw7uGGpHCFZ1V+/BgpN mEdMZFeQAbkfPttiCaATLXhH3ap5Iyhm1T8pwZ99xeVg4KTm4AuBIj1SnMa6WBAhu8FW 3XwhogaHJ5UFuLaHP2OsgE1+Bt3eSowYBbgRzFmVaZEb+FtmxrxODVW6zEKanRSXtT5K OdO5YQZ/1das2CGJKNZIU9IlNPU3hXSjRjRQVJBIx4AL7tGPmo+AeSNDrAho7MkA+h2m jW1A== 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=CKwhM/p5h4wamB1x+3FqP0MIaklGaKFzDUa3D1pJ8XY=; b=uNKnyrOQ7jTJOx/Wt5tZlK+Tm6EUBQSdrR88QgHQJg7XAEA/aAFSBg8tvUzOcwC3P2 7Qd2fb3YrFJbSY7jHM/sNGIYgUPXPvxb0+LM3A4AJ61B8Wje0vIFm2Sm7PMQrpqpxzzS 4rm14wNhrhbhiqwcMZq44WCY5bjAaSpMmrVaQDAaNRL5c7EiVptabQYUO8GLdCCvXAMI zw+9L/S/XvSlAqEmHD1/MJb76ZNZWbhkMprnQ4U01ynrGLyOoKYqsvRIdEkgqiQkeavq d56moEbT9FfS15kHijhOnPFgJkI4BKcEAOZZ5i7CYcqyTJbbw7L1eHLSxJPlVlQLxFM0 Te9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BqcEHHbQ; 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 p1-v6si13280919pfa.120.2018.11.11.14.59.22; Sun, 11 Nov 2018 14:59:36 -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=BqcEHHbQ; 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 S2403751AbeKLIWj (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:51248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390677AbeKLIWg (ORCPT ); Mon, 12 Nov 2018 03:22:36 -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 A246621582; Sun, 11 Nov 2018 22:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975559; bh=1erSnG0ArysKG85B7X8OlLYTO5vShg6oH5af2ZZki9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BqcEHHbQc733o9ePnCs4J4iTATjdvIxvQRp6smzGXjTkeyShWCgUwTa4oyV69S30Q 8iwWdt25SditIvQswmASITdxM+v6al+Y9Bf8D1RpvNEi+sN6HjUPdAD2Z30UbyaFV6 zuy7HrmM6qSZTbSxLI+3K0s7vYZfmtzPG3vkijJo= 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.14 101/222] scsi: lpfc: Correct soft lockup when running mds diagnostics Date: Sun, 11 Nov 2018 14:23:18 -0800 Message-Id: <20181111221656.965098029@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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 @@ -3585,6 +3585,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; @@ -3606,16 +3607,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; } }