Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5264551rwl; Tue, 11 Apr 2023 02:58:45 -0700 (PDT) X-Google-Smtp-Source: AKy350ZoGH7nu61CvT/ngVkAzgkPm2C4Nmqc7HMY9ggEQ33Uvgdc1Gk7t06YaEB6MgLOlDJcpz00 X-Received: by 2002:aa7:d741:0:b0:4fc:9c79:86bc with SMTP id a1-20020aa7d741000000b004fc9c7986bcmr13464276eds.42.1681207125718; Tue, 11 Apr 2023 02:58:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681207125; cv=none; d=google.com; s=arc-20160816; b=h9xUaCtBmVc1HYZvir28CoQ5WFwC/c0lzbl+Jw6SuARLwr9U74i4BTicmPhpz6yXmo uyyOAW0U63r5m8Icn3Sf/5V2aeMTKFYkRpBsQxLq7VLw6S/wNg5mqTfD1Hfc73paJsA+ IZPfZy1aRwjZYIk2e58O9f84/9Ili9JfLPrlWtXuioEsOCs/Z7/AVutA+5389UB7osGP FWQr6ivg825AjpGKE0g7ON0h6uXuJHpTb1heaR1XRemFzidVr/L1bisPpOS5sM0TQsOh xftGjT2zjIjEMm15iDbGXwqBb6BBbOsKbzJ9aG4B/KoztYteOBhmnh9/5UmSzCm+qWZJ QjAg== 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; bh=TjdibkQAoy8+zrNzVTzJd7kT6ZkOLIRYt8S7Ld86efw=; b=k2CNXCm5wz0QmKigPqWj28r759brPrQgcHAd5oA8Qn7GjNbMS6M9YUN/9BEPAeuTqV GR4R2NSDLprk12lnbqfveMYRRo9h0FuJ9DGPIkFf731mjhsedBg3/Vdl4hBcInKMJyJD hEzDw3l8yyQyru5isum9ks/c2e1N6VB03Nvys9TYUAPKkL23CzQkMuqAl98k51rrdTk/ AnVwlU81TPLAl/pTAd5enmxQdTuf5V3amjc10aApr2Wxiz/qLVnTIYGE7dkRYNVgVw0Y O772x4g9OkDOzPuUA5OxVNVlXE3HxRNRu9ERxHFnA6FxNqNk25gYCjHa7CKCq9DkVOzz Q7mA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tj5-20020a170907c24500b00930f5af3877si333611ejc.343.2023.04.11.02.58.21; Tue, 11 Apr 2023 02:58:45 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbjDKJuu (ORCPT + 99 others); Tue, 11 Apr 2023 05:50:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjDKJub (ORCPT ); Tue, 11 Apr 2023 05:50:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00CBC10E5; Tue, 11 Apr 2023 02:50:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8D0B462377; Tue, 11 Apr 2023 09:50:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C48AC433D2; Tue, 11 Apr 2023 09:50:26 +0000 (UTC) From: Huacai Chen To: Arnd Bergmann , Huacai Chen Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, Huacai Chen , Baoqi Zhang Subject: [PATCH] LoongArch: Enable PG when wakeup from suspend Date: Tue, 11 Apr 2023 17:49:59 +0800 Message-Id: <20230411094959.3368451-1-chenhuacai@loongson.cn> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 Some firmwares don't enable PG when wakeup from suspend, so do it in kernel. This can improve code compatibility for boot kernel. Signed-off-by: Baoqi Zhang Signed-off-by: Huacai Chen --- arch/loongarch/power/suspend_asm.S | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/loongarch/power/suspend_asm.S b/arch/loongarch/power/suspend_asm.S index 90da899c06a1..e2fc3b4e31f0 100644 --- a/arch/loongarch/power/suspend_asm.S +++ b/arch/loongarch/power/suspend_asm.S @@ -80,6 +80,10 @@ SYM_INNER_LABEL(loongarch_wakeup_start, SYM_L_GLOBAL) JUMP_VIRT_ADDR t0, t1 + /* Enable PG */ + li.w t0, 0xb0 # PLV=0, IE=0, PG=1 + csrwr t0, LOONGARCH_CSR_CRMD + la.pcrel t0, acpi_saved_sp ld.d sp, t0, 0 SETUP_WAKEUP -- 2.39.1