Page MenuHomeFreeBSD

mmel (Michal Meloun)
User

Projects

User Details

User Since
Feb 3 2015, 4:54 AM (605 w, 2 d)

Recent Activity

Sun, Sep 6

mmel added inline comments to D59115: kobj: allow multiple inheritance with per-class softc.
Sun, Sep 6, 5:47 PM
mmel updated the diff for D59115: kobj: allow multiple inheritance with per-class softc.

Address objections.

Sun, Sep 6, 5:39 PM

Tue, Sep 1

mmel updated the summary of D59115: kobj: allow multiple inheritance with per-class softc.
Tue, Sep 1, 10:00 AM
mmel updated the summary of D59115: kobj: allow multiple inheritance with per-class softc.
Tue, Sep 1, 9:59 AM
mmel updated the diff for D59115: kobj: allow multiple inheritance with per-class softc.
  • Rename the functions as agreed during the discussion.
  • Precompute the total size of class data.
  • Implement support for nested classes with optimisation for the most common cases.
Tue, Sep 1, 9:51 AM

Sun, Aug 30

mmel added a comment to D59264: vt_simplefb: support armv7 and U-Boot-placed framebuffer nodes.

Another thing: Wouldn't it be much cleaner to extend the implementation of pmap_mapdev_attr() for early boot phase of armv7? subr_devmap.c looks ready for this job.

Sun, Aug 30, 7:00 AM · ARM, drivers
mmel added a comment to D59264: vt_simplefb: support armv7 and U-Boot-placed framebuffer nodes.

I'm not thrilled with this solution.
The standard pre-pmap_bootstrap() KVA is 128 MB, including:

  • kernel text/data/bss (section-mapped from KERNBASE);
  • early page tables (kern_pt1, kern_pt2tab and initial L2 pages);
  • whatever initarm() takes (dpcpu, stacks, msgbuf, etc.).
Sun, Aug 30, 6:32 AM · ARM, drivers

Thu, Aug 27

mmel added a comment to D59191: dwc(4): support Synopsys IP version 4 and 5.
In D59191#1358240, @br wrote:

Eqos driver does expect that the memory returned is non-cached, otherwise it would be incorrect to flush all the descriptors at once. Bus_dma could not figure out by itself which descriptor to flush if that is fully transparent to driver.

The EQOS driver expects coherent memory, not uncachable memory. But yes, on ARM, coherent memory can be realised as uncacheable if the device sits on a non-coherent bus, or as normal cacheable memory if the device sits on a DMA coherent bus (i.e. ACE). However, this decision lies with the busdma layer. The driver may request memory with a given characteristic, and the busdma layer is responsible for fulfilling that request.

If we must use uncached descriptors for all DMAs, then it is limitation, because having descriptors to reside in cached memory could be the more efficient and faster way to deal with them on heavy usage. That would require individual flushes.

There is no way to make cached memory coherent for a device that is not on a coherent bus. The golden rule is that the CPU can load a cache line or flush it at any time, irrespective of the executed code. This is the result of SMP, speculative reads and various streaming optimisations. Forget about this. Ask Adrian; MIPS gave us a big lesson in this area.

As descriptors operate on coherent memory, bus_dma_sync() can access them at any time without issue. Using a shorter bus_dma_sync() per descriptor doesn't make sense because bus_dma_sync() on coherent memory is a pure read or write barrier, nothing more.

For memory barries don't we prefer to use macroses like mb() instead of calling to busdma sync routines?
Current dwc(4) driver does that instead of busdma_sync. It makes it easier to read the code, and probably a bit faster for CPU.

bus_dma_sync() should be used here. However, we do not yet have a proper operation for this, so rmb()/wmb() can be tolerated.

Thu, Aug 27, 12:55 PM
mmel added a comment to D59191: dwc(4): support Synopsys IP version 4 and 5.
In D59191#1357815, @br wrote:

I have spent a few days on eqos(4) but did not get it working.

I also think that rqos should be merged back into dwc.

Thu, Aug 27, 9:01 AM
mmel added a comment to D59188: mdio: Add new mdio FDT driver.

