Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1094575ybz; Fri, 1 May 2020 14:28:21 -0700 (PDT) X-Google-Smtp-Source: APiQypJt4CK5z2r5+k9ylTTOcvUa7y5tr0llkqtCEQPb93ZG/QL+CxG6ZjCOlxFXWHmd7u6xcWG9 X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr5454333ejb.6.1588368501481; Fri, 01 May 2020 14:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588368501; cv=none; d=google.com; s=arc-20160816; b=0hL/+I+4GttTU4DE9DvxWfwgPzEJf7q35QsyHIIj0oTIfQlasPrMGQENO5k8CKCJKq MpWZBz3efkpLj5+B+sQ9Gtyl2TKp+K6MGMOykNMym4ZcM59qrnvC4IlUNKTrpWk3TiEC 3451fl/it3USApync6a9kR/gBmzq31wc5TvOAUDU+DVnoaC9uuPxIadRptS4QQadLhu/ CNBJGwNSvrcdhMjkS4QbgwwM410WHeHqVjlDPZIT+t9LRs33X6ZmV3DN0qorWbDUNwKw 4clxABo07bg3bwgKUuLyYtr/XAOX/lmokWqnov3ZsJITN/2Ti6BsC/xe+YUrbwYqWbAb vGfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to:dkim-signature; bh=JOH0fItTITIs39+numeUrXseWQMyJbcgZrHAP+cimTE=; b=TZWzLagTxC+CcoYgrlt0nwXtbMI8fG4VA53u5cugXAHdIsMPCr3ujQS48iIQ2Ocpda yUuOZYRmFTv6RqF1xcHBUFc7Ay6qGjgSUtZFCX7WgizcViNu5F5BzDIhEUGO/YWW6WEc M8j74X83wPodRapzESpcQMNAa43l+p6Ao5+upTYXDXHoVnGvSARievGZgX9mLQldiHgu UUmuKn1D7esDULVZn/dINJ4OLbYzkrIt0fZrbz1dPXBiuN1cNa3JXbGf8dynJx2Fwdyh MStTq+d+G9Cz6dmpgoB8xv3sGUecpG+Bf1SJmz4/VO86GqYfU3TSrb8PeB23oegz73Mt rNAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SGFMB9zh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si2619329eju.120.2020.05.01.14.27.58; Fri, 01 May 2020 14:28:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SGFMB9zh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726574AbgEAV0c (ORCPT + 99 others); Fri, 1 May 2020 17:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726045AbgEAV0c (ORCPT ); Fri, 1 May 2020 17:26:32 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAD16C061A0C; Fri, 1 May 2020 14:26:31 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id i10so13082246wrv.10; Fri, 01 May 2020 14:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=JOH0fItTITIs39+numeUrXseWQMyJbcgZrHAP+cimTE=; b=SGFMB9zhhFAaqlWEjTYajAyach4csZy/ytVyPW3zHe2r3kZQUR13WN8vusEwKFG6MA BwLobj60xhZLlb9iRUZsXxyQWW1nV2nMQ73TEEx5rihpzV10YmTG996Y5llN4XgDf9/6 G0ToBT2JWuQL/YEpThEEQphErRD3LcdR5gBmYm7SP9TJ0Lj5siCIRwDAQur0kYj35709 xRJu/HktNa0Exy7wN9af8/EarEAAm9lkra8KN2M1IBeBYQZ8ZjsSK0VWI1mcv2t2EwNB geLGmqrBFWxbSthxh+Rc2SpnSUC3gvsulp9J5qvH3tGtv1GOEsQLrUEQKQiIfe0LYPU+ PRuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=JOH0fItTITIs39+numeUrXseWQMyJbcgZrHAP+cimTE=; b=GLBSkNFN1/5FrJ4Mcr07t+8G8GM5UsbZ7mYLXKOoDqC6ln8h6G3EmmhJOu/QKlcLML qZEi9CJqCzmoj6lXDyzIdwOO9C/YBK20XTn2UTpYMZ3YSrYXuxqZPyPz1kjiWSyD3zrc p3ywrBlnP6dgphdg3lSZgHTENTI9+B3MvMwmz89ui1ELltVRkhP7GF12iihexcm0ku8I fH7NYPq6QGPm5d/0yNCkOez+UQnNLgbc7naKR+OV8xpXKtieXawONotXfKvnuKBj459M 6IUDQxYDu65mdd2z3P8DwD11R5Pxr1d/SaWGTF7z0eVRyFjQcBDcF+I3nvX59qOaRmuO ZOiA== X-Gm-Message-State: AGi0Pube6N8OBQSmhnoEJDArjEYSHrjWUYxmaI0OQDhNs6gQ7Q1JLTXZ +SN2Bz1tPCDJs14vrQwtnIO/USiN X-Received: by 2002:adf:e943:: with SMTP id m3mr5850885wrn.248.1588368389448; Fri, 01 May 2020 14:26:29 -0700 (PDT) Received: from ?IPv6:2003:ea:8f06:ee00:bcdf:534e:d44f:409? (p200300EA8F06EE00BCDF534ED44F0409.dip0.t-ipconnect.de. [2003:ea:8f06:ee00:bcdf:534e:d44f:409]) by smtp.googlemail.com with ESMTPSA id t2sm1157947wmt.15.2020.05.01.14.26.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 May 2020 14:26:29 -0700 (PDT) To: Thomas Gleixner , Jonathan Corbet , Realtek linux nic maintainers , David Miller Cc: "netdev@vger.kernel.org" , Linux Kernel Mailing List , linux-doc@vger.kernel.org From: Heiner Kallweit Subject: [PATCH net-next 0/2] timer: add fsleep for flexible sleeping Message-ID: <8e3c56ca-b43f-3877-0104-a1a279d5a6c5@gmail.com> Date: Fri, 1 May 2020 23:26:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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