Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1006770iob; Fri, 13 May 2022 19:23:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhAUMbck6I5MJiIS9AdWliz0cKp6nBw5Q5b3sq2o9SAB5UMvWXqGnWOMpPZSU2RvNxeLBD X-Received: by 2002:a05:6000:1ac8:b0:20c:dced:2f6c with SMTP id i8-20020a0560001ac800b0020cdced2f6cmr5870452wry.107.1652494983481; Fri, 13 May 2022 19:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652494983; cv=none; d=google.com; s=arc-20160816; b=dzjMRI2xxCz6VevM1VSnBtGL+GQSR9SVs5axighPLo66GuM3sSjcZQe6d88hw6wz9T 1XrmwZ8ygxrdBgV7XDBQHS2bSPbANeeJVjGni2Algp3LnhH96bPuEQ+v3KJTZ2wj7Vs7 c1kbHddG9kMocARsIDbu5py8qCnfQ4xj+iHurZxupw68hC0ARvlKSLmf9+rQBAuKlHsp m+gCq5yXLDza4Klzp6G7jRh6SGHXmbeRf5ashsON5Bne9sO5KInr41T1cA0RNOvSwtpa hXDnmI60rWw6eZyzJIZG2cmT88/vlSRfiJbKw5GTOAVjN/l8Wzo4cFeYGnavZe/tm0FA fy+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=3OIzuXMaPPDatbr7PwIVbgMbSTqi2zEiI+KiyHfQ53c=; b=ownEidGspUbVpam+BCG47FKiE6q/V07c98Ro95PZsjQmcv24N7n52Tp6jVpx8RFV+L fuRtIAxiuq+beIBX4vIeG6U7Yw2GRu7WyEHIEb/dNXdCQky4jRk2c60X9GO/gKdQxkdE QwLs5U1szXAOmiq/+kci+ryGz7fek50/wi2/abhAmzn2Vm1EIPaQV77yz3AcCQ0RcOn+ R/xRLtKaCJsGlBURJW9QgpOVdAwk7Az1zGwZT5/uafIBiVzbpTBkCxf4TUXVyiFtjq1d gABbxJb26LBuutWAZu6YDZkd4Moq18kTr7oGseUnIJMMApFPIUFMNZb3NWttpUezQiYi vrLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g1-20020a5d64e1000000b0020ad294293csi3883704wri.191.2022.05.13.19.23.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:23:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 62AFC34A97E; Fri, 13 May 2022 17:38:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380224AbiEMMZ0 (ORCPT + 99 others); Fri, 13 May 2022 08:25:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380217AbiEMMZY (ORCPT ); Fri, 13 May 2022 08:25:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9DCC2A1FCC; Fri, 13 May 2022 05:25:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 79627B82F6C; Fri, 13 May 2022 12:25:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C57CC34115; Fri, 13 May 2022 12:25:18 +0000 (UTC) Message-ID: <2532419a-812b-c2de-ef56-849ec7dc16bc@linux-m68k.org> Date: Fri, 13 May 2022 22:25:16 +1000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] m68knommu: fix undefined reference to `mach_get_rtc_pll' Content-Language: en-US To: Geert Uytterhoeven Cc: Linux/m68k , Linux Kernel Mailing List , Arnd Bergmann , kernel test robot References: <20220513064952.3610672-1-gerg@linux-m68k.org> From: Greg Ungerer In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On 13/5/22 17:12, Geert Uytterhoeven wrote: > Hi Greg, > > On Fri, May 13, 2022 at 8:50 AM Greg Ungerer wrote: >> Configuring for a nommu classic m68k target and enabling the generic rtc >> driver (CONFIG_RTC_DRV_GENERIC) will result in the following compile >> error: >> >> m68k-linux-ld: arch/m68k/kernel/time.o: in function `rtc_ioctl': >> time.c:(.text+0x82): undefined reference to `mach_get_rtc_pll' >> m68k-linux-ld: time.c:(.text+0xbc): undefined reference to `mach_set_rtc_pll' >> m68k-linux-ld: time.c:(.text+0xf4): undefined reference to `mach_set_rtc_pll' >> >> "mach_set_rtc_pll" and "mach_get_rtc_pll" are only defined in the common >> MMU setup code, and are really only implemented in any meaningful way on >> classic M68K MMU enabled machines. So conditionally limit their use to > > And only on Q40/Q60. > >> MMU enabled classic M68K systems. >> >> Reported-by: kernel test robot >> Signed-off-by: Greg Ungerer > > Thanks for your patch! > >> --- a/arch/m68k/kernel/time.c >> +++ b/arch/m68k/kernel/time.c >> @@ -62,7 +62,7 @@ void timer_heartbeat(void) >> } >> #endif /* CONFIG_HEARTBEAT */ >> >> -#ifdef CONFIG_M68KCLASSIC >> +#if defined(CONFIG_M68KCLASSIC) && defined(CONFIG_MMU) >> #if !IS_BUILTIN(CONFIG_RTC_DRV_GENERIC) >> void read_persistent_clock64(struct timespec64 *ts) >> { > > read_persistent_clock64() uses mach_hwclk(), which is provided by > both setup_mm.c and setup_no.c, so it's always available?> Albeit not populated by coldfire or nommu platform code, so I see > the point in depending on MMU (no nommu Amiga support yet ;-). Yes, exactly. And even worse is that on ColdFire platforms it is never set, so will be the startup value of NULL. It is called without checking for NULL in both of rtc_generic_get_time() and rtc_generic_set_time(). I figured if nommu mode is ever supported on any of the classic MMU m68k then this could be revisited. > Perhaps rtc_ioctl() should depend on CONFIG_Q40? That is probably reasonable too. Using CONFIG_MMU was a good fit for the way mach_set_rtc_pll and mach_get_rtc_pll are currently defined - as in setup_mm.c which is CONFIG_MMU only, which is why I went that way. But if you prefer I can re-factor further based on CONFIG_Q40? Regards Greg >> @@ -140,7 +140,7 @@ static int __init rtc_init(void) >> >> module_init(rtc_init); >> #endif /* CONFIG_RTC_DRV_GENERIC */ >> -#endif /* CONFIG M68KCLASSIC */ >> +#endif /* CONFIG M68KCLASSIC && CONFIG_MMU */ >> >> void __init time_init(void) >> { > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds