Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp524401pjc; Mon, 20 May 2019 11:14:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqybK5RMpQp6h8MVpURs3kd73l/uogb8c309+AunlnC3VudKrMYsLbis2HtCqtJA7TNdlRu7 X-Received: by 2002:aa7:8ec6:: with SMTP id b6mr81840574pfr.234.1558376043826; Mon, 20 May 2019 11:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558376043; cv=none; d=google.com; s=arc-20160816; b=oKMteeVL54tqfqnG5MM05mawujv5UI4gri9TeUef69MKtKtpI5V+3Ws+E2i4e+h6xb dSwK/t5b/QSFus1QU7921CdQsRoL/4OJvjXumGVXX7SN22+gkTyytohB1+sRY3uG9GfJ VkRjd1gaJ66LMfQu/CpjxMLBJq0VU7lqhsYXp9UiQ0SFp36yOPJF4ktQuTEW72epCNJg Y/7AWExv9FSuUv9FWc/fYs5VEjCuJIASU2qub8F4QZkMQ5yjzWUo/uUy2cvw5rPEDfvK GvM7ubP4knOFFR+pchDQCUIQnQPObfK36s2eQOMdoqWYAtrwSaAJdbj1Ga8+z1oMpABv LABw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=g4F9hU8J3C+nvQrYfBSkrDIKfockwKfku650J+JBeIg=; b=YwhnuT+EcNw3U+sjCkqOM/DHS4yjovpcMW/gS60oSCtr7MY6HKLMrzdW0vekfp6riO aRk7HZz06TvyGTnPQWreP2S19P/MceFJxfoESl1m1/R/2E3WyFPPoVwqVuoZARV6JJv8 570osKOQIEIK5lfCz88AdqR+2AP5BvrOGj8EYTGaruUeMGp5RWDhp6mftjfoyGVZjrDS WAev5ikTdgMrWhOk0KSyu5KX4Is9eCVl3K7alVDS5AuV1X0C5kU2kCfiTtyuErKjT991 ehvuyzGACYEOngjPvpuWTW72vzC1nRYtCTf3brcFN5DSenGbqDdC8PBSIzl5xe7B8qrF TmhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qeBSn7dw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si11716993pgg.458.2019.05.20.11.13.49; Mon, 20 May 2019 11:14:03 -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; dkim=pass header.i=@linaro.org header.s=google header.b=qeBSn7dw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732906AbfETO5E (ORCPT + 99 others); Mon, 20 May 2019 10:57:04 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36462 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730485AbfETO5D (ORCPT ); Mon, 20 May 2019 10:57:03 -0400 Received: by mail-wr1-f68.google.com with SMTP id s17so15006259wru.3 for ; Mon, 20 May 2019 07:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=g4F9hU8J3C+nvQrYfBSkrDIKfockwKfku650J+JBeIg=; b=qeBSn7dwzGMdxB68NipEKXOsl8lKlXpo47d1lLKffFwnlr94dsSP77y+IWuurSKD+Q EgYH+XE/TQWuZbIwhfuP9BaZFLeCkMBYetrUR5oygTseBT7rCOzUC1stMRSsUND2eNtX 5dletx1MR5DzHEF0uR06puDFh9Cb273Eg3cc4CwMZHDUWb9fG8ji1zMz7riBpODPRWRs qSSqxxVAYX7dmjl4gIZ4Vl2YtFdx7+VPyXKYPy/cwkoOX3VUooee4o1dttwtRn7TWKxc DTciSEYXlgkfvLf6OI8QTqmiyCIQJs6C6q+Y2hUl9B+ShP9PenPCwTegCjH0sxrwQ0Xl XQCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=g4F9hU8J3C+nvQrYfBSkrDIKfockwKfku650J+JBeIg=; b=fGLpvKFqB7MPWlInXLIwETFcO3QlaMSsMV4/uJZWSA6FCpdvg4nvFFMry3S9VfZUV/ uSAIyBXbYYm2gaIancllBTp9ADFL9AqCQIIWEcZzN/Z/zjtTSrv9qru2RbHCdPFBwbRQ tTyFlH7GXEvNmk0K3Uu2jbdBhMvmTKnnVy/tIq7tBslrqURoc7oB88Gl6AJMNyHCBd41 /b3PezacqcW4prMALSl8nonEN+4RWQAmS/rlxhNEqF2yysJlGkmU79nJbZHVPBbCisJP f7G0Y7AYlGVLEUqetRvnMF+AY5l4ces30iEY9Bn+Cot8jQDsGPjzDNviWIRZQUi2R22f g7Pw== X-Gm-Message-State: APjAAAWAQ1yzkIOJSowNHPDMgKSEPGqHOmWRFJJMlFc4W7G+uyERDjKZ uo74MFwSv22WjUA30/EwGowBMw== X-Received: by 2002:adf:8189:: with SMTP id 9mr43959318wra.71.1558364221961; Mon, 20 May 2019 07:57:01 -0700 (PDT) Received: from [192.168.1.7] (139.red-79-146-81.dynamicip.rima-tde.net. [79.146.81.139]) by smtp.gmail.com with ESMTPSA id t13sm37837110wra.81.2019.05.20.07.57.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 07:57:00 -0700 (PDT) Subject: Re: [PATCH] tty: serial: msm_serial: Fix XON/XOFF To: Stephen Boyd , agross@kernel.org, david.brown@linaro.org, gregkh@linuxfoundation.org Cc: jslaby@suse.com, keescook@chromium.org, anton@enomsg.org, ccross@android.com, tony.luck@intel.com, linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, khasim.mohammed@linaro.org, agsumit@qti.qualcomm.com References: <20190520103435.30850-1-jorge.ramirez-ortiz@linaro.org> <20190520145110.7BDAE21721@mail.kernel.org> From: Jorge Ramirez Message-ID: <254704a2-ee20-30cd-8362-6e1bd23ec090@linaro.org> Date: Mon, 20 May 2019 16:56:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190520145110.7BDAE21721@mail.kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/20/19 16:51, Stephen Boyd wrote: > Quoting Jorge Ramirez-Ortiz (2019-05-20 03:34:35) >> When the tty layer requests the uart to throttle, the current code >> executing in msm_serial will trigger "Bad mode in Error Handler" and >> generate an invalid stack frame in pstore before rebooting (that is if >> pstore is indeed configured: otherwise the user shall just notice a >> reboot with no further information dumped to the console). >> >> This patch replaces the PIO byte accessor with the word accessor >> already used in PIO mode. > > Because the hardware only accepts word based accessors and fails > otherwise? I can believe that. > > I wonder if the earlier UART hardware this driver used to support (i.e. > pre-DM) would accept byte access to the registers. It's possible, but we > don't really care because those boards aren't supported. ok. also the PIO path uses iowrite32_rep to write a number of bytes (from 1 to 4) so I think it is also appropriate to use it for XON/XOFF. > >> >> Signed-off-by: Jorge Ramirez-Ortiz >> --- > > Reviewed-by: Stephen Boyd > >> drivers/tty/serial/msm_serial.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c >> index 109096033bb1..23833ad952ba 100644 >> --- a/drivers/tty/serial/msm_serial.c >> +++ b/drivers/tty/serial/msm_serial.c >> @@ -869,10 +870,12 @@ static void msm_handle_tx(struct uart_port *port) >> else >> tf = port->membase + UART_TF; >> >> + buf[0] = port->x_char; >> + >> if (msm_port->is_uartdm) >> msm_reset_dm_count(port, 1); >> >> - iowrite8_rep(tf, &port->x_char, 1); >> + iowrite32_rep(tf, buf, 1); > > I suppose it's OK to write some extra zeroes here? > > yeah, semantically confusing msm_reset_dm_count is what really matters: it tells the hardware to only take n bytes (in this case only one) so the others will be ignored