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

golden_hw_state failed with error -2 #212

Open
smsilva98 opened this issue May 8, 2022 · 12 comments
Open

golden_hw_state failed with error -2 #212

smsilva98 opened this issue May 8, 2022 · 12 comments

Comments

@smsilva98
Copy link

smsilva98 commented May 8, 2022

I'm getting the "golden_hw_state failed with error -2" error in my dmesg logs, it doesn't stop me from creating and using vgpu's though, what does this error affect? I saw issue #77 mentioned that it's not actually a real error but that issue was closed so I'm not sure if the issue was ever fixed, if it's not actually a real error can the error message be removed?

The full error message:
Direct firmware load for i915/gvt/vid_0x8086_did_0x5917_rid_0x07.golden_hw_state failed with error -2

I assume the error has something to do with [drivers/gpu/drm/i915/gvt/firmware.c] line 230
sprintf(path, "%s/vid_0x%04x_did_0x%04x_rid_0x%02x.golden_hw_state", GVT_FIRMWARE_PATH, pdev->vendor, pdev->device, pdev->revision);
and line 236
ret = request_firmware(&fw, path, gvt->gt->i915->drm.dev);

System: Arch Linux (5.17.5-arch1-1)
CPU: Kabby Lake (i7-8550U)
GPU: UHD Graphics 620 (Gen9)
Driver: mesa
Mkinitcpio Modules: kvmgt vfio vfio-iommu-type1 mdev
Kernel Parameters: intel_iommu=on i915.enable_guc=0 i915.enable_gvt=1

@smsilva98
Copy link
Author

smsilva98 commented May 8, 2022

I found the code that prints the message in the source code of request_firmware it internally calls _request_firmware and passes in FW_OPT_UEVENT for opt_flags which is an enum value for BIT(0), I think the only way to disable this message is to replace request_firmware with another function where we can pass in a different value for opt_flags to disable the message, does anyone have any thoughts on this?

if (ret) {
	if (!(opt_flags & FW_OPT_NO_WARN))
		dev_warn(device,
			"Direct firmware load for %s failed with error %d\n",
			name, ret);

@smsilva98
Copy link
Author

smsilva98 commented May 8, 2022

I think the problem can be solved by replacing line 236 of [drivers/gpu/drm/i915/gvt/firmware.c]
ret = request_firmware(&fw, path, gvt->gt->i915->drm.dev);
with either
ret = firmware_request_nowarn(&fw, path, gvt->gt->i915->drm.dev);
or potentially
ret = request_firmware_direct(&fw, path, gvt->gt->i915->drm.dev);
can someone please confirm if this would be an acceptable solution?

@TerrenceXu
Copy link

Thanks @smsilva98 , we will check it.

@jnikula
Copy link
Contributor

jnikula commented Jun 14, 2022

Also hit by other folks at https://gitlab.freedesktop.org/drm/intel/-/issues/6167

@mhalano
Copy link

mhalano commented Jul 27, 2022

I'm getting this log and black screen, but no problem to load firmware. It is similar to issue @jnikula mentioned before. Could it be related?

journalctl -b -2 |grep i915          
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: enabling device (0006 -> 0007)
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=mem
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/tgl_dmc_ver2_12.bin (v2.12)
jul 27 18:46:49 glados kernel: mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: [drm] failed to retrieve link info, disabling eDP
jul 27 18:46:49 glados kernel: mei_pxp 0000:00:16.0-fbf6fcf1-96cf-4e2e-a6a6-1bab8cbe36b1: bound 0000:00:02.0 (ops i915_pxp_tee_component_ops [i915])
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: [drm] Protected Xe Path (PXP) protected content support initialized
jul 27 18:46:51 glados kernel: [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
jul 27 18:46:51 glados kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
jul 27 18:46:51 glados kernel: i915 0000:00:02.0: [drm] Cannot find any crtc or sizes
jul 27 18:46:51 glados kernel: i915 0000:00:02.0: [drm] Cannot find any crtc or sizes

smsilva98 added a commit to smsilva98/gvt-linux that referenced this issue Aug 9, 2022
When request_firmware runs its prints an error message "Direct firmware load for i915/gvt/vid_0x8086_did_0x5917_rid_0x07.golden_hw_state failed with error -2
" into the logs, as mentioned in issue intel#77 this is not a real error message and should be removed. firmware_request_nowarn is the proper system call to use. It runs the exact same code as request_firmware except passes an extra bit to the internally called _request_firmware to disable the branch of code that prints the error message. I posted and discussed some of the internal code in issue intel#212
@insomnia417
Copy link

Is this problem fixed now? I still have this problem on unreid 6.11.5. CPU: 9900ES (QQZ5)

@rahulc07
Copy link

rahulc07 commented Mar 2, 2023

Are you having problems actually creating a vgpu?

I think this error could be solved by installing the linux-firmware or firmware-linux package

@insomnia417
Copy link

but unraid is not support

@smsilva98
Copy link
Author

smsilva98 commented Mar 3, 2023

The error still needs to be fixed. I found the source of the error, and it only required a one-line of code change to fix. I submitted a pull request with the fix a while ago, but it has not been merged yet. I've tried pull requests to multiple branches, and I've raised a second issue #218 asking where I need to submit the pull request, in order to get it merged but haven't heard back anything from anyone. Does anybody know what I need to do to get my pull request merged into the project?

@zhenyw
Copy link
Contributor

zhenyw commented Mar 3, 2023

sorry, gvt development doesn't use github to merge any patch, it's still required to be sent to intel-gvt-dev@lists.freedesktop.org mail list for review and merge.

@T4ylan
Copy link

T4ylan commented Jun 23, 2023

Any news about this issue?

@smsilva98
Copy link
Author

@T4ylan I don't think anyone has looked at this, I'll email the mail list to see if it can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants