Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1009471pxb; Wed, 6 Apr 2022 06:37:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2FgC2uwLDp8w1BWJmuGcGOVfU9KzLCXdkOxxPBKgpW1rhsX4lmke+OUxY9MTeEOOitB0r X-Received: by 2002:a17:90a:7304:b0:1c6:aadc:90e5 with SMTP id m4-20020a17090a730400b001c6aadc90e5mr9973857pjk.164.1649252270180; Wed, 06 Apr 2022 06:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252270; cv=none; d=google.com; s=arc-20160816; b=eL+ODDJxzi7jQHFzHHpGZHD9KQJxn6CNDE1aoF+6tEKLiXMo5KbKjfP3E0lqABRgNB Z2rdHhjPjhy6rrdy8bPbxehUgQmyCsOOubiqs1yegLe+sVJ/UYSXbUmLNPFmlBnM0CM1 Nns5b+mDszQTuwJJFJ5jgZu71RTX9J7BlIgz7K187RK9N7Duo47iaGs9UdK3uRZwqw9J CK98/ZXxgpHgfIKk7muMkzhw1AfC2REyf1qSqfGlxImg4rTZ9KBmFfFv9GrK3AhmemJi r57XyF0jTUlYCEIuFej0M2BiBqa+CJ1cEa7vCwgciS6rZrbwhoQH+eI4xhbcd+LFc5HA Y4LA== 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=dGsi7zovtbdbNlIVXzNoKbqHism1gC9trd7uWDdJlLU=; b=Rzfa0A+NwWh/I6Sfsxr7VBcdWfMC/9N0v+O7aC8X6XbV3b6lBCgbIGyvdf5n8yHxdC +hn78alqEFxcOZLXAEeF0+VrXC6Jbz46ju6yS8CDuGOwOcxOoRPbO+m10b3xo5WgUZly fj6fXRpLHq/NAzvD/mx4LW1yVCTSrOb3trVGMo68LEq5pxQ5xiI5XYwB0zzmq7YSxnG3 KA32VUigcDMh20rs8iuga3qZAyRDnegkwufhw5pWIA+doC3j1kH5HmjHtAKHIyIubYFu DDNzLB2/My2IB5AXcd8GQHHAg3i/G3jxAxSqsqje8XzRGkuqFQvh3PaGPvHoOv3C1LBA jumg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rwsv1IR6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l10-20020a63da4a000000b003816043f030si14925644pgj.549.2022.04.06.06.37.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:37:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rwsv1IR6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9344C5E97AB; Wed, 6 Apr 2022 04:22:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444792AbiDEUIX (ORCPT + 99 others); Tue, 5 Apr 2022 16:08:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349067AbiDEJtD (ORCPT ); Tue, 5 Apr 2022 05:49:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64DA4A94F6; Tue, 5 Apr 2022 02:39:45 -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 005D5615E5; Tue, 5 Apr 2022 09:39:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C92EC385A2; Tue, 5 Apr 2022 09:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151584; bh=W/rAFKXNz3HhQGCq+VKNswrAmZ8mi7KiJaR5vyar9Sk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rwsv1IR6zAlywwU1tXta4CYD2CYuCvo193Ahr6Z9YQz/huaShzl+Hh1bkJqkCf88N w6agki8vbwE+P2WElltTQVDTy+tr94XgAquax4eAqU4iziE5JNIhNPQ6iHWrAJPe6t hTZlVQvkmr638F1M783MOn02KimPGf3WQQf2ljMw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bjorn Andersson , Stephen Boyd , Dmitry Baryshkov , Sasha Levin , Kuogee Hsieh Subject: [PATCH 5.15 469/913] drm/msm/dp: populate connector of struct dp_panel Date: Tue, 5 Apr 2022 09:25:31 +0200 Message-Id: <20220405070353.907182430@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Kuogee Hsieh [ Upstream commit 5e602f5156910c7b19661699896cb6e3fb94fab9 ] DP CTS test case 4.2.2.6 has valid edid with bad checksum on purpose and expect DP source return correct checksum. During drm edid read, correct edid checksum is calculated and stored at connector::real_edid_checksum. The problem is struct dp_panel::connector never be assigned, instead the connector is stored in struct msm_dp::connector. When we run compliance testing test case 4.2.2.6 dp_panel_handle_sink_request() won't have a valid edid set in struct dp_panel::edid so we'll try to use the connectors real_edid_checksum and hit a NULL pointer dereference error because the connector pointer is never assigned. Changes in V2: -- populate panel connector at msm_dp_modeset_init() instead of at dp_panel_read_sink_caps() Changes in V3: -- remove unhelpful kernel crash trace commit text -- remove renaming dp_display parameter to dp Changes in V4: -- add more details to commit text Changes in v10: -- group into one series Changes in v11: -- drop drm/msm/dp: dp_link_parse_sink_count() return immediately if aux read Fixes: 7948fe12d47 ("drm/msm/dp: return correct edid checksum after corrupted edid checksum read") Signee-off-by: Kuogee Hsieh Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1642531648-8448-3-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/dp/dp_display.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index a0392e4d8134..d5198b435638 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1442,6 +1442,7 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, struct drm_encoder *encoder) { struct msm_drm_private *priv; + struct dp_display_private *dp_priv; int ret; if (WARN_ON(!encoder) || WARN_ON(!dp_display) || WARN_ON(!dev)) @@ -1450,6 +1451,8 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, priv = dev->dev_private; dp_display->drm_dev = dev; + dp_priv = container_of(dp_display, struct dp_display_private, dp_display); + ret = dp_display_request_irq(dp_display); if (ret) { DRM_ERROR("request_irq failed, ret=%d\n", ret); @@ -1467,6 +1470,8 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, return ret; } + dp_priv->panel->connector = dp_display->connector; + priv->connectors[priv->num_connectors++] = dp_display->connector; return 0; } -- 2.34.1