Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp86712iof; Sun, 5 Jun 2022 21:57:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS8+vlvXsTFt8vKFXfRhgUXZQrt/sgy2a6rTwRkdNV5rlf+g9g3kaHxkmc1Nshh+oOApiV X-Received: by 2002:a63:2152:0:b0:3f5:f7c1:61e with SMTP id s18-20020a632152000000b003f5f7c1061emr20098498pgm.152.1654491455547; Sun, 05 Jun 2022 21:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654491455; cv=none; d=google.com; s=arc-20160816; b=BEpHIiZx0OXa6d4zKHcWGZ0fYnZItFGgdItY/pqw3Ha4srGxb5WyeaEqsoGMyBWJoa R8f/GK3KFulKeJThddPLEa1qecsXCN816mCt3fVby3McFU7CoLKQn4GJTSokjGM5gLPd Qq7Jw9ycI3mf3NcdrVONuqAZoxIpYXCOKIvrapXsUwIgsUfD1qu8arYU5BdtJKmrSVtA MJeIaXq5Li8hp2rrDl/apEVE9Lmx+ks/IVcalzCYQgqCnkN4GHeRgnB0scenZN7kdjx6 qP3hy4yjUi4enKXfmzNq3onbEcNUM6XqcyufR7+ru8WDx3KqA5TUNCWp1CaMeGnuX/cx ai4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=+bJH935PB5pfQJUgE5Lu1i5hWq8Cu1nLmIvkALLizzI=; b=HStMGxgSbCnwBWdHznqZE3rW8L7ZZdSt2LwRKaqFVuxL7aWSyF4Dkdk4+udCb9XrR6 fQNEmfBK13BWUBJfro60IiYAYPooSf+7wQhJ+YOAiSYXZ1OXOCeg4T5w6eMT7uSba5SJ A07L+upetnPGGdfoO7lxS/vovp/hG4DeazgF03GcnOsvba71TDPUWMH0EAoFdN2Imv45 oTbc5yTslsW+S5YPcA6uyLnJuZGnwHsI2SgzWGFWz8NDu64W2DiAVnwRTZhhZDvDgoCi pZy5H/4yE414HFaTus6jB7TsMzDXrUscU4zEpr9VpuXua8kfETA6+F7mzF8Mn7AZ3SLe Lo+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=D6tN55dF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y191-20020a638ac8000000b003c15242c486si19365636pgd.787.2022.06.05.21.57.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:57:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=D6tN55dF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 09522E52AF; Sun, 5 Jun 2022 21:10:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348312AbiFCSyc (ORCPT + 99 others); Fri, 3 Jun 2022 14:54:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348295AbiFCSyb (ORCPT ); Fri, 3 Jun 2022 14:54:31 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A55CE289AD; Fri, 3 Jun 2022 11:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654282470; x=1685818470; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=+bJH935PB5pfQJUgE5Lu1i5hWq8Cu1nLmIvkALLizzI=; b=D6tN55dFGcSREaxNbr547kk6a62H48RVUS6RV/k/tYP3LqOc6/SrLkJO p/wvbdCr+2YS//o8c8ULAaMz1E6kYftbORGgYe5uiIyXGK9mK+bUvCbJA EXDEX9Wo5gD3ecrazM/hV+sYm+upVgN26vy+L86YvE6NvmYOxa8seQedw g=; Received: from ironmsg07-lv.qualcomm.com ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 03 Jun 2022 11:54:30 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg07-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 11:54:30 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 3 Jun 2022 11:54:30 -0700 Received: from [10.216.1.37] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 3 Jun 2022 11:54:26 -0700 Message-ID: Date: Sat, 4 Jun 2022 00:24:23 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [V4] serial: core: Do stop_rx in suspend path for console if console_suspend is disabled Content-Language: en-CA From: Vijaya Krishna Nivarthi To: Marek Szyprowski , , , , CC: , , , References: <1652692810-31148-1-git-send-email-quic_vnivarth@quicinc.com> <3866c083-0064-ac9a-4587-91a83946525d@samsung.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 6/2/2022 9:12 PM, Vijaya Krishna Nivarthi wrote: > Hi, > > > On 6/2/2022 3:55 AM, Marek Szyprowski wrote: >> Hi, >> >> On 01.06.2022 13:24, Vijaya Krishna Nivarthi wrote: >>> On 5/24/2022 5:24 PM, Marek Szyprowski wrote: >>>> On 23.05.2022 23:32, Marek Szyprowski wrote: >>>>> Hi, >>>>> >>>>> On 16.05.2022 11:20, Vijaya Krishna Nivarthi wrote: >>>>>> For the case of console_suspend disabled, if back to back >>>>>> suspend/resume >>>>>> test is executed, at the end of test, sometimes console would >>>>>> appear to >>>>>> be frozen not responding to input. This would happen because, during >>>>>> resume, rx transactions can come in before system is ready, >>>>>> malfunction >>>>>> of rx happens in turn resulting in console appearing to be stuck. >>>>>> >>>>>> Do a stop_rx in suspend sequence to prevent this. >>>>>> >>>>>> Signed-off-by: Vijaya Krishna Nivarthi >>>>>> --- >>>>>> v4: moved the change to serial core to apply for all drivers >>>>>> v3: swapped the order of conditions to be more human readable >>>>>> v2: restricted patch to contain only stop_rx in suspend sequence >>>>>> v1: intial patch contained 2 additional unrelated changes in >>>>>> vicinity >>>>>> --- >>>>> This patch landed recently in linux-next as commit c9d2325cdb92 >>>>> ("serial: core: Do stop_rx in suspend path for console if >>>>> console_suspend is disabled"). >>>>> >>>>> Unfortunately it breaks console operation on my test systems after >>>>> system suspend/resume cycle if 'no_console_suspend' kernel parameter >>>>> is present. System properly resumes from suspend, the console >>>>> displays >>>>> all the messages and even command line prompt, but then doesn't react >>>>> on any input. If I remove the 'no_console_suspend' parameter, the >>>>> console is again operational after system suspend/resume cycle. >>>>> Before >>>>> this patch it worked fine regardless the 'no_console_suspend' >>>>> parameter. >>>>> >>>>> If this matters, the test system is ARM 32bit Samsung >>>>> Exynos5422-based >>>>> Odroid XU3lite board. >>>> One more information. This issue can be easily reproduced with >>>> QEMU. It >>>> happens both on ARM 32bit and ARM 64bit QEMU's 'virt' machines when >>>> 'no_console_suspend' is added to kernel's cmdline. >>>> >>> Ideally, as comments indicate, the set_termios should have done >>> stop_rx at begin and start_rx at end to take care of this issue. >>> >>> This is probably missing in your driver. Can we check if this can be >>> fixed? >> Sure, just point me what need to be added in amba-pl011.c and >> samsung_tty.c. I've briefly compared the suspend/resume paths of those >> drivers with other drivers and I don't see anything missing there. >> >>> OR other option is >>> >>> Add a start_rx in uart_resume_port after call to set_termios to handle >>> this scenario for other drivers. Since start_rx is not exposed it doesn't seem like we will be able to handle it in core. In your drivers, Can we add a call to stop_rx at begin of set_termios and then undo it at end? That would ensure that set_termios functionality is unaffected while fixing the broken cases? If that's not an option we will have to go back to a previous version of limiting the change to qcom driver. Thank you. >>> >>> Please let me know if there are any concerns for this options. >> IMHO this looks like an issue that affects lots of drivers and it should >> be handled in the core. > > Sure, we will look into both aspects and get back as soon as possible. > > Thank you. > >> >>   > ... >> >> Best regards