Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1400352rwi; Wed, 26 Oct 2022 15:03:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ZYYP/Qox6fZ1CRgf9ltVKPJ0zCTJRYncf6DqFtOTn8Ay+tSOIXUvR0/8PirixpvNX417b X-Received: by 2002:a17:902:f786:b0:180:6f9e:23b with SMTP id q6-20020a170902f78600b001806f9e023bmr47247263pln.37.1666821820896; Wed, 26 Oct 2022 15:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666821820; cv=none; d=google.com; s=arc-20160816; b=zUmzdXarrAqixfg0HINJ8wg9udVuB8M8+bjbH8NcUjuUF99fArLaSogRM8lrH2DVxa BB+ZiAvOVL645qKDwDOR/g+Aejaoy1lH+chrXIx2FdWP39kJ87+qk69S8gPoMwIGHP61 mkfaHqtOuHtRwYQC99+7IuggR+Ud79Gv0Wk3oJt97gHd32bu6bLQpATZaPuQF0Xn+9H2 5J6ZOoXWP2Lu1EA673oJL4uABueq317QS+VSo/Hl3p8LQJHUrVj2VnDRMIh7Iz3oRZuD uY00TzPTh+lmoJvz/g+pazHENzrXjLUB6sJafrsum4mUAgqAYgpQ4iT4FRDIX/DTa7Tk 8o2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Zf8F9ChAf7zqv+J4DXJfD/0KRA4IjfZo9n1Zhf785UA=; b=PhY5lgB4uK2VKCX4qVw3TAVfYSnwamrlBsEuLUBlPA6K64U4sN5Om2CIzKPjbXABSc /vWbn+M6P38XrkOWzTobJMOA93KqNphpJLv8O769BlOhwyHA/63c8rpC9Fk8gbSnuclS 1hz8iE+X35MDPL5SgxBkzsjSLG/DHIbBeyC1Z8R67Dl+zgOBvKEhExb0NJnVFDjElrDf pRaJyUQO3MG7FhaXcZNZuBnwIuWBHd7RWbnYOMTSPWRWoN3jJ6Bbgx11eoZSYZVslFIQ 54XYA2FwOp5/Ldjc51ifgSQ1qjCYY7rrhtQPVJHxNGWUdTK/RqCaNBd/kM0cx8S5fjOZ AbfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cQEPR/5X"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a056a000a8c00b0052da2ea956csi8051867pfl.371.2022.10.26.15.03.12; Wed, 26 Oct 2022 15:03:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cQEPR/5X"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231628AbiJZVUm (ORCPT + 99 others); Wed, 26 Oct 2022 17:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233309AbiJZVUi (ORCPT ); Wed, 26 Oct 2022 17:20:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D782B72FD8; Wed, 26 Oct 2022 14:20:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AC983620D4; Wed, 26 Oct 2022 21:20:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DF94C43144; Wed, 26 Oct 2022 21:20:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666819234; bh=xFK9vhrZ57tkHdq2fZio/r4aau2MYUNcvDSiX8wbTWw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cQEPR/5XQ0hjK8EAMbPf7nTle28yI0S3UPvvIB50hKl6qPesnnvi9qOn7y6spU2XS kGfv3CLZAPAdcSdJizqDJZ+rtp+BykHurb4hbEyQG3oA5n6Zckipdcp/TLhLypiX2I 8EKPqdbbx8hDQZYY94WvsyRR5fewmyi7xzRvdPm4S900Dvrw1plSZuezywRZh0PSA6 s3H6i3XQ14FT7EMYbv7VfhNEdhNYybxWdS3wzZlC44+EjXWtmP4EPHRNig2e2OBER+ fzRRfmg9W7QEz/Mtg3u59r0mSVKOhJJtkbI5/KAaa5A77SOv4++ubBJF+s6gR/TtyM yU0y8bryGooog== Received: by mail-lf1-f44.google.com with SMTP id d6so31431809lfs.10; Wed, 26 Oct 2022 14:20:34 -0700 (PDT) X-Gm-Message-State: ACrzQf3khWeMkd8lEIFPO1+OxJxWLm68Yml78XS+rJAjokasnbtJMxP9 22DAd9MXDdgPpozYDZbVDlDxSLDth9LXg5VRroM= X-Received: by 2002:a05:6512:3119:b0:4a2:d749:ff82 with SMTP id n25-20020a056512311900b004a2d749ff82mr17759347lfb.637.1666819232150; Wed, 26 Oct 2022 14:20:32 -0700 (PDT) MIME-Version: 1.0 References: <23DC077F-69DF-402C-A940-2E7EEABF2D97@live.com> In-Reply-To: From: Ard Biesheuvel Date: Wed, 26 Oct 2022 23:20:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [REGRESSION] Failure to write the NVRAM variables starting from kernel 6.0 on T2 Macs To: Aditya Garg Cc: "matthew.garrett@nebula.com" , "jk@ozlabs.org" , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Orlando Chamberlain Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Oct 2022 at 23:18, Aditya Garg wrote: > > Hi Ard > > Just a friendly reminder to get updates on the patch you asked me to test, as it seems to fix my issue. > This should be fixed now in v6.1-rc2 > > Thanks for the report. I did identify an issue in some refactoring > > work of the efivars layer that went into 6.0 > > > > Can you please check whether the change below fixes the issue for you? > > > > diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c > > index dd74d2ad3184..35edba93cf14 100644 > > --- a/drivers/firmware/efi/vars.c > > +++ b/drivers/firmware/efi/vars.c > > @@ -209,7 +209,7 @@ efivar_set_variable_blocking(efi_char16_t *name, > > efi_guid_t *vendor, > > if (data_size > 0) { > > status = check_var_size(attr, data_size + > > ucs2_strsize(name, 1024)); > > - if (status != EFI_SUCCESS) > > + if (status != EFI_SUCCESS && status != EFI_UNSUPPORTED) > > return status; > > } > > return __efivars->ops->set_variable(name, vendor, attr, > > data_size, data); > > @@ -242,7 +242,7 @@ efi_status_t > > efivar_set_variable_locked(efi_char16_t *name, efi_guid_t *vendor, > > if (data_size > 0) { > > status = check_var_size_nonblocking(attr, data_size + > > > > ucs2_strsize(name, 1024)); > > - if (status != EFI_SUCCESS) > > + if (status != EFI_SUCCESS && status != EFI_UNSUPPORTED) > > return status; > > } > > return setvar(name, vendor, attr, data_size, data); > > Regards > Aditya