From patchwork Wed May 19 05:44:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 442359 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp984562jac; Tue, 18 May 2021 22:45:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMMHUgxuI/W5LmiZxe8Tr2lObfSNLFEmOykRD4dfzQJYAHVFn7DVixH/MV71WdgBThwTRV X-Received: by 2002:a17:906:fa81:: with SMTP id lt1mr10262295ejb.465.1621403103926; Tue, 18 May 2021 22:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621403103; cv=none; d=google.com; s=arc-20160816; b=wRXhvnVQKwnKbwQ6UaDP+06nhSMrpOlOyxmQ8eZLmgfXuNZjSBbw7E5hAqX6AZ9It+ 1k39zjx4kgA5+d/Cl8hbfli6id/MbycCTEHPcbakBPNJ18pmU54m5rAqZNqB90JXvowK 5xqRjB7RE07Bo7IZbAbz+adQRDKF7npqCv0VaqrEjSxCsYQg/xrTwyLpMUEcpoirvDkd BxJRZkTiYJztvhSGr1BNfH26gIMdlLaGXNmbgvE92NgKItTPleYQbFQ4OqKv+JGvyKdz cSSpocJ5o38f/meKtmDXD+FL5+ojhjH0aQ2lPeSaIeBN0+LRgGtAx3x+zdWoHaFx1Q+G Dhnw== 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=t//Ba7BQEstmtSntb/woLBNXbqOF5TyYsd2EJMurrfUyRWOWFv4MYdvpgoqLLHlfgQ /BI+WEyx/Z84y1KZrNcMm03Eta6YE4vpUYdGXR3MFtQFl3XQRo2Ep/oYGz1ERwwF78/e hUPVdX/ae3Bv6l5ZbCkx3O226ldlTKbllGTLsgjsTUl2vSHsDnUYlYLmDWtdbacF9c/K sQmURE4gc3hvTu32OTW9DxSaehAotvzKehFWuOO3XJ21wjb/UyOs+g5ZXDASge3u7uTt s9nigY/YL3/hCIjgH7Gc8Tg78KIaOQr2iskWk+PtWCytUcArwTq+lWrruLiK3G+/zvjS uY3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LuLVM+K9; 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 a16si5385107eje.232.2021.05.18.22.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 22:45:03 -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=LuLVM+K9; 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 38D0282B7D; Wed, 19 May 2021 07:44:56 +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="LuLVM+K9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4FA5C82B71; Wed, 19 May 2021 07:44:54 +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-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) (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 D1ABB82B05 for ; Wed, 19 May 2021 07:44:50 +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-x1029.google.com with SMTP id t11so6783261pjm.0 for ; Tue, 18 May 2021 22:44:50 -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=LuLVM+K9mrIILT6+bEuZGLSzf0MSnBTsLXr86LW1EY3JWJwoVrRt9a53MnGCAoOpJ0 87rUyOgJhOy0SG3MrShriCDPqfj99/KxfiDy6VJdN/eQahS9yuICzHyScteblfvTDz56 XV8c8NGsclDaxPFxN5Ou+DghTWNWwtsjTFXL3JVCMAObqS+69CbtIBFFt/Tm+KmKRu6b 7bmOvfbUOQEU+pL9sozj2YMzHD2R+Nk+N5RjaUaZgQWRiKZK39KOOswYXJr3SqkgE2xK IdI6YI3hvTuCvP6SELPmencGXbhDp0r8QioGgh4jVVvwf6J3wGgyAn4RKN29jpekDJzK 8pVQ== 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=IT/6K7f1Y12NkphWG1Ko3L4ZdVJap5yykvrydddiH7LNLBHopTGblD3elJNqqyGiKE kgYMnT5jfZWSE5mNPqYT3UpOuYzOI9t/wnGW5lxaiYK22zAMx8S/AdpiDNCwX/mIEmy2 5KAt2V1/vVAyNtJ7/iZ6aA1Cv0gEv8eGtlu1hGMwBhyj2l5fJqhbK67OC0vCs0a+zGl1 MGT33946sqJ8OMoet+KSD/y4MwmLUzyOvPcvb2qLnT2uNEyQgxRp1OWERRyUTDnt9X/p trGFNAKGWKcZKL5fvbh6HEqxy02ZmfVn64PaKLAkdqWBof2KhQiHhEKc+/dkEc5V6gEQ 2F4w== X-Gm-Message-State: AOAM532jEqujM7+ToAthDjPgCtTm9MlB3Mdcn8noerpzGayNOtKmm/F5 PaqiW5w8HY/qm4T5gPpQ5+ayLw== X-Received: by 2002:a17:903:22d1:b029:f2:67be:82fb with SMTP id y17-20020a17090322d1b02900f267be82fbmr8877826plg.15.1621403089186; Tue, 18 May 2021 22:44:49 -0700 (PDT) Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp. [210.141.244.193]) by smtp.gmail.com with ESMTPSA id y25sm12142091pfm.20.2021.05.18.22.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 22:44:48 -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 v4 02/14] dm: pci: Skip setting VGA bridge bits if parent device is the host bus Date: Wed, 19 May 2021 14:44:44 +0900 Message-Id: <162140308389.47256.7062389446717416966.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <162140306116.47256.6799058439792039400.stgit@localhost> References: <162140306116.47256.6799058439792039400.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);