I see all this, but I'm not able to understand how it should work.

Thu, Aug 27, 8:05 AM

Wed, Aug 26

mmel added a comment to D59115: kobj: allow multiple inheritance with per-class softc.

I'm also fine with it, thanks. Is the device_get_softc_class() function OK? That's actually the one I had the most trouble with.

Wed, Aug 26, 12:52 PM
mmel added a comment to D59188: mdio: Add new mdio FDT driver.

How does this correspond with the MII bus? Shouldn't we combine these two drivers into one?

Wed, Aug 26, 5:34 AM

Mon, Aug 24

mmel added a comment to D59115: kobj: allow multiple inheritance with per-class softc.

kobj_total_data_size looks good — thanks!
kobj_instance_data_offset seems too long to me, and 'instance' is not entirely precise. Can we shorten it to kobj_data_offset?

Mon, Aug 24, 2:14 PM
mmel added a comment to D59115: kobj: allow multiple inheritance with per-class softc.

This is one of my dilemmas. KOBJ consistently uses 'baseclass', but 'kobj_offsetof_baseclass' or 'kobj_baseclass_offsetof' looks ugly, especially since these could also be used for the main/leaf class.

Mon, Aug 24, 6:41 AM
mmel added a comment to D59115: kobj: allow multiple inheritance with per-class softc.
In D59115#1355807, @kib wrote:

kobj should not mention 'softc', it is not limited to the driver support. It should be named more generally.

Completely agree, but despite my best efforts, I can't figure out which word to use instead of “softc”

Mon, Aug 24, 6:19 AM

Sun, Aug 23

mmel added reviewers for D59115: kobj: allow multiple inheritance with per-class softc: alc, imp, kib, adrian, jhibbits.
Sun, Aug 23, 7:02 AM
mmel requested review of D59115: kobj: allow multiple inheritance with per-class softc.
Sun, Aug 23, 7:00 AM

Mon, Aug 17

mmel added a comment to D58812: arm64: mediatek: add initial MT7622/Banana Pi R64 support (revised).

Not exactly. The D57176 has nothing to do with simplebus; all of its clock nodes in the DT are leaf nodes.

Mon, Aug 17, 5:49 AM · arm64

Sun, Aug 16

mmel added a comment to D58812: arm64: mediatek: add initial MT7622/Banana Pi R64 support (revised).

