From patchwork Thu Nov 13 19:24:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pranith Kumar X-Patchwork-Id: 5300311 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 24A679F2F1 for ; Thu, 13 Nov 2014 19:31:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40E12201F2 for ; Thu, 13 Nov 2014 19:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E7D9A201C8 for ; Thu, 13 Nov 2014 19:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933908AbaKMTZO (ORCPT ); Thu, 13 Nov 2014 14:25:14 -0500 Received: from mail-yk0-f174.google.com ([209.85.160.174]:33792 "EHLO mail-yk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933974AbaKMTZD (ORCPT ); Thu, 13 Nov 2014 14:25:03 -0500 Received: by mail-yk0-f174.google.com with SMTP id q9so2364208ykb.19 for ; Thu, 13 Nov 2014 11:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CBXv1O+USBtZ/zY2AqIyvQPVTUrnRc/eWJxl2nA4H8w=; b=oD517gLq+ivM/m6qAr5AGuipyM4Ljf1z7bSmqGwpYJO54CQt2rdct5j2OO0hEUrO7I R11uiuBhIho2AriKM2Gu9G0bBABHgOxW50BGBxynEl35w9qjuQZINYA0lxLvrZDR63wX oJQvGCa4i4Ppf4TtKJMW9WMm2vTUxkLVXyG9ywNRbTW3OAHF6NDE8zgAcBUrMsdoDjzi pBCqGPSfUcD9Q3NnCkEkHT6165thBzUMxyMU22+gD4K5miBzxecaODfe3NCcZUESY0D/ oQlbAMA+YdQNclw35AluOmwfm8/8/DNW10GAloY3Ut1wyS1T/L3jnY8exEkX6wFJtWdG 0y7A== X-Received: by 10.236.189.148 with SMTP id c20mr5086548yhn.133.1415906702180; Thu, 13 Nov 2014 11:25:02 -0800 (PST) Received: from evgadesktop.attlocal.net (108-232-152-155.lightspeed.tukrga.sbcglobal.net. [108.232.152.155]) by mx.google.com with ESMTPSA id u66sm13963019yhp.46.2014.11.13.11.25.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Nov 2014 11:25:01 -0800 (PST) From: Pranith Kumar To: Dan Williams , Vinod Koul , Bartlomiej Zolnierkiewicz , Kyungmin Park , "David S. Miller" , Thomas Gleixner , =?UTF-8?q?Manuel=20Sch=C3=B6lling?= , Dave Jiang , Rashika , dmaengine@vger.kernel.org (open list:DMA GENERIC OFFLO...), linux-kernel@vger.kernel.org (open list) Cc: paulmck@linux.vnet.ibm.com Subject: [PATCH 03/16] drivers: dma: Replace smp_read_barrier_depends() with lockless_dereference() Date: Thu, 13 Nov 2014 14:24:09 -0500 Message-Id: <1415906662-4576-4-git-send-email-bobby.prani@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415906662-4576-1-git-send-email-bobby.prani@gmail.com> References: <1415906662-4576-1-git-send-email-bobby.prani@gmail.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- drivers/dma/ioat/dma_v2.c | 3 +-- drivers/dma/ioat/dma_v3.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c index 695483e..0f94d72 100644 --- a/drivers/dma/ioat/dma_v2.c +++ b/drivers/dma/ioat/dma_v2.c @@ -142,10 +142,9 @@ static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete) active = ioat2_ring_active(ioat); for (i = 0; i < active && !seen_current; i++) { - smp_read_barrier_depends(); prefetch(ioat2_get_ring_ent(ioat, idx + i + 1)); desc = ioat2_get_ring_ent(ioat, idx + i); - tx = &desc->txd; + tx = &lockless_dereference(desc)->txd; dump_desc_dbg(ioat, desc); if (tx->cookie) { dma_descriptor_unmap(tx); diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c index 895f869..cbd0537 100644 --- a/drivers/dma/ioat/dma_v3.c +++ b/drivers/dma/ioat/dma_v3.c @@ -389,7 +389,6 @@ static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete) for (i = 0; i < active && !seen_current; i++) { struct dma_async_tx_descriptor *tx; - smp_read_barrier_depends(); prefetch(ioat2_get_ring_ent(ioat, idx + i + 1)); desc = ioat2_get_ring_ent(ioat, idx + i); dump_desc_dbg(ioat, desc); @@ -398,7 +397,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, dma_addr_t phys_complete) if (device->cap & IOAT_CAP_DWBES) desc_get_errstat(ioat, desc); - tx = &desc->txd; + tx = &lockless_dereference(desc)->txd; if (tx->cookie) { dma_cookie_complete(tx); dma_descriptor_unmap(tx);