Received: by 10.192.165.148 with SMTP id m20csp2462317imm; Sun, 22 Apr 2018 07:32:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx495kyvLAPSzSshd60l0xW3up5DVOU+I12krXteR6u1qcfQO12ZivlAq1KHOwK2Hgv+ChMy1 X-Received: by 10.99.64.65 with SMTP id n62mr14300317pga.259.1524407563383; Sun, 22 Apr 2018 07:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524407563; cv=none; d=google.com; s=arc-20160816; b=GsnMLtA04F3KNLsrwrLJcKVQWudDBaPkvlpTwz2eNbT95J+bERJcAlqS8/xw1nFzn5 FzPpkPOXojlsZSXc8kHekTw7+K2Yq4EJT3mUw726dmODogVPffW6+xkdTDzY24n7/3uA GEinsixPJkTJ0UDP0SHfGbjBNeUcy4pNNs+jk+e7K5AiGi+LDfKiLJkvDUPfPl52Un/Y ymKJyQR5uZrH7MUyz4ZCC4a4UwANCspD8UeQEh0xIvwq4wQxleNBvXJE6fvAsNbNCBLy vQnqnsshu8mp+foIaK5QiMa0zNsRbWtCxDiF8elHayFcONwKIPvjm+MNfOXqCHF15z71 ei9A== 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=3pRLtpnAS+ip4ceHmxLjyzTF9MICVwCMc2IM98r0SJw=; b=MrDzAaPx0vQ3fdnUSamDblxe1uhXq2dh7RjPR2BaGLWYTzKv4v7LiXwrITLmgZTI18 mIXig296nfkFGgF5ABWAClSri0vaIQmw0Bha2SHLRTM+NcNirdo2liFDjdlBe8OX9zpY P9uaJzy5eKQ8y/xwxtsEMAqhYv4f1otrONq+K6pAbX6EfuOF1DGfGaghGn82uD4Magn1 iX57QnUl9FKE7YGiRc+8+QlC3F29oFMovNuGWS7F9HVeHFVmC0l53c8UDYGARwL2dXK0 cHMuhQJcYZkaf3QtL0SCdmZ02YXu4vYyGEezuIp9+ZWzR7qlXGFsCNUYZtF4vTN6T7Gg pQZQ== 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 k70si8123660pgc.648.2018.04.22.07.32.29; Sun, 22 Apr 2018 07:32:43 -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 S1757432AbeDVOUc (ORCPT + 99 others); Sun, 22 Apr 2018 10:20:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60450 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757420AbeDVOU3 (ORCPT ); Sun, 22 Apr 2018 10:20:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AF071CA4; Sun, 22 Apr 2018 14:20:28 +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 3.18 03/52] s390/qdio: dont retry EQBS after CCQ 96 Date: Sun, 22 Apr 2018 15:53:36 +0200 Message-Id: <20180422135315.386662468@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135315.254787616@linuxfoundation.org> References: <20180422135315.254787616@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 3.18-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 @@ -126,7 +126,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); @@ -149,14 +149,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));