Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp408595imm; Fri, 1 Jun 2018 03:09:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKICkEiEG9WBPZ9Wri1DPjfEo6QlKbPuviESbI9xduNFb3H5d78wAN3/UB57/xaarx9cYUbq X-Received: by 2002:a65:51c4:: with SMTP id i4-v6mr8274107pgq.190.1527847748997; Fri, 01 Jun 2018 03:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527847748; cv=none; d=google.com; s=arc-20160816; b=SQ7PBPqARz4/XP8vhU/DfDLhG9KS+nT0Jr8uwcUkA2yAlOSrlPpYOeIAqmWsRW72/N wiBsRm5HiI0rZ2IOHYdhjyj4/IdT4ZQrRN42n4qD1XRfPoC3Ad+jBMM1N5l7wZqTMLEX Z4cKRIBcUBIFZajvtsPvrW0dSSyg+YBxO5FkWrwQP3qBRtBpXf22LsO/YUUBtDbl6Ihk 7cH4mzamFMcQDvsdfcpFFqGQ3BS2AjXRqVYDw5kQ7U4D0B/s6IRAe/AJrahKIdYqYyvq n9Nk4U1zBM5aSvSwpgvtCF1LlHp2nITvgwrb6NCDJxzCOM8RKHvzCIzvGmDNUEbSSzCe xVfA== 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:arc-authentication-results; bh=IgA3P3kege4paOHDhg7v0uxTiLD2+tYwah6qlKLJpV4=; b=Ry8geHGqaTsiiHIec9a0YHl0DLmS1viM366zzWOHcFBb1vuCSiP1F7enAHreSsL4ZW OWkXlcb+a1ZOd7UwGsO6zlrWWuzP7ChmJC2zBVnGOUNnKqBUYY9EGHYREJX4va55ZhRS auQkRepEqyVejQy1jMLWi15BL2zCm74xw62h+Ug2slAlab/jPhBaRHBiH3ydsPB0KORz sgPyesmVN+0nrvvBUiPCUPO2qBe7JnK246nKe32jjvQf2LYrhTgTweYAUMXH4KWij4s2 snJa32jvNQvmvuQsRF/q7gX+1uQiScPYlEyYS+VV5MY+M4uuI1bvuVUrRKjpzCBGNZsg il4Q== 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 a98-v6si39348030pla.239.2018.06.01.03.08.54; Fri, 01 Jun 2018 03:09:08 -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 S1750868AbeFAKIa (ORCPT + 99 others); Fri, 1 Jun 2018 06:08:30 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8621 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750766AbeFAKI2 (ORCPT ); Fri, 1 Jun 2018 06:08:28 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id E2F844273980A; Fri, 1 Jun 2018 18:08:14 +0800 (CST) Received: from [127.0.0.1] (10.142.68.147) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.382.0; Fri, 1 Jun 2018 18:08:14 +0800 Subject: Re: [PATCH v1 1/2] ACPI / APEI: Add SEI notification type support for ARMv8 To: Mark Rutland CC: , , , , , , , , , , , , , References: <1527770506-8076-1-git-send-email-gengdongjiu@huawei.com> <1527770506-8076-2-git-send-email-gengdongjiu@huawei.com> <20180531105252.it67drvnsfz62pqa@lakrids.cambridge.arm.com> From: gengdongjiu Message-ID: <5aed8a29-a2c2-5080-d954-90c7f817ada1@huawei.com> Date: Fri, 1 Jun 2018 18:07:52 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180531105252.it67drvnsfz62pqa@lakrids.cambridge.arm.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.68.147] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, Thanks for the comments. On 2018/5/31 18:52, Mark Rutland wrote: > On Thu, May 31, 2018 at 08:41:45PM +0800, Dongjiu Geng wrote: >> +#ifdef CONFIG_ACPI_APEI_SEI >> +static LIST_HEAD(ghes_sei); >> + >> +/* >> + * Return 0 only if one of the SEI error sources successfully reported an error >> + * record sent from the firmware. >> + */ >> +int ghes_notify_sei(void) >> +{ >> + struct ghes *ghes; >> + int ret = -ENOENT; >> + >> + rcu_read_lock(); >> + list_for_each_entry_rcu(ghes, &ghes_sei, list) { >> + if (!ghes_proc(ghes)) >> + ret = 0; >> + } >> + rcu_read_unlock(); >> + return ret; >> +} >> + >> +static void ghes_sei_add(struct ghes *ghes) >> +{ >> + mutex_lock(&ghes_list_mutex); >> + list_add_rcu(&ghes->list, &ghes_sei); >> + mutex_unlock(&ghes_list_mutex); >> +} >> + >> +static void ghes_sei_remove(struct ghes *ghes) >> +{ >> + mutex_lock(&ghes_list_mutex); >> + list_del_rcu(&ghes->list); >> + mutex_unlock(&ghes_list_mutex); >> + synchronize_rcu(); >> +} >> +#else /* CONFIG_ACPI_APEI_SEI */ >> +static inline void ghes_sei_add(struct ghes *ghes) { } >> +static inline void ghes_sei_remove(struct ghes *ghes) { } >> +#endif /* CONFIG_ACPI_APEI_SEI */ >> + >> #ifdef CONFIG_HAVE_ACPI_APEI_NMI >> /* > >> index 8feb0c8..9ba59e2 100644 >> --- a/include/acpi/ghes.h >> +++ b/include/acpi/ghes.h >> @@ -120,5 +120,6 @@ static inline void *acpi_hest_get_next(struct acpi_hest_generic_data *gdata) >> section = acpi_hest_get_next(section)) >> >> int ghes_notify_sea(void); >> +int ghes_notify_sei(void); > > It would be nice to have a stub definition when !CONFIG_ACPI_APEI_SEI, > e.g. > > #ifdef CONFIG_ACPI_APEI_SEI > int ghes_notify_sei(void); > #else > static in int ghes_notify_sei(void) { return -ENOENT; } > #endif > > ... as callers could simply call this without additional checks. > > As a cleanup, similar would be nice for ghes_notify_sea() with > CONFIG_ACPI_APEI_SEA. I think your suggestion is better, I will do the cleanup include the ghes_notify_sea(). thanks again. > > Thanks, > Mark. > > . >