Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1427120lqp; Mon, 15 Apr 2024 06:26:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU26REgwPfZb/vbsIarIkXFVjs0ySdK5anQJOb89volfugz/xqktz4PcKaFsEwJZsLqhHbiei5IrsaI0w6IVDTt+Pbv2Ujf5DgKQoLblw== X-Google-Smtp-Source: AGHT+IGSnXbD3/32U+TFm9Y/fMzMoOho71ph9gMwTyksP6sF5uEDCncCEF2sCKlhN5wi9ch7Ht+A X-Received: by 2002:a05:6a21:7787:b0:1a7:a353:939e with SMTP id bd7-20020a056a21778700b001a7a353939emr11438859pzc.56.1713187590828; Mon, 15 Apr 2024 06:26:30 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q12-20020a170902e30c00b001e3bffa498bsi7473734plc.389.2024.04.15.06.26.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:26:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=U3DZfTt2; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-145210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145210-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3F241B2165B for ; Mon, 15 Apr 2024 13:18:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E3D9C85958; Mon, 15 Apr 2024 12:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="U3DZfTt2" Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57D3084E1A for ; Mon, 15 Apr 2024 12:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713185932; cv=none; b=dBbnGg7ukTB1TF5IgN/G1B4vDFIsmfC1BnpUZFbSYgvS8TCSopxplvbKx1uRf5OzHjSdYLffvnnIkoEvd1tOvBEEtK4qgH2a+ZxoTrk9KDJWHcwOkSvFCTJDmgpdgnXwTWtdfG2CqvS1QZ8T0QfIWV+/moQNCAmunFsPXyTXBmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713185932; c=relaxed/simple; bh=iziCxtBeQUgWvhE++plh/rlR2F6qXEUcQ5jrLIOpDfU=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:In-Reply-To: Content-Type:References; b=Nrnr7TstDWMvIr/VzmSvcn1dJ0FyC4XrBtvhl9Nr3Y7zYQJBk9kYMDA1NdKqX4NcvZ9yy8Ff5BmvCqAG6rxXkFNJltmyy8iKijt7MLebAMh/kbCbXv7zQJatqnrLZecyIACbo8sr4bh+TfL2S6iztt1jRKw/VYgC74tdjJ5ZgVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=U3DZfTt2; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240415125848euoutp02406710cf51cf4a85ea3be87bd67c4f92~GdYZxAVra1053010530euoutp02a for ; Mon, 15 Apr 2024 12:58:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240415125848euoutp02406710cf51cf4a85ea3be87bd67c4f92~GdYZxAVra1053010530euoutp02a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1713185928; bh=K7kgIzAF8cwrWU7cZnQZrJq9/UxYfRIxipy6YJIOOnc=; h=Date:From:Subject:To:Cc:In-Reply-To:References:From; b=U3DZfTt2tz636C6PK/TOxc5kdPqHBA+WgNL+c9f7jbLpkfE7TazfaTNa1XDFdbp4K OoNcBD9ppaVqFVCdTDnNa+PocIQQNt/VohmdBru9TOuKws3EYQ6SPCtNybhXcx7/Ii uvixRC/CXtAC7SbwwI43vAloRWJGzUYSBTHr2z0Y= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20240415125848eucas1p2693e3902c12ef8668751a407d9d9f211~GdYZi7waQ1350713507eucas1p20; Mon, 15 Apr 2024 12:58:48 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 83.07.09875.8842D166; Mon, 15 Apr 2024 13:58:48 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240415125847eucas1p2bc180c35f40f9c490c713679871af9ae~GdYZAlLpo1350813508eucas1p25; Mon, 15 Apr 2024 12:58:47 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240415125847eusmtrp2b598b357b551f9ce09ab776ff9f34d8a~GdYY-6IPH2471724717eusmtrp2U; Mon, 15 Apr 2024 12:58:47 +0000 (GMT) X-AuditID: cbfec7f4-11bff70000002693-32-661d2488da1c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 89.6F.08810.7842D166; Mon, 15 Apr 2024 13:58:47 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240415125846eusmtip1044831a80b43d035463a2940376d5e6d~GdYYUHAow1109911099eusmtip1Q; Mon, 15 Apr 2024 12:58:46 +0000 (GMT) Message-ID: <91ac609b-0fae-4856-a2a6-636908d7ad3c@samsung.com> Date: Mon, 15 Apr 2024 14:58:46 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Marek Szyprowski Subject: Re: [PATCH 12/15] tty: serial: switch from circ_buf to kfifo To: "Jiri Slaby (SUSE)" , gregkh@linuxfoundation.org, linux-amlogic@lists.infradead.org, "linux-arm-msm@vger.kernel.org" Cc: 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 In-Reply-To: <20240405060826.2521-13-jirislaby@kernel.org> Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHKsWRmVeSWpSXmKPExsWy7djP87odKrJpBtu2clls67CxaF68ns3i zaMjzBbv5spY/GzfwmTRMXk7i8WC2dwW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20240415125847eucas1p2bc180c35f40f9c490c713679871af9ae X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" 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> Dear All, 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: [    8.763154] Run /sbin/init as init process NT [   12.429776] platform cpufreq-dt: deferred probe pending: (reason unknown) [   12.434259] platform regulator-vddcpu: deferred probe pending: pwm-regulator: Failed to get PWM [[6if;9]Uigmkfl-tl ocretbo nrnee .[[6if;9]Uigmkfl-tl ocretbo nrnee . [[6if;9]Uigmkfl-tl ocretbo nrnee . [[6if;9]Uigmkfl-tl ocretbo nrnee . [[6if;9]Uigmkfl-tl ocretbo nrnee . [[6if;9]Uigmkfl-tl ocretbo nrnee . [[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[2l[1[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. [.. yteiigteiiilhtlgeet dvcs..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. [.. yteiigteiiilhtlgeet dvcs..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. [.. yteiigteiiilhtlgeet dvcs..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. [.. yteiigteiiilhtlgeet dvcs..[[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. [.. yteiigteiiilhtlgeet dvcs..[  105.613420] debugfs: Directory 'ff800280.cec' with parent 'regmap' already present! [[6if;9]Uigmkfl-tl ocretbo nrnee . [.. trightlgeet ipthr ytm-dv5c7[Gmo [94m8[2h[0. .]Snhszn h nta opu vns(usses..[2l[11[[2 k;9?5[  105.638809] mc: Linux media interface: v0.10 [.. atn o dvt eflyppltd.[  105.707390] meson-vrtc ff8000a8.rtc: registered as rtc0 I found this patch by bisecting today's linux-next. I've checked the changes in the related UART drivers and I don't see any obvious issues though. Let me know if I can help debugging this issue somehow. I've trimmed recipient list due to my smtp server limitation. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland