Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753771AbaGMO0Y (ORCPT ); Sun, 13 Jul 2014 10:26:24 -0400 Received: from smtp-out-218.synserver.de ([212.40.185.218]:1081 "EHLO smtp-out-216.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753627AbaGMO0Q (ORCPT ); Sun, 13 Jul 2014 10:26:16 -0400 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@laprican.de X-SynServer-PPID: 20591 Message-ID: <53C296C2.30304@metafoo.de> Date: Sun, 13 Jul 2014 16:25:06 +0200 From: Lars-Peter Clausen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Richard Weinberger CC: Lennox Wu , Marek Vasut , Chen Gang , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , dmitry.torokhov@gmail.com, thierry.reding@gmail.com, jic23@kernel.org, wim@iguana.be, Benjamin Herrenschmidt , kys@microsoft.com, Martin Schwidefsky , teg@jklm.no, Mischa.Jonker@synopsys.com, msalter@redhat.com, knaack.h@gmx.de, rdunlap@infradead.org, linux-input@vger.kernel.org, linux-pwm@vger.kernel.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-watchdog@vger.kernel.org, Liqin Chen Subject: Re: [PATCH] drivers: Let several drivers depends on HAS_IOMEM for 'devm_ioremap_resource' References: <53C1F7DE.3060102@gmail.com> <201407130545.23004.marex@denx.de> <53C25551.1050909@nod.at> <53C288F0.3070001@metafoo.de> <53C28C4A.70907@nod.at> <53C29015.5070607@metafoo.de> <53C291C8.6050303@nod.at> In-Reply-To: <53C291C8.6050303@nod.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/13/2014 04:03 PM, Richard Weinberger wrote: > Am 13.07.2014 15:56, schrieb Lars-Peter Clausen: >> On 07/13/2014 03:40 PM, Richard Weinberger wrote: >>> Am 13.07.2014 15:26, schrieb Lars-Peter Clausen: >>>> On 07/13/2014 11:45 AM, Richard Weinberger wrote: >>>>> Am 13.07.2014 11:27, schrieb Lennox Wu: >>>>>> As I said before, some configurations don't make sense. >>>>> >>>>> If such a configuration can be achieved using allmod/yesconfig it has to be fixed. >>>>> Chen's fixes seem reasonable as not all architectures support iomem. >>>> >>>> Maybe we should stub out ioremap() and friends when COMPILE_TEST is enabled to avoid these linker errors. That's in my opinion better than turning most of the 'depends on >>>> COMPILE_TEST' into 'depends on COMPILE_TEST && HAS_IOMEM'. The issue comes up quite a lot and it is often overlooked when adding a driver that can be build when COMPILE_TEST is >>>> enabled. >>> >>> And what should this stub do? >>> Except calling BUG()... >> >> return NULL; >> >> It's for compile testing, it's not meant to work at runtime. > > Hm, I really don't like the idea of having a non-working kernel. > IMHO either it should build _and_ run and nothing else. > Greg, what do you think? The kernel will still be working fine and you can run it on a system. The drivers which use ioremap() or similar are probably not instantiated on a system that does not provide HAS_IOMEM. But even if it was the driver should handle ioremap() returning NULL gracefully and abort the driver probe. That said you'll probably not run a kernel that was built with COMPILE_TEST on your real hardware since it contains so many drivers that are completely useless on your hardware. The idea of COMPILE_TEST is to have as much compile test exposure as possible to the code that is enabled by COMPILE_TEST. Stubbing out ioremap() and friends when HAS_IOMEM is not set and COMPILE_TEST is set makes it easier to get there. - Lars -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/