Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3230854ybv; Sat, 15 Feb 2020 14:58:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzQegLdnbXlegK+GMGlcxPGkOqQb55nOW9TMQs64JplZU8OsymBdehQD8s+m1Zmp4XCGdxs X-Received: by 2002:a9d:6548:: with SMTP id q8mr5017936otl.356.1581807522238; Sat, 15 Feb 2020 14:58:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581807522; cv=none; d=google.com; s=arc-20160816; b=RjY1obldWIXxm62QIC/upTcG/IfyiiEFdPx4jnLukHbuyC+PSDE4QeVwzp/WZ3J5+0 D7Dde2Bp7cBJeBztOfw8Ady46cD2XGc4G90mgl5vLWJGivB7SXUg/8jNiMaKCf7MNwuW zj5DDwvqcjybQIypC5ejFgjvGtr0ikUGYEACcYwDWHhwG888kEP1+BTNkFWZNjobqDBp VPZekKS4VtVtccrLuyVbJ9o9R1RWg+AiNIknxd/t5R7EzLPcm10A6GZkAgHI9zs41/SG 3xf31PZbHuPiAjCqiP4BcpUWd1P1gaQ8Q+7Vig5O4XkXttyU9m3hz6Nl/7GoX4GQJJ3m w92g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:references:subject:cc:cc:cc :to:from:date:message-id; bh=ZnrpFRwuHcMrcf2f334c6cLcNZOAyH4smyDfWLzsbYI=; b=fn/lxrnyQ8fzeqRKBkVXW13K8Wg+oql21gLyxvrC8El2hOLEGPoL1Xq0stQVTwUOwA WVhdL5ut9hSqtj/cay4EEo7NVVojsAdH0FfJ14olTidYfVoy6SvveTQ7Ems4NycNnMIv YoKeb9tihSU6ydqz7qeQGwdjhHjxUQbtquXsyPrpxBTjAUguiGXG0G/ej4V2Zy6JsikE N0UYQiokEI4j56reCt1gRp/w8PDxgPKF9Jqqo2XZmyMU0VP4B3ojHKo3UVnO/x/I6zZp WtPyiYNVeJn32uudXg0CsU9cssm1GN6O0bRNoAMLo4g50/j8NywK9Qo5cNootn4A/gMK 2ipA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si4927379otm.263.2020.02.15.14.57.55; Sat, 15 Feb 2020 14:58:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbgBOW4B (ORCPT + 99 others); Sat, 15 Feb 2020 17:56:01 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36748 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726275AbgBOW4A (ORCPT ); Sat, 15 Feb 2020 17:56:00 -0500 Received: by mail-pf1-f195.google.com with SMTP id 185so6892379pfv.3; Sat, 15 Feb 2020 14:56:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:to:cc:cc:cc:subject :references:in-reply-to; bh=ZnrpFRwuHcMrcf2f334c6cLcNZOAyH4smyDfWLzsbYI=; b=EDqICnpPB/CQU8EGUIsb0gMToUW8D9hu+953il6WTMZjj7YvRjjJr6uTi+cc59gfoT IeKnp+i/PskESjNQ7PJH2QFcUQm7AVI/yYijbH2hE+452KqKr8ZFNHM7uoQMvH7k8sqS u1j4clPxU9I6gSN0SCHfx1F5Yot+6DaeZNO8BVtSUzBvwEBJtsvH5GTVN2a8laJ3vwST SmvqXLTRTxQ33nf1mjpjUIEG/TvnQFPus7TObcvGyLgXhep35yd99pJL21uziwd0OGo6 CyHc2SHDG5c0n/EY7aLzIwUwYA/DekTD4DTw1U2v3SnsMvMOKx6aEXs+6RSWu0YsIROm bCCQ== X-Gm-Message-State: APjAAAWPm51kiZv66FmSSOgVTz+JZ4SxXP7j4kHNvvuEZ0+qhqeyLbzL T+JOdJVbJjnpgiNgA+jUZFc= X-Received: by 2002:a63:6d0b:: with SMTP id i11mr10217031pgc.266.1581807359743; Sat, 15 Feb 2020 14:55:59 -0800 (PST) Received: from localhost ([2601:646:8a00:9810:5af3:56d9:f882:39d4]) by smtp.gmail.com with ESMTPSA id w189sm11733073pfw.157.2020.02.15.14.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Feb 2020 14:55:59 -0800 (PST) Message-ID: <5e4876ff.1c69fb81.7b887.cb6e@mx.google.com> Date: Sat, 15 Feb 2020 14:55:58 -0800 From: Paul Burton To: Mark Tomlinson CC: paulburton@kernel.org, linux-mips@vger.kernel.org CC: chris.packham@alliedtelesis.co.nz, linux-kernel@vger.kernel.org, Mark Tomlinson CC: linux-mips@vger.kernel.org Subject: Re: [PATCH] MIPS: cavium_octeon: Fix syncw generation. References: <20200211212455.3307-1-mark.tomlinson@alliedtelesis.co.nz> In-Reply-To: <20200211212455.3307-1-mark.tomlinson@alliedtelesis.co.nz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Mark Tomlinson wrote: > The Cavium Octeon CPU uses a special sync instruction for implementing > wmb, and due to a CPU bug, the instruction must appear twice. A macro > had been defined to hide this: > > #define __SYNC_rpt(type) (1 + (type == __SYNC_wmb)) > > which was intended to evaluate to 2 for __SYNC_wmb, and 1 for any other > type of sync. However, this expression is evaluated by the assembler, > and not the compiler, and the result of '==' in the assembler is 0 or > -1, not 0 or 1 as it is in C. The net result was wmb() producing no code > at all. The simple fix in this patch is to change the '+' to '-'. Applied to mips-fixes. > commit 97e914b7de3c > https://git.kernel.org/mips/c/97e914b7de3c > > Fixes: bf92927251b3 ("MIPS: barrier: Add __SYNC() infrastructure") > Signed-off-by: Mark Tomlinson > Tested-by: Chris Packham > Signed-off-by: Paul Burton Thanks, Paul [ This message was auto-generated; if you believe anything is incorrect then please email paulburton@kernel.org to report it. ]