Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2769071imj; Mon, 11 Feb 2019 08:11:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ9chmBvq9YQDduKFIRbuIkf8dgbdYodFArqfDvcO/E4uxYKADGZmCak08xNhaj2PMdCSm3 X-Received: by 2002:a63:b70b:: with SMTP id t11mr29007004pgf.404.1549901494324; Mon, 11 Feb 2019 08:11:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901494; cv=none; d=google.com; s=arc-20160816; b=yboYEh1lJwVNveUxbgBssjdwh9Jd2VwxRf7xZRNAz2MZDU7xu+6/5/XI8Ozw+7Gl+i xt+xHzImbKNs1UNgKBuaf/LB4SEKJIU/q9G1ZN/oNekrcC8EcJYfApsm92jaWYh364SN ox5W1Jw6KXQrJfXSotd7p9/Cn7bcLcdSED++/MWtXf1oMELgmimY07osT/J+wTygcWYk qsFwiVDvlkcEqu5jH1Vdfv6ixIZlLCRIw0/WruR258McvaWD5VPaP660Xg8QWiKrUy1E Jt1i1S8usC1NSo5/9FkRuz8ta8rqTg03Hg0OndKfcNTZ8xf0g5akYYglgNHLbcrLnJZ5 LrMw== 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=eIWOcKLl4jKcIL+70t4eclqlP5aNby1/Q3RuL1taQIM=; b=heJ6SKzrdyU0cAicwotecumsmc12pZex/+6zWrnCUFaLfPqnMN8FkDYdUR34QBdON4 Of0J6AekruIYXOrLlzke3DvaXDPxMz6rcjHCtbnJ4tIMqPY8W+ZoRFKo1dwovqRsbE2F ld6+VBlDuY7+SH+jc+kh8h5OJqouJywiNARgIAtOgATzmoczpf+K0heGMQvcskqb4c8L oEqH3Pm/aOrtrsIOwBBV+zpVj79gXz+gZ1tpVUqrashcskqIWnRbULwfhEoO/fsqwo8o Ly/i2WNdNXCUflC/TfkeqCQpOzkW8gwB3wL3h8IskOGcMsqS45SrsssBr+DCHGVVk0g2 Kavg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="s1fB7/L4"; 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 31si10901791pla.334.2019.02.11.08.11.17; Mon, 11 Feb 2019 08:11:34 -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="s1fB7/L4"; 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 S1729274AbfBKOYu (ORCPT + 99 others); Mon, 11 Feb 2019 09:24:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:58042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729266AbfBKOYp (ORCPT ); Mon, 11 Feb 2019 09:24:45 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 3EAF221855; Mon, 11 Feb 2019 14:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895084; bh=eUBfZWU0joDIYleActZ+jzo23fwm3FAQIQrPWITgKq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s1fB7/L4464RD9cx8zkTul40FKL7z2bJVHlO4vFzqkMRauDr1DbRNjwlVXJkXnVZX VKLZ7BGCyNr9Q/yCG+pQ0gA80424T9hH3k1O6H0NIMhaY0Q7WpO5FaKT2cEgngZY88 96fOiYIPS6+wgacjDUYrxj5gtDZ1LGHiR+mASXBM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Young Xiao , Jens Axboe , Sasha Levin Subject: [PATCH 4.20 087/352] sunvdc: Do not spin in an infinite loop when vio_ldc_send() returns EAGAIN Date: Mon, 11 Feb 2019 15:15:14 +0100 Message-Id: <20190211141851.477327773@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a11f6ca9aef989b56cd31ff4ee2af4fb31a172ec ] __vdc_tx_trigger should only loop on EAGAIN a finite number of times. See commit adddc32d6fde ("sunvnet: Do not spin in an infinite loop when vio_ldc_send() returns EAGAIN") for detail. Signed-off-by: Young Xiao Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/block/sunvdc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index b54fa6726303..6b7b0d8a2acb 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c @@ -45,6 +45,8 @@ MODULE_VERSION(DRV_MODULE_VERSION); #define WAITING_FOR_GEN_CMD 0x04 #define WAITING_FOR_ANY -1 +#define VDC_MAX_RETRIES 10 + static struct workqueue_struct *sunvdc_wq; struct vdc_req_entry { @@ -431,6 +433,7 @@ static int __vdc_tx_trigger(struct vdc_port *port) .end_idx = dr->prod, }; int err, delay; + int retries = 0; hdr.seq = dr->snd_nxt; delay = 1; @@ -443,6 +446,8 @@ static int __vdc_tx_trigger(struct vdc_port *port) udelay(delay); if ((delay <<= 1) > 128) delay = 128; + if (retries++ > VDC_MAX_RETRIES) + break; } while (err == -EAGAIN); if (err == -ENOTCONN) -- 2.19.1