Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3050260rwb; Mon, 15 Aug 2022 16:57:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR4HFqmfJJpOkDz/IChVRG5GsbtstBG3TLr6g5M+9ChBAnaSNzHTPd8wkkazK+nYCkI1trzy X-Received: by 2002:a63:5f09:0:b0:41c:da4f:e498 with SMTP id t9-20020a635f09000000b0041cda4fe498mr16138200pgb.276.1660607833810; Mon, 15 Aug 2022 16:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660607833; cv=none; d=google.com; s=arc-20160816; b=Uy5GO1zNZsa71mjUia6+4A4gQgnI0UwxcSSzKfcbiLAFAdLkC0vcQp4ZoXBrAGsn0G YOz4hoC5ECIeNognwEnDSoAVH5ajifMe03k5isMMb5yzMEERc8v4B8Rz0YLKlbLV5T9h 4EgDoLLduJs/+FeYM04RcZJ+s3Y+mfR+UIZvTlQlNxHqNEGgMdNTWV9Mdx3NvamADOIa ODgg6su0DF1EBxAcmhLysnAdd88KSnhz/phrP0jMdsCCl6Q7ZRSLmR1AG7CRnnEYl6Az JoGL8NXv0hR3lvvrDVq26xOWZZPt2Jww2D7PRSiwZd4KrPkAIhe3I9GYqHs5Tk7u1+4S DYYw== 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=piUYfy/+s05m9u15ect7jH8p5y72etdNhlVLnbxizYA=; b=ovQRozHXs/UE+m5QOwpckcl5kd/uL+liSlMED+n8ezBXuGRnVIDe46D3xBbhtkP7WJ Hr2lqi3MbglYdt73XrUs7e6Up9AQYmSo8kDbL/TFkhXPYStwh0qB7yPo5dFeXShCIuTK M2MFAdWluV08bPW9FHCsp/jDWkomQAhhwj/xFvdUXL67IM2kb8mNmK7TVX1k1988ZlPa H5M80UT2AUdqxcrddNRYgSCgKdKTFt2BDLQPZjEuo3jXKFaiMDYCYRy2K7uhuvNF6pFc 5PwFowoMiE27y4CiCtxKc/RubpQuGULD0mJgBT5mSh/dFzdaikJHWbPgl8Z1uIh/wTV3 r9nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AguIDfoD; 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 mu14-20020a17090b388e00b001f7353b22b7si20880302pjb.135.2022.08.15.16.57.03; Mon, 15 Aug 2022 16:57:13 -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=AguIDfoD; 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 S1354864AbiHOXzi (ORCPT + 99 others); Mon, 15 Aug 2022 19:55:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354695AbiHOXtc (ORCPT ); Mon, 15 Aug 2022 19:49:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 514A68FD70; Mon, 15 Aug 2022 13:15:47 -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 2CF9E60F0E; Mon, 15 Aug 2022 20:15:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D1B6C433D6; Mon, 15 Aug 2022 20:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594545; bh=2uyKtmGglGH0iXko6R1xrbjLGUfoGmJ7bj7j9NKT1Cw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AguIDfoD77bQYkLrUCG6fywHAdkWA54+pxnwBQX8iT3134dx7DPk2OEcElT6vopbd wcYwujjs1TEGDutawyOCKMupwcWaxdDvJ5EFftYDodZAGoa+uApiPmw58SVmxvF/5j iN8IV3sb+a3meEsD5VO90pyYz4V6b1kbqAeNoDMs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hsin-Yi Wang , Xin Ji , Robert Foss , Sasha Levin Subject: [PATCH 5.19 0447/1157] drm/bridge: anx7625: Fix NULL pointer crash when using edp-panel Date: Mon, 15 Aug 2022 19:56:43 +0200 Message-Id: <20220815180457.473914286@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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: Hsin-Yi Wang [ Upstream commit dfb02eb6bdf84697dbadd69a7df12db612ce4ed0 ] Move devm_of_dp_aux_populate_ep_devices() after pm runtime and i2c setup to avoid NULL pointer crash. edp-panel probe (generic_edp_panel_probe) calls pm_runtime_get_sync() to read EDID. At this time, bridge should have pm runtime enabled and i2c clients ready. Fixes: adca62ec370c ("drm/bridge: anx7625: Support reading edid through aux channel") Signed-off-by: Hsin-Yi Wang Reviewed-by: Xin Ji Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20220706125254.2474095-4-hsinyi@chromium.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/analogix/anx7625.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 0117fd8c62ae..183bd065c494 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -2656,14 +2656,6 @@ static int anx7625_i2c_probe(struct i2c_client *client, platform->aux.dev = dev; platform->aux.transfer = anx7625_aux_transfer; drm_dp_aux_init(&platform->aux); - devm_of_dp_aux_populate_ep_devices(&platform->aux); - - ret = anx7625_parse_dt(dev, pdata); - if (ret) { - if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "fail to parse DT : %d\n", ret); - goto free_wq; - } if (anx7625_register_i2c_dummy_clients(platform, client) != 0) { ret = -ENOMEM; @@ -2679,6 +2671,15 @@ static int anx7625_i2c_probe(struct i2c_client *client, if (ret) goto free_wq; + devm_of_dp_aux_populate_ep_devices(&platform->aux); + + ret = anx7625_parse_dt(dev, pdata); + if (ret) { + if (ret != -EPROBE_DEFER) + DRM_DEV_ERROR(dev, "fail to parse DT : %d\n", ret); + goto free_wq; + } + if (!platform->pdata.low_power_mode) { anx7625_disable_pd_protocol(platform); pm_runtime_get_sync(dev); -- 2.35.1