Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp19461rwe; Thu, 13 Apr 2023 21:17:00 -0700 (PDT) X-Google-Smtp-Source: AKy350aumJBY0pAYFZQUc4rzjSGrU/OqJFD8pgtFsF0aFwyHQWLEiNVi1bepHSLCp1tnEYica+bG X-Received: by 2002:a17:902:ceca:b0:1a6:5332:25b with SMTP id d10-20020a170902ceca00b001a65332025bmr1536955plg.42.1681445820291; Thu, 13 Apr 2023 21:17:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681445820; cv=none; d=google.com; s=arc-20160816; b=ziDUWEiWNGhhHouRawIRPOhevnFcJpV1O0kW0iYeYmRxEqH2GhuJL2uGrEIFaY3XAQ 1Jp/l+udWuoVDjiyavFocbZRKru3U43HXy4oUDAckWK/ttmHKptGpoS0lTshPzpOA/W9 SAjiLH1QIuA6xHXxZuoqOLZZ0zZ3Gqz4YHkAw8cQ2vUP871H94iKouAUZhGoCalCJuJ0 3Q87LV++PTR8BbHSyi1BrHpMrbVPsu+P8nmHp/G7pujwuiGtRwfY0Za3rZ58B893QGFS hNgLtdMuKveGCY40yqFxxZQXlOMr9YVZZwiynxISDWIC37S0L0SXLYgn/Np6XehcFVxZ CgpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=7Q0orXZao0HEOdQ5cjS4IbC7rZKK6fSLaKvHlHab5/E=; b=A9JyPqnz7COMD4v+XFLAqjCF9brKjIJqE8FSIshYzQCO7p78ecvBn1i0xww8CyIaFq 8me2pXUcaZmMq4XhXZkuh+wfaf2XHR9QAL6358OQsHLZZUD5FZrChfbo5tM8C0HgAyBp yxeE6X9M6q9sHfk4agTk3fB7uMLYwPw8/w3XDHqE4SMa66FOQeWh95uWsCCcDYCTJMLJ lUqUy+7mK8MtsiD4iw0Yg3Ky29I0Aa9qCvjd4v+BgClKr9uAp2k0yqFSVKUkPwowk20A La0x3A3u3ZQkV4SlKSlVZ2ONqt4C1R1DWZ4IAhsh4NFmj465p57UXyoOoM5jdCfkAAto o12A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LchK71ym; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a170902f68300b0019ac13b77efsi3858605plg.158.2023.04.13.21.16.46; Thu, 13 Apr 2023 21:17:00 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=LchK71ym; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbjDNEOZ (ORCPT + 99 others); Fri, 14 Apr 2023 00:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbjDNEOX (ORCPT ); Fri, 14 Apr 2023 00:14:23 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC9CE210B; Thu, 13 Apr 2023 21:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681445660; x=1712981660; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ilHX1TUJOSQR7mRe4+AEDRbkMzycBg1B0YKXxtFmyHw=; b=LchK71ymk2b8Tpsc5NIIb3YqngpYoKXaArF4MSbA/9ZciMU6OQ3wVexg 0kJs2Cthj2lRUfgIY6en6oKlRH17WC7GdoIF2UfL6b7eCAMQGb7G7tA0T CxKeQoWOtyw9qotKYalk9Ylin0r4XPsF844z+z/ULu27l7W3do7jRakI1 KaByojNSSZvR8/tNC89PjgPPxzX1mNIJk9qQ5b0k5sIWyR+r0XD19LEhg jfrQJN7Re1ST5UUsCS4H1yS3xCCEYZJOAaEwQQ/QNb8f1oUoRWW1GZVfU LkAkk66uGtiA63u1Y/FR2ga246fQvA07uDB9vX8SMdy8x6tuvZrYFXZPZ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="343138350" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="343138350" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 21:14:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="683194742" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="683194742" Received: from chenyu-dev.sh.intel.com ([10.239.158.170]) by orsmga007.jf.intel.com with ESMTP; 13 Apr 2023 21:14:18 -0700 From: Chen Yu To: "Rafael J. Wysocki" , Len Brown Cc: Ye Bin , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Pavankumar Kondeti , Yifan Li , Chen Yu Subject: [PATCH v3 0/2] Fix test_resume failure by openning swap device non-exclusively Date: Fri, 14 Apr 2023 20:10:11 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 test_resume does not work in current kernel when using swapfile for hibernation. This is because the swap device should be openned non-exclusively in test_resume mode. Patch 1 is a preparation to turn snapshot_test into a global variable. Patch 2 is the fix to open swap device non-exclusively only for test_resume mode. Change since v2: Adjust the initialization of fmode and refine the commit message per Rafael's suggestion. Change since v1: Turn snapshot_test into global variable and do not introduce parameters for swsusp_check() nor load_image_and_restore(). Chen Yu (2): PM: hibernate: Turn snapshot_test into global variable PM: hibernate: Do not get block device exclusively in test_resume mode kernel/power/hibernate.c | 15 ++++++++++++--- kernel/power/power.h | 1 + kernel/power/swap.c | 8 ++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) -- 2.25.1