From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753096AbdKHVAQ (ORCPT ); Wed, 8 Nov 2017 16:00:16 -0500 Received: from omzsmtpe01.verizonbusiness.com ([199.249.25.210]:29138 "EHLO omzsmtpe01.verizonbusiness.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753132AbdKHU4j (ORCPT ); Wed, 8 Nov 2017 15:56:39 -0500 X-Host: surveyor.tdc.vzwcorp.com From: "Levin, Alexander (Sasha Levin)" To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: James Smart , Dick Kennedy , "Martin K . Petersen" , "Levin, Alexander (Sasha Levin)" Subject: [PATCH AUTOSEL for-3.18 12/27] scsi: lpfc: Add missing memory barrier Thread-Topic: [PATCH AUTOSEL for-3.18 12/27] scsi: lpfc: Add missing memory barrier Thread-Index: AQHTWNNHP/FlAw3U60mq3NGq1OylLQ== Date: Wed, 8 Nov 2017 20:50:57 +0000 Message-ID: <20171108205049.27612-12-alexander.levin@verizon.com> References: <20171108205049.27612-1-alexander.levin@verizon.com> In-Reply-To: <20171108205049.27612-1-alexander.levin@verizon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.144.60.250] Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id vA8L0JVH003720 From: James Smart [ Upstream commit 6b3b3bdb83b4ad51252d21bb13596db879e51850 ] On loosely ordered memory systems (PPC for example), the WQE elements were being updated in memory, but not necessarily flushed before the separate doorbell was written to hw which would cause hw to dma the WQE element. Thus, the hardware occasionally received partially updated WQE data. Add the memory barrier after updating the WQE memory. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/lpfc/lpfc_sli.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 207a43d952fa..42236ef89ab0 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -118,6 +118,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, union lpfc_wqe *wqe) if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED) bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id); lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size); + /* ensure WQE bcopy flushed before doorbell write */ + wmb(); /* Update the host index before invoking device */ host_index = q->host_index; -- 2.11.0