Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2318330pxj; Sun, 13 Jun 2021 16:34:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwczSfCW6xZBMkvz1WjPJDYOyD13Qai+vebyySYUaAxKrW80ns+agUpLF3HfYwCjKP5qGBU X-Received: by 2002:a17:907:628d:: with SMTP id nd13mr12425161ejc.299.1623627261023; Sun, 13 Jun 2021 16:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623627261; cv=none; d=google.com; s=arc-20160816; b=uprcytYyeFOx8L80yHrm+THXrOfjdVxWqeVtt63o6CuQmU/eo4VZ/3K9i/9ZCVN5dx NdQZFk6Rw0qlEfs8pSPhCxxyXI5SXi8GKGiT+Bbto7GPsGJTaRAOLiDOeGGPYiQ72c0G LVxg4LrYc9VgJeCqhs6JsFZxSmmwLqn+Pv7VwmvtC28P7xc/5BVze/fEofbNZZYo89LJ yrk5xwxLfrsxztMMpX5vRJ96LEXNOLegxO94DoGDPpTEdobG0RcxpY4xuqBwacawQyAP 2QBHKXrva3suTafCaYtQyXvgYs3WtvteKGCrgEQoDtgFyFizkmZItCPQbz8VqVbZG8vM Y9rg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lr00zhwGwG4GL85hsYk0DjVuGde5MrGHUlbq816anbQ=; b=VOow2WA3k32BzArp51GrfXlqV4rdAwbkiQykysCDhFhSGZ3ABJf/pRZJvyp8FErH2/ MPifAR0Y+4PdzVjfhshzwC7IdG7FV4qKw6wposBSM87YgvfCGL6fps7ETOR4ICGijxuI Uvn+JsQJse4ipM/847r0Dp2S4l+zF3FLVwvaFFdagtkr4Oorsca4igvXwuwTKb7Njuyz utXkOvS8EcQdPxjT3CQzrukfdvLgCYN1r7DAs/WtsEpmATWCRBvK6+MG3R9u3RQ15R8i lwlsSv4s/qsqTqEJMHwI8m3gfVFjuXaKIqpDXcyfwrnRtNBMjkaZqP1vpjOeWD/hIe9W tmxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SKuPsRvX; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm9si9711778edb.350.2021.06.13.16.33.58; Sun, 13 Jun 2021 16:34:21 -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=@gmail.com header.s=20161025 header.b=SKuPsRvX; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbhFMXdo (ORCPT + 99 others); Sun, 13 Jun 2021 19:33:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232220AbhFMXdj (ORCPT ); Sun, 13 Jun 2021 19:33:39 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8CE9C061766; Sun, 13 Jun 2021 16:31:22 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 3-20020a05600c0243b029019f2f9b2b8aso11712942wmj.2; Sun, 13 Jun 2021 16:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lr00zhwGwG4GL85hsYk0DjVuGde5MrGHUlbq816anbQ=; b=SKuPsRvX/oKpVnvtfkkVIm4w3z/RIU4efHyzUPW2ZF+FOJ3TrQZL9neN0fCu7HcjIH wlm9ZT+Y0mbtcRT+NJuJY9zmbrxdxMUy/2KOthm0Mi/lGYa998mTOXYaO9IvVZbkq9vQ XbN7dDfHw6pc0IvTBAGvxW+2nHeBqKfflUS1uLw76XVvT253b5GDR3S/gd2ckiOfQNSm wwjbz4xFLA98AAE7yvZ7BfGTQhEnppOck1pneyCsnphL5k9uCIy+zNjsXYAv4Of11AsR QMOVwUG8qRtaSj3nV5vBaxQlb03zgm7inrrVJXKgb0jMVA5DIp66rX+jaYmrTonalgf8 s9VA== 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=lr00zhwGwG4GL85hsYk0DjVuGde5MrGHUlbq816anbQ=; b=tBycTo3VSCNzELDm0hkP/LxG6KtJ6ILQ1EpwV1IYad/vzrSsUKBb1nhpzx5g9Rz9rP twQq/IMz0aRj9kQtItKORIRrtyLGScwaGwgI03njozoqHJP/iQFzXMOT3UEK7w821Lys Ih3sD7HF+4nckjWM7XgzHYOSJbgBoPopui3NfQsozpaV/14jS+/TkMeXDZiJqLYyCLl4 LGhsm0tr96oUd7JYxjtZyFGsSnc3qN1cZIWsBE4ZJH/1JFGnlcjRzgeXZ6vFGJU9uWid uGykqu6mqG2WDWplVVtypGfGkerigYZuHngVmxsf3HnX5lC3nsX7ijJesbOSJEOi8w/m yF2g== X-Gm-Message-State: AOAM532lhon95l3beJtOHhGZ/JcgxyVXGSrggYG7Gj7VLhG1/1M85Dg1 X5dw9ONbpWR7K+pd2wQWRMs= X-Received: by 2002:a7b:c20a:: with SMTP id x10mr13249392wmi.141.1623627081516; Sun, 13 Jun 2021 16:31:21 -0700 (PDT) Received: from localhost.localdomain ([195.245.23.224]) by smtp.gmail.com with ESMTPSA id i9sm17882511wrn.54.2021.06.13.16.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jun 2021 16:31:21 -0700 (PDT) From: Alexander Sverdlin To: Geert Uytterhoeven , Nikita Shubin , linux-spi@vger.kernel.org Cc: Alexander Sverdlin , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH 2/7] spi: spi-ep93xx: Prepare clock before using it Date: Mon, 14 Jun 2021 01:30:36 +0200 Message-Id: <20210613233041.128961-3-alexander.sverdlin@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210613233041.128961-1-alexander.sverdlin@gmail.com> References: <20210613233041.128961-1-alexander.sverdlin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework, otherwise the following is visible: WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1011 clk_core_enable+0x9c/0xbc Enabling unprepared ep93xx-spi.0 CPU: 0 PID: 1 Comm: swapper Tainted: G W 5.13.0-rc5-... #1 Hardware name: Cirrus Logic EDB9302 Evaluation Board [] (unwind_backtrace) from [] (show_stack+0x10/0x18) [] (show_stack) from [] (dump_stack+0x20/0x2c) [] (dump_stack) from [] (__warn+0x98/0xc0) [] (__warn) from [] (warn_slowpath_fmt+0x90/0xc0) [] (warn_slowpath_fmt) from [] (clk_core_enable+0x9c/0xbc) [] (clk_core_enable) from [] (clk_core_enable_lock+0x18/0x30) [] (clk_core_enable_lock) from [] (ep93xx_spi_prepare_hardware+0x10/0x30) [] (ep93xx_spi_prepare_hardware) from [] (__spi_pump_messages+0x124/0x620) [] (__spi_pump_messages) from [] (__spi_sync+0x280/0x2c0) [] (__spi_sync) from [] (spi_sync+0x24/0x40) [] (spi_sync) from [] (spi_sync_transfer.constprop.0+0x64/0x8c) [] (spi_sync_transfer.constprop.0) from [] (regmap_spi_write+0x48/0x70) [] (regmap_spi_write) from [] (_regmap_raw_write_impl+0x640/0x740) [] (_regmap_raw_write_impl) from [] (_regmap_bus_raw_write+0x7c/0xac) [] (_regmap_bus_raw_write) from [] (_regmap_update_bits+0xec/0xf8) [] (_regmap_update_bits) from [] (regmap_update_bits_base+0x50/0x7c) [] (regmap_update_bits_base) from [] (cs4271_component_probe+0x74/0x148) [] (cs4271_component_probe) from [] (snd_soc_component_probe+0x24/0x74) [] (snd_soc_component_probe) from [] (soc_probe_component+0x11c/0x29c) [] (soc_probe_component) from [] (snd_soc_bind_card+0x3c4/0x8a8) [] (snd_soc_bind_card) from [] (edb93xx_probe+0x34/0x5c) [] (edb93xx_probe) from [] (platform_probe+0x34/0x80) [] (platform_probe) from [] (really_probe+0xe8/0x394) [] (really_probe) from [] (device_driver_attach+0x5c/0x64) [] (device_driver_attach) from [] (__driver_attach+0x7c/0xec) [] (__driver_attach) from [] (bus_for_each_dev+0x78/0xc4) [] (bus_for_each_dev) from [] (driver_attach+0x18/0x24) [] (driver_attach) from [] (bus_add_driver+0x140/0x1cc) [] (bus_add_driver) from [] (driver_register+0x74/0x114) [] (driver_register) from [] (__platform_driver_register+0x18/0x24) [] (__platform_driver_register) from [] (edb93xx_driver_init+0x10/0x1c) [] (edb93xx_driver_init) from [] (do_one_initcall+0x7c/0x1a4) [] (do_one_initcall) from [] (kernel_init_freeable+0x17c/0x1fc) [] (kernel_init_freeable) from [] (kernel_init+0x8/0xf8) [] (kernel_init) from [] (ret_from_fork+0x14/0x3c) ... spi_master spi0: failed to prepare transfer hardware: -108 Signed-off-by: Alexander Sverdlin --- drivers/spi/spi-ep93xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c index aa676559d273..5896a7b2fade 100644 --- a/drivers/spi/spi-ep93xx.c +++ b/drivers/spi/spi-ep93xx.c @@ -550,7 +550,7 @@ static int ep93xx_spi_prepare_hardware(struct spi_master *master) u32 val; int ret; - ret = clk_enable(espi->clk); + ret = clk_prepare_enable(espi->clk); if (ret) return ret; @@ -570,7 +570,7 @@ static int ep93xx_spi_unprepare_hardware(struct spi_master *master) val &= ~SSPCR1_SSE; writel(val, espi->mmio + SSPCR1); - clk_disable(espi->clk); + clk_disable_unprepare(espi->clk); return 0; } -- 2.32.0