Sorry, I was too brief. In the past, Martin gave me many versions of the clock code for pre-review, so I have a tendency to respond briefly.
The issue is the audsys/audiosys driver (at least, I didn't check the other clocks). It is not a leaf node, but it has subnodes, so it must implement the simplebus class together with the MT_CLK class. This is impossible in the current situation because both classes have their own softc.
The audsys driver version in review only derives simplebus, which means it cannot work at all. It doesn't have a method for physical access to clock related registers or locking functions (CLKDEV interface).

Sun, Aug 16, 5:02 AM · arm64

Sat, Aug 15

mmel requested changes to D58812: arm64: mediatek: add initial MT7622/Banana Pi R64 support (revised).

This code is fundamentally incomplete and unusable in its current state.

  • All PLL clocks are crudely faked with fixed clock events instead of being dynamic, without any check.
  • The UART silently accepts and programs invalid baud rates without any error reporting.
    • pinctrl implements barely ~10% of the properties defined in the bindings, rendering it effectively useless. -Several clock driver nodes (simplebus being a clear example) lack required functionality and must be rewritten from scratch.

This code is nowhere near ready and demands substantial rework. I'm sorry, but the quality of this AI slope is significantly below my acceptance limit.

Sat, Aug 15, 8:25 PM · arm64
mmel accepted D57176: clk: Initial support for the SpacemiT K1 clock control units.
Sat, Aug 15, 5:54 AM

Jul 21 2026

mmel added inline comments to D57176: clk: Initial support for the SpacemiT K1 clock control units.
Jul 21 2026, 6:47 AM

Jul 15 2026

mmel added a comment to rG8ffb400bfd64: rk_gpio: defer level-IRQ EOI until source line is driven low.

Firstly, I must apologize. on my first response I didn't re-read the Rockchip TRM and instead relied on my own memory, which turned out to be a bad idea.

Jul 15 2026, 8:58 AM

Jul 14 2026

mmel added a comment to D58212: bsd.cpu.mk: Add a workaround for erratum 843419.
In D58212#1335515, @bz wrote:

I think the only thing I'd love to see is to tell users in the commit message how to apply this as it seems this needs to be done manually.

Jul 14 2026, 8:27 AM
mmel accepted D58212: bsd.cpu.mk: Add a workaround for erratum 843419.
Jul 14 2026, 7:34 AM

Jul 13 2026

mmel committed rG920518cf2e75: FDT: implement fdt_ether_get_addr() (authored by mmel).
FDT: implement fdt_ether_get_addr()
Jul 13 2026, 8:37 AM
mmel closed D58104: FDT: implement fdt_ether_get_addr().
Jul 13 2026, 8:37 AM

Jul 12 2026

mmel accepted D58182: rockchip: fix stack overflow in rk8xx_rtc.
Jul 12 2026, 4:37 AM

Jul 10 2026

mmel requested changes to D57176: clk: Initial support for the SpacemiT K1 clock control units.

It would be significantly better to use predefined classes for fixed rate, fixed divider, gates or so .

Jul 10 2026, 7:35 AM
mmel added a comment to D58105: busdma, arm64: implement support for bus view of DMA address space.

At this stage, I do not want to introduce tables or hard-coded segment mappings
and/or limits for DMA memory allocation.
For flexibility, the primary interface should be based on functions. A default
implementation can always be added later if a sufficiently robust common case
is identified.

Jul 10 2026, 7:04 AM

Jul 9 2026

mmel added a reviewer for D58104: FDT: implement fdt_ether_get_addr(): bz.
Jul 9 2026, 9:32 AM
mmel removed a reviewer for D58104: FDT: implement fdt_ether_get_addr(): bz.
Jul 9 2026, 8:43 AM
mmel updated the diff for D58104: FDT: implement fdt_ether_get_addr().

remove redundant empty line

Jul 9 2026, 8:42 AM
mmel retitled D58104: FDT: implement fdt_ether_get_addr() from FDT: implement fdt_ether_get_macaddr() to FDT: implement fdt_ether_get_addr().
Jul 9 2026, 8:40 AM
mmel updated the diff for D58104: FDT: implement fdt_ether_get_addr().

update commit log

Jul 9 2026, 8:24 AM
mmel updated the diff for D58104: FDT: implement fdt_ether_get_addr().

Rename function and fix cut&paste error

Jul 9 2026, 8:22 AM

Jul 8 2026

mmel added a comment to D58105: busdma, arm64: implement support for bus view of DMA address space.

That's a very good and valid question.
Combining the fact that the 'dma-ranges' DT property (which this change targets) can describe multiple discontinuous ranges and that PCI(e) mappings further depend on transaction types quickly opens a very large Pandora's box. Add chained DMA tags and the IOMMU into the mix, and the problem becomes even more complex.
The honest answer is: I don't know how to handle this in full generality right now.
Today, it remains the driver's responsibility to work with CPU addresses. Modernising busdma would require a significant amount of work, and I'm not confident I have the energy or deep enough knowledge to tackle it all at once.
This minimal implementation is intended only to enable RPi5 support for now, nothing more yet.

Jul 8 2026, 2:36 PM
mmel added reviewers for D58106: ofw_pcib: add support for reading 'dma-ranges' property: adrian, arm64.
Jul 8 2026, 12:06 PM
mmel added a reviewer for D58108: cgem: add support for ethernet on RP1 chip found on Raspberry Pi 5: arm64.
Jul 8 2026, 11:48 AM
mmel requested review of D58108: cgem: add support for ethernet on RP1 chip found on Raspberry Pi 5.
Jul 8 2026, 11:47 AM
mmel added a reviewer for D58107: simplebus: add support for reading 'dma-ranges' property: arm64.
Jul 8 2026, 11:37 AM
mmel requested review of D58107: simplebus: add support for reading 'dma-ranges' property.
Jul 8 2026, 11:37 AM
mmel requested review of D58106: ofw_pcib: add support for reading 'dma-ranges' property.
Jul 8 2026, 11:34 AM
mmel requested review of D58105: busdma, arm64: implement support for bus view of DMA address space.
Jul 8 2026, 11:32 AM
mmel added reviewers for D58104: FDT: implement fdt_ether_get_addr(): manu, adrian, arm64.
Jul 8 2026, 11:30 AM
mmel requested review of D58104: FDT: implement fdt_ether_get_addr().
Jul 8 2026, 11:29 AM
mmel added reviewers for D58103: FDT, clk_fixed: add gated-fixed-clock support and deferred initialization: manu, arm64.
Jul 8 2026, 11:23 AM
mmel requested review of D58103: FDT, clk_fixed: add gated-fixed-clock support and deferred initialization.
Jul 8 2026, 11:22 AM
mmel added reviewers for D58102: pci_dw: add support for 64-bit sized ATU windows: arm64, ARM.
Jul 8 2026, 11:19 AM
mmel requested review of D58102: pci_dw: add support for 64-bit sized ATU windows.
Jul 8 2026, 11:15 AM

Jun 25 2026

mmel requested changes to D57732: arm64: mediatek: add initial MT7622/Banana Pi R64 support.

All of these clock drivers share too much common code. Firstly, why don't you subclass these from the base class in mdtk_clk.c? If that's not sufficient, why don't you use a new base class that implements all this glue and subclass it?

Jun 25 2026, 10:54 AM · arm64

Jun 24 2026

mmel accepted D57795: hym8563: Fix 32-bit powerpc build.

I would much rather have PowerPC adapt the clock, reset and other frameworks. After all, PowerPC .dts files use them, so I don't see a single reason why we could not include them in the PowerPC build.
The assumption that FDT means that all these frameworks would make the world much simpler.

Jun 24 2026, 11:20 AM

May 27 2026

mmel added a comment to D55947: arm64: mte: handle synchronous tag check faults.

Aliasing SEGV_PKUERR and SEGV_MTEAERR breaks Qt6 (at least Qt6-base), as it has both in one switch. It seems Linux takes PKUERR as arch-independent.

May 27 2026, 4:06 PM

Apr 27 2026

mmel accepted D56651: if_awg: Add missing awg_poll() prototype.
Apr 27 2026, 5:35 AM

Apr 15 2026

mmel committed rG1dddb580f950: arm64: Define the .iplt section placement. (authored by mmel).
arm64: Define the .iplt section placement.
Apr 15 2026, 4:04 PM
mmel closed D56403: arm64: Define the .iplt section placement..
Apr 15 2026, 4:03 PM
mmel requested review of D56403: arm64: Define the .iplt section placement..
Apr 15 2026, 9:45 AM

Mar 21 2026

mmel accepted D55907: clk/broadcom: Add CPRMAN clkdev backend and peripheral clock node.

LGTM

Mar 21 2026, 4:21 PM

Mar 20 2026

mmel requested changes to D55907: clk/broadcom: Add CPRMAN clkdev backend and peripheral clock node.
Mar 20 2026, 8:17 AM

Feb 22 2026

mmel committed rGd2dea8b46a8a: arm: Add EARLY_PRINTF for ns8250 on arm/aarch64 platforms. (authored by mmel).
arm: Add EARLY_PRINTF for ns8250 on arm/aarch64 platforms.
Feb 22 2026, 9:21 PM
mmel committed rGdc9a7b15b78b: HYM8563: Add HYM563 RTC driver to common config. (authored by mmel).
HYM8563: Add HYM563 RTC driver to common config.
Feb 22 2026, 5:55 PM
mmel committed rG9de43130f989: regulator_fixed: add support for 'gpios' property (authored by mmel).
regulator_fixed: add support for 'gpios' property
Feb 22 2026, 5:55 PM
mmel committed rG92c66dc5f872: pci_dw: improve pci_dw (authored by mmel).
pci_dw: improve pci_dw
Feb 22 2026, 5:55 PM
mmel committed rGf40ed4881e25: fdt,simple_mfd: Map memory as shareable. (authored by mmel).
fdt,simple_mfd: Map memory as shareable.
Feb 22 2026, 5:55 PM
mmel committed rG67fc0ff33d20: dtb: generate .DTB for some RK3588 based boards. (authored by mmel).
dtb: generate .DTB for some RK3588 based boards.
Feb 22 2026, 5:55 PM
mmel committed rG2ade7208068d: TCA64xx: Convert mutex to SX lock. (authored by mmel).
TCA64xx: Convert mutex to SX lock.
Feb 22 2026, 5:55 PM
mmel committed rG4840558e5219: OFW: Improve OFW_CPU. (authored by mmel).
OFW: Improve OFW_CPU.
Feb 22 2026, 5:54 PM
mmel committed rG6b77d34f4491: HYM8563: Add support for clock output. (authored by mmel).
HYM8563: Add support for clock output.
Feb 22 2026, 5:54 PM

Feb 20 2026

mmel accepted D55388: qoriq: fix spelling in device_set_desc().
Feb 20 2026, 9:45 AM

Feb 13 2026

mmel accepted D55268: elf_common.h: Add some AArch32 relocations.
Feb 13 2026, 6:26 AM

Feb 12 2026

mmel accepted D55255: libsys/arm: include ARM EABI unwind bits into libsys.

I'm not sure if anyone knows the exact, precise response. ARMv7 unwinding is pure mesh. All of my attempts to understand it ended with me turning off the computer and opening a bottle of good wine.
I think it's possible to write a backtrace that doesn't use it, but I also think it's used by the unwinder library, which is also used for backtraces.
My motivation was to be careful about security. If the executable implements real unwinder personalities, we should also use it for libsys

Feb 12 2026, 11:19 AM
mmel added a comment to D55255: libsys/arm: include ARM EABI unwind bits into libsys.

I understand that libsys might be the last frame.
However, this also means that the unwinder is supposed to call the function aeabi_unwind_cpp_pr0, found in the .ARM.exidx section of the corresponding object.
In your case, this is
buildin_trap().
Is this right?

Feb 12 2026, 9:10 AM
mmel added a comment to D55255: libsys/arm: include ARM EABI unwind bits into libsys.

Sorry for my poorly formulated question.
The hidden but not weak aeabi_unwind_cpp_pr* symbols means that we don't expect or want to process exceptions generated in libsys because the unwinder always ends in an abort/trap. So why don't we simply compile libsys with -fno-exceptions?

Feb 12 2026, 8:32 AM
mmel added a comment to D55255: libsys/arm: include ARM EABI unwind bits into libsys.

Should not these symbols also be marked as weak? Hidden symbols are not 'overloaded' in the same library. kib, jrtc27 any comment about this, please?

Feb 12 2026, 5:48 AM

Feb 5 2026

mmel closed D53993: ARM GICv3: Add support for non-coherent and/or bus address range limited DMA..

It was should be closed with 62e1227219f2f79a2ed7a672149dc3d774d25dd4, sorry.

Feb 5 2026, 5:07 PM

Feb 1 2026

mmel requested changes to D55013: Support for MT7531 Switch Driver.

At first look only:

    • the '#ifndef MT7531' is clearly incompatible with GENERIC kernel.
  • the defined FDT bindings between the NIC and the switch are not followed. Instead, a "brutal" hack (fdt_find_ethernet_prop_switch) is used.
  • the eqos driver changes is improper. All of these are should be in attached the phy driver.
Feb 1 2026, 9:57 AM
mmel committed rGd78cbf483fe7: arm: Implement kernel ifunc (authored by mmel).
arm: Implement kernel ifunc
Feb 1 2026, 8:18 AM
mmel closed D54970: arm: Implement kernel IFUNC.
Feb 1 2026, 8:18 AM

Jan 30 2026

mmel added inline comments to D54970: arm: Implement kernel IFUNC.
Jan 30 2026, 8:13 PM
mmel requested review of D54970: arm: Implement kernel IFUNC.
Jan 30 2026, 3:42 PM

Jan 3 2026

mmel added inline comments to D54475: nvme: Be more correct in busdma usage.
Jan 3 2026, 7:28 PM

Dec 3 2025

mmel committed rGef8a0ef2aa97: ofw: Fix 64-bit arithmetic in cpufreq_dt.c. (authored by mmel).
ofw: Fix 64-bit arithmetic in cpufreq_dt.c.
Dec 3 2025, 6:52 AM
mmel committed rG3e7d3361dd24: arm64: Add missing dtrace_isa.c (authored by mmel).
arm64: Add missing dtrace_isa.c
Dec 3 2025, 6:52 AM
mmel committed rG62e1227219f2: ARM GICv3: Add support for non-coherent and/or bus address range limited DMA. (authored by mmel).
ARM GICv3: Add support for non-coherent and/or bus address range limited DMA.
Dec 3 2025, 6:52 AM
mmel committed rGd14a985898ee: ofw: Add ofw_bus_is_machine_compat(). (authored by mmel).
ofw: Add ofw_bus_is_machine_compat().
Dec 3 2025, 6:52 AM
mmel closed D53992: ofw: Add ofw_bus_is_machine_compat().
Dec 3 2025, 6:52 AM

Nov 30 2025

mmel added inline comments to D53993: ARM GICv3: Add support for non-coherent and/or bus address range limited DMA..
Nov 30 2025, 7:24 PM
mmel added inline comments to D53993: ARM GICv3: Add support for non-coherent and/or bus address range limited DMA..
Nov 30 2025, 7:16 PM
mmel updated the diff for D53992: ofw: Add ofw_bus_is_machine_compat().

Use correct diff

Nov 30 2025, 9:00 AM
mmel updated the diff for D53993: ARM GICv3: Add support for non-coherent and/or bus address range limited DMA..

Use correct diff

Nov 30 2025, 8:59 AM
mmel requested review of D53993: ARM GICv3: Add support for non-coherent and/or bus address range limited DMA..
Nov 30 2025, 8:43 AM
mmel requested review of D53992: ofw: Add ofw_bus_is_machine_compat().
Nov 30 2025, 8:41 AM

Nov 24 2025

mmel added a comment to D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.
In D53891#1231630, @alc wrote:

Confirmed, this part is enough.

This makes sense to me. Suppose that the object has OBJ_ONEMAPPING set. On a memory-starved machine, we could have paged out all of the object's pages, so that the resident count would be zero. Then, if a hole is punched in a mapping to this object, then vm_map_entry_delete() will call vm_object_page_remove(), which will fail to release the swap space.

@mmel you have been testing on ARMv7, correct?

yes, and also on arm32 jail

Nov 24 2025, 6:43 PM
mmel added a comment to D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.

Confirmed, this part is enough.

Nov 24 2025, 5:28 PM
mmel accepted D53891: Fixes for dreaded assert in jemalloc page allocator AKA mmap(MAP_ANON) providing non-zeroed pages.

After another day of extensive testing, I can confirm that everything is working properly.

Nov 24 2025, 8:08 AM

Nov 4 2025

mmel accepted D53546: mmc_fdt: handle broken-cd property.
Nov 4 2025, 8:01 PM

Sep 30 2025

mmel accepted D52783: gpioc: fix race in ioctl(GPIOCONFIGEVENTS).
Sep 30 2025, 10:13 AM
mmel added inline comments to D52783: gpioc: fix race in ioctl(GPIOCONFIGEVENTS).
Sep 30 2025, 7:52 AM
mmel added inline comments to D52783: gpioc: fix race in ioctl(GPIOCONFIGEVENTS).
Sep 30 2025, 7:23 AM
mmel added inline comments to D52783: gpioc: fix race in ioctl(GPIOCONFIGEVENTS).
Sep 30 2025, 6:43 AM