From patchwork Mon May 10 06:31:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 433033 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2564634jao; Sun, 9 May 2021 23:31:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpezjiIhtZpRsE2vQOdEQrqqRAlqp4v0iPrw6QjBBrnaa1dmTVbskzRkR9PEDVBw6VEPiU X-Received: by 2002:a17:906:49c1:: with SMTP id w1mr24664506ejv.178.1620628299773; Sun, 09 May 2021 23:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620628299; cv=none; d=google.com; s=arc-20160816; b=nUhwjiWf2MKflrY3LE0/S3ChHCdbQSlRoLyg0W+4en2BZWYU8zt5z15rPG09lGTwt4 bO/pDbnUMd2gemyrmIMvGALhdy8ZkN8aF3azbeF6dxykVYySCbcPZD+FvKFsSRaqRyqM GHgKoOakSwS3/w3hqd1/2h8z2F5G11WGtmhzzbEHN/CsxUuGJG0sST1YK8zjZFunjUHB gFcRm3Zf3n6Jbwhv86pDwDuvJ8arf+C5NyPVnivSFolpcTLsOpkbBOvbFD7DZvTihPTe vr7nXbh/ion+7LA+yOYye6xO0+hoKOQioIaHYWJrNJyB3N3j3485dgvEXD7YlhabgsYT H0gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=HUeuKptVZl+AyYfhXDPh4WDXeiyXxCHn77aqz5aRYGQ=; b=04f7YhlAxk0/UXzfAggEmA0IuwAyAXSe/L04rEiKjWfghj2A7igBXSUZF4zkMwRy+V KA0s4oeddJavhdU8w4yjPspcHRjV51GbdGf1784it5182KrD5jATTwd68S5iboxnOid7 9pOvXegpV3lPRy+Ygy4uLtH471+XgBJTnwCIXJNEH1o2mkd1BkPB2+m+u32ikTL4PRZS TDW2oYCZ+9d4xWmsQ5TSB0kI6pLgAVF+rJI/GnjtPzgKmv8uuKy1uELix/ij3cJaRNKF JtXxfK/fZwqp7x8ebjzA4nbbh3ABceFQGKzB7PqTtNlKI9OAYWZhVs+VHyL3WCzOZ5ZJ vPJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rZfPXM1A; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id r27si7095015ejc.437.2021.05.09.23.31.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 May 2021 23:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rZfPXM1A; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1731282EB7; Mon, 10 May 2021 08:31:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="rZfPXM1A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1F2F182EB5; Mon, 10 May 2021 08:31:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F0DAA82EBC for ; Mon, 10 May 2021 08:31:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pj1-x1036.google.com with SMTP id ge1so9168025pjb.2 for ; Sun, 09 May 2021 23:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=HUeuKptVZl+AyYfhXDPh4WDXeiyXxCHn77aqz5aRYGQ=; b=rZfPXM1AiZEaAaKl4HmdXGCdjeusyDGmt0i36C6tMwRWnDdQuRZVi7Qr/NXYl0XtJU 6FZRyN9BTIrPot0lVtxCCM5Cvl1HlpS9uO/75iqdEhu+jQGG1kiKxBcFEzmJ5UiDAyjZ TGjG8DARFNnoCXBNx0Dfst4KF/hdzTGpchmPXvQBB21eYwWj3qyp25iTPuLDe7eLb6Lo TNeqFHASgZMe+SzUW+FWcbF3YmGdeF7VZSZAgW4a1bdzcZ+OQPnMru3PB4RoGpRqd9Xl 4qOwyj2cMGjMLjttkOqubKok4Z5hCkd/DKxJAO5kfOScFQEC509UIOrI96Kl2dU4zdQg Zvsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=HUeuKptVZl+AyYfhXDPh4WDXeiyXxCHn77aqz5aRYGQ=; b=Pno3oBT2SRSFn0XGcOoX3Nqiu5RDXP8Fn+CRmF+ZC4+0F+c017Tiwru+rJo7iKOdnl jr6JjcpWK8CZ0cYXNhB7ysdh4zpdj9O31Zsvu5UUApuKZoHOCnh1UkZW29oBei/6HVfm tg+VVwKO5mBJ+wZLa+lPdVyMj0c9/HcZo5rHhykTR6kIXMaeGweL7srl+GCST9jJ+LoL ullQgzsxazrmD+NbPZGBpAgbQ3W6Dg3aFd42r7gGPoI6T3WpbZhKQtMSJPZT0Bq+ir0S ShYA539zNNeQf/7WREXup01KldcDCXu983EZ9ppevsaYGXXCNc1foKJ28Mpw27LWsamS KOiw== X-Gm-Message-State: AOAM5316BcAKDyTSaaJO+hGol5oEyViQE+ztHoyI8Yy1snWO6ljlL7Yw NDJdZTpW5pN0/qwN1Oiek/WHMySFFPZZc7Mm X-Received: by 2002:a17:902:b109:b029:ef:1ee:9d02 with SMTP id q9-20020a170902b109b02900ef01ee9d02mr18786846plr.85.1620628291506; Sun, 09 May 2021 23:31:31 -0700 (PDT) Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp. [210.141.244.193]) by smtp.gmail.com with ESMTPSA id 79sm10347598pfz.202.2021.05.09.23.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 May 2021 23:31:31 -0700 (PDT) From: Masami Hiramatsu To: Peng Fan , Simon Glass , Tom Rini , Heinrich Schuchardt , Alexander Graf , Jagan Teki , Vignesh R , Joe Hershberger , Ramon Fried , Sughosh Ganu Cc: Masami Hiramatsu , Jassi Brar , Ilias Apalodimas , Masahisa Kojima , Takahiro Akashi , Tim Harvey , Bin Meng , u-boot@lists.denx.de Subject: [PATCH v3 03/14] dm: pci: Skip setting VGA bridge bits if parent device is the host bus Date: Mon, 10 May 2021 15:31:26 +0900 Message-Id: <162062828602.501222.16973646108770784279.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162062825393.501222.13616174511857694530.stgit@localhost> References: <162062825393.501222.13616174511857694530.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Commit bbbcb5262839 ("dm: pci: Enable VGA address forwarding on bridges") sets the VGA bridge bits by checking pplat->class, but if the parent device is the pci host bus device, it can be skipped. Moreover, it shouldn't access the pplat because the parent has different plat data. Without this fix, "pci enum" command cause a synchronous abort. pci_auto_config_devices: start PCI Autoconfig: Bus Memory region: [78000000-7fffffff], Physical Memory [78000000-7fffffffx] PCI Autoconfig: Bus I/O region: [0-ffff], Physical Memory [77f00000-77f0ffffx] pci_auto_config_devices: device pci_6:0.0 PCI Autoconfig: BAR 0, Mem, size=0x1000000, address=0x78000000 bus_lower=0x79000000 PCI Autoconfig: BAR 1, Mem, size=0x8000000, No room in resource, avail start=79000000 / size=8000000, need=8000000 PCI: Failed autoconfig bar 14 PCI Autoconfig: BAR 2, I/O, size=0x4, address=0x1000 bus_lower=0x1004 PCI Autoconfig: BAR 3, Mem, size=0x2000000, address=0x7a000000 bus_lower=0x7c000000 PCI Autoconfig: BAR 4, I/O, size=0x80, address=0x1080 bus_lower=0x1100 PCI Autoconfig: ROM, size=0x80000, address=0x7c000000 bus_lower=0x7c080000 "Synchronous Abort" handler, esr 0x96000006 elr: 00000000e002bd28 lr : 00000000e002bce8 (reloc) elr: 00000000fff6fd28 lr : 00000000fff6fce8 x0 : 0000000000001041 x1 : 000000000000003e x2 : 00000000ffb0f8c8 x3 : 0000000000000001 x4 : 0000000000000080 x5 : 0000000000000000 x6 : 00000000fff718fc x7 : 000000000000000f x8 : 00000000ffb0f238 x9 : 0000000000000008 x10: 0000000000000000 x11: 0000000000000010 x12: 0000000000000006 x13: 000000000001869f x14: 00000000ffb0fcd0 x15: 0000000000000020 x16: 00000000fff71cc4 x17: 0000000000000000 x18: 00000000ffb13d90 x19: 00000000ffb14320 x20: 0000000000000000 x21: 00000000ffb14090 x22: 00000000ffb0f8c8 x23: 0000000000000001 x24: 00000000ffb14c10 x25: 0000000000000000 x26: 0000000000000000 x27: 0000000000000000 x28: 00000000ffb14c70 x29: 00000000ffb0f830 Code: 52800843 52800061 52800e00 97ffcf65 (b9400280) Resetting CPU ... Signed-off-by: Masami Hiramatsu Reviewed-by: Simon Glass --- drivers/pci/pci-uclass.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index f463ef3550..e9baa34e74 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -550,6 +550,9 @@ int pci_auto_config_devices(struct udevice *bus) max_bus = ret; sub_bus = max(sub_bus, max_bus); + if (dev_get_parent(dev) == bus) + continue; + pplat = dev_get_parent_plat(dev); if (pplat->class == (PCI_CLASS_DISPLAY_VGA << 8)) set_vga_bridge_bits(dev);