Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp167881imd; Fri, 26 Oct 2018 06:50:17 -0700 (PDT) X-Google-Smtp-Source: AJdET5dQEcufSEOPpECtXM4qhbgCFD/p59yBiVgXhH1UL9rEmaPoPEJx9UpgpYF0Frp/EttmfMVk X-Received: by 2002:a63:a064:: with SMTP id u36mr3590420pgn.145.1540561817445; Fri, 26 Oct 2018 06:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540561817; cv=none; d=google.com; s=arc-20160816; b=xQ4o21nYvM4WsTRprAef0YOm/Mqjn8fZoOkAcehrDpqAyC0QQ2YDC4oUdvHuOhrLmT uIrjJwVeL+JeDOv9RKFrfi3xudq1H7DPqGScpmmvdwIHXpFWOIV7QAyuIllt6qqjasF2 S75TkUTNi+5wyxdZc5GB6koYy82gEvSoedWynBuity15+gVoL7pqKc7wJj2WBkf/IBiv 3YOXXEDKYHMf8Ov2fPqzA0geUcV+CC0NBRkI1ubfAbpFsTW/+bv0XaS2zQGPzv1Nb126 rYermaFztvGX5GkydMu2CcKuiGxIr0aZbdwyOAnCmWAQuZKcvg9zOjODxb57ES4+bouX zCYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MMH0hBbNWcrhECKIbWdrpSnng6C4+TXQokZNlMVafn8=; b=TMfkrE7oc/8tV5Bn0/tfqkkHpYO9kCdNYufcqv+zlxIGs+dgFURDGGk/C+rPvORN9n rqmrozwrf0qApHQWzaF64ARFVNuHm/m/WTZjsnLSX7ixDD4bvS2nY79aNidhAxv0li0e cXzLHvhx2crYS0YxJx3tubEvi1PTmkqaqis2N4I3UOpKulI2kVnRyuWpElhHU5DaY6QX DYhBF4o8hn+2FDgy2yiekNRcc1kbkpazbQH0I2eEaG6Vm6KGcvtz1+zjdcMB+RNoDLBg y+YZnUFZjFWSEGpPP0ROSvllMNq8IugPG2p7pJm15VzySd65F2XiQVkOTCxHE8Jx1mzd 6B0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9-v6si10820962pll.414.2018.10.26.06.50.02; Fri, 26 Oct 2018 06:50:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727747AbeJZW0Z (ORCPT + 99 others); Fri, 26 Oct 2018 18:26:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:44840 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727591AbeJZWZr (ORCPT ); Fri, 26 Oct 2018 18:25:47 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 46287B054; Fri, 26 Oct 2018 13:48:38 +0000 (UTC) From: Nicolas Saenz Julienne To: stefan.wahren@i2se.com, eric@anholt.net, dave.stevenson@raspberrypi.org Cc: nsaenzjulienne@suse.de, linux-rpi-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC 14/18] staging: vchiq_util: get rid of unneeded memory barriers Date: Fri, 26 Oct 2018 15:48:09 +0200 Message-Id: <20181026134813.7775-15-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181026134813.7775-1-nsaenzjulienne@suse.de> References: <20181026134813.7775-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All the memory operations featured in this file modify/access memory that is only accessed by the CPU. So we can assume that all the memory barrier handling done by the completion routines is good enough for us. Signed-off-by: Nicolas Saenz Julienne --- .../interface/vchiq_arm/vchiq_util.c | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c index 44b954daa74a..4b8554bc647e 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c @@ -84,20 +84,7 @@ void vchiu_queue_push(VCHIU_QUEUE_T *queue, VCHIQ_HEADER_T *header) flush_signals(current); } - /* - * Write to queue->storage must be visible after read from - * queue->read - */ - smp_mb(); - queue->storage[queue->write & (queue->size - 1)] = header; - - /* - * Write to queue->storage must be visible before write to - * queue->write - */ - smp_wmb(); - queue->write++; complete(&queue->push); @@ -112,12 +99,6 @@ VCHIQ_HEADER_T *vchiu_queue_peek(VCHIU_QUEUE_T *queue) complete(&queue->push); // We haven't removed anything from the queue. - /* - * Read from queue->storage must be visible after read from - * queue->write - */ - smp_rmb(); - return queue->storage[queue->read & (queue->size - 1)]; } @@ -130,20 +111,7 @@ VCHIQ_HEADER_T *vchiu_queue_pop(VCHIU_QUEUE_T *queue) flush_signals(current); } - /* - * Read from queue->storage must be visible after read from - * queue->write - */ - smp_rmb(); - header = queue->storage[queue->read & (queue->size - 1)]; - - /* - * Read from queue->storage must be visible before write to - * queue->read - */ - smp_mb(); - queue->read++; complete(&queue->pop); -- 2.19.1