From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 496E5C433FE for ; Fri, 10 Dec 2021 19:11:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231757AbhLJTPK (ORCPT ); Fri, 10 Dec 2021 14:15:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231135AbhLJTPJ (ORCPT ); Fri, 10 Dec 2021 14:15:09 -0500 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4948CC061746 for ; Fri, 10 Dec 2021 11:11:34 -0800 (PST) Received: by mail-oi1-x22e.google.com with SMTP id bj13so14549510oib.4 for ; Fri, 10 Dec 2021 11:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MCCCrMsD80PYsXI80yfhET4AB8VSWOdySeInd6qTHiw=; b=aBi0zyo1vOOvZtbVw1z0ewL0DB+wpsdif/9QhdpeVGrtx2FKxCx3PyanvopaVMam18 LsNaYYxK9MWHESlmYlzj5cuePZb3rxr2ICfSp9IssOwMeQ/AGLJOBjnH9IEiTb7qbMJl 1wLr74UaWxYx2aKRsmS0I+Cag6qTY8rx3+0de9BOEZDbaavQytFuUAl4ikacxrHA5uL+ jsSYwgX9JiANWLyqTpVbV5DknVCz5LH436HwOZEhqmvHiyMkDtkFCRPHRdh++AczBz0q 6c9hflbFHrmt2+yzUIQ0AQpMXZgwHFaGc8/siXhoKQcoWxbHqsoyxBXqy/DYVu80SdzS Ny0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MCCCrMsD80PYsXI80yfhET4AB8VSWOdySeInd6qTHiw=; b=B6N3EsR2sIgVM6NihzdDTuPnOl9uz2KfvL5xF7GPzENIJ/HNEiPDsr1KVuuGzMNowN 64zW6/mYP2x4zl11dsIxsLr9FgX+1bH+BM5PEZuTiu0Pj2aP6LNFiiboRo8zaO3AHHl/ +HgzQ6rY4lMB0YzjMpTqA9HrkpsepODvGknEFP0ipnTwHt5AmvHetB32u6IHEcNar0ND 4vkYqUEOWltCnZXoTBjh3Ke8gonx6WJF8Xv/tvCM9zjmTQft7RvOxgY7lyRCaMuPvWgy 6m5WX2gL5XNdsEmWaPxg6cZlqD6pw0EVQDb523iKz3EoAUNkoNwfCgwFn+BCCTJZ0Nd3 V7ZA== X-Gm-Message-State: AOAM530ScYn2n9Jyr0oS2b/vdTowV5PiixZzD2y0CEQlJvZsnnKyMDd4 ZOOQfKUYW2+KhN5cbkHPL/X0MEwYwX7spaukKFBgwi6s X-Google-Smtp-Source: ABdhPJznkZHc+/04noUEWFMaObXDPF6FRikbNCHRD5le/cb77UpNIAdmSFl/MsYmSVixh4A3WQ7/OGpzRzZw/YTh/js= X-Received: by 2002:a05:6808:300b:: with SMTP id ay11mr14026975oib.120.1639163493704; Fri, 10 Dec 2021 11:11:33 -0800 (PST) MIME-Version: 1.0 References: <62aab616-53cb-ff9f-c5f3-169c547bd1ee@igalia.com> <6d3c7acf-a23f-3073-56ed-375ccb8cc815@suse.de> <99b38881-8c63-de04-50f8-aa4119b52b25@igalia.com> <56dfb915-036b-0584-f0ef-83c786970d6e@igalia.com> <0847ff12-8b1c-a046-eb05-f0011f81e172@igalia.com> In-Reply-To: <0847ff12-8b1c-a046-eb05-f0011f81e172@igalia.com> From: Alex Deucher Date: Fri, 10 Dec 2021 14:11:22 -0500 Message-ID: Subject: Re: Reuse framebuffer after a kexec (amdgpu / efifb) To: "Guilherme G. Piccoli" Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Thomas Zimmermann , Gerd Hoffmann , "open list:EFIFB FRAMEBUFFER DRIVER" , kexec@lists.infradead.org, amd-gfx list , kernel@gpiccoli.net, Baoquan He , =?UTF-8?Q?Samuel_Iglesias_Gons=C3=A1lvez?= , xinhui pan , Maling list - DRI developers , pjones@redhat.com, "Deucher, Alexander" , Dave Young , Vivek Goyal Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org On Fri, Dec 10, 2021 at 10:24 AM Guilherme G. Piccoli wrote: > > On 10/12/2021 12:13, Christian K=C3=B6nig wrote: > > [...] > > How about issuing a PCIe reset and re-initializing the ASIC with just > > the VBIOS? > > > > That should be pretty straightforward I think. > > > > Christian. > > > Thanks Christian, that'd be perfect! Is it feasible? Per Alex comment, > we'd need to run atombios commands to reprogram the timings, display > info, etc...like a small driver would do, a full init. > You need the equivalent of a GOP driver or a full GPU driver. I think it would be less effort to just fix up any problems amdgpu has when trying to load after the crash than to write a new mini driver. By the time you add everything you'd need, you'd be pretty close to a full GPU driver. > Also, what kind of PCIe reset is recommended for this adapter? Like a > hot reset, powering-off/re-power, FLR or that MODE2 reset present in > amdgpu code? Remembering this is an APU device. You'd need to issue the relevant device specific reset sequence. It would be a mode2 reset on vangogh, but varies on other asics. It would probably be easiest to just fix up the logic in amdgpu to detect bad GPU state on driver load and do a GPU reset before driver init. We already have the logic in place for some dGPUs, but APUs only recently got full GPU reset support due to architectural limitations and hardware bugs. Alex From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29AB6C433EF for ; Fri, 10 Dec 2021 19:11:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6332B10EC88; Fri, 10 Dec 2021 19:11:36 +0000 (UTC) Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5AB5F10EC82; Fri, 10 Dec 2021 19:11:34 +0000 (UTC) Received: by mail-oi1-x233.google.com with SMTP id u74so14475903oie.8; Fri, 10 Dec 2021 11:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=MCCCrMsD80PYsXI80yfhET4AB8VSWOdySeInd6qTHiw=; b=aBi0zyo1vOOvZtbVw1z0ewL0DB+wpsdif/9QhdpeVGrtx2FKxCx3PyanvopaVMam18 LsNaYYxK9MWHESlmYlzj5cuePZb3rxr2ICfSp9IssOwMeQ/AGLJOBjnH9IEiTb7qbMJl 1wLr74UaWxYx2aKRsmS0I+Cag6qTY8rx3+0de9BOEZDbaavQytFuUAl4ikacxrHA5uL+ jsSYwgX9JiANWLyqTpVbV5DknVCz5LH436HwOZEhqmvHiyMkDtkFCRPHRdh++AczBz0q 6c9hflbFHrmt2+yzUIQ0AQpMXZgwHFaGc8/siXhoKQcoWxbHqsoyxBXqy/DYVu80SdzS Ny0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=MCCCrMsD80PYsXI80yfhET4AB8VSWOdySeInd6qTHiw=; b=ssWILijMgWRHdRF/iLP3suXaQgS6QXBCrxscBRJfCAREptAGdSbHQnUvrosiSZxrkl TvvPkK0OZWAKSWTEwCm02INXWpmU4XGIHMBoTWv0bHPgHVc43ZCrexZpr1CVVjnyD79G 0qYb2Z4PsZbkapBeE9NNlznHmpXBOGtI6vZbtL5gz6hYygIR2jKBPVngfDyKTL06+wbr hGL3wSUZnk67J8wklm8LWScWPdUrNOsyeIIMWb5L3Cxeq87cIIIU7uQgMghZ2SZyUgMX VwwlEgHCUO3moJfMMYTf8+BNX8Bm6MAbXj4XFZ01xLIjmF0zeUR37ZBXY7a2q53pSJRD mw5w== X-Gm-Message-State: AOAM531j6+dE7f79w5DeAcJ7t2X3bXD58J8h2tjvhIWC5NjG83NtzyG0 mbtuWp/je0olshYwVdYVRRZD8/gvkBNQTBLgRi4= X-Google-Smtp-Source: ABdhPJznkZHc+/04noUEWFMaObXDPF6FRikbNCHRD5le/cb77UpNIAdmSFl/MsYmSVixh4A3WQ7/OGpzRzZw/YTh/js= X-Received: by 2002:a05:6808:300b:: with SMTP id ay11mr14026975oib.120.1639163493704; Fri, 10 Dec 2021 11:11:33 -0800 (PST) MIME-Version: 1.0 References: <62aab616-53cb-ff9f-c5f3-169c547bd1ee@igalia.com> <6d3c7acf-a23f-3073-56ed-375ccb8cc815@suse.de> <99b38881-8c63-de04-50f8-aa4119b52b25@igalia.com> <56dfb915-036b-0584-f0ef-83c786970d6e@igalia.com> <0847ff12-8b1c-a046-eb05-f0011f81e172@igalia.com> In-Reply-To: <0847ff12-8b1c-a046-eb05-f0011f81e172@igalia.com> From: Alex Deucher Date: Fri, 10 Dec 2021 14:11:22 -0500 Message-ID: Subject: Re: Reuse framebuffer after a kexec (amdgpu / efifb) To: "Guilherme G. Piccoli" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:EFIFB FRAMEBUFFER DRIVER" , xinhui pan , Maling list - DRI developers , Baoquan He , =?UTF-8?Q?Samuel_Iglesias_Gons=C3=A1lvez?= , kernel@gpiccoli.net, kexec@lists.infradead.org, amd-gfx list , pjones@redhat.com, Gerd Hoffmann , Thomas Zimmermann , "Deucher, Alexander" , Dave Young , =?UTF-8?Q?Christian_K=C3=B6nig?= , Vivek Goyal Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Dec 10, 2021 at 10:24 AM Guilherme G. Piccoli wrote: > > On 10/12/2021 12:13, Christian K=C3=B6nig wrote: > > [...] > > How about issuing a PCIe reset and re-initializing the ASIC with just > > the VBIOS? > > > > That should be pretty straightforward I think. > > > > Christian. > > > Thanks Christian, that'd be perfect! Is it feasible? Per Alex comment, > we'd need to run atombios commands to reprogram the timings, display > info, etc...like a small driver would do, a full init. > You need the equivalent of a GOP driver or a full GPU driver. I think it would be less effort to just fix up any problems amdgpu has when trying to load after the crash than to write a new mini driver. By the time you add everything you'd need, you'd be pretty close to a full GPU driver. > Also, what kind of PCIe reset is recommended for this adapter? Like a > hot reset, powering-off/re-power, FLR or that MODE2 reset present in > amdgpu code? Remembering this is an APU device. You'd need to issue the relevant device specific reset sequence. It would be a mode2 reset on vangogh, but varies on other asics. It would probably be easiest to just fix up the logic in amdgpu to detect bad GPU state on driver load and do a GPU reset before driver init. We already have the logic in place for some dGPUs, but APUs only recently got full GPU reset support due to architectural limitations and hardware bugs. Alex From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvlIs-003QZz-Mm for kexec@lists.infradead.org; Fri, 10 Dec 2021 19:11:36 +0000 Received: by mail-oi1-x231.google.com with SMTP id bf8so14523408oib.6 for ; Fri, 10 Dec 2021 11:11:34 -0800 (PST) MIME-Version: 1.0 References: <62aab616-53cb-ff9f-c5f3-169c547bd1ee@igalia.com> <6d3c7acf-a23f-3073-56ed-375ccb8cc815@suse.de> <99b38881-8c63-de04-50f8-aa4119b52b25@igalia.com> <56dfb915-036b-0584-f0ef-83c786970d6e@igalia.com> <0847ff12-8b1c-a046-eb05-f0011f81e172@igalia.com> In-Reply-To: <0847ff12-8b1c-a046-eb05-f0011f81e172@igalia.com> From: Alex Deucher Date: Fri, 10 Dec 2021 14:11:22 -0500 Message-ID: Subject: Re: Reuse framebuffer after a kexec (amdgpu / efifb) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: "Guilherme G. Piccoli" Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Thomas Zimmermann , Gerd Hoffmann , "open list:EFIFB FRAMEBUFFER DRIVER" , kexec@lists.infradead.org, amd-gfx list , kernel@gpiccoli.net, Baoquan He , =?UTF-8?Q?Samuel_Iglesias_Gons=C3=A1lvez?= , xinhui pan , Maling list - DRI developers , pjones@redhat.com, "Deucher, Alexander" , Dave Young , Vivek Goyal T24gRnJpLCBEZWMgMTAsIDIwMjEgYXQgMTA6MjQgQU0gR3VpbGhlcm1lIEcuIFBpY2NvbGkKPGdw aWNjb2xpQGlnYWxpYS5jb20+IHdyb3RlOgo+Cj4gT24gMTAvMTIvMjAyMSAxMjoxMywgQ2hyaXN0 aWFuIEvDtm5pZyB3cm90ZToKPiA+IFsuLi5dCj4gPiBIb3cgYWJvdXQgaXNzdWluZyBhIFBDSWUg cmVzZXQgYW5kIHJlLWluaXRpYWxpemluZyB0aGUgQVNJQyB3aXRoIGp1c3QKPiA+IHRoZSBWQklP Uz8KPiA+Cj4gPiBUaGF0IHNob3VsZCBiZSBwcmV0dHkgc3RyYWlnaHRmb3J3YXJkIEkgdGhpbmsu Cj4gPgo+ID4gQ2hyaXN0a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