From patchwork Wed Sep 16 19:17:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11780613 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 62F1459D for ; Wed, 16 Sep 2020 19:18:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 137402075E for ; Wed, 16 Sep 2020 19:18:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BSM6Vjo5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="POX3iV6n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 137402075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t297vnjGhXt0B2t3AOnuUgulEjnpvaI2o8iW4QhZJ+c=; b=BSM6Vjo5vXM2nX8E0G/kymstB Sah61xrNkhGocXE+QmQglm4xsxd/tqGHCZvCeIUmc6/kEpFMQZiwW2lsBGOy/v4oZy6q7WDtrnWrU 26Fye8dy7D+93FrsI5GkDAFxghQVRsneaLLQ9TyBIdPN/vYK9T4FxBvab1Zz8bo7AoxJMU1ro48nY W0+AsWoHtRPGZq/SYYXEmprO+u+DrsMHaiS2CkU+wO0nJCd8GxjpubSaK64L5UdxK37w34583wk5G qfObwhKYL+ppwEdfcSbd/TR3t8YHFnWpNUiqBaW6rGdHfWz+pZVr/N+55tbOGheI71TF/1wlUhR7p tfU4zWO2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIcwg-0005I6-42; Wed, 16 Sep 2020 19:18:22 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIcw7-00057B-Sq for linux-arm-kernel@lists.infradead.org; Wed, 16 Sep 2020 19:17:49 +0000 Received: by mail-pl1-x643.google.com with SMTP id y6so3715579plt.9 for ; Wed, 16 Sep 2020 12:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uwz7uDiSpijhZG4h1tserEStKWNE3HZkcr8/salV8us=; b=POX3iV6nlCb0dIrYb1Gn/NjEpUNZlcqETAyRE7QwmNxuJnURWKse4aRCc0oxZFvFxQ NLxaRsFQ33H8dikTXbDpTdr75xDM5Q4EqDHzbHxwNqVMkBh8KcTjq+r8d9FX76CcJ5tl YqqT4UjP4undHKXoQnkb02v1e4PD5RlDaxnd1dxy2BJevRKMMSagD/is5TW3e+fYJRZx kA0FhRzYob0WRAdz+hl2TaUtTJEcqhReLPa89j61Z29U9bSM4uspgI8LiQOKdZFE6hyo SYW251azdWJqq9g5xpvAoh6VxBNlUIJJAJ5uVeV7kxzntD2wKM5+bVcrtMClsubV13Fr 6btA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uwz7uDiSpijhZG4h1tserEStKWNE3HZkcr8/salV8us=; b=ELyWRgOHqAvLDtGKwfQ8XoMvECZEC33wMjXamsQ0X0jJ3Ext8Cye3OfzX8bT8yiL0N Wnl+k6nP0Ac7UvuRUjJeVt8mbW8+x8VZBHFEULzmlblY9axOHDJsPB3Yar0BGbvlV8Z8 6/8k7FbHeygvIfssFEYzh6pVg4Qi52BUha/43SFiLGOnVlORnqRZkdd3vlBMiY6ayiaw 8jujDjwleKroiLE9HLy9O/WFEQJ/biFX1TMi4B+t2BlWv21nILNiLMnS1uF+CNokgIkk rp1ipjY2AZlnHRiijZEx6JSrmrr5xjj/a7+pQTT0ffe4wmwoe9eKxNB4mrrLsmoKqyfC NZcA== X-Gm-Message-State: AOAM530tYiDP2aFyBp+oDldZF94DPftXhQIpzehdFBGi7c2f/i+gUEbE +LYhF0QIvOUdeNJDvPp0jbtX1Q== X-Google-Smtp-Source: ABdhPJymvRW+Zat6n+q9jRaLx3Lamg31OZ5/XkFmEre09r7lk2LGVcjpGdqpqkkE0ExchqtAUQeQSg== X-Received: by 2002:a17:90b:3105:: with SMTP id gc5mr5357689pjb.225.1600283866159; Wed, 16 Sep 2020 12:17:46 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id b2sm11373688pfp.3.2020.09.16.12.17.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 12:17:45 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 06/16] coresight: cti: remove pm_runtime_get_sync() from CPU hotplug Date: Wed, 16 Sep 2020 13:17:27 -0600 Message-Id: <20200916191737.4001561-7-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200916191737.4001561-1-mathieu.poirier@linaro.org> References: <20200916191737.4001561-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200916_151748_012257_351F3F86 X-CRM114-Status: GOOD ( 13.96 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:643 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tingwei Zhang 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") Signed-off-by: Tingwei Zhang Reviewed-by: Mike Leach Signed-off-by: Mathieu Poirier --- 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 d6fea6efec71..c4e9cc7034ab 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 */