Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2198582ima; Mon, 22 Oct 2018 06:05:05 -0700 (PDT) X-Google-Smtp-Source: AJdET5ehfni/Y2qxsX+dZs/g7iiJzILyha1ZLrTFYUCqMLMrt6ygQfQjierEXGyTMq+MXJx+atKt X-Received: by 2002:a63:5c22:: with SMTP id q34-v6mr6747086pgb.417.1540213505021; Mon, 22 Oct 2018 06:05:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540213504; cv=none; d=google.com; s=arc-20160816; b=cP7JkQhZ0uhe+XQ7rIWWipH1v0NR+c0HNXj3/o8He7B0lm//95ucKvODoA1GkN+XPc N53Tx9d0G6eRX2ChmOkbrakL/NcWN5fX9JKhMFJ3tyw/Ygayy5x8u2CZSnQEh/Zj89pW P8Zmi5EsYscnjxTinG9eRtuESXsQH0cy88CpZRTYrl621gKhMWEneLUK6roVhz2cl/42 ujw8funqeTmBSk3a6gxRHNJf+WphCV/0su5tunNmJlE/oDBL5bf+Nkf0T6LdH/kwOe/T RvDniGSftUpo8kxvpadGwTGgQbIwHAp1DXtg/eOW/s3qjxeB+f0MxBGT1MxtFqB7X1MB nWVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=x8oCIvt6nOoHUTvDF2NggLqQeL6wo+FZ64JvsC5L7Hc=; b=f03iNZMaYmjOw49WEN0qp1PzjLwY6PR6DMXvTh7Ev7dv4Vy2a3pRvuiD7e/TNhUJD2 Mp2DY50BdkWsBX2Fum43IFS1gpI1+OLL4KsOYdWkAf6cjGNLFay437VIAUlKW/FW4z1Z q4SddUPjSwkElF1YER3e8AgO46XMvrVNISHWQJONA7wGrdd1G1Wwvg6OE9pdLmo1K3pe rhRDZGolt0nmyP6YlGdMVFdCgbgoreUzWaeIYE+fFZa/QyaKEmsK+1BdcgcUzQ834C9c fAO8EvTMrUjGomvLSyhR/CiYQh41sJ07lO2wjG5h4F5rZvS7CkAVqV2cJJh/d5RzerTV ZRFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CgktSkZQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7-v6si34371103pgb.301.2018.10.22.06.04.46; Mon, 22 Oct 2018 06:05:04 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CgktSkZQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728825AbeJVThS (ORCPT + 99 others); Mon, 22 Oct 2018 15:37:18 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:36505 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727531AbeJVThR (ORCPT ); Mon, 22 Oct 2018 15:37:17 -0400 Received: by mail-lj1-f193.google.com with SMTP id p89-v6so36600453ljb.3; Mon, 22 Oct 2018 04:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=x8oCIvt6nOoHUTvDF2NggLqQeL6wo+FZ64JvsC5L7Hc=; b=CgktSkZQusFg4nk94NkMWLuDEp/69UNVg5Jw+fOFZwaoSRx6Ef4NY04sB++6aQrlua 8hJD3wJhcy4E2Fc+NkuP7W+6nh2c2UFslyQJg5SIoFX9r8Zbn/oS5Vwghk9owxizMlaP v6O0RY9mIdBpHB0X4siCKnsYodThh3H2dWg8IqI6e+7WAD7yruwSmfUe88qQAPbYgezO 74WJ/hOA8fbytKjtSm61tVKefi7nVdO+W+RmAAHksz4aEJ8gtnNbxdcelR26zrkowlCg Wpr+HkgAACUw+OkU4LZvD5nXNelO0dZwCVWDW/kt10D2vOs+AEWXmrIxZbP2fYrxiJt9 Tufw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=x8oCIvt6nOoHUTvDF2NggLqQeL6wo+FZ64JvsC5L7Hc=; b=o2gEnDIA/VGiNqQb8YSHJEs7aGFKV28OYAKQlwlMGULPMHM85BfjQcdQEjXrQv5K30 +MSudPDTY5de0RkEEpEH2jZqA2cVWH41TMqt4f67RCejYc+v0bVjQUXnuC1FyjLc03BB TYxANYVCmpPxDyBBql8yCkvDKCOW/AL5rVe7FTTfm3HMrYH6g7C4rYSRNDprw4umzBmC GL4GEChGupquRga/gMoc1sbSaP7cPZqKKAX69GuCXJDxdWtmwC2axK1VykxKr36TqQqR 4i+vqkphSoc5WhVT/0iv6D7Opdrw1fRoYrYI8YvNWIcFzknfhSl3cKY/DzhGhvw/MMD/ qTKA== X-Gm-Message-State: ABuFfojokwP4XCGUc/v/attXzOb6tKQepc9xz0PDjxj3UHBUdA88HVRb VfVOUnKO+B689WoeDtQqIpsMexRr X-Received: by 2002:a2e:87da:: with SMTP id v26-v6mr12075888ljj.13.1540207147212; Mon, 22 Oct 2018 04:19:07 -0700 (PDT) Received: from [192.168.2.145] (109-252-91-118.nat.spd-mgts.ru. [109.252.91.118]) by smtp.googlemail.com with ESMTPSA id t4-v6sm1361633lft.77.2018.10.22.04.19.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 04:19:06 -0700 (PDT) Subject: Re: [PATCH] mfd: tps6586x: Handle interrupts on suspend To: Thierry Reding , Jon Hunter Cc: Lee Jones , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, stable@vger.kernel.org References: <1539955373-13735-1-git-send-email-jonathanh@nvidia.com> <20181022095257.GD4014@ulmo> From: Dmitry Osipenko Message-ID: <366ad7c3-85e2-3526-1c0b-6d2fbde4c552@gmail.com> Date: Mon, 22 Oct 2018 14:19:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20181022095257.GD4014@ulmo> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/22/18 12:52 PM, Thierry Reding wrote: > On Fri, Oct 19, 2018 at 02:22:53PM +0100, Jon Hunter wrote: >> From: Jonathan Hunter >> >> The tps6586x driver creates an irqchip that is used by its various child >> devices for managing interrupts. The tps6586x-rtc device is one of its >> children that uses the tps6586x irqchip. When using the tps6586x-rtc as >> a wake-up device from suspend, the following is seen: >> >> PM: Syncing filesystems ... done. >> Freezing user space processes ... (elapsed 0.001 seconds) done. >> OOM killer disabled. >> Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done. >> Disabling non-boot CPUs ... >> Entering suspend state LP1 >> Enabling non-boot CPUs ... >> CPU1 is up >> tps6586x 3-0034: failed to read interrupt status >> tps6586x 3-0034: failed to read interrupt status >> >> The reason why the tps6586x interrupt status cannot be read is because >> the tps6586x interrupt is not masked during suspend and when the >> tps6586x-rtc interrupt occurs, to wake-up the device, the interrupt is >> seen before the i2c controller has been resumed in order to read the >> tps6586x interrupt status. >> >> The tps6586x-rtc driver sets it's interrupt as a wake-up source during >> suspend, which gets propagated to the parent tps6586x interrupt. >> However, the tps6586x-rtc driver cannot disable it's interrupt during >> suspend otherwise we would never be woken up and so the tps6586x must >> disable it's interrupt instead. >> >> Prevent the tps6586x interrupt handler from executing on exiting suspend >> before the i2c controller has been resumed by disabling the tps6586x >> interrupt on entering suspend and re-enabling it on resuming from >> suspend. >> >> Cc: stable@vger.kernel.org >> >> Signed-off-by: Jon Hunter >> --- >> drivers/mfd/tps6586x.c | 24 ++++++++++++++++++++++++ >> 1 file changed, 24 insertions(+) > > So does this mean that the SPI interrupt for the PMIC can still be a > wakeup source even if it is masked? This is slightly odd because now > you're saying that this does work while it doesn't work for the RTC > interrupt. So is this an implementation quirk of the LIC/GIC on Tegra > which doesn't extend to the TPS6586x? Or am I missing something? What is the expected behaviour of IRQ disabling? Should it disable wakeup ability or only mask IRQ handling? Couple months ago disabling of IRQ was disabling the wakeup, now something has been changed in kernel and wakeup isn't getting disabled. So either there was a bug before that was fixed or there is a bug now.