Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4596109pxj; Tue, 8 Jun 2021 19:11:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgsgzMI1cdebAwIOfuB/iAM977faq3zon+aPNBlgCW+yvc+iyyzvYDWluN4RoGN3pX0ZNK X-Received: by 2002:a17:907:33d0:: with SMTP id zk16mr26160139ejb.144.1623204714873; Tue, 08 Jun 2021 19:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623204714; cv=none; d=google.com; s=arc-20160816; b=cBTzYnKAtmMetk+iVPwU03hVn8c6kKQlFJKuGA3DipM8UnTXsgThJMNitqC08kNkrs DAcb2yBpoeq/R0JRJuwdKub3J5xk2U1oUhPpBdUo54qDOCI8W/AQJrJeDPjgRdiT0ghH ABiYKQeFZwHMt4g+WSFcbgr4PhZWjpKiLilVHjLmeTZWZTGLOa4w3POBB2INxG2xSpvf pUrNvSuxvAv9zUz8LFsT+/xgdGEi/Nw0DO8V6YRP+2oHghN3XbeameDr2jIaclu+5LHr gZgh9Pn1bUINKtN4o1/mjTyoDr0yldnY8VclOnd/aMjBxEXm+XDeZEX8VKlmw+pYb4/y wTMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YOoJEAvOVqbK4v61piMRQZKD7D+2Wxv5vNkMO12sWiQ=; b=sXNRZjv73g2HZGrGANb5BawfSr/JKTG+eXsFOPk6y2Nzj5AiANvubUVVT2Et8BXZ2b vzf7tED3dCO6jvf4vQkITrP+6R6ylaQht0NIYjRpDmYpZ0v1XVtMC0Zs2aO5V8czBIbB d1UO0JHyEl7+amQREmvCM+k4Zs+xdTA8wVzBeaPxjeMljWCij/uhkvuDw7y1PYVXOJQn q2jpCDzntji8+3VICRufLgLtLFZA+qfnL0L6JWK+8L3/ZyZNeQZppNPkD2lj9iRgMJxz qeHws2M/nyDi3DmDz00SBjyTOrSNc9uDaHmfrz8OtUoFeWj1XIBTRsPf+W01eUDq7qpX eYhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lp04WpJQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si1173619ejr.218.2021.06.08.19.11.30; Tue, 08 Jun 2021 19:11:54 -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=@gmail.com header.s=20161025 header.b=lp04WpJQ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233546AbhFHO4L (ORCPT + 99 others); Tue, 8 Jun 2021 10:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233288AbhFHO4K (ORCPT ); Tue, 8 Jun 2021 10:56:10 -0400 Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 021B0C061574 for ; Tue, 8 Jun 2021 07:54:18 -0700 (PDT) Received: by mail-oi1-x235.google.com with SMTP id t40so8767290oiw.8 for ; Tue, 08 Jun 2021 07:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YOoJEAvOVqbK4v61piMRQZKD7D+2Wxv5vNkMO12sWiQ=; b=lp04WpJQ5cFn5howqG+MuDdJmNjwz8GlRj1bvoRTW/1I82dmb2yowy8E3iTj5P2fK1 mJCMvw2jkZq7wEuGTj2c9Gfryglr6XrC3y6ONNynB7tR+ixr4p8DGlTPJXNTcvINFB/b RsvE8qxy/Hgu5wsPSlEDQbHSgI5Emy8/3GoZf0dMzrGi/d9nrOu5jqpa4xzzxyQVUlsp l+dnGZF2k0aWDYhh3TZ3w7Lc8/TbQrHzIommbszYqPYXkgYtdjnMGBBO713Jijdy5C7R 2qOV0ci+YShmXDfSL9uhhkf3g7eEll6wpaP7r4OsGr9Bq5c+PUHJV9YIZSVQHDgA5MLm HrYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YOoJEAvOVqbK4v61piMRQZKD7D+2Wxv5vNkMO12sWiQ=; b=OU2p72d5gRPy8WCctFzblYGamUDSKZzH3+pnHLX7rrBcKpcEPDuogveuOlKMm8G0Mu 7lsN7ZhzH8k8bSuf+b0kyrqUWLQCdiSlRYxJzrMLJTucCLmzulWIZjzObg0Od2j9wxUW 2EwtTGWGHK4y1yVgn1Fl78zbYM011fBvbJokX6rV33JA+8dK1HCOMSjLHj6hlCEKgsBj xfXRkDDNMExzXZw7iaq5eLX3Y742GuahOcSMuzV5lkOOID2VHEGzp7qHdfRQflz1wtSM pek+NEYrBkBSj51EJTWpCk9yJSA9LvnmZkbxcXTyLErrgRxxDV3EDoVJKKIqRC2HwFID IjIw== X-Gm-Message-State: AOAM531Y6dGF5U582w38MdExtCYZ5JkiU7Qq86lDT6+2Tzh9CIFLOXoT yNdpOiilQwRut6szZ62MP2lOzDqLgqFBH4MNCE8= X-Received: by 2002:a05:6808:249:: with SMTP id m9mr3105250oie.120.1623164056486; Tue, 08 Jun 2021 07:54:16 -0700 (PDT) MIME-Version: 1.0 References: <1623068820-2479-1-git-send-email-yangtiezhu@loongson.cn> <0d1b517f-797f-e87d-4edd-8474b16993ed@amd.com> <31de1f2e-5030-3a01-782b-df659d0d2869@loongson.cn> In-Reply-To: <31de1f2e-5030-3a01-782b-df659d0d2869@loongson.cn> From: Alex Deucher Date: Tue, 8 Jun 2021 10:54:05 -0400 Message-ID: Subject: Re: [PATCH] drm/radeon: Always call radeon_suspend_kms() in radeon_pci_shutdown() To: Tiezhu Yang Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Alex Deucher , David Airlie , Daniel Vetter , Jianmin Lv , Xuefeng Li , Maling list - DRI developers , amd-gfx list , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 7, 2021 at 10:26 PM Tiezhu Yang wrote: > > On 06/07/2021 09:42 PM, Alex Deucher wrote: > > On Mon, Jun 7, 2021 at 8:30 AM Christian K=C3=B6nig wrote: > >> Am 07.06.21 um 14:27 schrieb Tiezhu Yang: > >>> radeon_suspend_kms() puts the hw in the suspend state (all asics), > >>> it should always call radeon_suspend_kms() in radeon_pci_shutdown(), > >>> this is a normal cleanup process to avoid more operations on radeon, > >>> just remove #ifdef CONFIG_PPC64 and the related comments. > >> Well NAK. > >> > >> Alex knows more about the details but suspending should not be part of > >> the pci shotdown process at all. > >> > >> We just add that here to enforce a GPU reset on PPC64 boards for some > >> reason. > > Everything in the comment still applies. > > > > Alex > > Hi Alex and Christian, > > Thanks for your quick reply. What do you think of the following changes? > If it is OK, I will send v2. If no, please ignore it. > > Any comments will be much appreciated. Looks fine. Please send it out. Alex > > Thanks, > Tiezhu > > > Subject: [PATCH] drm/radeon: Call radeon_suspend_kms() in > radeon_pci_shutdown() for Loongson64 > > On the Loongson64 platform used with Radeon GPU, shutdown or reboot faile= d > when console=3Dtty 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 !=3D FBINFO_STATE_RUNNING) > return; > > So call radeon_suspend_kms() in radeon_pci_shutdown() for Loongson64 to f= ix > 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 >