Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp798229rbd; Fri, 23 Feb 2024 04:08:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXmJ/+qQq4zGiukqnDHsku5SLCuX+oRuiuzfGo1lIBRceawXgrTZpVwTUgauJ9HBrbehjZxs5ZVeCox/JwXOVQDvxRDpmW0yLfYiUSSdQ== X-Google-Smtp-Source: AGHT+IGz7FpL0uFkOPFQ4wNM9xYKgQiMF4+8TUr09loW/cFcgxhId+UqPkRUyOSYlVsrto0DqTYc X-Received: by 2002:a17:902:c185:b0:1db:f23f:678e with SMTP id d5-20020a170902c18500b001dbf23f678emr1438341pld.15.1708690108823; Fri, 23 Feb 2024 04:08:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708690108; cv=pass; d=google.com; s=arc-20160816; b=AquG9eoaMQQVU+I0MKyzkcM54jSgBnSe+Hp462wvtXBaUdpJoka69tmLYnl/kjulXh M67KnMC8JwymhSBqiWCkt/wyTefB88ff+BoCH6Kcvubv3wZxaUjpCKz/IcppmRVhgBFL 5grlx9oDlPSSnl8r3mhRCpavbBobO58y6mIqZioiolZOdDraP4HlwXGwBHoFDwcuQ5Cs /oQt/B+iF0LSTCqSKWhZomsxs7RZ9Hq2i/qJM964I5z6V2gNs3tlveUX7G6rC5IFQMzH z9QL7WkIdJhXpVfEq3q5AVTzuj7RsVPdD+hGisZV9+rxPiIHFIC9IsY+sHZQ2CfRhTUA kBzw== 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:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id; bh=IVkYMh2v3Ey7NmqKqDSipUqSoF1sduLVXmKiBUqD86A=; fh=Lu0GjPebfelyV+Om/rUZhPhZeanAlFwBC4c4V9YfzJo=; b=hTCVmQsiiLWB+K1H+JmsH28Awk236P0tdu1bjB3FA94QVGphGd57RmZ3FVKn4zguNq zqU4kpwrB88lFnA+GBB5SjjEadBbUbtL/desIVOCN3IDhg3eGrTZMA5syN448NL14FWc LfVTY0LgDwIcHx0KbgaTPiXAK133MkrkxQU2ACfsxwuiN8c4Mpws6c39IjzGHy7HYu0L 3Ciy3WVH/amz7/7vgB6DhptLbCe6WUgdEXhaz6HvDBg0+Mi8UC4IB7atRtYbyBbTNhJ7 CxZi1y1mtY6x+IR90VO3B3PcLvvSVqGjcdGeZPMiFqb14aoQQj9Bd1a0slyCpv0wXTFe a9jQ==; 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-78268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78268-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 y16-20020a17090322d000b001db40a75197si12188382plg.322.2024.02.23.04.08.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 04:08:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78268-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-78268-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78268-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 ABA9FB22188 for ; Fri, 23 Feb 2024 12:08:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C2097AE7F; Fri, 23 Feb 2024 12:08:18 +0000 (UTC) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 335525C60F for ; Fri, 23 Feb 2024 12:08:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708690097; cv=none; b=elS95ibpfR6Uf6XBlrEqEx8THzhX431Hs3qVxc5M9we5hpDtxsSNlcVD7yHRybH2wuopCV69slqjnq+T1D+DJNUh7UuYKxtjJjF247i5J3qAX/tDiS2J2+f3pUp0dyCKCYm9hj1/ikX19FU6xx66o782WcTXirLev1KU953CXUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708690097; c=relaxed/simple; bh=0oCjLgI7Pr6vLcr2tzxSaUCN54mVUd+mbIWulO+3ZPo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BI/JPWrzumFihPWfs4dcNi+hduKdJGnji9P16DfMI4hl2Ct7E04MDnctlcKW8e5d//19WY+H+ZSemXdEtCe/ZXNwkEkeIx3i1oM7PRTVjAe3L/H0wRZUUxt6C5PM34I0+TCJH9EAsINiPpI4AtrZdCVdb9VFfgfifejX/G1piyM= 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.128.48 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-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4128fe4b8c8so5312835e9.1 for ; Fri, 23 Feb 2024 04:08:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708690094; x=1709294894; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IVkYMh2v3Ey7NmqKqDSipUqSoF1sduLVXmKiBUqD86A=; b=shqvPprKla8yZaZ9H36QWYBQlQzJ3LMNOdS08UHJdprs0e2TkfVWyeNjjTYMFO5bnU aUsIPL9b8ihGZEF/4D9/pe/qVFIbw6m1H3dlGwuTWpYNQZK6NdV82I6spFJ7IH27MZ81 /OVojYJh2sx8qusgz+mgq0PgtmQ5ygoDlez1ksaohbZzvzMPsuCT1Pqc0aqdqNcGGj13 IOm+EDKNO4gVM8Ok41N6JZgBABC5jtf5kmuzDF1kEvTEvL9fwv+F/DSxO7pZn7c1pcvn OLSjnSa0xHKwr5geFGvAjnPrkKr2N+7j8/Z9mnW+TTQsB8FgFomkrKcSg/uTZkhIsPBb yhzQ== X-Gm-Message-State: AOJu0YyrXApoPFtmgv/1xixveU0ZKiykbVSmB+t8jW/bCUlnpD/nW4Vn qfb6xu0UuJVEijvBQe3obtU7vCg8WWaJkNoBlbXafuaKC7TE5EeRl19ti6tV X-Received: by 2002:a05:600c:45ca:b0:412:3b33:d130 with SMTP id s10-20020a05600c45ca00b004123b33d130mr1100071wmo.25.1708690094291; Fri, 23 Feb 2024 04:08:14 -0800 (PST) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:59? ([2a0b:e7c0:0:107::aaaa:59]) by smtp.gmail.com with ESMTPSA id jd17-20020a05600c68d100b004129335947fsm2047583wmb.8.2024.02.23.04.08.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Feb 2024 04:08:13 -0800 (PST) Message-ID: <53095fb1-1093-4db0-8c8b-ef3d7d673628@kernel.org> Date: Fri, 23 Feb 2024 13:08:13 +0100 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 0/4] kfifo: small cleanup + linear and skip helpers Content-Language: en-US To: stefani@seibold.net Cc: linux-kernel@vger.kernel.org References: <20240223115155.8806-1-jirislaby@kernel.org> From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwNelBCHEgS/OAa3EJoTfuYOK6wT6nadm YqYjwYbZE5V/SwzMbpWu7Jw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yzqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20240223115155.8806-1-jirislaby@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 23. 02. 24, 12:51, Jiri Slaby (SUSE) wrote: > Hi, > > this is a small cleanup of kfifo. > > More importantly, it introduces three helpers: kfifo_skip_count(), > kfifo_out_linear() and kfifo_out_linear_ptr(). They allow using kfifo in > the serial layer. > > They are needed as up to now, there is no way to "peek" the data without > actually copying to a temporary buffer. kfifo_out_linear*() allow that > and kfifo_skip_count() then allows for tail moving after the copy is > done. Note the copy is usually performed directly to hardware e.g. via > outb(), hence the need for peek without copying anywhere. Sorry, this reasoning is bogus. outb() would be using kfifo_out(), of course. The requirement comes from (for example): * memcpy_toio() in neo_copy_data_from_queue_to_uart(), * regmap_noinc_write() in max310x_handle_tx()), * and similar. The kfifo data are there directly copied to HW in a batch, without the need of temp buffers. thanks, -- js suse labs