schwicht has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<djfe>
🤔
schwicht has joined #openwrt-devel
<djfe>
I didn't want to introduce any false information, sorry. I quoted from the replies but don't know it better myself. Thanks for correcting me
goliath has joined #openwrt-devel
mrkiko has quit [Quit: leaving]
mrkiko has joined #openwrt-devel
schwicht has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
danitool has joined #openwrt-devel
<Christophe[m]1>
Hey, I started enabling UBSAN in my builds a while ago. When it found a shift-out-of-bounds issue in drivers/clk/mediatek/clk-mux.c, I got in touch with Sergio Paracuellos an he submitted a fix: https://lkml.org/lkml/2023/2/6/165
<Christophe[m]1>
Should I get in touch with Owen Chen of Mediatek who contributed this code?
rz has quit [Remote host closed the connection]
rz has joined #openwrt-devel
ptudor has joined #openwrt-devel
<KanjiMonster>
Christophe[m]1: that fix looks wrong, AFAICT from the code the gate_shift is supposed to have a bit index, not a mask, especially seeing as it is a u8 (so the highest bit you could address would be bit 7 if it were a mask). Also look at the users of the MUX_GATE_* macros, they pass a value <= 31 as the 9th argument (the gate shift value)
<KanjiMonster>
Christophe[m]1: the issue likely comes from mux clocks defined via the MUX_FLAGS() macro, which initialized gate_shift to -1 (aka 255 as u8)
<KanjiMonster>
(as well as the MUX() macro)
<KanjiMonster>
also the MUX_CLR_SET_UPD() macro passing a fixed 0 for gate_shift feels wrong, and might have intended to disable gating for that clock
<Christophe[m]1>
Let me revert my patch and get all three ubsan warnings.
<Christophe[m]1>
Thanks for having a look
<KanjiMonster>
clk-mux.c already provides different ops for gateable and non-gatable mux clocks; so the core issue seems to be that non-gateable clocks use the gateable ops
<KanjiMonster>
so yeah, the proper fix would be to figure out where the 255/-1 comes from, and why the wrong ops are used
<bluecmd[m]>
robimarko: Hi, got your comment in https://github.com/openwrt/openwrt/pull/13038#discussion_r1250528054 re. AutoLoad vs AutoProbe. I belive for our use case it is fine to do AutoProbe, I was merely cargo-culting the other sensors which uses a whole lot of AutoLoad. Do you know if this was a problem in the past or why it's so prevelent to use AutoLoad?
<bluecmd[m]>
Seems like the load order should be handled by the kernel and device tree resolution
<robimarko>
That is why AutoProbe is prefered, as it will get loaded only when needed
<robimarko>
With AutoLoad you are loading the module regardless
<bluecmd[m]>
Yes, that seems wrong indeed. Thanks for spotting that
<robimarko>
Its usually used only for things that dont have a probing mechanism or are not DT aware
<Christophe[m]1>
KanjiMonster: Should it be MUX_CLR_SET_UPD instead of MUX_GATE_CLR_SET_UPD?
<KanjiMonster>
Christophe[m]1: that sounds like it should do the trick
<KanjiMonster>
it also passes -1 for upd_shift, but upd_shift is s8, and there is a check for it, so that part should be fine
<Christophe[m]1>
ubsan warnings are gone and no occurrences of gate_shift>31 :-D
schwicht has joined #openwrt-devel
xback has joined #openwrt-devel
cmonroe has quit [Ping timeout: 480 seconds]
schwicht has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
danitool has quit [Quit: Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos]
<Christophe[m]1>
KanjiMonster: Thanks for stepping in. Iearned new things today (:
<KanjiMonster>
you're welcome :)
Danct12 has quit [Ping timeout: 480 seconds]
minimal has joined #openwrt-devel
RoganDawes has joined #openwrt-devel
<RoganDawes>
Hi folks. Can anyone help me work through configuring a build for the Wink Hub v1?
<RoganDawes>
I have managed to add an entry in the menuconfig, (https://hastebin.com/share/irihurazon.go), but I'm trying to figure out how to add target-specific kernel options, as well as end up with a ubifs root
<RoganDawes>
I have also built a basic device tree which has the NAND partitions, serial console, and a couple of other peripherals. Once I can get a build going, I will then flesh out the DTS with the SDIO wifi device, etc
<PaulFertser>
RoganDawes: the kernel is common for the whole target (or subtarget).
<PaulFertser>
RoganDawes: usually OpenWrt is meant to be used with squashfs root, to have some solid state which can always be returned to (with generic reset or generic failsafe), and ubifs (or jffs2) is used as a r/w overlay.
<PaulFertser>
RoganDawes: often times the easiest way to start with the port is to build initramfs images (where all the system is included in the kernel image, so no rootfs is needed at all) and load them directly with a bootloader.
<RoganDawes>
PaulFertser: ok, thanks for this info. So, if I want to add SDIO wifi to the imx28 target, I would change target/linux/mxs/config-5.15 ?
<RoganDawes>
The good news is that my partition layout is quite generous - I have 8MB for my "kernel", so I should be able to include a ramdisk there quite easily, I think. One complication is that I *think* my U-Boot build may be missing support for FIT images
<RoganDawes>
does it make sense to have the root filesystem as an initramfs, with mutable content in the ubifs? Or is that an unnecessary waste of RAM (I do have 64MB, but not really enough to be wasteful with)
<PaulFertser>
RoganDawes: OpenWrt uses wireless kernel backports for all wireless drivers, so you'd need to add another kmod to package/kernel/mac80211
<PaulFertser>
RoganDawes: (initramfs + overlay) that's too uncommon so I would suggest you first stick to the way OpenWrt works on most devices currently.
<RoganDawes>
makes sense
<RoganDawes>
PaulFertser: so how would I enable the BRCMFMAC driver?
<tmn505>
yes, but don't forget the proper firmware, I assume it's cypress-firmware-43430-sdio. Also nvram file is usually necessary, You can copy it from vendor image and place it in appropriate directory structure in target/mxs/base-files.
csharper2005 has quit [Remote host closed the connection]
schwicht has joined #openwrt-devel
schwicht has quit [Ping timeout: 480 seconds]
gch981213 has quit [Ping timeout: 480 seconds]
danitool has joined #openwrt-devel
robimarko has quit [Quit: Leaving]
schwicht has joined #openwrt-devel
schwicht has quit [Ping timeout: 480 seconds]
goliath has quit [Quit: SIGSEGV]
schwicht has joined #openwrt-devel
schwicht has quit [Ping timeout: 480 seconds]
<RoganDawes>
PaulFertser: how do I get openwrt to build an initramfs, and append it to the kernel? And should it be before or after the DTB?
schwicht has joined #openwrt-devel
schwicht has quit [Ping timeout: 480 seconds]
schwicht has joined #openwrt-devel
schwicht has quit [Ping timeout: 480 seconds]
schwicht has joined #openwrt-devel
rua has quit [Quit: Leaving.]
schwicht has quit [Ping timeout: 480 seconds]
schwicht has joined #openwrt-devel
schwicht has quit [Ping timeout: 480 seconds]
<rotanid>
we just noticed that 4b5bd1509195bc8f19999ebe481b59356b5c3512 unfortunately was not part of the 22.03.2 release notes or changelog, but it should have been. there is at least one device (Rocket M) in that commit which shouldn't have been moved to tiny at that time, because it has 64m memory in contrast to the 32m devices of that target.
schwicht has joined #openwrt-devel
schwicht has quit [Ping timeout: 481 seconds]
<djfe>
I'm preparing a PR rn for the rocket-m and powerbridge-m
<djfe>
is PolynomialDivision/Nick Hainke available via IRC? (I don't know his nickname)