Confusing warning from pci_map_rom()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While scanning through dmesg I found this line:

i915 0000:00:02.0: BAR 6: can't assign [??? 0x00000000 flags 0x0] (bogus alignment)

I digged a bit and found that this happens when pci_map_rom() is called and
BAR6 is just 0. The question is: which's fault is this (if at all)?

-the drivers fault: the driver should check if there is a ROM bar at all and
not call pci_map_rom() otherwise. In this case the warning message should be
more clear, like a WARN_ON or a message that this is a driver bug that needs
to be fixed. And the function doc needs to be updated.

-pci_map_rom()'s, because it shoudl check itself. In this case the function
should check first if the resource has length 0 and then just return NULL
without any further message. The driver has to deal with the NULL case anyway
and can complain itself if that is unexpected.

I'm fine either way, I just want to hear some opinions before doing a patch.
I would vote for #2.

Eike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux