Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752796AbdFTXte (ORCPT ); Tue, 20 Jun 2017 19:49:34 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:33903 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752515AbdFTXta (ORCPT ); Tue, 20 Jun 2017 19:49:30 -0400 MIME-Version: 1.0 In-Reply-To: References: <20170620153701.12626-1-clemens.gruber@pqgruber.com> From: Fabio Estevam Date: Tue, 20 Jun 2017 20:49:28 -0300 Message-ID: Subject: Re: [PATCH] serial: imx: disable DMA for RS-485 on i.MX6 SMP To: Clemens Gruber Cc: "linux-serial@vger.kernel.org" , Greg Kroah-Hartman , Fabio Estevam , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , linux-kernel , stable , Fugang Duan Content-Type: multipart/mixed; boundary="001a113d496a0554d905526ce7eb" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6277 Lines: 107 --001a113d496a0554d905526ce7eb Content-Type: text/plain; charset="UTF-8" Hi Clemens, On Tue, Jun 20, 2017 at 1:13 PM, Fabio Estevam wrote: > The subject gives the impression that the DMA will only be disabled > for RS485, but the impact of this change is wider. > > For example: if I have a mx6q system with a Bluetooth serial > connection I can no longer use DMA with your change applied. > > Ideally we should fix the RS485 DMA bug. If that is not possible, then > at least we need to restrict this change to the RS485 case. > > Maybe we need to pass "linux,rs485-enabled-at-boot-time" in device > tree and then use this property to deceide if DMA will be enabled or > not: > > if (!uart_console(port) && !sport->dma_is_inited && !sport->rs485_enabled) Could you please test the two attached patches and see if it solves the issue? Unfortunately I no longer have access to the RS485 half-duplex board. Just make sure to pass 'linux,rs485-enabled-at-boot-time' in your device tree, thanks. --001a113d496a0554d905526ce7eb Content-Type: text/x-patch; charset="US-ASCII"; name="0001-serial-imx-Allow-passing-linux-rs485-enabled-at-boot.patch" Content-Disposition: att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KQEAgLTIxMjMsNiArMjEy Myw5IEBAIHN0YXRpYyBpbnQgc2VyaWFsX2lteF9wcm9iZShzdHJ1Y3QgcGxhdGZvcm1fZGV2aWNl ICpwZGV2KQogCXNwb3J0LT5wb3J0LnJzNDg1X2NvbmZpZyA9IGlteF9yczQ4NV9jb25maWc7CiAJ c3BvcnQtPnBvcnQucnM0ODUuZmxhZ3MgPQogCQlTRVJfUlM0ODVfUlRTX09OX1NFTkQgfCBTRVJf UlM0ODVfUlhfRFVSSU5HX1RYOworCWlmIChvZl9nZXRfcHJvcGVydHkobnAsICJsaW51eCxyczQ4 NS1lbmFibGVkLWF0LWJvb3QtdGltZSIsIE5VTEwpKQorCQlzcG9ydC0+cG9ydC5yczQ4NS5mbGFn cyB8PSBTRVJfUlM0ODVfRU5BQkxFRDsKKwogCXNwb3J0LT5wb3J0LmZsYWdzID0gVVBGX0JPT1Rf QVVUT0NPTkY7CiAJaW5pdF90aW1lcigmc3BvcnQtPnRpbWVyKTsKIAlzcG9ydC0+dGltZXIuZnVu Y3Rpb24gPSBpbXhfdGltZW91dDsKLS0gCjIuNy40Cgo= --001a113d496a0554d905526ce7eb Content-Type: text/x-patch; charset="US-ASCII"; name="0002-serial-imx-Disable-DMA-for-RS485.patch" Content-Disposition: attachment; filename="0002-serial-imx-Disable-DMA-for-RS485.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j4680pdn1 RnJvbSBiZjYzYTA3YzU0NmNlZWQzZDJjM2QyMDNkNzVlODcwMDExNDQ0MjNmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBGYWJpbyBFc3RldmFtIDxmYWJpby5lc3RldmFtQG54cC5jb20+ CkRhdGU6IFR1ZSwgMjAgSnVuIDIwMTcgMjA6MzY6MzIgLTAzMDAKU3ViamVjdDogW1BBVENIIDIv Ml0gc2VyaWFsOiBpbXg6IERpc2FibGUgRE1BIGZvciBSUzQ4NQoKQ3VycmVudGx5IERNQSBzdXBw b3J0IGZ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