lkml.org 
[lkml]   [2017]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] thunderbolt: Do not enumerate more ports from DROM than the controller has
On Tue, Jul 25, 2017 at 03:06:47PM +0300, Mika Westerberg wrote:
> + /*
> + * Some DROMs list more ports than the controller actually has
> + * so we skip those but allow the parser to continue.
> + */
> + if (header->index > sw->config.max_port_number) {
> + dev_warn_once(&sw->dev, "DROM has too many port entries %u (expected %u)\n",
> + header->index, sw->config.max_port_number);
> + return 0;
> + }
> +

I wouldn't have gotten into bikeshedding here but since Greg is
indicating he'd like a repost:

Could you tone down the error to KERN_INFO, it seems harmless and
the user will see this on every boot even though they may not be able
to do anything about it, short of flashing the EEPROM on the
Thunderbolt controller which may not be supported by the vendor.

Also, you're now only reporting the first index of additional
unwanted entries, which isn't really helpful. And max_port_number
is already reported upon allocation of the switch. I suggest removing
the two %u and just reporting the existence of additional
superfluous port entries in the Device ROM and that they're being
ignored (e.g. "ignoring unnecessary extra entries in DROM").

Apart from these nits,
Reviewed-by: Lukas Wunner <lukas@wunner.de>

Thanks for the report and quick fix!

Lukas

\
 
 \ /
  Last update: 2017-07-25 16:18    [W:0.058 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site