Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp712962pxv; Thu, 15 Jul 2021 14:11:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWPQYTghLxb834m+muruUS0KcPBEoNYQqk1U/40Okrijs0TcJgWia2m7qkD2g4/dog1g3h X-Received: by 2002:a17:906:c7d6:: with SMTP id dc22mr7713352ejb.517.1626383500768; Thu, 15 Jul 2021 14:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383500; cv=none; d=google.com; s=arc-20160816; b=d7dIuxDOtVeWpgcocVDivNrRp7w/usyHDQgIw3Hs70gocXAzdDZA9BDf09RtyShXjk /UqusqNmqaRszr6rYlcwuVRtv4lspghIFu/5Nzfw1S345eXCSRXsj4x7eEUNxMFOcX/V 1NGTTgatI7wdr27kyE4Smz8N2LtFyPgv05m7tdLoPjpM2X+8k9TCKk5Qp5qXjhqZUIiG zrOEglNcTt5V0nF436JAIL8qTvzciLTZS5oIDHkAFdBeOBvZm9LXLUlh+EOAElPdvmwp xuaRr5BkwxIR8ESCAO8/nC3uCqkFGieuxYGSaoSdy1qNrliowsg/YZYS+sOHO3SbHnMW od8g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5ePlV8eZqRHjYx3ZMKU5pCqSDNqszFqpE3VGvSfa9ME=; b=GjrIg+0b5Vac/LE+1zReAVIhpVEZmcvfa/+kck4fqJeoDnc9Gos1SdEUM4Qad/EMER fZ9qyMwpUx6SdWz0/SakFG0F1pLbNZW6OLknVlCzXKlJyVGiZv9NW9lzK45ppcmtkCcp phF4iSu3y3QfcxhsmCCRsCNfaNPwtuBCRk8JHHNoHq7AfCM3GKWx1bywLBjmmxiEIS0z 9sH+s5/hJ1+qkuT8XIiQ7G+ochV+ag/GVTKR7ATgYfiBkGz1A4S5wzt02qfWs6ypkulk tm0uSTdx+wqRQ58Y/PRNxRTYxnP1oWE+PsA+VpLA0S5d1wGrAWCQ8BR0vU6Bpb88JjM0 SK0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C4apIq1S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc17si8501968edb.517.2021.07.15.14.11.15; Thu, 15 Jul 2021 14:11:40 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C4apIq1S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240660AbhGOTVv (ORCPT + 99 others); Thu, 15 Jul 2021 15:21:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:39498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240432AbhGOTFp (ORCPT ); Thu, 15 Jul 2021 15:05:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D39C613E0; Thu, 15 Jul 2021 19:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375724; bh=a9XVL2KJ0JroVTPxy1S9ksp1mr+U+sM7H6KVZIxwG1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C4apIq1SL3sL0lwzndN9oFSDeh7+lRMAXEPy1xW4BV6VpntruwdvH0cIsgcL6wW7D wgtY+/uErrQ4KmEnPIGGQsaR9Jph4pLF4LKr7cSfwyAabZmNpwVCSDWYzKa+7IjmB3 K7ZcXRh2u4a6ijj15a/BNlEEj2YH662vbSatdMO0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jianmin Lv , Tiezhu Yang , Alex Deucher Subject: [PATCH 5.12 167/242] drm/radeon: Call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64 Date: Thu, 15 Jul 2021 20:38:49 +0200 Message-Id: <20210715182622.693834717@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tiezhu Yang commit c1bfd74bfef77bcefc88d12eaf8996c0dfd51331 upstream. 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 Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/radeon/radeon_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- 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 because + * it breaks some other boards. */ radeon_suspend_kms(pci_get_drvdata(pdev), true, true, false); #endif