Received: by 10.192.165.156 with SMTP id m28csp281419imm; Tue, 17 Apr 2018 10:02:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/41h64TwdSn2568AdOL8KwsLp+Z+w89lQ0Vt7jL3ApZdd9sNFsvy8CRjShM0nekBkFa2KP X-Received: by 10.98.155.12 with SMTP id r12mr2661250pfd.15.1523984567962; Tue, 17 Apr 2018 10:02:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523984567; cv=none; d=google.com; s=arc-20160816; b=Lwo66tyuO/zZC1eMIaQpCyQGA4DMkgVLzqXOnDOoaun2HTL4ZLrIVARIQtm84pSZkg bEElJXc2FhTivmyYUAWbHUxRkDmkD2t5NhcR3sxsQzWfwwCac0LQ36uKw6CdYfmJABMO OJ2ksuViohXijjaNYPp+KviNG8B0uNK4xAB1fCIot+FQ3uYjILOTPPUMWo76mvDjyQOW hhpCyBUaPZwg341ecThl2PKl3Qf5u/BSIVLuGjeJUMyNdqRWo03/iTMhSuv2kNIjjql0 GrDeZkwardihm4TxDUxC58dZ3sJqtKDbXl0reGulZ/sC77wlr4z6JPe+xEbnBQ/sHCoc EGGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hMfw/WAJUozV7eVaZ8C6dWzMYqZfgaqACF/OQXW7E+A=; b=pOxEh1YWztzjMklJQzdl4LF9V3ND1IbthQcV3QPN2ycGB70Cxjzyut2zRS4ePn6ioe ocgGz795WOy0OctOvDNUv9CcMpAdNBzW+5HjRT3xXFTpR1XijQ1cO17pyMfvSrRXN0Hn A+M0CbFPW5X4dj9oa7x2QjtUGd36lpSR1OD5cpD5ciW6D20erKEPIHduTjgDslITIYtI tY6DuHwckWNzbBBwtm3npJRgndAvHIFF0yHwRcT9zzBmxg/vNCejJ5F7LQMf/R06c4iR qhNkByej4tgQwGcULJWHEDGY9MDceXyPPYRqzaeKQ0K9Q9UyTu+OZtC/fGQUJ3GHq3fI o68w== ARC-Authentication-Results: i=1; mx.google.com; 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 e4-v6si2911194pln.331.2018.04.17.10.02.32; Tue, 17 Apr 2018 10:02:47 -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; 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 S1754036AbeDQQCZ (ORCPT + 99 others); Tue, 17 Apr 2018 12:02:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60758 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754022AbeDQQCY (ORCPT ); Tue, 17 Apr 2018 12:02:24 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4B2B4DFC; Tue, 17 Apr 2018 16:02:23 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , Benjamin Block , Martin Schwidefsky Subject: [PATCH 4.16 59/68] s390/qdio: dont retry EQBS after CCQ 96 Date: Tue, 17 Apr 2018 17:58:12 +0200 Message-Id: <20180417155751.735062039@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155749.341779147@linuxfoundation.org> References: <20180417155749.341779147@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Wiedmann commit dae55b6fef58530c13df074bcc182c096609339e upstream. Immediate retry of EQBS after CCQ 96 means that we potentially misreport the state of buffers inspected during the first EQBS call. This occurs when 1. the first EQBS finds all inspected buffers still in the initial state set by the driver (ie INPUT EMPTY or OUTPUT PRIMED), 2. the EQBS terminates early with CCQ 96, and 3. by the time that the second EQBS comes around, the state of those previously inspected buffers has changed. If the state reported by the second EQBS is 'driver-owned', all we know is that the previous buffers are driver-owned now as well. But we can't tell if they all have the same state. So for instance - the second EQBS reports OUTPUT EMPTY, but any number of the previous buffers could be OUTPUT ERROR by now, - the second EQBS reports OUTPUT ERROR, but any number of the previous buffers could be OUTPUT EMPTY by now. Effectively, this can result in both over- and underreporting of errors. If the state reported by the second EQBS is 'HW-owned', that doesn't guarantee that the previous buffers have not been switched to driver-owned in the mean time. So for instance - the second EQBS reports INPUT EMPTY, but any number of the previous buffers could be INPUT PRIMED (or INPUT ERROR) by now. This would result in failure to process pending work on the queue. If it's the final check before yielding initiative, this can cause a (temporary) queue stall due to IRQ avoidance. Fixes: 25f269f17316 ("[S390] qdio: EQBS retry after CCQ 96") Cc: #v3.2+ Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/qdio_main.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c @@ -128,7 +128,7 @@ static inline int qdio_check_ccq(struct static int qdio_do_eqbs(struct qdio_q *q, unsigned char *state, int start, int count, int auto_ack) { - int rc, tmp_count = count, tmp_start = start, nr = q->nr, retried = 0; + int rc, tmp_count = count, tmp_start = start, nr = q->nr; unsigned int ccq = 0; qperf_inc(q, eqbs); @@ -151,14 +151,7 @@ again: qperf_inc(q, eqbs_partial); DBF_DEV_EVENT(DBF_WARN, q->irq_ptr, "EQBS part:%02x", tmp_count); - /* - * Retry once, if that fails bail out and process the - * extracted buffers before trying again. - */ - if (!retried++) - goto again; - else - return count - tmp_count; + return count - tmp_count; } DBF_ERROR("%4x EQBS ERROR", SCH_NO(q));