Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2253555iof; Wed, 8 Jun 2022 00:34:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0TzpJQ5yCCBB8/ngfrpPHEn5Gc5NXaOuFCqDWlG5HV7oFseZX5F/Tw7cABTRBpAyHO7Kj X-Received: by 2002:a05:6a00:26cf:b0:4f6:fc52:7b6a with SMTP id p15-20020a056a0026cf00b004f6fc527b6amr99601156pfw.39.1654673687117; Wed, 08 Jun 2022 00:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654673687; cv=none; d=google.com; s=arc-20160816; b=fuvq0FkljfIeElY+x4dEa0YERtLagVNWWyy3ByjUXQElstqL/GuHbkFzNCaBaKd6uF 8yVpdZl75ZT/vU35e/cqF/XJy6ykSl1fM4Ho/DUdpuh7NdtR0q7YdbEHkdF+dkylUJNj iuCwEj5vrAvZ1aPebXQI9PMZWv5yLSsNd+EqSQTo7CiQDzFWtxA567OIjbYIwmqC+ylP mKMh90zU5DU1zMQdwKqcZwQJLnegqataHDHYmVqADuspV3JkfHd5xar7F0xwTUUnjbin 3wgb7sCHNV9LVq8Dnob6m7MKByg9yYektpVKuMh3+M3I8/ELPSly0mcIXyVGwwmwJ4pE tZmA== 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=DrC5Ysi39BGAxv7IaYRHdPdr0esydpCQ6v27eyEspGw=; b=D6V/IYMfILRoAc+WCz7C6J/+cVUPrvKvqB3FiJPkPLJlCPpgDT2ucDIWGIH8OE2OiZ 8t793DG5lf6fBVK4sdH+h8tf3ji5/3C3+YgvL3DR1hWHpS+5DaJ1i9+50CVDgkaAe9B0 hPrrlDNmuRVjrdRR22HDed9S4My7o1erU3zUDJLUzslZ0dFw7UFPYfROgk8yTWUWzSyP EMFiptDc6FEGgUWy3gfuV5C0tnfVE7rCqDzyepXjkA01cgoORApqvbQBrVe0XDzLdmps la0DALMKsr9zMZdzufwMbtj6k7i2+tU1dAV2nx5pr3iTQKQZpv7Aqru+ybkL7Yp6kxwx NOXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=adxfJJLx; 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 f192-20020a636ac9000000b003fddd0f6d2esi8416989pgc.576.2022.06.08.00.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 00:34:47 -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=adxfJJLx; 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 B907522C81E; Wed, 8 Jun 2022 00:07:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357333AbiFGWnV (ORCPT + 99 others); Tue, 7 Jun 2022 18:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380954AbiFGVb3 (ORCPT ); Tue, 7 Jun 2022 17:31:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5E6622C486; Tue, 7 Jun 2022 12:03: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 ams.source.kernel.org (Postfix) with ESMTPS id 2240FB82182; Tue, 7 Jun 2022 19:03:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8712FC385A2; Tue, 7 Jun 2022 19:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628622; bh=8paB4wn84GkOCOxCrWhsa4YIQJLs/1Aq5n//Q6bQ/TA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=adxfJJLxUXnPG+LqcxEPiKOukq/n9Jsh2vKvQmHQT2t1ODHTIjDe95Q/dcAnw67Z4 NZizUn2/Rd/HBORsfzt45C1cpEEVl3bP56F3u0Xvy6Okw1D70ixGB2Hgm/bA5oWAUF 9SvoUQFF8J8ux2MEeButS8zknsRfSRpsNOVxGOmI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinod Polimera , Dmitry Baryshkov , Stephen Boyd , Sasha Levin Subject: [PATCH 5.18 396/879] drm/msm/disp/dpu1: avoid clearing hw interrupts if hw_intr is null during drm uninit Date: Tue, 7 Jun 2022 18:58:34 +0200 Message-Id: <20220607165014.359122289@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 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=unavailable 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: Vinod Polimera [ Upstream commit 01013ba9bbddc62f7d011163cebfd7ed06bb698b ] If edp modeset init is failed due to panel being not ready and probe defers during drm bind, avoid clearing irqs and dereference hw_intr when hw_intr is null. BUG: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Call trace: dpu_core_irq_uninstall+0x50/0xb0 dpu_irq_uninstall+0x18/0x24 msm_drm_uninit+0xd8/0x16c msm_drm_bind+0x580/0x5fc try_to_bring_up_master+0x168/0x1c0 __component_add+0xb4/0x178 component_add+0x1c/0x28 dp_display_probe+0x38c/0x400 platform_probe+0xb0/0xd0 really_probe+0xcc/0x2c8 __driver_probe_device+0xbc/0xe8 driver_probe_device+0x48/0xf0 __device_attach_driver+0xa0/0xc8 bus_for_each_drv+0x8c/0xd8 __device_attach+0xc4/0x150 device_initial_probe+0x1c/0x28 Changes in V2: - Update commit message and coreect fixes tag. Fixes: f25f656608e3 ("drm/msm/dpu: merge struct dpu_irq into struct dpu_hw_intr") Signed-off-by: Vinod Polimera Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/484430/ Link: https://lore.kernel.org/r/1651509846-4842-1-git-send-email-quic_vpolimer@quicinc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c index c61b5b283f08..cf9aa06ab8bd 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_interrupts.c @@ -599,6 +599,9 @@ void dpu_core_irq_uninstall(struct dpu_kms *dpu_kms) { int i; + if (!dpu_kms->hw_intr) + return; + pm_runtime_get_sync(&dpu_kms->pdev->dev); for (i = 0; i < dpu_kms->hw_intr->total_irqs; i++) if (!list_empty(&dpu_kms->hw_intr->irq_cb_tbl[i])) -- 2.35.1