Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1845722pxb; Wed, 20 Oct 2021 12:58:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL0K+hbjUbgtoFlaD3t+UaLvBRhYZ86AbtlykDc8AdzQ1dpyRy11HTSrVXk+EYW5Gx1IM2 X-Received: by 2002:a17:906:71d4:: with SMTP id i20mr1694023ejk.390.1634759890873; Wed, 20 Oct 2021 12:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634759890; cv=none; d=google.com; s=arc-20160816; b=l2UyEH51s+wzeAdWvPfC0GFrVzWjCobQkJDhjlF2arJ3qm8//K4/5IOFCIqDdEPPLC OpoovepYQcg/zwU2XPvRA03SkmXv5pA1o/XugXBGIVTFgmCjvNCj1K3iDuyx2EuKpRyB jPiQ/ZQm9llHUhyMAR5TTiq+dtomL2R33MnEBGftlRjTtEFj+2ypZwktBZwxfqtSokiH j5dM6hX0l5n8XNp6v+DzToZ+dnlYcYWVYoFrtAlR1acfIoPTrSX961LYBjlFiW04e8lu jl/qbcwUO1TxkY27lunZxej/Nx39/8pdYYcpJumwl6EO0bTS36vbp2E2Z2s5ktAE+HTd E+fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=o23NUFi4NSuDgxiiKqNfA+UEGKmDoRefv9wYtUa1fcg=; b=BFkaT588tuXK7tHK65Jz3Dtf3tQe7QKNhshdRHbNfyBZg4le7TN57DZr5GGSnw7OQf 63+ekW9BPx0Kuur7Moy/8GKp6uaJvVZ5XLq1U8ZtXQoRGl5kuLWuD+sm5GpQa34vccw4 v9T0ST0nqpWQIPa5K65S9ECPb/e1rGw2qZdTPs3zbXTPGUloyKCZDPdqRU/Has5E8h2b vTfZx4WE7lHd50wYJSW6Cc2wTwsAhr36WI2A2wvEv4a8To70mZUz3pookN57j2LLQI7C 2Z70kZK8wh8fpzkIrwZ1jQaeC5FNrEmfKf9QyXBeEslMYYrQpNCQqPWm5FrrEaQG10m3 Sj3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q0tHDpE6; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co5si3812635edb.321.2021.10.20.12.57.45; Wed, 20 Oct 2021 12:58:10 -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=@gmail.com header.s=20210112 header.b=Q0tHDpE6; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231687AbhJTT5U (ORCPT + 99 others); Wed, 20 Oct 2021 15:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231629AbhJTT5T (ORCPT ); Wed, 20 Oct 2021 15:57:19 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57BE3C06161C; Wed, 20 Oct 2021 12:55:04 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id z11so731116lfj.4; Wed, 20 Oct 2021 12:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o23NUFi4NSuDgxiiKqNfA+UEGKmDoRefv9wYtUa1fcg=; b=Q0tHDpE6NbCFqUdl2WmP/pzrTHuEbdZ37pv07jncZVe8s168enf4PIu5YsEmXpWS17 nORnfa5X+sqfcTI9PT11mZLjYKcBpBHtnsE9kaFaZ3Gb188VVnH8VA0VYx8TIuCwcX0x 2BLVPo2gLP2iOO3i6Usye2xTSHrMBw0IaBBahqN/3joixanbhuisuxE0vKqg6NE/PnMe qhgeV0rv2snVwW5UCdli+4+5Ar33vYUYmu5BLl5a6iduour+0q2Dih5l7Jyz5gUOxBb4 IUIMcNF84/kmhwXnhG8agF01VPAM/1kHtv13vWAV9llMn1S44SclF2ytNOhIl8dNicb+ UxHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o23NUFi4NSuDgxiiKqNfA+UEGKmDoRefv9wYtUa1fcg=; b=cVIRibhwkWvB+Qv7ZmKnLlgq25UGs6d/lJPzL2+Mj80W0Olyka1WNnqRJ+iLCJW+Js QU2YDALDTgmWy92GgeTmW8Ic4QQLZZPGUYJxWF7+bx5hQ9EQvogLLWsKjKFKnLDpubFC K0HdmWpEVEuo8D+EzvR+0BVxpK9aLKY83VEg8d+9UbUsfe29D5nwR81ioeaihxeOTmuA jXkPOZKv3BPkaXTDlV09hJFDLC517ltTocrZbpjcvpgNS0I0fCq8TMWp8ctEFr92AE8C yEq8UI3/XGQ9Ca5qTL/mef7jUWc97eGaiyr7zjUg8LTX3r/njTa0a9xCXPR29pAqhrOh 2SBg== X-Gm-Message-State: AOAM532pfHLLOUbwjvgEXPvvwdnQ9I5B0QzXT+vJVlvOafqRj/AzSzZC NwrywIxBFle9ZeRnQJGE24NUBaI/oVlISRI2/butMAB20PI= X-Received: by 2002:ac2:5e79:: with SMTP id a25mr1197326lfr.677.1634759702571; Wed, 20 Oct 2021 12:55:02 -0700 (PDT) MIME-Version: 1.0 References: <20211020192643.476895-1-francesco.dolcini@toradex.com> <20211020192643.476895-2-francesco.dolcini@toradex.com> In-Reply-To: <20211020192643.476895-2-francesco.dolcini@toradex.com> From: Andy Shevchenko Date: Wed, 20 Oct 2021 22:54:26 +0300 Message-ID: Subject: Re: [PATCH v2 1/2] serial: imx: fix detach/attach of serial console To: Francesco Dolcini Cc: Greg Kroah-Hartman , 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 , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko