From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757181AbcAMKak (ORCPT ); Wed, 13 Jan 2016 05:30:40 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:64692 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757133AbcAMKah (ORCPT ); Wed, 13 Jan 2016 05:30:37 -0500 From: Arnd Bergmann To: liviu.dudau@arm.com Cc: Rongrong Zou , Rongrong Zou , devicetree@vger.kernel.org, Catalin Marinas , Corey Minyard , gregkh@linuxfoundation.org, Will Deacon , linux-kernel@vger.kernel.org, linuxarm@huawei.com, benh@kernel.crashing.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 3/3] ARM64 LPC: update binding doc Date: Wed, 13 Jan 2016 11:29:53 +0100 Message-ID: <10121075.WaQr9PQ2xh@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20160113100911.GU13633@e106497-lin.cambridge.arm.com> References: <1451396032-23708-1-git-send-email-zourongrong@gmail.com> <4052627.BRvFkUij6q@wuerfel> <20160113100911.GU13633@e106497-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:xaJKumyuRJVhI6/anD30I/TP0e9LByIsXZ7x1uVSRLLfUqUVjV3 H1Rq3yYpc+aUNN2I50fiqCNxwUQp0rOx17s7RSz3K4Vf0WRualU73NfNEsAd3RkKAFZwB6J 3YUBTJ/kB+gWjaWFE2JCte2BDmX7/3Ko2zX2qsWIv5kK7/mMRRIA6xl3DFIRInhBG3T9Hf1 7ybRdfR5R0txHH63ywK1g== X-UI-Out-Filterresults: notjunk:1;V01:K0:g5D9kh65yOU=:Q6EyOmOgUPHPYf/MvEiLYn QLcxZq6LGaTJqCAhMWCDf39rHE1jRxaPTehEpZH2hs5bm7QwGFWexDJOl2qFqc6csK+9RKb0P iHn3tOIEatc+M0iUM+4JeosdJobAQIEKPqB0T3bF3z4O/czFfQfPr8raoDPK45R2r9H8b7H4a Zb0tb5Wi9MUX5cbGx67/bWCXSMG0yJPCVXUvd64nbnC1HZc4HcoEKqrsHN0Oa3gy0u780lZQr BAz6T7vgVZuDCaGIN9Jq4OurkxEUYBwNvk/MMXC78fN5YsxWz5Pn8oI789tJBKMgdi84KqMb2 68r158cNn9If6m1J8QaUFEUd6e3JVdI2y3FQSRDEoYHeBrK5lsZsr0IzgmHFw/8vWzZ/yWwQS SarF5uXf4v1RHlc1Qh4ZhFDurwOehLzcVpuTZfyFEr2bspxfS4GQqJWOg3Om99DYZ692dgRFQ YUuiL3FNrKd0toy6RZYrmJ5z3QsDeEI3VeamGlyBHtoXpocXQjGzyKmd+fZKunh3OFHhcmGr9 SOKvTa+MvsGfm90M3RzIMB8CcoMfbSO3CpowE5ii2fnLdbt3qcbb/knjVGsJdRZaf64np11Vr ukk4IkSywVHqe0YVjD9J1bY3FRp4/q/gJv2MHX/+tS6C3mvsRzz9niXP+4phG50URjZkyt2ZN ginGtYQzDfJt/Tz2p1PV/jf2K/5gIum0oNLorOOqxfknE2D7xm3t4ypyQnc2jUgIFG6w8xw1W rBg1j00kPQzQEe8a Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 13 January 2016 10:09:11 liviu.dudau@arm.com wrote: > On Tue, Jan 12, 2016 at 11:54:59PM +0100, Arnd Bergmann wrote: > > On Tuesday 12 January 2016 10:14:18 liviu.dudau@arm.com wrote: > > > > > > OK, looking at of_translate_one() comments it looks like a missing "ranges" property is > > > only accepted on PowerPC. I suggest you have an empty "ranges" property in your isa > > > parent node, that will signal to the OF parsing code that the mapping is 1:1. Then have > > > the IPMI node use the reg = <0x0 0xe4 4>; property values instead of reg = <0x1 0xe4 4>; > > > > > > > > > > A missing ranges property means that there is no translation, while an > > empty ranges means a 1:1 translation to the parent bus. > > > > We really want the former here, as I/O port addresses are not mapped into > > the MMIO space of the parent bus. > > Agree. However of_translate_one()'s behaviour doesn't match our expectations and I have no > useful suggestions on what the right behaviour should be. I believe of_get_address() already has the correct number (local to the ISA/LPC bus here), an we just need to teach __of_address_to_resource about ISA buses that have their own translation. We have the device node of the ISA bus here, so we just need to stop translating further using the ranges property and instead use the io_offset for that bus. In fact we can use the same method for both ISA and PCI buses, if we just remember which device node is the root for an I/O space and what its offset is relative to the Linux I/O space. Going all the way to a physical CPU address and then back to an I/O port number through pci_address_to_pio() is awkward anyway, but here it's wrong specifically because there is no physical address for it. Arnd