Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp857869pxb; Fri, 22 Apr 2022 12:47:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww0H/NURwnEBVl4cZiwwJT99PVkOvtxY/Yc/Nrr8Ab9hkvLkPuElwoyg3H7gQgjZnE0DTk X-Received: by 2002:a63:1014:0:b0:399:3710:f204 with SMTP id f20-20020a631014000000b003993710f204mr5254888pgl.424.1650656837291; Fri, 22 Apr 2022 12:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650656837; cv=none; d=google.com; s=arc-20160816; b=rqaWqykqAe+ZMNSGGnXVMH50FWHgYDI69tfaPBZ16CZ8g+VAMhOwuRCNiodlPa59hB Vr/fiYWeAf7qAg0smzFuik/g6kqXoVFslgzyTRWnYDBhWM58qo50A3eiVtwkRhZsdo7G 65oL36lUcBsuIPqKz5o7oUuEUYpDs40kn70zoQCkv2tzRDQhb691tBdHTcxvGwa9WE/C Z8Nl8P9FXY8XDMrugf33rbyunGE6mhS4M7g9nJJxrWimpQioFoIFv7s4yfs/5dc4lwx9 uz9rPynR8IWSB9nC2RKdJhbLz2RJ0E1e/dCazNKuA1AzDxKLBMmzX+v7a3o1wOoDGSHj v5pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8kekJI/xbhVTaB0kWCa/VXYzAzzmU1o9FoYB/mXUI7s=; b=JwYN9Q8x1ybXH7UKqf4i5FfeRx2GFNNJABXwx/EFyAlEWvLFWKOEOSl2mDqwdJcys+ u8B96MKM597tKkOB5BYhth7o3qlbPxhmmRxJuVQvicNBhkwYT0shJPNE01PA5Q9Chmvz pDRJNzkCm0VDAfqfbeoMZoNMbyCC1hoCdNYn/utUeXpUCX11WSH2zPX+1Cwd4zVu20ho l/7bfXe4FhorE977aHPI2hiGS1tiC3v8ZUjzFUq05Iyp7jkLfxYDVCKeyl+izi4ig3lD WB8eyod7PHwIFj2Unkxu1BQ9TsfKAkoCv/xB8kp7f3KpdTohmv74Okt+N0mYh+MTnz8G N/cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oYwbEOQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f64-20020a636a43000000b00381cbf13898si9207051pgc.373.2022.04.22.12.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 12:47:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oYwbEOQe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C4DFF20A41E; Fri, 22 Apr 2022 11:49:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379335AbiDTOJQ (ORCPT + 99 others); Wed, 20 Apr 2022 10:09:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379326AbiDTOJH (ORCPT ); Wed, 20 Apr 2022 10:09:07 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB14443AC6 for ; Wed, 20 Apr 2022 07:06:17 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id bo5so2032441pfb.4 for ; Wed, 20 Apr 2022 07:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8kekJI/xbhVTaB0kWCa/VXYzAzzmU1o9FoYB/mXUI7s=; b=oYwbEOQe3RG3YD7tEJ1vNhordyA4jyaj/hIJyCJXfkscClBDkhAXoZoRX3OE99jkZe FXNJKnEfJnNhV9NTJLLrtERwb3ZnZ+hRb/wqE/nj1wLZu4nMVn/8swXpSvjjN3Jrw5P5 57khmj4petaztDIt1vvOYdk7XDOJKbRNJIH3KXdOFCsq6vnF8bWZL2pjJvti1FBAJglF fRBa1MY9kVlsfrUrWrdDnr/j3CZSKITATHWub2ShsXclVUubtEEf/QZxsSQ2rCE0CcFv 0rkk38WAvR+kGTLonyzHgSi1Svzn8PVnrSVZgl2cqXag1V0lbS6Qt8Ny+Uap5YIuQJ/L ir8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8kekJI/xbhVTaB0kWCa/VXYzAzzmU1o9FoYB/mXUI7s=; b=L5lPqq2d6w2Cbdm0edmnQOQBZjJvk2URdu7LJqf1IpPyq2Q7Vh0FJHa+1Em7GVCE6d qSe5HPCfOcHxzOW8BxKEzB1RMdlL6aFmO0yzyhKS3LtdBiBKFKSNpbHrXWrls4THUCel IR64epNUzObiyO1ul4LzcH/LZ2M+fP41KSSkQIrj2Cpla1JdMHkmf0uzh77d8gA8eM0X 1MOQh8Tx1i7YVocw9h7VvhjjDmSJAryj86PeVEjAW9KnFjxW5o7odcDrAGN5GpYwXhSD bPPyAbLDAQmi8pAVHuU0vWskzUxg5c+iWi30qhbnlUfWAA2RDLDBe70ZVYmRzJLc3xvV X2gg== X-Gm-Message-State: AOAM531UnLUqM9aWPEeh0laIZu5dnoCmxQeCSW90tBWgKyU3FCeEWI0D e/Aa4WHp94IknUqSPuhgGDw/iqzWhA== X-Received: by 2002:a05:6a00:14cb:b0:50a:7e08:e1fc with SMTP id w11-20020a056a0014cb00b0050a7e08e1fcmr14317925pfu.12.1650463577110; Wed, 20 Apr 2022 07:06:17 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id br10-20020a056a00440a00b0050a777cd10csm10959178pfb.91.2022.04.20.07.06.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 07:06:16 -0700 (PDT) From: Pingfan Liu To: linux-kernel@vger.kernel.org Cc: Pingfan Liu , Thomas Gleixner , Marc Zyngier , Mark Rutland , Oleksandr Natalenko , Sebastian Andrzej Siewior , Peter Zijlstra , Valentin Schneider , Qais Yousef , Yuan ZhaoXiong , Randy Dunlap , Dongli Zhang , YueHaibing , Steven Price Subject: [PATCH 9/9] irq/irqdesc: rename sparse_irq_lock to bitmap_lock Date: Wed, 20 Apr 2022 22:05:21 +0800 Message-Id: <20220420140521.45361-10-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220420140521.45361-1-kernelfans@gmail.com> References: <20220420140521.45361-1-kernelfans@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 Now that sparse_irq_lock serves for both sparse and non-sparse purpose, it is better to rename it as bitmap_lock. Corresponding, rename irq_lock_sparse() as irq_lock_bitmap(). Signed-off-by: Pingfan Liu Cc: Thomas Gleixner Cc: Marc Zyngier Cc: Pingfan Liu Cc: Mark Rutland Cc: Oleksandr Natalenko Cc: Sebastian Andrzej Siewior Cc: Peter Zijlstra Cc: Valentin Schneider Cc: Qais Yousef Cc: Yuan ZhaoXiong Cc: Randy Dunlap Cc: Dongli Zhang Cc: YueHaibing Cc: Steven Price To: linux-kernel@vger.kernel.org --- include/linux/irqdesc.h | 4 ++-- kernel/cpu.c | 4 ++-- kernel/irq/cpuhotplug.c | 4 ++-- kernel/irq/debugfs.c | 4 ++-- kernel/irq/irqdesc.c | 26 +++++++++++++------------- kernel/irq/pm.c | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 6c01231fec00..8301653fc2b2 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h @@ -104,8 +104,8 @@ struct irq_desc { const char *name; } ____cacheline_internodealigned_in_smp; -extern void irq_lock_sparse(void); -extern void irq_unlock_sparse(void); +extern void irq_lock_bitmap(void); +extern void irq_unlock_bitmap(void); #ifndef CONFIG_SPARSE_IRQ extern struct irq_desc irq_desc[NR_IRQS]; diff --git a/kernel/cpu.c b/kernel/cpu.c index 94a6b512c26d..8874f0242893 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -601,11 +601,11 @@ static int bringup_cpu(unsigned int cpu) * setup the vector space for the cpu which comes online. * Prevent irq alloc/free across the bringup. */ - irq_lock_sparse(); + irq_lock_bitmap(); /* Arch-specific enabling code. */ ret = __cpu_up(cpu, idle); - irq_unlock_sparse(); + irq_unlock_bitmap(); if (ret) return ret; return bringup_wait_for_ap(cpu); diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index 1ed2b1739363..84547b5781be 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -220,14 +220,14 @@ int irq_affinity_online_cpu(unsigned int cpu) struct irq_desc *desc; unsigned int irq; - irq_lock_sparse(); + irq_lock_bitmap(); for_each_active_irq(irq) { desc = irq_to_desc(irq); raw_spin_lock_irq(&desc->lock); irq_restore_affinity_of_irq(desc, cpu); raw_spin_unlock_irq(&desc->lock); } - irq_unlock_sparse(); + irq_unlock_bitmap(); return 0; } diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c index 2b43f5f5033d..af4bd2ca2372 100644 --- a/kernel/irq/debugfs.c +++ b/kernel/irq/debugfs.c @@ -251,10 +251,10 @@ static int __init irq_debugfs_init(void) irq_dir = debugfs_create_dir("irqs", root_dir); - irq_lock_sparse(); + irq_lock_bitmap(); for_each_active_irq(irq) irq_add_debugfs_entry(irq, irq_to_desc(irq)); - irq_unlock_sparse(); + irq_unlock_bitmap(); return 0; } diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index a5cefd7c9ef7..acd80cb8a511 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -130,7 +130,7 @@ static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node, int nr_irqs = NR_IRQS; EXPORT_SYMBOL_GPL(nr_irqs); -static DEFINE_MUTEX(sparse_irq_lock); +static DEFINE_MUTEX(bitmap_lock); static DECLARE_BITMAP(allocated_irqs, IRQ_BITMAP_BITS); #ifdef CONFIG_SPARSE_IRQ @@ -318,12 +318,12 @@ static int __init irq_sysfs_init(void) } /* Prevent concurrent irq alloc/free */ - irq_lock_sparse(); + irq_lock_bitmap(); /* Add the already allocated interrupts */ for_each_irq_desc(irq, desc) irq_sysfs_add(irq, desc); - irq_unlock_sparse(); + irq_unlock_bitmap(); return 0; } @@ -607,9 +607,9 @@ static int irq_expand_nr_irqs(unsigned int nr) void irq_mark_irq(unsigned int irq) { - mutex_lock(&sparse_irq_lock); + mutex_lock(&bitmap_lock); bitmap_set(allocated_irqs, irq, 1); - mutex_unlock(&sparse_irq_lock); + mutex_unlock(&bitmap_lock); } #ifdef CONFIG_GENERIC_IRQ_LEGACY @@ -711,14 +711,14 @@ int generic_handle_domain_nmi(struct irq_domain *domain, unsigned int hwirq) } #endif -void irq_lock_sparse(void) +void irq_lock_bitmap(void) { - mutex_lock(&sparse_irq_lock); + mutex_lock(&bitmap_lock); } -void irq_unlock_sparse(void) +void irq_unlock_bitmap(void) { - mutex_unlock(&sparse_irq_lock); + mutex_unlock(&bitmap_lock); } /* Dynamic interrupt handling */ @@ -735,12 +735,12 @@ void irq_free_descs(unsigned int from, unsigned int cnt) if (from >= nr_irqs || (from + cnt) > nr_irqs) return; - mutex_lock(&sparse_irq_lock); + mutex_lock(&bitmap_lock); for (i = 0; i < cnt; i++) free_desc(from + i); bitmap_clear(allocated_irqs, from, cnt); - mutex_unlock(&sparse_irq_lock); + mutex_unlock(&bitmap_lock); } EXPORT_SYMBOL_GPL(irq_free_descs); @@ -779,7 +779,7 @@ __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, from = arch_dynirq_lower_bound(from); } - mutex_lock(&sparse_irq_lock); + mutex_lock(&bitmap_lock); start = bitmap_find_next_zero_area(allocated_irqs, IRQ_BITMAP_BITS, from, cnt, 0); @@ -794,7 +794,7 @@ __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, } ret = alloc_descs(start, cnt, node, affinity, owner); unlock: - mutex_unlock(&sparse_irq_lock); + mutex_unlock(&bitmap_lock); return ret; } EXPORT_SYMBOL_GPL(__irq_alloc_descs); diff --git a/kernel/irq/pm.c b/kernel/irq/pm.c index 4b67a4c7de3c..9b81a738d84f 100644 --- a/kernel/irq/pm.c +++ b/kernel/irq/pm.c @@ -133,7 +133,7 @@ void suspend_device_irqs(void) struct irq_desc *desc; int irq; - irq_lock_sparse(); + irq_lock_bitmap(); for_each_irq_desc(irq, desc) { unsigned long flags; bool sync; @@ -147,7 +147,7 @@ void suspend_device_irqs(void) if (sync) synchronize_irq(irq); } - irq_unlock_sparse(); + irq_unlock_bitmap(); } EXPORT_SYMBOL_GPL(suspend_device_irqs); -- 2.31.1