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 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 B9BE1C61DA3 for ; Tue, 21 Feb 2023 12:56:57 +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:Message-ID:Date:References :In-Reply-To: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=jZTRijQUdnDgyHfq6LOixbs+NVho+ckVeAylF8on16M=; b=MfNyfsPtK1OsBu s2/EE1t1U2rNSoAbfcwMg4mGbGcOlWKUlsz8yKBHW4sVvn/7DjMSMh3Lv+y6Tk/L1wKGgDmGpyW00 7h8G3hhBGEv0VkbZgaDeZr84A+xzLl7VZ2SgE9rEb0mDxklxhe6jPejbci//aLA0KSS/rtEMDd5CH 58dvfi/bW1lmSv+35qTUvNpj0ejUrIHkEB66GRtsA9BAYbv/Y5XChe3sXjb6evjT3LnU08lpJ6dp1 D3O6WQAv9BHeqhShtmRjTWhKIqcs+GHdRcn6PoTI778pqY1ZyqyYbZOK19mVvmn9DMqihATNiF82s vr7I8fdKOucyDRwcq8OA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pUSBB-008Ccc-QE; Tue, 21 Feb 2023 12:55:35 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pURoN-0081mp-Ig for linux-arm-kernel@lists.infradead.org; Tue, 21 Feb 2023 12:32:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676982718; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kcBSztIBu8Elzf5YULsmxeT71u7vQPkAxFlgEGJG8QI=; b=GdcIZaZuDyG4wJ+KADEOfq9w4c3U8AVco7e8CsIcfHBkFzok74gumSKZ7NgqBmSztHHQVy t1ZDQ86L1A3CljHyND7l8sf8ocBqV7VB8e7o8eAK3+/4OiIobJ0ktnHgZ6U5z4uf7g9n4p LneSq4r8Hy82nEtWIk2cb+6qb8EyT/o= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-206-vohA6TXoNxun5YcGONL05w-1; Tue, 21 Feb 2023 07:31:56 -0500 X-MC-Unique: vohA6TXoNxun5YcGONL05w-1 Received: by mail-wr1-f70.google.com with SMTP id i11-20020a5d584b000000b002c5400f5c76so885791wrf.14 for ; Tue, 21 Feb 2023 04:31:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kcBSztIBu8Elzf5YULsmxeT71u7vQPkAxFlgEGJG8QI=; b=7tGjk9RNUdnQBRc2P8W9NPyVoErRlNsIQzG5KeQS/apuaboYiJ7T615+eF3U1cjwJU +rS0aBXbFcUZXBFwG28vGfWmocigIxPR38v7E9xhZ4MHu9SL/syMmRxkK1urfWImOlLI IgznjzgJg38vArqUaitnfJxTKb6Rp23San+K8GsnRZZq7U6q03lnS2i8KRes101QuqYw HXrQw+zk+M0dMF2YusVvn5yLVbiSg/wqeAfnOzRBJ1YBPyz8zJSLszo9qtz/Hqrbozt5 9bjDwA6RenoRxXfl069GHZx/20MVyjyUkw830b8H/usv9sYryOXeN+SBAekRpQkhloJl TnWQ== X-Gm-Message-State: AO0yUKWzv2EbBDJpFRWWfyegLhQ0M18STstCFvLB/sCa5uzF4wtbcsa2 A0Hzwr8WHomEkmT5MQrQDTfa45du6IuRO75g4cW6lJquKtl8O8X2wJq4CRXurF1LqOYSYsasiEs 8FTZD/DOmFzVz4tfICqVQVLJYGlTDH5IbL+U= X-Received: by 2002:a05:6000:1141:b0:2c5:a19e:6d16 with SMTP id d1-20020a056000114100b002c5a19e6d16mr2636599wrx.61.1676982715780; Tue, 21 Feb 2023 04:31:55 -0800 (PST) X-Google-Smtp-Source: AK7set//Tf+JISa2y2oGaFX5tzeBEqdv+t7SGO62K3gr9LhE0gq2UicpG1BcV6nfaQQIe6dvwwpV3Q== X-Received: by 2002:a05:6000:1141:b0:2c5:a19e:6d16 with SMTP id d1-20020a056000114100b002c5a19e6d16mr2636581wrx.61.1676982715510; Tue, 21 Feb 2023 04:31:55 -0800 (PST) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id j8-20020a5d6048000000b002c553e061fdsm6967238wrt.112.2023.02.21.04.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:31:55 -0800 (PST) From: Javier Martinez Canillas To: Thomas Zimmermann , airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH] drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini() In-Reply-To: <95ea4783-8eb4-63e5-767b-3b7feece955d@suse.de> References: <20230216140620.17699-1-tzimmermann@suse.de> <87y1orxqiz.fsf@minerva.mail-host-address-is-not-set> <95ea4783-8eb4-63e5-767b-3b7feece955d@suse.de> Date: Tue, 21 Feb 2023 13:31:54 +0100 Message-ID: <87ttzftd1h.fsf@minerva.mail-host-address-is-not-set> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230221_043159_807292_7084D184 X-CRM114-Status: GOOD ( 14.13 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Thomas Zimmermann writes: > Hi > > Am 21.02.23 um 11:27 schrieb Javier Martinez Canillas: >> Thomas Zimmermann writes: >> >>> Move drm_fb_helper_unprepare() from drm_fb_helper_fini() into the >>> calling fbdev implementation. Avoids a possible stale mutex with >>> generic fbdev code. >>> >>> As indicated by its name, drm_fb_helper_prepare() prepares struct >>> drm_fb_helper before setting up the fbdev support with a call to >>> drm_fb_helper_init(). In legacy fbdev emulation, this happens next >>> to each other. If successful, drm_fb_helper_fini() later tear down >>> the fbdev device and also unprepare via drm_fb_helper_unprepare(). >>> >>> Generic fbdev emulation prepares struct drm_fb_helper immediately >>> after allocating the instance. It only calls drm_fb_helper_init() >>> as part of processing a hotplug event. If the hotplug-handling fails, >>> it runs drm_fb_helper_fini(). This unprepares the fb-helper instance >>> and the next hotplug event runs on stale data. >>> >>> Solve this by moving drm_fb_helper_unprepare() from drm_fb_helper_fini() >>> into the fbdev implementations. Call it right before freeing the >>> fb-helper instance. >>> >>> Fixes: 4825797c36da ("drm/fb-helper: Introduce drm_fb_helper_unprepare()") >> >> I think this should be Fixes: 032116bbe152 ("drm/fbdev-generic: Minimize >> client unregistering") instead? Because commit 4825797c36da just added a >> wrapper function for mutex_destroy(&fb_helper->lock), but it was commit >> 032116bbe152 that made drm_fbdev_cleanup() to call that helper function. > > Good point. After looking through the recent fbdev commits, I'll use > commit 643231b28380 ("drm/fbdev-generic: Minimize hotplug error > handling") for the tag. This is the one that added the call to > drm_fb_helper_fini() to the client's hotplug handler. And _fini() > currently does the _unprepare(), when it shouldn't. > Ah, much better indeed. -- Best regards, Javier Martinez Canillas Core Platforms Red Hat _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel