Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4872116rwi; Mon, 17 Oct 2022 11:57:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68PcLfP7uNLfhxdoU9UO5U+X6jFWv1IPGQsFZaT4ppau6UKAwkvPaQb+jbm352Of/Bpowi X-Received: by 2002:a17:902:f682:b0:185:45e8:2223 with SMTP id l2-20020a170902f68200b0018545e82223mr13167257plg.151.1666033061656; Mon, 17 Oct 2022 11:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666033061; cv=none; d=google.com; s=arc-20160816; b=tlUyftTPYTPN5EVvCj9gtx4kdMykGM4UtJoArMyg59eM3rjTRHBuyP/dKVU4px38Of dcWFlQoXJLsVVzDxK+kSauTEml3Vptr7Ry7KTGTPgNnNPqUH1ez0vEQ3zduOdCLiqhDa 73DYsSrRgX7J6IqKzs2TN8J6ChQNXjfeOrxhzhKvKOpEyhveHd8JYwCcT9cmuMndwrN6 Jb/7XcePdR1JxzR2QnKBLSBrAkeQH13bREbTBwSekxOap01RFXrDYqPpvMFzopeo2myk OcSGWTUgmu+hvNQoR+UzTnSGRocEaMpy4MEYMEF/wStOj61QPFa/cVyJSt1CWuW/gtAZ di1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1ygTaFM2xbm4f+3CnWyuW6YhAYiSOprMyGPvCYkz/T4=; b=VwUW+a4wpsrIG8KH9m3FhE8cHi6Ysj3wzlTzek/sBzCwq6Z4hupW2pW56VEa3Sdp1F ZTVZIFtIOdlz+t5qPS7VcH+hm25RRVJlHpwVQI3J4pfOujysFZJzR1Maq7bKejIwRPDH c4O8NNMVjd+bhEKMgc3EOsqMgmd55Q2mriNbPoFiMAsaYEMkaj7wG5+J+4l5+e5l/OJG 7clXkqMro61kmb5bxNOMmKrD3BNgXaXtcnby4N4TZ9skMY/jW9Kezt7/T7AGR6RUz5w/ 5YNmVNm3eDl0rgDoz0aoukKjSREYEwchPGTsAH7DuwcbR054vc/v2UCUg39yP4h5uRIX ZwQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bcwiVIzG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k12-20020a6555cc000000b0041cefab5b61si13906288pgs.719.2022.10.17.11.57.25; Mon, 17 Oct 2022 11:57:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bcwiVIzG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230500AbiJQSai (ORCPT + 99 others); Mon, 17 Oct 2022 14:30:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbiJQSaa (ORCPT ); Mon, 17 Oct 2022 14:30:30 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EAA96919F for ; Mon, 17 Oct 2022 11:30:27 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id q19so17285930edd.10 for ; Mon, 17 Oct 2022 11:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1ygTaFM2xbm4f+3CnWyuW6YhAYiSOprMyGPvCYkz/T4=; b=bcwiVIzGS1AnE11FxBrC4EJI4yYIXpkDDvkXNjOzLBOrdPpftEdG/bk1MmdY7yaumu bWJxNRX1dAceXkrG0vUNchvTHH0sYHv7SEZ2IxlUVbAYeo2h4h+5N80qnvb5Q52i+R7y NAdH8FgsQ1Diyv2AYEdi5cu0+xioeo6M/nsUCPx6UqIh0aoWwb5UVQBv57KG+7zZUQe+ wOSPUzlKQAcKw9VLG+DoxnJI3Z53He7V8zzEOJw+IHiTaDBp5yY6XmCAGHN6T6XyjSyz TDWPqnb03lh1ftWgeXwnMWw4NdDLDvfNABAVUJgtmgKFy5UbeiZHUpqrtmvikAe4o3Yt EQhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1ygTaFM2xbm4f+3CnWyuW6YhAYiSOprMyGPvCYkz/T4=; b=iXUg5Ibt3YUsoNm/TZa+3V1FR8aQcZ/7DASHy65c5FDTEaBFV6dW/cfGFDlqukNKlD GIN3zXRamI5465DjMZihbKI4U3UucEebIqwvd2hBZ+Az/W0syoiTRuocUxtlw0RRgqUn Uq+/MTiu3P5y1H/a4dpwDeB5PcPBzHCnDv4vjsNeH61bYirlU1COOD37PPm7LEQcoZ8W SfJxOHcHHHiRA1eUm3adZL79f8Km/81FO9+2mvi/4qf1k7oMKVIX52ScHjZV0ZxcOetU NroPdqaOAbjaI/ukGviqb6jxq30m6/K5jSiNq3/XD7Un8ZqPPFEALk6oz2N6LPvrVtZy xnKw== X-Gm-Message-State: ACrzQf1ZSI9ftQqQ4jUA/mhB2GcOsXElK7+Lcphb617zhUKWfDLb81t5 vYyhtR5U1AsmPm/G4IAXo0g= X-Received: by 2002:aa7:cd4f:0:b0:458:6077:c3ac with SMTP id v15-20020aa7cd4f000000b004586077c3acmr11616385edw.32.1666031424966; Mon, 17 Oct 2022 11:30:24 -0700 (PDT) Received: from [192.168.2.4] (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id b22-20020a170906d11600b0078d2d5b90f4sm6481422ejz.32.2022.10.17.11.30.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Oct 2022 11:30:24 -0700 (PDT) Message-ID: Date: Mon, 17 Oct 2022 20:30:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [BUG] [PATCH] drm/rockchip: use generic fbdev setup To: Heiko Stuebner , John Keeping Cc: 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 References: <20211029115014.264084-1-john@metanate.com> <2220890.jZfb76A358@phil> Content-Language: en-US From: Johan Jonker In-Reply-To: <2220890.jZfb76A358@phil> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). ==== int rockchip_gem_prime_vmap(struct drm_gem_object *obj, struct iosys_map *map) { struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj); if (rk_obj->pages) { void *vaddr = vmap(rk_obj->pages, rk_obj->num_pages, VM_MAP, pgprot_writecombine(PAGE_KERNEL)); if (!vaddr) { printk("FBDEV rockchip_gem_prime_vmap 1"); return -ENOMEM; } iosys_map_set_vaddr(map, vaddr); return 0; } if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING) { //////////////// printk("FBDEV rockchip_gem_prime_vmap 2"); //////////////// return -ENOMEM; } iosys_map_set_vaddr(map, rk_obj->kvaddr); return 0; } ==== [ 7.678392] [drm:drm_client_modeset_probe] connector 39 enabled? yes [ 7.678435] [drm:drm_client_modeset_probe] Not using firmware configuration [ 7.678465] [drm:drm_client_modeset_probe] looking for cmdline mode on connector 39 [ 7.678494] [drm:drm_client_modeset_probe] looking for preferred mode on connector 39 0 [ 7.678521] [drm:drm_client_modeset_probe] found mode 1920x1080 [ 7.678545] [drm:drm_client_modeset_probe] picking CRTCs for 1920x1080 config [ 7.678585] [drm:drm_client_modeset_probe] desired mode 1920x1080 set on crtc 35 (0,0) [ 7.801673] Console: switching to colour frame buffer device 240x67 [ 7.811047] FBDEV rockchip_gem_prime_vmap 2 [ 7.811071] ------------[ cut here ]------------ [ 7.811084] WARNING: CPU: 0 PID: 35 at drivers/gpu/drm/drm_fb_helper.c:471 drm_fb_helper_damage_work+0x138/0x3b4 [ 7.811198] rockchip-drm display-subsystem: Damage blitter failed: ret=-12 [ 7.811219] Modules linked in: [ 7.811244] CPU: 0 PID: 35 Comm: kworker/0:4 Not tainted 6.0.0-next-20221013+ #46 [ 7.811281] Hardware name: Rockchip (Device Tree) [ 7.811300] Workqueue: events drm_fb_helper_damage_work [ 7.811352] Backtrace: [ 7.811370] dump_backtrace from show_stack+0x20/0x24 [ 7.811431] r7:000001d7 r6:00000009 r5:c0b2bc60 r4:60000013 [ 7.811444] show_stack from dump_stack_lvl+0x48/0x54 [ 7.811512] dump_stack_lvl from dump_stack+0x18/0x1c [ 7.811580] r5:c0586064 r4:c0b6374c [ 7.811590] dump_stack from __warn+0xdc/0x154 [ 7.811677] __warn from warn_slowpath_fmt+0xa4/0xd8 [ 7.811740] r7:000001d7 r6:c0b6374c r5:c1004ec8 r4:c0b639e8 [ 7.811750] warn_slowpath_fmt from drm_fb_helper_damage_work+0x138/0x3b4 [ 7.811821] r9:ef7cf105 r8:c15dfc00 r7:fffffff4 r6:c200b490 r5:c1004ec8 r4:c200b494 [ 7.811833] drm_fb_helper_damage_work from process_one_work+0x230/0x518 [ 7.811912] r10:c110d140 r9:ef7cf105 r8:00000000 r7:ef7cf100 r6:ef7cbf00 r5:c200e300 [ 7.811927] r4:c200b494 [ 7.811936] process_one_work from worker_thread+0x54/0x554 [ 7.811991] r10:ef7cbf00 r9:00000008 r8:c1003d40 r7:ef7cbf1c r6:c200e318 r5:ef7cbf00 [ 7.812006] r4:c200e300 [ 7.812015] worker_thread from kthread+0xe8/0x104 [ 7.812100] r10:f0929e84 r9:c200da00 r8:c169aa80 r7:c200e300 r6:c01419e4 r5:00000000 [ 7.812114] r4:c200d780 [ 7.812124] kthread from ret_from_fork+0x14/0x2c [ 7.812178] Exception stack(0xf092dfb0 to 0xf092dff8) [ 7.812205] dfa0: 00000000 00000000 00000000 00000000 [ 7.812232] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 7.812255] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 7.812282] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c01491a8 [ 7.812299] r4:c200d780 r3:00000001 [ 7.812309] ---[ end trace 0000000000000000 ]--- [ 7.812336] FBDEV rockchip_gem_prime_vmap 2 [ 7.889795] FBDEV rockchip_gem_prime_vmap 2 [ 7.890418] FBDEV rockchip_gem_prime_vmap 2 [ 7.899447] FBDEV rockchip_gem_prime_vmap 2 [ 7.905252] FBDEV rockchip_gem_prime_vmap 2 >> >> I guess the memory usage increases slightly using the generic code and >> RK3066 has less memory available. > > also rk3066 and rk3188 do not have an iommu, so rely > on cma allocations. > > > Heiko > >