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 E4B43C61DA4 for ; Mon, 6 Feb 2023 07:53:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229929AbjBFHxS (ORCPT ); Mon, 6 Feb 2023 02:53:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbjBFHxO (ORCPT ); Mon, 6 Feb 2023 02:53:14 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 493AC1DBB5; Sun, 5 Feb 2023 23:52:43 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id q19so10736770edd.2; Sun, 05 Feb 2023 23:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Jf0eABmWCkzWHSAjxzxyePRPwheCG8eTMDjMOdk7BGM=; b=HLA49fFS6j+626RbExOu4egzV7bViU7IWs4hTVf7yE6b11vk/x9M/250B2/IwCB4RB VTHLfR2TBZTehuCW8zHe/6bvSHicWpMEbHjk474th1SXzE7gRPh5U2/zvYproO/yFoCN WS/FnItAogbGXn052nhSqu8Cf63RL/s3fdFHjNIPx/cYBVlvPitFQXOT9kqqZNZZwVZ1 9gdw8nm2rh/AOudJbEVIWRTlrVJvPp1Ib1AS5UTew5LlN3qJE4NxwuAGUyhcb8YPFyca aP9GZ5Oiayq0E0KHZZvAV0tEdFlZWXfmr417twGhKqA0cU2MJFtoaG6m/yt6+TpZ4svB Vaqg== 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=Jf0eABmWCkzWHSAjxzxyePRPwheCG8eTMDjMOdk7BGM=; b=rjWIYr5EqQDbxWFHDwrzGfHTGyRWtF4vshpzKtEIcBPDJQbFfS1KpSCyjnUB/YUjNZ PWdDi0xQ0luPtIaVXf747NfXdX31qgt9mMKgUsSq0qCox1t6zz8EsWK2rb7kVh2QFPOI zOvXIUf7Qv5U2gu1RFZp63jaGWoIJAh4mPJLjvuNzSDHjRZPLY/tyyKrk4/CrgzDQ0Kc S5zG4jhkB2xzISm+PBZD62J1UZPcI+QKk2X+ViSEW9OtQf/U21qGBA/jphr7oHTs3zGu wgO48PqMZdBuBTrKcoZaDn76TA0kkLesTEDVeWAtVl7SY8WBRD741cXEw8s3LauKySLI bi+g== X-Gm-Message-State: AO0yUKWTRCbXGmQIsOP32z/drGuIA6JL6ecy90KS2d6tZCIZh7fjlYmL pISDMolY4ihmDeGbBYza87pKVhG2FB0ujYJ/6ck= X-Google-Smtp-Source: AK7set98RyHvAcN3yuHhJF5tdfRYgn++sIR/5KBDTNjoxgKqV1UGEA9H6cdKCTV9EZUAGCmNN1dTlaiSWBSLmmdWIkc= X-Received: by 2002:a50:935a:0:b0:4aa:a503:7354 with SMTP id n26-20020a50935a000000b004aaa5037354mr1548010eda.49.1675669953383; Sun, 05 Feb 2023 23:52:33 -0800 (PST) MIME-Version: 1.0 References: <20230205210751.3842103-1-airlied@gmail.com> In-Reply-To: <20230205210751.3842103-1-airlied@gmail.com> From: Zeno Davatz Date: Mon, 6 Feb 2023 08:52:22 +0100 Message-ID: Subject: Re: [PATCH] nvidiafb: detect the hardware support before removing console. To: Dave Airlie , Bjorn Helgaas , Bjorn Helgaas Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dave Airlie Content-Type: multipart/mixed; boundary="000000000000554ed205f403504d" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000554ed205f403504d Content-Type: text/plain; charset="UTF-8" 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. sudo patch -p1 < /tmp/patch Passwort: 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 See attachments. Best Zeno --000000000000554ed205f403504d Content-Type: application/octet-stream; name=patch Content-Disposition: attachment; filename=patch Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ldsiklek0 LS0tCiBkcml2ZXJzL3ZpZGVvL2ZiZGV2L252aWRpYS9udmlkaWEuYyB8IDgxICsrKysrKysrKysr KysrKy0tLS0tLS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgNDIgaW5zZXJ0aW9ucygrKSwgMzkg ZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvZHJpdmVycy92aWRlby9mYmRldi9udmlkaWEvbnZp ZGlhLmMgYi9kcml2ZXJzL3ZpZGVvL2ZiZGV2L252aWRpYS9udmlkaWEuYwppbmRleCAxOTYwOTE2 MDk4ZDQuLmU2MGEyNzZiNDg1NSAxMDA2NDQKLS0tIGEvZHJpdmVycy92aWRlby9mYmRldi9udmlk aWEvbnZpZGlhLmMKKysrIGIvZHJpdmVycy92aWRlby9mYmRldi9udmlkaWEvbnZpZGlhLmMKQEAg LTExOTcsMTcgKzExOTcsMTcgQEAgc3RhdGljIGludCBudmlkaWFfc2V0X2ZiaW5mbyhzdHJ1Y3Qg ZmJfaW5mbyAqaW5mbykKICAgICAgICByZXR1cm4gbnZpZGlhZmJfY2hlY2tfdmFyKCZpbmZvLT52 YXIsIGluZm8pOwogfQoKLXN0YXRpYyB1MzIgbnZpZGlhX2dldF9jaGlwc2V0KHN0cnVjdCBmYl9p bmZvICppbmZvKQorc3RhdGljIHUzMiBudmlkaWFfZ2V0X2NoaXBzZXQoc3RydWN0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X3BhciAqcGFyID0gaW5mby0+cGFyOwogICAgICAgIHUz MiBhcmNoID0gMDsKCi0gICAgICAgc3dpdGNoIChwYXItPkNoaXBzZXQgJiAweDBmZjApIHsKKyAg ICAgICBzd2l0Y2ggKENoaXBzZXQgJiAweDBmZjApIHsKICAgICAgICBjYXNlIDB4MDEwMDogICAg ICAgICAgICAvKiBHZUZvcmNlIDI1NiAqLwogICAgICAgIGNhc2UgMHgwMTEwOiAgICAgICAgICAg IC8qIEdlRm9yY2UyIE1YICovCiAgICAgICAgY2FzZSAweDAxNTA6ICAgICAgICAgICAgLyogR2VG b3JjZTIgKi8KQEAgLTEyNzgsMTYgKzEyNzcsNDQgQEAgc3RhdGljIGludCBudmlkaWFmYl9wcm9i ZShzdHJ1Y3QgcGNpX2RldiAqcGQsIGNvbnN0IHN0cnVjdCBwY2lfZGV2aWNlX2lkICplbnQpCiAg ICAgICAgc3RydWN0IGZiX2luZm8gKmluZm87CiAgICAgICAgdW5zaWduZWQgc2hvcnQgY21kOwog ICAgICAgIGludCByZXQ7CisgICAgICAgdm9sYXRpbGUgdTMyIF9faW9tZW0gKlJFR1M7CisgICAg ICAgaW50IENoaXBzZXQ7CisgICAgICAgdTMyIEFyY2hpdGVjdHVyZTsKCiAgICAgICAgTlZUUkFD RV9FTlRFUigpOwogICAgICAgIGFzc2VydChwZCAhPSBOVUxMKTsKCisgICAgICAgaWYgKHBjaV9l bmFibGVfZGV2aWNlKHBkKSkgeworICAgICAgICAgICAgICAgcHJpbnRrKEtFUk5fRVJSIFBGWCAi Y2Fubm90IGVuYWJsZSBQQ0kgZGV2aWNlXG4iKTsKKyAgICAgICAgICAgICAgIHJldHVybiAtRU5P REVWOworICAgICAgIH0KKworICAgICAgIC8qIGVuYWJsZSBJTyBhbmQgbWVtIGlmIG5vdCBhbHJl YWR5IGRvbmUgKi8KKyAgICAgICBwY2lfcmVhZF9jb25maWdfd29yZChwZCwgUENJX0NPTU1BTkQs ICZjbWQpOworICAgICAgIGNtZCB8PSAoUENJX0NPTU1BTkRfSU8gfCBQQ0lfQ09NTUFORF9NRU1P UlkpOworICAgICAgIHBjaV93cml0ZV9jb25maWdfd29yZChwZCwgUENJX0NPTU1BTkQsIGNtZCk7 CisKKyAgICAgICBudmlkaWFmYl9maXgubW1pb19zdGFydCA9IHBjaV9yZXNvdXJjZV9zdGFydChw ZCwgMCk7CisgICAgICAgbnZpZGlhZmJfZml4Lm1taW9fbGVuID0gcGNpX3Jlc291cmNlX2xlbihw ZCwgMCk7CisKKyAgICAgICBSRUdTID0gaW9yZW1hcChudmlkaWFmYl9maXgubW1pb19zdGFydCwg bnZpZGlhZmJfZml4Lm1taW9fbGVuKTsKKyAgICAgICBpZiAoIVJFR1MpIHsKKyAgICAgICAgICAg ICAgIHByaW50ayhLRVJOX0VSUiBQRlggImNhbm5vdCBpb3JlbWFwIE1NSU8gYmFzZVxuIik7Cisg ICAgICAgICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICAgICB9CisKKyAgICAgICBDaGlwc2V0 ID0gbnZpZGlhX2dldF9jaGlwc2V0KHBkLCBSRUdTKTsKKyAgICAgICBBcmNoaXRlY3R1cmUgPSBu dmlkaWFfZ2V0X2FyY2goQ2hpcHNldCk7CisgICAgICAgaWYgKEFyY2hpdGVjdHVyZSA9PSAwKSB7 CisgICAgICAgICAgICAgICBwcmludGsoS0VSTl9FUlIgUEZYICJ1bmtub3duIE5WX0FSQ0hcbiIp OworICAgICAgICAgICAgICAgZ290byBlcnJfb3V0OworICAgICAgIH0KKwogICAgICAgIHJldCA9 IGFwZXJ0dXJlX3JlbW92ZV9jb25mbGljdGluZ19wY2lfZGV2aWNlcyhwZCwgIm52aWRpYWZiIik7 CiAgICAgICAgaWYgKHJldCkKLSAgICAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgICAg ICAgICBnb3RvIGVycl9vdXQ7CgogICAgICAgIGluZm8gPSBmcmFtZWJ1ZmZlcl9hbGxvYyhzaXpl b2Yoc3RydWN0IG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JjaDoKLSAg ICAgICBpb3VubWFwKHBhci0+UkVHUyk7Ci0gZXJyX291dF9mcmVlX2Jhc2UwOgorZXJyX291dF9m cmVlX2Jhc2UwOgogICAgICAgIHBjaV9yZWxlYXNlX3JlZ2lvbnMocGQpOwogZXJyX291dF9lbmFi bGU6CiAgICAgICAga2ZyZWUoaW5mby0+cGl4bWFwLmFkZHIpOwogZXJyX291dF9rZnJlZToKICAg ICAgICBmcmFtZWJ1ZmZlcl9yZWxlYXNlKGluZm8pOwogZXJyX291dDoKKyAgICAgICBpb3VubWFw KFJFR1MpOwogICAgICAgIHJldHVybiAtRU5PREVWOwogfQoKLS0KMi4zOC4xCg== --000000000000554ed205f403504d Content-Type: text/x-reject; charset="US-ASCII"; name="nvidia.c.rej" Content-Disposition: attachment; filename="nvidia.c.rej" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ldsil8pm1 LS0tIGRyaXZlcnMvdmlkZW8vZmJkZXYvbnZpZGlhL252aWRpYS5jCisrKyBkcml2ZXJzL3ZpZGVv L2ZiZGV2L252aWRpYS9udmlkaWEuYwpAQCAtMTE5NywxNyArMTE5NywxNyBAQCBzdGF0aWMgaW50 IG52aWRpYV9zZXRfZmJpbmZvKHN0cnVjdCBmYl9pbmZvICppbmZvKQogICAgICAgIHJldHVybiBu dmlkaWFmYl9jaGVja192YXIoJmluZm8tPnZhciwgaW5mbyk7CiB9CiAKLXN0YXRpYyB1MzIgbnZp ZGlhX2dldF9jaGlwc2V0KHN0cnVjdCBmYl9pbmZvICppbmZvKQorc3RhdGljIHUzMiBudmlkaWFf Z2V0X2NoaXBzZXQoc3RydWN0IHBjaV9kZXYgKnBjaV9kZXYsCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHZvbGF0aWxlIHUzMiBfX2lvbWVtICpSRUdTKQogewotICAgICAgIHN0cnVjdCBu dmlkaWFfcGFyICpwYXIgPSBpbmZvLT5wYXI7Ci0gICAgICAgdTMyIGlkID0gKHBhci0+cGNpX2Rl di0+dmVuZG9yIDw8IDE2KSB8IHBhci0+cGNpX2Rldi0+ZGV2aWNlOworICAgICAgIHUzMiBpZCA9 IChwY2lfZGV2LT52ZW5kb3IgPDwgMTYpIHwgcGNpX2Rldi0+ZGV2aWNlOwogCiAgICAgICAgcHJp bnRrKEtFUk5fSU5GTyBQRlggIkRldmljZSBJRDogJXggXG4iLCBpZCk7CiAKICAgICAgICBpZiAo KGlkICYgMHhmZmYwKSA9PSAweDAwZjAgfHwKICAgICAgICAgICAgKGlkICYgMHhmZmYwKSA9PSAw eDAyZTApIHsKICAgICAgICAgICAgICAgIC8qIHBjaS1lICovCi0gICAgICAgICAgICAgICBpZCA9 IE5WX1JEMzIocGFyLT5SRUdTLCAweDE4MDApOworICAgICAgICAgICAgICAgaWQgPSBOVl9SRDMy KFJFR1MsIDB4MTgwMCk7CiAKICAgICAgICAgICAgICAgIGlmICgoaWQgJiAweDAwMDBmZmZmKSA9 PSAweDAwMDAxMERFKQogICAgICAgICAgICAgICAgICAgICAgICBpZCA9IDB4MTBERTAwMDAgfCAo aWQgPj4gMTYpOwpAQCAtMTIyMCwxMiArMTIyMCwxMSBAQCBzdGF0aWMgdTMyIG52aWRpYV9nZXRf Y2hpcHNldChzdHJ1Y3QgZmJfaW5mbyAqaW5mbykKICAgICAgICByZXR1cm4gaWQ7CiB9CiAKLXN0 YXRpYyB1MzIgbnZpZGlhX2dldF9hcmNoKHN0cnVjdCBmYl9pbmZvICppbmZvKQorc3RhdGljIHUz MiBudmlkaWFfZ2V0X2FyY2godTMyIENoaXBzZXQpCiB7Ci0gICAgICAgc3RydWN0IG52aWRpYV9w YXIgKnBhciA9IGluZm8tPnBhcjsKICAgICAgICB1MzIgYXJjaCA9IDA7CiAKLSAgICAgICBzd2l0 Y2ggKHBhci0+Q2hpcHNldCAmIDB4MGZmMCkgeworICAgICAgIHN3aXRjaCAoQ2hpcHNldCAmIDB4 MGZmMCkgewogICAgICAgIGNhc2UgMHgwMTAwOiAgICAgICAgICAgIC8qIEdlRm9yY2UgMjU2ICov CiAgICAgICAgY2FzZSAweDAxMTA6ICAgICAgICAgICAgLyogR2VGb3JjZTIgTVggKi8KICAgICAg ICBjYXNlIDB4MDE1MDogICAgICAgICAgICAvKiBHZUZvcmNlMiAqLwpAQCAtMTI3OCwxNiArMTI3 Nyw0NCBAQCBzdGF0aWMgaW50IG52aWRpYWZiX3Byb2JlKHN0cnVjdCBwY2lfZGV2ICpwZCwgY29u c3Qgc3RydWN0IHBjaV9kZXZpY2VfaWQgKmVudCkKICAgICAgICBzdHJ1Y3QgZmJfaW5mbyAqaW5m bzsKICAgICAgICB1bnNpZ25lZCBzaG9ydCBjbWQ7CiAgICAgICAgaW50IHJldDsKKyAgICAgICB2 b2xhdGlsZSB1MzIgX19pb21lbSAqUkVHUzsKKyAgICAgICBpbnQgQ2hpcHNldDsKKyAgICAgICB1 MzIgQXJjaGl0ZWN0dXJlOwogCiAgICAgICAgTlZUUkFDRV9FTlRFUigpOwogICAgICAgIGFzc2Vy dChwZCAhPSBOVUxMKTsKIAorICAgICAgIGlmIChwY2lfZW5hYmxlX2RldmljZShwZCkpIHsKKyAg ICAgICAgICAgICAgIHByaW50ayhLRVJOX0VSUiBQRlggImNhbm5vdCBlbmFibGUgUENJIGRldmlj ZVxuIik7CisgICAgICAgICAgICAgICByZXR1cm4gLUVOT0RFVjsKKyAgICAgICB9CisKKyAgICAg ICAvKiBlbmFibGUgSU8gYW5kIG1lbSBpZiBub3QgYWxyZWFkeSBkb25lICovCisgICAgICAgcGNp X3JlYWRfY29uZmlnX3dvcmQocGQsIFBDSV9DT01NQU5ELCAmY21kKTsKKyAgICAgICBjbWQgfD0g KFBDSV9DT01NQU5EX0lPIHwgUENJX0NPTU1BTkRfTUVNT1JZKTsKKyAgICAgICBwY2lfd3JpdGVf Y29uZmlnX3dvcmQocGQsIFBDSV9DT01NQU5ELCBjbWQpOworCisgICAgICAgbnZpZGlhZmJfZml4 Lm1taW9fc3RhcnQgPSBwY2lfcmVzb3VyY2Vfc3RhcnQocGQsIDApOworICAgICAgIG52aWRpYWZi X2ZpeC5tbWlvX2xlbiA9IHBjaV9yZXNvdXJjZV9sZW4ocGQsIDApOworCisgICAgICAgUkVHUyA9 IGlvcmVtYXAobnZpZGlhZmJfZml4Lm1taW9fc3RhcnQsIG52aWRpYWZiX2ZpeC5tbWlvX2xlbik7 CisgICAgICAgaWYgKCFSRUdTKSB7CisgICAgICAgICAgICAgICBwcmludGsoS0VSTl9FUlIgUEZY ICJjYW5ub3QgaW9yZW1hcCBNTUlPIGJhc2VcbiIpOworICAgICAgICAgICAgICAgcmV0dXJuIC1F Tk9ERVY7CisgICAgICAgfQorCisgICAgICAgQ2hpcHNldCA9IG52aWRpYV9nZXRfY2hpcHNldChw ZCwgUkVHUyk7CisgICAgICAgQXJjaGl0ZWN0dXJlID0gbnZpZGlhX2dldF9hcmNoKENoaXBzZXQp OworICAgICAgIGlmIChBcmNoaXRlY3R1cmUgPT0gMCkgeworICAgICAgICAgICAgICAgcHJpbnRr KEtFUk5fRVJSIFBGWCAidW5rbm93biBOVl9BUkNIXG4iKTsKKyAgICAgICAgICAgICAgIGdvdG8g ZXJyX291dDsKKyAgICAgICB9CisKICAgICAgICByZXQgPSBhcGVydHVyZV9yZW1vdmVfY29uZmxp Y3RpbmdfcGNpX2RldmljZXMocGQsICJudmlkaWFmYiIpOwogICAgICAgIGlmIChyZXQpCi0gICAg ICAgICAgICAgICByZXR1cm4gcmV0OworICAgICAgICAgICAgICAgZ290byBlcnJfb3V0OwogCiAg ICAgICAgaW5mbyA9IGZyYW1lYnVmZmVyX2FsbG9jKHNpemVvZihzdHJ1Y3QgbnZpZGlhX3Bhciks ICZwZC0+ZGV2KTsKLQogICAgICAgIGlmICghaW5mbykKICAgICAgICAgICAgICAgIGdvdG8gZXJy X291dDsKIApAQCAtMTI5OCwxMSArMTMyNSw2IEBAIHN0YXRpYyBpbnQgbnZpZGlhZmJfcHJvYmUo c3RydWN0IHBjaV9kZXYgK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ICBudmlkaWFmYl9m aXgubW1pb19zdGFydCA9IHBjaV9yZXNvdXJjZV9zdGFydChwZCwgMCk7CiAgICAgICAgbnZpZGlh ZmJfZml4LnNtZW1fc3RhcnQgPSBwY2lfcmVzb3VyY2Vfc3RhcnQocGQsIDEpOwotICAgICAgIG52 aWRpYWZiX2ZpeC5tbWlvX2xlbiA9IHBjaV9yZXNvdXJjZV9sZW4ocGQsIDApOwotCi0gICAgICAg cGFyLT5SRUdTID0gaW9yZW1hcChudmlkaWFmYl9maXgubW1pb19zdGFydCwgbnZpZGlhZmJfZml4 Lm1taW9fbGVuKTsKIAotICAgICAgIGlmICghcGFyLT5SRUdTKSB7Ci0gICAgICAgICAgICAgICBw cmludGsoS0VSTl9FUlIgUEZYICJjYW5ub3QgaW9yZW1hcCBNTUlPIGJhc2VcbiIpOwotICAgICAg ICAgICAgICAgZ290byBlcnJfb3V0X2ZyZWVfYmFzZTA7Ci0gICAgICAgfQorICAgICAgIHBhci0+ UkVHUyA9IFJFR1M7CiAKLSAgICAgICBwYXItPkNoaXBzZXQgPSBudmlkaWFfZ2V0X2NoaXBzZXQo aW5mbyk7Ci0gICAgICAgcGFyLT5BcmNoaXRlY3R1cmUgPSBudmlkaWFfZ2V0X2FyY2goaW5mbyk7 Ci0KLSAgICAgICBpZiAocGFyLT5BcmNoaXRlY3R1cmUgPT0gMCkgewotICAgICAgICAgICAgICAg cHJpbnRrKEtFUk5fRVJSIFBGWCAidW5rbm93biBOVl9BUkNIXG4iKTsKLSAgICAgICAgICAgICAg IGdvdG8gZXJyX291dF9hcmNoOwotICAgICAgIH0KKyAgICAgICBwYXItPkNoaXBzZXQgPSBDaGlw c2V0OworICAgICAgIHBhci0+QXJjaGl0ZWN0dXJlID0gQXJjaGl0ZWN0dXJlOwogCiAgICAgICAg c3ByaW50ZihudmlkaWFmYl9maXguaWQsICJOViV4IiwgKHBkLT5kZXZpY2UgJiAweDBmZjApID4+ IDQpOwogCiAgICAgICAgaWYgKE5WQ29tbW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nJlZShpbmZvLT5waXhtYXAuYWRkcik7CiBlcnJfb3V0X2tmcmVlOgogICAgICAgIGZyYW1lYnVm ZmVyX3JlbGVhc2UoaW5mbyk7CiBlcnJfb3V0OgorICAgICAgIGlvdW5tYXAoUkVHUyk7CiAgICAg ICAgcmV0dXJuIC1FTk9ERVY7CiB9CiAK --000000000000554ed205f403504d--