Received: by 10.223.185.116 with SMTP id b49csp3682023wrg; Tue, 6 Mar 2018 03:16:17 -0800 (PST) X-Google-Smtp-Source: AG47ELux5BMkch7Xos+4sm7WeGCSzDbnWoemcecfVheC6v3j73UtQyUTV/qWUFQ18CYE+qVFj/wk X-Received: by 10.99.6.85 with SMTP id 82mr14609401pgg.181.1520334977798; Tue, 06 Mar 2018 03:16:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520334977; cv=none; d=google.com; s=arc-20160816; b=tmazc7eVcxGsGSNMe2bKLtd67h6lv5zkirrbW3cqDMKI82sYL8oPyfSdQouazGWgBO c4rRLkgara3PK1JDYKbIv/0C2u42kYqzgQlSIObmHhlGiqGHZbjX+khmoRl7WXO60XSl xY4ugUVp0OIm62rqK4dH0Fz6ZNXo02oAdnWUKn0PnY3MaVpFzNLbc5HKcAxMGeB/mvMx O+q44uCvbJvcDx41ue7cGcL0wNpG5zXJxHXva01DghUdPiKgDzY5RuerbierMxzTXWqE lnD7+oYfcTLpciI81uswTpM8Wc7DI0z5qQ4drcGH4vS8UpEQ2rmkkPQmmp5n2qesTRLB +ysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=mGBWXMy9c565LhgnE9GewQIcD0eNVjpDse2IPPB4iuU=; b=XOLiU1YTw8nmgBcRkPKeHnJPuCKz7R2wdz7jD3qybEJJ7yoznbAjHGiOrmJaJa9h4q SaZT0qon5ACaSryya1BFFTyhREd7yPZnVVhJ41clxOA/3o9tsRQeW1bC2b7A1PEY2TeF uVg5BWvFQ9ilAIFhPDeZfC642ZX7FQCFg3TeCUWjMqX3Xq1NvFpiWGpo1M9NXYjfJ0ib nLgRaIzPMuN0r/SjOBGhG6kyDxiHwlMtezaaVo5sBX6K13CTQX7lker54JgI88sagslq sIf3iEKNmv/siwUUm2GQHUvDT2krZ7XEyDxxeJw4RmnPmyVobEu82M7m2yKlsskFK6bF a+YA== 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 c4si9649179pgu.355.2018.03.06.03.16.03; Tue, 06 Mar 2018 03:16:17 -0800 (PST) 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 S1753297AbeCFLNy (ORCPT + 99 others); Tue, 6 Mar 2018 06:13:54 -0500 Received: from foss.arm.com ([217.140.101.70]:36662 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865AbeCFLNx (ORCPT ); Tue, 6 Mar 2018 06:13:53 -0500 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 8373A1529; Tue, 6 Mar 2018 03:13:52 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D5E9E3F24A; Tue, 6 Mar 2018 03:13:49 -0800 (PST) Date: Tue, 6 Mar 2018 11:13:41 +0000 From: Mark Rutland To: Sai Praneeth Prakhya Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Lee@lakrids.cambridge.arm.com, Chun-Yi , Borislav Petkov , Tony Luck , Will Deacon , Dave Hansen , Bhupesh Sharma , Ricardo Neri , Ravi Shankar , Matt Fleming , Peter Zijlstra , Ard Biesheuvel , Dan Williams Subject: Re: [PATCH V2 2/3] efi: Introduce efi_rts_workqueue and some infrastructure to invoke all efi_runtime_services() Message-ID: <20180306111339.xjrugce553f2egzh@lakrids.cambridge.arm.com> References: <1520292190-5027-1-git-send-email-sai.praneeth.prakhya@intel.com> <1520292190-5027-3-git-send-email-sai.praneeth.prakhya@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520292190-5027-3-git-send-email-sai.praneeth.prakhya@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 05, 2018 at 03:23:09PM -0800, Sai Praneeth Prakhya wrote: > @@ -329,6 +331,19 @@ static int __init efisubsys_init(void) > return 0; > > /* > + * Since we process only one efi_runtime_service() at a time, an > + * ordered workqueue (which creates only one execution context) > + * should suffice all our needs. > + */ > + efi_rts_wq = alloc_ordered_workqueue("efi_rts_workqueue", 0); > + if (!efi_rts_wq) { > + pr_err("Failed to create efi_rts_workqueue, EFI runtime services " > + "disabled.\n"); > + clear_bit(EFI_RUNTIME_SERVICES, &efi.flags); > + return 0; > + } I'm a little worried that something might sample this flag between it being set in an early_initcall (arm_enable_runtime_services), and cleared in a subsys_initcall here. However, nothing seems to do that so far, so maybe that's ok... [...] > +/* efi_runtime_service() function identifiers */ > +enum { > + GET_TIME, > + SET_TIME, > + GET_WAKEUP_TIME, > + SET_WAKEUP_TIME, > + GET_VARIABLE, > + GET_NEXT_VARIABLE, > + SET_VARIABLE, > + SET_VARIABLE_NONBLOCKING, > + QUERY_VARIABLE_INFO, > + QUERY_VARIABLE_INFO_NONBLOCKING, > + GET_NEXT_HIGH_MONO_COUNT, > + RESET_SYSTEM, > + UPDATE_CAPSULE, > + QUERY_CAPSULE_CAPS, > +}; Can we please give this enum a name.... [...] > +/* > + * efi_runtime_work: Details of EFI Runtime Service work > + * @func: EFI Runtime Service function identifier > + * @arg<1-5>: EFI Runtime Service function arguments > + * @status: Status of executing EFI Runtime Service > + */ > +struct efi_runtime_work { > + u8 func; ... and use it here rather than an opaque u8? I realise that means placing the enum in . > + void *arg1; > + void *arg2; > + void *arg3; > + void *arg4; > + void *arg5; > + efi_status_t status; > + struct work_struct work; > +}; Thanks, Mark.