Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp856238imw; Fri, 8 Jul 2022 13:05:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tFUVCgb5JvhCqG8iYSdq1Pij9yCRUOc8EnU499NstwXPwGg9cCpORriTC0bkORr+tDJQft X-Received: by 2002:a17:907:280a:b0:72a:fb8b:2942 with SMTP id eb10-20020a170907280a00b0072afb8b2942mr5339945ejc.119.1657310741636; Fri, 08 Jul 2022 13:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657310741; cv=none; d=google.com; s=arc-20160816; b=BDeBC2XM7myJt8p7Vexhg4BnTsAiGKbA1lzLuLPhGCfJ7xCFgxpNE+QePBddOb9RcD /NnfwopofJt9WZ+V8T7NI7QG6flY03FGEJLPiL83YHBoP0NbFD7GxYMvbimd6RpFmK5I MgzmeQbcIvzcn9qgDo83CjhgZRPqFQ+drow214b7GhZf/NcFMUA6Jhlhqv7rQSUvHIRf BTTXfHyQo79tv6jlCQJJPJYjiKa8ld2WpOOWr20LkBUA8A1czhmJlblqkZW0lyB1Fcnj voGVAaROdx6xlVCFzsE4WdkyTYoX3kF8vyCeK7doD0vZzfBipF1dyoMG1h4UJ/TjlLQs sXLw== 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; bh=tsq32Z7rEXP3WhU2rqoAIDZkcAsslIoBPyiJoHU7E8U=; b=VpSOuk14n2xa/fHD08ZyXiREcE9wJi5Pk2D7UPWMrtKr/PtZJ+uBWDiajqFyREGRRj 3oISBUgpr5sLQdu0ns45G0BHrZTAbFgf4g/SNrIuZuABk20NXrwCnizkNQwQazEHYCOH eDIqpzEjAqRh3qYW++XRLHg4VmYXltjmNW5O31DcirW6x3QXjtU3lbgyQGtVteHCQos0 qOQFVn50ogmY7P4QTOZpQpyhRYWI4bOTWs+LLY7Z5Y7o3OJ6UKDb5evtjSXyd/vYPb5K lCf5JduYyaHtY11dlhmqT60xYZsqSuo50xQrXYxinxtbJIbC6garfslJaIQaLU8ZI0uF cGdA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp19-20020a170906c15300b0072af8c9dc0dsi10722563ejc.394.2022.07.08.13.04.58; Fri, 08 Jul 2022 13:05:41 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239586AbiGHTYO (ORCPT + 99 others); Fri, 8 Jul 2022 15:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239571AbiGHTYC (ORCPT ); Fri, 8 Jul 2022 15:24:02 -0400 Received: from smtp.smtpout.orange.fr (smtp09.smtpout.orange.fr [80.12.242.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48773255B2 for ; Fri, 8 Jul 2022 12:24:02 -0700 (PDT) Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id 9ta1o86XNV0xU9ta1oRIrR; Fri, 08 Jul 2022 21:24:00 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Fri, 08 Jul 2022 21:24:00 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: Nishanth Menon , Tero Kristo , Santosh Shilimkar Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] firmware: ti_sci: Use the non-atomic bitmap API when applicable Date: Fri, 8 Jul 2022 21:23:56 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: <3ee11e9e83f7c1552d237f5c28f554319fcbbf1f.1657308216.git.christophe.jaillet@wanadoo.fr> References: <3ee11e9e83f7c1552d237f5c28f554319fcbbf1f.1657308216.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 Usages of the 'res_map' bitmap is protected with a spinlock, so non-atomic functions can be used to set/clear bits. Signed-off-by: Christophe JAILLET --- drivers/firmware/ti_sci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 522be2b75ce1..49677533f376 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -3096,7 +3096,7 @@ u16 ti_sci_get_free_resource(struct ti_sci_resource *res) free_bit = find_first_zero_bit(desc->res_map, res_count); if (free_bit != res_count) { - set_bit(free_bit, desc->res_map); + __set_bit(free_bit, desc->res_map); raw_spin_unlock_irqrestore(&res->lock, flags); if (desc->num && free_bit < desc->num) @@ -3127,10 +3127,10 @@ void ti_sci_release_resource(struct ti_sci_resource *res, u16 id) if (desc->num && desc->start <= id && (desc->start + desc->num) > id) - clear_bit(id - desc->start, desc->res_map); + __clear_bit(id - desc->start, desc->res_map); else if (desc->num_sec && desc->start_sec <= id && (desc->start_sec + desc->num_sec) > id) - clear_bit(id - desc->start_sec, desc->res_map); + __clear_bit(id - desc->start_sec, desc->res_map); } raw_spin_unlock_irqrestore(&res->lock, flags); } -- 2.34.1