Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1940961ybe; Thu, 12 Sep 2019 01:53:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/pwitCop+ntNwPyi7vHdKrBpKPJo0CjFPBp1Q0cb8qIwXmFY3QVtOSPZDiuvlR0skjwQY X-Received: by 2002:a17:906:a2d6:: with SMTP id by22mr33331466ejb.133.1568278403542; Thu, 12 Sep 2019 01:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568278403; cv=none; d=google.com; s=arc-20160816; b=GeT537/0+SQ+jHqvf34eqjLV53IBKuLIjXKHKjittPmLJOZGeuUk9TixZ0g8x1jb1s pU0SrarxjrLsxDVvwoqTgP8TunniFQPc6TLQGdWweMaQyqA5DJ97rm2jGTGdj5XXnVf7 kBW3Eeb7vc4C7su8aZPGG/EDezx+aCctVMAbDmJDxAOU5/sWOFUEGGZtRFMzg0empbtB zoEQH0hQPGRz4V3AU/2VjrGMb8dZ1wEjCqMKLj1XbD6GYBxFjC+pvFuz1wRwBLcJhxwK dpjbhqGv8SPAt/D2eczwPArB4m6RTpINWSMxau/8VYsqAckXpWjRiJ/awtpo+qr9mGWH hX/w== 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 :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date; bh=UqVIAlQBj4D4JMuNup2UuiBEqffBUsWACXHunyJ0OPc=; b=blgk4KpR6vvHekoZwpJEgLjKJu+VoVZYtSG9Rm7lVvr/cnyVve73a1ZWhDa4yd+a8+ +6VhN2jIvQ+4vjZYblOP5xtQZeQZ6oASHcibQ++GmS8SSiorMW0+yVayL+95Is6pENXD BfGIHsBs7m8SkrlAB3el8U+0O6KyeEJVV0DRugx1OA//2jH2SxEGvU6DBZQBIw/FhxoZ 0QjGvlgsBWBRAvdjobemXj+gcdcURkL8lR3hRRcaotJbRcctKYXz130JbJcpugy6KSb0 nB5Y4QoXdzPG4lNNDKucNPaypoK/Yz4maqozWIn6+Potd1Z4Uyti0xbiU6pryzkcPLBr /DYg== 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 p13si12628059ejr.281.2019.09.12.01.52.59; Thu, 12 Sep 2019 01:53:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730480AbfILIu2 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 12 Sep 2019 04:50:28 -0400 Received: from foss.arm.com ([217.140.110.172]:59200 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbfILIu2 (ORCPT ); Thu, 12 Sep 2019 04:50:28 -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 266951000; Thu, 12 Sep 2019 01:50:27 -0700 (PDT) Received: from big-swifty.misterjones.org (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 04DE63F71F; Thu, 12 Sep 2019 01:50:23 -0700 (PDT) Date: Thu, 12 Sep 2019 09:50:22 +0100 Message-ID: <865zlxsxtd.wl-maz@kernel.org> From: Marc Zyngier To: "Shenhar, Talel" Cc: , , , , , , , , , , , , James Morse Subject: Re: [UNVERIFIED SENDER] Re: [PATCH v2 2/3] soc: amazon: al-pos: Introduce Amazon's Annapurna Labs POS driver In-Reply-To: <3205f7ae-5568-c064-23ac-ea726246173b@amazon.com> References: <1568142310-17622-1-git-send-email-talel@amazon.com> <1568142310-17622-3-git-send-email-talel@amazon.com> <86d0g6syva.wl-maz@kernel.org> <3205f7ae-5568-c064-23ac-ea726246173b@amazon.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 12 Sep 2019 07:50:03 +0100, "Shenhar, Talel" wrote: > > Hi Marc, > > > On 9/11/2019 5:15 PM, Marc Zyngier wrote: > > [+James] > > > > Hi Talel, > > > > On Tue, 10 Sep 2019 20:05:09 +0100, > > Talel Shenhar wrote: > > > >> + log1 = readl(pos->mmio_base + AL_POS_ERROR_LOG_1); > > Do you actually need the implied barriers? I'd expect that relaxed > > accesses should be enough. > > You are correct. Barriers are not needed, In v1 this driver indeed > used _relaxed versions. > > Due to request coming from Arnd in v1 patch series I removed it. As > this is not data path I had no strong objection for removing it. Independently from whether this has any material impact on performance (this obviously isn't a hot path, unless it can be directly generated by userspace or a guest), I believe it is important to use the right type of accessor, if only because code gets copied around... Others would probably argue that this is the very reason why we should always use the "safe" option... > > > > >> + if (!FIELD_GET(AL_POS_ERROR_LOG_1_VALID, log1)) > >> + return IRQ_NONE; > >> + > >> + log0 = readl(pos->mmio_base + AL_POS_ERROR_LOG_0); > >> + writel(0, pos->mmio_base + AL_POS_ERROR_LOG_1); > >> + > >> + addr = FIELD_GET(AL_POS_ERROR_LOG_0_ADDR_LOW, log0); > >> + addr |= (FIELD_GET(AL_POS_ERROR_LOG_1_ADDR_HIGH, log1) << 32); > >> + request_id = FIELD_GET(AL_POS_ERROR_LOG_1_REQUEST_ID, log1); > >> + bresp = FIELD_GET(AL_POS_ERROR_LOG_1_BRESP, log1); > >> + > >> + dev_err(&pdev->dev, "addr=0x%llx request_id=0x%x bresp=0x%x\n", > >> + addr, request_id, bresp); > > What is this information? How do we make use of it? Given that this is > > asynchronous, how do we correlate it to the offending software? > > Indeed this information arriving from the HW is asynchronous. > > There is no direct method to get the offending software. > > There are all kinds of hacks we do to find the offending software once > we find this error. most of the time its a new patch introduced but > some of the time is just digging. OK, so that the moment, this is more of a debug tool than anything else, right? > > The whole think looks to me like a poor man's EDAC handling, and I'd > > expect to be plugged in that subsystem instead. Any reason why this > > isn't the case? It would certainly make the handling uniform for the > > user. > > This logic was not plugged into EDAC as there is no "Correctable" > error here. its just error event. Not all errors are EDAC in the sense > of Error Detection And *Correction*. There are no correctable errors > for this driver. I'd argue the opposite! Because you obviously don't let a read-only register being written to, the error has been corrected, and you signal the correction status. > So plugging it  under EDAC seems like abusing the EDAC system. > > Now that I've emphasize the reason for not putting this under EDAC, > what do you think? should this "only uncorrectable event" driver > should be part of EDAC? My choice would be to plug it into the EDAC subsystem, and report all interrupts as "Corrected" events. Optionally, and only if you are debugging something that requires it, report the error as "Uncorrectable", in which case the EDAC subsystem should trigger a panic. At least you'd get the infrastructure, logging and tooling that the EDAC subsystem offers (parsing the kernel log doesn't really count). Thanks, M. -- Jazz is not dead, it just smells funny.