Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752225AbdGYORp (ORCPT ); Tue, 25 Jul 2017 10:17:45 -0400 Received: from mailout1.hostsharing.net ([83.223.95.204]:56623 "EHLO mailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751799AbdGYORo (ORCPT ); Tue, 25 Jul 2017 10:17:44 -0400 Date: Tue, 25 Jul 2017 16:17:42 +0200 From: Lukas Wunner To: Mika Westerberg Cc: Greg Kroah-Hartman , Christian Kellner , Andreas Noever , Michael Jamet , Yehezkel Bernat , linux-kernel@vger.kernel.org Subject: Re: [PATCH] thunderbolt: Do not enumerate more ports from DROM than the controller has Message-ID: <20170725141742.GA32548@wunner.de> References: <20170725120647.29341-1-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170725120647.29341-1-mika.westerberg@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1280 Lines: 33 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 Thanks for the report and quick fix! Lukas