Received: by 10.223.185.116 with SMTP id b49csp4963386wrg; Wed, 7 Mar 2018 04:12:46 -0800 (PST) X-Google-Smtp-Source: AG47ELtxHhiun3i/z4EnwMnCPcOgoBgneyIEkabl+fntBz4IOgODU8gi/ARue3xLmZnqXbWfuV2r X-Received: by 10.99.66.135 with SMTP id p129mr18296215pga.220.1520424766846; Wed, 07 Mar 2018 04:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520424766; cv=none; d=google.com; s=arc-20160816; b=zXatCVXeYomz7D+d7QVCnyHW4GIGqQB045+/rcULJ5GYXjcxngyxD9j2hOMEN9McQ6 hOv7tYJ1XVKJRCM87eh9uvkEKS3g+hCXW6rs3aZQ99Z6BpASYZ9JB5zKyCDtDyGnWE13 a1fwrpV8lhZg3wWviYi/cc6phEOp10knLB8WXp2WdxolnEVK4YlahPtaNDCgCCiz6JRl Z3I/MmG8hUkqQnH5mpUnfiga5+brJRmS3OVs8Lw20XowUyDx+VgN1lsysqmOn5+Zdf16 8gPMEIjXBNDvYcXOBCMfa8YupSpWoi/NAlNn8D/nUONfEihlUq0zy57PCjAp+09cpU33 Qrog== 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=YEkbCMDFsLwznI+IXnfXIXmu7RChJyDNKX2Z6qBIf5U=; b=r9rPm5GjSzgwRtwPiZ8h9opMiYE8e5CAkFsqpJMCOw4bUQphNuTZ6nQKDNhcW82GqT SrP4G55Nr1FRnXpwO/JL8nL7+CqcBwxjJBQf2cnrdI+1JjOwiK0N3hu51BKlOpmfmBin P9ES+sKECUkADrfMgVyo6oAuW7rkPpn8IKDEY2rQXRcZSUovAaCHTUu1UKf3i1o2JWUG zHd35cDe1eC3+YWqkZfu2c7LgSKNE2J1Hb/reaQtjUMkO9VXoElxINyoHCbGNjqTfZXG GES+B0S6KRxJ560Q8EEcF1JBa+hSmy4Q+HJu+CwZ5sMK9lsDyPd7FUs+OEIh4vHNQMY+ KCeA== 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 m16si11267526pgn.290.2018.03.07.04.12.32; Wed, 07 Mar 2018 04:12:46 -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 S1754302AbeCGMLd (ORCPT + 99 others); Wed, 7 Mar 2018 07:11:33 -0500 Received: from mail.skyhub.de ([5.9.137.197]:57566 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbeCGMLb (ORCPT ); Wed, 7 Mar 2018 07:11:31 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id C-TPkcE8TxcD; Wed, 7 Mar 2018 13:11:29 +0100 (CET) Received: from pd.tnic (p200300EC2BCA230058AAD562244B69A4.dip0.t-ipconnect.de [IPv6:2003:ec:2bca:2300:58aa:d562:244b:69a4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 548131EC0084; Wed, 7 Mar 2018 13:11:29 +0100 (CET) Date: Wed, 7 Mar 2018 13:11:20 +0100 From: Borislav Petkov To: Sai Praneeth Prakhya Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Chun-Yi Lee , Tony Luck , Will Deacon , Dave Hansen , Mark Rutland , 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: <20180307121047.GG23662@pd.tnic> 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=utf-8 Content-Disposition: inline In-Reply-To: <1520292190-5027-3-git-send-email-sai.praneeth.prakhya@intel.com> User-Agent: Mutt/1.9.3 (2018-01-21) 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: > +#define efi_queue_work(_rts, _arg1, _arg2, _arg3, _arg4, _arg5) \ > +({ \ > + struct efi_runtime_work efi_rts_work; \ > + \ > + INIT_WORK_ONSTACK(&efi_rts_work.work, efi_call_rts); \ > + efi_rts_work.func = _rts; \ > + efi_rts_work.arg1 = _arg1; \ > + efi_rts_work.arg2 = _arg2; \ > + efi_rts_work.arg3 = _arg3; \ > + efi_rts_work.arg4 = _arg4; \ > + efi_rts_work.arg5 = _arg5; \ > + /* \ > + * queue_work() returns 0 if work was already on queue, \ > + * _ideally_ this should never happen. \ > + */ \ > + if (queue_work(efi_rts_wq, &efi_rts_work.work)) \ > + flush_work(&efi_rts_work.work); \ > + else \ > + BUG(); \ So failure to queue that work is such a critical problem that we need to BUG() and can't possibly continue and shoult not attempt recovery at all? IOW, we should always strive to fail gracefully and not shit in pants at the first sign of trouble. Even checkpatch warns here: WARNING: Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON() #184: FILE: drivers/firmware/efi/runtime-wrappers.c:92: + BUG(); \ and by looking at the other output, you should run your patches through checkpatch. Some of the things make sense like: WARNING: quoted string split across lines #97: FILE: drivers/firmware/efi/efi.c:341: + pr_err("Failed to create efi_rts_workqueue, EFI runtime services " + "disabled.\n"); for example. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.