Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp5050088ima; Tue, 5 Feb 2019 05:42:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IZeNdmkDU9wvKzdV6VoL2zpSCjhnlkfdAeiDj2TeiON96ZDlkB0XL0a9ZJf6YcuPQIgT8W5 X-Received: by 2002:a63:cd14:: with SMTP id i20mr4652127pgg.288.1549374123243; Tue, 05 Feb 2019 05:42:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549374123; cv=none; d=google.com; s=arc-20160816; b=lYH9hYt3x0b4CIT+9kXPzU+uH3VzALm76al6il44xoboQhq4LyuXEfydPIk7hs6anj PYRBEO+bY8eWWEScPYbG1SQfty1DWFuzpmflyb8CHF5kN41LLllg9OUcwqBhUYSSeK81 ZUSb5hxxBdyJeJGloCvFRjAeM6DEaxKkiLd958it6rqm6vqtbpUBltffzSyVeuxkrNmZ Sr5kDoEVvVAdvuLEDiOMF65ph+wt5r3AzA3o20rttL2rAr1KF8K3CovPcDv8lcSwDQ+L Zd/kiNrPqfCS4IydG3gRwTlb6/ubGD9rYrF8JrLgoElRxHMYEjgcu5lCRHkycWoNiolf Tnzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=mH2jC//BX4csPlxzLWPxIbl/VLPdX2MNzc/nlQzQz8Q=; b=BNBk8lnp37jJmFpNIVic7Ri5JEr6zZZ4M2ghkjZ3ySnqqiQiDKLpi4ZiCBEVUAeQa+ 0zb7FMKQ1W+QNcCZNntuAprLC2rP198TxWsdv6k9rIASHAKo921OG0jYjLDKMm5gcoOT hU0J2ZT2yw3bhTdjqeq6aC/a0sdDk5d8xTiYNQBXRqViFAGlD/TiTlEhK4d9EYnOMyiP u6EwWpvGZk0lhy6wjGdgxmFVSPDQv2a9AiFIHd8jDc7joF8esi+liWK/4bMXRo13h1WQ fqLRQOiWUO5bQqQWjDO6NEVcKFsXNLG+7pyyy4X/6vVR2X29myl0JdlNRWJHE6kRQW7x OK5w== 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 l9si2974332pgj.543.2019.02.05.05.41.43; Tue, 05 Feb 2019 05:42:03 -0800 (PST) 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 S1729484AbfBENYs (ORCPT + 99 others); Tue, 5 Feb 2019 08:24:48 -0500 Received: from mail-vs1-f66.google.com ([209.85.217.66]:41135 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726276AbfBENYr (ORCPT ); Tue, 5 Feb 2019 08:24:47 -0500 Received: by mail-vs1-f66.google.com with SMTP id t17so2108581vsc.8; Tue, 05 Feb 2019 05:24:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mH2jC//BX4csPlxzLWPxIbl/VLPdX2MNzc/nlQzQz8Q=; b=g3YaCJcISPixq7aUuf35LNeOkryoASZsaYYP4JnvgSu6j8PtbZJj79oe743QGuXlM8 pSyh6fsgRGsh2/A6gIPEIWbTjIcZiKYnZdFGIwndaGo6vZA2JkwpU3rXX0mQjuKbJENA w9JEfYl/F8wPwKBVTCfeaCIleLQiUliSRuVV9Zu9+8dd8i9nshnEA8hKJbdFwN0PMy+A EUd6k0mcnsolXK80Dkgw2ISGJ0CgphTpWGvQkzHgui+43WmHPhOgp+L0ca5En/vgvr8N YF1CC1OgCBfwK19kOLJYXZ7eNuOpGHMpoDv2AQR0oUMLT/phHOTDsS4bfiWBuzkZgziY brAA== X-Gm-Message-State: AHQUAua3qL84bJA7OJQh2VJzz3L/kqfB8ikbELQqlPgIM7gp5h6nYNMR XWlcsWDxoFNY9PKyeP1tBvgr+D0MmqyRuEiK5cA= X-Received: by 2002:a67:d119:: with SMTP id u25mr1891966vsi.63.1549373086077; Tue, 05 Feb 2019 05:24:46 -0800 (PST) MIME-Version: 1.0 References: <1548846984-2044-1-git-send-email-vincent.guittot@linaro.org> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 5 Feb 2019 14:24:33 +0100 Message-ID: Subject: Re: [PATCH v2 ] PM-runtime: fix deadlock with ktime To: Ulf Hansson Cc: Vincent Guittot , Linux PM , Linux Kernel Mailing List , Linux ARM , linux-omap , "Rafael J. Wysocki" , Biju Das , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ulf, On Wed, Jan 30, 2019 at 1:15 PM Ulf Hansson wrote: > On Wed, 30 Jan 2019 at 12:16, Vincent Guittot > wrote: > > > > A deadlock has been seen when swicthing clocksources which use PM runtime. > > The call path is: > > change_clocksource > > ... > > write_seqcount_begin > > ... > > timekeeping_update > > ... > > sh_cmt_clocksource_enable > > ... > > rpm_resume > > Hmm, isn't this already a problem in genpd then? > > In genpd's ->runtime_resume() callback (genpd_runtime_resume()) we > call ktime_get() to measure the latency of running the callback. > > Or, perhaps irq_safe_dev_in_no_sleep_domain() returns true for the > genpd + device in question, which means the ktime thingy is skipped. > > Geert? Correct. After adding dev_info(dev, "%s: pm_runtime_is_irq_safe = %d, genpd_is_irq_safe(%s) = %d => %s\n", __func__, pm_runtime_is_irq_safe(dev), genpd->name, genpd_is_irq_safe(genpd), ret ? "true" : "false"); I see on R-Car M2-W: sh_cmt ffca0000.timer: irq_safe_dev_in_no_sleep_domain: pm_runtime_is_irq_safe = 1, genpd_is_irq_safe(always-on) = 0 => true For all other devices, the result is false. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds