module: Convert symbol namespace to string literalClean up the existing export namespace code along the same lines ofcommit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)to __s
module: Convert symbol namespace to string literalClean up the existing export namespace code along the same lines ofcommit 33def8498fdd ("treewide: Convert macro and uses of __section(foo)to __section("foo")") and for the same reason, it is not desired for thenamespace argument to be a macro expansion itself.Scripted using git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file; do awk -i inplace ' /^#define EXPORT_SYMBOL_NS/ { gsub(/__stringify\(ns\)/, "ns"); print; next; } /^#define MODULE_IMPORT_NS/ { gsub(/__stringify\(ns\)/, "ns"); print; next; } /MODULE_IMPORT_NS/ { $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g"); } /EXPORT_SYMBOL_NS/ { if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) { if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ && $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ && $0 !~ /^my/) { getline line; gsub(/[[:space:]]*\\$/, ""); gsub(/[[:space:]]/, "", line); $0 = $0 " " line; } $0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/, "\\1(\\2, \"\\3\")", "g"); } } { print }' $file; doneRequested-by: Masahiro Yamada <masahiroy@kernel.org>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlcAcked-by: Greg KH <gregkh@linuxfoundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
clock, reset: microchip: move all mpfs reset code to the reset subsystemStephen and Philipp, while reviewing patches, said that all of the auxdevice creation and the register read/write code could
clock, reset: microchip: move all mpfs reset code to the reset subsystemStephen and Philipp, while reviewing patches, said that all of the auxdevice creation and the register read/write code could be moved to thereset subsystem, leaving the clock driver with no implementations ofreset_* functions at all. Move them.Suggested-by: Philipp Zabel <p.zabel@pengutronix.de>Suggested-by: Stephen Boyd <sboyd@kernel.org>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Link: https://lore.kernel.org/r/20240424-strangle-sharpener-34755c5e6e3e@spudSigned-off-by: Stephen Boyd <sboyd@kernel.org>
clk: microchip: mpfs: convert MSSPLL outputs to clk_dividerAfter splitting the MSSPLL in two, the PLL outputs have becomeopen-coded versions of clk_divider. Drop the custom clk ops structs, andin
clk: microchip: mpfs: convert MSSPLL outputs to clk_dividerAfter splitting the MSSPLL in two, the PLL outputs have becomeopen-coded versions of clk_divider. Drop the custom clk ops structs, andinstead use the generic clk_divider_ops.Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
clk: microchip: mpfs: add missing MSSPLL outputsThe MSSPLL has 4 outputs, of which only the cpu/axi/ahb clock parent iscurrently implemented.Add the CAN clock too, as that'll be needed by the dri
clk: microchip: mpfs: add missing MSSPLL outputsThe MSSPLL has 4 outputs, of which only the cpu/axi/ahb clock parent iscurrently implemented.Add the CAN clock too, as that'll be needed by the driver for the CANcontroller and uses output 3.While we are here, the other two missing clocks, used by the eMMC/SDcontroller and by the "user crypto".Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
clk: microchip: mpfs: setup for using other mss pll outputsNow that the MSSPLL is split, and the "postdiv" divider of thecpu/AHB/AXI bus clock is represented by its own "hw" struct, make theshift
clk: microchip: mpfs: setup for using other mss pll outputsNow that the MSSPLL is split, and the "postdiv" divider of thecpu/AHB/AXI bus clock is represented by its own "hw" struct, make theshifts, register offset and width a parameter of the initialisationmacro, rather than using defines that only work for one of the fouroutputs.Configuring this at initialisaion paves the way for using the otherthree output clocks, where the register offset, and the bit shiftwithin that register, will differ.Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
clk: microchip: mpfs: split MSSPLL in twoThe MSSPLL is really two stages - there's the PLL itself and 4 outputs,each with their own divider. The current driver models this as a singleentity, outp
clk: microchip: mpfs: split MSSPLL in twoThe MSSPLL is really two stages - there's the PLL itself and 4 outputs,each with their own divider. The current driver models this as a singleentity, outputting a single clock, used for both the CPU and AHB/AXIbuses. The other 3 outputs are used for the eMMC, "user crypto" and CANcontroller. Split the MSSPLL in two, as a precursor to adding supportfor the other 3 outputs, with the PLL itself as one "hw" clock and theoutput divider stage as another.Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
clk: microchip: mpfs-ccc: replace include of asm-generic/errno-base.hAs evidenced by the fact that only 2 other drivers include this header,it is not a normal thing to do. Including the regular ve
clk: microchip: mpfs-ccc: replace include of asm-generic/errno-base.hAs evidenced by the fact that only 2 other drivers include this header,it is not a normal thing to do. Including the regular version of thisheader is far more conventional for drivers.Acked-by: Al Viro <viro@zeniv.linux.org.uk>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Link: https://lore.kernel.org/r/20231214-dipper-earshot-72eef3059961@spudSigned-off-by: Stephen Boyd <sboyd@kernel.org>
clk: Explicitly include correct DT includesThe DT of_device.h and of_platform.h date back to the separateof_platform_bus_type before it as merged into the regular platform bus.As part of that mer
clk: Explicitly include correct DT includesThe DT of_device.h and of_platform.h date back to the separateof_platform_bus_type before it as merged into the regular platform bus.As part of that merge prepping Arm DT support 13 years ago, they"temporarily" include each other. They also include platform_device.hand of.h. As a result, there's a pretty much random mix of those includefiles used throughout the tree. In order to detangle these headers andreplace the implicit includes with struct declarations, users need toexplicitly include the correct includes.Acked-by: Dinh Nguyen <dinguyen@kernel.org>Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> # samsungAcked-by: Heiko Stuebner <heiko@sntech.de> #rockchipAcked-by: Chanwoo Choi <cw00.choi@samsung.com>Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> # versaclock5Signed-off-by: Rob Herring <robh@kernel.org>Link: https://lore.kernel.org/r/20230718143156.1066339-1-robh@kernel.orgAcked-by: Abel Vesa <abel.vesa@linaro.org> #imxSigned-off-by: Stephen Boyd <sboyd@kernel.org>
clk: microchip: Use of_property_read_bool() for boolean propertiesIt is preferred to use typed property access functions (i.e.of_property_read_<type> functions) rather than low-levelof_get_proper
clk: microchip: Use of_property_read_bool() for boolean propertiesIt is preferred to use typed property access functions (i.e.of_property_read_<type> functions) rather than low-levelof_get_property/of_find_property functions for reading properties.Convert reading boolean properties to to of_property_read_bool().Signed-off-by: Rob Herring <robh@kernel.org>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20230310144701.1541573-1-robh@kernel.org
clk: microchip: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIREAs part of converting RISC-V SOC_FOO symbols to ARCH_FOO to match theuse of such symbols on other architectures, convert
clk: microchip: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIREAs part of converting RISC-V SOC_FOO symbols to ARCH_FOO to match theuse of such symbols on other architectures, convert the Microchip FPGAclock drivers to use the new symbol.Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20230309204452.969574-2-conor@kernel.org
Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linuxPull clk updates from Stephen Boyd: "Nothing looks out of the ordinary in this batch of clk driver updates. T
Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linuxPull clk updates from Stephen Boyd: "Nothing looks out of the ordinary in this batch of clk driver updates. There are a couple patches to the core clk framework, but they're all basically cleanups or debugging aids. The driver updates and new additions are dominated in the diffstat by Qualcomm and MediaTek drivers. Qualcomm gained a handful of new drivers for various SoCs, and MediaTek gained a bunch of drivers for MT8188. The MediaTek drivers are being modernized as well, so there are updates all over that vendor's clk drivers. There's also a couple other new clk drivers in here, for example the Starfive JH7110 SoC support is added. Outside of the two major SoC vendors though, we have the usual collection of non-critical fixes and cleanups to various clk drivers. It's good to see that we're getting more cleanups and modernization patches. Maybe one day we'll be able to properly split clk providers from clk consumers. Core: - Print an informational message before disabling unused clks New Drivers: - BCM63268 timer clock and reset controller - Frequency Hopping (FHCTL) on MediaTek MT6795, MT8173, MT8192 and MT8195 SoCs - Mediatek MT8188 SoC clk drivers - Clock driver for Sunplus SP7021 SoC - Clk driver support for Loongson-2 SoCs - Clock driver for Skyworks Si521xx I2C PCIe clock generators - Initial Starfive JH7110 clk/reset support - Global clock controller drivers for Qualcomm SM7150, IPQ9574, MSM8917 and IPQ5332 SoCs - GPU clock controller drivers for SM6115, SM6125, SM6375 and SA8775P SoCs Updates: - Shrink size of clk_fractional_divider a little - Convert various clk drivers to devm_of_clk_add_hw_provider() - Convert platform clk drivers to remove_new() - Converted most Mediatek clock drivers to struct platform_driver - MediaTek clock drivers can be built as modules - Reimplement Loongson-1 clk driver with DT support - Migrate socfpga clk driver to of_clk_add_hw_provider() - Support for i3c clks on Aspeed ast2600 SoCs - Add clock generic devm_clk_hw_register_gate_parent_data - Add audiomix block control for i.MX8MP - Add support for determine_rate to i.MX composite-8m - Let the LCDIF Pixel clock of i.MX8MM and i.MX8MN set parent rate - Provide clock name in error message for clk-gpr-mux on get parent failure - Drop duplicate imx_clk_mux_flags macro - Register the i.MX8MP Media Disp2 Pix clock as bus clock - Add Media LDB root clock to i.MX8MP - Make i.MX8MP nand_usdhc_bus clock as non-critical - Fix the rate table for i.MX fracn-gppll - Disable HW control for the fracn-gppll in order to be controlled by register write - Add support for interger PLL in fracn-gppll - Add mcore_booted module parameter to i.MX93 provider - Add NIC, A55 and ARM PLL clocks to i.MX93 - Fix i.MX8ULP XBAR_DIVBUS and AD_SLOW clock parents - Use "divider closest" clock type for PLL4_PFD dividers on i.MX8ULP to get more accurate clock rates - Mark the MU0_Bi and TPM5 clocks on i.MX8ULP as critical - Update some of the i.MX critical clocks flags to allow glitchless on-the-fly rate change. - Add I2C5 clock on Renesas R-Car V3H - Exynos850: Add CMU_G3D clock controller for the Mali GPU - Extract Exynos5433 (ARM64) clock controller power management code to common driver parts - Exynos850: make PMU_ALIVE_PCLK clock critical - Add Audio, thermal, camera (CSI-2), Image Signal Processor/Channel Selector (ISPCS), and video capture (VIN) clocks on Renesas R-Car V4H - Add video capture (VIN) clocks on Renesas R-Car V3H - Add Cortex-A53 System CPU (Z2) clocks on Renesas R-Car V3M and V3H - Support for Stromer Plus PLL on Qualcomm IPQ5332 - Add a missing reset to Qualcomm QCM2290 - Migrate Qualcomm IPQ4019 to clk_parent_data - Make USB GDSCs enter retention state when disabled on Qualcomm SM6375, MSM8996 and MSM8998 SoCs - Set floor rounding clk_ops for Qualcomm QCM2290 SDCC2 clk - Add two EMAC GDSCs on Qualcomm SC8280XP - Use shared rcg clk ops in Qualcomm SM6115 GCC - Park Qualcomm SM8350 PCIe PIPE clks when disabled - Add GDSCs to Qualcomm SC7280 LPASS audio clock controller - Add missing XO clocks to Qualcomm MSM8226 and MSM8974 - Convert some Qualcomm clk DT bindings to YAML - Reparenting fix for the clock supplying camera modules on Rockchip rk3399 - Mark more critical (bus-)clocks on Rockchip rk3588"* tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (290 commits) clk: qcom: gcc-sc8280xp: Add EMAC GDSCs clk: starfive: Delete the redundant dev_set_drvdata() in JH7110 clock drivers clk: rockchip: rk3588: make gate linked clocks critical clk: qcom: dispcc-qcm2290: Remove inexistent DSI1PHY clk clk: qcom: add the GPUCC driver for sa8775p dt-bindings: clock: qcom: describe the GPUCC clock for SA8775P clk: qcom: gcc-sm8350: fix PCIe PIPE clocks handling clk: qcom: lpassaudiocc-sc7280: Add required gdsc power domain clks in lpass_cc_sc7280_desc clk: qcom: lpasscc-sc7280: Skip qdsp6ss clock registration dt-bindings: clock: qcom,sc7280-lpasscc: Add qcom,adsp-pil-mode property clk: starfive: Avoid casting iomem pointers clk: microchip: fix potential UAF in auxdev release callback clk: qcom: rpm: Use managed `of_clk_add_hw_provider()` clk: mediatek: fhctl: Mark local variables static clk: sifive: make SiFive clk drivers depend on ARCH_ symbols clk: uniphier: Use managed `of_clk_add_hw_provider()` clk: si5351: Use managed `of_clk_add_hw_provider()` clk: si570: Use managed `of_clk_add_hw_provider()` clk: si514: Use managed `of_clk_add_hw_provider()` clk: lmk04832: Use managed `of_clk_add_hw_provider()` ...
Merge tag 'modules-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linuxPull module updates from Luis Chamberlain: "The summary of the changes for this pull requests is: - Son
Merge tag 'modules-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linuxPull module updates from Luis Chamberlain: "The summary of the changes for this pull requests is: - Song Liu's new struct module_memory replacement - Nick Alcock's MODULE_LICENSE() removal for non-modules - My cleanups and enhancements to reduce the areas where we vmalloc module memory for duplicates, and the respective debug code which proves the remaining vmalloc pressure comes from userspace. Most of the changes have been in linux-next for quite some time except the minor fixes I made to check if a module was already loaded prior to allocating the final module memory with vmalloc and the respective debug code it introduces to help clarify the issue. Although the functional change is small it is rather safe as it can only *help* reduce vmalloc space for duplicates and is confirmed to fix a bootup issue with over 400 CPUs with KASAN enabled. I don't expect stable kernels to pick up that fix as the cleanups would have also had to have been picked up. Folks on larger CPU systems with modules will want to just upgrade if vmalloc space has been an issue on bootup. Given the size of this request, here's some more elaborate details: The functional change change in this pull request is the very first patch from Song Liu which replaces the 'struct module_layout' with a new 'struct module_memory'. The old data structure tried to put together all types of supported module memory types in one data structure, the new one abstracts the differences in memory types in a module to allow each one to provide their own set of details. This paves the way in the future so we can deal with them in a cleaner way. If you look at changes they also provide a nice cleanup of how we handle these different memory areas in a module. This change has been in linux-next since before the merge window opened for v6.3 so to provide more than a full kernel cycle of testing. It's a good thing as quite a bit of fixes have been found for it. Jason Baron then made dynamic debug a first class citizen module user by using module notifier callbacks to allocate / remove module specific dynamic debug information. Nick Alcock has done quite a bit of work cross-tree to remove module license tags from things which cannot possibly be module at my request so to: a) help him with his longer term tooling goals which require a deterministic evaluation if a piece a symbol code could ever be part of a module or not. But quite recently it is has been made clear that tooling is not the only one that would benefit. Disambiguating symbols also helps efforts such as live patching, kprobes and BPF, but for other reasons and R&D on this area is active with no clear solution in sight. b) help us inch closer to the now generally accepted long term goal of automating all the MODULE_LICENSE() tags from SPDX license tags In so far as a) is concerned, although module license tags are a no-op for non-modules, tools which would want create a mapping of possible modules can only rely on the module license tag after the commit 8b41fc4454e ("kbuild: create modules.builtin without Makefile.modbuiltin or tristate.conf"). Nick has been working on this *for years* and AFAICT I was the only one to suggest two alternatives to this approach for tooling. The complexity in one of my suggested approaches lies in that we'd need a possible-obj-m and a could-be-module which would check if the object being built is part of any kconfig build which could ever lead to it being part of a module, and if so define a new define -DPOSSIBLE_MODULE [0]. A more obvious yet theoretical approach I've suggested would be to have a tristate in kconfig imply the same new -DPOSSIBLE_MODULE as well but that means getting kconfig symbol names mapping to modules always, and I don't think that's the case today. I am not aware of Nick or anyone exploring either of these options. Quite recently Josh Poimboeuf has pointed out that live patching, kprobes and BPF would benefit from resolving some part of the disambiguation as well but for other reasons. The function granularity KASLR (fgkaslr) patches were mentioned but Joe Lawrence has clarified this effort has been dropped with no clear solution in sight [1]. In the meantime removing module license tags from code which could never be modules is welcomed for both objectives mentioned above. Some developers have also welcomed these changes as it has helped clarify when a module was never possible and they forgot to clean this up, and so you'll see quite a bit of Nick's patches in other pull requests for this merge window. I just picked up the stragglers after rc3. LWN has good coverage on the motivation behind this work [2] and the typical cross-tree issues he ran into along the way. The only concrete blocker issue he ran into was that we should not remove the MODULE_LICENSE() tags from files which have no SPDX tags yet, even if they can never be modules. Nick ended up giving up on his efforts due to having to do this vetting and backlash he ran into from folks who really did *not understand* the core of the issue nor were providing any alternative / guidance. I've gone through his changes and dropped the patches which dropped the module license tags where an SPDX license tag was missing, it only consisted of 11 drivers. To see if a pull request deals with a file which lacks SPDX tags you can just use: ./scripts/spdxcheck.py -f \ $(git diff --name-only commid-id | xargs echo) You'll see a core module file in this pull request for the above, but that's not related to his changes. WE just need to add the SPDX license tag for the kernel/module/kmod.c file in the future but it demonstrates the effectiveness of the script. Most of Nick's changes were spread out through different trees, and I just picked up the slack after rc3 for the last kernel was out. Those changes have been in linux-next for over two weeks. The cleanups, debug code I added and final fix I added for modules were motivated by David Hildenbrand's report of boot failing on a systems with over 400 CPUs when KASAN was enabled due to running out of virtual memory space. Although the functional change only consists of 3 lines in the patch "module: avoid allocation if module is already present and ready", proving that this was the best we can do on the modules side took quite a bit of effort and new debug code. The initial cleanups I did on the modules side of things has been in linux-next since around rc3 of the last kernel, the actual final fix for and debug code however have only been in linux-next for about a week or so but I think it is worth getting that code in for this merge window as it does help fix / prove / evaluate the issues reported with larger number of CPUs. Userspace is not yet fixed as it is taking a bit of time for folks to understand the crux of the issue and find a proper resolution. Worst come to worst, I have a kludge-of-concept [3] of how to make kernel_read*() calls for modules unique / converge them, but I'm currently inclined to just see if userspace can fix this instead"Link: https://lore.kernel.org/all/Y/kXDqW+7d71C4wz@bombadil.infradead.org/ [0]Link: https://lkml.kernel.org/r/025f2151-ce7c-5630-9b90-98742c97ac65@redhat.com [1]Link: https://lwn.net/Articles/927569/ [2]Link: https://lkml.kernel.org/r/20230414052840.1994456-3-mcgrof@kernel.org [3]* tag 'modules-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: (121 commits) module: add debugging auto-load duplicate module support module: stats: fix invalid_mod_bytes typo module: remove use of uninitialized variable len module: fix building stats for 32-bit targets module: stats: include uapi/linux/module.h module: avoid allocation if module is already present and ready module: add debug stats to help identify memory pressure module: extract patient module check into helper modules/kmod: replace implementation with a semaphore Change DEFINE_SEMAPHORE() to take a number argument module: fix kmemleak annotations for non init ELF sections module: Ignore L0 and rename is_arm_mapping_symbol() module: Move is_arm_mapping_symbol() to module_symbol.h module: Sync code of is_arm_mapping_symbol() scripts/gdb: use mem instead of core_layout to get the module address interconnect: remove module-related code interconnect: remove MODULE_LICENSE in non-modules zswap: remove MODULE_LICENSE in non-modules zpool: remove MODULE_LICENSE in non-modules x86/mm/dump_pagetables: remove MODULE_LICENSE in non-modules ...
clk: microchip: fix potential UAF in auxdev release callbackSimilar to commit 1c11289b34ab ("peci: cpu: Fix use-after-free inadev_release()"), the auxiliary device is not torn down in the correct
clk: microchip: fix potential UAF in auxdev release callbackSimilar to commit 1c11289b34ab ("peci: cpu: Fix use-after-free inadev_release()"), the auxiliary device is not torn down in the correctorder. If auxiliary_device_add() fails, the release callback will becalled twice, resulting in a UAF. Due to timing, the auxdev code in thisdriver "took inspiration" from the aforementioned commit, and thus itsbugs too!Moving auxiliary_device_uninit() to the unregister callback insteadavoids the issue.CC: stable@vger.kernel.orgFixes: b56bae2dd6fd ("clk: microchip: mpfs: add reset controller")Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Link: https://lore.kernel.org/r/20230413-critter-synopsis-dac070a86cb4@spudSigned-off-by: Stephen Boyd <sboyd@kernel.org>
clk: microchip: mpfs: remove MODULE_LICENSE in non-modulesSince commit 8b41fc4454e ("kbuild: create modules.builtin withoutMakefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarationsare u
clk: microchip: mpfs: remove MODULE_LICENSE in non-modulesSince commit 8b41fc4454e ("kbuild: create modules.builtin withoutMakefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarationsare used to identify modules. As a consequence, uses of the macroin non-modules will cause modprobe to misidentify their containingobject file as a module when it is not (false positives), and modprobemight succeed rather than failing with a suitable error message.So remove it in the files in this commit, none of which can be built asmodules.Signed-off-by: Nick Alcock <nick.alcock@oracle.com>Suggested-by: Luis Chamberlain <mcgrof@kernel.org>Cc: Luis Chamberlain <mcgrof@kernel.org>Cc: linux-modules@vger.kernel.orgCc: linux-kernel@vger.kernel.orgCc: Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>Cc: Conor Dooley <conor.dooley@microchip.com>Cc: Daire McNamara <daire.mcnamara@microchip.com>Cc: Michael Turquette <mturquette@baylibre.com>Cc: Stephen Boyd <sboyd@kernel.org>Cc: linux-riscv@lists.infradead.orgCc: linux-clk@vger.kernel.orgSigned-off-by: Luis Chamberlain <mcgrof@kernel.org>
kbuild, clk: remove MODULE_LICENSE in non-modulesSince commit 8b41fc4454e ("kbuild: create modules.builtin withoutMakefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarationsare used to id
kbuild, clk: remove MODULE_LICENSE in non-modulesSince commit 8b41fc4454e ("kbuild: create modules.builtin withoutMakefile.modbuiltin or tristate.conf"), MODULE_LICENSE declarationsare used to identify modules. As a consequence, uses of the macroin non-modules will cause modprobe to misidentify their containingobject file as a module when it is not (false positives), and modprobemight succeed rather than failing with a suitable error message.So remove it in the files in this commit, none of which can be built asmodules.Signed-off-by: Nick Alcock <nick.alcock@oracle.com>Suggested-by: Luis Chamberlain <mcgrof@kernel.org>Cc: Luis Chamberlain <mcgrof@kernel.org>Cc: linux-modules@vger.kernel.orgCc: linux-kernel@vger.kernel.orgCc: Hitomi Hasegawa <hasegawa-hitomi@fujitsu.com>Cc: Michael Turquette <mturquette@baylibre.com>Cc: Stephen Boyd <sboyd@kernel.org>Cc: linux-clk@vger.kernel.orgLink: https://lore.kernel.org/r/20230222121453.91915-13-nick.alcock@oracle.comAcked-by: Conor Dooley <conor.dooley@microchip.com>Reviewed-by: Conor Dooley <conor.dooley@microchip.com>Signed-off-by: Stephen Boyd <sboyd@kernel.org>
clk: microchip: mpfs-ccc: Use devm_kasprintf() for allocating formatted stringsIn various places, string buffers of a fixed size are allocated, andfilled using snprintf() with the same fixed size,
clk: microchip: mpfs-ccc: Use devm_kasprintf() for allocating formatted stringsIn various places, string buffers of a fixed size are allocated, andfilled using snprintf() with the same fixed size, which is error-prone.Replace this by calling devm_kasprintf() instead, which always uses theappropriate size.While at it, remove an unneeded intermediate variable, which allows usto drop a cast as a bonus.With the initial behavior it would have been possible to have a device treewith a node address that would make "ccc<node_address>_pll<N>" exceed18 characters. If that happened, the <N> would be cut off & bothpll 0 & 1 would be named identically. If that happens, pll1 would failto register. Thus, the fixes tag has been added to this commit.Fixes: d39fb172760e ("clk: microchip: add PolarFire SoC fabric clock support")Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>Reviewed-by: Conor Dooley <conor.dooley@microchip.com>Tested-by: Conor Dooley <conor.dooley@microchip.com>[claudiu.beznea: added the rationale behind fixes tag]Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/f904fd28b2087d1463ea65f059924e3b1acc193c.1672764239.git.geert+renesas@glider.be
clk: microchip: enable the MPFS clk driver by default if SOC_MICROCHIP_POLARFIREWith the intent of removing driver selects from Kconfig.socs inarch/riscv, essential drivers that were being selecte
clk: microchip: enable the MPFS clk driver by default if SOC_MICROCHIP_POLARFIREWith the intent of removing driver selects from Kconfig.socs inarch/riscv, essential drivers that were being selected there couldinstead by enabled by defaulting them to the value of the SoC's Kconfigsymbol.Do so here & drop the depend on RISC-V - the SOC_ symbols are onlydefined there anyway.Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Link: https://lore.kernel.org/r/20221123161921.81195-1-conor@kernel.orgSigned-off-by: Stephen Boyd <sboyd@kernel.org>
clk: microchip: check for null return of devm_kzalloc()Because of the possible failure of devm_kzalloc(), name might be NULL andwill cause null pointer dereference later.Therefore, it might be b
clk: microchip: check for null return of devm_kzalloc()Because of the possible failure of devm_kzalloc(), name might be NULL andwill cause null pointer dereference later.Therefore, it might be better to check it and directly return -ENOMEM.Fixes: d39fb172760e ("clk: microchip: add PolarFire SoC fabric clock support")Signed-off-by: Hui Tang <tanghui20@huawei.com>Reviewed-by: Conor Dooley <conor.dooley@microchip.com>[claudiu.beznea: s/refrence/reference/, s/possilble/possible]Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20221119054858.178629-1-tanghui20@huawei.com
clk: microchip: add PolarFire SoC fabric clock supportAdd a driver to support the PLLs in PolarFire SoC's Clock ConditioningCircuitry, an instance of which is located in each ordinal corner ofthe
clk: microchip: add PolarFire SoC fabric clock supportAdd a driver to support the PLLs in PolarFire SoC's Clock ConditioningCircuitry, an instance of which is located in each ordinal corner ofthe FPGA. Only get_rate() is supported as these clocks are intended tobe statically configured by the FPGA design. Currently, the DLLs arenot supported by this driver. For more information on the hardware, see"PolarFire SoC FPGA Clocking Resources" in the link below.Link: https://onlinedocs.microchip.com/pr/GUID-8F0CC4C0-0317-4262-89CA-CE7773ED1931-en-US-1/index.htmlSigned-off-by: Conor Dooley <conor.dooley@microchip.com>Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20220908143651.1252601-5-conor.dooley@microchip.com
clk: microchip: mpfs: update module authorship & licencingPadmarao wrote the driver in its original, pre upstream form.Daire & myself have been responsible for getting it upstreamable andsubseque
clk: microchip: mpfs: update module authorship & licencingPadmarao wrote the driver in its original, pre upstream form.Daire & myself have been responsible for getting it upstreamable andsubsequent development.Move Daire out of the blurb & into a MODULE_AUTHOR entry & add entriesfor myself and Padmarao.While we are at it, convert the MODULE_LICENSE field to its preferredform of "GPL".Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20220909123123.2699583-15-conor.dooley@microchip.com
clk: microchip: mpfs: convert periph_clk to clk_gateWith the reset code moved to the recently added reset controller, thereis no need for custom ops any longer. Remove the custom ops and thecusto
clk: microchip: mpfs: convert periph_clk to clk_gateWith the reset code moved to the recently added reset controller, thereis no need for custom ops any longer. Remove the custom ops and thecustom struct by converting to a clk_gate.Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20220909123123.2699583-14-conor.dooley@microchip.com
clk: microchip: mpfs: convert cfg_clk to clk_dividerThe cfg_clk struct is now just a redefinition of the clk_divider structwith custom implentations of the ops, that implement an extra level ofre
clk: microchip: mpfs: convert cfg_clk to clk_dividerThe cfg_clk struct is now just a redefinition of the clk_divider structwith custom implentations of the ops, that implement an extra level ofredirection. Remove the custom struct and replace it with clk_divider.Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20220909123123.2699583-13-conor.dooley@microchip.com
clk: microchip: mpfs: delete 2 line mpfs_clk_register_foo()The register functions are now comprised of only a single operationeach and no longer add anything to the driver. Delete them.Reviewed-
clk: microchip: mpfs: delete 2 line mpfs_clk_register_foo()The register functions are now comprised of only a single operationeach and no longer add anything to the driver. Delete them.Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20220909123123.2699583-12-conor.dooley@microchip.com
clk: microchip: mpfs: simplify control reg accessThe control reg addresses are known when the clocks are registered, sowe can, instead of assigning a base pointer to the structs, assign thecontro
clk: microchip: mpfs: simplify control reg accessThe control reg addresses are known when the clocks are registered, sowe can, instead of assigning a base pointer to the structs, assign thecontrol reg addresses directly. Accordingly, remove the interimvariables used during reads/writes to those registers.Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20220909123123.2699583-11-conor.dooley@microchip.com
clk: microchip: mpfs: move id & offset out of clock structsThe id and offset are the only thing differentiating the clock structsfrom "regular" clock structures. On the pretext of converting to mo
clk: microchip: mpfs: move id & offset out of clock structsThe id and offset are the only thing differentiating the clock structsfrom "regular" clock structures. On the pretext of converting to morenormal structures, move the id and offset out of the clock structs andinto the hw structs instead.Reviewed-by: Daire McNamara <daire.mcnamara@microchip.com>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>Link: https://lore.kernel.org/r/20220909123123.2699583-10-conor.dooley@microchip.com
12