mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>
Cc: linux-mips@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] serial: sb1250-duart: Convert to use a platform device
Date: Tue, 3 Nov 2026 13:42:33 -0800	[thread overview]
Message-ID: <e211bf3f-d696-4bc5-baff-e27b933a89ae@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2608060406470.55540@angie.orcam.me.uk>

On 8/6/26 03:54, Maciej W. Rozycki wrote:
> Prevent a crash from happening as the first serial port is initialised:
> 
>    pata-swarm: PATA interface at GenBus slot 4
>    workingset: timestamp_bits=62 max_order=18 bucket_order=0
>    Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
>    CPU 1 Unable to handle kernel paging request at virtual address 0000000000000208, epc == ffffffff8067f8f8, ra == ffffffff80666330
>    Oops[#1]:
>    CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.19.0-dirty #27 NONE
>    $ 0   : 0000000000000000 0000000014001fe0 0000000000000020 ffffffff80666130
>    $ 4   : 0000000000000000 a800000100e6f118 ffffffff8112cbc0 0000000000000000
>    $ 8   : 0000000000000002 0000000000000000 0000000000000000 0000000001a80000
>    $12   : 0000000000000000 ffffffff809fd488 000000004ddf14dd ffffffff00000000
>    $16   : a800000100e6f000 0000000000000000 ffffffff8112c1d0 a800000100e6f000
>    $20   : 0000000000000000 00000000000004d0 0000000000000004 ffffffff8112c1d0
>    $24   : 0000000000000001 0000000000000003
>    $28   : a80000010007c000 a80000010007fcb0 00000000000000ef ffffffff80666330
>    Hi    : fffffffffffffdb9
>    Lo    : 0000000000000035
>    epc   : ffffffff8067f8f8 __dev_fwnode+0x0/0x8
>    ra    : ffffffff80666330 serial_base_ctrl_add+0xb8/0x180
>    Status: 14001fe3	KX SX UX KERNEL EXL IE
>    Cause : 80800008 (ExcCode 02)
>    BadVA : 0000000000000208
>    PrId  : 03040102 (SiByte SB1)
>    Process swapper/0 (pid: 1, threadinfo=(____ptrval____), task=(____ptrval____), tls=0000000000000000)
>    Stack : 0000000000000000 ffffffff80cd5178 ffffffff80cd0000 ffffffff8112c1c8
>            0000000000000260 ffffffff806655c4 a800000100275bc0 ffffffff8064ac88
>            004000408112c000 0000000000000002 0000000000000000 ffffffff801965d0
>            a800000100786ba0 ffffffff80cd5178 a800000100786ba0 0000000000000004
>            a800000100275bc0 0000000000000000 0000000000000000 ffffffff80cd5178
>            0000000000000000 ffffffff8112c1c8 0000000000000260 00000000000004d0
>            0000000000000004 ffffffff80bf0000 00000000000000ef ffffffff80d171dc
>            ffffffff80d17120 ffffffff80d25658 0000000000000000 ffffffff80d50000
>            ffffffff80d2f928 ffffffff80d50000 ffffffff80d25698 ffffffff80cfcecc
>            00ffffff80b84428 0000000000000000 0000000000000006 0000000000000006
>            ...
>    Call Trace:
>    [<ffffffff8067f8f8>] __dev_fwnode+0x0/0x8
>    [<ffffffff80666330>] serial_base_ctrl_add+0xb8/0x180
>    [<ffffffff806655c4>] serial_core_register_port+0x174/0x8e0
>    [<ffffffff80d171dc>] sbd_init+0xbc/0xf4
>    [<ffffffff80cfcecc>] do_one_initcall+0x64/0x150
>    [<ffffffff80cfd284>] kernel_init_freeable+0x25c/0x30c
>    [<ffffffff809ff6e4>] kernel_init+0x24/0x118
>    [<ffffffff80112d20>] ret_from_kernel_thread+0x14/0x1c
>    
>    Code: 67bd0010  03e00008  2402ffea <03e00008> dc820208  67bdffa0  ffbe0050  ffb70048  ffb60040
>    
>    ---[ end trace 0000000000000000 ]---
> 
> -- where a pointer is dereferenced that has been derived from a null
> pointer to the port's parent device.
> 
> Since no device is available with legacy probing and it's not anymore a
> preferable way to discover devices anyway, switch the driver to using a
> platform device and use it as the port's parent device.
> 
> Use platform_driver_probe() because SB1250 DUART devices are embedded
> onchip the SoC and therefore not that straightforward to remove.
> 
> An unfortunate consequence of the switch to a platform device is we now
> hand the console over from the bootconsole much later in the bootstrap.
> The CFE console handler appears good enough though to work so late and
> in particular with interrupts enabled.
> 
> Conversely, only starting the console device so late lets the port
> initialisation code always use fsleep() for transmitter draining, so
> drop the other variant since it is now dead code.
> 
> Since there is one way only remaining to reach sbd_init_port() now, drop
> the port initialisation marker as no longer needed and go through the
> channel resets unconditionally.
> 
> Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
> Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
> Cc: stable@vger.kernel.org # needs to use .remove_new for <= 6.10

On BCM91250E (Sentosa):

Tested-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian


      reply	other threads:[~2026-11-03 21:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 10:54 [PATCH v3 0/3] MIPS: SiByte: Fix serial device regressions Maciej W. Rozycki
2026-08-06 10:54 ` [PATCH v3 1/3] serial: sb1250-duart: Fix console message clobbering at channel resets Maciej W. Rozycki
2026-11-03 22:06   ` Florian Fainelli
2026-08-06 10:54 ` [PATCH v3 2/3] serial: sb1250-duart: Fix bootconsole handover lockup Maciej W. Rozycki
2026-08-10  3:14   ` Philippe Mathieu-Daudé
2026-11-03 22:06   ` Florian Fainelli
2026-08-06 10:54 ` [PATCH v3 3/3] serial: sb1250-duart: Convert to use a platform device Maciej W. Rozycki
2026-11-03 21:42   ` Florian Fainelli [this message]

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=e211bf3f-d696-4bc5-baff-e27b933a89ae@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=tsbogend@alpha.franken.de \
    /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

all inboxes | Powered by JetHome®