Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2306265pxb; Fri, 5 Feb 2021 14:31:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzo1/t0fztpN8qN+11mPhbxOJSHgkUWrVk3aoSkwJtqOJs0pHoYpRAG5ZJrahBM5BbQSr02 X-Received: by 2002:a17:906:16d0:: with SMTP id t16mr5854960ejd.259.1612564313430; Fri, 05 Feb 2021 14:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612564313; cv=none; d=google.com; s=arc-20160816; b=oLTGUfV7x/DzdithRqDkiNJ6fIlkmLesrkpdRSkv7NAE323yNRGcRS4t9778ymXURJ mMTq1BfupTTIHA3Mq4AO4cKxvBYSi74IcWmAEvFsHObqQErMDstQUZo0yDedI8ekSS7k yke0mU3s5u9Q1f6i+HDPc4OGjoh1Z+e1Du0vkXK5OzvI4+tBUdHjF2XqSuY2aCrxDStA xzkSwemRP3iqblr/aygxcwrEB2RGJzME4uLC0aKras9LC4cWVbFLfCWKmkC8tBphqh0s Ttc9v6ROMRPldXW3F5NjCREeEbYNTlBNAP8SI6dKO9NmQEe8zrCdPfKjjmhwPecxfzla bedA== 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=aMrvGoxFnyLIwhynMOHcsOVQsRf5zd/1qs6lIRbCImw=; b=gBYRxYfxt9Y9g6UG5M9FHX9/AEA6MDtracifsqR+8cu6aWzr/dKRoOubDPbSFpg7Ds L2mSBsN5Zoc4JQuy2ZDlNzq2MupHuIpxImNC0UVwa++7eD+SkGCvLdZzrxd9NeB+QJX/ WoXuCKdSokgImthZSMoR1CjNzQu3up+85eyQrMTwkXe14t1g1Z9t6xs69+/+f68736lg xUhrD/i00El5rTqeJ5B42XKyOo5AvATmlz/sktNgeYwy/9akTg41On1jxD3rrLOyhCrc kSZds+TiuxadvQBEIALHHDXbIRGljciD3JuOI7dyrXAaNTADYYaDlQqmZBm+1RPRgBiQ J5Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c31voOwh; 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 q5si5763591ejj.525.2021.02.05.14.31.29; Fri, 05 Feb 2021 14:31:53 -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=c31voOwh; 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 S232846AbhBEWac (ORCPT + 99 others); Fri, 5 Feb 2021 17:30:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:44680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232831AbhBEOye (ORCPT ); Fri, 5 Feb 2021 09:54:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0133565097; Fri, 5 Feb 2021 14:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534436; bh=1v/J7WfRNwOGWIxtOOlAxyprU/btXSoTrHhjPs3JUYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c31voOwhd3SShCmhnnoYHDn7GhpQAb/CnLf1Q1jEfXxo++Nyp4xHFkBHz7eMZ8wpg kKMqoxfazOJTooZr1j/ixTrkLH2L2h3wg1elY/WWibfhZpL/QoqOdzaMjXNiKNCtKn yklEHttP6WOp4jDwxY74lAr/fEx1Tbd4Q8I1rb5U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lijun Pan , Jakub Kicinski Subject: [PATCH 4.19 02/17] ibmvnic: Ensure that CRQ entry read are correctly ordered Date: Fri, 5 Feb 2021 15:07:56 +0100 Message-Id: <20210205140649.916232560@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140649.825180779@linuxfoundation.org> References: <20210205140649.825180779@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 @@ -4434,6 +4434,12 @@ static void ibmvnic_tasklet(void *data) 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; }