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 41239C433F5 for ; Mon, 9 May 2022 05:12:34 +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:MIME-Version: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:In-Reply-To:References: List-Owner; bh=tH/DlurnnYhHFFmr0OIKRn0u6g/SEFxarkExKWfi3To=; b=CNzai/fjlGlg0Q cXkAOPzKnRV/F1RtQlsJJGTDMMKOWPkZpb9GWyV7HP1Of8rZGbkNC0Vbp4PRSr88hJmY9TZ7nMnxY vcWlM1pvV0waVW/w/HaOp63vyJgjIb1jNW3LZg5VOr5FrbWGnJ0ceKjVcNu7CrgictIHCDh/zJPb3 3hJkSwpOtrAns8OaxsRgEqbBC3X2I31KHpFL0OKZj2JwPjFa2aNtX8aURoFSCgnFGCioGpkAx8alK TTLWHTeFDJLpbhtRd9qPwUsxK6eKf94p6LKSZETxQy1KsiD2lAo50e3MKxoE0nci6RPWm28KX9k9i VSbnaE5AqqGsdT4GHyew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnvfx-00CS2s-LB; Mon, 09 May 2022 05:11:17 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nnvft-00CS1S-CJ for linux-arm-kernel@lists.infradead.org; Mon, 09 May 2022 05:11:16 +0000 Received: by mail-pf1-x433.google.com with SMTP id 204so8500491pfx.3 for ; Sun, 08 May 2022 22:11:11 -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:mime-version:content-disposition; bh=rDSFCO+czyrWwVIb/ri2W/5CAZ/bjTYqyMNHNUzLBgc=; b=NGeVsQ++HGtjZxzvUZn1nbfaCrKKTfnM27oWvJsxcQJiAy3hRTbcCH2794ZktMDynH R9268OPrKnRi0SxVYCY6APSONAAW56+inot6dKaYvxxiVLvViByq6EpMmXmtQQ9W3zvM noWZh5xnsQQHzXO1FSFi+X4Gumb189wYfLmLhtqViQkZVktne7fXneH4BFF7cj6X4rsq 6QI1jPOs3L5/8JvrCyigC6idtOfVxKY1C9aluVUxfuDMub6jQGS5embdFASWhukIScVZ SOatnziUTIe157Q6TVh9w90rUGNYDl7h0PZEjTMKQ0OZlr0FEd9q3rIyrlMMKzdAKDX6 5+ZA== 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:mime-version :content-disposition; bh=rDSFCO+czyrWwVIb/ri2W/5CAZ/bjTYqyMNHNUzLBgc=; b=iiW8HMMBO1t5GDx9XfemKbE9erE4nAV6Ycr3t8VXZ/OpdHPh4hkSeblNVIUIZf7kJh 4DC3GvmCxt44h4JeWrd97fw3a4CFkaozJdRGRmIUVhY9F8VtjjpvKURAvcyAwPW4pzCP hfJqKwJx+V0Zdgn7RBlwbA7tVCwwkIozf1DJuAXHzakmPX5gY5HgfpgahRZkSzpE5qb9 kS9l17+Sy31ZCVmJj2P3IBBELIdJXcFRaMk3XJaM9lQYthte3sotlMoyrt54t4GHzsGA NjSEAdXLPzv4RCyJ9XLn0e0MLRIIaHRLQ+eiCNs0HI0Oyobt6HUxS9Gm4pen4uar9DZD dODA== X-Gm-Message-State: AOAM532wQ14NMaQ+e1ueXFJJ2jhDd+m3eS+BPIi/sxA6EoAM0jrON2UG EMalCnbJOFURl6c2hlz7Oqa69g== X-Google-Smtp-Source: ABdhPJzQmAGyTKxouc0RQtiPKY+fyHgHySgxrAsDXhahZmKoQArbKkfoIBffIe19H+asxSznCOZPgA== X-Received: by 2002:a63:7d4a:0:b0:398:dad:6963 with SMTP id m10-20020a637d4a000000b003980dad6963mr11871980pgn.329.1652073071387; Sun, 08 May 2022 22:11:11 -0700 (PDT) Received: from x1 ([2601:1c2:1001:7090:8a29:6b15:2464:b015]) by smtp.gmail.com with ESMTPSA id t9-20020a170902a5c900b0015e8d4eb1e3sm6027714plq.45.2022.05.08.22.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 22:11:10 -0700 (PDT) Date: Sun, 8 May 2022 22:12:08 -0700 From: Drew Fustini To: Tony Lindgren , Daniel Lezcano Cc: Dave Gerlach , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: dmtimer: ack pending interrupt during suspend on am335x/am437x? Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220508_221113_675757_1B5D5F44 X-CRM114-Status: GOOD ( 11.87 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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? Thank you, Drew [1] https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=ti-linux-5.4.y&id=96f4c6e2ba8a [2] https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/commit/?h=ti-linux-5.4.y&id=7ae7dd5f8272 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel