Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6466801ybi; Wed, 29 May 2019 08:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2Ls2iwIy8afBjK3qq8g3QzpLc3veaFzx8aUKZE77sUmVpkGi3LVy0ILJz1ApQMgnhTfwn X-Received: by 2002:a65:628d:: with SMTP id f13mr37683242pgv.177.1559142875300; Wed, 29 May 2019 08:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559142875; cv=none; d=google.com; s=arc-20160816; b=x6SSHUXVdQ+xxyqrcblmjp/1Byj2AZXYX/4zh72Nq2t0aNpSTowZFN3p+48ITKuW22 xm4yugDau5+abGI2GhZbtXzizK9ifXz++bZwzRpl/VmZPF6KE8wkBSWBgfxiVEZh7yNq X9/U4JhcqayC85+IzXDcu98VqJ7YJc85U0BslC9v9Sr4xNyCYRw5xFkAiBM20rxig2Oq XmRsrZKSfYjyDeoDWXvbDRxmaiERej1k1LKZdDip65s/9XCDl/ySqFpT/vVUeiA5nun8 WFzI95brdtUV91WY1xLxLUOXTZcSzYJ557GtI8ds1he3HAGiBU9y/Nmpbjuz93TDYJkX rqbQ== 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:from:references:cc:to:subject; bh=80c4GfmaiwIFp5zHIy94q+RArXyW84dwPY7sJ/XfCXk=; b=il8G8Gk5lInmTlQH9aXd+gH3yyy1elNYmio3M8SwNn5OxeiKS2VqJEtI4k6HwcQDrk NTdov1ySkO9HzY7I4vPsFLNzJkbcJQUO4pJtfx3AjO2/YiVZ0fvTi7nusJwlOb+r8tyC pAf+m2MAtyE8SeHJVn8+RD1KpNrH3iEMY4UQSnX1IU9bGh08TFfg9JH5T6oqWGxIVlPZ vSs4PGz7AaUs1RCPYYTFTdXPVTYX+f2GqcQYh85Ng8v8QMI/PZWzXBMGZ6yeI1BHRaXn i2kSabefZJMHEXgTDD1Vf7i+fe+ANsvV1I5UqNaonpjYAJeiHpQ0fdEBLu830z5w3IJJ wz5g== 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 p10si484121pgs.99.2019.05.29.08.14.17; Wed, 29 May 2019 08:14:35 -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 S1726859AbfE2PMm (ORCPT + 99 others); Wed, 29 May 2019 11:12:42 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:47894 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbfE2PMl (ORCPT ); Wed, 29 May 2019 11:12:41 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 75B4B15AD; Wed, 29 May 2019 08:12:41 -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 63C383F5AF; Wed, 29 May 2019 08:12:40 -0700 (PDT) Subject: Re: [PATCH 11/21] EDAC, ghes: Unify trace_mc_event() code with edac_mc driver To: Robert Richter Cc: Borislav Petkov , Tony Luck , Mauro Carvalho Chehab , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20190529084344.28562-1-rrichter@marvell.com> <20190529084344.28562-12-rrichter@marvell.com> From: James Morse Message-ID: <37d47356-a40b-2739-10df-f5ab83fa2b36@arm.com> Date: Wed, 29 May 2019 16:12:38 +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: <20190529084344.28562-12-rrichter@marvell.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Robert, On 29/05/2019 09:44, Robert Richter wrote: > Almost duplicate code, remove it. almost? > Note: there is a difference in the calculation of the grain_bits, > using the edac_mc's version here. But is it the right thing to do? Is this an off-by-one bug being papered over as some cleanup? If so could you post a separate fix that can be picked up for an rc. Do Marvell have firmware that populates this field? ... Unless the argument is no one cares about this... From ghes_edac_report_mem_error(): | /* Error grain */ | if (mem_err->validation_bits & CPER_MEM_VALID_PA_MASK) | e->grain = ~(mem_err->physical_addr_mask & ~PAGE_MASK); Fishy, why would the kernel page-size be relevant here? If physical_addr_mask were the same as PAGE_MASK this wouldn't this always give ~0? (masking logic like this always does my head in) /me gives it ago: | {1}[Hardware Error]: physical_address: 0x00000000deadbeef | {1}[Hardware Error]: physical_address_mask: 0xffffffffffff0000 | {1}[Hardware Error]: error_type: 6, master abort | EDAC MC0: 1 CE Master abort on unknown label ( page:0xdead offset:0xbeef | grain:-1 syndrome:0x0 - status(0x0000000000000001): reserved) That 'grain:-1' is because the calculated e->grain was an unlikely 0xffffffffffffffff. Patch incoming, if you could test it on your platform that'd be great. I don't think ghes_edac.c wants this '+1'. Thanks, James