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 D31ADC433FE for ; Mon, 17 Oct 2022 19:00:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229905AbiJQTAi (ORCPT ); Mon, 17 Oct 2022 15:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbiJQTAe (ORCPT ); Mon, 17 Oct 2022 15:00:34 -0400 Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E893DEC6 for ; Mon, 17 Oct 2022 12:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=In-Reply-To:Content-Type:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=KaiF/SCfWzsRvXRBubrvLDOWGhfVrO/hXf7iRdDzGmk=; b=sHtai yqAEg9DkUpwrXBnspJ5VZMuZQYaZ85XTaLkxgnHhfTQX2I30OjhPcYuA3AuXZDtMwnIFhYyQAXt2N 18wzcdV8ZRPLAxg+4proMrSifd0wnRENgY5rwQnZ1qTqv0RJxf6Br/K3HPIShZkClZU6+xHRtsTht bNCdWtd6sf2ipr6EFhyxr0e8wN4ruwhobn7jZPeUA/pNszAz1JqpGrGd6HQktfLpmFMLBq74H2+gu eOstzi+9GjOYkMAdpaNHU1XeExVa9bHTQQJa4zmcBnMPrc0KBqiQR1NYU+iIl+wqnl9dcB7fFzRC9 iaHWgHFF4q11A/ryHRFmhlWnHesrg==; Received: from [81.174.171.191] (helo=donbot) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1okVLZ-0006Sk-25; Mon, 17 Oct 2022 20:00:22 +0100 Date: Mon, 17 Oct 2022 20:00:21 +0100 From: John Keeping To: Johan Jonker , Thomas Zimmermann Cc: Heiko Stuebner , dri-devel@lists.freedesktop.org, Sandy Huang , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [BUG] [PATCH] drm/rockchip: use generic fbdev setup Message-ID: References: <20211029115014.264084-1-john@metanate.com> <2220890.jZfb76A358@phil> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Authenticated: YES Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 17, 2022 at 08:30:23PM +0200, Johan Jonker wrote: > > > On 10/17/22 13:29, Heiko Stuebner wrote: > > Am Montag, 17. Oktober 2022, 12:05:16 CEST schrieb John Keeping: > >> Hi Johan, > >> > >> On Mon, Oct 17, 2022 at 10:11:32AM +0200, Johan Jonker wrote: > >>> Your patch contribution causes a kernel panic on MK808 with Rockchip rk3066a SoC. > >>> Would you like to contribute to fix this issue? > >>> The assumtion that drm_fbdev_generic_setup() does what rockchip_drm_fbdev_init did is not true! > >>> A revert makes it work again. > >> > > >> It looks like there are 3 different ways to end up with -ENOMEM here, > >> can you track down whether you're hitting one of the cases in > >> rockchip_gem_prime_vmap() or if it's the iosys_map_is_null case in > >> drm_gem_vmap()? > > It looks like it comes from rockchip_gem_prime_vmap() second return (2). > > > if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING) { > > //////////////// > > printk("FBDEV rockchip_gem_prime_vmap 2"); > > //////////////// > return -ENOMEM; > } Ah-ha, Heiko was right that this is because the no-iommu path is broken as a result of switching to the generic fbdev code. This patch should fix it, but I wonder if Thomas has any ideas about a better way to handle this since it feels a bit hacky to special-case the fb_helper inside the GEM code: -- >8 -- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 614e97aaac80..da8a69953706 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -364,9 +364,12 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, { struct rockchip_gem_object *rk_obj; struct drm_gem_object *obj; + bool is_framebuffer; int ret; - rk_obj = rockchip_gem_create_object(drm, size, false); + is_framebuffer = drm->fb_helper && file_priv == drm->fb_helper->client.file; + + rk_obj = rockchip_gem_create_object(drm, size, is_framebuffer); if (IS_ERR(rk_obj)) return ERR_CAST(rk_obj); -- 8< -- 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 A333AC433FE for ; Mon, 17 Oct 2022 19:00:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 837FF10E032; Mon, 17 Oct 2022 19:00:34 +0000 (UTC) Received: from metanate.com (unknown [IPv6:2001:8b0:1628:5005::111]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5975A10E032 for ; Mon, 17 Oct 2022 19:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=In-Reply-To:Content-Type:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=KaiF/SCfWzsRvXRBubrvLDOWGhfVrO/hXf7iRdDzGmk=; b=sHtai yqAEg9DkUpwrXBnspJ5VZMuZQYaZ85XTaLkxgnHhfTQX2I30OjhPcYuA3AuXZDtMwnIFhYyQAXt2N 18wzcdV8ZRPLAxg+4proMrSifd0wnRENgY5rwQnZ1qTqv0RJxf6Br/K3HPIShZkClZU6+xHRtsTht bNCdWtd6sf2ipr6EFhyxr0e8wN4ruwhobn7jZPeUA/pNszAz1JqpGrGd6HQktfLpmFMLBq74H2+gu eOstzi+9GjOYkMAdpaNHU1XeExVa9bHTQQJa4zmcBnMPrc0KBqiQR1NYU+iIl+wqnl9dcB7fFzRC9 iaHWgHFF4q11A/ryHRFmhlWnHesrg==; Received: from [81.174.171.191] (helo=donbot) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1okVLZ-0006Sk-25; Mon, 17 Oct 2022 20:00:22 +0100 Date: Mon, 17 Oct 2022 20:00:21 +0100 From: John Keeping To: Johan Jonker , Thomas Zimmermann Subject: Re: [BUG] [PATCH] drm/rockchip: use generic fbdev setup Message-ID: References: <20211029115014.264084-1-john@metanate.com> <2220890.jZfb76A358@phil> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Authenticated: YES 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: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sandy Huang , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Oct 17, 2022 at 08:30:23PM +0200, Johan Jonker wrote: > > > On 10/17/22 13:29, Heiko Stuebner wrote: > > Am Montag, 17. Oktober 2022, 12:05:16 CEST schrieb John Keeping: > >> Hi Johan, > >> > >> On Mon, Oct 17, 2022 at 10:11:32AM +0200, Johan Jonker wrote: > >>> Your patch contribution causes a kernel panic on MK808 with Rockchip rk3066a SoC. > >>> Would you like to contribute to fix this issue? > >>> The assumtion that drm_fbdev_generic_setup() does what rockchip_drm_fbdev_init did is not true! > >>> A revert makes it work again. > >> > > >> It looks like there are 3 different ways to end up with -ENOMEM here, > >> can you track down whether you're hitting one of the cases in > >> rockchip_gem_prime_vmap() or if it's the iosys_map_is_null case in > >> drm_gem_vmap()? > > It looks like it comes from rockchip_gem_prime_vmap() second return (2). > > > if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING) { > > //////////////// > > printk("FBDEV rockchip_gem_prime_vmap 2"); > > //////////////// > return -ENOMEM; > } Ah-ha, Heiko was right that this is because the no-iommu path is broken as a result of switching to the generic fbdev code. This patch should fix it, but I wonder if Thomas has any ideas about a better way to handle this since it feels a bit hacky to special-case the fb_helper inside the GEM code: -- >8 -- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 614e97aaac80..da8a69953706 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -364,9 +364,12 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, { struct rockchip_gem_object *rk_obj; struct drm_gem_object *obj; + bool is_framebuffer; int ret; - rk_obj = rockchip_gem_create_object(drm, size, false); + is_framebuffer = drm->fb_helper && file_priv == drm->fb_helper->client.file; + + rk_obj = rockchip_gem_create_object(drm, size, is_framebuffer); if (IS_ERR(rk_obj)) return ERR_CAST(rk_obj); -- 8< -- 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 2A3AAC4332F for ; Mon, 17 Oct 2022 19:00:59 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+rTKjpXjNz/F0oBWOfnyVYbQXF0ngjSYsoQXt+nLVBM=; b=vKf/K1hPKJfCHC PN2AJ11SlOeQ6ub+iypN5IQ5bmq8Q7m1vr4ZXVEkFQ4k4wgXurKH21VP/2vgPAomcUvaTSvkhJT70 /P/iGkoa7Yf+JcsdXHnVmTOmLLKyuKgjgw+cn/0MOaoBKfF/3yBQH81hLP4QJac5ZFv1cgv7RJvJC bXrn+Xpb+gXFc/Gexex4T4CZORRVx/gR9c8DKdz0BuLUXMCUNiAMAK9spSxuOQlPcyURrGZDyXFun 4VnApG3UVgQPMxll6/Zkod0uMo78QM8eprp0OA8zH4Ld8s0YH0ytTJSwaKy9I2jllrIXpwHgSZETQ 4TIdDYqNXQm3RCgjg1xA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okVM0-00ENwg-2m; Mon, 17 Oct 2022 19:00:48 +0000 Received: from [2001:8b0:1628:5005::111] (helo=metanate.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okVLo-00ENq3-ID; Mon, 17 Oct 2022 19:00:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=In-Reply-To:Content-Type:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=KaiF/SCfWzsRvXRBubrvLDOWGhfVrO/hXf7iRdDzGmk=; b=sHtai yqAEg9DkUpwrXBnspJ5VZMuZQYaZ85XTaLkxgnHhfTQX2I30OjhPcYuA3AuXZDtMwnIFhYyQAXt2N 18wzcdV8ZRPLAxg+4proMrSifd0wnRENgY5rwQnZ1qTqv0RJxf6Br/K3HPIShZkClZU6+xHRtsTht bNCdWtd6sf2ipr6EFhyxr0e8wN4ruwhobn7jZPeUA/pNszAz1JqpGrGd6HQktfLpmFMLBq74H2+gu eOstzi+9GjOYkMAdpaNHU1XeExVa9bHTQQJa4zmcBnMPrc0KBqiQR1NYU+iIl+wqnl9dcB7fFzRC9 iaHWgHFF4q11A/ryHRFmhlWnHesrg==; Received: from [81.174.171.191] (helo=donbot) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1okVLZ-0006Sk-25; Mon, 17 Oct 2022 20:00:22 +0100 Date: Mon, 17 Oct 2022 20:00:21 +0100 From: John Keeping To: Johan Jonker , Thomas Zimmermann Cc: Heiko Stuebner , dri-devel@lists.freedesktop.org, Sandy Huang , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [BUG] [PATCH] drm/rockchip: use generic fbdev setup Message-ID: References: <20211029115014.264084-1-john@metanate.com> <2220890.jZfb76A358@phil> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Authenticated: YES X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221017_120036_620514_64541089 X-CRM114-Status: GOOD ( 20.02 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On Mon, Oct 17, 2022 at 08:30:23PM +0200, Johan Jonker wrote: > > > On 10/17/22 13:29, Heiko Stuebner wrote: > > Am Montag, 17. Oktober 2022, 12:05:16 CEST schrieb John Keeping: > >> Hi Johan, > >> > >> On Mon, Oct 17, 2022 at 10:11:32AM +0200, Johan Jonker wrote: > >>> Your patch contribution causes a kernel panic on MK808 with Rockchip rk3066a SoC. > >>> Would you like to contribute to fix this issue? > >>> The assumtion that drm_fbdev_generic_setup() does what rockchip_drm_fbdev_init did is not true! > >>> A revert makes it work again. > >> > > >> It looks like there are 3 different ways to end up with -ENOMEM here, > >> can you track down whether you're hitting one of the cases in > >> rockchip_gem_prime_vmap() or if it's the iosys_map_is_null case in > >> drm_gem_vmap()? > > It looks like it comes from rockchip_gem_prime_vmap() second return (2). > > > if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING) { > > //////////////// > > printk("FBDEV rockchip_gem_prime_vmap 2"); > > //////////////// > return -ENOMEM; > } Ah-ha, Heiko was right that this is because the no-iommu path is broken as a result of switching to the generic fbdev code. This patch should fix it, but I wonder if Thomas has any ideas about a better way to handle this since it feels a bit hacky to special-case the fb_helper inside the GEM code: -- >8 -- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 614e97aaac80..da8a69953706 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -364,9 +364,12 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, { struct rockchip_gem_object *rk_obj; struct drm_gem_object *obj; + bool is_framebuffer; int ret; - rk_obj = rockchip_gem_create_object(drm, size, false); + is_framebuffer = drm->fb_helper && file_priv == drm->fb_helper->client.file; + + rk_obj = rockchip_gem_create_object(drm, size, is_framebuffer); if (IS_ERR(rk_obj)) return ERR_CAST(rk_obj); -- 8< -- _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip 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 76D01C4332F for ; Mon, 17 Oct 2022 19:01:44 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=atbustvib77D2/in0hWK0/sTgkh5gOzDIf4ZWxb7xr8=; b=SKhJemzWWRyZ8p f4N3xaG8HGIz+al1JrGK0ZcLFMkOiipQ4YBNoZAWfWULtvaXjJ3mIkEw9GP/W13heGRFaEs6BkpSv B7FGjgTastkTebbXA1aeQw5U4gIGqGgneDAXVR1VFTvnNbNd8XWPA3h1rHPal6rpelLIHLKm7cVC4 A6pRPp9Z/7Q7w1RAb/+XkKNq+PoweZR1+mudeROr1EX5Qp7Ap+Mhy1ZhAbLxDugBtws7CS02DY7hc AuyeYhRkLG24rs53EfumcmOWs7zcpcDtU+I2D+eVuHAbQMHQQ/38WCUMPfi3b4Umm6IDAjiEH+Mwx +mAB58Jm2WpLW9MM4yYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okVLq-00ENst-VQ; Mon, 17 Oct 2022 19:00:39 +0000 Received: from [2001:8b0:1628:5005::111] (helo=metanate.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okVLo-00ENq3-ID; Mon, 17 Oct 2022 19:00:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metanate.com; s=stronger; h=In-Reply-To:Content-Type:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=KaiF/SCfWzsRvXRBubrvLDOWGhfVrO/hXf7iRdDzGmk=; b=sHtai yqAEg9DkUpwrXBnspJ5VZMuZQYaZ85XTaLkxgnHhfTQX2I30OjhPcYuA3AuXZDtMwnIFhYyQAXt2N 18wzcdV8ZRPLAxg+4proMrSifd0wnRENgY5rwQnZ1qTqv0RJxf6Br/K3HPIShZkClZU6+xHRtsTht bNCdWtd6sf2ipr6EFhyxr0e8wN4ruwhobn7jZPeUA/pNszAz1JqpGrGd6HQktfLpmFMLBq74H2+gu eOstzi+9GjOYkMAdpaNHU1XeExVa9bHTQQJa4zmcBnMPrc0KBqiQR1NYU+iIl+wqnl9dcB7fFzRC9 iaHWgHFF4q11A/ryHRFmhlWnHesrg==; Received: from [81.174.171.191] (helo=donbot) by email.metanate.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1okVLZ-0006Sk-25; Mon, 17 Oct 2022 20:00:22 +0100 Date: Mon, 17 Oct 2022 20:00:21 +0100 From: John Keeping To: Johan Jonker , Thomas Zimmermann Cc: Heiko Stuebner , dri-devel@lists.freedesktop.org, Sandy Huang , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [BUG] [PATCH] drm/rockchip: use generic fbdev setup Message-ID: References: <20211029115014.264084-1-john@metanate.com> <2220890.jZfb76A358@phil> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Authenticated: YES X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221017_120036_620514_64541089 X-CRM114-Status: GOOD ( 20.02 ) 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 On Mon, Oct 17, 2022 at 08:30:23PM +0200, Johan Jonker wrote: > > > On 10/17/22 13:29, Heiko Stuebner wrote: > > Am Montag, 17. Oktober 2022, 12:05:16 CEST schrieb John Keeping: > >> Hi Johan, > >> > >> On Mon, Oct 17, 2022 at 10:11:32AM +0200, Johan Jonker wrote: > >>> Your patch contribution causes a kernel panic on MK808 with Rockchip rk3066a SoC. > >>> Would you like to contribute to fix this issue? > >>> The assumtion that drm_fbdev_generic_setup() does what rockchip_drm_fbdev_init did is not true! > >>> A revert makes it work again. > >> > > >> It looks like there are 3 different ways to end up with -ENOMEM here, > >> can you track down whether you're hitting one of the cases in > >> rockchip_gem_prime_vmap() or if it's the iosys_map_is_null case in > >> drm_gem_vmap()? > > It looks like it comes from rockchip_gem_prime_vmap() second return (2). > > > if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING) { > > //////////////// > > printk("FBDEV rockchip_gem_prime_vmap 2"); > > //////////////// > return -ENOMEM; > } Ah-ha, Heiko was right that this is because the no-iommu path is broken as a result of switching to the generic fbdev code. This patch should fix it, but I wonder if Thomas has any ideas about a better way to handle this since it feels a bit hacky to special-case the fb_helper inside the GEM code: -- >8 -- diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 614e97aaac80..da8a69953706 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -364,9 +364,12 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, { struct rockchip_gem_object *rk_obj; struct drm_gem_object *obj; + bool is_framebuffer; int ret; - rk_obj = rockchip_gem_create_object(drm, size, false); + is_framebuffer = drm->fb_helper && file_priv == drm->fb_helper->client.file; + + rk_obj = rockchip_gem_create_object(drm, size, is_framebuffer); if (IS_ERR(rk_obj)) return ERR_CAST(rk_obj); -- 8< -- _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel