From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 AE1FB33858E for ; Fri, 19 Dec 2025 19:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766172771; cv=none; b=nKCo74+gaRfLHhf6/ieRdqR0S7T6JHUKnWLG6sfX+EDZUWZLGYzZoWNSVxrZXy82cCActIjf2IiqWEm9FP4T5ivBxLdR6HqxjIg41zfGnG2kstJdmbXuqbj0jbuFpM7bXfAOsQ0fZ4f9sFZTtfIMZ9nfyol/nd3feub/UjHPzPA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766172771; c=relaxed/simple; bh=3kIb5PaWJTv5Meiy1ecCsXsOoIrJW1HzqQZiofEH0Kk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ECjLI9XUbwg9qrrWA6+0cItg9RWDgNyN+bjp3Cp2U8rFgFPoOTUE8BMVNxGzQAP1Ai1wZE9iFo38gL265cCNvMxRagsOCyIXM+DyArVU9ocv83iC+4dcSneJpMJV4p4UMWx9Rys/UFFVwxZo6VrSo/OieYYGl7VjHQ0K35Nrves= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ic1R47kb; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=MEOjDYSY; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ic1R47kb"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="MEOjDYSY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766172767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Bsy3mdlm/wcMmAZZX12T2tp26u7IDK5gsFrOm+g9New=; b=Ic1R47kbPCjc91qdqAVNNG2ejq3VLlYpGJXTgaPQCbmf0DY9ilu35o+MuLgcrkp5dxwtKU zxjB6tDGt4SHsP3/fYYG8/XvYPL9QC3mNtdG+hvz0MJseGUOTzzRJfnGyU8Ll1qapMi48M Lpla/dHTHngqpJWLX8rUkbVKD6HUqgU= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-260-OWFG9GjMOIuuXYL_6xVmUQ-1; Fri, 19 Dec 2025 14:32:46 -0500 X-MC-Unique: OWFG9GjMOIuuXYL_6xVmUQ-1 X-Mimecast-MFC-AGG-ID: OWFG9GjMOIuuXYL_6xVmUQ_1766172765 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8b2e41884a0so515486685a.1 for ; Fri, 19 Dec 2025 11:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1766172765; x=1766777565; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Bsy3mdlm/wcMmAZZX12T2tp26u7IDK5gsFrOm+g9New=; b=MEOjDYSYnTuVpy071RI6EZDZ0XPhMHoiWLYt0cETHT/qRsoeAIpM0au5cD4fsvhmdI Rsc7mMoiAk0hkGp9fcAyVonvbUHWUjh0e91rYeMVB1L9q8lLMBkR1UX5amTIDaFmOcFb 1vuP6oEOjULx4HjrTAzBWSexYV1cCwhTCDuQHYQR8V5ZamTh3z44TTJw5016ZT5O5JQF 20RoFG+CCZL8KYX8SXXgD6Ce4p/awkuw5q4YQLEkZ+4bb4gb1tWx2C5pTZ2T8xkTsYvh qdh3hvWh188RaenQ011Z1b9gmHnwlHoMbanPu+uY2dJngbWLzF5d/DTb5zJfCJS40kgN Hx4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766172765; x=1766777565; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Bsy3mdlm/wcMmAZZX12T2tp26u7IDK5gsFrOm+g9New=; b=spBwZ7y/qwhnre+XgWiurVsBogOR1lrx61ymZ1aRa3dadTbKhl3ZW7bUHihYh+tnmT hXGR+De2hYwTi22GyJfJn1rhXpCZAJdKrLH/LpE9vJfyvcfc7rE4MhBv1VOMLhGmupl0 l05bYnJKt2iLKqvh37AW3XdLDSJsf+kJSXJ5EoPzGBNamIfGPFf0oxckmr+TWTpYfgOW TWNBYxQ7pikpiO/PAtpjaXt2VYXhPwzAsLvEW278788Q3zLRMDj111vzT8avnuJ/ytG0 Sj0sfjhvdx8x9YlJY8QAxvxpswIW5O7zrUKQYiePzvWbK5T9K12h8RXv+IGQSbqSBgJZ rf3g== X-Forwarded-Encrypted: i=1; AJvYcCWQ5Ax3GqvkjAkqbmpXgK1viURl9QQcEq1MEIFo/WBxalVdGTday8/tixJuigP3UY4LMljeUh7uLE8aZGQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwfZK8yYOXL8KPoUAYb6yZ+EL1WeuJLKaT4u8gZSnrP+hkIpM2e aNHw1FZANOql+EgOp9SyoiD8sP2TXzyqNbjpumeIcbADUINwinw33r13On2Cd42nhLgkYkww6tQ xiK7KZHlD+L82l7aLQGz+5X/1Je4558ylCYLiUo+WWmVpWWOGb2PhUBmp8Y4jCceo3A== X-Gm-Gg: AY/fxX6z4a9YUO+Wp482blBZVfiZIdS+oSFMESoR9DMFJ1sAo2p9Bt+lrFA5xim8+jD 65eOFiwngSxNA5rFII+bkA8E9tFJM0mPUfCjKdtXpQB/Dq2Dv0b8KyEZAEPu6w7/FZFq67i7pCT VP6SL/7KyBAItxj/Dk3YsLLuGaoecJj4X6J9FAFTVZC/elp4oGubUbnLp4NM/5xdOL/uemo8QWj a+Gx2WpdfRzb239YX/er4aO6D9h5sdO5cC73a38ULqh09EQyyoS+xGXRaSNB0t8Cm1/aULu4Aco BcKMND+lY1tetKSWPkeqBMqFZ8BPjgy2DZDmjxx6uQ+NEluECTBJkqAbOefwolaF/7zmvU7eWJV chaUyAbfe X-Received: by 2002:a05:620a:28c6:b0:8b3:274c:d9f8 with SMTP id af79cd13be357-8c08fab5bf8mr659813785a.22.1766172764742; Fri, 19 Dec 2025 11:32:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IE6jXx/pJ6yJLMkL8SEFSwefUId8AraZsRhep9+Ucw+RTY73PJ4OfxckFz9DDiO4dvIadDlVw== X-Received: by 2002:a05:620a:28c6:b0:8b3:274c:d9f8 with SMTP id af79cd13be357-8c08fab5bf8mr659809985a.22.1766172764311; Fri, 19 Dec 2025 11:32:44 -0800 (PST) Received: from redhat.com ([2600:382:8519:53fe:9d9a:13fe:abf1:fb80]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8c0970f880bsm241678085a.32.2025.12.19.11.32.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Dec 2025 11:32:43 -0800 (PST) Date: Fri, 19 Dec 2025 14:32:41 -0500 From: Brian Masney To: Claudiu Beznea Cc: Michael Turquette , Stephen Boyd , Maxime Ripard , Conor Dooley , Dan Carpenter , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/4] clk: microchip: core: allow driver to be compiled with COMPILE_TEST Message-ID: References: <20251205-clk-microchip-fixes-v3-0-a02190705e47@redhat.com> <20251205-clk-microchip-fixes-v3-4-a02190705e47@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.14 (2025-02-20) Hi Claudiu, Sorry about the delay writing back. I was at Linux Plumbers in Tokyo. On Sat, Dec 06, 2025 at 04:28:31PM +0200, Claudiu Beznea wrote: > On 12/5/25 21:46, Brian Masney wrote: > > This driver currently only supports builds against a PIC32 target. To > > avoid future breakage in the future, let's update the Kconfig and the > > driver so that it can be built with CONFIG_COMPILE_TEST enabled. > > > > Note that with the existing asm calls is not how I'd want to do this > > today if this was a new driver, however I don't have access to this > > hardware. To avoid any breakage, let's keep the existing behavior. > > > > Signed-off-by: Brian Masney > > --- > > drivers/clk/microchip/Kconfig | 2 +- > > drivers/clk/microchip/clk-core.c | 32 +++++++++++++++++++++++--------- > > 2 files changed, 24 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/clk/microchip/Kconfig b/drivers/clk/microchip/Kconfig > > index 1b9e43eb54976b219a0277cc971f353fd6af226a..1e56a057319d97e20440fe4e107d26fa85c95ab1 100644 > > --- a/drivers/clk/microchip/Kconfig > > +++ b/drivers/clk/microchip/Kconfig > > @@ -1,7 +1,7 @@ > > # SPDX-License-Identifier: GPL-2.0 > > > > config COMMON_CLK_PIC32 > > - def_bool COMMON_CLK && MACH_PIC32 > > + def_bool (COMMON_CLK && MACH_PIC32) || COMPILE_TEST > > > > config MCHP_CLK_MPFS > > bool "Clk driver for PolarFire SoC" > > diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c > > index f467d7bc28c87a50fb18dc527574f973c4b7e615..fad4b45d908310ffb59e4ed57c55ae4266253444 100644 > > --- a/drivers/clk/microchip/clk-core.c > > +++ b/drivers/clk/microchip/clk-core.c > > @@ -9,7 +9,15 @@ > > #include > > #include > > #include > > + > > +#if !defined(CONFIG_MACH_PIC32) && defined(CONFIG_COMPILE_TEST) > > Can't we have something like: > > #if defined(CONFIG_MATCH_PIC32) > #include > #else > #define PIC32_CLR(_reg) ((_reg) + 0x04) > #define PIC32_SET(_reg) ((_reg) + 0x08) > #define PIC32_INV(_reg) ((_reg) + 0x0C) > #define pic32_syskey_unlock() > #endif Yes, I agree that would be simpler. > > +#define PIC32_CLR(_reg) ((_reg) + 0x04) > > +#define PIC32_SET(_reg) ((_reg) + 0x08) > > +#define PIC32_INV(_reg) ((_reg) + 0x0C) > > +#define pic32_syskey_unlock() > > On the other side, there are other drivers using these defines, maybe a > unified approach would fit better? Maybe moving these to > include/linux/platform_data ? I agree that would be the better approach. Specifically: - Move arch/mips/include/asm/mach-pic32/pic32.h to include/linux/platform_data - Drop the unused include linux/io.h in pic32.h - Check for CONFIG_MATCH_PIC32 for the pic32_syskey_unlock define. Make it a noop for all other architectures. That would allow us to have the following in the drivers, with no #if's: #include I initially wanted to go this route, and I feel that's the best technical decision, however my only hesitation is that this is going to touch at least 8 different subsystems. I could probably get the MIPS folks to take all of this, however it's going to be a pain to collect all of the ACKs from the different subsystems. x1:~/src/linux/linus (master %)$ git grep pic32.h arch/mips/pic32/common/reset.c:#include arch/mips/pic32/common/reset.c:static void pic32_halt(void) arch/mips/pic32/common/reset.c: pic32_halt(); arch/mips/pic32/common/reset.c: pic32_halt(); arch/mips/pic32/pic32mzda/config.c:#include arch/mips/pic32/pic32mzda/early_clk.c:#include arch/mips/pic32/pic32mzda/early_console.c:#include arch/mips/pic32/pic32mzda/init.c:#include drivers/clk/microchip/clk-core.c:#include drivers/irqchip/irq-pic32-evic.c:#include drivers/mmc/host/sdhci-pic32.c:#include drivers/pinctrl/pinctrl-pic32.c:#include drivers/pinctrl/pinctrl-pic32.c:#include "pinctrl-pic32.h" drivers/rtc/rtc-pic32.c:#include drivers/tty/serial/pic32_uart.c:#include drivers/watchdog/pic32-dmt.c:#include drivers/watchdog/pic32-wdt.c:#include Thoughts? > > +#if !defined(CONFIG_MACH_PIC32) && defined(CONFIG_COMPILE_TEST) > > Same here, can't we have: > > #ifdef CONFIG_MATCH_PIC32 > #define cpu_nop5() \ > do { \ > __asm__ __volatile__("nop"); \ > __asm__ __volatile__("nop"); \ > __asm__ __volatile__("nop"); \ > __asm__ __volatile__("nop"); \ > __asm__ __volatile__("nop"); \ > } while (0) > #else > #define cpu_nop5() > #endif Yes that sounds good. Brian