From patchwork Thu Jun 22 08:38:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 111497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4919117vqr; Thu, 22 Jun 2023 01:51:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4x+dm7CO2e8mjxq/pa0k1mETVn0AZKqxnX4aB/G5GDaBNgaEJwcdP7VF19COqoepOmkbUn X-Received: by 2002:a05:620a:2955:b0:763:a83c:a9e4 with SMTP id n21-20020a05620a295500b00763a83ca9e4mr12137732qkp.31.1687423861332; Thu, 22 Jun 2023 01:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687423861; cv=none; d=google.com; s=arc-20160816; b=S6aLkVC82cL7hjzNjwZUcSI0me89bmstP2mC9Qbu9go/oZEWI4/7KxfWH97H9n86/+ sCQ6lDFHsa68bI19Xr/3TymsbLiruU1lOy5RZOjBkAEbQwcMjlRS94a+t/2GEsNscESq LXeZoKTOsyf/5S25gqsvFbJYUhUyyKnI9Jq5P5LPWRuGS7aSwQzGP9V2WiJDPtGmLSlN X+v6zKsNyQWixO50f/S5q4/6NNi3aGwaQh3m6ySf8J+15gLr0KwyvDX0Bdrth6ypSY+Y ufPpYLUldW6pHiNtUZLIxH7ccJaS+Z3qaSVnw8/0QDyaZ8jwQZSjXI3et0iIp3Xh8kLc 85Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=HXkUx2ZrteCgNj07PnMHGRTq+c/3p2glX386TX0nMhE=; b=0r1bjrtXHGdjoMmVgQWIQSBJE/xX6sz0n7CGmN+ffY7u6lSX/KieSc4g/deFIgfU7t QzsybGrz49hEac832v0qHHPsvSw2kbuUZBVqSnV35yVa2ow4YDscL4JWOGXhpY23r0Cm hFtgNUlvlaBrhPo1C8zcuhQu5+8L7NsgWqLqagQ3679DQ4wyZUoFaVzhCwpiRzGnENaU Xauc3wMbmkP4SX/8hNQPTEjgQ8CDC8x45eZB2yyVxQdZMAsPQ4Cx9qd8c5zFQJqy1t4p sJulruk06AGMx6hhtgR5cSsapz2zgcQmyG0d205oGLEAKdQ0cWPt8QV8uWVTKqGFLTgo 1lrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ijA1pG6R; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=u1LCnIzR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d10-20020a63734a000000b0054ff42d3833si6057904pgn.336.2023.06.22.01.50.48; Thu, 22 Jun 2023 01:51:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ijA1pG6R; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=u1LCnIzR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230448AbjFVIi2 (ORCPT + 99 others); Thu, 22 Jun 2023 04:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230264AbjFVIi0 (ORCPT ); Thu, 22 Jun 2023 04:38:26 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B71D1BD4; Thu, 22 Jun 2023 01:38:24 -0700 (PDT) Date: Thu, 22 Jun 2023 08:38:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687423101; h=from:from:sender:sender:reply-to: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:in-reply-to:references:references; bh=HXkUx2ZrteCgNj07PnMHGRTq+c/3p2glX386TX0nMhE=; b=ijA1pG6RhWz5+KlyVVDlNf8MHyJuw+yFdlBdljNpZrHucJIxmDBZsK/6mapXk6OllqU1xy p7B8famjJ0C6tTCZnEeUfrOPYsrUMHXx6mvOKZRh+k43e1F1TE25HTTwcyiutFbO9VaA7Y pgwES93MK+N67N2WYz8no3S5LJEInKmKVZtkStmzpxYa7+Jy9bq0sbPXzdKfhGIj1OLvl0 8O7upgEIzkfmP6vs2vxrTts4EUJ9+GM7Pl4HwTV+l8LbRCuLJ8KVe+rOhMOZIZCLyatBUE yqQDQu9NmqgoPXCvekyusWq6e8ox9fdTxPreuEzeCtMQi9QLR6PT0z44mqIyTA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687423101; h=from:from:sender:sender:reply-to: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:in-reply-to:references:references; bh=HXkUx2ZrteCgNj07PnMHGRTq+c/3p2glX386TX0nMhE=; b=u1LCnIzRoM02IH4N2x2w2sBCdCUUiHrrLhJT4Ej/kED4PR1TAyb5uZO41iYQp0kkt88JAi G71fv2Ey0+vuIEDg== From: "tip-bot2 for Ben Dooks" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] hrtimer: Add missing sparse annotations to hrtimer locking Cc: Ben Dooks , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230621075928.394481-1-ben.dooks@codethink.co.uk> References: <20230621075928.394481-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 Message-ID: <168742310100.404.5830952013545972340.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769392162846315536?= X-GMAIL-MSGID: =?utf-8?q?1769392162846315536?= The following commit has been merged into the timers/core branch of tip: Commit-ID: ccaa4926c2264ca2a2fcad4b3511fe435d7d4d15 Gitweb: https://git.kernel.org/tip/ccaa4926c2264ca2a2fcad4b3511fe435d7d4d15 Author: Ben Dooks AuthorDate: Wed, 21 Jun 2023 08:59:28 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 22 Jun 2023 10:32:37 +02:00 hrtimer: Add missing sparse annotations to hrtimer locking Sparse warns about lock imbalance vs. the hrtimer_base lock due to missing sparse annotations: kernel/time/hrtimer.c:175:33: warning: context imbalance in 'lock_hrtimer_base' - wrong count at exit kernel/time/hrtimer.c:1301:28: warning: context imbalance in 'hrtimer_start_range_ns' - unexpected unlock kernel/time/hrtimer.c:1336:28: warning: context imbalance in 'hrtimer_try_to_cancel' - unexpected unlock kernel/time/hrtimer.c:1457:9: warning: context imbalance in '__hrtimer_get_remaining' - unexpected unlock Add the annotations to the relevant functions. Signed-off-by: Ben Dooks Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230621075928.394481-1-ben.dooks@codethink.co.uk --- kernel/time/hrtimer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index e8c0829..238262e 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -164,6 +164,7 @@ static inline bool is_migration_base(struct hrtimer_clock_base *base) static struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) + __acquires(&timer->base->lock) { struct hrtimer_clock_base *base; @@ -280,6 +281,7 @@ static inline bool is_migration_base(struct hrtimer_clock_base *base) static inline struct hrtimer_clock_base * lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) + __acquires(&timer->base->cpu_base->lock) { struct hrtimer_clock_base *base = timer->base; @@ -1013,6 +1015,7 @@ void hrtimers_resume_local(void) */ static inline void unlock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) + __releases(&timer->base->cpu_base->lock) { raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags); }