From patchwork Fri Jul 8 19:23:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12911806 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 173EFC433EF for ; Fri, 8 Jul 2022 19:25:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2EI01gnep3DzI9lJFD8fFN75Ajdvdlh55c6+leMB1sA=; b=rq7FD5K/U0JN2p kFPtp1emz5MezclFOQUZfeB0buL4zEqmY90QF6Qd7fJEmsRV5cmO77aZDz3DOnG0jtE596Z4Hcs0a fcCjFoBofCIhEuBqKyWv2bS4PMz1fENtW6/2g1/qI+3gnC57E2sJxVCB/5W8wzMqC06D1p5azki6B qPhAHohVkCEIqe+dj7mHrwDavaUrTfWmE5h+hBRvcQxVgzb9oiQLUSXvLqGb5wavw0GrH/BrOtF6G v355Qx78ryNnSB67EafRw7VygXIwib0nWPoNXD+Pr4Auz/0OI8QYrTi7bUOAQjBE6AGTcyX0Dm2Wj O1XCBAPhI+iAZbR0h1xQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9taG-005aPf-S4; Fri, 08 Jul 2022 19:24:12 +0000 Received: from smtp09.smtpout.orange.fr ([80.12.242.131] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9ta8-005aN7-1L for linux-arm-kernel@lists.infradead.org; Fri, 08 Jul 2022 19:24:05 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220708_122404_237260_1D79CC1C X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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); }