From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 58081F47CC9 for ; Thu, 5 Mar 2026 20:12:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C036A10E8AE; Thu, 5 Mar 2026 20:12:34 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="LTvd9k5g"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4069B10E8AE for ; Thu, 5 Mar 2026 20:12:33 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 45B4760053; Thu, 5 Mar 2026 20:12:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FE2FC116C6; Thu, 5 Mar 2026 20:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772741552; bh=hbIbkllAiEN/fkhFtcDGuL0eZPTE8FI1rQITQKYrNMM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LTvd9k5gb4QD6iUdWeDhfx0tGr1FH6uinyHepfoDFhCaSmdWQKPj9v0vjfhqLoBSQ Yn3NuiHYYp8tce/aT0f0ZmW6l1N6Jnm8m/VwmprfA5Oq8w/1/HGjBb8OPUv6e2KuKx VHReeF6+zdP4zJ4GOw+kSe/bICrHMPiFI19Kgp2a4VsTLkqBLkkgUVDw9i/Nr917jc FUosSFPSUK18chpuQ/nv28BycJzu3251vOuiJ1OYLrmMP1G/B6k1cQm0jiMgKBscPF Z4hH95r7JNArvYzHp9JThUSMs1XBiIVIYqbhfVhGQ3gnxG4sMr5RgBi65QruPjltTF zZbUWYRH2HAlw== Date: Thu, 5 Mar 2026 13:12:27 -0700 From: Nathan Chancellor To: Thomas Zimmermann Cc: gregkh@linuxfoundation.org, deller@gmx.de, sam@ravnborg.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 09/13] lib/fonts: Compare font data for equality with font_data_is_equal() Message-ID: <20260305201227.GA2200688@ax162> References: <20260302141255.518657-1-tzimmermann@suse.de> <20260302141255.518657-10-tzimmermann@suse.de> <20260305002347.GA4102761@ax162> <4acb921b-6bce-4bbf-a607-cc3e991dfc3a@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4acb921b-6bce-4bbf-a607-cc3e991dfc3a@suse.de> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Mar 05, 2026 at 10:31:13AM +0100, Thomas Zimmermann wrote: > Thanks for testing. The attached patch fixes the problem for me. Could you > please test? Yeah, that appears to work for me as well. Tested-by: Nathan Chancellor # build It seems like the asm/sections.h include can be dropped as well, since that was only included for is_kernel_rodata() AFAICT. > From 8dc48d2e676d1437584794f4df3dd20d08878655 Mon Sep 17 00:00:00 2001 > From: Thomas Zimmermann > Date: Thu, 5 Mar 2026 09:28:28 +0100 > Subject: [PATCH] test for internal fonts by refcount > > Internal font data is 'static const'. Hence test against the refcount > being zero. > --- > lib/fonts/fonts.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/lib/fonts/fonts.c b/lib/fonts/fonts.c > index 198aae869be2..b73d74b977ec 100644 > --- a/lib/fonts/fonts.c > +++ b/lib/fonts/fonts.c > @@ -45,14 +45,11 @@ static struct font_data *to_font_data_struct(font_data_t *fd) > > static bool font_data_is_internal(font_data_t *fd) > { > - return is_kernel_rodata((unsigned long)fd); > + return !REFCOUNT(fd); /* internal fonts have no reference counting */ > } > > static void font_data_free(font_data_t *fd) > { > - if (WARN_ON(font_data_is_internal(fd))) > - return; > - > kfree(to_font_data_struct(fd)); > } > > -- > 2.53.0 >