Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2193570iof; Tue, 7 Jun 2022 22:47:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi5L+PDmBKjiWPsggadjbMD7I8693EueFM1eloWcOxWClBbJZ2NjQDi888dC2tg0E231ym X-Received: by 2002:a05:6a00:1886:b0:51b:eefe:e182 with SMTP id x6-20020a056a00188600b0051beefee182mr22645294pfh.75.1654667250532; Tue, 07 Jun 2022 22:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667250; cv=none; d=google.com; s=arc-20160816; b=P9vvzxRDPb8fEfE1B54mgzWFTS+mS/68b2FDtA7+gHm/YSoo9mRiqQwGkkrp3R+jHa VoZWJ5kSrJgweiy//X2yivGmxVjlfz4+HoJdWqEY/ikjQ8AyR8EJhMIg+JAcjgzJyT/n nb4nSYMJw6zpJ5PAW/FSJbHVAgnRfJSMlsa46dubKMgQkom6aF8obmyB7/8josIWek8z 6E+e2Po/Mhei2XhrQZTanhyGRoTrUZYi1K+s4+AcfTYYomedhj/NtYsQddPL2StCmCIN NxRhpsjSGejyLNm+/TAK2Q3a8ep3Ng310+qIH7OZaDZQP0pr9cAK8xpYQAANYWbDwm5p XWQw== 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=MEr/A8qjhqi/cUUx0TG0+PRgpVCfUD5bkAbc7tigoDc=; b=BnMjxruo3xK1tP+vt8zlpmRYpdmUrhoNZztggh0gpgjOWkrtAGSENHLLEansf7mJq6 RkwVG+meeZQSERycXoUusjGeyeg6/nDvCgeJxU/AjofDSN+JLtM/tWCxH8+yQ3l0E8/F TnRVlDOnrcQrMpC6sfiH62yaHx3sMbIYlXwUkX49o0eDobfXTOOEWCN4mtxagHQdBdwF tBvtQs1N0k0UjlUbjyJDDiJgekXrdukVxVA4RallbJ+YZlfFrInbENfMcijeQEi0t/Vc RUJ3A3IBd6OOuH8fXq/ryyg2vVdssrY5xLPFteoWwpCVb2EG1dLzrTSG7HrBoyJU53Nn +5Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="OV+/iAun"; 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 j185-20020a638bc2000000b003fcb1bb48f2si25725643pge.638.2022.06.07.22.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:47:30 -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="OV+/iAun"; 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 4D7B749DB16; Tue, 7 Jun 2022 22:12:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1388103AbiFHAba (ORCPT + 99 others); Tue, 7 Jun 2022 20:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381583AbiFGVrT (ORCPT ); Tue, 7 Jun 2022 17:47:19 -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 C95C42383CD; Tue, 7 Jun 2022 12:08:03 -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 3B310617DA; Tue, 7 Jun 2022 19:08:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D83EC385A2; Tue, 7 Jun 2022 19:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628882; bh=IidhPLXS2CwCKIgFuwWIM2uWXF3YHnpxqQyIVw7rreE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OV+/iAunH16pot12XtQPuWPW8Z0lq5yx74eJf8jbYXWT3P25xhZxDTiN1bKlDy7/P u8CodeAxCQivdEfAoA5GEsUX17xwoXPQyZj4hoMPVka4T8lLS3+CI5THRSRBBeU3rc ddqgwW14LHIL94znyb7V1RTTU8pPM4ojsedQVOG4= 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.18 489/879] drm/msm/dpu: handle pm_runtime_get_sync() errors in bind path Date: Tue, 7 Jun 2022 19:00:07 +0200 Message-Id: <20220607165017.065749581@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: 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 ad13a9423601..c8089678f733 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1058,7 +1058,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