Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp896767ybg; Fri, 18 Oct 2019 08:58:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXuLlv11kC2/vvPKMEIiqauydX2ZQECkb6CBAiiKle+lYJRR7CEQfgxG3FI14pTy/TG7We X-Received: by 2002:a05:6402:88d:: with SMTP id e13mr10217128edy.246.1571414306828; Fri, 18 Oct 2019 08:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571414306; cv=none; d=google.com; s=arc-20160816; b=ypdlFsq4UZ+RraDHwXzPmWg63aEHkvdgXdzLzXEQZ9+UF4QkVxz9R5iaZQ/sAHyBhW e31lu67QonGuozjA6A2fVkbIc9Z7WMkBMzWjr/9dIPAGZm4aVJ3WsyQ+ye5tpq/Gb7pL /wfJK8LPpq9zdWNeTFVx7M5rqHumxq3DpR5O8TMMErzx9DVWsIarDgbsdDI8RoExIds6 a88xU/W4+Nsvb7UU6EacX4ur/2qcaF1kKP62zRYO6xrUlFM/i4nhZmyJmC8Ot+bkCBZv gcgzezRtszWk0kW5rw9hYGtVsfThNoLPwWSmFAyf2qVp6HLgC3jNAYTDYoRHlXqxr0KW 3mmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Tc37Pb9q6dE/zT3Ycpn//EMDbegOyEk2q1pX9+DJhEk=; b=MfG6vPFklNvgOPi4topebfw+isL7g8V1/MPcquy5ZnJNabnsJvMHFDe0sRFG43TTj3 Hw7if2vM4rnlRufuSqHXjo1EKM9LCIvrJDwdiPYKTqRB8aUQASIQD/HMJhWf3XcM2jGO yESEJK25Lr4nH27s1TWljwaOz4TWW6BDVbCNZdUkue8A3HSwsAIFidVkHlxM2n5CaOx5 tcdpQhI/2EfHSM30jPWhyGUniOucTVwzl2IOVv5yZ4tPfqJyMUjfE1WUuCGmzNlLMy7x 9vFDPHmGAGM9wcq1UYJ6C3wbB9IwDcJmYoJlBdNPbjVhTUtgDa7B1KxE2idZ/xNActsQ 6Gxw== 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 o22si3813252ejb.285.2019.10.18.08.58.03; Fri, 18 Oct 2019 08:58:26 -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 S1733086AbfJQNCk (ORCPT + 99 others); Thu, 17 Oct 2019 09:02:40 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:33914 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728923AbfJQNCk (ORCPT ); Thu, 17 Oct 2019 09:02:40 -0400 Received: by mail-qk1-f196.google.com with SMTP id f18so1151407qkm.1 for ; Thu, 17 Oct 2019 06:02:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Tc37Pb9q6dE/zT3Ycpn//EMDbegOyEk2q1pX9+DJhEk=; b=SESw4Tfv8Mfu0s1PL5CqgougsyQEsacsXelf0dSE/DncaQFPJXBxY5YhRXSsNTBNJM wL8SMcZSWDu0+bvtpmgKz+9dDu48sPTXaDVonTJxx8FeiUK3rNWBfNPG+UloVz+vJ0IA ArnzrCoe+o3jwHP0TsLntYJJ6Ise6Rxph+rVBeuSk1yenyZPzHlGxc2zCIlhawQJvzDI 9yCMWmHn8fqGYC0Dw4cBKkgZBpOgS3IhuO1HNvdZ17V6ALhjZYw7Nvb7+dx33UgTIZbZ 1deumTYnriD8rV7uNt4a4U4LP18YUeVKD0xc3Z6ovOb489iHExbM7mMA9fAfa+pFkTly vRtQ== X-Gm-Message-State: APjAAAWavVe+khO7j9sWZNG4xMEbbCb0Z+zR42nCjmq1sn90UOEPGaGT G2z9qe+NPE6JvDNlIhN0aw55yCzZWC2HIvA19ygpzFn6 X-Received: by 2002:a37:9442:: with SMTP id w63mr3106804qkd.138.1571317358971; Thu, 17 Oct 2019 06:02:38 -0700 (PDT) MIME-Version: 1.0 References: <20191014061617.10296-1-daniel@0x0f.com> <20191014061617.10296-2-daniel@0x0f.com> <20191016203219.GA5191@shiro> In-Reply-To: <20191016203219.GA5191@shiro> From: Arnd Bergmann Date: Thu, 17 Oct 2019 15:02:22 +0200 Message-ID: Subject: Re: [PATCH 2/4] ARM: mstar: Add machine for MStar infinity family SoCs To: Daniel Palmer Cc: "linux-kernel@vger.kernel.org" , Linux ARM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 16, 2019 at 10:32 PM Daniel Palmer wrote: > > > > + > > > +static void __init infinity_map_io(void) > > > +{ > > > + iotable_init(infinity_io_desc, ARRAY_SIZE(infinity_io_desc)); > > > + miu_flush = (void __iomem *)(infinity_io_desc[0].virtual > > > + + INFINITY_L3BRIDGE_FLUSH); > > > + miu_status = (void __iomem *)(infinity_io_desc[0].virtual > > > + + INFINITY_L3BRIDGE_STATUS); > > > +} > > > > If you do this a little later in .init_machine, you can use a simple ioremap() > > rather than picking a hardcoded physical address. It looks like nothing > > uses the mapping before you set soc_mb anyway. > > I've moved this into infinity_barriers_init() using ioremap() as suggested. > I'd like to keep the fixed remap address for now as there are some > drivers in the vendor code that might be useful until rewrites are done but > are littered with hard coded addresses. Maybe keep the infinity_io_desc as an out-of-tree patch then? You can simply do both, and ioremap() will return the hardcoded address. > > Not sure if it matters in practice, as almost nothing uses fiq any more. > > OTOH, maybe the lock is not needed at all? AFAICT if the sequence > > gets interrupted by a handler that also calls mb(), you would still > > continue in the original thread while observing a full l3 barrier. ;-) > > I've taken the lock out and tested that the ethernet isn't sending garbage > and everything looks good. I would not expect a missing spinlock to have an observable effect, the question is more whether it's correct in all rare corner cases where the barrier is interrupted and the interrupt handler uses another barrier. I think it is, but I would recommend adding a comment to explain this if you drop the spinlock. (or a comment about why this works with fiq if you keep the lock). Arnd