From patchwork Mon Feb 1 14:12:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Henzl X-Patchwork-Id: 8179961 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 022DB9F38B for ; Mon, 1 Feb 2016 14:12:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32F9F2045A for ; Mon, 1 Feb 2016 14:12:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2441720458 for ; Mon, 1 Feb 2016 14:12:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932728AbcBAOMI (ORCPT ); Mon, 1 Feb 2016 09:12:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43030 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932244AbcBAOMH (ORCPT ); Mon, 1 Feb 2016 09:12:07 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 13E12C0B7AA1; Mon, 1 Feb 2016 14:12:07 +0000 (UTC) Received: from dhcp-26-156.brq.redhat.com (dhcp-26-156.brq.redhat.com [10.34.26.156]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u11EC51W012285; Mon, 1 Feb 2016 09:12:05 -0500 To: "'linux-scsi@vger.kernel.org'" Cc: "Sumit.Saxena@avagotech.com" , "Desai, Kashyap" , Uday Lingala , stable@vger.kernel.org From: Tomas Henzl Subject: [PATCH v2] megaraid_sas: add an i/o barrier Message-ID: <56AF67B4.2010702@redhat.com> Date: Mon, 1 Feb 2016 15:12:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A barrier should be added to ensure proper ordering of memory mapped writes. V2: - added the barrier also to megasas_fire_cmd_skinny, as suggested by Kashyap Desai Signed-off-by: Tomas Henzl Reviewed-by: Kashyap Desai Acked-by: Kashyap Desai --- drivers/scsi/megaraid/megaraid_sas_base.c | 1 + drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index cc92c8198d..9f7689515c 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -749,6 +749,7 @@ megasas_fire_cmd_skinny(struct megasas_instance *instance, &(regs)->inbound_high_queue_port); writel((lower_32_bits(frame_phys_addr) | (frame_count<<1))|1, &(regs)->inbound_low_queue_port); + mmiowb(); spin_unlock_irqrestore(&instance->hba_lock, flags); } diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index d9d0029fb1..98a848bdfd 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -204,6 +204,7 @@ megasas_fire_cmd_fusion(struct megasas_instance *instance, &instance->reg_set->inbound_low_queue_port); writel(le32_to_cpu(req_desc->u.high), &instance->reg_set->inbound_high_queue_port); + mmiowb(); spin_unlock_irqrestore(&instance->hba_lock, flags); #endif }