Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post boot logs after driver installation #5

Open
sohamxda7 opened this issue Mar 26, 2024 · 15 comments
Open

Post boot logs after driver installation #5

sohamxda7 opened this issue Mar 26, 2024 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@sohamxda7
Copy link

Using on my asus vivobook 15. Followed all of your installation step as well as used that get firmware script.
I have attached full dmesg logs. The driver seems to throw the following error:

[   16.192558] mt7902 0000:02:00.0: Message 00000010 (seq 4) timeout
[   16.192567] mt7902 0000:02:00.0: Failed to get patch semaphore
[   19.512695] mt7902 0000:02:00.0: Message 00000010 (seq 5) timeout
[   19.512716] mt7902 0000:02:00.0: Failed to get patch semaphore
[   22.840522] mt7902 0000:02:00.0: Message 00000010 (seq 6) timeout
[   22.840557] mt7902 0000:02:00.0: Failed to get patch semaphore
[   26.168661] mt7902 0000:02:00.0: Message 00000010 (seq 7) timeout
[   26.168691] mt7902 0000:02:00.0: Failed to get patch semaphore
[   29.496645] mt7902 0000:02:00.0: Message 00000010 (seq 8) timeout
[   29.496677] mt7902 0000:02:00.0: Failed to get patch semaphore
[   32.824702] mt7902 0000:02:00.0: Message 00000010 (seq 9) timeout
[   32.824742] mt7902 0000:02:00.0: Failed to get patch semaphore
[   36.152690] mt7902 0000:02:00.0: Message 00000010 (seq 10) timeout
[   36.152721] mt7902 0000:02:00.0: Failed to get patch semaphore
[   36.234735] mt7902 0000:02:00.0: hardware init failed

logs.txt

By the way, if possible take a look at this: greearb/linux-6.5-be200@2230751

@samveen
Copy link
Owner

samveen commented Mar 27, 2024

I cannot apply greearb/linux-6.5-be200@04725f4 because those definitions have been moved into a shared header.

If I change the shared header, the dkms module will have a different understanding of the device structrures as compared to the mt76 core that's already present in the module, leading to more issues.

Instead I'm adding more logging to help pinpoint failures.

@sohamxda7
Copy link
Author

@samveen sure thing, waiting for the next update, will send you all the logs.

@samveen
Copy link
Owner

samveen commented Mar 27, 2024

@sohamxda7 Pull and test

@sohamxda7
Copy link
Author

Here are the new logs: @samveen
log.txt

@samveen
Copy link
Owner

samveen commented Mar 27, 2024

