r8169 misleading firmware error messages
Subsystems (2)
Hi,
I'm using Linux 2.6.38.3 with a Realtek 8169 card, ID: 10ec:8168 (integrated into an Intel D945GSEJT mobo). It never needed any firmware files, and when I was using 2.6.37, it never complained about it either. Now it does complain (but it still works perfectly):
r8169 0000:01:00.0: eth0: unable to apply firmware patch
Also when I do initramfs stuff:
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169
So then I installed the rtl_nic firmware files, and the error messages were gone.
How do I know if it actually tries to load the firmware at all? I see there's a condition, if an rtl_readphy returns a wrong value, it doesn't even try to load the firmware and just prints the message. Although this wouldn't explain why the error message disappeared when the files were there.
Clearly, my device works without these firmware files. If my device works better with them, or if there are other similar devices which require it, I think there should be a configuration option to disable this firmware stuff and its benefits altogether so that it doesn't even report that it needs it.
Best regards,
Signature · 2 lines
Fejes József http://joco.name
On Sat, Apr 16, 2011 at 10:27:01AM +0200, Fejes József wrote:
[...]
Quoted 4 lines
So then I installed the
rtl_nicfirmware files, and the error messages were gone.How do I know if it actually tries to load the firmware at all?
Currently: remove it and the driver will tell you that it could not load the firmware.
It's a bit rough. I'll report something through ethtool (-i).
Quoted 4 lines
I see there's a condition, if an
rtl_readphyreturns a wrong value, it doesn't even try to load the firmware and just prints the message. Although this wouldn't explain why the error message disappeared when the files were there.
I don't get your point.
Quoted 5 lines
Clearly, my device works without these firmware files. If my device works better with them, or if there are other similar devices which require it, I think there should be a configuration option to disable this firmware stuff and its benefits altogether so that it doesn't even report that it needs it.
The driver uses netif_warn, not netif_err.
I think the driver is nevrotic enough as is and I will not add what I consider a silly if not unusable configuration option.
Feel free to send patches if you think they really add some value.
Signature · 1 line
Ueimor
Quoted 6 lines
Quoted 4 lines
I see there's a condition, if an
rtl_readphyreturns a wrong value, it doesn't even try to load the firmware and just prints the message. Although this wouldn't explain why the error message disappeared when the files were there.I don't get your point.
I meant this:
2233 if ((rtl_readphy(tp, 0x06) != 0xbf00) ||
2234 (rtl_apply_firmware(tp, FIRMWARE_8168D_1) < 0)) {
2235 netif_warn(tp, probe, tp->dev, "unable to apply firmware patch\n");
2236 }
So if a user sees this warning, they don't know if the right firmware is missing or something else is wrong with the device and it doesn't even try to load the firmware.
Quoted 7 lines
Quoted 6 lines
Clearly, my device works without these firmware files. If my device works better with them, or if there are other similar devices which require it, I think there should be a configuration option to disable this firmware stuff and its benefits altogether so that it doesn't even report that it needs it.
Quoted 8 lines
The driver uses
netif_warn, notnetif_err.I think the driver is nevrotic enough as is and I will not add what I consider a silly if not unusable configuration option.
Feel free to send patches if you think they really add some value.
I took a deeper look. It seems to me that the firmware files are not the usual microcode type that the device can't function without, it just sets up some registers, which supposedly already contain some sensible values, so it's more like patching. That explains why this device still works without the firmware. So my actual question is this: what do I gain if I use the firmware, what do I lose if I don't? Since the previous kernel version, either something pretty important was moved out of the code into the firmware file, in which case it's a bad idea not to use them, or they add some features to an already perfectly working device, in which case I thought it could be a good idea to make it a configuration option. I'd just like to understand because I couldn't find any documentation, I don't mean to question your decisions.
On Sat, 2011-04-16 at 14:06 +0200, Fejes József wrote:
[...]
Quoted 4 lines
I took a deeper look. It seems to me that the firmware files are not the usual microcode type that the device can't function without, it just sets up some registers, which supposedly already contain some sensible values, so it's more like patching.
Some of the R8169 variants have a microcontroller in the PHY running firmware that is initially loaded from non-volatile memory (maybe eFuse?). These blobs contain bug fixes for the original PHY firmware.
Quoted 3 lines
That explains why this device still
works without the firmware. So my actual question is this: what do I gain if I use the firmware, what do I lose if I don't?
[...]
The original firmware apparently is unable to establish a stable link against some link partners.
This warning:
Quoted 4 lines
W: Possible missing firmware
/lib/firmware/rtl_nic/rtl8168d-2.fwfor module r8169
W: Possible missing firmware/lib/firmware/rtl_nic/rtl8168d-1.fwfor module r8169
is purely based on the MODULE_FIRMWARE annotations, which do not distinguish which devices might require which files.
Ben.
Signature · 2 lines
Ben Hutchings Once a job is fouled up, anything done to improve it makes it worse.
On Sat, Apr 16, 2011 at 02:06:38PM +0200, Fejes József wrote:
[...]
Quoted 7 lines
I meant this:
2233 if ((
rtl_readphy(tp, 0x06)!=0xbf00) ||
2234 (rtl_apply_firmware(tp, FIRMWARE_8168D_1)< 0)) {
2235 netif_warn(tp, probe,tp->dev, "unable to apply
firmware patch\n");
2236 }
Ok.
This part is about to be reworked in Linus's tree.
[...]
Quoted 7 lines
I took a deeper look. It seems to me that the firmware files are not the usual microcode type that the device can't function without, it just sets up some registers, which supposedly already contain some sensible values, so it's more like patching. That explains why this device still works without the firmware. So my actual question is
this: what do I gain if I use the firmware, what do I lose if I don't ?
As Ben stated, if everything seems ok with your link partner and you do not use the firmware, using the firmware will not make things work better.
Signature · 1 line
Ueimor