Message ID | 20231017110221.189299-1-herve.codina@bootlin.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4050398vqb; Tue, 17 Oct 2023 04:02:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwzOE/aNbq2+65iIqwT6AdmTu7Sl/K6fHOibIxdUeDfBAksqRC14cnRcxoWVmQy8T97wGi X-Received: by 2002:a05:6a20:d80d:b0:163:c167:964a with SMTP id iv13-20020a056a20d80d00b00163c167964amr1694086pzb.1.1697540566813; Tue, 17 Oct 2023 04:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697540566; cv=none; d=google.com; s=arc-20160816; b=madTXqYeRNkPdr31BV23svwhPoInA8ADaths6Yl5G7p9OnTHcUw45wrtgsc+b+hBOI 1SlNNYzddd1MK4hjBRDVywGE5orHh3DsWDJA2ikpH2d2HsuySKKWlXKIYvVQvKtEDGrN tkKmPXzcw51XNMOQmvydDoTfNRWOkBnSmfhaJU8HOnZbXsFUSn/u0s+7g0cTIUQE/9U1 fI2K5SPrbNXOPiRw9/tNXTpBYfQzTuJcdqqpJzVH5ysUB57dfBN45zxVQ5Lp2KNNTl/j Lcyw9IwC/XVI7iNuyNoJC7kUgbdngPKd6suA8dErvCWdbRqXrM4WhdbVECI/V8o0g8fc Uz5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uNnm02JCk44Tr5/Yas+vsF5cPz7HwoX99lHqaKeh5AU=; fh=FrxXp3R3VRdykpxJNx7pRXkmFaw80vhpUJHrlJKWU4Y=; b=rEOyqF53EIAjnhfEfVAclAT0aBW5S+R6S3F6RljatMPW60WkjDCMdg4cY50F7MOqlW YXaYSi89h19z3VMmb8ndUJJqDqah1o79PhuRbigRvuyoO51CT5HzagsJYr+ZioBGl5yU SLF2oEY0mM2c3PB4ynCfNwYHKuBbmCgRkXyXnYz5jSfKLuu4WholcR94+XXVwa1IPrXk tQtn7rEB8nHw6BTfHuKct+41/Lkik/AzNPv1o3HlzSCFgzNGCgK+P7i/MHGKsEHmnhQP UfW5N8+ZWIeEOfJC/tsZx92FRoauSvUP3dA163NZBwXo0vgMOIPjztw4ivcyV+2wtR4X kRTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gaerQvBL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id bw6-20020a056a02048600b00585a5433e55si1774132pgb.143.2023.10.17.04.02.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 04:02:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gaerQvBL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 9F9408020C33; Tue, 17 Oct 2023 04:02:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343504AbjJQLC3 (ORCPT <rfc822;hjfbswb@gmail.com> + 19 others); Tue, 17 Oct 2023 07:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234663AbjJQLC2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 17 Oct 2023 07:02:28 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D8B3A2; Tue, 17 Oct 2023 04:02:27 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 59D071BF207; Tue, 17 Oct 2023 11:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697540545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uNnm02JCk44Tr5/Yas+vsF5cPz7HwoX99lHqaKeh5AU=; b=gaerQvBLMnnAXQwESoahLNGVxGLCxD/2WqhPHNZHjzhjGRgAfm0YuiwqpmFPX+WWdePWjt TsWQiBqea6weTZwDo12A3meSb0yFZ87oDJU44vQ85GGIC7vW0ZqqtnC5yaJOVgoDmt7nDV Aj7dBIp8WTfSGrZR6NFrx4I/5PjaREltsMy+PIDNdpkmuO95hiHNaifZu4mI/ePu2OoGLP eNOQcZ4KQioCRtco2Yjn9neBJodFOFbC2bBABwrAxJk7/Zi/MQoMLgzoTw35OFjnTfx0P2 yoOAZ/WYyZD90CsSBmkFKk3tRBgwm3HAyHzkieDGs9K4LNdgs3VHKK47bKFIlw== From: Herve Codina <herve.codina@bootlin.com> To: Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Lizhi Hou <lizhi.hou@amd.com> Cc: Max Zhen <max.zhen@amd.com>, Sonal Santan <sonal.santan@amd.com>, Stefano Stabellini <stefano.stabellini@xilinx.com>, Jonathan Cameron <Jonathan.Cameron@Huawei.com>, Bjorn Helgaas <bhelgaas@google.com>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Allan Nielsen <allan.nielsen@microchip.com>, Horatiu Vultur <horatiu.vultur@microchip.com>, Steen Hegelund <steen.hegelund@microchip.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Herve Codina <herve.codina@bootlin.com> Subject: [PATCH v2 0/3] Fix DT based address translations Date: Tue, 17 Oct 2023 13:02:15 +0200 Message-ID: <20231017110221.189299-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 17 Oct 2023 04:02:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780000297589462758 X-GMAIL-MSGID: 1780000297589462758 |
Series | Fix DT based address translations | |
Message
Herve Codina
Oct. 17, 2023, 11:02 a.m. UTC
Hi, This patch series fixes a DT based address translation (translations using the ranges property). The issue is present with a ranges property made of a 3 cells child address, a 3 cells parent address and a 2 cells child size. This can happen with the recent addition of of_pci_prop_ranges() in commit 407d1a51921e ("PCI: Create device tree node for bridge") The issue description is fully described in the first patch commit log. In this series, - The first patch fixes the issue. - The second patch avoids duplicated code. - The third patch adds unit tests related address translations. I previously sent the first patch alone: https://lore.kernel.org/linux-kernel/20231003065236.121987-1-herve.codina@bootlin.com/ This series v2 has to be considered as the next iteration based on the review done on my previous patch sent alone. Best regards, Hervé Changes v1 -> v2 - Patch 1 Simplify of_bus_default_flags_map(). Fix the commit log (pci-ep-bus ranges[0] size is 0x200_0000 instead of 0x2000_0000). - Patch 2 (new in v2) Remove duplicated code. - Patch 3 (new in v2) Add unit tests. Herve Codina (3): of: address: Fix address translation when address-size is greater than 2 of: address: Remove duplicated functions of: unittest: Add tests for address translations drivers/of/address.c | 43 ++++++--- drivers/of/unittest-data/tests-address.dtsi | 101 ++++++++++++++++++++ drivers/of/unittest.c | 74 ++++++++++++++ 3 files changed, 205 insertions(+), 13 deletions(-)
Comments
On Tue, Oct 17, 2023 at 01:02:15PM +0200, Herve Codina wrote: > Hi, > > This patch series fixes a DT based address translation (translations > using the ranges property). > > The issue is present with a ranges property made of a 3 cells child > address, a 3 cells parent address and a 2 cells child size. > This can happen with the recent addition of of_pci_prop_ranges() in > commit 407d1a51921e ("PCI: Create device tree node for bridge") > > The issue description is fully described in the first patch commit log. > > In this series, > - The first patch fixes the issue. > - The second patch avoids duplicated code. > - The third patch adds unit tests related address translations. > > I previously sent the first patch alone: > https://lore.kernel.org/linux-kernel/20231003065236.121987-1-herve.codina@bootlin.com/ > This series v2 has to be considered as the next iteration based on the > review done on my previous patch sent alone. > > Best regards, > Hervé > > Changes v1 -> v2 > > - Patch 1 > Simplify of_bus_default_flags_map(). > Fix the commit log (pci-ep-bus ranges[0] size is 0x200_0000 instead > of 0x2000_0000). > > - Patch 2 (new in v2) > Remove duplicated code. > > - Patch 3 (new in v2) > Add unit tests. > > Herve Codina (3): > of: address: Fix address translation when address-size is greater than > 2 > of: address: Remove duplicated functions > of: unittest: Add tests for address translations > > drivers/of/address.c | 43 ++++++--- > drivers/of/unittest-data/tests-address.dtsi | 101 ++++++++++++++++++++ > drivers/of/unittest.c | 74 ++++++++++++++ > 3 files changed, 205 insertions(+), 13 deletions(-) I've applied this. I sent out this series[1] of clean-ups to apply on top. Rob [1] https://lore.kernel.org/all/20231026135358.3564307-2-robh@kernel.org/