Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3929756imm; Mon, 8 Oct 2018 11:51:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV600L5++7TJUXm30uK9lsWPLLGiDSfi+PmRbwk7iEJSI2DmJF3KMPheV2stIVYyvNOaMvA5q X-Received: by 2002:a17:902:b213:: with SMTP id t19-v6mr25657277plr.51.1539024713955; Mon, 08 Oct 2018 11:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024713; cv=none; d=google.com; s=arc-20160816; b=tKcPXitG3EQJXVBVHQZTE4cB1Uu9r9TwLadsu3BI8wWHEQ8otpmWB4tRmvdyECMoH2 LpYshfy2DMk3dsahtkhW5+HwUDB5Dd/VJhscAAY8UJOnRqFbFXfq8OMz6HSDtjtKKJb/ 4qmVbMo9w5dnp5rA+mmp9Yi5IU2K6/uX17Zhoes5IHofAOjLNt2nmurCgHD1gw3rNhvY hP+cpmj4vViCADdw25wzM5n0gkIXjkQYJuZq8aJRCiWqsp8n/vqNIm95qfT4leUjjK4U ZkyuSyXVt8FU2jgQtoopIGlKVLl7bF6ZiK/jXsbaEFfwMgJOxp+zNQIh4We94g5AaPLh zH5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/8QqGFdJCEImoiGtzbfIoJe3Lb4AmU5nXEXnbiVTfWk=; b=a0bZjmpOPS6Xjn9Dsc2AHNbcR/TzyJXtAlMr+4v5UDrpFBvgsp3uQLJUNskdKhDxug CYUaH10veGWo70mcZ4O6U5Q1Ks6Tom2TxaMfRV7QXukU2JMMjo0nmbOFBhPxwEQXM9H9 bSFYVaduLd+VxFWOrOP/4jSl/bgwvlQZttJAj/duhxo1YR39MmbeRT3z96bI056BU71p btxXb+KoXJYB7j55hj1DsyWyQZrV8nFp4Sb4eI/IkoM5gbdyGJR8pv/j3RwuwJDveEO0 18uNXQP5cpfvh74MHPh+7d1Nzhmz6Ps10HQf2n18sZ3vX/j2caen7liJvwttfyi774fP OZzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mcdkkAlh; 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 j12-v6si20673386pfd.222.2018.10.08.11.51.38; Mon, 08 Oct 2018 11:51:53 -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; dkim=pass header.i=@kernel.org header.s=default header.b=mcdkkAlh; 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 S1732349AbeJICEi (ORCPT + 99 others); Mon, 8 Oct 2018 22:04:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:54494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731723AbeJICEh (ORCPT ); Mon, 8 Oct 2018 22:04:37 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BEFC9204FD; Mon, 8 Oct 2018 18:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024690; bh=vlZkPvKDe6/jBdxfBxfNUttO7s8cZGhO3e8LA4xX314=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mcdkkAlhZ+GJ1pEECR3LvrxotEe+0vbzH6mZ1hjScAmxeq0HBHO8G2CLA2oJxoaiL AnhETiCAlmee9mG+wdyeV8RbM1AOitAF9k6N9mQ5kY6081YIGORELk63lys2GRzuuJ Crqqj+EV6xLxZnPcpMucISeAiU8E+WIZ/UREBloU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Netanel Belgazal , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 123/168] net: ena: fix missing calls to READ_ONCE Date: Mon, 8 Oct 2018 20:31:43 +0200 Message-Id: <20181008175624.725073888@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Netanel Belgazal [ Upstream commit 28abf4e9c9201eda5c4d29ea609d07e877b464b8 ] Add READ_ONCE calls where necessary (for example when iterating over a memory field that gets updated by the hardware). Signed-off-by: Netanel Belgazal Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/amazon/ena/ena_com.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -459,7 +459,7 @@ static void ena_com_handle_admin_complet cqe = &admin_queue->cq.entries[head_masked]; /* Go over all the completions */ - while ((cqe->acq_common_descriptor.flags & + while ((READ_ONCE(cqe->acq_common_descriptor.flags) & ENA_ADMIN_ACQ_COMMON_DESC_PHASE_MASK) == phase) { /* Do not read the rest of the completion entry before the * phase bit was validated @@ -637,7 +637,7 @@ static u32 ena_com_reg_bar_read32(struct mmiowb(); for (i = 0; i < timeout; i++) { - if (read_resp->req_id == mmio_read->seq_num) + if (READ_ONCE(read_resp->req_id) == mmio_read->seq_num) break; udelay(1); @@ -1796,8 +1796,8 @@ void ena_com_aenq_intr_handler(struct en aenq_common = &aenq_e->aenq_common_desc; /* Go over all the events */ - while ((aenq_common->flags & ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == - phase) { + while ((READ_ONCE(aenq_common->flags) & + ENA_ADMIN_AENQ_COMMON_DESC_PHASE_MASK) == phase) { pr_debug("AENQ! Group[%x] Syndrom[%x] timestamp: [%llus]\n", aenq_common->group, aenq_common->syndrom, (u64)aenq_common->timestamp_low +