From patchwork Fri Apr 16 23:37:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 422675 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6d12:0:0:0:0 with SMTP id m18csp844971ejr; Fri, 16 Apr 2021 16:37:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoF7Ncy0qB3x5QmBFdMZIu6W5jqQodS5vzmUjQAlhYWvmCw0Srg0KnaQbEU3+pXre+2kRb X-Received: by 2002:a05:6402:142:: with SMTP id s2mr12726036edu.2.1618616270205; Fri, 16 Apr 2021 16:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618616270; cv=none; d=google.com; s=arc-20160816; b=ix7EbNTNhAEyTi3xaQ1ovF2xoq1BXiFpJkmRfiXvZaqAk2cV33O9s15trq42ZOOX5f YkVlFbPVvogRFqN83KEP8PoCNtTNVeG2ReDPaoV3W7GlJm/vht05JgwrOOBEwJnfJYGd m4771TiDoslaWENoL9m3sNfucuZRv7rv8kgJh3opwMdVgE9+UAGjmapAkWBp5b1Ud0pg kaWxnbC0673+QVvYwjEXF9zjNcXRkXuaT4GhfbneYDTHFj4w8QZBJuE0133DE76wi7UB Q2yDXCCCT42RN9MMBc4gfs+0v78SFVPsLHiiYPQxwrj0TwVm5EQo9Z6oiLSK3FOn/6hH JDXg== 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=BpCfBPSpy+m1vMhZYiIp0YhKpxX7N8xRnQ3U5IMY0kIDmSYEAL4iBZ0BDTWxDY9dtY uABup2KB5UkKULDihvyiT4//mOywihKLI8w7zp5FYhNIlWeQtRw42erP7wAKMbq++wfN 4HUsR97TrV9slEDsi1NkbR9pU59CD84ndXTi4c1Z9siUfHJdb8GE+JMEWPlatWIAkSIx mGkI0WbdBaX/tnuVRAx3GXod74KqAmo7Uoa0Syoz7kb+SdNjcqrCR7/oo1gQCh12pGLD YdA1jJ8++pJ08batN+LzrM7aaagMp3kSnXyOlHb1ehfkDMzMDX0/XaTh/uLIPARbC7Eg ZdFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=No4c0d8f; 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 4si6395804edc.257.2021.04.16.16.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 16:37:50 -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=No4c0d8f; 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 E5EF380F4A; Sat, 17 Apr 2021 01:37:45 +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="No4c0d8f"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C4F5480FBD; Sat, 17 Apr 2021 01:37:43 +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-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (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 5FB4B80EC0 for ; Sat, 17 Apr 2021 01:37:38 +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-x102b.google.com with SMTP id nm3-20020a17090b19c3b029014e1bbf6c60so11227261pjb.4 for ; Fri, 16 Apr 2021 16:37:38 -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=No4c0d8f3wjCqukZhxvqM7mv7i8ttleqYST1OpDlNfnr6MFVnTIDKbxZOJghVsHyNJ W+DGhJOaQwbuctALN3b5cwf9UJfYay/TwsI+DAm+kUPOW6Xqya22AjpB9qigtpojsUnj JyAgqzCBiripgrkhlp4Hm3JzOqsXKxKKtYTuq8EfL8su9+MCbFc23m1ZAwfo/DNgeSoS 556y95m+ZQRnMFAF9ohC3rqIVlMgcpO3GgmNIeVKy8dJUvhQQh5EtweRFTDJb/ExwmV5 bDLUzF/PlPK21I0/qfDxdi6nuZt3Wmm5ObXgcy47CTVel9a08k6tQTXDhPxLZokbVpep V0iw== 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=mxChBeeD2WTOzZ35XXFDlb1Fc14FUmB2EbR/Cw9cv1umbh7mBzMlabMWDUMGytrvos 9J9dNwZ92Rsv+je7keW2lciruQs8MbLRwfwPqAdW3xwSqm4tIdv8nBB3AVkbtokxMgll 3g3jw2jvpzdKZBbCkhkz2nHP/SeAbY3QjRRK0KrM2P3/nPp9eKv+nME2T6OX9m+dyK7K mgUau+23ru3NKkE/9CQ6STDkDErI19zogRIYP8uXP4DlsUNIAZRd7/ErY91mTWyS84CB xidK7h17RN73b7XFva8LlEFqsXTk1Wd+n3Hc3oAwIB3SLjfc/rbmbYPwzKtgkwNnTlIo /Jiw== X-Gm-Message-State: AOAM531oQsOb+TxoLPT1sxpP7ZXYmoLtEFt12GGXxk+L0CtQdTHExVYo Sv1XiExOQdPDmqjKj3pMfJ8f8w== X-Received: by 2002:a17:902:d706:b029:e6:90aa:24e0 with SMTP id w6-20020a170902d706b02900e690aa24e0mr12057771ply.42.1618616256483; Fri, 16 Apr 2021 16:37:36 -0700 (PDT) Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp. [210.141.244.193]) by smtp.gmail.com with ESMTPSA id i28sm5769978pgi.42.2021.04.16.16.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 16:37:36 -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 v2 02/13] dm: pci: Skip setting VGA bridge bits if parent device is the host bus Date: Sat, 17 Apr 2021 08:37:31 +0900 Message-Id: <161861625122.298230.14741735251011903714.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <161861622792.298230.15803163505976731363.stgit@localhost> References: <161861622792.298230.15803163505976731363.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);