All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Jonathan Corbet <corbet@lwn.net>,
	Realtek linux nic maintainers <nic_swsd@realtek.com>,
	David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-doc@vger.kernel.org
Subject: [PATCH net-next 0/2] timer: add fsleep for flexible sleeping
Date: Fri, 1 May 2020 23:26:21 +0200	[thread overview]
Message-ID: <8e3c56ca-b43f-3877-0104-a1a279d5a6c5@gmail.com> (raw)

Sleeping for a certain amount of time requires use of different
functions, depending on the time period.
Documentation/timers/timers-howto.rst explains when to use which
function, and also checkpatch checks for some potentially
problematic cases.

So let's create a helper that automatically chooses the appropriate
sleep function -> fsleep(), for flexible sleeping
Not sure why such a helper doesn't exist yet, or where the pitfall is,
because it's a quite obvious idea.

If the delay is a constant, then the compiler should be able to ensure
that the new helper doesn't create overhead. If the delay is not
constant, then the new helper can save some code.

First user is the r8169 network driver. If nothing speaks against it,
then this series could go through the netdev tree.

Heiner Kallweit (2):
  timer: add fsleep for flexible sleeping
  r8169: use fsleep in polling functions

 Documentation/timers/timers-howto.rst     |   3 +
 drivers/net/ethernet/realtek/r8169_main.c | 108 +++++++++-------------
 include/linux/delay.h                     |  11 +++
 3 files changed, 58 insertions(+), 64 deletions(-)

-- 
2.26.2


             reply	other threads:[~2020-05-01 21:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 21:26 Heiner Kallweit [this message]
2020-05-01 21:27 ` [PATCH net-next 1/2] timer: add fsleep for flexible sleeping Heiner Kallweit
2021-08-05 13:06   ` Bjorn Helgaas
2020-05-01 21:29 ` [PATCH net-next 2/2] r8169: use fsleep in polling functions Heiner Kallweit
2020-05-07  0:04 ` [PATCH net-next 0/2] timer: add fsleep for flexible sleeping David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e3c56ca-b43f-3877-0104-a1a279d5a6c5@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.