Received: by 10.213.65.68 with SMTP id h4csp467012imn; Fri, 16 Mar 2018 08:37:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELv2s7kbaUkFOsKJpEQ2DTv8t64Kd+9g80QFkkhbEBscQrM5AkWVeVDircidG2xV7Alc0oAY X-Received: by 10.101.74.208 with SMTP id c16mr1821630pgu.116.1521214652796; Fri, 16 Mar 2018 08:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521214652; cv=none; d=google.com; s=arc-20160816; b=pqS6Num9XpEfQG/jErp4SVJmxV9Dg1YJ7mdZl38gpQgjIfefGLjxCcbTXh+ohVqI42 0VU8RfAfVG6u/mVloBOlXRn6B22t6jVFBMBTZxIni4Ud8IF+7U8AsS/E4tbilaWLagZc ErKficr76Jgnif5Lhn0VKYFrUnPZahK6wik7ecjx7NYK1K3SFbRXxsYQtGE+HCqru3Bn L4upA9adJLDL7zCqa2oGGguSviOrYIWMG4PF3C+SN48iwpftaJRZwAQ0njvcBCJfKlY+ Rd7RRH9ck7QeugeaAyVzCNZ0d1jpMV/AMfgXupLHTwJGBvb/3mDOgQgUUaw0xeEeWskS Vj6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BW1QWuxyoNp1r+2083o9xAJkJF5gplbIOm49SLoxv7Q=; b=PK1ftB4ei6mZ3r2dggfQIYpPK9d3+RupPOGDtRB9GSGnTxoheZccTito7BZcOBdJm8 FbJ/CnPgs+4LeTdwPXkZ3nCWjn3InqqQUHZKY+tx0AVId745XYtmA/2PYaa34dkjincb vVKMzfaVaMMaPj7+Ml+6Z6EguWrzVWzhEAjiPOybicFzV5JvqbMMWzoqDeWkpB7nSeRb JH5/gRvAzhPbYsdzPqj0qu3niOGnaXCSbASYU3TdpeE7AAzJuxSAxhx0I7jV0AX4UGsD Bi7gfs6X1lpJJkzpUs9rgkcK72nCsenEEQriCXYRZMoSqLCmoZKVhOexbK0CgqdXtF4y IkrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x75si5702594pff.339.2018.03.16.08.37.18; Fri, 16 Mar 2018 08:37:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934029AbeCPPes (ORCPT + 99 others); Fri, 16 Mar 2018 11:34:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39562 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933420AbeCPPep (ORCPT ); Fri, 16 Mar 2018 11:34:45 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 185AAF2F; Fri, 16 Mar 2018 15:34:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nikola Ciprich , Sebastian Andrzej Siewior , Johan Hovold Subject: [PATCH 4.14 023/109] serial: core: mark port as initialized in autoconfig Date: Fri, 16 Mar 2018 16:22:52 +0100 Message-Id: <20180316152331.220071545@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sebastian Andrzej Siewior commit 714569064adee3c114a2a6490735b94abe269068 upstream. This is a followup on 44117a1d1732 ("serial: core: mark port as initialized after successful IRQ change"). Nikola has been using autoconfig via setserial and reported a crash similar to what I fixed in the earlier mentioned commit. Here I do the same fixup for the autoconfig. I wasn't sure that this is the right approach. Nikola confirmed that it fixes his crash. Fixes: b3b576461864 ("tty: serial_core: convert uart_open to use tty_port_open") Link: http://lkml.kernel.org/r/20180131072000.GD1853@localhost.localdomain Reported-by: Nikola Ciprich Tested-by: Nikola Ciprich Cc: Signed-off-by: Sebastian Andrzej Siewior Tested-by: Nikola Ciprich Acked-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/serial_core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1157,6 +1157,8 @@ static int uart_do_autoconfig(struct tty uport->ops->config_port(uport, flags); ret = uart_startup(tty, state, 1); + if (ret == 0) + tty_port_set_initialized(port, true); if (ret > 0) ret = 0; }