Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4932621pxj; Wed, 9 Jun 2021 05:34:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNw2kwYb9p2Xw9p19ggJMPoV+LVjwGXroZ7LmHfkQCFjeEq75f5tQzrifTw2TSvBZr1DgP X-Received: by 2002:a17:907:2149:: with SMTP id rk9mr1185216ejb.229.1623242095870; Wed, 09 Jun 2021 05:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623242095; cv=none; d=google.com; s=arc-20160816; b=e3jFVb0YUUo+tNY57JRqNV3vCjPDdlsOWqAlyN38V6k+V3Ux9mvc1erIcb3TO5iX3F HNdsM74xVBV2OOrdBcK8mAHjbETGfrjAJrFs7tSgE5i9Ddin53wa9VJqsAIb2FwURfEA KStqPormtJ08KuT7lH284uES6K/IT5JS+yPJwrDlSmv5c9D7yp6Ds5nshKhoCrcJGQzr n2m3lSAtHq4piS4S3FNrcZP6l8TcfobY3LcUFG2x+NPkNVXjAGvrm0Vmd3c6+FeyzmHS DpELSoxt61u3kWGJnTxRY296tTvbFd30qom+zlHYaJNb4Kk7SHWkmpSKuglJRDoZQIYO jCyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=3Qx6GI83AR7LB+CtK+AC0k6I27K9aV3jnE8hdc/Ke9E=; b=aIKfB4Z2p4Acf8ljP5U7DZ7W9GC672eRvfvVjTXHU1mxXeA7+w5LKWcJeyhJXXDbLH rgvmZxFgmc9tQNNGlkgdai7Ntn32hFCsgd4+Eu9Q0YZnArn0O62IKm7d2/iFrounXVM3 7cUnntGTe1UIHZSg4ywxOMzxfa+JBjjOCYTeuVW7K2mu9S8bOhcvJTTAy+ODyF3ZVKGC sKIaVZ1al/AE9Q+oJfQecVOzd6BxKivpFjrjRTAlIOpDucbZkP56ELQCRkb7nvLgjJPI xYvdztouCalFELo1bgM/oGlpMkBJ77q9AUylw4Z7xbRHBnlbIgd6WcsZT4s59ivDQQRn GUfQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si2121527eja.729.2021.06.09.05.34.30; Wed, 09 Jun 2021 05:34:55 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232994AbhFIDhf (ORCPT + 99 others); Tue, 8 Jun 2021 23:37:35 -0400 Received: from mail.loongson.cn ([114.242.206.163]:33898 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232787AbhFIDhf (ORCPT ); Tue, 8 Jun 2021 23:37:35 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx70LnNsBgGIANAA--.15141S2; Wed, 09 Jun 2021 11:35:04 +0800 (CST) From: Tiezhu Yang To: Alex Deucher , christian.koenig@amd.com, David Airlie , Daniel Vetter Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Xuefeng Li , Jianmin Lv Subject: [PATCH v2] drm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64 Date: Wed, 9 Jun 2021 11:35:01 +0800 Message-Id: <1623209701-18311-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Dx70LnNsBgGIANAA--.15141S2 X-Coremail-Antispam: 1UD129KBj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ID: X-Mailing-List: linux-kernel@vger.kernel.org On the Loongson64 platform used with Radeon GPU, shutdown or reboot failed when console=tty is in the boot cmdline. radeon_suspend_kms() puts the hw in the suspend state, especially set fb state as FBINFO_STATE_SUSPENDED: if (fbcon) { console_lock(); radeon_fbdev_set_suspend(rdev, 1); console_unlock(); } Then avoid to do any more fb operations in the related functions: if (p->state != FBINFO_STATE_RUNNING) return; So call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64 to fix this issue, it looks like some kind of workaround like powerpc. Co-developed-by: Jianmin Lv Signed-off-by: Jianmin Lv Signed-off-by: Tiezhu Yang --- drivers/gpu/drm/radeon/radeon_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index efeb115..daabbf5 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -386,13 +386,13 @@ radeon_pci_shutdown(struct pci_dev *pdev) if (radeon_device_is_virtual()) radeon_pci_remove(pdev); -#ifdef CONFIG_PPC64 +#if defined(CONFIG_PPC64) || defined(CONFIG_MACH_LOONGSON64) /* * Some adapters need to be suspended before a * shutdown occurs in order to prevent an error - * during kexec. - * Make this power specific becauase it breaks - * some non-power boards. + * during kexec, shutdown or reboot. + * Make this power and Loongson specific becauase + * it breaks some other boards. */ radeon_suspend_kms(pci_get_drvdata(pdev), true, true, false); #endif -- 2.1.0