public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Hans de Goede <hdegoede@redhat.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Mark Gross <markgross@kernel.org>,
	Andy Shevchenko <andy@kernel.org>,
	Ard Biesheuvel <ardb@kernel.org>
Cc: linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org,
	platform-driver-x86@vger.kernel.org, x86@kernel.org,
	linux-efi@vger.kernel.org
Subject: Re: [PATCH 1/2] platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830/1050 poweroff again
Date: Fri, 8 Jul 2022 16:36:52 +0300	[thread overview]
Message-ID: <f7ad68fa-7a32-d89b-efbd-2c056ed0999d@collabora.com> (raw)
In-Reply-To: <20220708131412.81078-2-hdegoede@redhat.com>

On 7/8/22 16:14, Hans de Goede wrote:
> @@ -950,13 +953,19 @@ static int __init lenovo_yoga_tab2_830_1050_init(void)
>  	if (ret)
>  		return ret;
>  
> -	pm_power_off = lenovo_yoga_tab2_830_1050_power_off;
> +	/* SYS_OFF_PRIO_FIRMWARE + 1 so that it runs before acpi_power_off */
> +	lenovo_yoga_tab2_830_1050_sys_off_handler =
> +		register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_FIRMWARE + 1,
> +					 lenovo_yoga_tab2_830_1050_power_off, NULL);
> +	if (IS_ERR(lenovo_yoga_tab2_830_1050_sys_off_handler))
> +		return PTR_ERR(lenovo_yoga_tab2_830_1050_sys_off_handler);

Please note that technically we could ignore the registration error
(maybe print error message) and allow the rest of the module to work
without the power-off.

The unregister_sys_off_handler() will skip the ERR_PTR handler.

-- 
Best regards,
Dmitry

  reply	other threads:[~2022-07-08 13:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08 13:14 [PATCH 0/2] Fix 2 5.19 power-off regressions caused by sys-off-handler work Hans de Goede
2022-07-08 13:14 ` [PATCH 1/2] platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830/1050 poweroff again Hans de Goede
2022-07-08 13:36   ` Dmitry Osipenko [this message]
2022-07-08 13:14 ` [PATCH 2/2] efi: Fix efi_power_off() not being run before acpi_power_off() when necessary Hans de Goede
2022-07-08 16:37   ` Ard Biesheuvel
2022-07-10 15:24     ` Hans de Goede
2022-07-08 13:29 ` [PATCH 0/2] Fix 2 5.19 power-off regressions caused by sys-off-handler work Dmitry Osipenko
2022-07-10 15:27 ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7ad68fa-7a32-d89b-efbd-2c056ed0999d@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=andy@kernel.org \
    --cc=ardb@kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox