Received: by 10.213.65.68 with SMTP id h4csp1803260imn; Thu, 29 Mar 2018 11:19:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx49oZLV8z/6wSpKiyQZoTQIuw6OGT+HWVfK+ltEkNFz/Y/BFn/0RSCDoT2Ibggwjy4tuBlW/ X-Received: by 2002:a17:902:c6:: with SMTP id a64-v6mr9416043pla.408.1522347552493; Thu, 29 Mar 2018 11:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522347552; cv=none; d=google.com; s=arc-20160816; b=I3gfC9gGlQsTGLo1u6fhVwi9RovGHYiQKa+y/rGURP01aapm9Urbyxx+AEVLgww1T/ 59Xx/Wr6qpT6e0N4+vLaIEstgBt+gm0n/Ud6xWPoTBP1jkYboRg8ElZLG6j2xRspNmR7 WqsYkGkeUiAxLb11mOe4/BQZm5wtgo85KnPccNo6sk+MU4PBcGBYQjYda9SXLi6gkSzS 3WDZiiTURfQaB4wNrq8BgJ2pBm1T4xb4wHzLpKqQ+pX83A7t4Uw1/i3ma7LCYXRlOjxY YgE8k391yEPHseI7DTDR4EibQygF+SCGlP3Xwhaq0uCP6tOY2RBKfTdgrFAcLqqIt4zO 4dvw== 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=CAVb/FIqo6nxlYSLMHBAE0AAecQYU8mu1QUTCJKE6VA=; b=iJavdpyzmtFBvbwzZqilXpveG2694dbIQTzGLyfHsvnkNUYeROvAJD+HOq/JBp6ab5 F3NkLKVn3QlhysKe9jBs8/QhgmT+L4Xx0XpVo+DXBWadxJIbbaB8yT4ScUxOa9OKZCKT WYEi6sG1LVQs40BUPX38czWwQ3SC9P0V3PoHqrohOTk/DjdReApEzmpWc5z6shFnwuG9 n91gSGnWcdSqLU6r0wVfxSb/Tdx3vGc5Ttknr2ht8fx9Gx5phqZpIZjpodWUXmgkZ7n+ uaVaJI61180AF/H20UDv51i16GuFOGGEgiXYDKZ1g8yotFlvRpA10m7+uX+n2sNTtUPD r5Qg== 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 n2si319395pgv.789.2018.03.29.11.18.58; Thu, 29 Mar 2018 11:19:12 -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 S1753862AbeC2SG6 (ORCPT + 99 others); Thu, 29 Mar 2018 14:06:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59828 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753852AbeC2SG4 (ORCPT ); Thu, 29 Mar 2018 14:06:56 -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 426959B9; Thu, 29 Mar 2018 18:06:56 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , "David S. Miller" Subject: [PATCH 4.9 24/28] s390/qeth: lock read device while queueing next buffer Date: Thu, 29 Mar 2018 20:00:43 +0200 Message-Id: <20180329175736.156599671@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180329175733.447823703@linuxfoundation.org> References: <20180329175733.447823703@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Wiedmann [ Upstream commit 17bf8c9b3d499d5168537c98b61eb7a1fcbca6c2 ] For calling ccw_device_start(), issue_next_read() needs to hold the device's ccwlock. This is satisfied for the IRQ handler path (where qeth_irq() gets called under the ccwlock), but we need explicit locking for the initial call by the MPC initialization. Signed-off-by: Julian Wiedmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/s390/net/qeth_core_main.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -522,8 +522,7 @@ static inline int qeth_is_cq(struct qeth queue == card->qdio.no_in_queues - 1; } - -static int qeth_issue_next_read(struct qeth_card *card) +static int __qeth_issue_next_read(struct qeth_card *card) { int rc; struct qeth_cmd_buffer *iob; @@ -554,6 +553,17 @@ static int qeth_issue_next_read(struct q return rc; } +static int qeth_issue_next_read(struct qeth_card *card) +{ + int ret; + + spin_lock_irq(get_ccwdev_lock(CARD_RDEV(card))); + ret = __qeth_issue_next_read(card); + spin_unlock_irq(get_ccwdev_lock(CARD_RDEV(card))); + + return ret; +} + static struct qeth_reply *qeth_alloc_reply(struct qeth_card *card) { struct qeth_reply *reply; @@ -1179,7 +1189,7 @@ static void qeth_irq(struct ccw_device * return; if (channel == &card->read && channel->state == CH_STATE_UP) - qeth_issue_next_read(card); + __qeth_issue_next_read(card); iob = channel->iob; index = channel->buf_no;