From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 420F3C433E1 for ; Thu, 23 Jul 2020 15:22:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13CD82086A for ; Thu, 23 Jul 2020 15:22:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HaFP5dX+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13CD82086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=Huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9VALmF+zGzUNnO1/b+e6HywXVOBn3jhqLv5iIZb6Nf0=; b=HaFP5dX+vdzrWYjWUmLNHLkla lbe04RGAZna+kF5sfG/Ry7uoonZ9lKXd0pDBr5IImT9apBnaQ8QQ7pBFSqlP4Vzr3Fk22zUcpUJ4S 8LNSMUJ8tftB1+5WpA1fICW3I+/iqlQpjahnrCM0NopY+gmqrgTDyh7EsrakWHy9mfBSH9b1V1wDt mIF0Q3Lsa21gRPznimT5sQeHzCUrBb/8zuhafjlCOYixBRp0XBAJQVA38NzC1NKx5AtM9CczhMcX0 YffZ3wsbOYMxS8vgig9a4ryE02puMO6DNG9Wkwh6Qhoil34K+UAucFg2UteyeT5BiqAmJbFJsUM8q R9zYuUzsA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyd26-0006Ao-IH; Thu, 23 Jul 2020 15:21:18 +0000 Received: from lhrrgout.huawei.com ([185.176.76.210] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jyd23-00069x-CX for linux-arm-kernel@lists.infradead.org; Thu, 23 Jul 2020 15:21:16 +0000 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 8BB80952380F6439236A; Thu, 23 Jul 2020 16:21:11 +0100 (IST) Received: from localhost (10.52.125.229) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Thu, 23 Jul 2020 16:21:10 +0100 Date: Thu, 23 Jul 2020 16:19:49 +0100 From: Jonathan Cameron To: Gavin Shan Subject: Re: [PATCH v2 14/17] drivers/firmware/sdei: Move struct sdei_event to header file Message-ID: <20200723161949.00000061@Huawei.com> In-Reply-To: <20200722095740.28560-15-gshan@redhat.com> References: <20200722095740.28560-1-gshan@redhat.com> <20200722095740.28560-15-gshan@redhat.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 X-Originating-IP: [10.52.125.229] X-ClientProxiedBy: lhreml725-chm.china.huawei.com (10.201.108.76) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200723_112115_611214_EEC908D7 X-CRM114-Status: GOOD ( 23.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, catalin.marinas@arm.com, james.morse@arm.com, shan.gavin@gmail.com, will@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 22 Jul 2020 19:57:37 +1000 Gavin Shan wrote: > This moves struct sdei_event to the header file so that it can be > dereferenced by external modules. This is needed by the code to > virtualize SDEI functionality, as part of the arm64/kvm. > > Signed-off-by: Gavin Shan Hi Gavin, One question inline. Jonathan > --- > v2: Derived from "drivers/firmware/sdei: Identify event by struct" > --- > drivers/firmware/arm_sdei.c | 20 ------------ > include/linux/arm_sdei.h | 61 ++++++++++++++++++++++++------------- > 2 files changed, 40 insertions(+), 41 deletions(-) > > diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c > index a52dcff59a20..bdd2de0149c0 100644 > --- a/drivers/firmware/arm_sdei.c > +++ b/drivers/firmware/arm_sdei.c > @@ -44,26 +44,6 @@ static asmlinkage void (*sdei_firmware_call)(unsigned long function_id, > /* entry point from firmware to arch asm code */ > static unsigned long sdei_entry_point; > > -struct sdei_event { > - /* These three are protected by the sdei_list_lock */ > - struct list_head list; > - bool reregister; > - bool reenable; > - > - u32 event_num; > - u8 type; > - u8 priority; > - > - /* This pointer is handed to firmware as the event argument. */ > - union { > - /* Shared events */ > - struct sdei_registered_event *registered; > - > - /* CPU private events */ > - struct sdei_registered_event __percpu *private_registered; > - }; > -}; > - > /* Take the mutex for any API call or modification. Take the mutex first. */ > static DEFINE_MUTEX(sdei_events_lock); > > diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h > index 0a241c5c911d..fdc2f868d84b 100644 > --- a/include/linux/arm_sdei.h > +++ b/include/linux/arm_sdei.h > @@ -22,6 +22,46 @@ > */ > typedef int (sdei_event_callback)(u32 event, struct pt_regs *regs, void *arg); > > +/* > + * This struct represents an event that has been registered. The driver > + * maintains a list of all events, and which ones are registered. (Private > + * events have one entry in the list, but are registered on each CPU). > + * A pointer to this struct is passed to firmware, and back to the event > + * handler. The event handler can then use this to invoke the registered > + * callback, without having to walk the list. > + * > + * For CPU private events, this structure is per-cpu. > + */ > +struct sdei_registered_event { > + /* For use by arch code: */ > + struct pt_regs interrupted_regs; > + > + sdei_event_callback *callback; > + void *callback_arg; > + u32 event_num; > + u8 priority; > +}; > + > +struct sdei_event { > + /* These three are protected by the sdei_list_lock */ As this patch leaves the sdei_list_lock as local to arm_sdei.c, is this comment still valid? > + struct list_head list; > + bool reregister; > + bool reenable; > + > + u32 event_num; > + u8 type; > + u8 priority; > + > + /* This pointer is handed to firmware as the event argument. */ > + union { > + /* Shared events */ > + struct sdei_registered_event *registered; > + > + /* CPU private events */ > + struct sdei_registered_event __percpu *private_registered; > + }; > +}; > + > /* > * Register your callback to claim an event. The event must be described > * by firmware. > @@ -51,27 +91,6 @@ static inline int sdei_mask_local_cpu(void) { return 0; } > static inline int sdei_unmask_local_cpu(void) { return 0; } > #endif /* CONFIG_ARM_SDE_INTERFACE */ > > - > -/* > - * This struct represents an event that has been registered. The driver > - * maintains a list of all events, and which ones are registered. (Private > - * events have one entry in the list, but are registered on each CPU). > - * A pointer to this struct is passed to firmware, and back to the event > - * handler. The event handler can then use this to invoke the registered > - * callback, without having to walk the list. > - * > - * For CPU private events, this structure is per-cpu. > - */ > -struct sdei_registered_event { > - /* For use by arch code: */ > - struct pt_regs interrupted_regs; > - > - sdei_event_callback *callback; > - void *callback_arg; > - u32 event_num; > - u8 priority; > -}; > - > /* The arch code entry point should then call this when an event arrives. */ > int notrace sdei_event_handler(struct pt_regs *regs, > struct sdei_registered_event *arg); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel