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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3E7DC433EF for ; Mon, 18 Oct 2021 00:46:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6022660231 for ; Mon, 18 Oct 2021 00:46:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6022660231 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcGnH-0007Sp-4p for qemu-devel@archiver.kernel.org; Sun, 17 Oct 2021 20:46:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mcGlQ-0006WH-Rp; Sun, 17 Oct 2021 20:44:28 -0400 Received: from gate.crashing.org ([63.228.1.57]:34859) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mcGlO-00046c-Ij; Sun, 17 Oct 2021 20:44:28 -0400 Received: from ip6-localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 19I0f9q9024702; Sun, 17 Oct 2021 19:41:10 -0500 Message-ID: <4bab811367b2c1e813061d6f1048bbf9b4a2a606.camel@kernel.crashing.org> Subject: Re: [PATCH 1/2] hw/misc/bcm2835_property: Fix framebuffer with recent RPi kernels From: Benjamin Herrenschmidt To: Philippe =?ISO-8859-1?Q?Mathieu-Daud=E9?= , qemu-devel@nongnu.org, Alex =?ISO-8859-1?Q?Benn=E9e?= Date: Mon, 18 Oct 2021 11:41:09 +1100 In-Reply-To: <0615f4a3-fba0-bb59-2405-4e1a080f8166@amsat.org> References: <5283e2811498034cc2de77f10eb16b9cd67a0698.camel@kernel.crashing.org> <0615f4a3-fba0-bb59-2405-4e1a080f8166@amsat.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=63.228.1.57; envelope-from=benh@kernel.crashing.org; helo=gate.crashing.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Sun, 2021-10-17 at 17:08 +0200, Philippe Mathieu-Daudé wrote: > Hi Benjamin, > > On 10/17/21 09:48, Benjamin Herrenschmidt wrote: > > The framebuffer driver fails to initialize with recent Raspberry Pi > > kernels, such as the ones shipped in the current RaspiOS images > > (with the out of tree bcm2708_fb.c driver) > > Which particular version? The one I dug out of 2021-05-07-raspios-buster-arm64-lite.img (note that this then fails to boot some time after the fb is setup, even after the fix, in the vchip driver init (before serial is up even). That said, the same fb problem happens with 5.10.60-v8+ from raspbian. I'm not sure your fix will work on these, see below: > + case 0x00040013: /* Get number of displays */ > + stl_le_phys(&s->dma_as, value + 12, 0 /* old fw: unique display */); > + resplen = 4; > + break; > This should have been equivalen to not having the property. However, the failure path in the driver looks like this (note the mismatch between the comment and the code.. this is rpi 5.10.73 from the rpi repo : ret = rpi_firmware_property(fw, RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS, &num_displays, sizeof(u32)); /* If we fail to get the number of displays, or it returns 0, then * assume old firmware that doesn't have the mailbox call, so just * set one display */ if (ret || num_displays == 0) { dev_err(&dev->dev, "Unable to determine number of FBs. Disabling driver.\n"); return -ENOENT; } else { fbdev->firmware_supports_multifb = 1; } So it appears that the intention at some stage was to set only one display but the code as written will fail to initialize the drive if the properly is absent *or* if it returns 0. I've just checked the rpi-5.15.y branch and it's the same. Cheers, Ben.