Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1828105imm; Mon, 3 Sep 2018 10:28:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYUgDXxIuqjPVGBftluPdzbKS+tdgVUZ3hLahho4yL9V38o4UOOjM3/p6KAIGBnIP2ZclN2 X-Received: by 2002:a17:902:286a:: with SMTP id e97-v6mr29728779plb.340.1535995723715; Mon, 03 Sep 2018 10:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995723; cv=none; d=google.com; s=arc-20160816; b=UfVAj0tEGJ3xvC7V9+F0eirvT3WODbltgSy+raZwtftYSOeVGWhaeuO/iewEdVDY6J y6FGck5N9IzzTlgkQMiWyvKpYZUeOscRHN4lriXJMVtZLFUahsFtKAdPDEcw1YOnsizm 32qRE+OTVW05mUPDSURWbjwrc7GLaVEdCPlvFanWqArIhlV0hJSFY9/E0Tcg1JXAEYom 5qrm6CYlZWtvDEQXAMLio8yC39DRwGX6yfcAiHdsjepOD7cm0UZBpUifG920+2qaYvRl bYmYbQY+Ee6M6r04kYCbxjShVVmeJ1RRzbjqw3gyvhy1EAzLEF5U3DUFbNW0GaQcnp4I +bcA== 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=d0X4heSI0OLbokqhUmCsTM5uIg5dFN8RJr2PfVPuwZk=; b=Als/nB16dcyHyBtMl5JURK6sc82XmPHxQTqAqGIbs+aIJNyJSYUZM9MCXBZ8/Wtyp5 U1voQF8uwWRD9CJE3wpygaWTpw4oMIt66LE5qu1umoyFutx/j4/S1yseQesjp0biInsq LevqifuVZdwcP1sf5Hmm8oPHBD4NMZEeedcJeiEQpWgyirhZFR8ac+TNsWrnOe2SD6Os SQXcBOQQBlJc2SvEdkToRuKhkSwNX/OnAhr4OgzlcSrXdTcn+WrP+P5l56PBnX3vSzSS lwm0qBwZ6k9u6uSUlTfM0M3Jc+CR9KO/W3m9FaG5KVW5mXyoiske+TPycQZFbubd5LPL aKyw== 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 i8-v6si17881596pgj.33.2018.09.03.10.28.28; Mon, 03 Sep 2018 10:28: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 S1730900AbeICVsJ (ORCPT + 99 others); Mon, 3 Sep 2018 17:48:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45970 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728731AbeICVsJ (ORCPT ); Mon, 3 Sep 2018 17:48:09 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 440AED24; Mon, 3 Sep 2018 17:27:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , Martin Schwidefsky Subject: [PATCH 4.14 144/165] s390/qdio: reset old sbal_state flags Date: Mon, 3 Sep 2018 18:57:10 +0200 Message-Id: <20180903165702.884418791@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Wiedmann commit 64e03ff72623b8c2ea89ca3cb660094e019ed4ae upstream. When allocating a new AOB fails, handle_outbound() is still capable of transmitting the selected buffer (just without async completion). But if a previous transfer on this queue slot used async completion, its sbal_state flags field is still set to QDIO_OUTBUF_STATE_FLAG_PENDING. So when the upper layer driver sees this stale flag, it expects an async completion that never happens. Fix this by unconditionally clearing the flags field. Fixes: 104ea556ee7f ("qdio: support asynchronous delivery of storage blocks") Cc: #v3.2+ Signed-off-by: Julian Wiedmann Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- arch/s390/include/asm/qdio.h | 1 - drivers/s390/cio/qdio_main.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) --- a/arch/s390/include/asm/qdio.h +++ b/arch/s390/include/asm/qdio.h @@ -262,7 +262,6 @@ struct qdio_outbuf_state { void *user; }; -#define QDIO_OUTBUF_STATE_FLAG_NONE 0x00 #define QDIO_OUTBUF_STATE_FLAG_PENDING 0x01 #define CHSC_AC1_INITIATE_INPUTQ 0x80 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c @@ -641,21 +641,20 @@ static inline unsigned long qdio_aob_for unsigned long phys_aob = 0; if (!q->use_cq) - goto out; + return 0; if (!q->aobs[bufnr]) { struct qaob *aob = qdio_allocate_aob(); q->aobs[bufnr] = aob; } if (q->aobs[bufnr]) { - q->sbal_state[bufnr].flags = QDIO_OUTBUF_STATE_FLAG_NONE; q->sbal_state[bufnr].aob = q->aobs[bufnr]; q->aobs[bufnr]->user1 = (u64) q->sbal_state[bufnr].user; phys_aob = virt_to_phys(q->aobs[bufnr]); WARN_ON_ONCE(phys_aob & 0xFF); } -out: + q->sbal_state[bufnr].flags = 0; return phys_aob; }