Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp999010pxb; Wed, 27 Oct 2021 17:05:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjbUK+K+XdHaAU54nmDOA2D1hwRF2awN8SCmjUMAT6KFd3lINNrLn2451+nmCHU0IP/LNM X-Received: by 2002:a17:906:4789:: with SMTP id cw9mr994468ejc.285.1635379519116; Wed, 27 Oct 2021 17:05:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635379519; cv=none; d=google.com; s=arc-20160816; b=DE4VLQGXgK12QwsbIqGF8AQjF0rQkjY+QT8SWj1Hs1m7T5v9Mq0VEa60+NlwqaSwgl FUuiG2UBKCOE0VWk1gxOW+w/NO3LMzxVnvi88++++4S4vEyKicBY4BGK3c7hZm0jmgH/ 5eomeF7yNh7aPYkmfD97XgCFlqphGidkHilvRoR9Mod4ZBS9HhtRmnI+Rj7lAD0+VYgW HaIi3DmKcsYRdONIiEV9uwjb9Kclk5/NOOD8EEyyRDEM+g/KqF4NwZbLOFyKhxm2U9nh QuC863InkixmmeuWuWKLHBGuKvi7hCe7TfyJhjrwso6WWGYsF/0qPpTJWCGX9O+46rEz Z3HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uqHiZAh9153nwS+DodprExoTASZ+7YRb3/+XlZxYLIE=; b=G9UPz+IY6vtX9s8T8XWu4SCWsmjIfA9pcrYS6PDU2cTu4rtxDX0hgivu/2ToVHDk8d jJZOG0sMwb0WYd4DJkoWVWtSYcrGulraOgOPLCxIbNc+8IXUE8wm5uSDayvybzhitRaA bMj06NByc46SPNkEudB8bStt2HeDu8sYlbboUyknTSSXcRVxXTCmvnKIwWcFfIv0uttE fa8Yu7Ko/OvbSQBOGzpzasxggthQ015RN2B6j4zgxnytmMzpjvu0/6KBKLf8q3TkrDv/ brFW8CAnqUkAOyGQAPUDBAwozcnyIB8+HzeY3vCHqQ14r0fHUKtDFjxMVmvuK4rUcSj+ 3aWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uDQ9r6kZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si1777700ejb.354.2021.10.27.17.04.53; Wed, 27 Oct 2021 17:05:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uDQ9r6kZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229437AbhJ1AEU (ORCPT + 99 others); Wed, 27 Oct 2021 20:04:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbhJ1AET (ORCPT ); Wed, 27 Oct 2021 20:04:19 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E1ECC061767 for ; Wed, 27 Oct 2021 17:01:53 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id e2so7480322ljg.13 for ; Wed, 27 Oct 2021 17:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uqHiZAh9153nwS+DodprExoTASZ+7YRb3/+XlZxYLIE=; b=uDQ9r6kZiDALGD4eETvKi+OF+Z+JRrO7Ta/eyWLuqzAi1N5S57vey4fLz9MQ7srH01 AwA+AwCHxpONEVd93TX/qLMSZqLjLEw+o9DqzKxlM5S/8A6AIbGoeEiwfj96uIt+TLym Y7+IUAhZP4koHDaPoCwyiPWKSLlTGf6ALXjoz4Gif4DhiWVWFBwkY1VXlz9/PohF6yoj PmQlvJs0q+xoifPkDqmQwRKZvvE4bmYpw4YaHJVmEzFleF73zcNL/RWmekWsy1OgHv6M isOFzGkRO3cbxql94FjuVzkUeBh5KAhq0P7OCqN9vXBpi8ZDv3n20rMnVboST+pWPaUC INiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uqHiZAh9153nwS+DodprExoTASZ+7YRb3/+XlZxYLIE=; b=ClpTVk0j4rO/YaWGimb7FU622eYtjvlFraB7n/wwHsKMLFqgNNmBaJsxB0o+qov5Lt i9nH/lQ1Q6WKUSsAL3k4FlR3Gbt05BW6/vD1Ahm6iT+C0FUO1AtnjBBC2yJJMlKnTRQF GJRhdoWN/2UNvPvn+gpYLmKSSl5feXs6W9caztIf8TWWOtVK3UfjAJXjZ1zs8/NX5Xx9 kB00dSRin9kNO/GqwykgTFuKW0aZybEGhLVJFzxrsrxdvoAb1zguP5A5SWFpeLSo4DQf eQ+gK0r2WNpADCG+Za4G2Gbxdl4WK6hRE5eC4/7IoKb3RKaib2QS0hQsAmhHH+5jcdkn tfTg== X-Gm-Message-State: AOAM533Dw6i2MrRdUn9LDog/ttomYnpVNoE6lqrzEHoEVqfJS8TDGSXw IytE5MKg1Ag460hQE37cxeQmmRT0TEnjGN6iB1S+ig== X-Received: by 2002:a05:651c:389:: with SMTP id e9mr1101224ljp.61.1635379311380; Wed, 27 Oct 2021 17:01:51 -0700 (PDT) MIME-Version: 1.0 References: <20211025144345.267107-1-tadeusz.struk@linaro.org> In-Reply-To: <20211025144345.267107-1-tadeusz.struk@linaro.org> From: John Stultz Date: Wed, 27 Oct 2021 17:01:39 -0700 Message-ID: Subject: Re: [PATCH] media: venus: Synchronize probe() between venus_core and enc/dec To: Tadeusz Struk Cc: Stanimir Varbanov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Lee Jones , Amit Pundir , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 25, 2021 at 7:44 AM Tadeusz Struk wrote: > > Venus video encode/decode hardware driver consists of three modules. > The parent module venus-core, and two sub modules venus-enc and venus-dec. > The venus-core module allocates a common structure that is used by the > enc/dec modules, loads the firmware, and performs some common hardware > initialization. Since the three modules are loaded one after the other, > and their probe functions can run in parallel it is possible that > the venc_probe and vdec_probe functions can finish before the core > venus_probe function, which then can fail when, for example it > fails to load the firmware. In this case the subsequent call to venc_open > causes an Oops as it tries to dereference already uninitialized structures > through dev->parent and the system crashes in __pm_runtime_resume() as in > the trace below: > > [ 26.064835][ T485] Internal error: Oops: 96000006 [#1] PREEMPT SMP > [ 26.270914][ T485] Hardware name: Thundercomm Dragonboard 845c (DT) > [ 26.285019][ T485] pc : __pm_runtime_resume+0x34/0x178 > [ 26.286374][ T213] lt9611 10-003b: hdmi cable connected > [ 26.290285][ T485] lr : venc_open+0xc0/0x278 [venus_enc] > [ 26.290326][ T485] Call trace: > [ 26.290328][ T485] __pm_runtime_resume+0x34/0x178 > [ 26.290330][ T485] venc_open+0xc0/0x278 [venus_enc] > [ 26.290335][ T485] v4l2_open+0x184/0x294 > [ 26.290340][ T485] chrdev_open+0x468/0x5c8 > [ 26.290344][ T485] do_dentry_open+0x260/0x54c > [ 26.290349][ T485] path_openat+0xbe8/0xd5c > [ 26.290352][ T485] do_filp_open+0xb8/0x168 > [ 26.290354][ T485] do_sys_openat2+0xa4/0x1e8 > [ 26.290357][ T485] __arm64_compat_sys_openat+0x70/0x9c > [ 26.290359][ T485] invoke_syscall+0x60/0x170 > [ 26.290363][ T485] el0_svc_common+0xb8/0xf8 > [ 26.290365][ T485] do_el0_svc_compat+0x20/0x30 > [ 26.290367][ T485] el0_svc_compat+0x24/0x84 > [ 26.290372][ T485] el0t_32_sync_handler+0x7c/0xbc > [ 26.290374][ T485] el0t_32_sync+0x1b8/0x1bc > [ 26.290381][ T485] ---[ end trace 04ca7c088b4c1a9c ]--- > [ 26.290383][ T485] Kernel panic - not syncing: Oops: Fatal exception > > This can be fixed by synchronizing the three probe functions and > only allowing the venc_probe() and vdec_probe() to pass when venus_probe() > returns success. > > Signed-off-by: Tadeusz Struk Hey Tadeusz Thanks so much for sending this out, I definitely would like to see these crashes sorted! Unfortunately this patch causes some odd behavior when I use it with a modular config. The display does not start up and trying to reboot the board ends up with it hanging instead of rebooting. And booting with this patch in my non-modular config, it just seems to get stuck during bootup (I suspect waiting on firmware that's not yet mounted?). I've got to run right now, but I'll try to help debug this down further. thanks -john