Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp524584pjc; Mon, 20 May 2019 11:14:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGL+V+vJkydTyudaMjz+ATVPYuLJRg0K8avkX5FRKonbTlQ2ho5aiOljLZgIVXHpr64BMs X-Received: by 2002:a63:6b41:: with SMTP id g62mr65252916pgc.240.1558376052541; Mon, 20 May 2019 11:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558376052; cv=none; d=google.com; s=arc-20160816; b=MpfGXYLg1e5r1Djspy4RMVU3H6QHspjm19n7b6WL6aYB0awtvNVrLPt3eRDUbVqUQn mf2CyDvmVGhZ94HjdNPOqW8xzEdeQddHtwuwNMoAzJQ6Y6DkKlfDrAe/3O+aixwjEAQG FEQvVlG0YQYBpFegap2NvWhj7M7+zaKIgtXl+r6C8hYBSSwzqrW2r2nYSaQ3guZe2xkh Ajqt+qxUmHmGyu7cpNNm2MQIJJNlPt/3jL460Hj7qo/22+hKHhxVePk3/a0SHhccBPB7 OpKh43ATVJdHbjyv1LGF5tS+/fRpoo1v0nGSY+jvdFHEDX5EmEW+YrP0j1kiM33psLo9 iKKQ== 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:references:cc:to:from:subject:dkim-signature; bh=NfF+wJElm7sO7fUhXmCqvcXujZsDjYgHnoG9GckrRbY=; b=EBoeBqF/N2eRObWOoUkedZ01qF+7k/PFYkDleahiSOlMLeuWv+Vkw1XDeIQ3V3IbKl yRorzFJ9kjXNhoPUmuorcV3nDI0Bx/+WHH1lmqoMtcvqRUzYdebCZaYR7w/ShkK7Okdv BmNr1bbAXlO3tpXO871KMntMrYBFHVAaKMC2Tx1m8AiXurVYD0ZIW259jcko+a03MQY0 afGNp8i3a0WEvFkOiohNItXFhTWxtY2rFIEogDSMdQ+P1xOr00pYSPogMd+3uzNUOvL2 +yV2f7TdkP9e+GC+skBeVOAWmwwXlDMpebQ8s1ht/69rjLtuRuelMjZxTYE/3oaQUOl/ V9DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UI720Zx/"; 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 m19si18202675pgl.241.2019.05.20.11.13.57; Mon, 20 May 2019 11:14:12 -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="UI720Zx/"; 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 S2387516AbfETO67 (ORCPT + 99 others); Mon, 20 May 2019 10:58:59 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51643 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730351AbfETO66 (ORCPT ); Mon, 20 May 2019 10:58:58 -0400 Received: by mail-wm1-f68.google.com with SMTP id c77so12175265wmd.1 for ; Mon, 20 May 2019 07:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NfF+wJElm7sO7fUhXmCqvcXujZsDjYgHnoG9GckrRbY=; b=UI720Zx/M7niBgl8FlQoFswrGZyl1BV8L6/UeDPhzkzuyQYMk0zgQDA5up9AifRezV ywfOAdN8uFrQdjSz5v7RXjHfg/qMjEbF7U/XwdOg57hsSHeET8zY39ra47k00+H4ZpS5 /Cyotkhhy3HAz/8bdbQk84s9XqN6O6zDnXslwX5z1i2+iw/IGDHWqqhUXmom7/TCXbyq hecUd753WqN7tImkYAnej1Fs6eBWwWLZgB/beZSS1C71Vq+TMJFe5GRGjTJQjA+m9j9h JEwuMlaPFbKwW1GBTYoJDLbhJlpC4n5SXtqAGKnQ3eBTw+K1IbwVdhnYkYLaB9E6m+Mm WRgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NfF+wJElm7sO7fUhXmCqvcXujZsDjYgHnoG9GckrRbY=; b=mWyOMB0hOyrlPIpuNoR4Aj6PD0iPolYBshNNnUgbiTnodyB6Lwlf1jcxzq6qYcZb1A vhEhwYHo14bQNEZqrcyRqPugBTu9IF+9tLBUlie1YVTTiUzvazNh3O2OcsQmtFVx9dal GDWOT7/zGzztoMocS3lM8pEWTqfyD568hub8OFLw4IlYNSyvxCwSLRaYSjVxt8aJ2cJh kHdeGtXRlPhjx7v3ZspkzxNtE7vxzjGPdHjWTiooaWey8Pugbl6vzOdDxwiHP3OfPFRG 4yOp9Dnr8cNHlwJRH/lpo7Y1G8KWRZE5pCpLJDK8ufXgAbN1UM/a3r496TmYY7zjXBdT JM2Q== X-Gm-Message-State: APjAAAWzC17heqRBRg12F4Sl0VsuUTtTpXDGrHORLOblC/tY3Xxh3n7v 5A7GcNvBPGidQDJjduGuCpdjcg== X-Received: by 2002:a1c:1f47:: with SMTP id f68mr31986725wmf.57.1558364336406; Mon, 20 May 2019 07:58:56 -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 f81sm16179742wmf.10.2019.05.20.07.58.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 07:58:55 -0700 (PDT) Subject: Re: [PATCH] tty: serial: msm_serial: Fix XON/XOFF From: Jorge Ramirez 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> <254704a2-ee20-30cd-8362-6e1bd23ec090@linaro.org> Message-ID: Date: Mon, 20 May 2019 16:58:54 +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: <254704a2-ee20-30cd-8362-6e1bd23ec090@linaro.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:56, Jorge Ramirez wrote: > 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 um after I said this, maybe iowrite32_rep should only be applied to uartdm ... what do you think? > >