Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4975169rwl; Mon, 10 Apr 2023 21:23:41 -0700 (PDT) X-Google-Smtp-Source: AKy350ac2nBdLxbgCURDcOCjBBZgdcP5jxv5R2II2eam0XDS9WCSIb4aDm6l74C7x1ifXr57Z0iQ X-Received: by 2002:a17:907:376:b0:94b:958c:8827 with SMTP id rs22-20020a170907037600b0094b958c8827mr3482379ejb.56.1681187021171; Mon, 10 Apr 2023 21:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681187021; cv=none; d=google.com; s=arc-20160816; b=HDy0STT4mHB3YHwchYCdHyhdbtliMi91ZmfT7PG2eXWKeRYmX+jJmvDN3rGCoYyWYe fl+2ut7vlO+z6p0vA60RECH1iTzP7FNQBLJZPSBnlj63TnhcOw6JYWEp3Ul/Tcj6mPs4 krRoNPmdYIfgI3JzKR76uWIpn0/Hp9vJrOq5aD6i0ukUPSE0tC5/zcdpKT0w7zI6pEG+ Teh8qOF5yHhmvJwWvLD/7G+fzt2tY9UxEaxJdtZqnogCTPU5MgrNgjM4H0f4Qnq/zbRP ASGV1IyijLr4M3hEVyCJvV3d9YKVTw4puOR82IL9fZTJKaSchmAKw0/XQhbWwJ3jSRKk fgKA== 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=UWhAgCfzcEs0xAq14wh6WsvcIAc/6eVA0Unu+paNt9g=; b=QHPYMsrz0V1cIJlck9rKdu+HT7tgBfDYo9tmV0bD6LKkihGNoDKD29YSIfKoehDYj6 wXiv8iB5VwVYgZMbd2w2Sb75d0WMOhIYRaiSdBZSBaj+RWBGnNyCSsegKuxLcaLrk6An TRt/EVv5fccU9RanYwlDaH4RvUui/UEykclty2qp6CKqdgnRq8tFVFHth7R1OWz6H9vx nvC1Al7wkiAUv7MRiFOYbezXMfIObthuWT0Dmifwu3wuTcsEy0nJHbG1lOXO2R511crc a7+M+RxE9SZKjBJqRC3Ae2EBQ3bCoycwzeRXLHnngfyP7n0/lpzZggAPtv4KFYC8hil5 XO7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NNLM5lqE; 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 h17-20020aa7de11000000b005048c65e064si7070189edv.452.2023.04.10.21.23.16; Mon, 10 Apr 2023 21:23:41 -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=NNLM5lqE; 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 S229982AbjDKEW5 (ORCPT + 99 others); Tue, 11 Apr 2023 00:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229694AbjDKEWy (ORCPT ); Tue, 11 Apr 2023 00:22:54 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35D111BF0; Mon, 10 Apr 2023 21:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681186973; x=1712722973; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hmE/4fx0REVbtNDLwDAGT/41Nij4JlBZargTHRs5SMU=; b=NNLM5lqExyNQdiOXoAQ44/Ux3z5JrwmUaEtRZcW+gUWM/mzPJwjhADmC RmL6k3WHGvcxIOLuIn1L6yoqQ9sJ86dTRMMfDO7iToU4UxKC4GYpDCbqJ yTEHOQYtUEyi50xFQJTf/cH6e4phY/1KQNWfIHTpjBhizap40gNFKSKUM 9AzXNITkTo4l7PD4ya3I/lRBK8Nd6oJsudrr0dGVmhRx8anOjLEil6Mzn D8kfV7T4ia7kw0m//rlqtmcnBxH63qGiyMQb9TFXxBA9zbI1EPW8VOMTw 3SzjoW34pZw2j4LFJ9OgZzGdthWIeusYvDOrJhbW/id8Oc43KopA9qeaq w==; X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="341010163" X-IronPort-AV: E=Sophos;i="5.98,335,1673942400"; d="scan'208";a="341010163" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2023 21:22:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10676"; a="721045362" X-IronPort-AV: E=Sophos;i="5.98,335,1673942400"; d="scan'208";a="721045362" Received: from chenyu-dev.sh.intel.com ([10.239.158.170]) by orsmga001.jf.intel.com with ESMTP; 10 Apr 2023 21:22:50 -0700 From: Chen Yu To: "Rafael J. Wysocki" , Len Brown Cc: Ye Bin , Pavankumar Kondeti , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Yu Subject: [PATCH v2 0/2] Fix test_resume failure by openning swap device non-exclusively Date: Tue, 11 Apr 2023 20:18:43 +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=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=unavailable 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 for patch 2 and it turns snapshot_test into a global variable. Patch 2 opens swap device non-exclusively for test_resume mode, and exclusively for manual hibernation resume. 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 | 12 +++++++++--- kernel/power/power.h | 1 + kernel/power/swap.c | 5 +++-- 3 files changed, 13 insertions(+), 5 deletions(-) -- 2.25.1