Received: by 10.192.165.148 with SMTP id m20csp329219imm; Thu, 3 May 2018 21:32:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo6TPxLxa2NM8M0VbQ6vOT6Utfu0on9YO12NqgUqTAfOeD/meE64sM5A5i6e2A2msJ7lzUE X-Received: by 2002:a65:4805:: with SMTP id h5-v6mr6926087pgs.96.1525408347375; Thu, 03 May 2018 21:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525408347; cv=none; d=google.com; s=arc-20160816; b=S6mX18TxzizkS+Aqsn/6oxh5iD7WjYv29d+1PTzsSyClIx38MgW8q/6rNZzNdNZzfk crrYKVrU4xKhZUyM8MVwN3080NyZvY5Dqn3HdpNYFl2m3s4wAvqEJXsV1ZW8LpDtx4zy xelX2hmf5mEaN4VPzdM9UsgiyFafuL2EgCe0Fyafc/zg4nqlfYghAk9KhCzJuJsBseXY RZ4dtZMmAyynNU7Fd5XZ0KbUgtREhrCS4NMacD4SatHuc1fsvS/X23oQvAWYmBYDCA+A JeUF/5wuaJzF0JJZy62+upWdU8PMXJA2EV3sHKiu+2OCHZAFlRXCKQGEX2maRve79oQM 15xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=5m5gw2cFFwT8GPO2JBNaxFH2YHXeaZ6cqU064kU4Fc0=; b=Zyy7dCFoxqiHCXgZfdfqfM3lqM10XeQQnIeiGgi+B0vuxY+sV04a3rj54PK+eq+WDb V6HzqGe6IDssnLalzZQ3LQwfQTlnj//v3txpZtu7MzUpuAtSXXzPaIRN3Jqx9t0iD/wQ Z1FHj7aZckzN0XeZk3zZv0Lygj0njbh3yuv8paO2wW3NSYesd28ZI+9XF7bFF1NxMAh3 Ngj3PPQ32ugoVuLGsoHQbsMpzk4T2UCogxMdWOzvVxVwqonMqpQYcSqLRK4SOpzLpO8K /4I/iLewlBm2mwJWM8tzxUiBrRnxJI+RVNGUDbKE0KPIKxHsTPT//E1x6GslA7CkpjOD AlXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EPpYPp9M; 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 h14-v6si15606226plk.535.2018.05.03.21.32.13; Thu, 03 May 2018 21:32:27 -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=@gmail.com header.s=20161025 header.b=EPpYPp9M; 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 S1751314AbeEDEbY (ORCPT + 99 others); Fri, 4 May 2018 00:31:24 -0400 Received: from mail-ot0-f193.google.com ([74.125.82.193]:36198 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750753AbeEDEbX (ORCPT ); Fri, 4 May 2018 00:31:23 -0400 Received: by mail-ot0-f193.google.com with SMTP id m11-v6so16965880otf.3; Thu, 03 May 2018 21:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=5m5gw2cFFwT8GPO2JBNaxFH2YHXeaZ6cqU064kU4Fc0=; b=EPpYPp9MEzDrWztoWfq2NnJMKxRooOT6ycrEA8Jmzm6cKvJUccL1Jr5gwIiTdMUx/i vZfD/GpNb3ImE0KoB1DJg7Kg0ae9ZrHlph/Ltd8OyLASE1utNWx9yQnh30Q5eZSGY56k Vj/5MndO0B1rT7l9KRsZBopOdPukxmBGvJDnG2vfP8BF6IJYLN7JyP9F+ispwGJYP2hK 4PdCe0gtc8CflQWT2knxjVJqR7VylzNDqigF6EWeOuEJFSwn9astAALnqJW4sygbPEXs WZROvx0WjA0oSOjA50Jy6igbWY8tCfNAPqJtlNGqdyIra6wVuFk7wJR9t+2oqhXj+yu2 128A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=5m5gw2cFFwT8GPO2JBNaxFH2YHXeaZ6cqU064kU4Fc0=; b=GM13wqoF328bAT/Tpgl2UxP7Tjt2AnTlSY7CEVMAoEd9MWZFAUBCe6PBL/9MHlQJpe FgGGlPon46pyQbXcp8vXErtYdTCbMVkfJY2ZMM/18UXJ17KsQXCoacFDWhorb7DGseFY vdyg0LIIDr5nqq8hkTnjIw00mRAeul1/dwx1EBsXVryyEEroedhLVJbi3fElXiFvqygX T+M/LxhLFeizglciIZO0OvtvjoiqxR98ILB81XEWy/yABW+SSI9nEOxkmrTyldbJAP0b I/EAN3nwF8VBWaFTz2yr7uFaNqjxdAn6h5wmujLSa0LU0LXq7lQ7bI+Nk8qP9EmNT4u1 aSBQ== X-Gm-Message-State: ALQs6tD5whj3xo88l8thC27WTqYrffWJS46w5ipLm91yVC7/6C2DvNtQ zaTQ+j6aXaUeUJSAeahrGGK66BcaV7Hd82lTlLtzaw== X-Received: by 2002:a9d:ef:: with SMTP id 44-v6mr17641666otk.164.1525408282459; Thu, 03 May 2018 21:31:22 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:118b:0:0:0:0:0 with HTTP; Thu, 3 May 2018 21:31:21 -0700 (PDT) In-Reply-To: <20180503183408.GA12152@kroah.com> References: <20180503183408.GA12152@kroah.com> From: Muni Sekhar Date: Fri, 4 May 2018 10:01:21 +0530 Message-ID: Subject: Re: serial: start_tx & buffer handling To: Greg KH Cc: linux-serial , linux-kernel@vger.kernel.org, kernelnewbies Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 4, 2018 at 12:04 AM, Greg KH wrote: > On Thu, May 03, 2018 at 08:08:48PM +0530, Muni Sekhar wrote: >> Hi All, >> >> I=E2=80=99m trying to understand how user mode buffer is written to low = level >> serial hardware registers. >> >> For this I read the kernel code and I came to know that from user mode >> write() API lands into kernel=E2=80=99s tty_write() ("drivers/tty/tty_io= .c") >> and then it calls a uart_write() ("drivers/tty/serial/serial_core.c"). >> >> In uart_write(), the buffer is copied to circ_buf and then it calls >> low level serial hardware driver=E2=80=99s start_tx() (struct uart_ops >> .start_tx). But here I could not find how the buffer kept in circ_buf >> is copied to serial port=E2=80=99s TX_FIFO registers? >> >> Can someone take a moment to explain me on this? > > It all depends on which specific UART driver you are looking at, they > all do it a bit different depending on the hardware. > > Which one are you looking at? Look at what the start_tx callback does > for that specific driver, that should give you a hint as to how data > starts flowing. Usually an interrupt is enabled that is used to flush > the buffer out to the hardware. > I=E2=80=99m looking for any existing sample code which does DMA transfers o= f UART transmitted data. I looked at the bcm63xx_uart.c, it looks it does not handle DMA transfers. Even copying the Tx buffer (from circ_buf) to UART_FIFO_REG happening in ISR. > thanks, > > greg k-h --=20 Thanks, Sekhar