Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751865AbcDFPxp (ORCPT ); Wed, 6 Apr 2016 11:53:45 -0400 Received: from foss.arm.com ([217.140.101.70]:57996 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbcDFPxl (ORCPT ); Wed, 6 Apr 2016 11:53:41 -0400 Subject: Re: [PATCH V2 1/9] acpi: apei: read ack upon ghes record consumption To: Tyler Baicar , fu.wei@linaro.org, timur@codeaurora.org, harba@codeaurora.org, rruigrok@codeaurora.org, ahs3@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, lenb@kernel.org, matt@codeblueprint.co.uk, robert.moore@intel.com, lv.zheng@intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, devel@acpica.org References: <1459955578-24602-1-git-send-email-tbaicar@codeaurora.org> <1459955578-24602-2-git-send-email-tbaicar@codeaurora.org> Cc: "Jonathan (Zhixiong) Zhang" , Naveen Kaje From: Suzuki K Poulose Message-ID: <57053100.7050305@arm.com> Date: Wed, 6 Apr 2016 16:53:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1459955578-24602-2-git-send-email-tbaicar@codeaurora.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2043 Lines: 55 On 06/04/16 16:12, Tyler Baicar wrote: > A RAS (Reliability, Availability, Serviceability) controller > may be a separate processor running in parallel with OS > execution, and may generate error records for consumption by > the OS. If the RAS controller produces multiple error records, > then they may be overwritten before the OS has consumed them. > > The Generic Hardware Error Source (GHES) v2 structure > introduces the capability for the OS to acknowledge the > consumption of the error record generated by the RAS > controller. A RAS controller supporting GHESv2 shall wait for > the acknowledgment before writing a new error record, thus > eliminating the race condition. > > Signed-off-by: Jonathan (Zhixiong) Zhang > Signed-off-by: Richard Ruigrok > Signed-off-by: Tyler Baicar > Signed-off-by: Naveen Kaje > return ERR_PTR(-ENOMEM); > + > + hest_hdr = (struct acpi_hest_header *)generic; > + if (hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { > + ghes->generic_v2 = (struct acpi_hest_generic_v2 *)generic; > + rc = apei_map_generic_address( > + &ghes->generic_v2->read_ack_register); > + if (rc) > + goto err_unmap; > + } else > + ghes->generic_v2 = NULL; ... > err_unmap: > apei_unmap_generic_address(&generic->error_status_address); > + if (ghes->generic_v2) > + apei_unmap_generic_address( > + &ghes->generic_v2->read_ack_register); > err_free: > kfree(ghes); > return ERR_PTR(rc); > @@ -279,6 +295,9 @@ static void ghes_fini(struct ghes *ghes) > { > kfree(ghes->estatus); > apei_unmap_generic_address(&ghes->generic->error_status_address); > + if (ghes->generic_v2) > + apei_unmap_generic_address( > + &ghes->generic_v2->error_status_address); I am not familiar with the APEI code, but is this error_status_address or read_ack_register ? We don't seem to be mapping error_status_address in generic_v2 header which is introduced in this patch ? Am I missing something ? Suzuki