Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5656630img; Wed, 27 Mar 2019 12:34:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxedczDpzua611D1I16oUx006nAefhCEJsta/w0X/u+xu82a4uvOG5wnwJ5Fb5sicFNip/G X-Received: by 2002:a65:6546:: with SMTP id a6mr36266383pgw.296.1553715267562; Wed, 27 Mar 2019 12:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553715267; cv=none; d=google.com; s=arc-20160816; b=LxtdnesChjb0lu7SpijOjRVZ1rkR61z3u52/AZGyiNJXjsRBohrmPOBGZZaiQtR6hC sJZuIU+BahZ4OTOEKoVtg48u4FtiIl2FxeVYLHE8L7pKwE4znKTgnIHyVahF7XXAiNS3 Yfe1i2jAMxjsuzXdbXCCEMn/fZfLxx3MShIzrcZXmjVRRrPiyxzLhDeQ/sTt1pPx/8YH p+fMBUy7cLlufsY6brUgD6jX5lTLWp6szXYm3uJhTu1GLyUW/xBXRVE0DiudZpvY5cDD AGrNCAG3VmEqnT+L4by25v5kveeIOkFoLVGspMgLM47OVsz5yP+XO4/sYcZHFE22/e3X qUHw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=w5sgtZy56oXZuduViHo6cB3mXlLddF+VzCtHvI03VI0=; b=ocYjeJMpvz53ulxzFxxHI8yHHomNdc8TQXkRsZrf5YOiNG6X+6bxptsqLSwgBnaRla 8wveCwMrbm/MhXUI+RyccNA3RiNctFbra5XgbyI00s4WtuuuaT1JgrlcrAOXPAk4SvD2 AgbLKZJz2lQfCC3wdy122knF6YBtEAQHeivZojlblNXwyCpeEk6IqA0A68/v4gF3xIUF 5Iwir9ZutqO7Zxp/uqltdGX9LL/6Zya8lWfHpdxPkaq0ITwyfvwwM4RcFFeA1uFJ1UDP xoTfsFvTIB4HhQF7I+I4XLTktmxtHWk3yTuc66oJb4H52h9rwHsidph+/BNEXPBPTjSS 2aeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rb10KEBD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k75si11057684pgc.515.2019.03.27.12.34.12; Wed, 27 Mar 2019 12:34:27 -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=rb10KEBD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733160AbfC0Tdi (ORCPT + 99 others); Wed, 27 Mar 2019 15:33:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:42360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730522AbfC0SC2 (ORCPT ); Wed, 27 Mar 2019 14:02:28 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EBE1821738; Wed, 27 Mar 2019 18:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709747; bh=rEYuKFJ2Cscjzc31Ovq2NcrqoB0i5CBvRuOemQu/+7o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rb10KEBDqVovp5sYjvewhd+OPbf/P4LbUkxzQlMohxRabjdWuEF6UEvazonEijqRM ZJlRNG6p8BkioMbUnHW5gmln6gNxIuF1yvQWlZ3BJVGDGEtLJki2oI4CsAIzS5vIXV 5nRcz8Bpkfn7HQ8qm8ecYHiiPB48DX67Y8k+kVQs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tony Lindgren , Tero Kristo , Stephen Boyd , Sasha Levin , linux-omap@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 017/262] clk: ti: clkctrl: Fix clkdm_name regression for TI_CLK_CLKCTRL_COMPAT Date: Wed, 27 Mar 2019 13:57:52 -0400 Message-Id: <20190327180158.10245-17-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tony Lindgren [ 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