Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3227164ybx; Sun, 3 Nov 2019 13:53:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwOyXFc2CEl7+kvTV9Q/LIdGpOa8nj7iAD1aRdsrCeBmPQ6kHrvFPyLSt8HzVH+4s2aPbMJ X-Received: by 2002:a05:6402:602:: with SMTP id n2mr5175684edv.23.1572818001367; Sun, 03 Nov 2019 13:53:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572818001; cv=none; d=google.com; s=arc-20160816; b=XvNMS6oE9RgxYxyDEWPcCHRZbmq/Wv4HdUKIdizkS6w4OWI1bl7LTSuJBjh23c19Wm vuCCWUEb+s8cv0nsYu4YSqQ19eM9mSQ7jb7UsyiIjiMu3TfnTo972u8MkM/VI4cGG2Ly HjQQ5uTgKq7jMYrZ4cAWrcu2EGNkZ4e/8i30JHJ3CLpw6HBQkjudceVQ03GJ00F8TfcS KWBPldhGGbQUAhd6+lfuWJLTWn968yDYb22SsHla3jynQPEnJtXhbRqruFP8w7xGCHNe AOgaQv4eUQnIU4xh9C30Za4DszeocTf4R/WmeWHjPXV15Szo6OE5H3sZzmRkJlmDMrmK ocMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lgLWVbnYsmp8GTfjtkJQ6PMmsjA0Nkny+EyycF5N+NM=; b=BG1chkRYEdcjgYL6IkXSXETngzBxmLBCRsWeGLJlC5XFB+VKfmP08BKh27x/+4Eaiy qA5O30eQZrbP5+AJu4DJZIJOKlwT/ui4zEKFiMBRMOifsx3g3K4i5wIUu1n6r+5tpZ3l Nag18S3OF8RW7dicFFjEVYZ+pNJcVRYziV3RHdu+yVWXG4nVhX57lj2jqIcSiVD0OBMG TYWiD1IzUTyDKe2ihaDwyzvC3PBRr6hJhP17G2qDcJwVzj9+uWh75ipGR88RSBiSPtTF /Ns3L9fmqpo56tpksVpUXrkQDsPmjE/umpqzj9kRkW6rreB+W9dQKU2jXlrwmdMjsnB+ AuIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hoy5ufyo; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si5963814edb.57.2019.11.03.13.52.40; Sun, 03 Nov 2019 13:53:21 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=Hoy5ufyo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728324AbfKCVv3 (ORCPT + 99 others); Sun, 3 Nov 2019 16:51:29 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:34955 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727380AbfKCVv3 (ORCPT ); Sun, 3 Nov 2019 16:51:29 -0500 Received: by mail-io1-f67.google.com with SMTP id x21so677527iol.2; Sun, 03 Nov 2019 13:51:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lgLWVbnYsmp8GTfjtkJQ6PMmsjA0Nkny+EyycF5N+NM=; b=Hoy5ufyo3HMrwiKzs049mLa9IUVYs0l4COHDLR2cN8MCEGzesPfcSq/UAzytFwcSpX jdssTa/6NE0Vzyh4B+HRPhkFOcrF52w4Dzd4eqeOVRBcLrE3XkkmUib+6nzjCL22kyiS vDq/DJSzEQSNZsqIVkZM2BxCBVxEEiyL343EZsZLi3UM9Yqm57zfeCq3HN3XZRt0UrqK GasW+HfOgIeEMAUz1lmSOUKWonItNX/wG+ijzsT1Y+rPBeq9dRxSzn4Y/5A4irsXzJiz YhNuURecQGWkBNQnaEMoUw7yR3My+3PMK+VmTj9PV378/3pmv01kiDpaRtXztVKPTMaH bVIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lgLWVbnYsmp8GTfjtkJQ6PMmsjA0Nkny+EyycF5N+NM=; b=b+/cykFbX1WOoK13o4oECnFkOfx1BStlPqr57A2W65Ri8ZpfLqckNcmen2p4bRxDLJ /3ECzKDGEXV/Yo5TA6m/VNM/f3bZRxUmV7bjtDDSJGzC8B8gRVemzOPHTPq2bETuZU1b iDVwNLT3vvDjjbvN0SL1GL3LRSJIQQfKbn3jMZQFryoi253Di5If7q2OC1tZEYsZJgFH 2InSlPfzw6k9uJA5xmHLbubwLQWvtqO4Gw6xShi89g2sN2Z/RB8D6UvZLE43BvxA7kRf +68Sl+UMG+0eS9TThbD4mFIQfpHCCzpCwR3zqqPVT0ydt+KiADDqcdzTCnnVF+jey8Mq m/VQ== X-Gm-Message-State: APjAAAWSgE3LX4LUJu2JJ0qlALiYwB3edx4F04h/WDhQ+CMwEMKbXM44 WuFns1XpQnEwgmiUp92QF1Qu/+c3X6dSSPd9QNY= X-Received: by 2002:a5d:91d2:: with SMTP id k18mr20651366ior.178.1572817888371; Sun, 03 Nov 2019 13:51:28 -0800 (PST) MIME-Version: 1.0 References: <20191021154616.25457-1-jeffrey.l.hugo@gmail.com> <20191027055528.GJ5514@hector.lan> In-Reply-To: <20191027055528.GJ5514@hector.lan> From: Jeffrey Hugo Date: Sun, 3 Nov 2019 14:51:17 -0700 Message-ID: Subject: Re: [PATCH v2] tty: serial: msm_serial: Fix flow control To: Andy Gross , Greg Kroah-Hartman Cc: Bjorn Andersson , jslaby@suse.com, MSM , linux-serial@vger.kernel.org, lkml 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 On Sat, Oct 26, 2019 at 11:55 PM Andy Gross wrote: > > On Mon, Oct 21, 2019 at 08:46:16AM -0700, Jeffrey Hugo wrote: > > hci_qca interfaces to the wcn3990 via a uart_dm on the msm8998 mtp and > > Lenovo Miix 630 laptop. As part of initializing the wcn3990, hci_qca > > disables flow, configures the uart baudrate, and then reenables flow - at > > which point an event is expected to be received over the uart from the > > wcn3990. It is observed that this event comes after the baudrate change > > but before hci_qca re-enables flow. This is unexpected, and is a result of > > msm_reset() being broken. > > > > According to the uart_dm hardware documentation, it is recommended that > > automatic hardware flow control be enabled by setting RX_RDY_CTL. Auto > > hw flow control will manage RFR based on the configured watermark. When > > there is space to receive data, the hw will assert RFR. When the watermark > > is hit, the hw will de-assert RFR. > > > > The hardware documentation indicates that RFR can me manually managed via > > CR when RX_RDY_CTL is not set. SET_RFR asserts RFR, and RESET_RFR > > de-asserts RFR. > > > > msm_reset() is broken because after resetting the hardware, it > > unconditionally asserts RFR via SET_RFR. This enables flow regardless of > > the current configuration, and would undo a previous flow disable > > operation. It should instead de-assert RFR via RESET_RFR to block flow > > until the hardware is reconfigured. msm_serial should rely on the client > > to specify that flow should be enabled, either via mctrl() or the termios > > structure, and only assert RFR in response to those triggers. > > > > Fixes: 04896a77a97b ("msm_serial: serial driver for MSM7K onboard serial peripheral.") > > Signed-off-by: Jeffrey Hugo > > --- > > Reviewed-by: Andy Gross > > Greg, can you pick this one up? > > Thanks, > Andy Greg, will this be queued for 5.5?