From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 206C1C11F69 for ; Tue, 29 Jun 2021 09:44:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 043BA61DC4 for ; Tue, 29 Jun 2021 09:44:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232970AbhF2JrW (ORCPT ); Tue, 29 Jun 2021 05:47:22 -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-Google-Smtp-Source: ABdhPJy06olXLZfAm05U4GcZNHdgwCRhnlpCZ8sU2e7+C3VS7EOVINUFGdMcuDwYXMbgFp8XUZyLKw== 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 371DAC11F66 for ; Tue, 29 Jun 2021 09:47:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0435A61DAD for ; Tue, 29 Jun 2021 09:47:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0435A61DAD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=canonical.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=R/EFyhzEU4JSCnpqGlY1A5qY4LW9mmcAW1JTLSm5V04=; b=DIfJUPS6pCTr9XjyYtpPQ01tAM dFHcr6xsv9cv3Zu81MocDDQ32RdsyUSHAXFKLs05rpi4+Bv0GgyxUTjkF3EjsAu0fI0Lso1cn7+jE IP4u2ATNkEUKusEgPAiFfwQ8snyXoiNuG6krOxvqNH04WTOwdMaKNkOKrUl2FJZM/fxEL/UKhRwvr veAF4AzTPObUUYHBYFwblTk5x7VGXPQejqZtO6ydn3vltTfvoqxlQLGwcjH3l8ba+RMwNipx7UsV9 iMs+5KXXS7PXtQmc0JhOTIALFowF6lbsPAHinb3LE2mxZVSzpzWKGw+CJSFzT+VsxKx7eJhQyoFZf 4qABnUqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyAIp-00AQl6-Qg; Tue, 29 Jun 2021 09:45:12 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyAIZ-00AQfd-W5 for linux-arm-kernel@lists.infradead.org; Tue, 29 Jun 2021 09:44:57 +0000 Received: from mail-ed1-f70.google.com ([209.85.208.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lyAIW-0005ft-7Q for linux-arm-kernel@lists.infradead.org; Tue, 29 Jun 2021 09:44:52 +0000 Received: by mail-ed1-f70.google.com with SMTP id r15-20020aa7da0f0000b02903946a530334so11232761eds.22 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=HBxN0SK0SN+jCEShfBeMMXrUZ6Fi60O1kFlvbIdAt7ABwERag1ZydlbTQ4aN+tvkuc MKhkbLX1FVO2+zISJaxPtytrxmT459maklhGhqO6bQ9ZWEkosnU/l10coWg+I2N3mfGF Nloqghb7d0Mp4FFsN7mrQolJI4On2XgvP334Lr/94kPKqWUhv9LwFvISkWPiH68S++s7 52x9S+0ffhrW2BLl0gmDez4po0MPD1Z6GVCoB9ZhN1yG4Sq5jIuPJt/Y/mzgyGfw4H9S TuuMHSQGn6sT3kEe0P2+ElEFA1kuydDrYkY8L1KUAbJgUplXnF8cH3HBFRD+Hxbw2Fce qiFA== X-Gm-Message-State: AOAM532Qme6eHRCa+g1UpKizTRU4AQPm9yPNE7l9sMrUDBuasPCIyCRc no/ZiMzv2JmvagzVRmv28lAFqxQqKGTF2okYa2RIaU0hA7ZnerQ2eDrZcOheyBatD5ipo3yWM6o t/n3v6Q27e1gxoVc4sB5f8w6SzjJwWZePTWmAmN/KA4O+RtSt7+d0 X-Received: by 2002:a05:6402:2813:: with SMTP id h19mr38800578ede.39.1624959892026; Tue, 29 Jun 2021 02:44:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy06olXLZfAm05U4GcZNHdgwCRhnlpCZ8sU2e7+C3VS7EOVINUFGdMcuDwYXMbgFp8XUZyLKw== 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210629_024456_071769_9244BFB5 X-CRM114-Status: GOOD ( 20.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel