Received: by 10.213.65.68 with SMTP id h4csp478869imn; Fri, 16 Mar 2018 09:00:48 -0700 (PDT) X-Google-Smtp-Source: AG47ELue/yGZzfAN/l/IAxV6f/SQsOnDNmTKJFVNFUkuk0k3SkBZatSebexXmRmuO3UPrEVO2JKO X-Received: by 2002:a17:902:59c9:: with SMTP id d9-v6mr2705915plj.251.1521216048429; Fri, 16 Mar 2018 09:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216048; cv=none; d=google.com; s=arc-20160816; b=mJEhdEb4W3e/txM7t0kTFZIsPQ3uQZxNlkjQA9GAAXh+/0bLtTxEMFZFxzEvOjdWyi DbcoOsND7sz8m1YoL5TdBrJ5VpoLGsTE9BOGYbqsWQ07k6BThWs6yrDqwWCHwk/0HAuX anO+O51gAEe8BwH7fkQEPn19zm3sHGwqFPJoaPfhhd4lbepRd4ogj65GXpo3Si5IOwQy GFswvsePAaWKyiiiDvGNDZrECxnULXjJuauqeg0O8C3DieMBp3UzxvjSDFffXOhTQsOu RbSS+AQTJXUftaeD6C75UAy/XlgRXVEJccf3ON7Tuv1hBP2bXyU6cZ5+yANgscTNmipv 9Oxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=DU156U4cPJprZu/pfnnCxFVftZgx0wDFcILFs0GkNc8=; b=JIqnOEH5jaJcd+Ksxf0aYZgAUfHExQ8c/W4zt0ulUJuPaCkv3nX0YxrRyp72/991wz 5/3l6OGQyse6R2kaxAhb/Kz3GQ46T/0K76teADzhCcndsJSX0KimPleyJmLqi2emeKoW /wRWaHIHJZB7yrWTddt61twb3HnWpmQojcmc4H3PZuvYkHUsiFO9VB4gpn7g00tm1GIc 0WAiTtDoKvN3wBDA2WfZTaXyQcTcwbP8pgHYy6J66ChfIC9hcryBxd5+eI1u/744f8Sq Wrb9I1ieq6D4KaqiGOyGB5/pXcCccFvUYxa/xnQDQzO6o6rzwmxku1aCxaF2VyF2Nl2l SJLw== ARC-Authentication-Results: i=1; mx.google.com; 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 u70si5116701pgd.354.2018.03.16.09.00.32; Fri, 16 Mar 2018 09:00:48 -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; 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 S965290AbeCPPnh (ORCPT + 99 others); Fri, 16 Mar 2018 11:43:37 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45584 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965014AbeCPPne (ORCPT ); Fri, 16 Mar 2018 11:43:34 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B15AB25A; Fri, 16 Mar 2018 15:43:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tobias Jordan , Maxime Ripard , Mark Brown , Sasha Levin Subject: [PATCH 4.15 097/128] spi: sun6i: disable/unprepare clocks on remove Date: Fri, 16 Mar 2018 16:23:58 +0100 Message-Id: <20180316152341.389442285@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tobias Jordan [ Upstream commit 2d9bbd02c54094ceffa555143b0d68cd06504d63 ] sun6i_spi_probe() uses sun6i_spi_runtime_resume() to prepare/enable clocks, so sun6i_spi_remove() should use sun6i_spi_runtime_suspend() to disable/unprepare them if we're not suspended. Replacing pm_runtime_disable() by pm_runtime_force_suspend() will ensure that sun6i_spi_runtime_suspend() is called if needed. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 3558fe900e8af (spi: sunxi: Add Allwinner A31 SPI controller driver) Signed-off-by: Tobias Jordan Acked-by: Maxime Ripard Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-sun6i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -541,7 +541,7 @@ err_free_master: static int sun6i_spi_remove(struct platform_device *pdev) { - pm_runtime_disable(&pdev->dev); + pm_runtime_force_suspend(&pdev->dev); return 0; }