Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp237902rdh; Wed, 7 Feb 2024 03:26:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8Ej4eLWZIvG5CJEMjP+F9s7sGK3Ub8uAWMWy1qNBu6Sz+o9eS2Ou1Prydu3XPaxVFLaxK X-Received: by 2002:a25:bfc6:0:b0:dc6:d2b0:95cb with SMTP id q6-20020a25bfc6000000b00dc6d2b095cbmr4099067ybm.57.1707305200036; Wed, 07 Feb 2024 03:26:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707305200; cv=pass; d=google.com; s=arc-20160816; b=fbUpMeNYg5RgsPwVL64J3b+TpUSrnW7mG7hrylls2zLukzG2MpdfzPXv3lHXfTJgPJ AjTZysCvhABWtBea4eeiB6KUzZb0s64OiTrfeXYj7ZnS7txu2OUEsXtE/hGlnHNblhD6 H4bAULByR+VCc0MWMzif6TxQbQY2pdckdnkqDM0rK/nu9/4YudthyyyZx8AW5p5bni7c FxzxOqC/QAVGlhkKmB2/Zo1C5IlJfjKyVj6ARXfOLCGZqE+kWxJEWcqXIbUiDZdphtFq oQRCs6Y7OSpCuaBE0XZZEO7TZRMcpD4Q7mjUKMvDXtXzub8ZEsSV/mQZ12qSSbE2tHHQ sNPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=jdCIcHY3HFLAduHPxS6ZbiHVayvEt7hL0AjwboJZzHk=; fh=sDMAMWPM8hSvyKfNVPY8fKcpKH34DxE6zxYX5VddpFw=; b=G0xfK8x4A5AN83DEMWNRNbtYLttbnRhmmBPFrlmTX3oniZuEMeu4kXGFVb+2SdIBr1 9ZFglhDzMViNDDJ09CYgCS1UetMvOzE7UchzuDzyzZcqgu+ocXBGtwY45X6xzFXGycF2 eawHHBngfUAm0/wmzj7dEmUHMeug+nS8uFFvbkF0gzV85bMPagl1GVd7Gb3ZvVSAYFI4 RfY1a1iuj9IWnSevWs9ec1eKx718HcVFARZi2rYzxNtfKE3rgDDI1HG0eIBvaVKx8HFT 9TdP+0nOy5SkSApGvwtyySNWx7aGvMvlqXZocrU6qEI3vXf0rJzB3n4MMyCIzg2VAttu hWSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="rVs+jf/Y"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-56391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCVy6vP6P1oTZgy5UZtSs3XzDbljRAr+gOJ98YMK98gRFPoyAl/7OJnbz/RcwRDrbde7MnTClwWidwIxVhQBoRspdCJdBcwUoByzHxoD9A== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u17-20020a05620a085100b00785537e8fdfsi870939qku.80.2024.02.07.03.26.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 03:26:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="rVs+jf/Y"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-56391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C5CDB1C25496 for ; Wed, 7 Feb 2024 11:26:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B43ED1AADD; Wed, 7 Feb 2024 11:26:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rVs+jf/Y"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hLYCgGrH" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71AB71B275; Wed, 7 Feb 2024 11:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707305190; cv=none; b=aveJyfA8nEN0VXBmDIJzbOJvB8sQU6sDoV6F8RkfKfsun71WT4QG/HTKYqU9e5ubHuaxISWznceLPV0jdebLvUXfLs7aL4FYI4UwvBgBEdOg1ZKZthodylF227Gyz5Dr9hHqJkWpGVVlAZ6ZCiAl5Ue6o+m/oU1UlYVWvHkTeYY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707305190; c=relaxed/simple; bh=JfYBzih6S6mvSYeUfR3TJzJyamqjVFjhY7RxM4mbHeg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=OaW9B6uo0WBqirn3WpJWqcQcPd5liK1F1jV0dso/jtjrOxWAXPdR2/Xvgp1nnjsoDWrihNwOhBFdVq5onPNm2tHl57NTO/S0SFbJgZjibGKWmKSl+gp2KB8A6I4tPvh1QOEgJbRQ+GOHzREbmxkXvcl78bA7GYeCbXDI5Zf8m7s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rVs+jf/Y; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hLYCgGrH; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707305187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jdCIcHY3HFLAduHPxS6ZbiHVayvEt7hL0AjwboJZzHk=; b=rVs+jf/YT/rRqYGCZt6/RMrx/PA95qNfki/mh0TL7LHCe5jje8ceLJGry2F2qmIhT0UfCE 1i5afSBU/iLIxigCi5jSKDtuwUrNVppdKQDL/EXL1rni/H3hqaONZS0j6kJtG8GHWls5fi c5zF8kbHH8ZtbtCopwbBBYRNz0Q0J96hEUFEusm3ypMUkLwfFDvLg2YB6N66Gwd1H4Uca5 aOtfa5ISa2a2k5DaEPjscbIE3poLkqDj+0gJQPgXAbgqNlNXiRJq/fv8Dj8q6ZVasWUgMo cQ+K3+Y8uqwhM1yHetql7mwu179TPYbiwjsQjTfTdykO2tWs9rcgxA3gYIO89g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707305187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jdCIcHY3HFLAduHPxS6ZbiHVayvEt7hL0AjwboJZzHk=; b=hLYCgGrHKz53r5YQVdNWW5ahRCIfoL61j/VjkJJCHFGfjzVDyqugAEdGVti6IhSUFz0EOy ZJIcdFpN8SXeBTCA== To: "Rafael J. Wysocki" , Pranav Prasad Cc: rafael@kernel.org, pavel@ucw.cz, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, krossmo@google.com, jstultz@google.com Subject: Re: [PATCH] alarmtimer, PM: suspend: Expose a function from In-Reply-To: References: <20240131191317.2191421-1-pranavpp@google.com> Date: Wed, 07 Feb 2024 12:26:26 +0100 Message-ID: <87msscms65.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Jan 31 2024 at 21:10, Rafael J. Wysocki wrote: > On Wed, Jan 31, 2024 at 8:13=E2=80=AFPM Pranav Prasad wrote: >> @@ -564,6 +565,8 @@ static int enter_state(suspend_state_t state) >> #endif >> } else if (!valid_state(state)) { >> return -EINVAL; >> + } else if (time_check_suspend_fail()) { >> + return -ETIME; > > This causes a function defined in modular code to be called from > non-modular code which is an obvious mistake. > > It also makes the generic suspend code call a function defined in a > random driver, which is a total no-go as far as I am concerned. Alarmtimers is built-in core infrastructure and not a random modular driver, but nevertheless: > Why don't you instead define a PM notifier in the alarmtimer driver > and check if it is going to trigger shortly from there? PM notifiers > run before the tasks freezer, so there would be a little difference > timing-wise and you can return whatever error code you like from > there. As an additional benefit, you'd be able to handle hibernation > in the same way. Makes sense. Thanks, tglx