Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

Today I pushed a small fix for mtw: the MediaTek MT7601U USB WiFi driver in FreeBSD.

Uncategorized
1 1 0
  • Today I pushed a small fix for mtw: the MediaTek MT7601U USB WiFi driver in FreeBSD.

    The issue: driver worked perfectly on first boot. Connect the adapter, it initializes, you're online. Great. Then you reboot your machine and... nothing. "timeout waiting for MCU to initialize." The only fix was to physically unplug the adapter and plug it back in, or do a full cold boot (power off completely).

    The root cause was a state machine transition problem. When you do a warm reboot, USB devices don't lose power - they just sit there, happily retaining whatever state they were in. The MT7601U's microcontroller still had its "ready" flag set from the previous session. So when the driver came back up and checked "is firmware already running?", the device said "yep!" and the driver said "cool, nothing to do" and returned early.

    Except the device wasn't actually ready. It was in a Schrödinger state - simultaneously "ready" and "not ready" until you observe it by trying to actually probe it, at which point the wavefunction collapses into "definitely broken." Technically powered, firmware loaded, flags set, but not actually functional.

    The fix was straightforward: if we detect the MCU is already marked ready at attach time, assume it's stale state from a previous session, reset the MCU, clear the ready flag, and do a proper initialization from scratch. Force the cat to be alive.

    Also added USB re-enumeration on attach and bumped some timeouts because these devices can be slow after a reset.

    What's funny about driver development is that progress isn't linear. You find and fix a bug in hardware revision 1 and 2. Revision 3 ships and works perfectly - they must have fixed it in silicon, you think. Then revision 6 manufactured a year later shows up with the exact same bug. Different fab? Cost reduction? Recycled design from a different product line? Who knows.

    You end up maintaining a mental map of "this chip from this date range has this quirk, but the same chip from that date range doesn't, except if it's from this OEM who used a different reference design."

    And the datasheets - when they exist - are always for the "ideal" version of the hardware that exists only in the minds of the engineers who wrote them.

    Anyway, if you're running FreeBSD with an MT7601U adapter and wondered why you had to unplug it after every reboot, this one's for you.

  • stefano@mastodon.bsd.cafeundefined stefano@mastodon.bsd.cafe shared this topic

Gli ultimi otto messaggi ricevuti dalla Federazione
  • @mos_8502 I think, or maybe merely hope, that having deep expertise and actually understanding all the code being spewed forth at alarming rates (even if I haven't actually read most of it), has long-term value.

    But, I don't think I have any choice about using it and staying employed. If I want to keep working in the field I'm in, I'm going to be doing it with AI assistance. That was up in the air until recently...but, the current generation models+agents lay the question to rest.

    read more

  • @swelljoe My reply to the vibe coder in this scenario is "well, then, what do we need you for? Pack up your desk."

    Now, this is not to say I'm 100% dead set against it per se. I would restrict its use to expert-level programmers who understand the problem domain, on the grounds that you need to know the language at a high level and understand the problem if you're going to debug and maintain the code.

    read more

  • @mos_8502 the vibe-coder answer to that is, "I don't need to understand it, I just ask Claude to maintain it, too." And...I scoffed at that idea in the past. But, it's gotten really good.

    I think it's still very dangerous in the hands of non-technical folks. And, I think most of the models are still flailing a lot (the frontier models are all pretty good, but Opus 4.5 is the one that Just Works, but all the lower end models are stupid a lot).

    I dunno. The ground shifted beneath my feet.

    read more

  • @mos_8502 I was dragged into using it at work, and I've had to accept that I was wrong about how well it works. I still have plenty of reservations about its use. But...it can write good software very, very, fast. And, in an agentic configuration (like Claude Code or whatever other agentic harnesses you wanna use), it can test its own work, verify outputs, etc. It's genuinely astonishing how well it works.

    Whether I like it kinda doesn't matter. It works well enough to where it will be used.

    read more

  • @swelljoe What worries me is the "competent operator". Best case scenario, the model generates perfect code that does exactly what the fuck it should -- and the user who prompted it has no clue how to maintain or debug the code.

    read more

  • @mos_8502 I wasn't enthusiastic about AI for coding, but Claude Code with Opus 4.5 is remarkable. I can't really say I'm happy about it, but given a competent operator, it produces quite good, if a little verbose, code that works the first time most of the time. It writes better and more tests than I've found most human coders do, it often includes accessibility markup without being asked (another thing human coders simply don't do), and it documents its work.

    read more

  • @nickzoic @mos_8502 A million lines of actual code, regardless of where it came from, is a catastrophic failure.

    read more

  • @mos_8502 It's like trying to accept code from a contributor who keeps making a gratuitous wrong change every time they fix the last thing you told them to fix, and trying to slip it past you. Infuriating and pointless when you could just do it faster yourself or reject their proposal entirely.

    read more
Post suggeriti