Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp311551ybm; Wed, 22 May 2019 03:40:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjK1H88hfq9e3D1G/edk3nsHZr6U+PKfJyQ1CYJe8/zFrChAZcNPKoritxCCa9e5bJnJPL X-Received: by 2002:a63:950d:: with SMTP id p13mr89701121pgd.269.1558521621561; Wed, 22 May 2019 03:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558521621; cv=none; d=google.com; s=arc-20160816; b=0KApqHQF48oh6XyAnT1FQV9kPO18Vd8GEczQSkF5KiOByvRXPV6JRluAWWZdMhVq91 agvSIku53hOGwmnntZQr4ervvuJGcdT++G9QGbLZctnCSSMmZ0Ln0mPXgYSKzEhfWlB1 izJ2EIZZ5APPuqmA/kF9oAiH7LaGG5b12wH1MCxapHNsrAn/ZyLPPFUXkCvFDX8yQ+29 pGCXJJiZlrh+cobRn0PvGBcjBN0RdzogbkrzSjqsCw1pZlv/bHZe9sgozfvCMwAWIPaz aQ7jxJwQR7zMVrHPzPJNTKCGKHGsJC2300ZduUqO+2jmCm6mHGyzYqIncKjE4z14NrLj MLDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=x6wg+K+WgL8DG2zwYLLZfjFG8NTa66iAHPjSVdCuEsY=; b=N+dj7IRrN2eolDNN2DdNR14yticZdWPNb8KIVb9y1/pKvOLC+XBIbhMwCvOxrpvxlX gUXNphMmtxGyx+MuJRXM4CO099qn2IqN2kFmbu3WgVAwJbMJOxhAsSNJ6qvtHkMyLAk0 vdwXYmj3eiJ07ryJyHU/gpYflwFkD0F5k2HzYt+2ITSoHBsq4mVU3g82qClg0VD1uL3f lvDp04i3aSklrb4Ku2Vln3KbbEsUraCCAhNai9MfWnOeM6/abLr7h28QkGajMyupbTDd obedYlf0VxMgn99n3lwmu9ZpM3M6x2hVwOO4uQDn4RZvKKw8iY2zfIZBje3VPDqiPoBt pS0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=CfYeCurN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61si24934918plq.398.2019.05.22.03.40.06; Wed, 22 May 2019 03:40:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=CfYeCurN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729431AbfEVKia (ORCPT + 99 others); Wed, 22 May 2019 06:38:30 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:35872 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729092AbfEVKia (ORCPT ); Wed, 22 May 2019 06:38:30 -0400 Received: by mail-oi1-f195.google.com with SMTP id y124so1218773oiy.3 for ; Wed, 22 May 2019 03:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=x6wg+K+WgL8DG2zwYLLZfjFG8NTa66iAHPjSVdCuEsY=; b=CfYeCurNCDn3hjO3u+qMUfNRL8mmvk/0/jcHv9r7SPKY4JNDX3NteV015dcJVd9TK8 SIW4fXoGb9TFfWFqeFvDoP/3nZX/90MMyKwi0UaTZ6KePlwPAzcuJCSRHMJzg54SCKkI y9ZLrtCLN4J1Zw1wVyMLAy9yHyGGEaNg8ZM5Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=x6wg+K+WgL8DG2zwYLLZfjFG8NTa66iAHPjSVdCuEsY=; b=fjbr22ctaRcMaTVLAnhXMybwqUhXRu6SiM8ByjMS1g5K/QTE3GukCAwZAWd/LhjEK/ TpLdXs4dwv58rhyy2VwQ8FhQPPcef30a+uSWhiafbx0B4DRsxqy9iYUn8eD3cWthqTz/ KJX4FaiRsWR9OvI4cgS8aK20sjlfvUR23DOWRSdalJqT/kzGvQGlp8nKBV5c7bU8/YJo hpywB22FAaENqAPQMlPhp/BFA+WYUDusZX51iMAqw7dkJzzfzcaQfqt42Vr/iFbHg10i eOds9VJYIAX1tcMCVrdxqUIXcrqdmWplMBV5jurDgHv1RHvGDNU88uhG9LAARNPhR/pp ak3g== X-Gm-Message-State: APjAAAWpB5zDGYApCHeYi0Lmgu36ptyTt3r6wfbg9/as4ZqyqWr0OtxF Uvo8iM3KVrC9Qi+MaN3qeZo+msHlwWKNaVKiGCKwCw== X-Received: by 2002:aca:e4c8:: with SMTP id b191mr6914932oih.110.1558521509592; Wed, 22 May 2019 03:38:29 -0700 (PDT) MIME-Version: 1.0 References: <20190520082216.26273-10-daniel.vetter@ffwll.ch> <20190521142304.9652-1-daniel.vetter@ffwll.ch> <6b9747cf-8845-0eb9-878e-f2953665fcec@samsung.com> In-Reply-To: <6b9747cf-8845-0eb9-878e-f2953665fcec@samsung.com> From: Daniel Vetter Date: Wed, 22 May 2019 12:38:18 +0200 Message-ID: Subject: Re: [PATCH] fbcon: Remove fbcon_has_exited To: Bartlomiej Zolnierkiewicz Cc: DRI Development , Intel Graphics Development , LKML , Daniel Vetter , Maarten Lankhorst , Hans de Goede , =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= , Yisheng Xie , Konstantin Khorenko , Prarit Bhargava , Kees Cook Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 22, 2019 at 12:04 PM Bartlomiej Zolnierkiewicz wrote: > > > Hi Daniel, > > On 5/21/19 4:23 PM, Daniel Vetter wrote: > > This is unused code since > > > > commit 6104c37094e729f3d4ce65797002112735d49cd1 > > Author: Daniel Vetter > > Date: Tue Aug 1 17:32:07 2017 +0200 > > > > fbcon: Make fbcon a built-time depency for fbdev > > > > when fbcon was made a compile-time static dependency of fbdev. We > > can't exit fbcon anymore without exiting fbdev first, which only works > > if all fbdev drivers have unloaded already. Hence this is all dead > > code. > > > > v2: I missed that fbcon_exit is also called from con_deinit stuff, and > > there fbcon_has_exited prevents double-cleanup. But we can fix that > > by properly resetting con2fb_map[] to all -1, which is used everywhere > > else to indicate "no fb_info allocate to this console". With that > > change the double-cleanup (which resulted in a module refcount underflo= w, > > among other things) is prevented. > > > > Aside: con2fb_map is a signed char, so don't register more than 128 fb_= info > > or hilarity will ensue. > > > > v3: CI showed me that I still didn't fully understand what's going on > > here. The leaked references in con2fb_map have been used upon > > rebinding the fb console in fbcon_init. It worked because fbdev > > unregistering still cleaned out con2fb_map, and reset it to info_idx. > > If the last fbdev driver unregistered, then it also reset info_idx, > > and unregistered the fbcon driver. > > > > Imo that's all a bit fragile, so let's keep the con2fb_map reset to > > -1, and in fbcon_init pick info_idx if we're starting fresh. That > > means unbinding and rebinding will cleanse the mapping, but why are > > you doing that if you want to retain the mapping, so should be fine. > > > > Also, I think info_idx =3D=3D -1 is impossible in fbcon_init - we > > unregister the fbcon in that case. So catch&warn about that. > > > > Signed-off-by: Daniel Vetter > > Cc: Maarten Lankhorst > > Cc: Bartlomiej Zolnierkiewicz > > Cc: Daniel Vetter > > Cc: Hans de Goede > > Cc: "Noralf Tr=C3=B8nnes" > > Cc: Yisheng Xie > > Cc: Konstantin Khorenko > > Cc: Prarit Bhargava > > Cc: Kees Cook > > --- > > drivers/video/fbdev/core/fbcon.c | 39 +++++--------------------------- > > 1 file changed, 6 insertions(+), 33 deletions(-) > This patch was #09/33 in your patch series, now it is independent change. > > Do you want me to apply it now or should I wait for the new version of > the whole series? It's an in-reply-to replacement for the totally broken one, so that patchwork picks things up correctly (and therefore our CI). I'm not sure how far that convention is used beyond dri-devel ... I did fix up all the issues pointed out thus far, but I haven't fully appeased our CI just yet. Once that's done I'll resend. Thanks, Daniel > [ I looked at all patches in the series and they look fine to me. > After outstanding issues are fixed I'll be happy to apply them all > to fbdev-for-next (I can create immutable branch if needed). ] > > Best regards, > -- > Bartlomiej Zolnierkiewicz > Samsung R&D Institute Poland > Samsung Electronics --=20 Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch