Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755960AbbHDAkK (ORCPT ); Mon, 3 Aug 2015 20:40:10 -0400 Received: from vi37-28-154-113.vibiznes.pl ([37.28.154.113]:36861 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754672AbbHDAkI (ORCPT ); Mon, 3 Aug 2015 20:40:08 -0400 Subject: Re: [PATCH] serial: don't announce CIR serial ports To: Greg Kroah-Hartman References: <55BE8725.6090303@maciej.szmigiero.name> <20150803234012.GA31555@kroah.com> Cc: linux-serial@vger.kernel.org, Jiri Slaby , linux-kernel From: "Maciej S. Szmigiero" X-Enigmail-Draft-Status: N1110 Message-ID: <55C009E1.3090400@maciej.szmigiero.name> Date: Tue, 4 Aug 2015 02:40:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <20150803234012.GA31555@kroah.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2874 Lines: 73 On 04.08.2015 01:40, Greg Kroah-Hartman wrote: > On Sun, Aug 02, 2015 at 11:09:57PM +0200, Maciej S. Szmigiero wrote: >> CIR type serial ports aren't real serial ports. >> This is just a way to prevent legacy serial driver >> from probing and eventually binding some resources >> so don't announce them like normal serial ports. >> >> Signed-off-by: Maciej Szmigiero >> --- >> drivers/tty/serial/serial_core.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c >> index f368520..99f944d 100644 >> --- a/drivers/tty/serial/serial_core.c >> +++ b/drivers/tty/serial/serial_core.c >> @@ -2237,7 +2237,7 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state, >> port->ops->config_port(port, flags); >> } >> >> - if (port->type != PORT_UNKNOWN) { >> + if (port->type != PORT_UNKNOWN && port->type != PORT_8250_CIR) { >> unsigned long flags; >> >> uart_report_port(drv, port); > > This does not seem correct, why is this type of "port" somehow special > that it should be skiped? PORT_8250_CIR is not an actual serial port, it is a way to tell serial driver to not really bind to some resources (I/O port, memory range, IRQ). The 8250 driver does scan a few predefined locations (I/O ports on x86) to discover legacy serial ports there. The problem is that some of devices that shouldn't been driven by 8250 driver implement enough of serial port interface to be identified as a serial port (and bound to) during this scan by this driver. This prevents their native driver from binding to them since their resources are already taken. When a serial port has PORT_8250_CIR type the relevant resources won't be reserved by 8250 driver and trying to use this port will result in ENODEV or EIO (drivers/tty/serial/8250/8250_core.c:serial8250_do_startup() returns -ENODEV unconditionally for such type of port). Marking port as PORT_8250_CIR type is done by 8250 PNP driver which will do this for a some of PNP IDs (besides marking them it also won't bind to these devices). Currently only Winbond CIR port PNP ID is on the list, but I have also submitted other patch to add SMSC IR port too, as it has the same problem. Overall, I guess the announcement purpose is for user to tell him what serial ports he has on the system, and by extension, which ones he can use. Since user can't really use this type of serial port it would be nice to not announce it. That's why I've submitted this patch. > thanks, > > greg k-h > Thanks and best regards, Maciej Szmigiero -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/