Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3583937imw; Mon, 11 Jul 2022 11:23:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sc/uN5i7h6O/urokBdPDaSKfLFwSwoEpazGy4QCTuEod/+eokA7tnCYXGeLOkbtxHK8QbZ X-Received: by 2002:a05:6402:1003:b0:43a:75d8:a0e with SMTP id c3-20020a056402100300b0043a75d80a0emr26851045edu.303.1657563830993; Mon, 11 Jul 2022 11:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657563830; cv=none; d=google.com; s=arc-20160816; b=O1CBtP7DCer2b5iJwE0hvlvvP6PcFKLnY18QE1wrbwBi9DabyPJl+f+LW/6BlV7rhQ uaG11kEYBpyK8emsi5/h6PzbiP0BXEowSQIhhCvwq941E6gXy33chrIFl+c4bjPfsRFU lkd5eF98rW2myKTy5ODk0YWOMpHlsRTwa4xB4vocL9SgkvN09oBfNpoJ0QIqGeEs7eVm axAWopsHlsKXvXEwELOcvuq4TRgq/nDfcmAOR6egaWEzfj5OpvHVcIP9Kh7k5/YZTN3u qktdTF6kOB/j4s07vyNYBeZpkUNB36mCFa8XMBG9T0O7PtkABPIt81rjbTEchBwD7vjB 6j/A== 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; bh=N/J7EoD7mYdsTByRR/hI1SV+TyZn6NehpwEWybopIbI=; b=B1WhMLmX8nWiVzT88fp3zN1f3s3ilU0JkByz7D8x61oxfpj85ZkTt6LlIfx+Mp87Ux YlUxVmSmi6V0zzplGoymvO//5Eo9igw1EuSjSQFO/A/OrMU95ccz2PgyDO1b0O5NT8I7 6pG/XuoAqmtNvvaen849pFN8miu0QiXJc4DUbvs/3SqpeizOs9JJAh6ii12JvbcVgHt1 v2HFNXtIoGlhwdFmdWDMk55jfSs8WZXjTIMf6FKYFNaMyRGG1N2Xp8zrE1FpO/k23Xnh c8tP5ddRS+mAxbN4fVmoCmuCJzX4YT9g2rr9gCORRuFs1qnLFisP5OrtYNfc74c8hG9n q3GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw25-20020a1709066a1900b0072b408fc69dsi9358225ejc.951.2022.07.11.11.23.23; Mon, 11 Jul 2022 11:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbiGKSNe (ORCPT + 99 others); Mon, 11 Jul 2022 14:13:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbiGKSNd (ORCPT ); Mon, 11 Jul 2022 14:13:33 -0400 Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C389104; Mon, 11 Jul 2022 11:13:31 -0700 (PDT) Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-31cac89d8d6so57850937b3.2; Mon, 11 Jul 2022 11:13:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N/J7EoD7mYdsTByRR/hI1SV+TyZn6NehpwEWybopIbI=; b=FIqGpB85xJKRC5WkrCOUp/7iGRo00lqk6kJT0a+Dys9m2lWFcYyySY7HpOBgAutwWk iPqbHDzcSwzlJM4aRA+tl4VBkoZUMKy0nMXKlhLDXHwD3Dl0LDlqkpeUyBy6RIhEx/IX xGvCrph1Eu+h+6NNvmhR9nZUyC2iBuQMqMQLjIENcETbpqeSoLJySBZ2MCbnt1JELr+e nXc4pStjwNUdtBk8W+ANlby/vbEhMUVVMmO+w7vChBeAu3Bt7tlkHEVY+iMCTIllQ0c1 VHv4rWlEgY2Ku4ptevRGlqxQGJKjrrzsVg0/vRDX+DxGws58SpGHqIfOyzHxSQuu8Joe yDAQ== X-Gm-Message-State: AJIora8m58ORCYg8fMbQzsIxqHYbGeVsAltSBJHD0JaBUGdkcqOvS4Fx ipNMOcSmudcH1Zd8N/bW0z14yiPTsZA5ZoHE6bX8IvVa X-Received: by 2002:a81:5957:0:b0:31c:f620:17ef with SMTP id n84-20020a815957000000b0031cf62017efmr20027196ywb.19.1657563210199; Mon, 11 Jul 2022 11:13:30 -0700 (PDT) MIME-Version: 1.0 References: <03096156-3478-db03-c015-28643479116c@I-love.SAKURA.ne.jp> <48d01ce7-e028-c103-ea7f-5a4ea4c8930b@I-love.SAKURA.ne.jp> <2646e8a3-cc9f-c2c5-e4d6-c86de6e1b739@I-love.SAKURA.ne.jp> In-Reply-To: <2646e8a3-cc9f-c2c5-e4d6-c86de6e1b739@I-love.SAKURA.ne.jp> From: "Rafael J. Wysocki" Date: Mon, 11 Jul 2022 20:13:18 +0200 Message-ID: Subject: Re: [PATCH v2 3/4] PM: hibernate: allow wait_for_device_probe() to timeout when resuming from hibernation To: Tetsuo Handa Cc: Greg KH , Oliver Neukum , Wedson Almeida Filho , "Rafael J. Wysocki" , Arjan van de Ven , Len Brown , Dmitry Vyukov , Linux PM , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 10, 2022 at 4:25 AM Tetsuo Handa wrote: > > syzbot is reporting hung task at misc_open() [1], for there is a race > window of AB-BA deadlock which involves probe_count variable. > > Even with "char: misc: allow calling open() callback without misc_mtx > held" and "PM: hibernate: call wait_for_device_probe() without > system_transition_mutex held", wait_for_device_probe() from snapshot_open() > can sleep forever if probe_count cannot become 0. > > Since snapshot_open() is a userland-driven hibernation/resume request, > it should be acceptable to fail if something is wrong. Not really. If you are resuming from hibernation and the image cannot be reached (which is the situation described above), failing and continuing to boot means discarding the image and possible user data loss. There is no "graceful failure" in this case. > Users would not want to wait for hours if device stopped responding. If the device holding the image is not responding, we should better wait for it or panic(). Or let the user make the system reboot.