Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp195181rdg; Thu, 12 Oct 2023 03:02:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFG/aqc9NrFenyZj4gMmiqfVtxlcOgvm1RHK6WL1YcvH7tXYF90TE05BtroKG3uJR6t+nJi X-Received: by 2002:a17:90b:1bc4:b0:274:dd15:87bf with SMTP id oa4-20020a17090b1bc400b00274dd1587bfmr29914590pjb.20.1697104962274; Thu, 12 Oct 2023 03:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697104962; cv=none; d=google.com; s=arc-20160816; b=nEi4aTjSN8Sd6CHcBPZefsgtOnbcXnVkZZMb+T7EvEwgY7nxYmOHPWCfyQt5LG0siM GJrLxJpfcoMPU9evJ7ix9l2ES/Buh7KhnEDq/X5pJfb9gEVDWxWWSgSnJWbOZPpMN0qv soQ2PhjZv0Un1z4UIYD7/+qu2ZZXv41PHV02AOb+InZVVjxDwv90O9tS0aFQcU2yOn1o NQ8qby3txYgkP/vSeFBQZzovY/1CPGSIEld/zWH93wjnyKYoo1rB/DhTQeNER0x6omk4 rNNL6IuekHXuatVFLGS8iJVXLf7cAUnD5auN3kcr2bX1bKnwjJtTyIhaiuoNpaGdLubm 6k9Q== 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 :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5uzJdD9EnJYoFGXNEQeQiThsmnwqPchhQD9Xsg4JKR4=; fh=NAuXkc5JSLEXANS/WGzRBo8+pvt2IHDPVUsBNLp4AZI=; b=RE7KldTC6PtVdkZYPqxmRyy6Q3/VxNP9VwFV8wwJwC91mfb/kYPTnKDLzd72Hj2WkL KzeyjjaCP/R1azRUzUeb1D06K6HL2U8N8O7RQeTv794x6KF4q/B7ngc0mIKAIkDOKR04 dc18vBl15w9Sni8eG94SZwB18oti7EjZWKSxkPem8ibO8gJzLR2Qav3V0FKHB/VU2Wp5 H2sCcbB3B5XHtP2sR5PIQTV55xV/wdXtIZvSXmKPNdaLerxFXu1GMBE7Zn0VrpRFshTu Vkz33H5SRzwzCFnFFAVPGLo3q7b5Sx6wUs6dORBYJvvxhS2UGJBr+oHZcfm2j6f6JP6q wM/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=oOYVxnL7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id r5-20020a17090aad0500b0027d04b581dcsi1909427pjq.72.2023.10.12.03.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 03:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=oOYVxnL7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7679483B8190; Thu, 12 Oct 2023 03:02:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235586AbjJLKC3 (ORCPT + 99 others); Thu, 12 Oct 2023 06:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235457AbjJLKC1 (ORCPT ); Thu, 12 Oct 2023 06:02:27 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7666A9; Thu, 12 Oct 2023 03:02:25 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id D887F66071A3; Thu, 12 Oct 2023 11:02:23 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697104944; bh=m9OfIh4qBSX/4JsExhLjoNnCHZqhMXqV3D0UdQP9C4I=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oOYVxnL7i9TfhrFJngxiI0cjozeNstGQiGVRu9uqDccAPrpSgdmGL7AOUVUHDTJtV fBrxu6JUjG/l8YAlW+RHOSc1beVGcErH73WyvklEfa3hOzYt0wVlic0gZvMW+U4VWA SpJjYneXMzhr+ssMqvJuztqFCFcjz+am2WQPM0hmOhPnBcntINI29IR/6/Z12/5HqR A3iInsIMJXBoFLm9Ff/RxngBfa3uMctrouaqNaPC9Fz7sVQ4dniIf+dXns2CDOQSeO nH9T6hYn3gPeUx2QNRR1QSMcMucaV3LJ/TN67VPBlN9e6mNxMwx1/tEBKsDJd7uK3X RhflYV8jpt3wA== Message-ID: Date: Thu, 12 Oct 2023 12:02:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH v2] media: mediatek: vcodec: using encoder device to alloc/free encoder memory Content-Language: en-US To: Yunfei Dong , =?UTF-8?Q?N=c3=adcolas_F_=2e_R_=2e_A_=2e_Prado?= , Nicolas Dufresne , Hans Verkuil , Benjamin Gaignard , Nathan Hebert Cc: Chen-Yu Tsai , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20231010122010.25937-1-yunfei.dong@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20231010122010.25937-1-yunfei.dong@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 12 Oct 2023 03:02:38 -0700 (PDT) Il 10/10/23 14:20, Yunfei Dong ha scritto: > Need to use encoder device to allocate/free encoder memory when calling > mtk_vcodec_mem_alloc/mtk_vcodec_mem_free, or leading to below crash log > when test encoder with decoder device. > > pc : dma_alloc_attrs+0x44/0xf4 > lr : mtk_vcodec_mem_alloc+0x50/0xa4 [mtk_vcodec_common] > sp : ffffffc0209f3990 > x29: ffffffc0209f39a0 x28: ffffff8024102a18 x27: 0000000000000000 > x26: 0000000000000000 x25: ffffffc00c06e2d8 x24: 0000000000000001 > x23: 0000000000000cc0 x22: 0000000000000010 x21: 0000000000000800 > x20: ffffff8024102a18 x19: 0000000000000000 x18: 0000000000000000 > x17: 0000000000000009 x16: ffffffe389736a98 x15: 0000000000000078 > x14: ffffffe389704434 x13: 0000000000000007 x12: ffffffe38a2b2560 > x11: 0000000000000800 x10: 0000000000000004 x9 : ffffffe331f07484 > x8 : 5400e9aef2395000 x7 : 0000000000000000 x6 : 000000000000003f > x5 : 0000000000000001 x4 : 0000000000000000 x3 : 0000000000000cc0 > x2 : ffffff8024102a18 x1 : 0000000000000800 x0 : 0000000000000010 > Call trace: > dma_alloc_attrs+0x44/0xf4 > mtk_vcodec_mem_alloc+0x50/0xa4 [mtk_vcodec_common 2819d3d601f3cd06c1f2213ac1b9995134441421] > h264_enc_set_param+0x27c/0x378 [mtk_vcodec_enc 772cc3d26c254e8cf54079451ef8d930d2eb4404] > venc_if_set_param+0x4c/0x7c [mtk_vcodec_enc 772cc3d26c254e8cf54079451ef8d930d2eb4404] > vb2ops_venc_start_streaming+0x1bc/0x328 [mtk_vcodec_enc 772cc3d26c254e8cf54079451ef8d930d2eb4404] > vb2_start_streaming+0x64/0x12c > vb2_core_streamon+0x114/0x158 > vb2_streamon+0x38/0x60 > v4l2_m2m_streamon+0x48/0x88 > v4l2_m2m_ioctl_streamon+0x20/0x2c > v4l_streamon+0x2c/0x38 > __video_do_ioctl+0x2c4/0x3dc > video_usercopy+0x404/0x934 > video_ioctl2+0x20/0x2c > v4l2_ioctl+0x54/0x64 > v4l2_compat_ioctl32+0x90/0xa34 > __arm64_compat_sys_ioctl+0x128/0x13c > invoke_syscall+0x4c/0x108 > el0_svc_common+0x98/0x104 > do_el0_svc_compat+0x28/0x34 > el0_svc_compat+0x2c/0x74 > el0t_32_sync_handler+0xa8/0xcc > el0t_32_sync+0x194/0x198 > Code: aa0003f6 aa0203f4 aa0103f5 f900 > > 'Fixes: 01abf5fbb081c ("media: mediatek: vcodec: separate struct 'mtk_vcodec_ctx'")' > Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno