From patchwork Wed Sep 11 05:13:26 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: 13799693 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 CEC72EE0209 for ; Wed, 11 Sep 2024 05:19:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61E388D00F8; Wed, 11 Sep 2024 01:19:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CDF58D0056; Wed, 11 Sep 2024 01:19:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 495338D00F8; Wed, 11 Sep 2024 01:19:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 2B54E8D0056 for ; Wed, 11 Sep 2024 01:19:55 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 82BC414127B for ; Wed, 11 Sep 2024 05:19:54 +0000 (UTC) X-FDA: 82551305508.22.FA2A42D Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf03.hostedemail.com (Postfix) with ESMTP id A485120004 for ; Wed, 11 Sep 2024 05:19:52 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=zcjOUdE5; dkim=pass header.d=linutronix.de header.s=2020e header.b=gknwvNYQ; spf=pass (imf03.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=1726031890; 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=+M63sb+alCucSQJ7tlC6FTNMfLDiWgRAcRl5msr836k=; b=mgSs/7qIZMopKmJ6S9+9W2ZTTVXwVM+mCV5jr8g37kHKAL5mM1vbClenO3FIS6gJzbt1Mb ISLFY02Nni9P1q5Asz2NX9XY26w9ttcdc/iVdgNYubBzflL6kBnPaKLm7UDbDTeTkUQW2v q9NssllMvAjJ08LrPKQYV9dTvgZ5Kkg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726031890; a=rsa-sha256; cv=none; b=psJkH2YGoVxBUAqWmY+KxqL1ZCRC1YZFLw/gRYSACH9HftoBF9mFOjQJp1miQyYEs11WTE +Nebz1fbp00bQ7p4ypeeSmtaKKJqy/zbZHgmRiNmYLdch/D0DQB6dp5E7vmKapBf+OORlg a9hQrCQ16LE3+UpWJEEKiQH+YHgFl9Y= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=zcjOUdE5; dkim=pass header.d=linutronix.de header.s=2020e header.b=gknwvNYQ; spf=pass (imf03.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=1726031630; 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=+M63sb+alCucSQJ7tlC6FTNMfLDiWgRAcRl5msr836k=; b=zcjOUdE5uYOzG3zMWEysbHES79qDB4JSVXHCvX7jvX038hWJ6E1a9zmS+8gu8PUIVCCpAB MFWXJ7p6LXXj4ROo0dAOnsRZIxnowxknJJEhm4BWG0Oo+2egK0RgI2vlxZMdxkEWOAx7i1 d2brlK5z8VGIsQ1JjenUCJxy45eLQdU0pqQ8FCEgHTyk615kiOsGJtMGW8lZ6bPKCRxcPo uFDQn+ByIPqS23hKA0bubN5nF5pDTo6IRnyxDc/mXB4TF8q39GIubPyo2pmQ4LXywN2So1 g6YS43ZHIDqqJIWssbA6Ql0ocvqSfcNJxMiLCpxJ7Mksmpr5QBVYTaU10mmzmQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1726031630; 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=+M63sb+alCucSQJ7tlC6FTNMfLDiWgRAcRl5msr836k=; b=gknwvNYQnzUM0poa0HzYHQbR2GF9YzVdCcLwSMZwtPEgGL8vK1OkJldGBzIqqkkvp4MOMX P63ejNE/kCRZ18DA== Subject: [PATCH v2 00/15] timers: Cleanup delay/sleep related mess Date: Wed, 11 Sep 2024 07:13:26 +0200 Message-Id: <20240911-devel-anna-maria-b4-timers-flseep-v2-0-b0d3f33ccfe0@linutronix.de> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAPYm4WYC/5WNSw6CMBQAr0Le2mdK+bWuvIdhUeQhL4GWtNhgC He3cgOXM4uZHQJ5pgC3bAdPkQM7m0BeMniOxr4IuU8MUshSaFFiT5EmNNYanI1ng12JK8/kAw5 TIFpQFarSuex0rRWkzuJp4O18PNrEI4fV+c+5jPnP/lOPOQokrZpayKouGnGf2L5X7yxv156gP Y7jC2ndop/WAAAA To: Frederic Weisbecker , Thomas Gleixner , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, Len Brown , "Rafael J. Wysocki" , Anna-Maria Behnsen , 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 , Andrew Lunn , 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 X-Rspamd-Queue-Id: A485120004 X-Stat-Signature: q5jsaeamyeeqz9qk8935wsyrhi47dd79 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1726031992-720331 X-HE-Meta: U2FsdGVkX18JQRuFebkXkLb6RFqoJ2BWg3+8g8YswdObizDWPimjAajrIjeKrdbeW0PmugtR3/u6f9hFN6SfYdgiVHXExgq6qTaRW56/0ccRPx6V8wYnzGxRyHKokJatvUKQFNXgWF9G5vrPqodtkKylAKUu3SqgvjcI2tB7qKIF748ciliJ4ivr8J74jEuBVoMJ1QOvSuA18t7yDn9/YUoWEuioV1QooQobzU5kOSVpvpb9CXO4xTdsFK05LYGIXlO8fzi0Sw8wNW9jso4OF9h8N32/G34CkMZENLtY4jTzT0l1YKlDAZcwu3Jzz/4/Wzk4SunFWYD3KkDeodXkfxQqu9Ei6dpglsHdQoxtjhN7nDxVjEQpLHNGdTGsFaHHOq8pYENjJxRPXBw2PS2QUnqWzboWX/0iqlwDmnOKUByyg4uqnJyfwa2UdlQ4U9+nHYHdFkMQO6r65lateV33opv05Mr6s9zrEFspJ5c/XmZzbZvSRQOxu2Nrr+1BVi5c34Ep3LZudPKgkcO00aaDlqTQsFBc22rFYhHl2X+ieCTWuSmafPoXNqED/TqJvJAOrx+O9y/nacXsAaAK95VDSQJuOMfM89oGwJNyukji0LUTrZvGh+OX+88rCFfYx2pqP5PxxDkel3nwp18fzmiHC+8BVfqPZlPUZil3IDaQcRRFSuqOUoH6Nq7A3zEf1nDwFK9ADi7vJu0a+KDc/vDfZQhwdNqozsoDBlsFhc5rx3676zAsBWyJYjjcRFbMkdp0LYcQm8Cl4UUqJGgr8JpHjKVo2P4IclfnTw+Za7Ge7ts8CXw2RbEgLUNDMbNkB4e9GKnpquaXw4SXEcPUf1nJHVJU2RWfytjQvO6FnwXmOpFVr/U7mm5MQ6Ge+g8eKeBdO7jhB5dHxGJrZeVCiRuN7shtFrneC4nLYeegzRBFuAaXFt4ImVB9MeuajOiBMkGwF7f5mQj+JSP+gNJ+D+M qmO2CPbj ENdppXhYxONlAmvcIr7UvbOxeMgLIO1bD86fzN7d5yf9qO9l028Fj1IKZZt09ekulk18SG/lvzae4435vYPgRoyGwElAIXj44EDjkVPOHJFR0RHjGi+Li+79obKlOI8PeUlpfHDs7vnTA/8pP2OodPfkTGHpyqZn31topRVGZH3zwzxWXXdgrctEZdg== 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" - Last but not least (as there are no more references): Update the outdated documentation and move it into a file with a self explaining file name The queue is available here and applies on top of tip/timers/core: git://git.kernel.org/pub/scm/linux/kernel/git/anna-maria/linux-devel.git timers/misc Signed-off-by: Anna-Maria Behnsen --- 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 (15): 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 broken sleep/delay related checks 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 link to outdated sleep function documentation timers/Documentation: Cleanup delay/sleep documentation Documentation/dev-tools/checkpatch.rst | 6 - Documentation/timers/delay_sleep_functions.rst | 122 ++++++++ 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 | 6 +- drivers/regulator/core.c | 47 +--- include/asm-generic/delay.h | 95 +++++-- 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 | 376 +++++++++++++++++++++++++ kernel/time/timer.c | 192 ------------- mm/damon/core.c | 5 +- scripts/checkpatch.pl | 38 --- sound/soc/sof/ops.h | 8 +- 20 files changed, 701 insertions(+), 634 deletions(-)