From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39D313E5ED9 for ; Wed, 25 Mar 2026 14:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774449783; cv=none; b=t7qGBgRbeWOUutbs6Yhyr64Vd8D6owsB7T6y4bcJ7YPZ5LtVgPPOF9aH1ZcMYz+3E7LHRYOt8Rn8BgC87Ag2JgVYVbIXke9WR8MfjXbekhaHmAcsKidN3c2Vc6KptQLb2M6nN18bC/lK4z36vN05d+jcOC8gmSAq/8xfoLR5I08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774449783; c=relaxed/simple; bh=PO6T0qi91hB7YX3hTkv4I4vRIbfh3ABFhwMLy1i/fjg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DBXQlOlJ0LxoDWqI6STdNBrKQjxCmjcRTMFvCDphRsxNqHj5x8onI65naMXTADAFMmqMUxHwuxbR1POiWQEIFUO/LXylxoi8OEuZtj2/2QUYcpVGEekpqXz5+zBJTdJz2VHq/Wlvv6Zd1RXTNa3sgOt1R6mfteaRAx190oPnh7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZSPYceDk; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=kiXkmFKO; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZSPYceDk"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="kiXkmFKO" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62PBGJPA3091228 for ; Wed, 25 Mar 2026 14:43:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 6CO42NrH0o8ZBBIP0NTPmzhTbucDiEvU/OBKheKuW6g=; b=ZSPYceDku93G02pJ 38QmIYgjKMgLaWUr3wX6Mz9p/n5QhC0PobotkuTYjzgXZYk8QzhPmHE2YxmTsVcb E6yAw+qWfP5JtYXEQMV2qB5xzpJ6W9fU/Pt4vHK4u19gpdBBfUjzICi1DGpKJ3R1 blBWd9FElOnkYA38TLgS3HzW95BEc5wOEexbfLpoLkvJJq+4iFRQpalWeGOwc0Og yeq1xJQ5IttxY5cfcRyoLeneokkAexuWxpttfQKbQ7js04S1m8u2GNcwMt9ThWiL NLaTCaVOnMMTdv+krTySvxWQq/sGGe4YNuV6q9Cehh2zEHz+dlMSE/9s+GWA6Qzn 94HnJg== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4d4dmps062-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 25 Mar 2026 14:43:01 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-50b2cbe7223so123555201cf.2 for ; Wed, 25 Mar 2026 07:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1774449781; x=1775054581; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6CO42NrH0o8ZBBIP0NTPmzhTbucDiEvU/OBKheKuW6g=; b=kiXkmFKOKg45x9nGrWdFanWMckBeWcpgzfSFdDklhR3kmyFGoZ1I6T7r9fAtOhAQdU boNeFJJNj5ozEtDPsT/2JxvHa0ad8drDFj1AeeDzSviO93ip92ZwOgKthvZK0CmMatgq yLnb+XftMqujYt6VgiylFmXZYxBezQ+4sszuL81RzXstIb8sCuzaF5dNRaU1EOYdRkbj s4ajw9De03TnPFTOslip9y34jJ6Mi6wiSGBeoGHWrdCgILsQkSfPm3N/wpXBJhrr5I5w x0g1yV6uQacasPi0kqFFBRWH6cqx2dg6r7t8/v1VeV4EOvAgS2+xqfE4SkxdIpifrW14 vlrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774449781; x=1775054581; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6CO42NrH0o8ZBBIP0NTPmzhTbucDiEvU/OBKheKuW6g=; b=DJRXxeB4lUfoNgAC0F+6+Z6CqE5yD7/snvm0JshGFxBk+Kzpi7/3XFY6RjpiixLgI+ TC+asILAZkRSC/Ut/FDVVu7LRXlWu3Nzk/NnLWARU1sZhZYvLA/uDcKltqegjVx/oOR6 p7pcmyiEK/AJw3fsnnOneHBpLkcDjNf5qymmFcWfAjAyLog/36xcZPmO2s4ud1mBMO9S 6lYVA1Z7GFj98dPk0S5GPVagZHmiGTmyQOCH39rQI8ecrM8KvmsLGE1XocOjD1sQcfeE rfyXDr0kkNJLq+pDaNogec4dxnE74L0Sv55sgEBNXkJChpf/xskCpzw2BtStZgylE7PP BZ1w== X-Forwarded-Encrypted: i=1; AJvYcCW2xotP9nwowT+HZiGAwvCZRYevupjuyXpZ16AXBk+MQI1DoREOuO5b7GggWcFZBbnZrmOOow6EQJ6JPn0=@vger.kernel.org X-Gm-Message-State: AOJu0YyC+2HMI8qjD36zNX7fw3+XUt/CibPv2CUhYlYDKiqhktGfKWP1 atnGI2KbgaNz0cMb63+y/jwFmq4xWLPQRY+iKRphqM4py2OZNh+bz9PgQjQpuW1cj4B/m+APSVZ 9niP7cBo6osFxfgZMMVn8GeoIjvvsx5QjdPq43rym/8TsXHB7MhQp4PyN7MN7qubDQOM= X-Gm-Gg: ATEYQzwIXxYOmwl+LLkHHWpavNCTE1tfhcoBrzZyQ5RmppfRrH6fkXXCsbb0JqdUwvV XEUgK+EL8KbvyPBgJux/xr1B2Nq0oE0PRbkPdyKRWSmHx51da9LJXckrI80wD00pzg0t+V6aAtf jEWRCiKmGWNNV+PwIQIydryAy3uNEydqbpbmmAkpxDPWzm9POYs68Cdmn3cH7MlyWJvACVT1pTX HOuDJI3ywN4hkjcFpVzKJoXFr3Ubo/mBeDPky5zOT27lF+ePmNfviTTHb9Mjv/MrbNmb6iE0xo0 ttgp1OYKP7QFhY3IzN54yPitzD2Wt1eYaGkSwB+Hkz6WZafATjYLm+v4Ey2BFTL4JsJF11S1xo+ Voq6j7iH6oMIzyFsA+wNH1PkMq+aIRoGoFDxx9NCHApCBRUJnqsnzzIP17bkclTjFlFtoZFPZxh sJsrrnm614 X-Received: by 2002:a05:622a:1ba3:b0:50b:8c01:2100 with SMTP id d75a77b69052e-50b8c0126e5mr20402441cf.62.1774449780409; Wed, 25 Mar 2026 07:43:00 -0700 (PDT) X-Received: by 2002:a05:622a:1ba3:b0:50b:8c01:2100 with SMTP id d75a77b69052e-50b8c0126e5mr20401581cf.62.1774449779680; Wed, 25 Mar 2026 07:42:59 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:a7db:2283:19fe:fa8a? ([2a05:6e02:1041:c10:a7db:2283:19fe:fa8a]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-487116ee514sm163278995e9.13.2026.03.25.07.42.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Mar 2026 07:42:58 -0700 (PDT) Message-ID: <28a09389-9fdf-49d8-84a6-4e68c40b5224@oss.qualcomm.com> Date: Wed, 25 Mar 2026 15:42:57 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [EXT] Re: [PATCH v4 3/4] clocksource/drivers/timer-mediatek: Convert timer-mediatek to a loadable module To: Zhipeng Wang Cc: "daniel.lezcano@linaro.org" , "tglx@kernel.org" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "matthias.bgg@gmail.com" , "angelogioacchino.delregno@collabora.com" , "linux-kernel@vger.kernel.org" , "imx@lists.linux.dev" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "chun-hung.wu@mediatek.com" , "walter.chang@mediatek.com" , "jstultz@google.com" , "amergnat@baylibre.com" , Aisheng Dong , Jindong Yue , Xuegang Liu , Greg Kroah-Hartman References: <20260304081207.4030882-1-zhipeng.wang_1@nxp.com> <20260304081207.4030882-4-zhipeng.wang_1@nxp.com> <6255aa0f-529c-41cb-be32-e5d54a839125@oss.qualcomm.com> <019942a0-e9f2-45f1-8e04-26ecc9822705@oss.qualcomm.com> Content-Language: en-US From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzI1MDEwNSBTYWx0ZWRfX+RlMNFBTOBJn QZClOP3E5NpbGVK+Kr6+905wJxFE5crrM+4y0zc7sKxH3bswhkFdC6HwrRROlTRaJ4c2hKyqu3Q BZvKMueszkRgsfsaQbihIAU9iNK7urPKDmlcPJZXWjSTMC6jPArPwi3yxcVX5TyOsnhFVTKNxQB srIinQ/mHpclS99/Mmsy49WSlpPfWZ6GhLUZNV+NeFeJRcbVHB3U72rOI8v9ullqZP5gfSFbmQU wW73QeVKdyWin0MGewYucfDNpL8tgrVWProtwQ+kl1i8vgj/eaVwiL4EI0kdr0zNldRjLOGxcS9 iKXbAKCM1seDt0TNweELveVDHsK/UbCfxD3taTpk5hDUPSQsrOTGw1A9g5vQa47EDgt0vrBjM+Z msqsvf8dISt+mkgIo3QOC48ZrX33z7BDFnbjtNs5KPDofNuMt/kFN/r9vsaTb0RvTmMRFCNQEv4 OTmf+3oMJnnuUBETW6g== X-Proofpoint-GUID: hhiZSht0hKgFY1FwkPBvDPGmRaQgU1x8 X-Proofpoint-ORIG-GUID: hhiZSht0hKgFY1FwkPBvDPGmRaQgU1x8 X-Authority-Analysis: v=2.4 cv=O7w0fR9W c=1 sm=1 tr=0 ts=69c3f475 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=Zs_j8f1EyT6rY914oN0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-25_04,2026-03-24_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 bulkscore=0 phishscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603250105 Hi Zhipeng, On 3/10/26 09:41, Zhipeng Wang wrote: >> >> >> Hi Zhipeng, >> >> On 3/9/26 06:31, Zhipeng Wang wrote: >>> Hello Daniel, >>> >>> I'd be very happy to collaborate on this! >> >> Great, let me see if I can cook a patch in the next days >> >>> My availability: I can dedicate time to work on this over the next few weeks. >> I'm happy to help with: >>> - Testing the new macros with IMX timer drivers >>> - Converting existing drivers as examples >>> - Reviewing and testing patches >>> - Documentation >> >> That's awesome, thanks >> >>> My understanding is that, based on your RFC, we should use two macros — >> TIMER_OF_DECLARE_PDEV and TIMER_OF_DECLARE_PLATFORM_DRIVER. >> >> Yes, but also sort out the existing TIMER_OF_DECLARE macro vs MODULE in >> order to prevent #ifdef MODULE in the drivers >> > Hi Daniel, > > Yes, that's our goal. > > I'll test the new macros (TIMER_OF_DECLARE_PLATFORM_DRIVER and > TIMER_OF_DECLARE_EARLY_PLATFORM_DRIVER) with the IMX timer drivers > once the patches are available. I think I have an idea on how to achieve that. That will result in the removal of TIMER_OF_DECLARE() when all drivers will be changed to use the new macro. The #ifdef MODULE macro is set when the driver is compiled as a module. So we can do something like: #ifdef MODULE #define TIMER_OF_DECLARE_PDEV(name, compat, data, fn) \ OF_DECLARE_1_RET(timer_pdev, name, compat, data, fn) #else #define TIMER_OF_DECLARE_PDEV(__name, compat, data, fn) \ OF_DECLARE_1_RET(of_pdev_timer_match_table, __name, compat, data, fn) static struct platform_driver __##__name##_timer_driver = { .probe = __##__name##_timer_probe, .driver = { .name = name, .of_match_table = of_pdev_timer_match_table, }, }; module_platform_driver(__##__name##_timer_driver); #endif So we deal with two tables, one for platform device non module and one module for modules. The first one is called by the timer-of init routine. The other one is called by the probe function. The drawback will be the match table will be common to all timer drivers. So probe will be a bit slower. May be there is an area of optimization here.