linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>,
	H Peter Anvin <hpa@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>,
	Peter Zijlstra <peterz@infradead.org>,
	"Stuart R . Anderson" <stuart.r.anderson@intel.com>,
	alan@linux.intel.com, x86@kernel.org,
	linux-kernel@vger.kernel.org
Cc: Feng Tang <feng.tang@intel.com>
Subject: [PATCH RFC] x86/earlyprintk: Don't fail the pciserial device with incorrect class code
Date: Thu, 27 Sep 2018 20:43:20 +0800	[thread overview]
Message-ID: <20180927124320.13419-1-feng.tang@intel.com> (raw)

"pciserial" earlyprintk helps much on many modern x86 platforms,
but unfortunately there are some platforms whose PCI UART devices
have wrong PCI class code, which will be blocked by current check.

So loose the class code check by giving a warning message instead.
This should be fine, as a developer who can give the accurate
BDF should know whether it's a usable UART device.

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 arch/x86/kernel/early_printk.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 5e801c8..abe1d08 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -265,7 +265,8 @@ static __init void early_pci_serial_init(char *s)
 	if (((classcode >> 16 != PCI_CLASS_COMMUNICATION_MODEM) &&
 	     (classcode >> 16 != PCI_CLASS_COMMUNICATION_SERIAL)) ||
 	   (((classcode >> 8) & 0xff) != 0x02)) /* 16550 I/F at BAR0 */
-		return;
+		pr_warn("earlyprintk: classcode for pcidev %d:%d:%d shows it's not a UART like device, please check!\n",
+			bus, slot, func);
 
 	/*
 	 * Determine if it is IO or memory mapped
-- 
2.7.4


             reply	other threads:[~2018-09-27 12:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 12:43 Feng Tang [this message]
2018-09-27 13:30 ` [PATCH RFC] x86/earlyprintk: Don't fail the pciserial device with incorrect class code Borislav Petkov
2018-09-28  1:47   ` Feng Tang

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=20180927124320.13419-1-feng.tang@intel.com \
    --to=feng.tang@intel.com \
    --cc=alan@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=stuart.r.anderson@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).