Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1002053yba; Thu, 4 Apr 2019 02:09:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwROsYrkk10KoKgSPWbPs6c1eQPPzAy67yMO9m6Qeyr9+IYvRGFfGTwBfXQffInieEZGiSa X-Received: by 2002:a17:902:7043:: with SMTP id h3mr5299487plt.228.1554368969157; Thu, 04 Apr 2019 02:09:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554368969; cv=none; d=google.com; s=arc-20160816; b=XY7LWnJqR33LteQ+bWiCZNdLY8z7eX1yLxrCmkoGG9btm6/+3QJb9VNQYbb3zu/nHQ WreDzDyg+28vcQCMmWyYNE+OSNYHyTYLWgy+nsxb/OvlG9atGsKDJuhvb5e3oF3rP0vh MCCDaeGn4XoNUGqZeyKZm3Iwj+3j+QK2exdInvKsXpWRn/0bRsFdKCFxhBOT0iaQFDwE s6PhodCf9cLoO6fGEn0dUkUTlBcifbczqjinG79ptbJslFjyOhWBu55SbEcAOQnEoTJm j1uJ4uF3dAvZXj+40oswiTV2hUSokavbXsC1eAOtAwuMPgBh/fO4V4koFFN/yVYt03zE v/qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KvVKt/UHm1a+llwazQBjzq5VKn+cVkYQKvAf3ylWaVY=; b=R5LrXShreYi1M/2IcZyUffwmQD1TMjxKho+CgkUiFMi3+2+MYonLQsaqARCce1NedQ yhk6oJ8GO9ZDb1pR2Av7A8V3unEQI2CEe/unMoB1ulBDvJhGOAxJRhYCHNV+v+2TrmJr 3XNImjLPFipeQajLrmrW5uULcnPPcW+RFB2Dj6OBV9LCS8HGSsupt/vgrqM+1CUnOG8s eo2oP9Ne6IOssv0npQMfEd76oJ8nwhNvhcsFa2KzUr0mGkuh4cJ6Q1ovib2O0FCoAYNg h8+nAyjqUUL1B5L2DWOVeAOVwFmfY6PKfa1aPtVUK5b5pd2WjAj+QmSrdNwSh+GSkwGK yHMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wcO80lFS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n79si16090119pfb.133.2019.04.04.02.09.13; Thu, 04 Apr 2019 02:09:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wcO80lFS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732686AbfDDJIl (ORCPT + 99 others); Thu, 4 Apr 2019 05:08:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:47796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732048AbfDDJIk (ORCPT ); Thu, 4 Apr 2019 05:08:40 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 39E2B21741; Thu, 4 Apr 2019 09:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368919; bh=XuH24fgkmdKrRZPKt4UsQEktP1TM2UB2K/YUBBsYHDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wcO80lFSWidegeebwqURKgdHJ4eouRKbN3Ofmz8i/vGZoX+En57odqTtCGEiV4pSp ixgb+pHrpAaJXN/BQu0SNOUXBDCi1euIi6qxULcj+l5asT4C1qRbnujIKIMQw2AiyF Sad0JQ1AfuyNJiLFyGzeAAol8V83c4cEtQGI5bI8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tero Kristo , Tony Lindgren , Stephen Boyd , Sasha Levin Subject: [PATCH 5.0 014/246] clk: ti: clkctrl: Fix clkdm_name regression for TI_CLK_CLKCTRL_COMPAT Date: Thu, 4 Apr 2019 10:45:14 +0200 Message-Id: <20190404084619.690847928@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084619.236418459@linuxfoundation.org> References: <20190404084619.236418459@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit d17a718db40df2548e99a62dc3d7e5e2b38143cc ] Commit a72d785021cb ("clk: ti: Prepare for remove of OF node name") changed the code to use kasprintf() for provider->clkdm_name but also changed the offset used later on by three. We don't need to change the offset as we already have the extra three characters in the format for kasprintf with "%pOFnxxx". This caused the clocks with TI_CLK_CLKCTRL_COMPAT to have NULL clk->clkdm_name for omap4 and 5. And null clkdm_name can cause module reset, enable, and idle to fail. The issue can also be seen also when enabling DEBUG for clkctrl.c and then we start seeing "clock: could not associate" messages for omap4 and 5 as the generated name is something like "l4_wkclkdm" instead of "l4_wkup_clkdm" that's needed. Let's fix the issue with a partial revert of commit a72d785021cb ("clk: ti: Prepare for remove of OF node name"). ALso note that in general code should not depend on the dts node names. And the node names should be generic types like clock-domain in this case. This could be fixed later by using separate compatible properties for the clockdomains, or by adding soc_device_match() table with reg offsets to the driver. But let's fix the regression first. Fixes: a72d785021cb ("clk: ti: Prepare for remove of OF node name") Cc: Tero Kristo Signed-off-by: Tony Lindgren Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/ti/clkctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c index 40630eb950fc..85d7f301149b 100644 --- a/drivers/clk/ti/clkctrl.c +++ b/drivers/clk/ti/clkctrl.c @@ -530,7 +530,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) * Create default clkdm name, replace _cm from end of parent * node name with _clkdm */ - provider->clkdm_name[strlen(provider->clkdm_name) - 5] = 0; + provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0; } else { provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFn", node); if (!provider->clkdm_name) { -- 2.19.1