From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0CECFC433EF for ; Mon, 16 May 2022 03:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rLMCl/lhKcxkuRM+PDjaniOAl90IyME3DC+LQFQGaRs=; b=wNxGrl/1IUTIb+ g5gri7QU//yP3oQ4FrIK2Jk6+Rcc/gc5fcgIzr/DuyW/gaG5wpcLbWQuijW67y5zMdn7u3iyNUzB+ zUKxbHUxD7v9tBcoRHvXdhoRpURgxHcLu2KTCOyMQ+0guFzAfTMo1E+6m3Oej0IzG8tM0qiJuP0cV vfCLMi3ZQ5pL7WqRF/+UNwHa8aIiK5+giQGxMFP939idlHqEb9BfFZXjhAYANzUMfFwEVl4oV0nuQ 3XmgCAYQ56z4BfhLUwoWOJ8wjPXgz83mY4VlUYHPY6f5U+pd0EuFvFZPFV9UQfLWRkUWXOcQHfO0O j8Sz4k+9iZm+qRuZfJ6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqRs0-005rCC-1F; Mon, 16 May 2022 03:58:08 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nqRru-005rAL-JV for linux-arm-kernel@lists.infradead.org; Mon, 16 May 2022 03:58:05 +0000 Received: by mail-pj1-x1034.google.com with SMTP id f10so1359639pjs.3 for ; Sun, 15 May 2022 20:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=81zc4fqkgQwb8WIkORpKBhGcFxG3h9Urzvpiad4QCFg=; b=W6LddtNMiFSSJofxVZqIRxwE5VyeMZWnHVjwe/OIn02+PgdfTm416Y8Dx4dggHgh8C vgxt05kJFFWI49QuDa0Ojn/hduH2hjoCCNseMdbramTtwjtRN9YV/nk56X73D/+EaDRn pF0gSzmsQjXrQkdh5VmYmtOx0vxBcXXcqjM5nb4j9ujhDAesgNZ2exU46cuSX51nIcR0 xxiXWnf3rzO8qRH2YGtOq5Z8pAyiBfS1sK2hrrfSLY5t1KG6lG3IQGgA1Wl9+NpksLw2 VSas7r8Ic3zL97BH+rrvYF5JtMSn4SxcL3P5R4kURmlqT5s9Fwpw174MHKrfrslRXq2O QeJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=81zc4fqkgQwb8WIkORpKBhGcFxG3h9Urzvpiad4QCFg=; b=LFw4WA/qAzvtpYsIHAJMSDhJmgAG5vBfp6tjzrA7/4wutCjoQtkud0RzRqRZvk6+Na e1reswVjjktdTAsBYcCHK6hJuOl/NhicQf2jjdhH3znhxei7zuC4lZj8zXoMoTWF0lYM kB5nZ05CyvYxjyTGQzW/T/oALpGSPCFGAyCWjBHXQ6DYOelH/Ue3asUX4BUNQ3rgte4J 98Dj00FplnpWvHbq3J4oWyj91VDniVGb2koXBWjJGxjZlJO6VTsMbhWilviDCgPaN1Hn nnAjzgkGh5N4jpRbhO9CcDb6cDvMwAotXiWGqARbJxC8/iWx9gCmEwiex+xSvbHEZ5qz CPaQ== X-Gm-Message-State: AOAM531xjuapYo5aemJh9KD0UvGatpsf9DmLj47lUjjOi7uK89AGulRI ZkiHZn/IgiDFTxdcsOhp/eNHyA== X-Google-Smtp-Source: ABdhPJyg3KrEF088VNTx7elv0wOUTwpEq+w+oeu0yE6kH1FAK/ti7Jhg6b6REiH/sYNyYQAnq5j8vA== X-Received: by 2002:a17:902:9684:b0:161:5b2b:6ea2 with SMTP id n4-20020a170902968400b001615b2b6ea2mr7540565plp.71.1652673480745; Sun, 15 May 2022 20:58:00 -0700 (PDT) Received: from x1 ([2601:1c2:1001:7090:362:347a:2a38:5df4]) by smtp.gmail.com with ESMTPSA id h35-20020a632123000000b003c14af50627sm5511128pgh.63.2022.05.15.20.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 May 2022 20:58:00 -0700 (PDT) Date: Sun, 15 May 2022 20:58:55 -0700 From: Drew Fustini To: Marc Zyngier , Tony Lindgren Cc: Daniel Lezcano , Dave Gerlach , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: dmtimer: ack pending interrupt during suspend on am335x/am437x? Message-ID: References: <4de411aa2fc8a6f185afb8bfd5da63d4@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4de411aa2fc8a6f185afb8bfd5da63d4@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220515_205802_904728_F6DCE73F X-CRM114-Status: GOOD ( 31.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 10, 2022 at 09:19:51AM +0100, Marc Zyngier wrote: > On 2022-05-10 07:49, Tony Lindgren wrote: > > * Drew Fustini [220509 05:07]: > > > Hello Daniel, Tony suggested I mail you along with the list to get > > > feedback. I'm attempting to upstream these two patches [1][2] from > > > ti-linux-5.4.y for arch/arm/mach-omap2/timer.c: > > > 96f4c6e2ba8a ("ARM: OMAP2+: timer: Ack pending interrupt during > > > suspend") > > > 7ae7dd5f8272 ("ARM: OMAP2+: timer: Extend pending interrupt ACK for > > > gic") > > > = > > > On the TI AM335x and AM437x SoCs, it is possible for a late > > > interrupt to > > > be generated which will cause a suspend failure. The first patch makes > > > omap_clkevt_idle() ack the irq both in the timer peripheral register > > > and in the interrupt controller to avoid the issue. > > > = > > > On AM437x only, the GIC cannot be directly acked using only the > > > irqchip > > > calls. To workaround that, the second patch maps the GIC_CPU_BASE and > > > reads the GIC_CPU_INTACK register before calling irq_eoi to properly > > > ack > > > the late timer interrupts that show up during suspend. > > > = > > > However, Tony removed most of arch/arm/mach-omap2/timer.c with: > > > 2ee04b88547a ("ARM: OMAP2+: Drop old timer code for dmtimer and 32k > > > counter") > > > = > > > The timers are now implemented in drivers/clocksource/timer-ti-dm.c > > > and > > > drivers/clocksource/timer-ti-dm-systimer.c. The function > > > dmtimer_clocksource_suspend() disables the dmtimer and clock but does > > > not ack any interrupts. > > > = > > > Tony suggested the right place to ack the interrupt during suspend is > > > in CPU_CLUSTER_PM_ENTER inside omap_timer_context_notifier(). > > > = > > > Do you think that would be an acceptable approach? > > = > > Based on what we chatted on irc yesterday, I'd suggest try resetting the > > clockevent on suspend first for am3/4 at omap_clockevent_idle() and see > > if > > that takes care of the issue. If it's the timer hardware blocking the > > deeper idle states, this should work, and GIC will lose it's context > > on system suspend anyways. > = > Maybe, but the core tracking code will still know it is in the > middle of an interrupt. I=B4d expect things like lockdep to shout > at you... > = > M. Tony and Marc - thank you for your insights. I have learned from Dave Gerlach that the occurance of suspend failures on the downstream TI 5.4 kernel was only 1 in 10,000 prior to his downstream patches. I have now done 33,175 cycles of suspend/resume with rtcwake and no failures have occurred. Thus, I have to conclude that mainline does not exhibit the problem of late timer interrupts causing suspend to fail. Thanks, Drew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel