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 468B8C05027 for ; Mon, 6 Feb 2023 08:41:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229960AbjBFIlf (ORCPT ); Mon, 6 Feb 2023 03:41:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229939AbjBFIl2 (ORCPT ); Mon, 6 Feb 2023 03:41:28 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EF4915CA8 for ; Mon, 6 Feb 2023 00:40:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675672855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=roTV3VmW5X0JgyWd8+N9XcQz3DnWn4LG2jD8zZdvfpc=; b=idl7XTOLFPpOtZuFPT+E2YIDftJh8S/J3iaV++14sQqNjG1tYTF/u11RIt5HBUA9H1UfMm 4ip+SQZ5j6udgUMxqdy1gjBSCHiB4MMztnRRDp6Pn1WTwgiZ5hCEae40clkYwzLFul2BnJ wZpnauY5DYg0B4tObsBEj7NcTBA3f7Q= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-31-xMCI-w8JNfCCp6tMuzyoOw-1; Mon, 06 Feb 2023 03:40:54 -0500 X-MC-Unique: xMCI-w8JNfCCp6tMuzyoOw-1 Received: by mail-qk1-f198.google.com with SMTP id a6-20020a05620a102600b00729952b4c73so7330418qkk.6 for ; Mon, 06 Feb 2023 00:40:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=roTV3VmW5X0JgyWd8+N9XcQz3DnWn4LG2jD8zZdvfpc=; b=ahvn6zGPhb3DuLQ6nTrCDJ+MewzvmnVJpmPx69O7LosErFLm+1GGekuIBFRFZkcD5V bwh7A3fGO3+A9qiWDyQEsZ3UbHZ7Tz5RiSldnawPzVaFGkNKl6MAPoylZtDRLnxPnl4+ MDHjBynVcbIsrpVFShIhXH6F1Y90+frC1SOAHOh+X2uowvrg7cGjqjXjsYAX6WSWJ25B Zj6VtFJyTemNPnWH3L+GrKfIWNC6m9S2kO9e63+/eLuxs/1PcSGVdL9KErJE0AsG1M80 wbUS55lAfg2I9oEbN5GzeOk0jaEOd9J9J1FFyIzVeBG3nT1vnmTZnQ7nALc9mm+Yk3G+ tUrQ== X-Gm-Message-State: AO0yUKXTcVIUusBIAOO9SGGSCD0jkV82CfcspBo0TLI6wY8YJ/5lwxqK URqOUq1XOHJF4UKLho7eQJoQvcuj60OmwXPouJwvem4jGh4lQRwcrdlmYXInX9K0VdQ0/lOEbCo L9pGZRAdWPWyl4dBnaK7ybYKm5hnTTR13+yf5SNK1 X-Received: by 2002:a05:620a:a95:b0:725:1245:9cea with SMTP id v21-20020a05620a0a9500b0072512459ceamr1144350qkg.233.1675672853997; Mon, 06 Feb 2023 00:40:53 -0800 (PST) X-Google-Smtp-Source: AK7set/AyyLKWKC0Tzhd4X1sVhMpuQEy8NmHdpvAo+907dt4f/zUYiFlzaghQWvc33xB0w4f6AglGqNdHIJCw287vv0= X-Received: by 2002:a05:620a:a95:b0:725:1245:9cea with SMTP id v21-20020a05620a0a9500b0072512459ceamr1144344qkg.233.1675672853645; Mon, 06 Feb 2023 00:40:53 -0800 (PST) MIME-Version: 1.0 References: <20230205210751.3842103-1-airlied@gmail.com> In-Reply-To: From: David Airlie Date: Mon, 6 Feb 2023 18:40:42 +1000 Message-ID: Subject: Re: [PATCH] nvidiafb: detect the hardware support before removing console. To: Zeno Davatz Cc: Dave Airlie , Bjorn Helgaas , Bjorn Helgaas , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: multipart/mixed; boundary="0000000000003403e205f403fd13" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000003403e205f403fd13 Content-Type: text/plain; charset="UTF-8" On Mon, Feb 6, 2023 at 6:38 PM Zeno Davatz wrote: > > Dear Dave > > On Mon, Feb 6, 2023 at 9:10 AM Dave Airlie wrote: > > > > On Mon, 6 Feb 2023 at 18:01, Zeno Davatz wrote: > > > > > > Dear Dave > > > > > > On Mon, Feb 6, 2023 at 8:54 AM Dave Airlie wrote: > > > > > > > > On Mon, 6 Feb 2023 at 17:52, Zeno Davatz wrote: > > > > > > > > > > Dear Dave > > > > > > > > > > Thank you for your patch. > > > > > > > > > > On Sun, Feb 5, 2023 at 10:07 PM Dave Airlie wrote: > > > > > > > > > > > > From: Dave Airlie > > > > > > > > > > > > This driver removed the console, but hasn't yet decided if it could > > > > > > take over the console yet. Instead of doing that, probe the hw for > > > > > > support and then remove the console afterwards. > > > > > > > > > > > > Signed-off-by: Dave Airlie > > > > > > Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=216859 > > > > > > Reported-by: Zeno Davatz > > > > > > --- > > > > > > drivers/video/fbdev/nvidia/nvidia.c | 81 +++++++++++++++-------------- > > > > > > 1 file changed, 42 insertions(+), 39 deletions(-) > > > > > > > > > > > > diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c > > > > > > index 1960916098d4..e60a276b4855 100644 > > > > > > --- a/drivers/video/fbdev/nvidia/nvidia.c > > > > > > +++ b/drivers/video/fbdev/nvidia/nvidia.c > > > > > > @@ -1197,17 +1197,17 @@ static int nvidia_set_fbinfo(struct fb_info *info) > > > > > > return nvidiafb_check_var(&info->var, info); > > > > > > } > > > > > > > > > > > > -static u32 nvidia_get_chipset(struct fb_info *info) > > > > > > +static u32 nvidia_get_chipset(struct pci_dev *pci_dev, > > > > > > + volatile u32 __iomem *REGS) > > > > > > { > > > > > > - struct nvidia_par *par = info->par; > > > > > > - u32 id = (par->pci_dev->vendor << 16) | par->pci_dev->device; > > > > > > + u32 id = (pci_dev->vendor << 16) | pci_dev->device; > > > > > > > > > > > > printk(KERN_INFO PFX "Device ID: %x \n", id); > > > > > > > > > > > > if ((id & 0xfff0) == 0x00f0 || > > > > > > (id & 0xfff0) == 0x02e0) { > > > > > > /* pci-e */ > > > > > > - id = NV_RD32(par->REGS, 0x1800); > > > > > > + id = NV_RD32(REGS, 0x1800); > > > > > > > > > > > > if ((id & 0x0000ffff) == 0x000010DE) > > > > > > id = 0x10DE0000 | (id >> 16); > > > > > > @@ -1220,12 +1220,11 @@ static u32 nvidia_get_chipset(struct fb_info *info) > > > > > > return id; > > > > > > } > > > > > > > > > > > > -static u32 nvidia_get_arch(struct fb_info *info) > > > > > > +static u32 nvidia_get_arch(u32 Chipset) > > > > > > { > > > > > > - struct nvidia_par *par = info->par; > > > > > > u32 arch = 0; > > > > > > > > > > > > - switch (par->Chipset & 0x0ff0) { > > > > > > + switch (Chipset & 0x0ff0) { > > > > > > case 0x0100: /* GeForce 256 */ > > > > > > case 0x0110: /* GeForce2 MX */ > > > > > > case 0x0150: /* GeForce2 */ > > > > > > @@ -1278,16 +1277,44 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) > > > > > > struct fb_info *info; > > > > > > unsigned short cmd; > > > > > > int ret; > > > > > > + volatile u32 __iomem *REGS; > > > > > > + int Chipset; > > > > > > + u32 Architecture; > > > > > > > > > > > > NVTRACE_ENTER(); > > > > > > assert(pd != NULL); > > > > > > > > > > > > + if (pci_enable_device(pd)) { > > > > > > + printk(KERN_ERR PFX "cannot enable PCI device\n"); > > > > > > + return -ENODEV; > > > > > > + } > > > > > > + > > > > > > + /* enable IO and mem if not already done */ > > > > > > + pci_read_config_word(pd, PCI_COMMAND, &cmd); > > > > > > + cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); > > > > > > + pci_write_config_word(pd, PCI_COMMAND, cmd); > > > > > > + > > > > > > + nvidiafb_fix.mmio_start = pci_resource_start(pd, 0); > > > > > > + nvidiafb_fix.mmio_len = pci_resource_len(pd, 0); > > > > > > + > > > > > > + REGS = ioremap(nvidiafb_fix.mmio_start, nvidiafb_fix.mmio_len); > > > > > > + if (!REGS) { > > > > > > + printk(KERN_ERR PFX "cannot ioremap MMIO base\n"); > > > > > > + return -ENODEV; > > > > > > + } > > > > > > + > > > > > > + Chipset = nvidia_get_chipset(pd, REGS); > > > > > > + Architecture = nvidia_get_arch(Chipset); > > > > > > + if (Architecture == 0) { > > > > > > + printk(KERN_ERR PFX "unknown NV_ARCH\n"); > > > > > > + goto err_out; > > > > > > + } > > > > > > + > > > > > > ret = aperture_remove_conflicting_pci_devices(pd, "nvidiafb"); > > > > > > if (ret) > > > > > > - return ret; > > > > > > + goto err_out; > > > > > > > > > > > > info = framebuffer_alloc(sizeof(struct nvidia_par), &pd->dev); > > > > > > - > > > > > > if (!info) > > > > > > goto err_out; > > > > > > > > > > > > @@ -1298,11 +1325,6 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) > > > > > > if (info->pixmap.addr == NULL) > > > > > > goto err_out_kfree; > > > > > > > > > > > > - if (pci_enable_device(pd)) { > > > > > > - printk(KERN_ERR PFX "cannot enable PCI device\n"); > > > > > > - goto err_out_enable; > > > > > > - } > > > > > > - > > > > > > if (pci_request_regions(pd, "nvidiafb")) { > > > > > > printk(KERN_ERR PFX "cannot request PCI regions\n"); > > > > > > goto err_out_enable; > > > > > > @@ -1318,34 +1340,17 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) > > > > > > par->paneltweak = paneltweak; > > > > > > par->reverse_i2c = reverse_i2c; > > > > > > > > > > > > - /* enable IO and mem if not already done */ > > > > > > - pci_read_config_word(pd, PCI_COMMAND, &cmd); > > > > > > - cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); > > > > > > - pci_write_config_word(pd, PCI_COMMAND, cmd); > > > > > > - > > > > > > - nvidiafb_fix.mmio_start = pci_resource_start(pd, 0); > > > > > > nvidiafb_fix.smem_start = pci_resource_start(pd, 1); > > > > > > - nvidiafb_fix.mmio_len = pci_resource_len(pd, 0); > > > > > > - > > > > > > - par->REGS = ioremap(nvidiafb_fix.mmio_start, nvidiafb_fix.mmio_len); > > > > > > > > > > > > - if (!par->REGS) { > > > > > > - printk(KERN_ERR PFX "cannot ioremap MMIO base\n"); > > > > > > - goto err_out_free_base0; > > > > > > - } > > > > > > + par->REGS = REGS; > > > > > > > > > > > > - par->Chipset = nvidia_get_chipset(info); > > > > > > - par->Architecture = nvidia_get_arch(info); > > > > > > - > > > > > > - if (par->Architecture == 0) { > > > > > > - printk(KERN_ERR PFX "unknown NV_ARCH\n"); > > > > > > - goto err_out_arch; > > > > > > - } > > > > > > + par->Chipset = Chipset; > > > > > > + par->Architecture = Architecture; > > > > > > > > > > > > sprintf(nvidiafb_fix.id, "NV%x", (pd->device & 0x0ff0) >> 4); > > > > > > > > > > > > if (NVCommonSetup(info)) > > > > > > - goto err_out_arch; > > > > > > + goto err_out_free_base0; > > > > > > > > > > > > par->FbAddress = nvidiafb_fix.smem_start; > > > > > > par->FbMapSize = par->RamAmountKBytes * 1024; > > > > > > @@ -1401,7 +1406,6 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) > > > > > > goto err_out_iounmap_fb; > > > > > > } > > > > > > > > > > > > - > > > > > > printk(KERN_INFO PFX > > > > > > "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n", > > > > > > info->fix.id, > > > > > > @@ -1415,15 +1419,14 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) > > > > > > err_out_free_base1: > > > > > > fb_destroy_modedb(info->monspecs.modedb); > > > > > > nvidia_delete_i2c_busses(par); > > > > > > -err_out_arch: > > > > > > - iounmap(par->REGS); > > > > > > - err_out_free_base0: > > > > > > +err_out_free_base0: > > > > > > pci_release_regions(pd); > > > > > > err_out_enable: > > > > > > kfree(info->pixmap.addr); > > > > > > err_out_kfree: > > > > > > framebuffer_release(info); > > > > > > err_out: > > > > > > + iounmap(REGS); > > > > > > return -ENODEV; > > > > > > } > > > > > > > > > > > > -- > > > > > > 2.38.1 > > > > > > > > > > This patch fails for me. > > > > > > > > I've based the patch on 6.2-rc7, please make sure to not have the > > > > previous revert committed, this is to replace that patch. > > > > > > Can you guide me through the steps please? > > > > > > I done: > > > > > > 1. cd /usr/src/linux > > > 2. sudo git pull > > > 3. then I applied your patch. > > > > > > Am I doing something wrong? > > > > What is your top of tree commit? (git log) > > > > have you got any commits on top? > > > > git reset --hard origin/master should reset your tree to Linus top. > > 1. git log shows "d2d11f342b179f1894a901f143ec7c008caba43e" > 2. No, no patches on top. > 3. I am doing the following steps: > /usr/src/linux> sudo git reset --hard origin/master > Passwort: > HEAD ist jetzt bei d2d11f342b17 Merge branch 'fixes' of > git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs > /usr/src/linux> sudo patch -p1 < /tmp/patch > patching file drivers/video/fbdev/nvidia/nvidia.c > Hunk #1 FAILED at 1197. > Hunk #2 FAILED at 1220. > Hunk #3 FAILED at 1278. > Hunk #4 FAILED at 1298. > Hunk #5 FAILED at 1318. > Hunk #6 FAILED at 1401. > Hunk #7 FAILED at 1415. > 7 out of 7 hunks FAILED -- saving rejects to file > drivers/video/fbdev/nvidia/nvidia.c.rej > Are you pulling the patch from email? I guess your email service or something is mangling it. I've attached it to see if that helps. Dave. --0000000000003403e205f403fd13 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-nvidiafb-detect-the-hardware-support-before-removing.patch" Content-Disposition: attachment; filename="0001-nvidiafb-detect-the-hardware-support-before-removing.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ldskc7v50 RnJvbSA1OGQ4YzRlNTkxNzljNzZmZTdmYjEwY2FjZmFjZGM5NWVkYzQzYzYzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYXZlIEFpcmxpZSA8YWlybGllZEByZWRoYXQuY29tPgpEYXRl OiBNb24sIDYgRmViIDIwMjMgMDc6MDU6MjggKzEwMDAKU3ViamVjdDogW1BBVENIXSBudmlkaWFm YjogZGV0ZWN0IHRoZSBoYXJkd2FyZSBzdXBwb3J0IGJlZm9yZSByZW1vdmluZwogY29uc29sZS4K ClRoaXMgZHJpdmVyIHJlbW92ZWQgdGhlIGNvbnNvbGUsIGJ1dCBoYXNuJ3QgeWV0IGRlY2lkZWQg aWYgaXQgY291bGQKdGFrZSBvdmVyIHRoZSBjb25zb2xlIHlldC4gSW5zdGVhZCBvZiBkb2luZyB0 aGF0LCBwcm9iZSB0aGUgaHcgZm9yCnN1cHBvcnQgYW5kIHRoZW4gcmVtb3ZlIHRoZSBjb25zb2xl IGFmdGVyd2FyZHMuCgpTaWduZWQtb2ZmLWJ5OiBEYXZlIEFpcmxpZSA8YWlybGllZEByZWRoYXQu Y29tPgpGaXhlczogaHR0cHM6Ly9idWd6aWxsYS5rZXJuZWwub3JnL3Nob3dfYnVnLmNnaT9pZD0y MTY4NTkKUmVwb3J0ZWQtYnk6IFplbm8gRGF2YXR6IDx6ZGF2YXR6QGdtYWlsLmNvbT4KLS0tCiBk cml2ZXJzL3ZpZGVvL2ZiZGV2L252aWRpYS9udmlkaWEuYyB8IDgxICsrKysrKysrKysrKysrKy0t LS0tLS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgNDIgaW5zZXJ0aW9ucygrKSwgMzkgZGVsZXRp b25zKC0pCgpk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