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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6E6BCC4345F for ; Wed, 17 Apr 2024 10:21:05 +0000 (UTC) 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:References:In-Reply-To:From:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Na7I41HvVp0/Qg8o/ligvCaL5gfsLBb1HrVsRgRvfjw=; b=5AIUnyeRhDG07Q q3IAS8YzL4ZYycCgycucG+6S6d4pUM4cYhUoXPVi574iQvVbwJDk351k85Q8SXLM7K35VgWy/sFaf AUWK1EJiSDZTTOxFuKGuwDaZ4TcfzxyWoJa9/3spHBfz+OUF9sXpoODlRbCuzZ9xmNwZystZzyFge Bgcrfp0fRue1dkDC1xF2A5NX7PSNpaSDJMPMwmV/nFpMj9xYxVjLahStX97pvcGtZw0Oi2zHT8ov9 gKEjfzQDy6w17cQUbUbnWyfXttMWXPxUsR0yQMn4pTM1pO0SH5nGnXLHzQLpL8MDepMKKtj6QYZ2U Ff7GeSe/veFxMg7ya0Iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx2PP-0000000FZnn-1nyP; Wed, 17 Apr 2024 10:20:55 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx2P5-0000000FZYk-1GnU for linux-amlogic@lists.infradead.org; Wed, 17 Apr 2024 10:20:38 +0000 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240417102031euoutp024daa2ae94d1555fad8dd01c1dbd61d29~HCgx42H3L2070420704euoutp02D for ; Wed, 17 Apr 2024 10:20:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240417102031euoutp024daa2ae94d1555fad8dd01c1dbd61d29~HCgx42H3L2070420704euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1713349231; bh=dFt6dfcqV3zT2/ZiPZ6VfWUb9Ittzgqcfr2mHlwzjko=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=mkJh3BtIzO80Gg+ySnEXp6oFTse34sqblkl0o4Ue5vGXUqRxc0+v5gcoYkATjhzn6 f6c1HGwzkv8ogHl1K6tt3qzJSoBEp5bZMwXosy6Njj8ewelg155GGIBUg+BoN23jTr pluVfCm7C5G9aCZXjpFUqCTJWeGLvXaXGuRBGTbY= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240417102031eucas1p1a388b363c581a557fe3c4ca64f141a92~HCgxlaONv1596815968eucas1p1Z; Wed, 17 Apr 2024 10:20:31 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id AA.39.09875.F62AF166; Wed, 17 Apr 2024 11:20:31 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240417102031eucas1p221e613c1c12e7f71449935a2090cd72e~HCgxLJvvj1176911769eucas1p27; Wed, 17 Apr 2024 10:20:31 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240417102031eusmtrp1f8fa65831e1464c22b1362499d7a4fdd~HCgxJ80f-2417024170eusmtrp1B; Wed, 17 Apr 2024 10:20:31 +0000 (GMT) X-AuditID: cbfec7f4-11bff70000002693-21-661fa26f07c1 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 21.B5.09010.E62AF166; Wed, 17 Apr 2024 11:20:30 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240417102030eusmtip21c4b82205fab31cb65d46fa91d3a4030~HCgwZ4A6z1594315943eusmtip2g; Wed, 17 Apr 2024 10:20:30 +0000 (GMT) Message-ID: Date: Wed, 17 Apr 2024 12:20:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 12/15] tty: serial: switch from circ_buf to kfifo To: Anders Roxell , Jiri Slaby Cc: gregkh@linuxfoundation.org, linux-amlogic@lists.infradead.org, "linux-arm-msm@vger.kernel.org" , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Content-Language: en-US From: Marek Szyprowski In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCKsWRmVeSWpSXmKPExsWy7djPc7r5i+TTDK5eVbC4NeU3k8W2DhuL 5sXr2SzePDrCbPFurozFz/YtTBYdk7ezWCyYzW0xcf9ZdovLu+awWZxZ3MtucWzRSRaL9ztv MTrwery/0cru8XTCZHaPTas62TzuXNvD5rF/7hp2j81L6j0+b5ILYI/isklJzcksSy3St0vg ythw9hFLwWyRioldn9kaGA8JdDFyckgImEgsP3iNsYuRi0NIYAWjxNztx1ggnC+MEu8vdbND OJ8ZJd5c388E0/JidR8bRGI5o8TlUxOgnI+MEjufPger4hWwk+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y6x VYo2tDDSM7S00DMysdQzNDaPtTIyVdK3s0lJzcksSy3St0vQy9hw9hFLwWyRioldn9kaGA8J dDFyckgImEi8WN3H1sXIxSEksJRR4s6yVlaIhIzEyWkNULawxJ9rXVBF7xklHu08DZbgFbCT 6D07kw3EZhFQlVjYso0ZIi4ocXLmExYQW1RAXuL+rRnsILawgKvEpTdvwepFBAIlrt5Zwg4y lFngPLPEhOZ9rBAbDjBJ3F23DqyDWUBc4taT+UwgNpuAoUTX2y6wbk4BdYmTJxYzQdSYSXRt 7WKEsOUltr+dwzyBUWgWkkNmIRk1C0nLLCQtCxhZVjGKpJYW56bnFhvpFSfmFpfmpesl5+du YgRG8LZjP7fsYFz56qPeIUYmDsZDjBIczEoivC3CsmlCvCmJlVWpRfnxRaU5qcWHGE2BoTGR WUo0OR+YQvJK4g3NDEwNTcwsDUwtzYyVxHk9CzoShQTSE0tSs1NTC1KLYPqYODilGphWKz++ WxdkKsZh9Pla9pEchZcXTbnfBoj/8Nsod1jt2F1XsSdTT5Xvr9ix1+lCjXCwweLDuVtszzxc vVbdt3Lu66Ml5lptj3ImRO1YN3nKNUvpA9knP08PkZRItDt24a1PJ+eV82avT062+enwIVaL JdxFh2caixWbhf7bTQ7752TLmSsFy2n2n3EV3X/MVmbLM8vKvs/mU4sWnYs8KHjI7RO/YeNs Me19ixenvH/yvkrh8EZ192WCusFM9zaWf0vIkZhqJP6iz+fE0/QYPvGN9vHczwQz9sTP31As +HLrmuv8M9pssu8fqwuxvx/G57jOP3uay+pojmlPFr1p7rn/cX/PvswDQWutlQL3XlJQYinO SDTUYi4qTgQAEwnrVGkDAAA= X-CMS-MailID: 20240417102031eucas1p221e613c1c12e7f71449935a2090cd72e X-Msg-Generator: CA X-RootMTR: 20240415125847eucas1p2bc180c35f40f9c490c713679871af9ae X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240415125847eucas1p2bc180c35f40f9c490c713679871af9ae References: <20240405060826.2521-1-jirislaby@kernel.org> <20240405060826.2521-13-jirislaby@kernel.org> <91ac609b-0fae-4856-a2a6-636908d7ad3c@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240417_032035_658988_56F08C89 X-CRM114-Status: GOOD ( 18.24 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org On 17.04.2024 12:08, Anders Roxell wrote: > On 2024-04-15 15:28, Jiri Slaby wrote: >> On 15. 04. 24, 14:58, Marek Szyprowski wrote: >>> On 05.04.2024 08:08, Jiri Slaby (SUSE) wrote: >>>> Switch from struct circ_buf to proper kfifo. kfifo provides much better >>>> API, esp. when wrap-around of the buffer needs to be taken into account. >>>> Look at pl011_dma_tx_refill() or cpm_uart_tx_pump() changes for example. >>>> >>>> Kfifo API can also fill in scatter-gather DMA structures, so it easier >>>> for that use case too. Look at lpuart_dma_tx() for example. Note that >>>> not all drivers can be converted to that (like atmel_serial), they >>>> handle DMA specially. >>>> >>>> Note that usb-serial uses kfifo for TX for ages. >>>> >>>> omap needed a bit more care as it needs to put a char into FIFO to start >>>> the DMA transfer when OMAP_DMA_TX_KICK is set. In that case, we have to >>>> do kfifo_dma_out_prepare twice: once to find out the tx_size (to find >>>> out if it is worths to do DMA at all -- size >= 4), the second time for >>>> the actual transfer. >>>> >>>> All traces of circ_buf are removed from serial_core.h (and its struct >>>> uart_state). >>>> >>>> Signed-off-by: Jiri Slaby (SUSE) >>>> ... >>> This patch landed in linux-next as commit 1788cf6a91d9 ("tty: serial: >>> switch from circ_buf to kfifo"). Unfortunately it breaks UART operation >>> on thr Amlogic Meson based boards (drivers/tty/serial/meson_uart.c >>> driver) and Qualcomm RB5 board (drivers/tty/serial/qcom_geni_serial.c). >>> Once the init process is started, a complete garbage is printed to the >>> serial console. Here is an example how it looks: >> Oh my! >> >> Both drivers move the tail using both kfifo and uart_xmit_advance() >> interfaces. Bah. Does it help to remove that uart_xmit_advance() for both of >> them? (TX stats will be broken.) >> >> Users of uart_port_tx() are not affected. >> >> This is my fault when merging uart_xmit_advance() with this series. >> > I'm trying to run on two dragonboard devices db410c and db845c and both > fails to boot see the boot failure from db845c [1], linux-next tag: next-20240415. > I tried to apply the patch [2] (that you proposed in this thread) ontop of next-20240415. However, that didn't > help bootlog on db845c [3]. This is a different issue, which I've reported 2 days ago. See the following thread: https://lore.kernel.org/all/d3eb9f21-f3e1-43ec-bf41-984c6aa5cfc8@samsung.com/ Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic