Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp588073pxf; Wed, 10 Mar 2021 12:31:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJycWhKoZkFcbpZpid54ZZUgqkYJgmsQD9uicSADSL3qk1lNZZTRteprqnApf3Mvmuv4XAXB X-Received: by 2002:a17:906:ae88:: with SMTP id md8mr231733ejb.264.1615408278437; Wed, 10 Mar 2021 12:31:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615408278; cv=none; d=google.com; s=arc-20160816; b=xFc6qJy+daPUHOxAcqJjSW5kbdsnp4F3N+ftIykJClSQHdhz3ApB7NcXYnAKXcXq8Z Sg6Xlx4ww125H1jNwV03X7Hp6APACEBXDMoUGO9pqNjaP+TwBpF2bGuFaUfvDYfrKJDa Dg0BCNAivuaOS0o1oczNhhgYlzqqNWsTLtuJvMpcvhy6qc7b9ma4Gxe2H1Zxh46cfQCB MqC4LGk0KZeNGG7XcVP8KZ6F9VuhP0rr9d8SukMrGQXwnKzhTMPjfG1rKZGiQ4Q0GkfM UMPBeEjbN//ZyFSHT7X49tK1+CWNgKzJ7bG3LUiZrAZAprR9ZkYvybJ7wNc3w2KU3p4p +b9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=NjeHyvZMbZGJ8OEzLSik+NBjkSDo6JPO/IsATXTAv4U=; b=AbXw7sQvt/IKG/K0NyTVVIbRhB+oIgxcGwiJn65klOS90vvxKg4H1hvUhlnilcHipI wiiyj3XmlsEc+BZTbTM+2S9ovdBmHXtzIDdDjoYH5s2vFgCo0lWycc7tENmKlEZYQSVu 2P2S14JI650YAHrPcf8Qv56VkEiYEEl1eaJURcOuWyi8HU0usxVBKfrO34jyboqkuuuH U2kCzVDqaSVaaFhSzWcKYrL/9ow5kQZqCI6FOblsfQYlsCtovp8IQ5h9N4dP+PWx0Avr yqmAj5S9q9vhnzKMBQJhKLpbmji7j3BhszDimGwwumi1PtLRNiaMg/KbEVTKGWMk8VP1 A/cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HqjgsGqm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si271349edw.605.2021.03.10.12.30.55; Wed, 10 Mar 2021 12:31:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HqjgsGqm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231321AbhCJU1j (ORCPT + 99 others); Wed, 10 Mar 2021 15:27:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231484AbhCJU1Q (ORCPT ); Wed, 10 Mar 2021 15:27:16 -0500 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C085FC061574 for ; Wed, 10 Mar 2021 12:27:15 -0800 (PST) Received: by mail-qk1-x736.google.com with SMTP id d20so18335626qkc.2 for ; Wed, 10 Mar 2021 12:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NjeHyvZMbZGJ8OEzLSik+NBjkSDo6JPO/IsATXTAv4U=; b=HqjgsGqmuDSGg/MeVO8mxOU3yiE7d6qGOOsFAoMQmWI/ZpLuOC3B3KDsNgAVmp1HEP I9teL1AcZ1SkgrbgstvsGH9yxsotjqYeZjCbqYMZcbLKvBYghiYTHElgDN1hIsSLWdZX v5PPGjpkNnOgUjrXWbCYWccvWjR0lD1duMzNI= 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=NjeHyvZMbZGJ8OEzLSik+NBjkSDo6JPO/IsATXTAv4U=; b=bJougEsCLe+VuE2aQ0mmdYVijqyHdRAR9uKQXt3xI7LmN23wH3s5obu5iIasNoJYHc 86JFUec0ncUjU1f1MvuRYKTqM6jnhShKqhYag1z5JTdGkaJmMxKbEpuqBJP09V1UZoAW uKc1gxMXAfOVkvahzMfy85VPJVMG+oHg7Aba/GyOe0gQjMhhVCmPSqTgKDjKzObNv119 GEE2FmcCgbYZh4j7OH/Fo4Ne267SyxjapPvnvpvRcfN2h6FSY1GWGXy3ZZfiYlCiy/Vv ZCzmkhGZ5cfUDhYhsjuyenFqXa3lV966pJh/bUIP8BSjMEnTZ93v1Hcwx4zuxD4f6w/z hnVw== X-Gm-Message-State: AOAM530El1vocKWUF299yut7jJRD08KJ1eyKAxc4KfJ9HRIAzg1RKBTX uuBH0/h3KUufb0LvnMzHKX6LZQAmDRP8Sw== X-Received: by 2002:a37:4d57:: with SMTP id a84mr4623438qkb.464.1615408034674; Wed, 10 Mar 2021 12:27:14 -0800 (PST) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com. [209.85.219.175]) by smtp.gmail.com with ESMTPSA id z5sm266906qtc.42.2021.03.10.12.27.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Mar 2021 12:27:14 -0800 (PST) Received: by mail-yb1-f175.google.com with SMTP id h82so19203564ybc.13 for ; Wed, 10 Mar 2021 12:27:13 -0800 (PST) X-Received: by 2002:a25:9348:: with SMTP id g8mr4388320ybo.343.1615408033534; Wed, 10 Mar 2021 12:27:13 -0800 (PST) MIME-Version: 1.0 References: <20210310202004.1436-1-saiprakash.ranjan@codeaurora.org> In-Reply-To: <20210310202004.1436-1-saiprakash.ranjan@codeaurora.org> From: Doug Anderson Date: Wed, 10 Mar 2021 12:27:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] watchdog: qcom: Move suspend/resume to suspend_late/resume_early To: Sai Prakash Ranjan Cc: Andy Gross , Bjorn Andersson , Guenter Roeck , Wim Van Sebroeck , linux-watchdog@vger.kernel.org, Stephen Boyd , Matthias Kaehlcke , Linux ARM , LKML , linux-arm-msm Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Mar 10, 2021 at 12:20 PM Sai Prakash Ranjan wrote: > > During suspend/resume usecases and tests, it is common to see issues > such as lockups either in suspend path or resume path because of the > bugs in the corresponding device driver pm handling code. In such cases, > it is important that watchdog is active to make sure that we either > receive a watchdog pretimeout notification or a bite causing reset > instead of a hang causing us to hard reset the machine. > > There are good reasons as to why we need this because: > > * We can have a watchdog pretimeout governor set to panic in which > case we can have a backtrace which would help identify the issue > with the particular driver and cause a normal reboot. > > * Even in case where there is no pretimeout support, a watchdog > bite is still useful because some firmware has debug support to dump > CPU core context on watchdog bite for post-mortem analysis. > > * One more usecase which comes to mind is of warm reboot. In case we > hard reset the target, a cold reboot could be induced resulting in > lose of ddr contents thereby losing all the debug info. > > Currently, the watchdog pm callback just invokes the usual suspend > and resume callback which do not have any special ordering in the > sense that a watchdog can be suspended before the buggy device driver > suspend callback and watchdog resume can happen after the buggy device > driver resume callback. This would mean that the watchdog will not be > active when the buggy driver cause the lockups thereby hanging the > system. So to make sure this doesn't happen, move the watchdog pm to > use late/early system pm callbacks which will ensure that the watchdog > is suspended late and resumed early so that it can catch such issues. > > Signed-off-by: Sai Prakash Ranjan > --- > drivers/watchdog/qcom-wdt.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Douglas Anderson