Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753366AbcKIVgT (ORCPT ); Wed, 9 Nov 2016 16:36:19 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:60071 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbcKIVgR (ORCPT ); Wed, 9 Nov 2016 16:36:17 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: John Garry , mark.rutland@arm.com, devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, benh@kernel.crashing.org, minyard@acm.org, gabriele.paoloni@huawei.com, catalin.marinas@arm.com, zhichang.yuan02@gmail.com, liviu.dudau@arm.com, linuxarm@huawei.com, Will Deacon , linux-kernel@vger.kernel.org, zourongrong@gmail.com, bhelgaas@google.com, robh+dt@kernel.org, xuwei5@hisilicon.com, linux-serial@vger.kernel.org, linux-pci@vger.kernel.org, olof@lixom.net, kantyzc@163.com, "zhichang.yuan" Subject: Re: [PATCH V5 1/3] ARM64 LPC: Indirect ISA port IO introduced Date: Wed, 09 Nov 2016 22:33:17 +0100 Message-ID: <2939462.W2yy62pjEE@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <6dee9821-5145-2113-e391-6317e4533c06@huawei.com> References: <1478576829-112707-1-git-send-email-yuanzhichang@hisilicon.com> <2479288.4UmF9SBrq1@wuerfel> <6dee9821-5145-2113-e391-6317e4533c06@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:Rp2sy0MZG9l3gDufF28GBHnygCt50Mgfx4o/HosTAaOEDFK7xOc RASLYv9l3sUt30cV+f1y9XvfCm1DZsO3cfMk0XU9nTvRl7Jmj8oSYHU+PEpVI8yRCfy2KYd 8g0UFtV1x4ZusVJg4BnUNIXmgnK9xqPUcYbMVc9FhjrIGA9E23zoq7z9wtorJhDg9WnLoj2 l9t57v29Nye3gTKMoOvsg== X-UI-Out-Filterresults: notjunk:1;V01:K0:rt4cGLOcw/Y=:OVMBCwUkSMZIbWicSoY0uu /QUg7WK4N/rVEJGtR2ZGS6oIWL9Ha7G6NJ8orFWSQuk/nHwXRS3LUsdmXcvsYYbuKs0si34oU A7KzVJTCUlL0d7jDIdQIE49ydG8RVcwdeO22Kwffd9QRq/YUL1c3XlLnRLEqbXg8gAa4Cu+JD BdaQnRMXfEVtk8hV9zghsTo8Ep62HagbGPxpyniNVSgI1KF6NbuskMEhnkdGKhNNfQc9Ph1Tc j79Xy9OMUYj4ld9bNBS5ToabIRLhHLuCQ57zGVYqOlTItt4ckMc+Row9X54LcaErh3cCzuf3j fJdFHHtl/Q9gX/cfCJGXXRYBPqDgmDVKM+gVbKeXtzdv0Pur4EyYa00Nu5Zjd7GWH3emGR9DW UF+Bb93v3x4rQYlQPh1W1BjxxrRft/uu75aIvyQ928+VQv+Pu8IRPZYkjl8yEtrye+5tP6lGN Yod2pVsLxggwOBkY1tcCgkRFRPI/fZS8XIXr9OqK22L+S/G7UW2tVe6wO9uBim1R7KzsFswaU iuKNdkp5uMvXWM9OBGWYE4uGJamdhlS7Iyu5ep1ZGXBSpyErDLKWN23nnaicQ3DepM/UmWNRr ffcvaYjitUwyMxx8SY78CuvzJs0FhxzB6rjhyt1ZmxG/V3NxoZwJIdzZlCdaIqS/a7dotL+Q3 x0Pdi24jjZ9q4WA5xga1oBr/RFZLASl9dI5j2IHHGv8ZVVRh8f7zqE6fVxUkm/j6wQho7jLg8 iU/rrJPA2lemLOul Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1939 Lines: 37 On Wednesday, November 9, 2016 11:29:46 AM CET John Garry wrote: > On 08/11/2016 22:35, Arnd Bergmann wrote: > > On Tuesday, November 8, 2016 4:49:49 PM CET Will Deacon wrote: > >> On Tue, Nov 08, 2016 at 04:33:44PM +0000, John Garry wrote: > >>> On 08/11/2016 16:12, Will Deacon wrote: > >>>> On Tue, Nov 08, 2016 at 11:47:07AM +0800, zhichang.yuan wrote: > > > >>>> Is there no way to make this slightly more generic, so that it can be > >>>> re-used elsewhere? For example, if struct extio_ops was common, then > >>>> you could have the singleton (which maybe should be an interval tree?), > >>>> type definition, setter function and the BUILD_EXTIO invocations > >>>> somewhere generic, rather than squirelled away in the arch backend. > >>>> > >>> The concern would be that some architecture which uses generic higher-level > >>> ISA accessor ops, but have IO space, could be affected. > >> > >> You're already adding a Kconfig symbol for this stuff, so you can keep > >> that if you don't want it on other architectures. I'm just arguing that > >> plumbing drivers directly into arch code via arm64_set_extops is not > >> something I'm particularly fond of, especially when it looks like it > >> could be avoided with a small amount of effort. > > > > Agreed, I initially suggested putting this into arch/arm64/, but there isn't > > really a reason why it couldn't just live in lib/ with the header file > > bits moved to include/asm-generic/io.h which we already use. > > > > Right, Zhichang will check the logistics of this. The generic io.h is > quite clean, so as long as you don't mind new build switches of this > nature being added, it should be ok; and we'll plan on moving extio.h > into include/asm-generic as well. I think all we need is an #ifdef CONFIG_something around the existing defintion, with the alternative being "extern" declarations, after that all the interesting logic can sit in a file in lib/. Arnd