Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp525842pjc; Mon, 20 May 2019 11:15:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfrRnBH5s8bD81RMAsl3A21JERYl0WPwKUZLKRBopO3YiHtTelS5B+/SlZ47264Agdr8hI X-Received: by 2002:a17:902:424:: with SMTP id 33mr77451669ple.102.1558376121415; Mon, 20 May 2019 11:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558376121; cv=none; d=google.com; s=arc-20160816; b=kzCX8KF2PbmXnTvz+Bu53/OGjQQOpQD2yJDswjyT3THWSz04fZ763Fj2i04pJXJ/Hm mfo2iBb7cm2UyUgfDREhWbp2vOapx9g63N47rb+7dKJjLDPWqji3ad5vaQSFFn54kltq hXCQbI5fIIIKrEo2vN1WSukamG8fqpy2tgpJ+mxjWwczQIMsphbsWibqVHg5udiWK8FD cAcQBPNeUfsOvZLPHZeUT2gnHwCV9b7LWRQeXdHXQJu6oDRBTFe6z95YCAoYOdc7LHNh 7TGl1aMu6cWHEa6M98INlgbaJzTkar4TeOT8BrBQF71T/caEj22DdQh9dq4gkMwTzz/P 3KDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kWQ/hyaLyaZYd4k9b0E1vEn2XlvquDuxKLnZf2eEVqo=; b=pqetK/08WdiNsMIMSkHWBqHOxw9Sk/tePJu36SfOdoTVYwx4VBt1tGUdr4edHnz2m6 fv/ukmhSFUNfvaYub8saG2VAemiM280cXVDGKtif9pDHZuE8t/QVzztfuv3wLuj/SiNr bT5AtUcwlkJ3yXWPqk47NeMScJhWYiUBXAvEQYoQPfFHiNHEBLnArDKr7G3u3HCc6Bz4 y8yu5n3dq+llLnn5TwgCyfaFmFYe6pNZpa/o6bCofNh3R5KU60tJHBlnRrZBI7J0muMR q0uLEklbSfZcqCVVl3UYUfZt7X62xe6kcXI8BtRDKsIa8TrHpM4ZqRiCBw8XcHiI0haf YGow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WDkH87CO; 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 a128si18282838pgc.242.2019.05.20.11.15.05; Mon, 20 May 2019 11:15:21 -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=WDkH87CO; 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 S2388555AbfETPLk (ORCPT + 99 others); Mon, 20 May 2019 11:11:40 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:40592 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730967AbfETPLk (ORCPT ); Mon, 20 May 2019 11:11:40 -0400 Received: by mail-pg1-f193.google.com with SMTP id d30so6937803pgm.7 for ; Mon, 20 May 2019 08:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kWQ/hyaLyaZYd4k9b0E1vEn2XlvquDuxKLnZf2eEVqo=; b=WDkH87COf0IydRv14/WVFpnoeM4Pn9ASM3B+dHDy58+l8fZqCQnryXd6AHUPacBMdr MgUUtpO6PN73eSDfAS1uW5beMeU7f6bLS22vRFDAWtrbf1fNTOGXki1YU3zS7oQa+pAG c0fzM0ei7/kjhNNY5qzxNyEWRlWpwlgPL63pK6Ea0g2uZWyZsWeAbObW7XGaRfPBwlNr zvDzQX0jNCz2WenEQsaReWUs7Z4JAxVShHSGlqwDlO7XV/xTqkNqHJvLlMfil3eCmHa0 /BsDD9tIVWa6E1gTl3+80W4ftHV3dpMWIjd9CHGMhd+yTGzvGlRYM1/zzaykMqEHPOp6 IriQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kWQ/hyaLyaZYd4k9b0E1vEn2XlvquDuxKLnZf2eEVqo=; b=nUcfr3P7i26U/8ESXGWRCMzALWzfN+2HT19iV5NfvZgqjVWMFktk6337eY1AL6k+36 HbI2B+0ghGvhdGFvu2bzRvTPxQ3D/N9HWXBiugCugft7E3/uqs1WJSHdR8/BoYAYWrdr DTZxPHMdgwCJlZxdVsvcRDrdaJkoB0ZMB04pX+EtlUIpkkMyYKf+LKUbuohcMqL3lzWG XriiNu+m4IacfIdylxJ7yZgr2j3KWsvc7KdJav2cfBnKlewDB4vZag7RxgYbWCH1ZESE S0jb7ieIqAE6tAdUfEhnNR8BfoPkDfZ+eDOx3vo+gGpovnxp8eOhhEoGD6qhpcfYWd6a N+4Q== X-Gm-Message-State: APjAAAUmUWt7WuQOTTbcbA8pTNusIA9e2Fia9eZKZ4MZw5Ejr5T/g3i9 ZRKPmUmxQaEL7dg5886SXYsYlQ== X-Received: by 2002:a63:d652:: with SMTP id d18mr59754107pgj.112.1558365099497; Mon, 20 May 2019 08:11:39 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id r14sm20466206pgm.0.2019.05.20.08.11.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 May 2019 08:11:38 -0700 (PDT) Date: Mon, 20 May 2019 08:12:06 -0700 From: Bjorn Andersson To: Jorge Ramirez Cc: Stephen Boyd , agross@kernel.org, david.brown@linaro.org, gregkh@linuxfoundation.org, 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 Subject: Re: [PATCH] tty: serial: msm_serial: Fix XON/XOFF Message-ID: <20190520151206.GO2085@tuxbook-pro> References: <20190520103435.30850-1-jorge.ramirez-ortiz@linaro.org> <20190520145110.7BDAE21721@mail.kernel.org> <254704a2-ee20-30cd-8362-6e1bd23ec090@linaro.org> <20190520151101.GN2085@tuxbook-pro> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190520151101.GN2085@tuxbook-pro> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 20 May 08:11 PDT 2019, Bjorn Andersson wrote: > On Mon 20 May 07:58 PDT 2019, Jorge Ramirez wrote: > > > 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? > > > > If I read the history correctly this write was a writel() up until > 68252424a7c7 ("tty: serial: msm: Support big-endian CPUs"). > > So I think you should just change this back to a iowrite32_rep() and add > a Fixes tag. > I mean... Reviewed-by: Bjorn Andersson Regards, Bjorn