Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4335776pxv; Tue, 29 Jun 2021 04:49:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjbnnpZLpfvLtOu2BIte3dvd2yiKkeartAMA10VURPQzOhb6PS5eNFh/fSNtwpfhamJr3O X-Received: by 2002:a92:de05:: with SMTP id x5mr21633959ilm.161.1624967344177; Tue, 29 Jun 2021 04:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624967344; cv=none; d=google.com; s=arc-20160816; b=iXKemOMCN3ZW/CMHxPAKu5AbqCAxXxVab+5xeDHhnLKdmZG2ZzMP1Y0KEOcfF1JVNu 8o1TpsbITYMP/s7jheoHnnv2pl/ZnAx17G4YJutQtP8ltjBRcTke82vvqixqv5+3OQHe 9wNxAq0kXGj+QikNZnFOHCzwzL0GEZNFcV44aaT0ZD3odiWq2rAX/nRv3u4jWX9hVoF1 bJF9TY6aelfTj2HZQQUrO1aIHLgK6u74Gh8d4zTEKkuDM1sSvnVSkZbI+yO+2y+I6eNj YPn1ulFBfjHDiDdiKjq40aKGJCo5K8+mrnUULAIU/gRyYZNw1/ZEqpi5C3xRYSF8X9ka rdqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=P6S93IgLQX/j9P4a+cNZB4S+kLehvqpx4P2yVdaV6XE=; b=iDlFvxOM94BhVId4eiwhQ+NEkeaZJOo7uDWGJ4TQCGDvAiS5+msS9dW4k/kbUT5wcl cg0mzA5pRdoHEc5TWDo+xAsxa8PpJqc64CF0MdvbZ/XA0P01eoBBontyDAl0tnRT05tY TJx4lEHkW919qgrA5InwDuC3x4eEToQBUQ/2ZblOOIcZUM3jbpv2KITGnDbYZAh49BG5 Z6igQR73/z2WekU0c0And22OOPHTGAaQzw7Hzk4b2iccRNIY1lFfZlKp8VwqWvZw6Y2P gX6sMAALdGyEtYpqw1ZyRzGvHwy6RLdxP+At2zOoBF3kx1u8RqElRsedRWJRjPMeiayA fN9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si21514465ilj.6.2021.06.29.04.48.51; Tue, 29 Jun 2021 04:49:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232966AbhF2JrV (ORCPT + 99 others); Tue, 29 Jun 2021 05:47:21 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:33160 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232871AbhF2JrU (ORCPT ); Tue, 29 Jun 2021 05:47:20 -0400 Received: from mail-ed1-f69.google.com ([209.85.208.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lyAIW-0005fv-7t for linux-kernel@vger.kernel.org; Tue, 29 Jun 2021 09:44:52 +0000 Received: by mail-ed1-f69.google.com with SMTP id y18-20020a0564022712b029038ffac1995eso11322977edd.12 for ; Tue, 29 Jun 2021 02:44:52 -0700 (PDT) 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=P6S93IgLQX/j9P4a+cNZB4S+kLehvqpx4P2yVdaV6XE=; b=D4tuxU6U9HaNOxIdoGKNMJ2EDq8xuYzEmjJukDaxfXGx8gQiyfkf3esyYM2VJL1O1Q Ze6pCE7xMSrVCbg8kqtg7N0cV4dm70zfbEJcidBuYujTETSXR5dlKX1bAC1i5gXCYSKQ LT2Vnwnrun7cuMBKRglBD7DCc9OGtFSZqe9ja3b5CVeS0gIbADfmJxPgYvYOVoT+zsDU EzPk+tcVljA08si/E/SAjtIDYfic2cH9pvjtHw0sPn+e6VbFbbCRD41dAzQkxMFNmNMI eTDeY2gWwDAcHcCM0+kU84Rx7V6tERWQJRf8bvRzyOcrR6XB5RecPNDFKOtErHj9+AZQ vE9w== X-Gm-Message-State: AOAM53175IuyhiIv98EQ7PyfGjx+vtDboncYdNUsCa0TkPwgVSIQxNsJ 03cOgJMsBEcwlTjyQ2zIM9hXFmeFYxySjB29lMjBhY4SsD1q3J0vv66wzZZdXrykTgol+GoJHqW F1eYmoPZtAeX4mZUAxUuuMY5zjb0cWUcBFD/O/cNe6Q== X-Received: by 2002:a05:6402:2813:: with SMTP id h19mr38800580ede.39.1624959892026; Tue, 29 Jun 2021 02:44:52 -0700 (PDT) X-Received: by 2002:a05:6402:2813:: with SMTP id h19mr38800560ede.39.1624959891916; Tue, 29 Jun 2021 02:44:51 -0700 (PDT) Received: from [192.168.1.115] (xdsl-188-155-177-222.adslplus.ch. [188.155.177.222]) by smtp.gmail.com with ESMTPSA id z28sm7763057ejl.69.2021.06.29.02.44.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Jun 2021 02:44:51 -0700 (PDT) Subject: Re: [PATCH v5] serial: samsung: use dma_ops of DMA if attached To: Tamseel Shams , gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, alim.akhtar@samsung.com, ajaykumar.rs@samsung.com, robin.murphy@arm.com References: <20210629045902.48912-1-m.shams@samsung.com> From: Krzysztof Kozlowski Message-ID: <8569ce54-26ef-e36a-b3a9-2d31e2575bd2@canonical.com> Date: Tue, 29 Jun 2021 11:44:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210629045902.48912-1-m.shams@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/06/2021 06:59, Tamseel Shams wrote: > When DMA is used for TX and RX by serial driver, it should > pass the DMA device pointer to DMA API instead of UART device > pointer. DMA device should be used for DMA API because only > the DMA device is aware of how the device connects to the memory. > There might be an extra level of address translation due to a > SMMU attached to the DMA device. When serial device is used for > DMA API, the DMA API will have no clue of the SMMU attached to > the DMA device. > > This patch is necessary to fix the SMMU page faults > which is observed when a DMA(with SMMU enabled) is attached > to UART for transfer. > > Signed-off-by: Tamseel Shams > Signed-off-by: Ajay Kumar > --- > Changes since v1: > 1. Rebased the patch on "tty-next" branch of TTY driver tree > > Changes since v2: > 1. Updated the commit message. > 2. Changed the comment description > > Changes since v3: > 1. Removed the null pointer check for "dma", "dma->tx_chan" and > "dma->rx_chan" and instead sending DMA device pointer while calling > DMA API. > > Changes since v4: > 1. Fixed the alignments of arguments. > > drivers/tty/serial/samsung_tty.c | 46 +++++++++++++++++--------------- > 1 file changed, 25 insertions(+), 21 deletions(-) > Acked-by: Krzysztof Kozlowski Best regards, Krzysztof