From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by befuddled.reisers.ca (Postfix, from userid 65534) id E26111EF859; Thu, 25 Feb 2016 20:41:37 -0500 (EST) Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by befuddled.reisers.ca (Postfix) with ESMTPS id 337AD1EF842 for ; Thu, 25 Feb 2016 20:41:36 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id AABAE200C8 for ; Fri, 26 Feb 2016 02:41:22 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ce2VkTpQY3oq for ; Fri, 26 Feb 2016 02:41:22 +0100 (CET) Received: from var.youpi.perso.aquilenet.fr (LFbn-1-6757-94.w90-120.abo.wanadoo.fr [90.120.189.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 895E7200BC for ; Fri, 26 Feb 2016 02:41:22 +0100 (CET) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.86) (envelope-from ) id 1aZ7PG-0001Xi-1s for speakup@linux-speakup.org; Fri, 26 Feb 2016 02:41:22 +0100 Date: Fri, 26 Feb 2016 02:41:22 +0100 From: Samuel Thibault To: "Speakup is a screen review system for Linux." Subject: Re: Help with serial synths in 4.X kernels Message-ID: <20160226014122.GN3291@var.home> References: <56CC626F.90700@baechler.net> <497.1456239922@ccs.covici.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: <497.1456239922@ccs.covici.com> User-Agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 X-BeenThere: speakup@linux-speakup.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Speakup is a screen review system for Linux." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 01:41:38 -0000 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, covici@ccs.covici.com, on Tue 23 Feb 2016 10:05:22 -0500, wrote: > Do you have the serialio.c patched to comment out the return null in > around line 42? Just wondering... Is it known that passing 8250.nr_uarts=0 as a kernel command-line parameter has actually the same effect? It'll just prevent the normal serial driver from taking the ports, and thus speakup will not have any trouble accessing them. About the patches I have sent to the linux kernel mailing list, only the attached one is needed to fix serial port access. About proper serial port access, somebody from the Outreachy intern program is currently having a look. Samuel --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=speakup_serial_ports Subject: [PATCH] Staging: speakup: Fix getting port information Commit f79b0d9c223c ("staging: speakup: Fixed warning instead of ") broke the port information in the speakup driver: SERIAL_PORT_DFNS only gets defined if asm/serial.h is included, and no other header includes asm/serial.h. We here make sure serialio.c does get the arch-specific definition of SERIAL_PORT_DFNS from asm/serial.h, if any. Along the way, this makes sure that we do have information for the requested serial port number (index) Signed-off-by: Samuel Thibault Fixes: f79b0d9c223c ("staging: speakup: Fixed warning instead of ") --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -6,6 +6,11 @@ #include "spk_priv.h" #include "serialio.h" +#include +/* WARNING: Do not change this to without testing that + * SERIAL_PORT_DFNS does get defined to the appropriate value. */ +#include + #ifndef SERIAL_PORT_DFNS #define SERIAL_PORT_DFNS #endif @@ -23,9 +28,15 @@ const struct old_serial_port *spk_serial int baud = 9600, quot = 0; unsigned int cval = 0; int cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8; - const struct old_serial_port *ser = rs_table + index; + const struct old_serial_port *ser; int err; + if (index >= ARRAY_SIZE(rs_table)) { + pr_info("no port info for ttyS%d\n", index); + return NULL; + } + ser = rs_table + index; + /* Divisor, bytesize and parity */ quot = ser->baud_base / baud; cval = cflag & (CSIZE | CSTOPB); --FCuugMFkClbJLl1L--