Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2281327pxb; Fri, 5 Feb 2021 13:43:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6Rqdf2I3E105/FO8L498Up9dVsZZpAxXZZKovUnhyz5gcT5XudI0rjha6GnPMg/rgGg82 X-Received: by 2002:aa7:d817:: with SMTP id v23mr5388349edq.192.1612561380692; Fri, 05 Feb 2021 13:43:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612561380; cv=none; d=google.com; s=arc-20160816; b=kpLFGNAo/JXGim+v2EpJy0tZr7IVd0RmvtIT4FC+mrhzhaNQpREDso3nvJHzL9eG7j QZfiM8/gFmfcXPeJw65nMjJKcWojXpG9+r/hQlutia8qslN7usa4Ht+FuFypvi5iDUTS 0C9HBCueeLOWCsTd5IrZSMTstuxHPslfu1+/st+9Q7aCZGUQYG/UNsH0TeXl1oYKk1bE Jj8U1V5SdG3h1s2EO8eFCgwxrnjMbjG0WBB0NSrfSXOYVGisf9HD0pT9a/F0nF+SFTX0 MuNvf7dn5MoO7OWpnISieAzYzvvtVCDDxsT7tqwT61bfW3tu/5FeQCVuvYUYaRDvIo5I idog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+6AjbC29NBtjEUHOmTfdxhZHZLPOlzHbC3W4z4ODqh8=; b=EEfZj3FxdT6N9bEzbeelQ8HYSz1CClb/u6XR8BjIxE7h4QT2XiPq9m7o263iFuBXr6 k1k+Ry6Yaia1pzqAXtLp8oe6AxZrgAeiuEHsM5hLhQqDAkxA2nTQcH1gW/vo5xB1lsr9 1eOVcnIU3a67yDA4sEHA8RdNMnXCjFYZv7/Wv8BvXxxr1mY7Jd3ZIQ9LSsapFrrEElef v2nQoTCKDEmZtc2VtPPy1Xy/ZS72qdDHHdrr+XzElwZHd1YV8ilMVkw9Z9dlG/0buRPM j7dy9OkLtk3JwsO4pF5F2VUerq7t8fOo1h81clMfz9VrAAn36K/Qgn/OtcMYpEZIMiJp zwOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nKOuqS1s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si1956170eds.533.2021.02.05.13.42.36; Fri, 05 Feb 2021 13:43:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nKOuqS1s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231274AbhBEVlW (ORCPT + 99 others); Fri, 5 Feb 2021 16:41:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:45594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233021AbhBEO77 (ORCPT ); Fri, 5 Feb 2021 09:59:59 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0CAF264FE7; Fri, 5 Feb 2021 14:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534227; bh=IYMfv9JRu3GCkHKtOz8m2i55b8Oct4nbxyQObn+vl3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nKOuqS1sLVRd0GEQVumPgkJjVLycBicu0NXg+MJxhT5OsHO7P4qzQixomrSyt/32E diKPk4QnFTxpnxEPssCLyMWaAOEeIAHHrFeauZMs3jlmHVU+qY5FymAw4HUj/i4+kY 1lHUU+e4wj9rBpE2/ZwGuS6PByjFVXbXwkLEuiqc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lijun Pan , Jakub Kicinski Subject: [PATCH 5.10 09/57] ibmvnic: Ensure that CRQ entry read are correctly ordered Date: Fri, 5 Feb 2021 15:06:35 +0100 Message-Id: <20210205140656.380361517@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140655.982616732@linuxfoundation.org> References: <20210205140655.982616732@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lijun Pan commit e41aec79e62fa50f940cf222d1e9577f14e149dc upstream. Ensure that received Command-Response Queue (CRQ) entries are properly read in order by the driver. dma_rmb barrier has been added before accessing the CRQ descriptor to ensure the entire descriptor is read before processing. Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") Signed-off-by: Lijun Pan Link: https://lore.kernel.org/r/20210128013442.88319-1-ljp@linux.ibm.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ibm/ibmvnic.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4979,6 +4979,12 @@ static void ibmvnic_tasklet(struct taskl while (!done) { /* Pull all the valid messages off the CRQ */ while ((crq = ibmvnic_next_crq(adapter)) != NULL) { + /* This barrier makes sure ibmvnic_next_crq()'s + * crq->generic.first & IBMVNIC_CRQ_CMD_RSP is loaded + * before ibmvnic_handle_crq()'s + * switch(gen_crq->first) and switch(gen_crq->cmd). + */ + dma_rmb(); ibmvnic_handle_crq(crq, adapter); crq->generic.first = 0; }