Received: by 2002:a05:6520:2f93:b029:af:d4db:7a05 with SMTP id 19csp2364510lkf; Fri, 5 Feb 2021 11:12:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVHm96xNklc3wSSGFdGZU+DbH8NK7UeLjdT4q4xpF/Avw9m7gtPq8VB5D6CS+qRilQW8AA X-Received: by 2002:a17:907:76c5:: with SMTP id kf5mr5401065ejc.534.1612552346011; Fri, 05 Feb 2021 11:12:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612552346; cv=none; d=google.com; s=arc-20160816; b=cuY1+guCQomhCCP5SgVNWiK6hHAQaHJAx9N5yvlegh/zXzJWcguQbIVYtp9T9HlLtW n23W132uAGgv952ep0T642T65ogxtQ+3qrGeURbNWUCsW/NmEQsy7eNweAKBZ/DpzZpp 1IQ75xcUqJehdy1w3R5d2sIcRvbBpdXpsotsF2TryBi8LQ2yYogvCgoZpInOFyuEJPPD 2ysnVGioLe7CFGH+gV/PIKxwLodaWoiDLT+slxi6eiwbESbjyD1uhvS3k3Mn/7U49HV9 CZCfiKhbEtylsSjnp6WvAO2ZXzqyuQxSaMxHnHjh1qxMmtZQjUEM0ZqPlMEawOoBqRGM LCEA== 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=do6wErsm499YB7o7GqYisIT56ut14MFhdW3Z2MraS7M=; b=e2lEbEejuTn1dyRb6RYTdPsbyyvh2nXf92z0luQ3EVYQPP3GQRAe4xWY4rvQkf3WSl pHzMBuTXncYHS2iLqlmQ9LdrYQmJaEF5sPpaf+TL/33w0VYwkB1iq6ycVY8UwvECNlh4 s/brrce214wzKJ14z6gIp3o1uLFhbPkyKViDKQQHdRVWqw0Zh7GLGmoVPe9aa/NIQsqC 7BARQp9bXw2KZX+oRmhHjHj9jtfg4wJKbEY8angmr/ZfXqfZAgaiaBp24KKGjRLSWbiB A7Y76ktRqof2M0zdhAqD4qRLSVHaLAVucp/RAGcWSa1HjsjiPtWOVekd0fZalfbaIkN4 Rtzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eNv7CtOQ; 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 bw14si5788564ejb.201.2021.02.05.11.12.01; Fri, 05 Feb 2021 11:12:26 -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=eNv7CtOQ; 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 S233490AbhBER2H (ORCPT + 99 others); Fri, 5 Feb 2021 12:28:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:54516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233478AbhBEQAH (ORCPT ); Fri, 5 Feb 2021 11:00:07 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1520765053; Fri, 5 Feb 2021 14:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534341; bh=0Jg9HhX2wgLDjUo+HzKXXr/haumhWqdQR9muR8xmCak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eNv7CtOQpW5SprQU1Ujk5Mm3V+Rzy5H5d03cuFicQFZwhrFwah0tgote2X9VfMuC8 AuagyGrWNV204hQPtMjU/D45QREhSHXafh6FIlpP891YXDsAFLzfHOUfFebC+2VJEo p1U8TAeSC72utiIuzk0AYdFav63qvr2vqt+6SXKE= 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.4 03/32] ibmvnic: Ensure that CRQ entry read are correctly ordered Date: Fri, 5 Feb 2021 15:07:18 +0100 Message-Id: <20210205140652.499953112@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140652.348864025@linuxfoundation.org> References: <20210205140652.348864025@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 @@ -4752,6 +4752,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; }