Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp494002pxx; Wed, 28 Oct 2020 09:34:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzPSt+4pR1kXLJu4NzKKZaj85ffDkUbzg7mOm+d5xg2KwMx/MiZyQuHjGTNk2E8ZZo3Zth X-Received: by 2002:a05:6402:1585:: with SMTP id c5mr8816340edv.278.1603902898155; Wed, 28 Oct 2020 09:34:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603902898; cv=none; d=google.com; s=arc-20160816; b=WP9mrS1GG4BpVVl0diVUFUIpy7LAh4t/ZMSCirV6NPCebve5hUDgGKbPWG1OD+v+Fi jh+BoXB9ayLkvXTNaS/dDmXuBPc1a389oJrw8ALxTCDZ1zq1B7qMAe6MfVNRTMI7AZNX ikK9Pvw3nklYCxpY5ChVnweZ3gRGlG29l0lU0eZEzWQgYNZakg0yhnZ+uwbhFSutefNi k14kHDrP0eCCShMpwq24SjgfQ23xKf0KXLGGpQ5AaWXvuI6kaTD2dGDjOA6tFrhfCkKB SKiRI7C/rgSNuo/LkZ1TChyS+PYqG+xKncCRncdEOrVVtMTyOFfCwKI8sGyalNIAt1Ee AKzg== 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=fFtnXT2Xi1Q5G+IedOGSHhxgDwvevbBtaNt2nLrBsf8=; b=HIDzbPnBPSHysm3LXU7krgJ+UhUA98Rz9Sxk2n0fERBSJXrjrOGHA2VBlj/Jp+Z00G wWwrNYbW50tzBnjYRhfL4c0H1Yk5p1ogU5kx1rZSF8Ns6uN++v707SNfotdVuelDahWq FY9ktWVcEf7vpLlFSlIFQHOiTD834g4SJvH+NoJ0EJwjALWageJxH7ctFYDZuTZyvTm8 qY/TzHGj/u1E4YYJgFFfmLGIeiF5uMUK8BdJhghfy4c61RgFE2bSFjK5pL2X/xqnEcUK GEiOZ81oM4J74R14tewBHhbKvSp8Ldog0JrczknedrXHfJlvrpY1/LJgimAFo8dGfQCP R0Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="wfV/7MAH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j25si3921855ejb.68.2020.10.28.09.34.35; Wed, 28 Oct 2020 09:34:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="wfV/7MAH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1817992AbgJ0RQp (ORCPT + 99 others); Tue, 27 Oct 2020 13:16:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:59576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1783507AbgJ0O6S (ORCPT ); Tue, 27 Oct 2020 10:58:18 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 65DEE20714; Tue, 27 Oct 2020 14:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810697; bh=iKnE/Hc7xCVVFbYGgGIXEAKToBtNNhSRDCXKg6XNkX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wfV/7MAHdodq5uks7P0zV4m/Ze9sh7Duok9WezOuHwAHJf9Xf1kO4+XAKC3Jd0KWo 8R5WH+jDtaPPEiduKG2e5GeQBtij19D3jZYlstLOVAiwyMnwL346GL4g5CEXWB05O7 L1qQbU7xhTDd2ASgiCghVIau40CJWLrHwlpNtC5o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Leach , Tingwei Zhang , Mathieu Poirier , Sasha Levin Subject: [PATCH 5.8 231/633] coresight: cti: remove pm_runtime_get_sync() from CPU hotplug Date: Tue, 27 Oct 2020 14:49:34 +0100 Message-Id: <20201027135533.517664135@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tingwei Zhang [ Upstream commit 6e8836c6df5327bdb24211424f1ad1411d1ed64a ] Below BUG is triggered by call pm_runtime_get_sync() in cti_cpuhp_enable_hw(). It's in CPU hotplug callback with interrupt disabled. Pm_runtime_get_sync() calls clock driver to enable clock which could sleep. Remove pm_runtime_get_sync() in cti_cpuhp_enable_hw() since pm_runtime_get_sync() is called in cti_enabld and pm_runtime_put() is called in cti_disabled. No need to increase pm count when CPU gets online since it's not decreased when CPU is offline. [ 105.800279] BUG: scheduling while atomic: swapper/1/0/0x00000002 [ 105.800290] Modules linked in: [ 105.800327] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G W 5.9.0-rc1-gff1304be0a05-dirty #21 [ 105.800337] Hardware name: Thundercomm Dragonboard 845c (DT) [ 105.800353] Call trace: [ 105.800414] dump_backtrace+0x0/0x1d4 [ 105.800439] show_stack+0x14/0x1c [ 105.800462] dump_stack+0xc0/0x100 [ 105.800490] __schedule_bug+0x58/0x74 [ 105.800523] __schedule+0x590/0x65c [ 105.800538] schedule+0x78/0x10c [ 105.800553] schedule_timeout+0x188/0x250 [ 105.800585] qmp_send.constprop.10+0x12c/0x1b0 [ 105.800599] qmp_qdss_clk_prepare+0x18/0x20 [ 105.800622] clk_core_prepare+0x48/0xd4 [ 105.800639] clk_prepare+0x20/0x34 [ 105.800663] amba_pm_runtime_resume+0x54/0x90 [ 105.800695] __rpm_callback+0xdc/0x138 [ 105.800709] rpm_callback+0x24/0x78 [ 105.800724] rpm_resume+0x328/0x47c [ 105.800739] __pm_runtime_resume+0x50/0x74 [ 105.800768] cti_starting_cpu+0x40/0xa4 [ 105.800795] cpuhp_invoke_callback+0x84/0x1e0 [ 105.800814] notify_cpu_starting+0x9c/0xb8 [ 105.800834] secondary_start_kernel+0xd8/0x164 [ 105.800933] CPU1: Booted secondary processor 0x0000000100 [0x517f803c] Fixes: e9b880581d55 ("coresight: cti: Add CPU Hotplug handling to CTI driver") Reviewed-by: Mike Leach Signed-off-by: Tingwei Zhang Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200916191737.4001561-7-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/coresight/coresight-cti.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-cti.c b/drivers/hwtracing/coresight/coresight-cti.c index d6fea6efec71f..c4e9cc7034ab7 100644 --- a/drivers/hwtracing/coresight/coresight-cti.c +++ b/drivers/hwtracing/coresight/coresight-cti.c @@ -141,9 +141,7 @@ static int cti_enable_hw(struct cti_drvdata *drvdata) static void cti_cpuhp_enable_hw(struct cti_drvdata *drvdata) { struct cti_config *config = &drvdata->config; - struct device *dev = &drvdata->csdev->dev; - pm_runtime_get_sync(dev->parent); spin_lock(&drvdata->spinlock); config->hw_powered = true; @@ -163,7 +161,6 @@ static void cti_cpuhp_enable_hw(struct cti_drvdata *drvdata) /* did not re-enable due to no claim / no request */ cti_hp_not_enabled: spin_unlock(&drvdata->spinlock); - pm_runtime_put(dev->parent); } /* disable hardware */ -- 2.25.1