Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6648811imu; Wed, 14 Nov 2018 05:02:21 -0800 (PST) X-Google-Smtp-Source: AJdET5f9abRLZA+dv8qXzotXRi/rHu35Sm8Tdzd5xZS6OXY1e7ztIMZrF5T4m9yhgYwWcASiT+xL X-Received: by 2002:a17:902:9f8c:: with SMTP id g12-v6mr1165405plq.127.1542200541129; Wed, 14 Nov 2018 05:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542200541; cv=none; d=google.com; s=arc-20160816; b=h3moA90WHvWd+qNxyaTGobOL1zzFj6+hszczXvKjBgcIoo7pEu+lIBDt4PV01yN/N8 I6SeSbvjVNVToANDUxVf4R3BNzWdwFIluP4AnOK+6oYjWWIDc9k7F6/3bPpNCYSBqb6f Vc1zi21PoH5lKhX2ti8ZJsFGzU/gDqlyPPb2b9xne7ism03mY1D2Gm50ku6NJXhcoG26 kYtTuHYIBEYVVxIbfuL7NAJBA+JHdPk8ix0CS2sK4/LzYKZFmg8yTXKonfxldAkkXmSg lCGKVGIDKGccP1tB+L9UbOntCmXYmW/YUch+3xPyoUyikexVyEC6tIe5F0i5orWub0oQ R/mQ== 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=yeDD0VgUhJrOl6DgBaZYgv9QkZSw48PkCi7Bwh5ADzP5QmxSN00nMyPdYaaKIjqiVe zYKiMJ1j0oiJo66YSn32EeWqQkGBi6RMP1tf2+jej3jIE5BskwDyaVQ644i8qY46/MOL i0C+HM+h7dDPa+0e/jJq5Gh9RxNAVNUc9pEfHtY9vy64aJydM1YHkhTkAMzXIZ0HMkHM 8ZOjGbpFFVFMGQ40IoY4tKuBR1ByPt/+IXhAH/XCD6SY8RLd/5APqG+tqjxybxyC7k9y uobERGWUpx1Ww+grjJ5TX9bVqDoey2ro82QoUu1pJOc+VT8rYtNddgdFrRJUUn93ocP1 r7Iw== 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 k135si4278377pgc.574.2018.11.14.05.02.04; Wed, 14 Nov 2018 05:02:21 -0800 (PST) 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 S1733145AbeKNXEV (ORCPT + 99 others); Wed, 14 Nov 2018 18:04:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:44564 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732843AbeKNXDd (ORCPT ); Wed, 14 Nov 2018 18:03:33 -0500 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 C496FB0F1; Wed, 14 Nov 2018 13:00:22 +0000 (UTC) From: Nicolas Saenz Julienne To: stefan.wahren@i2se.com, eric@anholt.net, dave.stevenson@raspberrypi.org Cc: linux-rpi-kernel@lists.infradead.org, gregkh@linuxfoundation.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne Subject: [PATCH 12/16] staging: vchiq_util: get rid of unneeded memory barriers Date: Wed, 14 Nov 2018 13:59:38 +0100 Message-Id: <20181114125942.25163-13-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181114125942.25163-1-nsaenzjulienne@suse.de> References: <20181114125942.25163-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