Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3542120pxb; Wed, 13 Oct 2021 08:05:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEjbs1J8uOq6r+l+MxC1xlgSZaO0lc9kadK3xrG4aaxz1RgV4eHbQXHcATHnxJuSq8P6u8 X-Received: by 2002:a05:6a00:2405:b0:3e1:9f65:9703 with SMTP id z5-20020a056a00240500b003e19f659703mr38923276pfh.6.1634137510246; Wed, 13 Oct 2021 08:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634137510; cv=none; d=google.com; s=arc-20160816; b=j+qCr0fP23taaEze06rB5kEK1EbrhJKUn+tRX5o6IN4FAx7NQpLHRRlKj3Kz4j4IE0 CXeJQJWRKaMtvpRookqzo3DHs1mh4E2kE6ylphNrulOhGGCnpYDmw388GHWWgcYf2WOp M/x/72awoqWG9j6eeGZQbgIgt93Zve1oxAsY113LdWmmnsxMzvT6ys0u3Sh0wqux6qEt F7D2Z+wi5rUMzcl4cNIqZImfWmY5oTKkLL7AiH9uL/L8WYHgDGkWhEb/4/O/8OdM3ahe 4nRBvsYVirkIpVuW7f3i5Ijbx5/3jezHmKjnhDTMt5gcq5V+4ch1oIL3j4awighI0qHr 4Pcg== 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-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature :dkim-signature; bh=JT3rF9I4EV/hP/NrO3DfS+hQTjzQdnfHkTyQokP/KfM=; b=yAMCV9kc+FnLxHo74HiMXvXTLlY+AgUy7Vw6IWPNnS+egKXDFCEPW4sPoZ8EVuuq/5 UDipdjUDiWwWxQrg+GzftCr7BdJ/vD5f/qFsDfRaHZflPZ61Iy8qqo6PElkXCmMZJQGd 2+8o6PeAH5hFahggrwx7dlwrSebZUViyG6kiYsjH7kyUuBqvG1co1DpIsI3HfPFyMwoZ YMbTOcG3bosZANkHRxupl81X/xn3tphcE+bNKJ8NlILIyBvJo/eV+VxJlyLA7MTPXvPj EVgcQI8+nVT+1VsrBlm5gtHb9jDItR0rODfQ3t7//bCLKqTPzK9ihiGhvonn9wOBhS+n 8A1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=BKE9wmc5; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=BiguNnSr; 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 c20si18987969plo.8.2021.10.13.08.04.47; Wed, 13 Oct 2021 08:05:10 -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=BKE9wmc5; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=BiguNnSr; 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 S236779AbhJMPD2 (ORCPT + 99 others); Wed, 13 Oct 2021 11:03:28 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:43663 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236847AbhJMPDK (ORCPT ); Wed, 13 Oct 2021 11:03:10 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 70D2F5C0098; Wed, 13 Oct 2021 11:01:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 13 Oct 2021 11:01:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=JT3rF9I4EV/hP/NrO3DfS+hQTjz QdnfHkTyQokP/KfM=; b=BKE9wmc5whTAODhKWdKIpLLqsi8Ku654esYrrhhAuxe PXk4OIpRXE00kSt0aBbosoxnKo1qL6emQ7WafyOqHrUHD3YMDoR3FUpiYBKhujaB PeW9PluLZte5NFyh0/iOkATe2UIlZIC42GFU2wH6B7MsfF10d+ptHJFt9I6Mi1mc rNu6zPP1Xnv5Tg0pQRfpFUElrshzyJk2RGVd9zvXO72CF56j41gcdhAPBJpTEOJQ JK2EMhlxbv/lzf1uzNbA0j8PHR2qrECWBMdWD/Bzi7utbTgSy6Bwodv96wz0tBTP vGCXHZSEonY7n8ByWlPKP+lo0GcXhYOsc5IIihqikvQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm1; bh=JT3rF9 I4EV/hP/NrO3DfS+hQTjzQdnfHkTyQokP/KfM=; b=BiguNnSr5azHDSd6uETkks xI7CmBYQzX1k5J/bo77SomyMdrPDGPayDC6YdiW6kS0saYOVh3iQnM0qar7b1CIR 43u8UKAQxhK5cw2tGOgqcrl/pV/2Iqdkn4zrda5adKUdCMf7whNIagcKEm81uWKe ccf6iGK7jE26gFrXnfx4Jk7Il+LGNvD3xf/l/37aNYQr40E30Q728c5DSK1cig1F j9JMjD+lYLVvAUV77dgIoEwsI7V+DOy4LCymZSRfjkWr4Q2UawhkWle6A4lyQTDV xhK/i4MF8bk7/TSzDWNeppJT83i7kh2aq0L24YAOj1hroqX9gjXXs4RFgB9Jnaqg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddutddgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Oct 2021 11:01:05 -0400 (EDT) Date: Wed, 13 Oct 2021 17:01:03 +0200 From: Maxime Ripard To: Linus Torvalds , Sudip Mukherjee , Emma Anholt , David Airlie , Philipp Zabel , dri-devel , linux-kernel Subject: Re: Regression with mainline kernel on rpi4 Message-ID: <20211013150103.p3rea3ny3rjmohtd@gilmour> References: <20210924133022.waqgtr5xjjxigong@gilmour> <20210928083446.cfji7hmndt6a5nop@gilmour> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="peyav3thoy3lt6kq" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --peyav3thoy3lt6kq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 30, 2021 at 11:19:59AM +0200, Daniel Vetter wrote: > On Tue, Sep 28, 2021 at 10:34:46AM +0200, Maxime Ripard wrote: > > Hi Daniel, > >=20 > > On Sat, Sep 25, 2021 at 12:50:17AM +0200, Daniel Vetter wrote: > > > On Fri, Sep 24, 2021 at 3:30 PM Maxime Ripard wro= te: > > > > > > > > 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 numb= er > > > > > implied "crtc->state" being NULL, the drm data structure document= ation > > > > > 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 w= hile, > > > > so I guess it's never really been causing a practical issue bef= ore. > > >=20 > > > You also have no locking > >=20 > > Indeed. Do we just need locking to prevent a concurrent audio setup and > > modeset, or do you have another corner case in mind? > >=20 > > 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? > >=20 > > > 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). > >=20 > > 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? >=20 > Replicating the irc chat here. With >=20 > commit 6c5ed5ae353cdf156f9ac4db17e15db56b4de880 > Author: Maarten Lankhorst > Date: Thu Apr 6 20:55:20 2017 +0200 >=20 > drm/atomic: Acquire connection_mutex lock in drm_helper_probe_single_= connector_modes, v4. >=20 > this is already taken care of for drivers and should be all good from a > locking pov. So, if I understand this properly, this superseeds your comment on the spinlock for the hw state, but not the comment that we need some locking to synchronize between the audio and KMS path (and CEC?). Right? Maxime --peyav3thoy3lt6kq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYWb0rwAKCRDj7w1vZxhR xeHSAQDU0V5TZK2D6sulS8ToJp7H7Q/vdu9etNO4fRwbMpqOYQEAqukjS+xrus3a wg9JV8BsOTfB7osX5CRL7kqBAWu+uwQ= =vTbV -----END PGP SIGNATURE----- --peyav3thoy3lt6kq--