Message ID | 20230724063341.28198-1-rdunlap@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1617042vqg; Mon, 24 Jul 2023 00:00:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFW/2oC6Y4i304NdeVZTmvug/QT5fBS4reYNpUQoTd5dMXUBs+cmVsn2wn2IMVqCp5GoHQY X-Received: by 2002:aa7:ce10:0:b0:522:1fd2:ca7a with SMTP id d16-20020aa7ce10000000b005221fd2ca7amr3903685edv.29.1690182059500; Mon, 24 Jul 2023 00:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690182059; cv=none; d=google.com; s=arc-20160816; b=mRuJy4RUx58eS7+XiSzRpe+bm2atR0saDsAdJRaVPsnvFuDhnOuc7RQBHoziJ3Xe7r C23WgUJdLOoOFxdv2hhbtldcUbGQYkz5c2h3UJE0hkKNad9m5jZ2GH8spXsG+eLJOyfl XZNVMwqKjaD4iGQ0BNLqJY53zlfoqrK6JQ0HjUAsCYhwP4JuOrxDYnuAYVwvN/z6cXLI o74OKh5B3WkheqzQMyB0dBG6uBTKeknhi2KCotjcl1ZSoAzMOAmaLlSrRZeqiBIGr9ys T3J2m3grzKHdb34aegoipKUR5RTz/MTz3++ieWJZt+L40Frg1utRzZYzFPsTaR5Jh04M KXFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xi02gFW93Id0bT7Sh+4wBXdpqlJzFPayUdH3m+EHzPM=; fh=9bve6RI0XNndX5v+//R63Y5yUo82f8meSCc1RH8a1xI=; b=L/zzrFMrQoFZZIZlqzYPFRyWg7j8IG2CSUlA6KMu7ZTHFt1xdRNOKt3RHW9cmfM4ps zgUXjww6rPTS5KNiKN8EbhKTsHKmAYMydauQGXdxjoTRiY2WEBl04s2OiGa5gx7bYMAy CUmDnGkFDz5z2ltA0/VEooDdahRY/LpG7HkwiI8GfXsR9KNGdJVhqIBoU8Vpx2+FdvIQ tRfWK+ExAXw0rqfjVF4HNeD6SGin7JTNR+/m3lUiiTrFSq/Q2oz5OlAhjvNXRm5Ue64v QRCC55hzbJ5fF5Jr7WjmzBc4Prs+fwaJwORucq86wNwba/4FiIMmGaUB9QBPHK6gXWuu mF9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=BSdcx4Wo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b22-20020aa7df96000000b0052237dfa831si475522edy.541.2023.07.24.00.00.31; Mon, 24 Jul 2023 00:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=BSdcx4Wo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbjGXGdw (ORCPT <rfc822;kloczko.tomasz@gmail.com> + 99 others); Mon, 24 Jul 2023 02:33:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbjGXGdu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Jul 2023 02:33:50 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D439ED2; Sun, 23 Jul 2023 23:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=xi02gFW93Id0bT7Sh+4wBXdpqlJzFPayUdH3m+EHzPM=; b=BSdcx4WoALDgeHupsuSnOLc1rn gERe7ONSyqR4QdO2pdzHlgtJabW3mHKBgo9gz+fGGpRUX+vnDhZJ5AOedAXhwikUVAL0+SmhjwbxN /N0VWSoe1u1O8qFlW0Q/15iF3i1+4nL3KQEXy6vAxvUZONFG/WTS+I9t67a82XbLG7OfvoNZTxlTI kjMZrhFr7XVvcCGYfNtO/vTmnvsfUi39W5AF55O0z+mC8Pv0FcqpRQ7u2UZsTkfqp6YEEL95yW2ps /w1IpB+gf6iGr6PMeyaMEROi7+ys87t30fRl2tQhbDcxqjeRIsrAXvlidl94WCiUtoYWe74OlVV2m HuQe1YPw==; Received: from [2601:1c2:980:9ec0::2764] (helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qNp8c-002ySv-17; Mon, 24 Jul 2023 06:33:46 +0000 From: Randy Dunlap <rdunlap@infradead.org> To: linux-kernel@vger.kernel.org Cc: Randy Dunlap <rdunlap@infradead.org>, Timur Tabi <timur@kernel.org>, Kumar Gala <galak@kernel.crashing.org>, linuxppc-dev@lists.ozlabs.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, linux-serial@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>, linux-doc@vger.kernel.org Subject: [PATCH] Documentation: devices.txt: reconcile serial/ucc_uart minor numers Date: Sun, 23 Jul 2023 23:33:41 -0700 Message-ID: <20230724063341.28198-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772284342768120882 X-GMAIL-MSGID: 1772284342768120882 |
Series |
Documentation: devices.txt: reconcile serial/ucc_uart minor numers
|
|
Commit Message
Randy Dunlap
July 24, 2023, 6:33 a.m. UTC
Reconcile devices.txt with serial/ucc_uart.c regarding device number
assignments. ucc_uart.c supports 4 ports and uses minor devnums
46-49, so update devices.txt with that info.
Then update ucc_uart.c's reference to the location of the devices.txt
list in the kernel source tree.
Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART")
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Timur Tabi <timur@kernel.org>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: linux-serial@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org
---
Documentation/admin-guide/devices.txt | 2 +-
drivers/tty/serial/ucc_uart.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Sun, Jul 23, 2023 at 11:33:41PM -0700, Randy Dunlap wrote: > Reconcile devices.txt with serial/ucc_uart.c regarding device number > assignments. ucc_uart.c supports 4 ports and uses minor devnums > 46-49, so update devices.txt with that info. > Then update ucc_uart.c's reference to the location of the devices.txt > list in the kernel source tree. > > Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART") > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > Cc: Timur Tabi <timur@kernel.org> > Cc: Kumar Gala <galak@kernel.crashing.org> > Cc: linuxppc-dev@lists.ozlabs.org > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Jiri Slaby <jirislaby@kernel.org> > Cc: linux-serial@vger.kernel.org > Cc: Jonathan Corbet <corbet@lwn.net> > Cc: linux-doc@vger.kernel.org > --- > Documentation/admin-guide/devices.txt | 2 +- > drivers/tty/serial/ucc_uart.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Very nice, thanks for catching this, I'll go queue it up. Actually, how did you notice this? I don't think the devices.txt file is up to date at all anymore, and odds are, other things are wrong in it too. thanks, greg k-h
On 7/25/23 10:27, Greg Kroah-Hartman wrote: > On Sun, Jul 23, 2023 at 11:33:41PM -0700, Randy Dunlap wrote: >> Reconcile devices.txt with serial/ucc_uart.c regarding device number >> assignments. ucc_uart.c supports 4 ports and uses minor devnums >> 46-49, so update devices.txt with that info. >> Then update ucc_uart.c's reference to the location of the devices.txt >> list in the kernel source tree. >> >> Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART") >> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> >> Cc: Timur Tabi <timur@kernel.org> >> Cc: Kumar Gala <galak@kernel.crashing.org> >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> >> Cc: Jiri Slaby <jirislaby@kernel.org> >> Cc: linux-serial@vger.kernel.org >> Cc: Jonathan Corbet <corbet@lwn.net> >> Cc: linux-doc@vger.kernel.org >> --- >> Documentation/admin-guide/devices.txt | 2 +- >> drivers/tty/serial/ucc_uart.c | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) > > Very nice, thanks for catching this, I'll go queue it up. > > Actually, how did you notice this? I don't think the devices.txt file > is up to date at all anymore, and odds are, other things are wrong in it > too. I accidentally! saw some reference to lanana.org in the kernel source code and just grepped for that and saw this...
On Mon, Jul 24, 2023 at 1:33 AM Randy Dunlap <rdunlap@infradead.org> wrote: > > Reconcile devices.txt with serial/ucc_uart.c regarding device number > assignments. ucc_uart.c supports 4 ports and uses minor devnums > 46-49, so update devices.txt with that info. > Then update ucc_uart.c's reference to the location of the devices.txt > list in the kernel source tree. > > Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART") > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > Cc: Timur Tabi <timur@kernel.org> > Cc: Kumar Gala <galak@kernel.crashing.org> > Cc: linuxppc-dev@lists.ozlabs.org > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Jiri Slaby <jirislaby@kernel.org> > Cc: linux-serial@vger.kernel.org > Cc: Jonathan Corbet <corbet@lwn.net> > Cc: linux-doc@vger.kernel.org Acked-by: Timur Tabi <timur@kernel.org> One thing does concern me. The UCC UART driver piggy-backs on the CPM driver's layout (see cpm_uart.h), but apparently CPM UART supports 6 devices, not four: #define UART_NR fs_uart_nr where fs_uart_nr is defined in enum fs_uart_id. Unfortunately, it's been so long since I've touched this code, I'm not sure whether this means anything.
On 7/25/23 13:38, Timur Tabi wrote: > On Mon, Jul 24, 2023 at 1:33 AM Randy Dunlap <rdunlap@infradead.org> wrote: >> >> Reconcile devices.txt with serial/ucc_uart.c regarding device number >> assignments. ucc_uart.c supports 4 ports and uses minor devnums >> 46-49, so update devices.txt with that info. >> Then update ucc_uart.c's reference to the location of the devices.txt >> list in the kernel source tree. >> >> Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART") >> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> >> Cc: Timur Tabi <timur@kernel.org> >> Cc: Kumar Gala <galak@kernel.crashing.org> >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> >> Cc: Jiri Slaby <jirislaby@kernel.org> >> Cc: linux-serial@vger.kernel.org >> Cc: Jonathan Corbet <corbet@lwn.net> >> Cc: linux-doc@vger.kernel.org > > Acked-by: Timur Tabi <timur@kernel.org> > > One thing does concern me. The UCC UART driver piggy-backs on the CPM > driver's layout (see cpm_uart.h), but apparently CPM UART supports 6 > devices, not four: > > #define UART_NR fs_uart_nr > > where fs_uart_nr is defined in enum fs_uart_id. > > Unfortunately, it's been so long since I've touched this code, I'm not > sure whether this means anything. If CPM UART code ever worked with > 4 ports, it probably just used minor devnums that were not allocated to it. Also, it looks like the CPU UART part of Documentation/admin-guide/devices.txt needs to be updated: 46 = /dev/cucpm0 Callout device for ttyCPM0 ... 49 = /dev/cucpm5 Callout device for ttyCPM5 The driver must use some tricks to get 6 ports into 4 devnums. :)
Le 24/07/2023 à 08:33, Randy Dunlap a écrit : > Reconcile devices.txt with serial/ucc_uart.c regarding device number > assignments. ucc_uart.c supports 4 ports and uses minor devnums > 46-49, so update devices.txt with that info. > Then update ucc_uart.c's reference to the location of the devices.txt > list in the kernel source tree. Devices ttyCPM* belong to cpm_uart driver. As explained in the comment you have modified in UCC uart driver, UCC uart borrows those devices and shall not be considered as the reference. But the lines you modify in device.txt doesn't mention QE UCC, it mentions CPM SCC and CPM SMC. CPM uart driver supports up to 6 ports (4 SCC and 2 SMC). On one of my boards which has a powerpc mpc866 CPU, I have: [ 2.393872] ff000a80.serial: ttyCPM0 at MMIO 0xfff00a80 (irq = 19, base_baud = 8250000) is a CPM UART [ 2.411899] ff000a90.serial: ttyCPM1 at MMIO 0xfff00a90 (irq = 20, base_baud = 8250000) is a CPM UART [ 2.430352] ff000a00.serial: ttyCPM2 at MMIO 0xfff00a00 (irq = 30, base_baud = 8250000) is a CPM UART [ 2.448944] ff000a20.serial: ttyCPM3 at MMIO 0xfff00a20 (irq = 29, base_baud = 8250000) is a CPM UART [ 2.467435] ff000a40.serial: ttyCPM4 at MMIO 0xfff00a40 (irq = 28, base_baud = 8250000) is a CPM UART [ 2.485924] ff000a60.serial: ttyCPM5 at MMIO 0xfff00a60 (irq = 27, base_baud = 8250000) is a CPM UART # ll /dev/ttyCPM* crw------- 1 root root 204, 46 Jan 1 01:01 /dev/ttyCPM0 crw------- 1 root root 204, 47 Jan 1 01:00 /dev/ttyCPM1 crw------- 1 root root 204, 48 Jan 1 01:00 /dev/ttyCPM2 crw------- 1 root root 204, 49 Jan 1 01:00 /dev/ttyCPM3 crw------- 1 root root 204, 50 Jan 1 01:00 /dev/ttyCPM4 crw------- 1 root root 204, 51 Jan 1 01:00 /dev/ttyCPM5 # cat /proc/tty/drivers /dev/tty /dev/tty 5 0 system:/dev/tty /dev/console /dev/console 5 1 system:console /dev/ptmx /dev/ptmx 5 2 system ttyCPM /dev/ttyCPM 204 46-51 serial pty_slave /dev/pts 136 0-1048575 pty:slave pty_master /dev/ptm 128 0-1048575 pty:master pty_slave /dev/ttyp 3 0-4 pty:slave pty_master /dev/pty 2 0-4 pty:master Christophe > > Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART") > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Randy Dunlap <rdunlap@infradead.org> > Cc: Timur Tabi <timur@kernel.org> > Cc: Kumar Gala <galak@kernel.crashing.org> > Cc: linuxppc-dev@lists.ozlabs.org > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Jiri Slaby <jirislaby@kernel.org> > Cc: linux-serial@vger.kernel.org > Cc: Jonathan Corbet <corbet@lwn.net> > Cc: linux-doc@vger.kernel.org > --- > Documentation/admin-guide/devices.txt | 2 +- > drivers/tty/serial/ucc_uart.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff -- a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c > --- a/drivers/tty/serial/ucc_uart.c > +++ b/drivers/tty/serial/ucc_uart.c > @@ -59,7 +59,7 @@ static int firmware_loaded; > /* #define LOOPBACK */ > > /* The major and minor device numbers are defined in > - * http://www.lanana.org/docs/device-list/devices-2.6+.txt. For the QE > + * Documentation/admin-guide/devices.txt. For the QE > * UART, we have major number 204 and minor numbers 46 - 49, which are the > * same as for the CPM2. This decision was made because no Freescale part > * has both a CPM and a QE. > diff -- a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt > --- a/Documentation/admin-guide/devices.txt > +++ b/Documentation/admin-guide/devices.txt > @@ -2691,7 +2691,7 @@ > 45 = /dev/ttyMM1 Marvell MPSC - port 1 (obsolete unused) > 46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0 > ... > - 47 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 5 > + 49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 3 > 50 = /dev/ttyIOC0 Altix serial card > ... > 81 = /dev/ttyIOC31 Altix serial card
Hi Christophe, On 7/31/23 22:21, Christophe Leroy wrote: > > > Le 24/07/2023 à 08:33, Randy Dunlap a écrit : >> Reconcile devices.txt with serial/ucc_uart.c regarding device number >> assignments. ucc_uart.c supports 4 ports and uses minor devnums >> 46-49, so update devices.txt with that info. >> Then update ucc_uart.c's reference to the location of the devices.txt >> list in the kernel source tree. > > Devices ttyCPM* belong to cpm_uart driver. As explained in the comment > you have modified in UCC uart driver, UCC uart borrows those devices and > shall not be considered as the reference. But the lines you modify in > device.txt doesn't mention QE UCC, it mentions CPM SCC and CPM SMC. > > CPM uart driver supports up to 6 ports (4 SCC and 2 SMC). > Thank you for replying. Does this mean that the patch should be reverted? > On one of my boards which has a powerpc mpc866 CPU, I have: > > [ 2.393872] ff000a80.serial: ttyCPM0 at MMIO 0xfff00a80 (irq = 19, > base_baud = 8250000) is a CPM UART > [ 2.411899] ff000a90.serial: ttyCPM1 at MMIO 0xfff00a90 (irq = 20, > base_baud = 8250000) is a CPM UART > [ 2.430352] ff000a00.serial: ttyCPM2 at MMIO 0xfff00a00 (irq = 30, > base_baud = 8250000) is a CPM UART > [ 2.448944] ff000a20.serial: ttyCPM3 at MMIO 0xfff00a20 (irq = 29, > base_baud = 8250000) is a CPM UART > [ 2.467435] ff000a40.serial: ttyCPM4 at MMIO 0xfff00a40 (irq = 28, > base_baud = 8250000) is a CPM UART > [ 2.485924] ff000a60.serial: ttyCPM5 at MMIO 0xfff00a60 (irq = 27, > base_baud = 8250000) is a CPM UART > > # ll /dev/ttyCPM* > crw------- 1 root root 204, 46 Jan 1 01:01 /dev/ttyCPM0 > crw------- 1 root root 204, 47 Jan 1 01:00 /dev/ttyCPM1 > crw------- 1 root root 204, 48 Jan 1 01:00 /dev/ttyCPM2 > crw------- 1 root root 204, 49 Jan 1 01:00 /dev/ttyCPM3 > crw------- 1 root root 204, 50 Jan 1 01:00 /dev/ttyCPM4 > crw------- 1 root root 204, 51 Jan 1 01:00 /dev/ttyCPM5 I don't see minors 50-51 allocated in devices.txt for use by this device/driver. Am I overlooking that allocation somewhere? Thanks for your help. > > # cat /proc/tty/drivers > /dev/tty /dev/tty 5 0 system:/dev/tty > /dev/console /dev/console 5 1 system:console > /dev/ptmx /dev/ptmx 5 2 system > ttyCPM /dev/ttyCPM 204 46-51 serial > pty_slave /dev/pts 136 0-1048575 pty:slave > pty_master /dev/ptm 128 0-1048575 pty:master > pty_slave /dev/ttyp 3 0-4 pty:slave > pty_master /dev/pty 2 0-4 pty:master > > Christophe > > >> >> Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART") >> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> >> Cc: Timur Tabi <timur@kernel.org> >> Cc: Kumar Gala <galak@kernel.crashing.org> >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> >> Cc: Jiri Slaby <jirislaby@kernel.org> >> Cc: linux-serial@vger.kernel.org >> Cc: Jonathan Corbet <corbet@lwn.net> >> Cc: linux-doc@vger.kernel.org >> --- >> Documentation/admin-guide/devices.txt | 2 +- >> drivers/tty/serial/ucc_uart.c | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff -- a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c >> --- a/drivers/tty/serial/ucc_uart.c >> +++ b/drivers/tty/serial/ucc_uart.c >> @@ -59,7 +59,7 @@ static int firmware_loaded; >> /* #define LOOPBACK */ >> >> /* The major and minor device numbers are defined in >> - * http://www.lanana.org/docs/device-list/devices-2.6+.txt. For the QE >> + * Documentation/admin-guide/devices.txt. For the QE >> * UART, we have major number 204 and minor numbers 46 - 49, which are the >> * same as for the CPM2. This decision was made because no Freescale part >> * has both a CPM and a QE. >> diff -- a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt >> --- a/Documentation/admin-guide/devices.txt >> +++ b/Documentation/admin-guide/devices.txt >> @@ -2691,7 +2691,7 @@ >> 45 = /dev/ttyMM1 Marvell MPSC - port 1 (obsolete unused) >> 46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0 >> ... >> - 47 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 5 >> + 49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 3 >> 50 = /dev/ttyIOC0 Altix serial card >> ... >> 81 = /dev/ttyIOC31 Altix serial card
Le 01/08/2023 à 07:30, Randy Dunlap a écrit : > Hi Christophe, > > On 7/31/23 22:21, Christophe Leroy wrote: >> >> >> Le 24/07/2023 à 08:33, Randy Dunlap a écrit : >>> Reconcile devices.txt with serial/ucc_uart.c regarding device number >>> assignments. ucc_uart.c supports 4 ports and uses minor devnums >>> 46-49, so update devices.txt with that info. >>> Then update ucc_uart.c's reference to the location of the devices.txt >>> list in the kernel source tree. >> >> Devices ttyCPM* belong to cpm_uart driver. As explained in the comment >> you have modified in UCC uart driver, UCC uart borrows those devices and >> shall not be considered as the reference. But the lines you modify in >> device.txt doesn't mention QE UCC, it mentions CPM SCC and CPM SMC. >> >> CPM uart driver supports up to 6 ports (4 SCC and 2 SMC). >> > > Thank you for replying. > > Does this mean that the patch should be reverted? Not sure it should be reverted, the best would be to fix it up because anyway what we had was wrong. See below. > >> On one of my boards which has a powerpc mpc866 CPU, I have: >> >> [ 2.393872] ff000a80.serial: ttyCPM0 at MMIO 0xfff00a80 (irq = 19, >> base_baud = 8250000) is a CPM UART >> [ 2.411899] ff000a90.serial: ttyCPM1 at MMIO 0xfff00a90 (irq = 20, >> base_baud = 8250000) is a CPM UART >> [ 2.430352] ff000a00.serial: ttyCPM2 at MMIO 0xfff00a00 (irq = 30, >> base_baud = 8250000) is a CPM UART >> [ 2.448944] ff000a20.serial: ttyCPM3 at MMIO 0xfff00a20 (irq = 29, >> base_baud = 8250000) is a CPM UART >> [ 2.467435] ff000a40.serial: ttyCPM4 at MMIO 0xfff00a40 (irq = 28, >> base_baud = 8250000) is a CPM UART >> [ 2.485924] ff000a60.serial: ttyCPM5 at MMIO 0xfff00a60 (irq = 27, >> base_baud = 8250000) is a CPM UART >> >> # ll /dev/ttyCPM* >> crw------- 1 root root 204, 46 Jan 1 01:01 /dev/ttyCPM0 >> crw------- 1 root root 204, 47 Jan 1 01:00 /dev/ttyCPM1 >> crw------- 1 root root 204, 48 Jan 1 01:00 /dev/ttyCPM2 >> crw------- 1 root root 204, 49 Jan 1 01:00 /dev/ttyCPM3 >> crw------- 1 root root 204, 50 Jan 1 01:00 /dev/ttyCPM4 >> crw------- 1 root root 204, 51 Jan 1 01:00 /dev/ttyCPM5 > > I don't see minors 50-51 allocated in devices.txt for use by this device/driver. > Am I overlooking that allocation somewhere? I looked into history. ttyCPM do not appear in devices.txt in v2.6.9. It was introduced in v2.6.10 as : 46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0 ... 49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 5 Then in v2.6.11 we find: 46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0 ... 47 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 5 50 = /dev/ttyIOC40 Altix serial card ... 81 = /dev/ttyIOC431 Altix serial card So it looks like from the begining the intention was to have 6 ports (from 0 to 5) and it should have been up to 51. For some reason it was messed up. If you look into v2.6.10 drivers/serial/cpm_uart/cpm_uart.h you see there are 6 ports. Even in v2.6.9 that driver exists and has 6 ports. Anyway, the ttyIOC* were removed by commit a017ef17cfd8 ("tty/serial: remove the ioc4_serial driver"), so it should be no problem to fix devices.txt and set ttyCPM from 46 to 51. Christophe > > Thanks for your help. > >> >> # cat /proc/tty/drivers >> /dev/tty /dev/tty 5 0 system:/dev/tty >> /dev/console /dev/console 5 1 system:console >> /dev/ptmx /dev/ptmx 5 2 system >> ttyCPM /dev/ttyCPM 204 46-51 serial >> pty_slave /dev/pts 136 0-1048575 pty:slave >> pty_master /dev/ptm 128 0-1048575 pty:master >> pty_slave /dev/ttyp 3 0-4 pty:slave >> pty_master /dev/pty 2 0-4 pty:master >> >> Christophe >> >> >>> >>> Fixes: d7584ed2b994 ("[POWERPC] qe-uart: add support for Freescale QUICCEngine UART") >>> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") >>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> >>> Cc: Timur Tabi <timur@kernel.org> >>> Cc: Kumar Gala <galak@kernel.crashing.org> >>> Cc: linuxppc-dev@lists.ozlabs.org >>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> >>> Cc: Jiri Slaby <jirislaby@kernel.org> >>> Cc: linux-serial@vger.kernel.org >>> Cc: Jonathan Corbet <corbet@lwn.net> >>> Cc: linux-doc@vger.kernel.org >>> --- >>> Documentation/admin-guide/devices.txt | 2 +- >>> drivers/tty/serial/ucc_uart.c | 2 +- >>> 2 files changed, 2 insertions(+), 2 deletions(-) >>> >>> diff -- a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c >>> --- a/drivers/tty/serial/ucc_uart.c >>> +++ b/drivers/tty/serial/ucc_uart.c >>> @@ -59,7 +59,7 @@ static int firmware_loaded; >>> /* #define LOOPBACK */ >>> >>> /* The major and minor device numbers are defined in >>> - * http://www.lanana.org/docs/device-list/devices-2.6+.txt. For the QE >>> + * Documentation/admin-guide/devices.txt. For the QE >>> * UART, we have major number 204 and minor numbers 46 - 49, which are the >>> * same as for the CPM2. This decision was made because no Freescale part >>> * has both a CPM and a QE. >>> diff -- a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt >>> --- a/Documentation/admin-guide/devices.txt >>> +++ b/Documentation/admin-guide/devices.txt >>> @@ -2691,7 +2691,7 @@ >>> 45 = /dev/ttyMM1 Marvell MPSC - port 1 (obsolete unused) >>> 46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0 >>> ... >>> - 47 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 5 >>> + 49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 3 >>> 50 = /dev/ttyIOC0 Altix serial card >>> ... >>> 81 = /dev/ttyIOC31 Altix serial card >
diff -- a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -59,7 +59,7 @@ static int firmware_loaded; /* #define LOOPBACK */ /* The major and minor device numbers are defined in - * http://www.lanana.org/docs/device-list/devices-2.6+.txt. For the QE + * Documentation/admin-guide/devices.txt. For the QE * UART, we have major number 204 and minor numbers 46 - 49, which are the * same as for the CPM2. This decision was made because no Freescale part * has both a CPM and a QE. diff -- a/Documentation/admin-guide/devices.txt b/Documentation/admin-guide/devices.txt --- a/Documentation/admin-guide/devices.txt +++ b/Documentation/admin-guide/devices.txt @@ -2691,7 +2691,7 @@ 45 = /dev/ttyMM1 Marvell MPSC - port 1 (obsolete unused) 46 = /dev/ttyCPM0 PPC CPM (SCC or SMC) - port 0 ... - 47 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 5 + 49 = /dev/ttyCPM5 PPC CPM (SCC or SMC) - port 3 50 = /dev/ttyIOC0 Altix serial card ... 81 = /dev/ttyIOC31 Altix serial card