Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp813714imu; Tue, 20 Nov 2018 07:21:20 -0800 (PST) X-Google-Smtp-Source: AJdET5dvCeVBG9UgTCtXtEeePQkZwpi+H3yOl8xLrNrLt9WWgn6DZLsy3kXthJuZG6jojVWgtRvB X-Received: by 2002:a62:1bd7:: with SMTP id b206mr2574888pfb.213.1542727280216; Tue, 20 Nov 2018 07:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542727280; cv=none; d=google.com; s=arc-20160816; b=jLGfl3L2v9TY8+S6YZ7m+/PTgCn3EuNj4ddtNXUph/b3pdc/pPs6LUmA/v29MLMFYI 39jtpTvY4H+I04yxTS6kGiF/GWwwSzCR+4dPL7s0rKvQPAteh/tCbBoKUa4BRBKLT/K9 AAJOaLrHGgGX8VZpsnU+88lrCTwUJXMsF4clQB6U3jFNXwQZGXFdcpOWj/XZuXJSHUIr y4kCXMYaT7UpL9e5wlbpphIixYP9rnD1CxGxV1syoKfmOjIQeEivNkW2YIzE7NkGonfS dv4GGeokiKpQ6OO+irjQrfvahVMVx7IkHubx+YFbce0igM67EQIOIYW+v6LSEfupRdPW M/HA== 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=E4pzr4l6zOxE13xEEKTdABreM+gSd9uWSEVW3y0l5xK655DWptXE6n+UjFcHVtfXP8 jCJGTAvjB3YbYRcJ88irR2krBn2QzrhKAbrt277hinw2BxHQOMXq9/ysWL5L1dco41ex ofQtG4uLa0LEnUNcMAp8rNC/rVNOIKqaHm4RJ1i2h8hFAZ2zqDKFjq1zX57MqsIY8GwK uRJc/Xy8fOvqQMwTn4HGYScgVRoG6nxfvsveMHvrFeXsyzo+/OCJNN8NABj37/XOJL54 1TXx71n/tPgQcpLFGmSlBjxKzY3CIlTLcGRhRqB4t/nNQblwdr5Rg510BOSLreiUwnTS BdJA== 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 g124si9916377pgc.568.2018.11.20.07.21.05; Tue, 20 Nov 2018 07:21:20 -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 S1730002AbeKUBXp (ORCPT + 99 others); Tue, 20 Nov 2018 20:23:45 -0500 Received: from mx2.suse.de ([195.135.220.15]:39262 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729945AbeKUBXo (ORCPT ); Tue, 20 Nov 2018 20:23:44 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5CFB9AFF8; Tue, 20 Nov 2018 14:54:12 +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: Tue, 20 Nov 2018 15:53:47 +0100 Message-Id: <20181120145351.30390-13-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181120145351.30390-1-nsaenzjulienne@suse.de> References: <20181120145351.30390-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