Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1445071lqp; Mon, 15 Apr 2024 06:55:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWY2cujrhgHY+n4qzYfUf2W8eY+u+x2Zc/zS7z9NpVOsmEDZoPFt/+yvubkaaOAuk9Wg8toGt939bnF6ywi9KP/0cQDIwEIqg46HBnAAw== X-Google-Smtp-Source: AGHT+IE0eDTOJq3bFsYB77msjU88YTGmaWLdno4l4Hy/nmC4Pvc24Mz2wJeBAj1QFEeukBkhnTTa X-Received: by 2002:a05:6a21:2d8e:b0:1a9:dd82:a42a with SMTP id ty14-20020a056a212d8e00b001a9dd82a42amr4992059pzb.31.1713189307747; Mon, 15 Apr 2024 06:55:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713189307; cv=pass; d=google.com; s=arc-20160816; b=TJkyWlvDmPUv2MDVrnE+JLUkHipTVeBGHx2m1fJWHFWVYo3uLJD5vOjBQjGYasUdGn WeAH/KZBCGmkPKB6YtE4jOlEwNncbIG8NJyxGOMfxgiiR0riQo1Wdrl14smFhGvNunvE Ee2xXesybkMnHoH1rNQAA+VASjW/V6uV4u6+6UCPMmR5mJpCMr7W6RXYOFritA4oorYY W9euH/rNhstT4HzJXoF1dghlxv5JaHz5g0234sga5K0us58W54JQCMEYupP0sq67M+iA YuegsH8UsT7A7CzYRIJC8HfiGB8XY2uEbcn4DB2OjTr0MdQQSCP5UhBcUeHedD1RrCgK zMpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=+lrgrGzjjgYNJJjfx46YZRyvfOQXPcVBXxjVFNNCm2M=; fh=lxwrsZztIt0wtjWSB15zC3J462cRspLLZW0aHMO7Ldo=; b=Z3GjuKRk0CGl7WMTnFYGxf7BOnn2Tqu0+cW6GBckxtBKQmEecdqpLN4kIPz8mpCoyc 5/W66ivA8bHnEhpRhDmDqTqqQj7p4sUkI+ChPCpUx51xSDdrTpen00T5ymavmvTLPhmR VI6QQYJVvn0/rJEu+n0qhnsp7OQ63NUXv9e/aBpCV/KCn82BzSp8i6RLfsFGiA8pzhuP 1kFRfWzP7po3F5AtYAWG88fdrt7vMxRf4Dtdw9sZuo/3JduAcvC0MnOj506O4VPxansT spLSktBWo41o7759hcU6lUPCCeDRQ0uQMdzyzNeR8lVS/affMN2e15ur3X5U91iasHC8 kmKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-145264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t187-20020a632dc4000000b005f0a5125675si8225866pgt.94.2024.04.15.06.55.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:55:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-145264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 78891B23A7C for ; Mon, 15 Apr 2024 13:37:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 497DD7353F; Mon, 15 Apr 2024 13:28:50 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DC3673509; Mon, 15 Apr 2024 13:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713187729; cv=none; b=RE671WWKxyURMQBJgFPvSdV9ir+mToDFP2V7/nqAxl2KTrUEZFB708eCHD2xouElpejWLgDp6zipX5Dw72fcAenoapE7OtOifkefwKPfTIwXTNcNvTQnd32G7giMuBV4D8lpP78DkVMGa6Acd9ExoXsmP3yqIMgEslOmnzS77Jc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713187729; c=relaxed/simple; bh=Hkc/i5fQRWMyNfp/pkPP3vmKRGqAhBx5bs5wguZTaPE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Phuy1Z2jJsKVlLYe+PEn/kaU84E7tj3sB77mdsSAQAXsRI0YUq98TbkityUeUxFtcbFKmmArRNnAjgybgIAVyY03kOhzZ+1u4xTsHlqz98yjqxpWqkjQ56niRGKmY5gUnt31nSghh6faQl3q8Opq0NjUK+JmWsFiD+A3plpxwvA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-346b94fa7ecso3105004f8f.3; Mon, 15 Apr 2024 06:28:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713187726; x=1713792526; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+lrgrGzjjgYNJJjfx46YZRyvfOQXPcVBXxjVFNNCm2M=; b=XPgnxqT6dhAdZGCap2IOvCJwyeZx2+G8pQFnK10sp1nCOroPLNZvV3+IhUafXNHhUJ HozAVvAxJlj3ZxN90asL1WqYArXSy93tWiew6/zvvqWeev6bQoZ1baXtK4luJHB6Ggde yvEXrj5xFHQ8itmpvviI+npk/04OzH+OYTIv3Gjxhhwf7mtiQ6SCzQe1Gllave81GauH OBRxChR1aa3MsSxBAAM/jcqUx2QT1/wrxdoFlvfNC6c8WKAYjBtZGP5kAzVuRiC8JhN/ 8dTlKoO5yjpjNXrBu3xohYrotLe28hSgzqr6o/CDwwsqb3psUXo4A30Uuaj/Y4MIqBmi Plog== X-Forwarded-Encrypted: i=1; AJvYcCXvlQ9vf9YW2owSrMoQ59H0vmDA4V4Gn6U17ANhr6+SWeY65q1TgH7Xzpp/f5WO31h6Kgb1SFjG7V4VwZbIuJq+K2L6IUaTqXdSiYKKI7HX+0tqqOe/zJRkNPD1Ay8HrjJ2+6Ns1tRL0yod3w== X-Gm-Message-State: AOJu0YxOSINSKQDoP670G5VsnqUQ9thQFjJ9I/6JX9LrBve209B+hyBI UJvHsJtI6rwqkRr9xNMmkLhynF85H5Yy7APpdjlCYFtxqZCbFbOl X-Received: by 2002:a5d:64e3:0:b0:346:4151:12c4 with SMTP id g3-20020a5d64e3000000b00346415112c4mr11291238wri.10.1713187726032; Mon, 15 Apr 2024 06:28:46 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:69? ([2a0b:e7c0:0:107::aaaa:69]) by smtp.gmail.com with ESMTPSA id t7-20020adfe447000000b00343eac2acc4sm12148705wrm.111.2024.04.15.06.28.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Apr 2024 06:28:44 -0700 (PDT) Message-ID: Date: Mon, 15 Apr 2024 15:28:43 +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 Subject: Re: [PATCH 12/15] tty: serial: switch from circ_buf to kfifo To: Marek Szyprowski , 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 References: <20240405060826.2521-1-jirislaby@kernel.org> <20240405060826.2521-13-jirislaby@kernel.org> <91ac609b-0fae-4856-a2a6-636908d7ad3c@samsung.com> Content-Language: en-US From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb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wW35rpnq4f/EYTykbk1sa13Tav6btJ+4QOgbcezWI wZ5w/JVfEJW9JXp3BFAVzRQ5nVrrLDAJZ8Y5ioWcm99JtSIIxXxt9FJaGc1Bgsi5K/+dyTKL wLMJgiBzbVx8G+fCJJ9YtlNOPWhbKPlrQ8+AY52Aagi9WNhe6XfJdh5g6ptiOILm330mkR4g W6nEgZVyIyTq3ekOuruftWL99qpP5zi+eNrMmLRQx9iecDNgFr342R9bTDlb1TLuRb+/tJ98 f/bIWIr0cqQmqQ33FgRhrG1+Xml6UXyJ2jExmlO8JljuOGeXYh6ZkIEyzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <91ac609b-0fae-4856-a2a6-636908d7ad3c@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 15. 04. 24, 14:58, Marek Szyprowski wrote: > 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: 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. thanks, -- js suse labs