Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2155385iof; Tue, 7 Jun 2022 21:36:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCZIY8uF3Kc9MQdw8xaXVxKkQ+p2xIO+cxnwzus1TfUYHKfvm945aRYs2h+3U49sYAF9rO X-Received: by 2002:a17:90a:bf02:b0:1e2:fadf:3f15 with SMTP id c2-20020a17090abf0200b001e2fadf3f15mr35129026pjs.91.1654662994890; Tue, 07 Jun 2022 21:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654662994; cv=none; d=google.com; s=arc-20160816; b=By0y1EdP5eIpEhtPLQewIW7n+0hbHIUwtvNxMkzQkPggDVd7riax6+rxsHp6BD5TU2 3BvFbDduSeVrt2oag7xSKb42jW0JHDRak+55HENNTt/L6Uwza59Skt+hcRWkOOaBVwbz alnyOJBTXzG7vmW2pe7U8V+Q3hIvibHcAh4iyTTv3CQ2DgSXdBp/ims51EFt5GIu2hal DBcqhV+boM8Lm7nfriEd+z+hSpsNthc4J6MGn7H4NkBF37B/iiBVh1ATx/V4EupMykg4 J6SqHtap3UUGZyrKV6Z5dscTH4DJJgkbWNM4i724lXRjuiYRLCLUtx/hU+9kf+qPhnQD zuag== 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=6F1xGnacYC0KsNPSHiV6enql/PTPrNKRG8Vdb8EqTzA=; b=VzfoPqgOH5AMJDneoHJfBqz2KD9LlL0GpQTKkV3ZJpIVyV/ZzXGw3HWCOAvCnaMST5 0YGeosPSqbwl1n63jPCKpi+/g5ueHsppqZqKUWw0Hhy/J9bXdlSMqYStjtsgQBmiPcVO m+J2/XylB2p4V+K4/MEGJDzxADSENi/w55xLsb5lh8fv5487m0h/s5P6eIG3/aSneDp6 k47duoo2kJQV/DSgvBXBZRnR5VyU5Ch6VTyqtJCsVzcUipaaOPCp3FmrnOHYUqKxTMo9 9xSazcY2nS5GnT35+DozEI9R8GIzFi+58zaotTVCx9DLMPtmB9Abz2eFoshqPoHMrSyU llOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WcvyDqW8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mu2-20020a17090b388200b001e860feaeb5si16305273pjb.181.2022.06.07.21.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:36:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WcvyDqW8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 4FF88217891; Tue, 7 Jun 2022 21:09:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347808AbiFGRo2 (ORCPT + 99 others); Tue, 7 Jun 2022 13:44:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348024AbiFGRb3 (ORCPT ); Tue, 7 Jun 2022 13:31:29 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38FA511E1DA; Tue, 7 Jun 2022 10:29:05 -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 sin.source.kernel.org (Postfix) with ESMTPS id 36CEDCE0E13; Tue, 7 Jun 2022 17:29:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FEDAC34119; Tue, 7 Jun 2022 17:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622941; bh=3NVrkpZM0vx99wE1NC9rRmh0UfYplLuMiESkX4HrmcY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WcvyDqW8fIjKKI+itHmGPGVgMrCFAJ1H0U9ou3OUhADDYYRvWnN/RPoARr3WuFpLZ s8pKgMIvEfNkkumVDm8r3zV+ARLXjWnLnb785+fzztgSRJyxK2omThnKX9l8Y08nvP OP4tRbxcm5oF4MfRaKke8AWGjBipj+U/swKbTxuo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abhinav Kumar , Rob Clark , Stephen Boyd , Sasha Levin Subject: [PATCH 5.10 237/452] drm/msm/dpu: handle pm_runtime_get_sync() errors in bind path Date: Tue, 7 Jun 2022 19:01:34 +0200 Message-Id: <20220607164915.622399147@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@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: Abhinav Kumar [ Upstream commit 64b22a0da12adb571c01edd671ee43634ebd7e41 ] If there are errors while trying to enable the pm in the bind path, it will lead to unclocked access of hw revision register thereby crashing the device. This will not address why the pm_runtime_get_sync() fails but at the very least we should be able to prevent the crash by handling the error and bailing out earlier. changes in v2: - use pm_runtime_resume_and_get() instead of pm_runtime_get_sync() Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Abhinav Kumar Reviewed-by: Rob Clark Reviewed-by: Stephen Boyd Patchwork: https://patchwork.freedesktop.org/patch/486721/ Link: https://lore.kernel.org/r/20220518223407.26147-1-quic_abhinavk@quicinc.com Signed-off-by: Abhinav Kumar Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index b05ff46d773d..7503f093f3b6 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -939,7 +939,9 @@ static int dpu_kms_hw_init(struct msm_kms *kms) dpu_kms_parse_data_bus_icc_path(dpu_kms); - pm_runtime_get_sync(&dpu_kms->pdev->dev); + rc = pm_runtime_resume_and_get(&dpu_kms->pdev->dev); + if (rc < 0) + goto error; dpu_kms->core_rev = readl_relaxed(dpu_kms->mmio + 0x0); -- 2.35.1