@sohamxda7 I need you to check the differences between the private mt76/*.h headers included in the repo against the headers of the kernel tree that you are running (you will need to install the linux-source package matching your kernel package version).

In case the headers are not identical, then I'll need to rethink the structure of the code here, and maybe duplicate everything instead of using the existing modules.

@sohamxda7
Copy link
Author

@samveen okay, so in easy words what should I do now? Please guide me

@samveen
Copy link
Owner

samveen commented Mar 27, 2024

  • install the kernel source package. you can get the list with apt search linux-source and install the on that matches the 6.8 kernel.
  • Under the kernel source tree, check the files in drivers/net/wireless/mediatek/mt76/.
  • For all the files that exist in mt9702-dkms/mt76, check if there is any difference between the file with the same name in the kernel source at drivers/net/wireless/mediatek/mt76/. That said, I don't think there will be a difference, or if that will work.
  • Would you check if the BIOS initializes the WiFi card? is there an option to stop the BIOS initialization, and instead let the operating system do the initialization instead.
  • Does the BIOS driver contain any Firmware? Maybe the firmware given on the asus website is not correct, and the firmware from the BIOS is required instead?

@samveen
Copy link
Owner

samveen commented Mar 27, 2024

I've been reading the kernel source, and I am seeing the need to modify the mt76 module completely instead of using the existing mt76 module, integrating the code in this repo into the mod rather than writing a complementary module.

Let me see what see what I can do.

@sohamxda7 can you also provide me the output of sudo lspci and sudo lsusb to better understand the device structure on the vivobook?

@henri26mobu
Copy link

henri26mobu commented Mar 28, 2024

I have an asus vivobook too I give you the lspci and lsusb hoping you understand better the architecture of the laptop

henri26mobu@7902pop:~$ sudo lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Bus 001 Device 003: ID 3277:0036 ShineTech USB2.0 HD UVC WebCam
Bus 001 Device 004: ID 13d3:3579 IMC Networks Wireless_Device
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
henri26mobu@7902pop:~$ sudo lspci
00:00.0 Host bridge: Intel Corporation Raptor Lake-P/U 4p+8e cores Host Bridge/DRAM Controller
00:02.0 VGA compatible controller: Intel Corporation Raptor Lake-P [Iris Xe Graphics] (rev 04)
00:04.0 Signal processing controller: Intel Corporation Raptor Lake Dynamic Platform and Thermal Framework Processor Participant
00:06.0 PCI bridge: Intel Corporation Raptor Lake PCIe 4.0 Graphics Port
00:08.0 System peripheral: Intel Corporation GNA Scoring Accelerator module
00:0a.0 Signal processing controller: Intel Corporation Raptor Lake Crashlog and Telemetry (rev 01)
00:14.0 USB controller: Intel Corporation Alder Lake PCH USB 3.2 xHCI Host Controller (rev 01)
00:14.2 RAM memory: Intel Corporation Alder Lake PCH Shared SRAM (rev 01)
00:15.0 Serial bus controller: Intel Corporation Alder Lake PCH Serial IO I2C Controller #0 (rev 01)
00:15.2 Serial bus controller: Intel Corporation Alder Lake PCH Serial IO I2C Controller #2 (rev 01)
00:16.0 Communication controller: Intel Corporation Alder Lake PCH HECI Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation Alder Lake PCH-P PCI Express Root Port #9 (rev 01)
00:1f.0 ISA bridge: Intel Corporation Raptor Lake LPC/eSPI Controller (rev 01)
00:1f.3 Multimedia audio controller: Intel Corporation Raptor Lake-P/U/H cAVS (rev 01)
00:1f.4 SMBus: Intel Corporation Alder Lake PCH-P SMBus Host Controller (rev 01)
00:1f.5 Serial bus controller: Intel Corporation Alder Lake-P PCH SPI Controller (rev 01)
01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller PM9B1 (DRAM-less) (rev 02)
02:00.0 Network controller: MEDIATEK Corp. Device 7902

@samveen
Copy link
Owner

samveen commented Mar 29, 2024

From what I can make out now, I will need to restructure the build to duplicate the entire mt76 module code into the mt7902 module, and make it completely independent so that more debugging statements can be added. This will take me some time.

@sohamxda7
Copy link
Author

I've been reading the kernel source, and I am seeing the need to modify the mt76 module completely instead of using the existing mt76 module, integrating the code in this repo into the mod rather than writing a complementary module.

Let me see what see what I can do.

@sohamxda7 can you also provide me the output of sudo lspci and sudo lsusb to better understand the device structure on the vivobook?

Sorry, i was busy in other works, I will send you as soon as possible, please tell me if you need any other details as well.

@samveen
Copy link
Owner

samveen commented Apr 4, 2024

More detailed explaination of the issue is as follows:

  • The module mt7902 uses functions exported by the mt76 module.
  • There is a semaphore associated with the mt7902 device created in the mt7902 module.
  • The driver patch loading function is in the mt76 module.
  • When the patch loading function tries to get a lock on the patch semaphore, it fails.
  • After 10 tries the function returns a failure , propagating that back up the call stack, and the module loading fails.

The possible solution I thought was to duplicate all objects of the mt76 function required by the mt7902 module into the namespace of the mt7902 module with a custom prefix, so that there is no more dependency on the mt76 module. However that requires a lot of time, which I'm short of.

In case you have the time, would you create a PR after prefixing all the function and structure definitions in mt76/*.h in with mt7902 ?

For example in https://github.com/samveen/mt7902-dkms/blob/master/mt76/mt792x.h ,

struct mt792x_phy {

would become

struct mt7902_mt792x_phy {

Where ever struct mt792x_phy is used in the code, that would become struct mt7902_mt792x_phy. The same file contains the function definitions

static inline u8 mt792x_acpi_get_flags(struct mt792x_phy *phy)

That would change to

static inline u8 mt7902_mt792x_acpi_get_flags(struct mt7902_mt792x_phy *phy)

The code calling it would change to match.

@DarkMatter-999
Copy link
Contributor

just ran a find ./mt76 -type f -exec sed -i 's/mt792x/mt7902_mt792x/g' {} + over the repo it replaced all the occurances of mt792x into mt7902_mt792x. Is that what is needed?

Also should the #includes also need to be changed along with their respective file names or should i leave them as it is?

@samveen
Copy link
Owner

samveen commented Apr 5, 2024

The sed above would alter the #include statements too, so might as well go the whole hog and rename the includes.

The rename should break the compile, as the newly renamed functions do not exist. Once that breaks, the matching C files from the mt76 folder of the kernel need to be imported, and functions changed to match the headers.

@DarkMatter-999 Lakshyajeet, would you create a WIP PR with all the changes, so that the changes are reviewable? That'll allow quicker turnaround for any visible issues.

@DarkMatter-999
Copy link
Contributor

DarkMatter-999 commented Apr 5, 2024

Okay so from what I understand, I need to copy all the functions with the same content and just change the function and struct names to reflect the new names right?

Or would changing the includes back manually would work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants