Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp811206ybi; Fri, 14 Jun 2019 03:50:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfAPjUIVXjGGxuXPO7E3WKzyRbKxOT7HoKnXI6HkATMoea6BBezHtbKZO4Tl1ohcFHFy+Y X-Received: by 2002:a17:90a:b883:: with SMTP id o3mr2511099pjr.50.1560509428936; Fri, 14 Jun 2019 03:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560509428; cv=none; d=google.com; s=arc-20160816; b=bPa/POYxpLL3vQEHps2pF5sEWpmOTFwbgTEw5B2yQ4ak2H++hDv/MSbcGDnNuoYBCn mguxsoGCHD86qZGGonllmB9t+S73opdBiNA7alsuz7LsEIIeMou9W0ULVAmkAya1edkm 1GHQWxWAGhYeNMa4uzaLLAUCOc7fXxoxlzCBTOg+OgEkXMPIpVYeTIUMyy4Dc4u/RHsM yf68zsp9js1zCc0sFef/pnDTGFRrgqhi0Oao0MwlVB1qVgnzu3nz2CFLnr1g59x19VD2 KSGiHIoryWsb06Kbot/4wpHunD6xr9AI1SB5elrDyC6qU4qmbVmWM0uVJ2eKjkHRElZB FoZg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=tF4RNNhPjySd1T78IEmeyfgM8BLYRQ7QQeDcPJqXZYs=; b=vue2Kz34i6EtuUuZiTRyoujTGdD6Vouof6qWTZOI7Z4VcbMehro+X9rzvNYZ1nM+zw X7vjaDhDAX2csBN45y2+dNNkay2YV6USNgW8ztS+oDmKJAdmWcSLWJTieai+BxkgUX/R B3Z7yer0jybxX/kri4GfEjZGtfrbcdYSZOLvhg3oFwqK9whyhnQn9Ph5ORwEJOT5wzT3 RMzQCJxK0baGlVfu4P7JN0D5x5RJowceMjBKpgnYwTq2UqqGcKS44eso9+UdS23gKaLQ GUaPsLlqOQNubO0azi+NHXy8JusLbAk0GT15Ul3aiHVsMmpdAOyIHoQ4iHW/JKJ7nYAq zAQQ== 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 j18si2087406pfe.235.2019.06.14.03.50.12; Fri, 14 Jun 2019 03:50:28 -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 S1727187AbfFNKtr (ORCPT + 99 others); Fri, 14 Jun 2019 06:49:47 -0400 Received: from foss.arm.com ([217.140.110.172]:59482 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726767AbfFNKtr (ORCPT ); Fri, 14 Jun 2019 06:49:47 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6C8EC2B; Fri, 14 Jun 2019 03:49:46 -0700 (PDT) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D9D6C3F246; Fri, 14 Jun 2019 03:51:27 -0700 (PDT) Subject: Re: [PATCH 2/2] edac: add support for Amazon's Annapurna Labs EDAC From: James Morse To: "Hawa, Hanna" Cc: robh+dt@kernel.org, mark.rutland@arm.com, bp@alien8.de, mchehab@kernel.org, davem@davemloft.net, gregkh@linuxfoundation.org, nicolas.ferre@microchip.com, paulmck@linux.ibm.com, dwmw@amazon.co.uk, benh@amazon.com, ronenk@amazon.com, talel@amazon.com, jonnyc@amazon.com, hanochu@amazon.com, linux-edac@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <1559211329-13098-1-git-send-email-hhhawa@amazon.com> <1559211329-13098-3-git-send-email-hhhawa@amazon.com> <3129ed19-0259-d227-0cff-e9f165ce5964@arm.com> <4514bfa2-68b2-2074-b817-2f5037650c4e@amazon.com> Message-ID: Date: Fri, 14 Jun 2019 11:49:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hawa, On 13/06/2019 18:05, James Morse wrote: > On 11/06/2019 20:56, Hawa, Hanna wrote: >> James Morse wrote: >>> Hawa, Hanna wrote: >>>> +        if (cluster != last_cluster) { >>>> +            smp_call_function_single(cpu, al_a57_edac_l2merrsr, >>>> +                         edac_dev, 0); >>>> +            last_cluster = cluster; >>>> +        } >>> Here you depend on the CPUs being listed in cluster-order in the DT. I'm fairly sure the >>> numbering is arbitrary: On my Juno 0,3,4,5 are the A53 cluster, and 1,2 are the A57 >>> cluster. >>> >>> If 1,3,5 were cluster-a and 2,4,6 were cluster-b, you would end up calling >>> al_a57_edac_l2merrsr() for each cpu. As you don't wait, they could race. >>> >>> If you can get a cpu-mask for each cluster, smp_call_function_any() would to the >>> pick-one-online-cpu work for you. >> Again, I rely on that it's alpine SoC specific driver. An example of where this goes wrong is kexec: If you offline CPU0, then kexec, the new kernel will start up on the lowest numbered online CPU, which won't be zero. But the new kernel will call it CPU0. Kdump is even better, as it starts up on whichever CPU called panic(), and calls it CPU0. Thanks, James >> How can I get cpu-mask for each cluster? from DT? > Its not cluster you want, its the L2. Cacheinfo has this for online CPUs, and you're > already holding the cpus_read_lock().