Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4689861pxb; Tue, 28 Sep 2021 01:36:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuzdq5gBOSMuxKCLj17fIaAS3RZIi7YMcalrkjahZY/UFmy+NVSQim8y3PhVm4mQFtuNYd X-Received: by 2002:a17:90a:ab94:: with SMTP id n20mr4237586pjq.146.1632818215526; Tue, 28 Sep 2021 01:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632818215; cv=none; d=google.com; s=arc-20160816; b=RXEn5RlXXnk2OOHmnDlSEz56QjlaZ4X1I5D5ESR3RjKPt5Gp1oqzQErvlHKd2ggaD1 HW1RqEcmmjcKgyA5E5VL4N3pnXDvlCITNWh//YHyISC2XcNfiQNVeLyoYENWNZOfc58C BgIdblvLaATBH1mYiYfAWC9BVvaREijtbPudLHsMaA7NoJvNHq+Q4FoD5yTzItN/4aLw z4dH6FHXNN84yHY9nrtQiUCGqmJhBtcadoc/fF0Qo4v/VjKYTif6Gibo/L86mhpDGVVP LkgqN0wnZdQnlxbygYt6Mr1ueNt7sXOdJPOF9KJsgAIPu7OOuVORQ1u2QLbnt3626Jpf zbBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=8Ndt5mR9lDoSu8oa1clA56MdgUfnF9KzG9Uod91RcnU=; b=EZeqyBPzphAsqniRGIPRnTRXzav8TBXnY6M4V0MqRO8X4HZOiB30oeX+038Id/d0Lh g74DLS1vohUbeDwHgD+f4leBcJVskl+ku9gNIlqSRuq7fT54Bjgy/qYu+1c9XxoZxbIC aWFTivFhBMMddBwVLBTVFAAMjgicA33hu6ysc9nOapd3uxy7ocy8wcND3TRn+DTvZUwC 1w8wm6rX9HC6iOTkhVx78+2Ihx4ienumy6Bm7E6hK3v+oQNuHraAWwGjvkfWnxpcNDVs AdtOZl+6KzXvlDtchecf0y6NOtRWjCvslmtWpmVFjupJouxd083hU04DWSDNMPhTnhVT tUUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=KZVLBBU9; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="Sg2RWt/Y"; 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=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si11982855pfe.118.2021.09.28.01.36.42; Tue, 28 Sep 2021 01:36:55 -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=@cerno.tech header.s=fm1 header.b=KZVLBBU9; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b="Sg2RWt/Y"; 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=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239607AbhI1Iga (ORCPT + 99 others); Tue, 28 Sep 2021 04:36:30 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:58991 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235918AbhI1Iga (ORCPT ); Tue, 28 Sep 2021 04:36:30 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 3B1513201CC5; Tue, 28 Sep 2021 04:34:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 28 Sep 2021 04:34:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm1; bh=8 Ndt5mR9lDoSu8oa1clA56MdgUfnF9KzG9Uod91RcnU=; b=KZVLBBU9tsRVCpQVU H9FxCaX5369ZyOsqGNsP3qYIksV05riSj+RoC/l+jaRLOkfaZ/WbCaS7ZO2QxRhn lCpxawnGZEokifQJg0pv4mALe53EAhMJNM6txASv43J5Zb8mgWTLiycBqWUzTTG6 /L3fWcoeZucoFEclJ/ipR1shPqpVYm4bdi2+NHJRS2xUFYddS0w924/WrW8qS4wi D9WupVeTsq1EE8azv+TB4K3y292ASGhtp+zRJT5oFA/ZebiZRPQn7jK+WgonC094 vAE4KpH0rwUjN5DYn3k2Nx7fIBG+H99HpzsoMG/ifujaDXUqG/3jTXRSP7o+gnh+ j8mGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=8Ndt5mR9lDoSu8oa1clA56MdgUfnF9KzG9Uod91Rc nU=; b=Sg2RWt/Yens/ISPIedhUpJgADepthjpuYd0DEt0w8Olv+N2mY75iZtVC1 2ETBlChDYl/ZIX5G5smSd+qaCGFW4/92xgbAhXUm2CG7NFshsqGtF/hyAIT7YMLh pHRA/bCdMF9RullNm10pAkT8xLOAD9cyPtOBcOdoDmqKX23EC0qZHD9J5Sn7xJJ7 9TgjStmtzYA2JsyP7/10DNUPRTouSz2PmtrwvgbQ/+ZpN1nTQKSVWAdQDI7dEauf F5sI2NpqDL2BXuS8xdGhll9QeBWCJ1qWCpZ2qfJUrzmAzDJ4HFepvcDLKFPnpMPc 5xmUAnzDsK+m9PRCCyiQaZbcMqFGg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudektddgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtugfgjgesthhqredttddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpefgjeettdejgffgffdvteeutdehtdehgeehueetkeefgefhtdetjeekledu gedvudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Sep 2021 04:34:48 -0400 (EDT) Date: Tue, 28 Sep 2021 10:34:46 +0200 From: Maxime Ripard To: Daniel Vetter Cc: Linus Torvalds , Sudip Mukherjee , Emma Anholt , David Airlie , Philipp Zabel , dri-devel , linux-kernel Subject: Re: Regression with mainline kernel on rpi4 Message-ID: <20210928083446.cfji7hmndt6a5nop@gilmour> References: <20210922095725.dk4vk42zb3kh7y6s@gilmour> <20210924133022.waqgtr5xjjxigong@gilmour> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Daniel, On Sat, Sep 25, 2021 at 12:50:17AM +0200, Daniel Vetter wrote: > On Fri, Sep 24, 2021 at 3:30 PM Maxime Ripard wrote: > > > > On Wed, Sep 22, 2021 at 01:25:21PM -0700, Linus Torvalds wrote: > > > On Wed, Sep 22, 2021 at 1:19 PM Sudip Mukherjee > > > wrote: > > > > > > > > I added some debugs to print the addresses, and I am getting: > > > > [ 38.813809] sudip crtc 0000000000000000 > > > > > > > > This is from struct drm_crtc *crtc =3D connector->state->crtc; > > > > > > Yeah, that was my personal suspicion, because while the line number > > > implied "crtc->state" being NULL, the drm data structure documentation > > > and other drivers both imply that "crtc" was the more likely one. > > > > > > I suspect a simple > > > > > > if (!crtc) > > > return; > > > > > > in vc4_hdmi_set_n_cts() is at least part of the fix for this all, but > > > I didn't check if there is possibly something else that needs to be > > > done too. > > > > Thanks for the decode_stacktrace.sh and the follow-up > > > > Yeah, it looks like we have several things wrong here: > > > > * we only check that connector->state is set, and not > > connector->state->crtc indeed. > > > > * We also check only in startup(), so at open() and not later on when > > the sound streaming actually start. This has been there for a while, > > so I guess it's never really been causing a practical issue before. >=20 > You also have no locking Indeed. Do we just need locking to prevent a concurrent audio setup and modeset, or do you have another corner case in mind? Also, generally, what locks should we make sure we have locked when accessing the connector and CRTC state? drm_mode_config.connection_mutex and drm_mode_config.mutex, respectively? > plus looking at ->state objects outside of atomic commit machinery > makes no sense because you're not actually in sync with the hw state. > Relevant bits need to be copied over at commit time, protected by some > spinlock (and that spinlock also needs to be held over whatever other > stuff you're setting to make sure we don't get a funny out-of-sync > state anywhere). If we already have a lock protecting against having both an ASoC and KMS function running, it's not clear to me what the spinlock would prevent here? Maxime