Received: by 10.213.65.68 with SMTP id h4csp509976imn; Fri, 16 Mar 2018 09:57:11 -0700 (PDT) X-Google-Smtp-Source: AG47ELutd+U2Aqf4JbMP3yEiXiAMb0B4k1CKodCAuHVhI1qsAgkOLv9LutCrjZB7QzUTyQf+7XGC X-Received: by 10.99.95.5 with SMTP id t5mr1968604pgb.295.1521219431415; Fri, 16 Mar 2018 09:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521219431; cv=none; d=google.com; s=arc-20160816; b=x4i7nurOw7OCBEjtjCLe6x6ol9OT0JW/e3t8nr6rIc7C8h/H1++RFBn6Sxo2koTbAa L1CesLfFfTKWd5+1dUhnr1RmvYxKrl5CGQhxoVXoR1O9sBDfb1wtwp+WAzmZ5xS8YYKN 7T4C1YQSmhN41tK9lFHblZriSPrJJ9Se7ffBC6l/f1zK8E3uV1LMgsWNN3dslD4Gd3OZ GxRqHruiVrY6ElUM7Nb+gYmZjjVXwR+xH2cjuVdiB4IN4b/UrJtg5Nq6QH3YdMb0hwgT VFBZuf02cgtgSUa9ss43ncl2AQIotWpgdr/w2vmLE/34X8MV+3eQ0OCQ5CiReQqmYhlN fBmg== 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=pWxfpzG92kekcMdQ3WTpout11w7zKxG8vRswLHot94k=; b=V3bdEdTSCHvPTdaG7ODIvt7tImvLp6uiIzY+YXBONqafEFczvPkFvGJ4s4DugfRJDt WGh7ylkOUh/Ez6vOY3JuQSdZIjcsTTfArbTJG18ntJftaXVBWoaei+FdZpnn6mxYHIeS wp0M4jvSF0ZeXszkW/ZxUjtGCyqNW8ZTbXMW1r+I/SpSNl9pBqIN2PuQtAgCCt+9NcXh ov3/a4mvNO6yCp5AjJUbspYjoieXRpos9VxnAhU6SnUO688EGKIgG8km0prGQ76I4s3+ Y5araVF0eSWx2RSzi3V/BgkAMAn9GTMOsz4oDdRGNyxSQK07QDDkYJQBnQ8IYt4POxLm R3/A== 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 c7-v6si1613091plr.398.2018.03.16.09.56.57; Fri, 16 Mar 2018 09:57:11 -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 S933843AbeCPPdy (ORCPT + 99 others); Fri, 16 Mar 2018 11:33:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39182 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933832AbeCPPdv (ORCPT ); Fri, 16 Mar 2018 11:33:51 -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 1C6B6DB8; Fri, 16 Mar 2018 15:33:50 +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.9 84/86] serial: core: mark port as initialized in autoconfig Date: Fri, 16 Mar 2018 16:23:47 +0100 Message-Id: <20180316152322.993784908@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152317.167709497@linuxfoundation.org> References: <20180316152317.167709497@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.9-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 @@ -1135,6 +1135,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; }