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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 441E1C433FE for ; Tue, 19 Apr 2022 07:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241961AbiDSHZe (ORCPT ); Tue, 19 Apr 2022 03:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349296AbiDSHZd (ORCPT ); Tue, 19 Apr 2022 03:25:33 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 012B7326C4 for ; Tue, 19 Apr 2022 00:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650352970; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XE7bs+vMucrnxP7rX6KAEFBKjoWlCkL1ofuWPanz4ws=; b=ZfXzyeAnvfwwyYkLvMrJ7JOD9GjAkgaOVXpRax5WRS9j/d1Ew3KvwFzf3GGj2HC+SC9Eu1 6iuItCPQQT1mAN3Ww7iKXleobudxe6Nj7n8GRVquy0ACBInhFEinfCMhJhh/ny2HhPTIrm ISJwveWc6vKhAl0j0Y5AyACjp0X+R3o= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-567-EtT7qaa5OauYTgh55rP0VQ-1; Tue, 19 Apr 2022 03:22:27 -0400 X-MC-Unique: EtT7qaa5OauYTgh55rP0VQ-1 Received: by mail-wm1-f71.google.com with SMTP id y11-20020a7bc18b000000b0038eac019fc0so796009wmi.9 for ; Tue, 19 Apr 2022 00:22:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=XE7bs+vMucrnxP7rX6KAEFBKjoWlCkL1ofuWPanz4ws=; b=oO5EDPYITPUa6u3iJelSUrsIdPO5FUoPx7lIUwbFiqQD288Rig/mEbUn+M5FpyxJ+P 6dOqLlmMjW6QB/jZ+99jHxA7LGDLi3hzHd3N0bFjRURVSgivRyImzAws1fNGE1WhHcTz +3H0Xqt/2d0i1mTlq3gY9Bj4rNbWfZhvJ3DaqSY5ejkKux4F1+2elPH2b/6spuCWnHrW zsZcypUQfZCFM3u1daJr0xXoIWPwLleAufRJdfkwmsM4e385QqSs1YZKeFSKYJdeciEL os2sRdbU/fkQCDW2xnbR5p5Br1Bps+tvOezzXozZl/mWRS52Q98i5/ngvXGsb7CBxK3U ujAA== X-Gm-Message-State: AOAM533w54vzhZU0neq4Rwoshw7FybO58sHfGOPqSp/rGMBsGBXZsHjG 6x7u06BuAqzoBIlPCFUf/Df5+N1bBzK58qTFdXFBPFCAuSSLftm+KifIkfWQ/YAX6+5P/aYBtss zyQFsF//8jebu9xFtL6bMAw== X-Received: by 2002:a05:6000:1b08:b0:207:ad5b:83a0 with SMTP id f8-20020a0560001b0800b00207ad5b83a0mr10619558wrz.564.1650352946331; Tue, 19 Apr 2022 00:22:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPE0Lfb8036FFd0ol7Vvhr6xWQ3rGpwS+oyiFhkfgu+5MXMGjFNhcWkb9aY1gomEOacxFDLg== X-Received: by 2002:a05:6000:1b08:b0:207:ad5b:83a0 with SMTP id f8-20020a0560001b0800b00207ad5b83a0mr10619538wrz.564.1650352946065; Tue, 19 Apr 2022 00:22:26 -0700 (PDT) Received: from [192.168.1.129] ([92.176.231.205]) by smtp.gmail.com with ESMTPSA id o6-20020a05600c378600b0038eca3cdbb3sm15128816wmr.13.2022.04.19.00.22.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Apr 2022 00:22:25 -0700 (PDT) Message-ID: Date: Tue, 19 Apr 2022 09:22:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 2/2] fbdev: Remove hot-unplug workaround for framebuffers without device Content-Language: en-US To: Thomas Zimmermann , Daniel Vetter Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, frowand.list@gmail.com, deller@gmx.de, linuxppc-dev@lists.ozlabs.org, dri-devel@lists.freedesktop.org, robh+dt@kernel.org, paulus@samba.org, mpe@ellerman.id.au, sam@ravnborg.org, linux@roeck-us.net References: <20220413092454.1073-1-tzimmermann@suse.de> <20220413092454.1073-3-tzimmermann@suse.de> <2e183cc9-603d-f038-54aa-5601f11b0484@redhat.com> <9d4599d9-e094-e7dd-5b91-282c2679aae4@suse.de> From: Javier Martinez Canillas In-Reply-To: <9d4599d9-e094-e7dd-5b91-282c2679aae4@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hello Thomas, On 4/13/22 20:09, Thomas Zimmermann wrote: [snip] >>>> index bc6ed750e915..bdd00d381bbc 100644 >>>> --- a/drivers/video/fbdev/core/fbmem.c >>>> +++ b/drivers/video/fbdev/core/fbmem.c >>>> @@ -1579,14 +1579,7 @@ static void do_remove_conflicting_framebuffers(struct apertures_struct *a, >>>> * If it's not a platform device, at least print a warning. A >>>> * fix would add code to remove the device from the system. >>>> */ >>>> - if (!device) { >>>> - /* TODO: Represent each OF framebuffer as its own >>>> - * device in the device hierarchy. For now, offb >>>> - * doesn't have such a device, so unregister the >>>> - * framebuffer as before without warning. >>>> - */ >>>> - do_unregister_framebuffer(registered_fb[i]); >>> >>> Maybe we could still keep this for a couple of releases but with a big >>> warning that's not supported in case there are out-of-tree drivers out >>> there that still do this ? >>> >>> Or at least a warning if the do_unregister_framebuffer() call is removed. >> >> Yeah dying while holding console_lock isn't fun, and not having a WARN_ON >> + bail-out code pretty much forces bug reporters to do a bisect here to >> give us something more than "machine dies at boot with no messages". >> >> I'd just outright keep the WARN_ON here for 1-2 years even to really make >> sure we got all the bug reports, since often these older machines only >> update onto LTS releases. > > If that's what the consent is, I'll go with it. > > I'm just not sure if we talk about the same problem. offb didn't have a > platform device, so we recently added this workaround with 'if > (!device)'. All the other fbdev drivers have a platform device; and > anything else that could fail is out-of-tree. We don't really care about > those AFAIK. > Yes, agreed on the offb change but I'm not really sure if we don't care about out-of-tree modules. I mean, you are right in theory but I still feel that we are changing a core behavior without giving people time to sort out if needed. Since before commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices on forced removal") registered FBs didn't need to have a device, but now that will lead to a NULL pointer dereference in dev_is_platform(device). And that change only landed in v5.18-rc1, so it is fairly recent. I know that we follow https://www.kernel.org/doc/Documentation/process/stable-api-nonsense.rst but still my opinion is that having a warning for a couple of releases if registered_fb[i]->device is NULL, instead of just crashing would be a better way to handle this. > With offb converted, we could practically remove all of the checks here > and call platform_device_unregister() unconditionally. > Yes for mainline, but as mentioned I thought mostly about out-of-tree. If folks agree that we shouldn't care about these, I'm Ok with that as well. -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat