Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1071808ybl; Wed, 14 Aug 2019 10:14:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWcyYxvDCCJrPwZpcpg2iJ+uazP/UOe7znhXWMTziXevgJIc3Gl7TjP4gBsCpvZolZBO8V X-Received: by 2002:a63:3148:: with SMTP id x69mr198660pgx.300.1565802863318; Wed, 14 Aug 2019 10:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802863; cv=none; d=google.com; s=arc-20160816; b=t2zI7D6r5NADKDGUd/9QQrTVPg+HmiDMlZdcwsIuKLbuckAoveesCYng7ntnJofWth tqoB0F7IgJlMXO3iPfB0S1pOukjmnSlC8dGwF8c5zOGbkBZfPopBRd09hHzRwQLuOv4H Qp3UgWA+aP33RETE/cOfxiQ3snf+sIkXZiXsMM1l/Xudy8JP2X6pamYrxpbSXZCgNk9A YcMgcBmsM2DzfsW4aoUilIh9FbAcys2ktiJlmlyfTLf+MzJrds6YROOIWEUCfjOfbV9o Dej3tI5x3vd3K1GIpkRRFSZ43X/lUQGltZaxHRSLoAnQN3mkomL1bweKJ5hRb7JrpHkl 9+lw== 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=VwsQGsnsN7b3PHZsriKvIMhq78wFDjvSCa6lm3KdoFs=; b=mWGiyw83AUtCcQEiEWdyqg+IKQwUWQwsQxiPX6KEI2U1puDqgBjGwEjYliz3+Ih1s1 lmGKhx+xu/0pEv9qcXqw8F2Ln2ZOTnAHBJItLFSLnZIXwLgW1pyEFYdj+CQ55CroNb2V U5Q1Cy30VTuHr5dWK34xEVGGA1jbMTgPnG1OAfinBHaByeDT7T/uw9pbjNLTHGEqm8fy nYVSS2cfTccMhJctTJfHUBwCt2Rg+nNmyTCy6t0NbV7doH6/C520emoypL8aQy54hGFF X6wANM7gx+TcdNbOTCPPukNy49fKhFpnbR6i3n/BRIQ6AvlW4ouAeCcVSBIa8Ybp2kqX +RZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P4vTL27U; 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 t23si243816plr.108.2019.08.14.10.14.07; Wed, 14 Aug 2019 10:14:23 -0700 (PDT) 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=P4vTL27U; 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 S1730924AbfHNRNh (ORCPT + 99 others); Wed, 14 Aug 2019 13:13:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:37812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730888AbfHNRNd (ORCPT ); Wed, 14 Aug 2019 13:13:33 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 7BA0F2084D; Wed, 14 Aug 2019 17:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802813; bh=kR9+YXvfV2CdPfmskRIsMT9PpxhGNnm4bOzX5JEVLOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4vTL27UvV2wMe8O+21m41zwDNqHesGqsV5BPS+/+zWPlkzQBWfJFLe4dN/fts8jo xhjiFPjDnEVYa0/UNvtwJOA9X0bGUsuXeRuEQeUO+uRzP6IRy6Cq2y6tLgxsXZ0dkh ervS2fcCO010ChryC4fKK0LztJ80MpruVaFn/JF8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , Jens Remus , Heiko Carstens , Sasha Levin Subject: [PATCH 4.14 35/69] s390/qdio: add sanity checks to the fast-requeue path Date: Wed, 14 Aug 2019 19:01:33 +0200 Message-Id: <20190814165747.868696497@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165744.822314328@linuxfoundation.org> References: <20190814165744.822314328@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit a6ec414a4dd529eeac5c3ea51c661daba3397108 ] If the device driver were to send out a full queue's worth of SBALs, current code would end up discovering the last of those SBALs as PRIMED and erroneously skip the SIGA-w. This immediately stalls the queue. Add a check to not attempt fast-requeue in this case. While at it also make sure that the state of the previous SBAL was successfully extracted before inspecting it. Signed-off-by: Julian Wiedmann Reviewed-by: Jens Remus Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- drivers/s390/cio/qdio_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index ab8dd81fbc2b1..1a40c73961b83 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c @@ -1577,13 +1577,13 @@ static int handle_outbound(struct qdio_q *q, unsigned int callflags, rc = qdio_kick_outbound_q(q, phys_aob); } else if (need_siga_sync(q)) { rc = qdio_siga_sync_q(q); + } else if (count < QDIO_MAX_BUFFERS_PER_Q && + get_buf_state(q, prev_buf(bufnr), &state, 0) > 0 && + state == SLSB_CU_OUTPUT_PRIMED) { + /* The previous buffer is not processed yet, tack on. */ + qperf_inc(q, fast_requeue); } else { - /* try to fast requeue buffers */ - get_buf_state(q, prev_buf(bufnr), &state, 0); - if (state != SLSB_CU_OUTPUT_PRIMED) - rc = qdio_kick_outbound_q(q, 0); - else - qperf_inc(q, fast_requeue); + rc = qdio_kick_outbound_q(q, 0); } /* in case of SIGA errors we must process the error immediately */ -- 2.20.1