From patchwork Mon Oct 14 08:22:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 13834323 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F63ECFC501 for ; Mon, 14 Oct 2024 08:22:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EEE76B0082; Mon, 14 Oct 2024 04:22:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 99F396B0083; Mon, 14 Oct 2024 04:22:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8673C6B0085; Mon, 14 Oct 2024 04:22:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 689356B0082 for ; Mon, 14 Oct 2024 04:22:48 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 0B9D3AB81A for ; Mon, 14 Oct 2024 08:22:33 +0000 (UTC) X-FDA: 82671516480.17.EE75267 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf10.hostedemail.com (Postfix) with ESMTP id 69536C0006 for ; Mon, 14 Oct 2024 08:22:43 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=KFExR3Z0; dkim=pass header.d=linutronix.de header.s=2020e header.b=slvvGPaA; spf=pass (imf10.hostedemail.com: domain of anna-maria@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=anna-maria@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728894025; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=6HOwNsVm5tP1AF7YCvIKWbMDqeHpS3lPwmHnkUywq/Y=; b=5yAEcuBGG32DLL7acpV/5cn40UyDhll//6CDjYsotETty84klcTgk5xkza2lQLOIrh3vhK hUJJXX1cyNUEouBBmd/aMnzl7sqRSTbaoslV7SZw7Net9iehI1xnjT/bLg8IiZOMDNaLWD oM0SiZXLEFtjOUH/WsV7AokQIPG9+JM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728894025; a=rsa-sha256; cv=none; b=2PUbmRO2+nm7EowlLY9BgPsrodpxh9Ni5xQWZ051zAivL0yOrBlFwnxi5vbb7P76FfWYs1 mHe3KsiEGrvGtJztQdZodGp91bfDafYlnA7HBPXm2hXaHM3Ow96Gbw6oEZCwZvd/cebKQM 2IfMTEZbNlPWynpvcXUE8sapvi6G+uU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=KFExR3Z0; dkim=pass header.d=linutronix.de header.s=2020e header.b=slvvGPaA; spf=pass (imf10.hostedemail.com: domain of anna-maria@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=anna-maria@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728894163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6HOwNsVm5tP1AF7YCvIKWbMDqeHpS3lPwmHnkUywq/Y=; b=KFExR3Z0ch2CGjb8uZF385NycoNtXWJ52MR/i19uWkoHR73ejXuX4GOFPDZJchSNKxN0YH 9H09dQgIFLN0XYA0sRa7f+Jg744VoU+FWRipA2zenwRVFWf0noRuToPCIoq/ePHjxWarJ9 SqjMIQ2OJJIQc/JlGoQcr7qn+Ztcb5Wog63TpXuR+uMIcDwA7z6B2gog9Q3SVmAY2bikFt mRj2dJa9yDAlHsRKp62fLCoRoJ4uho0BgHGrPNhLu+s/+D79MQkDsckRZ1I3/nd5V/0BHs FuKX3H4yatjIlK09dEr8+nGf1DKjJ0qQxyhRK9NozUQLqHSQ76Lx7voiR0M2tA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728894163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6HOwNsVm5tP1AF7YCvIKWbMDqeHpS3lPwmHnkUywq/Y=; b=slvvGPaAqPFHoRdnXnb5CSGotI1RmGRgBCGz97ighCehiyEF+E9aEDo3bB0d+pbkk/R91i aaXfQVNhvqPTH6BA== Subject: [PATCH v3 00/16] timers: Cleanup delay/sleep related mess Date: Mon, 14 Oct 2024 10:22:17 +0200 Message-Id: <20241014-devel-anna-maria-b4-timers-flseep-v3-0-dc8b907cb62f@linutronix.de> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIALnUDGcC/5XNSw6CMBSF4a2Qjr2mD1515D6MgwIXuQkU0mKDI ezdwsjEiQ7/M/jOyjw6Qs8uycocBvI02hjqlLC6M/aBQE1sJrlMueYpNBiwB2OtgcE4MlClMNO AzkPbe8QJSlVmWshK57pk0ZkctrQcH7d77I78PLrXcRnEvv6jBwEcUJdFzmWWq4Jfe7LP2Y2Wl nODbH8I8kMV4hdVRrXijWqVqusWv9Rt295y1hsLLAEAAA== To: Frederic Weisbecker , Thomas Gleixner , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, Len Brown , "Rafael J. Wysocki" , rust-for-linux@vger.kernel.org, Alice Ryhl , FUJITA Tomonori , Andrew Lunn , Anna-Maria Behnsen , Miguel Ojeda , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org, SeongJae Park , Arnd Bergmann , linux-arch@vger.kernel.org, Heiner Kallweit , "David S. Miller" , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , netdev@vger.kernel.org, linux-sound@vger.kernel.org, Michael Ellerman , Nathan Lynch , linuxppc-dev@lists.ozlabs.org, Mauro Carvalho Chehab , linux-media@vger.kernel.org, Sebastian Andrzej Siewior X-Rspamd-Queue-Id: 69536C0006 X-Stat-Signature: n6j1cuyek6jiurf9pg1qtq639t1p33ui X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1728894163-530543 X-HE-Meta: U2FsdGVkX1+vo9Oz/Nt2YfFztiNstVQS8gq53QIk2i2nktMDlzYj3pMgKcnYowNwFyn9UUBctvNRGdVaLHSuOdWkg1YnVAdusOhK32XZA4eNiKru0wt87UL7DMhsdq8OhV9l6Ui0BzcC/aUOm9ngk91SzJmBkmmZJXQ/6+/qo/9pe3W32xcmNcHA1gEYrbblHxn6dnvZJv0eOK9cEdJjWlknSzlJhdHYMcUaar+Tby1hP1TL6Z+XjRQ6thqvoHqozhnPacJr8IKlxdx5J/4zyfpItel+wHhbnaU1HHB26IRkyPzJFOQQD699O7rEOAmUdHRi+RVbtnyRVa97jBNPslvOXSvihRT1CsA+ANB8hB7JFMhHUbcz21fzZQyPwL7kxz55CBidEtJn4Q6qLmq2aYs+GZXhpn5HjL2Jb96xfDKfl44j+0wMMwN1blfFb3+Pn9Zy/4TzfIR+APxjCvYDEmh83+kVUl16F8QRjzZpJ/+wXFd29e4anoAyzzTFV9UwCdKU+7WlvRxgWUQpDSALcn3vySS78t9RylIpJoHiq2wcyQ3vR4aoHrZGkvx9s7oS8CHLkMKHl/zro8Doyw5heAqQyjTrehB44ph1sEvdRRHEgKoSIaAhDjHgBp4Cn/ZgnEMEn78nmA0/clOJ2GFgHfjGZyfHZJWqPfQnssrIw8RgU0uhltULtAoutt8QqwwOC/+CK6SQhDSEwBLc/VMhEYN48B6m1TG5PzOO8j80tyQkOxpQ3/rxI/YsHy9wJyap1HBbQRfEbTY5earwcpkxKmD5voOY1NXnvthqtAZ3BtYZWVud8DH/82lLBUrKAF8nX5Cma+anNap+4FZrpdKdHh0kiwUnUn01kV9QftIzV+ktjsppmAmGVAufk9Xi6qMd8lV8Zjc7MVYUInFZXUlLg8am78ShjnA/Uhx+iWJDX6lnRv3crTW8cI05BTXZnvUerWB9hYGJwCQ6F9a0zY/ OKolSF12 qIfAGSB42Qs0XPvI8SWWrxNfKTdtYacbzz8Z96+PjCdLmeeda2odXlVI8vrq0KzvzSFEdIU6NtNMgP0QBbrab3dqMreohZOsrulQmSeWmfnMdXGw11efqAWxaZzOd6vHl5qCJ+/vVzpjOzZYZqixOMzAZedH+oOk7cQfub46gnpGRVNIel+GPBieGx3waSyeDjR9TBGyICr/DiNP1Wpr3HH/bv8UoWBUOfgsKkng+/KNBuTclEpyLywuCVCbOCgHaBOdn X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hi, a question about which sleeping function should be used in acpi_os_sleep() started a discussion and examination about the existing documentation and implementation of functions which insert a sleep/delay. The result of the discussion was, that the documentation is outdated and the implemented fsleep() reflects the outdated documentation but doesn't help to reflect reality which in turns leads to the queue which covers the following things: - Split out all timeout and sleep related functions from hrtimer.c and timer.c into a separate file - Update function descriptions of sleep related functions - Change fsleep() to reflect reality - Rework all comments or users which obviously rely on the outdated documentation as they reference "Documentation/timers/timers-howto.rst" - Update the outdated documentation and move it into a file with a self explaining file name (as there are no more references) - Remove checkpatch checks which also rely on the outdated documentation The queue is available here: git://git.kernel.org/pub/scm/linux/kernel/git/anna-maria/linux-devel.git timers/misc Signed-off-by: Anna-Maria Behnsen Reviewed-by: Mark Brown --- Changes in v3: - Add review remarks - Split checkpatch patch: 1. Remove links to outdated documentation, 2. Remove checks in checkpatch which rely on outdated documentation - Link to v2: https://lore.kernel.org/r/20240911-devel-anna-maria-b4-timers-flseep-v2-0-b0d3f33ccfe0@linutronix.de Changes in v2: - change udelay() and ndelay() as suggested by Thomas - Update some formatting in the new sleep_timeout.c file - minor typo changes and other small review remarks Thanks, Anna-Maria --- Anna-Maria Behnsen (16): MAINTAINERS: Add missing file include/linux/delay.h timers: Move *sleep*() and timeout functions into a separate file timers: Update schedule_[hr]timeout*() related function descriptions timers: Rename usleep_idle_range() to usleep_range_idle() timers: Update function descriptions of sleep/delay related functions delay: Rework udelay and ndelay timers: Adjust flseep() to reflect reality mm/damon/core: Use generic upper bound recommondation for usleep_range() timers: Add a warning to usleep_range_state() for wrong order of arguments checkpatch: Remove links to outdated documentation regulator: core: Use fsleep() to get best sleep mechanism iopoll/regmap/phy/snd: Fix comment referencing outdated timer documentation powerpc/rtas: Use fsleep() to minimize additional sleep duration media: anysee: Fix and remove outdated comment timers/Documentation: Cleanup delay/sleep documentation checkpatch: Remove broken sleep/delay related checks Documentation/dev-tools/checkpatch.rst | 6 - Documentation/timers/delay_sleep_functions.rst | 121 ++++++++ Documentation/timers/index.rst | 2 +- Documentation/timers/timers-howto.rst | 115 -------- MAINTAINERS | 2 + arch/powerpc/kernel/rtas.c | 21 +- drivers/media/usb/dvb-usb-v2/anysee.c | 17 +- drivers/regulator/core.c | 47 +-- include/asm-generic/delay.h | 96 +++++-- include/linux/delay.h | 79 ++++-- include/linux/iopoll.h | 52 ++-- include/linux/phy.h | 9 +- include/linux/regmap.h | 38 +-- kernel/time/Makefile | 2 +- kernel/time/hrtimer.c | 120 -------- kernel/time/sleep_timeout.c | 377 +++++++++++++++++++++++++ kernel/time/timer.c | 192 ------------- mm/damon/core.c | 5 +- scripts/checkpatch.pl | 38 --- sound/soc/sof/ops.h | 8 +- 20 files changed, 704 insertions(+), 643 deletions(-)