From: Lukas Wunner <lukas@wunner.de>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Christian Kellner <ckellner@redhat.com>,
Andreas Noever <andreas.noever@gmail.com>,
Michael Jamet <michael.jamet@intel.com>,
Yehezkel Bernat <yehezkel.bernat@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thunderbolt: Do not enumerate more ports from DROM than the controller has
Date: Tue, 25 Jul 2017 16:17:42 +0200 [thread overview]
Message-ID: <20170725141742.GA32548@wunner.de> (raw)
In-Reply-To: <20170725120647.29341-1-mika.westerberg@linux.intel.com>
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
prev parent reply other threads:[~2017-07-25 14:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 12:06 [PATCH] thunderbolt: Do not enumerate more ports from DROM than the controller has Mika Westerberg
2017-07-25 12:20 ` Mika Westerberg
2017-07-25 13:53 ` Greg Kroah-Hartman
2017-07-25 14:17 ` Lukas Wunner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170725141742.GA32548@wunner.de \
--to=lukas@wunner.de \
--cc=andreas.noever@gmail.com \
--cc=ckellner@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.jamet@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=yehezkel.bernat@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox