From patchwork Fri Jun 4 09:43:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 454005 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp257919jae; Fri, 4 Jun 2021 02:43:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpPNMIE0rDxSqedrTrpF7EkRzEvuoKKCpK1jJ8eqDBQjhju8qc2B9AEgsKVM2Ix0ql+LFb X-Received: by 2002:a17:906:3884:: with SMTP id q4mr3472812ejd.66.1622799832991; Fri, 04 Jun 2021 02:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622799832; cv=none; d=google.com; s=arc-20160816; b=qcA+00Jc02VUdqbf8pUPFiEFuIRvDgmpCtyT8fled+v6FN7zAadvJh5tkZT+pnILoA urSbqBojxACx8uoV9a8UmifxpDHw49i9/kRGI5nDgSSiC0b1svg2msHifoZdTjLDlYoU a32yXGfrhNfbxbn2Y/zKi4XQN02geFcti+VN94FrIdrfl6BbpnBTaSO7a1X7jFKLjOEA iNCfRG5SvvMq2npgowxi8ScvJ8T2H8GKVO3D364NiptNiMwED+tbN1ID9SWiXNn05FnZ VyKLDV0b7N09wGH+MhIdIf7HWYjpM6bpddcV8gaoOHx3BG3XaXPyV29ePcb4lc76f6xS Sf+w== 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=oIKW2tQfTpD2DWPfnFIYCTKukOC75WSdt4ZOmMT2GVs=; b=F3nw9xLUJj8uyACKt0xQnEkw/v7vQtfO6H+pa9srFbaJKFQ+kM7V+VM+alVC7/0cYY VD25BPwHZ0FsxuTNhL47yaQFTJakCUqplWDUvdrfLHTLLxl5km9K7fzcSAbI7GX/rJax EInjw1+L60LtnWjmXmRiY4Pv8okrnNtUSXV26yiYsSgZWTY97uVGrkwHETT6q6CtVKcR 3oxoxu9xvOEM0fvb6pCb9ADEvCzDmObG/21dukl5b+z9vr3U1vDdxw12xnfkdz0Pw0zc /AmLnef5+Y6Jhcb4paDG7DMIPhFDA/5mmsRoXi2ENK8tmfJi8M80OIXXgrst1go46Ypw wteg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uXXPxjVG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id hb18si4151641ejc.159.2021.06.04.02.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 02:43:52 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uXXPxjVG; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 8B18E82A8D; Fri, 4 Jun 2021 11:43:51 +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="uXXPxjVG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 978D282A8D; Fri, 4 Jun 2021 11:43:48 +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-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (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 4EEB781FF5 for ; Fri, 4 Jun 2021 11:43:40 +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-x1034.google.com with SMTP id m13-20020a17090b068db02901656cc93a75so7117748pjz.3 for ; Fri, 04 Jun 2021 02:43:40 -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=oIKW2tQfTpD2DWPfnFIYCTKukOC75WSdt4ZOmMT2GVs=; b=uXXPxjVGYJ9IAY7QZYrIcmlkA7WKWEcwzzCCq8ICkcSwQJDBS8vaB9XGqRb8CofOfD kX7IotuL5GPm21S7vg3GYa0nfLgHqwC+Sh3FMHX6Kea8jRcCwqeQidX26fynPvYSB3mN QeA8VsL9kIXvY+aMoM9JnQdbac8X/dgueCz9UOeqiBKB7iHRw+de8zXo5WruDVhHxyy1 D7mBUF3ikub5iiXcRV9R4WtmutagV4uCrFw1Mfzjqqg0ca3E/Z1CawxK+bY1LirhFG1F FK2d9QRa+5w+SnoULQiUJ4c70e/gw/zX4bqedRduGaNLqgqFWU1/6w8nzcLlDxtwalkr MeGw== 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=oIKW2tQfTpD2DWPfnFIYCTKukOC75WSdt4ZOmMT2GVs=; b=B3llSMxMKk84OKBgYBSngBFhMDEzW/Md4uBo9FKrxV5zOVCkcesdZzhSGNc3tUcyh1 JpPfvfQG+iILJ8IUiSHJiUMyuIWC0IQcIlwS3w1x8N4sZe5T4HkPSxVd/LVSe0GiQsa5 uFRv3U1XQyIOO5TlcUxSF/QIYzBKG8nLqZOMwmUeriT/jIusgIO9ZFRrdu8moPwRjv6G 2fpj9vfB4uK8N9XPotdG9mvBEAYljE7TIqUaX+8522HQgECiCwuXV4GQaMuc4l/2PpfJ m/iuXdBwTGaR9JMcj7jTdYp/p+C+0C5ACwoiTJ6ZLBtDl3iSGOFeepF5YQmKvaZvyous y+vg== X-Gm-Message-State: AOAM533z92Od2UQvJp+rYNLCAgJR098iTwlD1sUuvysibjiAIuUPG4Jx ZZ3cgNLgroKHg/8OP+NhEBmptA== X-Received: by 2002:a17:90a:e541:: with SMTP id ei1mr3946964pjb.189.1622799818830; Fri, 04 Jun 2021 02:43:38 -0700 (PDT) Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp. [210.141.244.193]) by smtp.gmail.com with ESMTPSA id bo14sm4360840pjb.40.2021.06.04.02.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 02:43:38 -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, Jaehoon Chung Subject: [PATCH v5 02/13] dm: pci: Skip setting VGA bridge bits if parent device is the host bus Date: Fri, 4 Jun 2021 18:43:34 +0900 Message-Id: <162279981377.518877.6264160083672865959.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162279979193.518877.11119025270138617301.stgit@localhost> References: <162279979193.518877.11119025270138617301.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 22a033e632..afe4f1974a 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);