Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1754485pxj; Wed, 19 May 2021 13:08:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlNBPksb/bLjQ3L6I8pVQ0LIYxD/te5xtVaKEnjfj+fcXb6UT+qARtGHCkFYVjXNbeiUl+ X-Received: by 2002:a17:907:72c3:: with SMTP id du3mr935027ejc.194.1621454936250; Wed, 19 May 2021 13:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621454936; cv=none; d=google.com; s=arc-20160816; b=Y6x/v+tn7XB/HFsk3y0D4dfKxzltadG7hb2yISK6P4jfvJD+IRLfDSbSGsyPdscDhp KcQenmPns3H9/fNrHEr1UAimv28L/11PW2SV5XRJkMp4iBmj3VnoPUmGCWYoYcyUvgKz K88TnsNoNue3PV9k9ZoVPHs5R9oBTPRwacuiIlRcxBMRsSys3yv1ugWWBBeUjFLFMY/v DRSRZha6/fUFQWTcdXuiG2IpMArXHpvQYG3GUjTfdRlENvgSu3B7CMt7M4vk64HC5icG QDjxYQjZccRwTuOciM+GslsfN3SU85e8jIftJbW7KE2KXppGKl4Y11fE9X5xdMRWtbF0 NBvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=v5CXWXv+dicxXzBmVU94yt1htl8k2quY3j/LebiIK+k=; b=DnjDctfzfpeVpAHo1kM1j0YLkkStUtuvM5peoGcXlD/n/baaPzJMACynybVwOQ+5LU Kou9ssO7Q+lgNc1hTlMs1XZ4MJkkrz6lktBqduq9JkJwn7b9SN4NCg6S2/hE79dw8I3F 8kW5PA0f48Z5p+Vk2qPwieAhbhhOBylmmjuUp4lTozeHn70dfwwY9Db2hUWtvyCOzMN0 nTW+VOzdIAZYiwazDdYZeBs1xFgiVEhYupwxTeuwr6ZguEPsVjH1QZQl7wR1Ewrsv0Z5 7X0y4LnwepXKCx09SqPQQmC90AetdfpZ1oenAGQyfJHDQc8plm/IcBQlRA0M+1GJOLUK 5EjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=EvWNtCTc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 19si566892ejx.529.2021.05.19.13.08.32; Wed, 19 May 2021 13:08:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=EvWNtCTc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241149AbhESO3n (ORCPT + 99 others); Wed, 19 May 2021 10:29:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241764AbhESO3m (ORCPT ); Wed, 19 May 2021 10:29:42 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0552CC06175F for ; Wed, 19 May 2021 07:28:19 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id c20so20299661ejm.3 for ; Wed, 19 May 2021 07:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=v5CXWXv+dicxXzBmVU94yt1htl8k2quY3j/LebiIK+k=; b=EvWNtCTc8p9rBoagHQZW3apWHQWRmFXtifalApkJiN+PrAeY/YI5SKIs0c1NJoHb+B rSWorFAyAtolyweWqIdEmbisnakESOLNsp85MCQZq/4VuvkfnNIIn1Fr6jkDpeNyKTnW UwPyQ18Ut1oeW5Wge+ZEpyAT6GxRu3HrqpiPLVQ/IXBMTsljzlPqxpVy5wig0EFoSXKF hMSoAaZW1ZP8y2zAT+RwceIUKtHUerklkrqbxaliQ6ri+aE6s2TJD2jaCnCvr7xICc0a 6MwVi2h179oCbAC8VRQCD+AZjnmWYcT82K7X0nLGT0JSz9PzICghqTANga/lEKxoshmI eX4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=v5CXWXv+dicxXzBmVU94yt1htl8k2quY3j/LebiIK+k=; b=XmEHcGl2c4GRHRBMS/nqC7yO/9hpTSUHL6wqICG4Qqy9Zu4pt1pboUAXRikGSng3Ol at6vdxb9EtyCA+jEAbWlPzT6WvoUNEx3IlkmPgH3bkx8ocpQf46U0IPmNg897272vfr6 OqniBunRJgTjOJKUz+1nrWiJnMUeA6egFiOOCGLfYFKFomwPk1wjMB/ciwRz/Cvq6lYA /7N+y8TPZHFD966X+wZ4oGR1SDgpOjda0ZEEr6XQmCO4ePStzGkKKVWM7W7mKED0oXtc ASn6tkBUulUgpdefURT+5vo06K5Rim3beo4w6anBKdDp54fta7jeV8dq2Ksh15Bd9P0O Qzug== X-Gm-Message-State: AOAM530QmccGnFFV5VCGsA4j1UpiebAaocXm5k9kI0cpfGP4ozfUqGLH inbAtOfEB7db7AlCGlQaEHlRyC6KfR6cDrnZA63DsQ== X-Received: by 2002:a17:907:161f:: with SMTP id hb31mr13134677ejc.514.1621434498337; Wed, 19 May 2021 07:28:18 -0700 (PDT) MIME-Version: 1.0 References: <20210407123438.224551-1-mindal@semihalf.com> <20210511030658.GG3425@dragon> <20210513021214.GJ3425@dragon> <20210513141921.i7sfmekbcw2m7vxd@skbuf> <20210513183102.6dflgb4v2oekdlq5@skbuf> In-Reply-To: From: =?UTF-8?Q?Kornel_Dul=C4=99ba?= Date: Wed, 19 May 2021 16:28:07 +0200 Message-ID: Subject: Re: [PATCH] arm64: dts: fsl-ls1028a: Correct ECAM PCIE window ranges To: Shawn Guo Cc: Vladimir Oltean , Marcin Wojtas , Claudiu Manoil , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Leo Li , "robh+dt@kernel.org" , "tn@semihalf.com" , "upstream@semihalf.com" , Alexandru Marginean , Bjorn Helgaas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shawn, On Fri, May 14, 2021 at 10:25 AM Kornel Dul=C4=99ba w= rote: > > Hi Vladimir, > > On Thu, May 13, 2021 at 8:31 PM Vladimir Oltean = wrote: > > > > Hi Marcin, > > > > On Thu, May 13, 2021 at 07:54:15PM +0200, Marcin Wojtas wrote: > > > Hi Vladimir, > > > > > > czw., 13 maj 2021 o 16:19 Vladimir Oltean n= apisa=C5=82(a): > > > > > > > > On Thu, May 13, 2021 at 10:12:15AM +0800, Shawn Guo wrote: > > > > > On Tue, May 11, 2021 at 09:48:22AM +0000, Claudiu Manoil wrote: > > > > > > >-----Original Message----- > > > > > > >From: Shawn Guo > > > > > > >Sent: Tuesday, May 11, 2021 6:07 AM > > > > > > [...] > > > > > > >Subject: Re: [PATCH] arm64: dts: fsl-ls1028a: Correct ECAM PCI= E window > > > > > > >ranges > > > > > > > > > > > > > >+ Claudiu > > > > > > > > > > > > > >On Wed, Apr 07, 2021 at 02:34:38PM +0200, Kornel Duleba wrote: > > > > > > >> Currently all PCIE windows point to bus address 0x0, which d= oes not match > > > > > > >> the values obtained from hardware during EA. > > > > > > >> Replace those values with CPU addresses, since in reality we > > > > > > >> have a 1:1 mapping between the two. > > > > > > >> > > > > > > >> Signed-off-by: Kornel Duleba > > > > > > > > > > > > > >Claudiu, > > > > > > > > > > > > > >Do you have any comment on this? > > > > > > > > > > > > > > > > > > > Well, probing is still working with this change, I've just test= ed it. > > > > > > > > > > > > PCI listing at boot time changes from: > > > > > > > > > > > > pci-host-generic 1f0000000.pcie: host bridge /soc/pcie@1f000000= 0 ranges: > > > > > > pci-host-generic 1f0000000.pcie: MEM 0x01f8000000..0x01f81= 5ffff -> 0x0000000000 > > > > > > pci-host-generic 1f0000000.pcie: MEM 0x01f8160000..0x01f81= cffff -> 0x0000000000 > > > > > > > > > > > > to: > > > > > > > > > > > > pci-host-generic 1f0000000.pcie: host bridge /soc/pcie@1f000000= 0 ranges: > > > > > > pci-host-generic 1f0000000.pcie: MEM 0x01f8000000..0x01f81= 5ffff -> 0x01f8000000 > > > > > > pci-host-generic 1f0000000.pcie: MEM 0x01f8160000..0x01f81= cffff -> 0x01f8160000 > > > > > > > > > > > > and looks reasonable. > > > > > > Adding Vladimir and Alex just in case. > > > > > > > > > > > > Acked-by: Claudiu Manoil > > > > > > > > > > Thanks, Claudiu. > > > > > > > > > > Kornel, > > > > > > > > > > Do we need a Fixes tag for this patch? > > > > > > > > > > Shawn > > > > > > > > Reviewed-by: Vladimir Oltean > > > > > > > > I am not sure whether "incorrect data that is unused" deserves a Fi= xes: > > > > tag or not, probably not. > > > > > > > > Bjorn Helgaas did point out before that "The fact that all these wi= ndows > > > > map to PCI bus address 0 looks broken", so there's that: > > > > > > > > https://patchwork.kernel.org/project/linux-pci/cover/20201129230743= .3006978-1-kw@linux.com/ > > > > > > > > And while it does look "broken", with the Enhanced Allocation capab= ility > > > > and the pci-host-ecam-generic driver, there is no address translati= on > > > > taking place, so no inbound/outbound windows are configured, so the > > > > range.pci_addr calculated in devm_of_pci_get_host_bridge_resources(= ) is > > > > not used for anything except for printing. > > > > > > ...in Linux. Please note Linux device trees can be used as-is by othe= r > > > projects. Regardless my opinion on how that's unfortunate, FreeBSD > > > does additional ranges check before performing EA and fails. Since th= e > > > current DT description is imo broken and the change is transparent fo= r > > > Linux, it would be great to get this change merged into tree in case > > > there are are no objections. > > > > Just for my curiosity, can you please link me to the extra FreeBSD chec= ks? > > FreeBSD parses values from "ranges" and uses "rman" API to store them. > Now "rman", or Resource manager is used in the FreeBSD kernel to > manage memory regions. > In particular it checks if any two regions inserted into the same > "manager" overlap. > If they do it is treated as a fatal error, which in our case causes > the PCI driver to fail to probe. > code: https://github.com/freebsd/freebsd-src/blob/main/sys/dev/pci/pci_ho= st_generic.c#L148. > > > > > Anyway, I'm not sure what is more "broken", to have a "ranges" property > > when no address translation takes place, or for that "ranges" property > > to be set to a confusing "child address space" value. That's not to say > > I have an objection against Shawn merging the patch. > > > > My main point was slightly different though, the "ranges" property is > > currently mandatory, although in this case it provides no information > > which cannot be retrieved directly from the config space. Properties > > that have no other use except to be pedantic are, well, useless. > > Maybe we can do something about that too. Do you have any more remarks regarding this patch?