From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C55E6C433FF for ; Fri, 2 Aug 2019 13:32:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A2F12173E for ; Fri, 2 Aug 2019 13:32:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564752777; bh=KomnOfMi9NVBkbXNqUUvxXI9LcH5q25vU4ZGhtPxURQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MY6dpiQDdnzW5kIhRnA5b4XM07ZrKgbESpchwhRJSTPEZct/BjVjTD8EXpjPr0DOe zpsBjZtgr1aqUMR1JHBuoR/mg3wKXWTZmnCGG6Tmw2y09FsiTAtxVavTfQ6R+seQyY ekDlUHXL4LFTI32qaWw+jn6c2tyTw/Cgf2HvmMAU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394047AbfHBNXt (ORCPT ); Fri, 2 Aug 2019 09:23:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:34388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394042AbfHBNXs (ORCPT ); Fri, 2 Aug 2019 09:23:48 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 06E8B20880; Fri, 2 Aug 2019 13:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564752227; bh=KomnOfMi9NVBkbXNqUUvxXI9LcH5q25vU4ZGhtPxURQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qgfvFJS66sdi9n4ipw1bJZ/KwPzkkRJnYKWbCJYLYKEtUTkx7Kzy6rNyVtY69mL1T 2O4rMCHle4XGTkXJIR1/gtvZG795Sh+yWvQKAF8rS6u7wWvIdZwm8OQyKr/sbzboCJ x8ChjN+jhA38xyOutuUSTO+MjgZhX6ovd80o12sg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Julian Wiedmann , Jens Remus , Heiko Carstens , Sasha Levin , linux-s390@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 22/42] s390/qdio: add sanity checks to the fast-requeue path Date: Fri, 2 Aug 2019 09:22:42 -0400 Message-Id: <20190802132302.13537-22-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190802132302.13537-1-sashal@kernel.org> References: <20190802132302.13537-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Julian Wiedmann [ 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 4ac4a73037f59..4b7cc8d425b1c 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c @@ -1569,13 +1569,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