Reading MT_HW_REV register after kexec causes CPU halt.
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 888
- Forks
- 436
- PR merge metrics
- No merged PRs in 30d
Description
Hello, we tracked this issue dow to mt7915/mmio.c, whereby mt76_rr(dev, MT_HW_REV) hangs the boards (Cudy WR3000S and TR3000 V1), but only if the kernel has been loaded and booted with kexec (the first boot reads fine and returns zero always).
The only workaround/hack that seems to work is to disable reading this register entirely:
- mdev->rev = (device_id << 16) |
- (mt76_rr(dev, MT_HW_REV) & 0xff);
+ mdev->rev = (device_id << 16);//|
+ //(mt76_rr(dev, MT_HW_REV) & 0xff);
dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
I am looking for guidance on the correct way to fix this, I am assuming the above workaround is a temporary hack. Perhaps this isn't even a driver issue, maybe it only happens on these specific boards?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in mt7915/mmio.c at the MT_HW_REV read through mt76_rr(dev, MT_HW_REV), and reproduce the second-boot behavior using kexec on the affected boards. Compare the first and subsequent reads and determine the driver-side cause or required handling; done means a validated fix that avoids the CPU halt without losing correct ASIC revision reporting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100