Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp394972pxb; Thu, 21 Oct 2021 01:30:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB42s2Zcv0LM/SueW1HTeldO41+NNPvp9dvJ+wjSEZhgi0tpG/Ii8GFZ3I/hoyXJ+YXI0p X-Received: by 2002:a62:e90d:0:b0:44d:35a1:e5a0 with SMTP id j13-20020a62e90d000000b0044d35a1e5a0mr4516539pfh.54.1634805009989; Thu, 21 Oct 2021 01:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634805009; cv=none; d=google.com; s=arc-20160816; b=0fmefasnYenTAlKnaJxrgFOshPVSs9c2ZncL7/ijc2OPN946gFimAnuCjlUIlTZYFx CJF5MWkkt6SCrjvg8TTkHYL46s6nuH4+SfNSeb6LLpSX2I/JD32x1LOnZ4dM/D5PL3np CMpCmxXWLBwHuFI5Bv139DYOG5PUIgl43FslWCRSmRTT4a2XP3PS6twCMI+hBJsnkde8 BFJNG09JsciaoTNpVDSnWn3jeaV1LtxXuuzyTpgOQtTpFOBv73bHQvJyOjPnFXWGxKnd W6OYVYqRMqzst0isYpVtKpqatWw7R27v42W/5sa+bXZLiVv6L0twWWsQAqFtqViu3Pbu ugvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Bgxrs8ftYIlU6xoCZreumCmQlQdrvhN/s/QoBVEoxFc=; b=VyobwNOGIKJet/yVes3RcVsx3U/cvdCY/FazAXNrj2DBBs+H+prNGrSPQLKXmuvMBu D2u9lgMPpq5J4G1yHtDMx0SE0PInn/AXg99kTUSXLllzYUYYilBTPLCR0OVL2ncCYEJc xRz6ckhnkj/efomWYoNOQsrnbqxeDNxo8z2xMmUOCI1aTWFTZ7d7wZn4P4lYzjNGJBIP RXYvqE+b1zhJVb6NZg0MoTK5teRI+NLJX53/pR+yefH6XS4i8gDzftqLa/iWmtBY34nu ATMk3Uxx19XJt2a+68yFTFQsmcV5ZAVaSrYwNFY9uXpiaVoiGL70HXC9C0FLaK2eur1J XLaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n8CMxxM+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si6123505pgq.163.2021.10.21.01.29.56; Thu, 21 Oct 2021 01:30:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=n8CMxxM+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231321AbhJUIay (ORCPT + 99 others); Thu, 21 Oct 2021 04:30:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:53768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbhJUIax (ORCPT ); Thu, 21 Oct 2021 04:30:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7D3C961056; Thu, 21 Oct 2021 08:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634804918; bh=qjew/QfPbYGCt0Lvs5YNdF5HsyJTr8BpEPVo9iVlsiM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=n8CMxxM+z2Mrc7OS5nclcrmdVvyTyvZ/dZJcsoz6Iz5KWflLoK7Jm/B6nPNQrfC3J 1UGrpVXMhMJQWfsk9uGvqUQMts5bYHkqwGN2jyAIftJYnktIS1G55+H/SkQ8VG8OII IE33n8vVrViKz/VD8jLPKwjw8ARJLrItk6AVypuE= Date: Thu, 21 Oct 2021 10:28:35 +0200 From: Greg Kroah-Hartman To: Andy Shevchenko Cc: Francesco Dolcini , Jiri Slaby , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andy Shevchenko , Stefan Agner , "open list:SERIAL DRIVERS" , linux-arm Mailing List , Linux Kernel Mailing List , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH v2 1/2] serial: imx: fix detach/attach of serial console Message-ID: References: <20211020192643.476895-1-francesco.dolcini@toradex.com> <20211020192643.476895-2-francesco.dolcini@toradex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021 at 10:54:26PM +0300, Andy Shevchenko wrote: > On Wed, Oct 20, 2021 at 10:27 PM Francesco Dolcini > wrote: > > > > From: Stefan Agner > > > > If the device used as a serial console gets detached/attached at runtime, > > register_console() will try to call imx_uart_setup_console(), but this > > is not possible since it is marked as __init. > > Thank you for fixing this! > > > For instance > > > > # cat /sys/devices/virtual/tty/console/active > > tty1 ttymxc0 > > # echo -n N > /sys/devices/virtual/tty/console/subsystem/ttymxc0/console > > # echo -n Y > /sys/devices/virtual/tty/console/subsystem/ttymxc0/console > > Can we leave only something like below in the commit message? > > > [ 73.167005] Unable to handle kernel paging request at virtual address c154d928 > > [ 73.168304] Internal error: Oops: 8000000d [#1] SMP ARM > > [ 73.168522] CPU: 0 PID: 536 Comm: sh Not tainted 5.15.0-rc6-00056-g3968ddcf05fb #3 > ... > > [ 73.168791] PC is at imx_uart_console_setup+0x0/0x238 > > [ 73.168927] LR is at try_enable_new_console+0x98/0x124 > ... > > [ 73.173826] [] (try_enable_new_console) from [] (register_console+0x10c/0x2ec) > > [ 73.174053] [] (register_console) from [] (console_store+0x14c/0x168) > > [ 73.174262] [] (console_store) from [] (kernfs_fop_write_iter+0x110/0x1cc) > > > A similar issue could be triggered unbinding/binding the serial console > > on unbinding/binding > > > device [*]. > > > > Drop __init so that imx_uart_setup_console() can be safely called at > > runtime. > > > > [*] https://lore.kernel.org/all/20181114174940.7865-3-stefan@agner.ch/ > > Make it Link: tag? > > > Fixes: a3cb39d258ef ("serial: core: Allow detach and attach serial device for console") > > Signed-off-by: Stefan Agner > > Signed-off-by: Francesco Dolcini > > With above nit-picks addressed, FWIW, Those are not a big deal, I'll edit the changelog text... thanks, greg k-h