Received: by 10.223.164.202 with SMTP id h10csp1344188wrb; Mon, 27 Nov 2017 01:11:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMY7EPf6gAQAAWOVyC3Ex/M1rVl2OV2BCjo1bsYaSBttqeGdYD6Rhx0tDlSvfAYEMpT6M6PP X-Received: by 10.84.253.1 with SMTP id z1mr33491429pll.115.1511773880087; Mon, 27 Nov 2017 01:11:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511773880; cv=none; d=google.com; s=arc-20160816; b=RVIL9GKRyew66po6VFxlzQxXO2YiPOjzdAPkOxYO9TYA6n8eUYl1PCXlZL3TUnuygL 2Yl7SJmX2rh+yKTzUlYPtto6wxPWM0Pqpd7u8bJOrR7Ukc7xugsql2bS2iACBhB5SpkM d4pd01LxuSXyAiyTFJx3jeI952/aGV0HtDw3j06pEhulhbC8hcJGNEx9NUMrST7VTki/ KaneX/yEbo+hiy00O8lpovF4HKpTEgEbBiux78kV8KsbUq2srudChsK+hWsJZFmMsnlp ugf5nxHwNm9mMmRQHII6kjVOmtjrT9/BpWEKaU3hnpoT+83Cbro0BzWEH0h76PvYG840 5G+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=VZTb8npsfXVztqrmBUOAohPJSRiBoWPcKSZEldnaAMc=; b=suO739BzSh45phj4etYumasx5oaVyaFM7uHlHd1qN/7W6bIcaLVpf2nu8JL1D9lCqZ rrna6zMqH1OX6YZa2DQHdcKsfu51KoeYj53Vm2sJC9Dk2DOIVNNEwP0Y5dl/R+dYXO3W V2kjdwZu4XZAQA78vThwnSk/5JEYjGsx3CjRay9QfIPrsRpxydHAkfreidWdjlIaiI2C ujexigCQozbQY3GZlkUJmaoffVSodJwERxigULZa1zXnmbltZMXmVxFnJt0PJVAIKEBv qB4m+2q2LNY5cdgQpdGncc236NrKg8TDpiMOZdy9WzLGkd5ug+vyAkWDfX6raWIPtykK 9fLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf5si2641677plb.578.2017.11.27.01.11.08; Mon, 27 Nov 2017 01:11:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751428AbdK0JK1 (ORCPT + 78 others); Mon, 27 Nov 2017 04:10:27 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:24639 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbdK0JK0 (ORCPT ); Mon, 27 Nov 2017 04:10:26 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAR98eWh025720; Mon, 27 Nov 2017 10:09:49 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2eexv21e6f-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 27 Nov 2017 10:09:49 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2B4783F; Mon, 27 Nov 2017 09:09:48 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A30B927D4; Mon, 27 Nov 2017 09:09:48 +0000 (GMT) Received: from [10.48.0.167] (10.75.127.46) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 27 Nov 2017 10:09:47 +0100 Subject: Re: [PATCH] iio: stm32: fix adc/trigger link error To: Jonathan Cameron , Jonathan Cameron CC: Alexandre Torgue , Arnd Bergmann , , , References: <20170906125722.2522781-1-arnd@arndb.de> <50ec54e0-85f7-8c32-475c-9b27a4e6ebd3@st.com> <20170910170040.7eb1f768@archlinux> <6b5ff28a-859d-973c-2da5-60a8bf50c378@st.com> <20170925111604.00000c02@huawei.com> <20170925182617.18bf5ce8@archlinux> From: Fabrice Gasnier Message-ID: Date: Mon, 27 Nov 2017 10:09:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20170925182617.18bf5ce8@archlinux> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-27_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/25/2017 07:26 PM, Jonathan Cameron wrote: > On Mon, 25 Sep 2017 11:16:04 +0100 > Jonathan Cameron wrote: > >> On Mon, 25 Sep 2017 11:54:06 +0200 >> Fabrice Gasnier wrote: >> >>> On 09/10/2017 06:00 PM, Jonathan Cameron wrote: >>>> On Wed, 6 Sep 2017 18:16:33 +0200 >>>> Fabrice Gasnier wrote: >>>> >>>>> On 09/06/2017 02:56 PM, Arnd Bergmann wrote: >>>>>> The ADC driver can trigger on either the timer or the lptim >>>>>> trigger, but it only uses a Kconfig 'select' statement >>>>>> to ensure that the first of the two is present. When the lptim >>>>>> trigger is enabled as a loadable module, and the adc driver >>>>>> is built-in, we now get a link error: >>>>>> >>>>>> drivers/iio/adc/stm32-adc.o: In function `stm32_adc_get_trig_extsel': >>>>>> stm32-adc.c:(.text+0x4e0): undefined reference to `is_stm32_lptim_trigger' >>>>>> >>>>>> We could use a second 'select' statement and always have both >>>>>> trigger drivers enabled when the adc driver is, but it seems that >>>>>> the lptimer trigger was intentionally left optional, so it seems >>>>>> better to keep it that way. >>>>> Hi Arnd, >>>>> >>>>> This is correct, not all stm32 have this hardware. >>>>>> >>>>>> This adds a hack to use 'IS_REACHABLE()' rather than 'IS_ENABLED()', >>>>>> which avoids the link error, but instead leads to the lptimer trigger >>>>>> not being used in the broken configuration. I've added a runtime >>>>>> warning for this case to help users figure out what they did wrong >>>>>> if this should ever be done by accident. >>>>>> >>>>>> Fixes: f0b638a7f6db ("iio: adc: stm32: add support for lptimer triggers") >>>>>> Signed-off-by: Arnd Bergmann >>>>> Tested-by: Fabrice Gasnier >>>> >>>> This may take me a few weeks to pick up. I don't want to >>>> pull the mfd immutable branch in just to have this fix, so this will >>>> get sorted after rc1 is out. >>>> >>>> As ever, poke me if it looks like I've forgotten about it. >>> >>> Hi Jonathan, >>> >>> Di you apply this one? >> >> I think I still need to rebase my branch. Greg took my fixes pull this morning >> so I can fast forward that branch next time I'm on the right PC and then pick >> this up. >> >> Thanks for the reminder. > > Applied to the fixes-togreg branch of iio.git. Hi Jonathan, Sorry to raise this again. Maybe I missed something, but I can't find this fix on recent tag (4.15-rc1). Do you know if this patch from Arnd is on its way in ? Please kindly let me know. BR, Fabrice > > Thanks, > > Jonathan >> >> Jonathan >> >>> >>> Thanks, >>> Best Regards, >>> Fabrice >>>> Sorry for the delay! >>>> >>>> Jonathan >>>> >>>>> >>>>> Many thanks for the fix, >>>>> Best Regards, >>>>> Fabrice >>>>>> --- >>>>>> include/linux/iio/timer/stm32-lptim-trigger.h | 5 ++++- >>>>>> 1 file changed, 4 insertions(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/include/linux/iio/timer/stm32-lptim-trigger.h b/include/linux/iio/timer/stm32-lptim-trigger.h >>>>>> index 34d59bfdce2d..464458d20b16 100644 >>>>>> --- a/include/linux/iio/timer/stm32-lptim-trigger.h >>>>>> +++ b/include/linux/iio/timer/stm32-lptim-trigger.h >>>>>> @@ -16,11 +16,14 @@ >>>>>> #define LPTIM2_OUT "lptim2_out" >>>>>> #define LPTIM3_OUT "lptim3_out" >>>>>> >>>>>> -#if IS_ENABLED(CONFIG_IIO_STM32_LPTIMER_TRIGGER) >>>>>> +#if IS_REACHABLE(CONFIG_IIO_STM32_LPTIMER_TRIGGER) >>>>>> bool is_stm32_lptim_trigger(struct iio_trigger *trig); >>>>>> #else >>>>>> static inline bool is_stm32_lptim_trigger(struct iio_trigger *trig) >>>>>> { >>>>>> +#if IS_ENABLED(CONFIG_IIO_STM32_LPTIMER_TRIGGER) >>>>>> + pr_warn_once("stm32 lptim_trigger not linked in\n"); >>>>>> +#endif >>>>>> return false; >>>>>> } >>>>>> #endif >>>>>> >>>>> -- >>>>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in >>>>> the body of a message to majordomo@vger.kernel.org >>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>>> >>> >>> _______________________________________________ >>> linux-arm-kernel mailing list >>> linux-arm-kernel@lists.infradead.org >>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-iio" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > From 1579558779440451687@xxx Tue Sep 26 00:10:39 +0000 2017 X-GM-THRID: 1577795212365520391 X-Gmail-Labels: Inbox,Category Forums