platform/raspberrypi: vchiq: register bus at subsys_initcallSince 6.19-rc1, with CONFIG_BCM2835_VCHIQ=y and CONFIG_SND_BCM2835=y(both builtin), the sound cards bcm2835_headphones and bcm2835_hdmi
platform/raspberrypi: vchiq: register bus at subsys_initcallSince 6.19-rc1, with CONFIG_BCM2835_VCHIQ=y and CONFIG_SND_BCM2835=y(both builtin), the sound cards bcm2835_headphones and bcm2835_hdmi arenot detected anymore (vc4-hdmi is not affected).dmesg shows: Driver 'bcm2835-audio' was unable to register with bus_type 'vchiq-bus' because the bus was not initialized.Since the VCHIQ interface was moved out of staging, its bus is no longerguaranteed to be registered before its client drivers. bcm2835-audio,still in drivers/staging, registers at device_initcall level and nowruns first.Register the bus and the platform driver at subsys_initcall so the busexists before any client driver, independently of link order. Theplatform driver probe already returns -EPROBE_DEFER while the firmwareis not ready, so probing earlier is safe. When built as modules, this isequivalent to module_init() and nothing changes.Tested on Raspberry Pi 1B rev2, 1B+, 2B, 3B and 4B with VCHIQ andbcm2835-audio both builtin and both as modules.Cc: stable@vger.kernel.orgFixes: aa125180c673 ("platform/raspberrypi: Destage VCHIQ interface")Reported-by: Martin Wetterwald <martin@wetterwald.eu>Closes: https://lore.kernel.org/r/CAFERDQ0FpdVvA5VJxOyRAE_pgxnPVmFx1tkZio5R272j6Bs4tg@mail.gmail.com/Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>Tested-by: Gaston Gonzalez <gascoar@gmail.com> # Raspberry Pi ZeroSigned-off-by: Martin Wetterwald <martin@wetterwald.eu>Link: https://lore.kernel.org/r/20261022082927.59030-1-martin@wetterwald.euSigned-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
show more ...
treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() familyMirroring the earlier kmalloc_obj() conversion, convert thedevice-managed allocators over to the type-based API using the no
treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() familyMirroring the earlier kmalloc_obj() conversion, convert thedevice-managed allocators over to the type-based API using the nowupdated scripts/coccinelle/api/kmalloc_objs.cocci. The size is derivedfrom the type rather than written out as a sizeof(), and the result isa pointer to that type rather than void *, so a mismatch between thesize requested and the variable assigned becomes a build error insteadof being silently accepted.The conversions break down as: 6713 devm_kzalloc_obj() 1749 devm_kzalloc_objs() 307 devm_kzalloc_flex() 91 devm_kmalloc_objs() 82 devm_kmalloc_obj() 2 devm_kmalloc_flex()The rules deliberately leave alone allocations sized by a string or abyte-sized type, or assigned to a pointer to a byte-sized type, sincethose are byte buffers rather than objects. Allocations sized by amulti-byte integer type are only converted when they are assigned to apointer to that same type, and allocations of pointers to integers or ofvoid pointers are left alone too. After this change, 528 files stillcall devm_kmalloc(), devm_kzalloc(), devm_kcalloc(), ordevm_kmalloc_array().Build tested with allmodconfig on x86_64, arm64, i386, arm, riscv, s390,m68k, mips, parisc, sparc, loongarch, arc, xtensa, and openrisc with GCC16.2.0 with no new warnings.Signed-off-by: Kees Cook <kees+treewide@kernel.org>
treewide: refresh kmalloc_obj() conversionsRefresh the tree with run of the existing Coccinelle rules inscripts/coccinelle/api/kmalloc_objs.cocci, now that they also convertarrays of multi-byte i
treewide: refresh kmalloc_obj() conversionsRefresh the tree with run of the existing Coccinelle rules inscripts/coccinelle/api/kmalloc_objs.cocci, now that they also convertarrays of multi-byte integers.The conversions break down as: 435 kzalloc_objs() 169 kmalloc_objs() 52 kvzalloc_objs() 47 kzalloc_obj() 42 kvmalloc_objs() 8 kmalloc_obj() 2 kzalloc_flex() 2 kvmalloc_flex()and 37 existing kmalloc_obj() family calls drop a redundant GFP_KERNEL.Build tested with allmodconfig on x86_64 with GCC 16.2.0, and, togetherwith the devm_kmalloc_obj() conversion that follows, on x86_64, arm64,i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc,xtensa, and openrisc with GCC 16.2.0 with no new warnings.Signed-off-by: Kees Cook <kees+treewide@kernel.org>
Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentThis was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs
Convert 'alloc_obj' family to use the new default GFP_KERNEL argumentThis was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'to convert the new alloc_obj() users that had a simple GFP_KERNELargument to just drop that argument.Note that due to the extreme simplicity of the scripting, any slightlymore complex cases spread over multiple lines would not be triggered:they definitely exist, but this covers the vast bulk of the cases, andthe resulting diff is also then easier to check automatically.For the same reason the 'flex' versions will be done as a separateconversion.Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
treewide: Replace kmalloc with kmalloc_obj for non-scalar typesThis is the result of running the Coccinelle script fromscripts/coccinelle/api/kmalloc_objs.cocci. The script is designed toavoid sc
treewide: Replace kmalloc with kmalloc_obj for non-scalar typesThis is the result of running the Coccinelle script fromscripts/coccinelle/api/kmalloc_objs.cocci. The script is designed toavoid scalar types (which need careful case-by-case checking), andinstead replace kmalloc-family calls that allocate struct or unionobject instances:Single allocations: kmalloc(sizeof(TYPE), ...)are replaced with: kmalloc_obj(TYPE, ...)Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)are replaced with: kmalloc_objs(TYPE, COUNT, ...)Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)(where TYPE may also be *VAR)The resulting allocations no longer return "void *", instead returning"TYPE *".Signed-off-by: Kees Cook <kees@kernel.org>
platform/raspberrypi: Destage VCHIQ interfaceDestage the VCHIQ interface driver to drivers/platform/raspberrypi.There is still the remaining TODO item of improving the documentation,which can be
platform/raspberrypi: Destage VCHIQ interfaceDestage the VCHIQ interface driver to drivers/platform/raspberrypi.There is still the remaining TODO item of improving the documentation,which can be handled post destaging.Secondly, multimedia drivers like codec and ISP that rely on thisinterface need to be upstreamed. And lastly, the drivers that facilitatethe shared memory between VideoCore and Linux, like the vc-sm-cma driverand vc_mem char driver also need to be upstreamed.Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>Link: https://patch.msgid.link/20251029-vchiq-destage-v3-6-da8d6c83c2c5@ideasonboard.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>