Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2811033rwb; Mon, 15 Aug 2022 11:49:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR5xII5xXf5VgoWs7DwrJ8yBOcce702uMFzZT6M0SnZ6ve6sUsuvjDtyMn8D7IGD0UQqONp9 X-Received: by 2002:a17:906:98d4:b0:730:b545:fb5d with SMTP id zd20-20020a17090698d400b00730b545fb5dmr10955837ejb.532.1660589348572; Mon, 15 Aug 2022 11:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589348; cv=none; d=google.com; s=arc-20160816; b=n0TxwC2ibAW4uls7LoNBkP/vJew8ZKA3kDh7OpV+hIL3W9wsUJ6ILifedLosHvNejR mLziPsuzgbArQQH7nQWYRtERVSf1CUic/e4KuCGzxDCJRGVPJx1gNZ6ccNiWi0YH0WJ+ I9i8nmtsoRIsek7hrwvkdh6qaPaRSu1IDKmzOij+iokAYH3wq4O+qJjzFpB8lH8IncWW PViwgBfpnP1LYHe9xoMEXwH1ao/s2yDd/K5kRD5XDpT4lhxltDnqXhPpmo/8leP1wlRt 6TYL8qwCMsh6bpQKrvgN30abQK+o1nSIjtctWjhbAYiuMUYachqjb9u2EzjYx3CLWw1F Vbaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cPHF5vrnOyqEHqkxCWIEXB0fmO1vLJ9GX3PmZLaKSYc=; b=fL+EAovusVyoge8078eNbTX5kEsLy4XtzjrcxMtRPijBRyH7d0TrFM+SPyRsbmSbRF YwVZ7cBEs89vg5lBsPO/ojrt/5s2yI9wnq6WvLCVW++sORVqAb+uk0EQ2M0Z2Osa/U1b r/1ilG8Gt/sNkWB6smmCZ5LrCUNAGb4d1f1aYLrtvT2T4C+Kc2tx5pleQMCae1coiJjo ThJKuPpLggxNwcwlCPoePBmYoi1wOro7e9QxeedC6pn8iODOP1/zpgs9ofCK0kImSOkh yYLOnjzmhyZgvC1IJUPogUyoWKoJm6Ibkt9sV3yhEX93OTVksXegmZjUV1Q3EqXmB9Ym 6uMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NLzZYstL; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a50eac8000000b0043e6a16bca1si7892508edp.475.2022.08.15.11.48.43; Mon, 15 Aug 2022 11:49:08 -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=@linuxfoundation.org header.s=korg header.b=NLzZYstL; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240292AbiHOSTj (ORCPT + 99 others); Mon, 15 Aug 2022 14:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238887AbiHOSS0 (ORCPT ); Mon, 15 Aug 2022 14:18:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30DC32B633; Mon, 15 Aug 2022 11:16:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BC3A261299; Mon, 15 Aug 2022 18:16:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4E70C433C1; Mon, 15 Aug 2022 18:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587363; bh=4qlNeIHgUazwweJK0KQBHpXgXwP8gTAiqf2xf6WlGYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NLzZYstLOxwxKmjc1tVEGDYYkHBmAMS++69dL2mVGqsKeIYQGkL1mtCzsJwx7rhCY Qi3nPJ0OPnUIdeHO3QRdKNXXBxEq3jvW/59cZZoLXvFujUub+9AY3Vbd1jjRXgrefK vIjjN7BrXpyoKFd/m963Nw4jPhxR2SmUMvEJvr4c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Elwell , Maxime Ripard Subject: [PATCH 5.15 062/779] drm/vc4: hdmi: Disable audio if dmas property is present but empty Date: Mon, 15 Aug 2022 19:55:06 +0200 Message-Id: <20220815180339.909034261@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Phil Elwell commit db2b927f8668adf3ac765e0921cd2720f5c04172 upstream. The dmas property is used to hold the dmaengine channel used for audio output. Older device trees were missing that property, so if it's not there we disable the audio output entirely. However, some overlays have set an empty value to that property, mostly to workaround the fact that overlays cannot remove a property. Let's add a test for that case and if it's empty, let's disable it as well. Cc: Signed-off-by: Phil Elwell Link: https://lore.kernel.org/r/20220613144800.326124-18-maxime@cerno.tech Signed-off-by: Maxime Ripard Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1470,12 +1470,12 @@ static int vc4_hdmi_audio_init(struct vc struct device *dev = &vc4_hdmi->pdev->dev; struct platform_device *codec_pdev; const __be32 *addr; - int index; + int index, len; int ret; - if (!of_find_property(dev->of_node, "dmas", NULL)) { + if (!of_find_property(dev->of_node, "dmas", &len) || !len) { dev_warn(dev, - "'dmas' DT property is missing, no HDMI audio\n"); + "'dmas' DT property is missing or empty, no HDMI audio\n"); return 0; }