Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp425479img; Wed, 20 Mar 2019 03:39:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3Djw092CHGVwmLJiREZj41UWMrU0N1eE6mb9Oz8r4phT44k+rTSA21YXP0GGKkZmdD83k X-Received: by 2002:a63:4a20:: with SMTP id x32mr6773280pga.429.1553078356424; Wed, 20 Mar 2019 03:39:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553078356; cv=none; d=google.com; s=arc-20160816; b=rHEbJtc+VBrtJ9soRE4+zFnXLOaun+GTbuYzDT5Hm42wILXZmcFWqq56gGCUXRkoqX WUgjNbQWaH4KH0GHgothdQoErhdt/r6qS8v4Gn0aDZc7wyDOmx7vwRqqn5Oc3aUwCjpQ +bKnYqZJ0dqkzcAjDzpvbFetlMbi4hYMGgIBgJHHMIvc/PDxr4OAlLqIjN+Mb+uolmLD dtr/iQFveg7PlhOeX/Si5KPO0/zCkqGp2CS7q1vH+vHUja6/DO6G6h0xTV9+3g/BQlik zpvfo4ZGpdO3k9Up/8DWAI3GlqofPI/oVfeDR7pRiarOwbPLV6u6Z9cBF8jhW/ND3Jkg doyg== 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; bh=G1hPOEe3jJ6AnbUU74DKDnm76pygJUX41TkFkiFijlk=; b=nYRprSnVflZ++ZyaD6fvNKXgZ73RR38VSZM74foM+xasjtU1KFZUuUtAzEEnwKtQck 5efEb94UFEX9+qr8LMNGX3dJdpWE2Ek3uVTSXk7IyYGl8SM0htskUveQZg3vNfDfJbQE DwqRQ5xjVnNeMgNESC0WsRyZmevaxljiyUI5HksYJGeKQ0GhI/ldDQzJw5IV8QRBzaUi D3XecqmAzeBT4inMpcVrlU6qtwpqzGjpvvw+BBa+iFdDwVHZU7SGicRdOjNc6xsCcui1 1GGPGrSuEJppK0ZYwPtvNg9Qwv9fHUZI/woQ/ggR36dAOwY4iC2qFPdfZD4KmXX3oNvT ewgw== 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 31si1612570plb.39.2019.03.20.03.39.00; Wed, 20 Mar 2019 03:39:16 -0700 (PDT) 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 S1727768AbfCTKiM (ORCPT + 99 others); Wed, 20 Mar 2019 06:38:12 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:50109 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbfCTKiM (ORCPT ); Wed, 20 Mar 2019 06:38:12 -0400 X-Originating-IP: 182.72.246.220 Received: from localhost (unknown [182.72.246.220]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 16496C0013; Wed, 20 Mar 2019 10:38:08 +0000 (UTC) Date: Wed, 20 Mar 2019 11:38:05 +0100 From: Alexandre Belloni To: Stephen Boyd Cc: Alessandro Zummo , linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, Enric Balletbo i Serra , Evan Green , Benson Leung , Guenter Roeck Subject: Re: [PATCH] rtc: cros-ec: Fail suspend/resume if wake IRQ can't be configured Message-ID: <20190320103805.GN29054@piout.net> References: <20190315185112.97699-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190315185112.97699-1-swboyd@chromium.org> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/03/2019 11:51:12-0700, Stephen Boyd wrote: > If we encounter a failure during suspend where this RTC was programmed > to wakeup the system from suspend, but that wakeup couldn't be > configured because the system didn't support wakeup interrupts, we'll > run into the following warning: > > Unbalanced IRQ 166 wake disable > WARNING: CPU: 7 PID: 3071 at kernel/irq/manage.c:669 irq_set_irq_wake+0x108/0x278 > > This happens because the suspend process isn't aborted when the RTC > fails to configure the wakeup IRQ. Instead, we continue suspending the > system and then another suspend callback fails the suspend process and > "unwinds" the previously suspended drivers by calling their resume > callbacks. When we get back to resuming this RTC driver, we'll call > disable_irq_wake() on an IRQ that hasn't been configured for wake. > > Let's just fail suspend/resume here if we can't configure the system to > wake and the user has chosen to wakeup with this device. This fixes this > warning and makes the code more robust in case there are systems out > there that can't wakeup from suspend on this line but the user has > chosen to do so. > > Cc: Enric Balletbo i Serra > Cc: Evan Green > Cc: Benson Leung > Cc: Guenter Roeck > Signed-off-by: Stephen Boyd > --- > drivers/rtc/rtc-cros-ec.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Applied, thanks. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com