Received: by 10.213.65.68 with SMTP id h4csp247757imn; Fri, 23 Mar 2018 03:52:53 -0700 (PDT) X-Google-Smtp-Source: AG47ELu8cKI6ovGo+R7QraS4qbD557wFVJzmw7Rh8I2sgFUzZ3WdIdFDaEgmpNaNavmGCJP2EB5t X-Received: by 10.98.155.137 with SMTP id e9mr14051408pfk.109.1521802373707; Fri, 23 Mar 2018 03:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521802373; cv=none; d=google.com; s=arc-20160816; b=pBa8ss+1iQRGUE/TwpKb3hl5kNsQKCV7ief+fdiLMosJ1fXWkum0UiknojbkwFDHfP CbeoiHe37Sp7VKvlIGW+GtpVvqltcjwOxEb9bTmMwr0jNC5KdNlNrFDvtKm38cQuoSZj T4bCA20Dmo/I29sgdR8Qerr+M+TBVK5Et2K0smo0Yl0vj19+3OZzG5fPSw6bR3DWVaDl zf8hmHsrYecPpGMdfuscb7rNMH1yazLIA3IL7DA/MNDM2gabIknHhrjcnou/tViyqiLF A1UNZ5OcHLwnb73Kjm0YXDdSBNKsribWjknDCgUCqrr03nnoaRSCEHRLQy9zeiDI5jrV BN1w== 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=OOCUYZlzgWHc5HdEPWwX0U6MZcUpGJr2+QRC7T5aEEw=; b=zxA45IZZyoKAOOWGWMaAgg0Gp627fZXL+q3bgGwCS95YbJpT8HnvAVJzJLRtOdo0nL fl2Y4U5VpmGXrbBTJDi5o5Rtubi477Qk3/4hgkAwihWpurMdzQeyxruebHATdMFdMgbr U/Qy3WoefCYBqEIbIACnkxbRc/FdP/i/Ow4HkHzFg7RGwWvtv+Xm251c17Y+UPCNyc/1 Lg2Efa8CvTx/Zml/OLelKmI/Dfp+b06pa3kO74zk01uRqQRXlWcXuTgWEMir44aTkHpv LLh2RgRDyVqBI15z/jkRCG66Q8FhQ77LHyLsN9te7EB3kewjPvYfN83oCLYoxp2YILoG j0yA== 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 b1-v6si9211168pll.57.2018.03.23.03.52.39; Fri, 23 Mar 2018 03:52:53 -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 S1756003AbeCWKOQ (ORCPT + 99 others); Fri, 23 Mar 2018 06:14:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45100 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755901AbeCWKOO (ORCPT ); Fri, 23 Mar 2018 06:14:14 -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 905B31234; Fri, 23 Mar 2018 10:14:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Vasut , Andy Shevchenko , Mark Brown , Sasha Levin Subject: [PATCH 4.4 19/97] spi: dw: Disable clock after unregistering the host Date: Fri, 23 Mar 2018 10:54:06 +0100 Message-Id: <20180323094158.546147392@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marek Vasut [ Upstream commit 400c18e3dc86e04ef5afec9b86a8586ca629b9e9 ] The dw_mmio driver disables the block clock before unregistering the host. The code unregistering the host may access the SPI block registers. If register access happens with block clock disabled, this may lead to a bus hang. Disable the clock after unregistering the host to prevent such situation. This bug was observed on Altera Cyclone V SoC. Signed-off-by: Marek Vasut Cc: Andy Shevchenko Cc: Mark Brown Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-dw-mmio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -120,8 +120,8 @@ static int dw_spi_mmio_remove(struct pla { struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev); - clk_disable_unprepare(dwsmmio->clk); dw_spi_remove_host(&dwsmmio->dws); + clk_disable_unprepare(dwsmmio->clk); return 0; }