Received: by 10.223.185.116 with SMTP id b49csp8506703wrg; Fri, 2 Mar 2018 03:05:16 -0800 (PST) X-Google-Smtp-Source: AG47ELvWqiMnZA72iKV6nyzQ36KbqFGhNftqVnTdl+RG4ZvWsqUeTejVnsbHm6BR7w/XAXxZqAOf X-Received: by 10.101.100.214 with SMTP id t22mr4296226pgv.333.1519988716630; Fri, 02 Mar 2018 03:05:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519988716; cv=none; d=google.com; s=arc-20160816; b=N+S091RDsTPq7nnGfpSLDxW9p7CLXkUMaAV9lPbfwk15rS2t4zf1ESFRSK67mFEiqZ TyJv2VKfYHC0lKXcRT+JCPHshs3pZKCsbuFpBgcXQZBYQXw4xrI3AMLkTMKmW3Ybksb0 ZfxCTUbqXt6nskmh9wVn/8Hvqu7MK473LEO3hi6KDn9f+hyi+iKVWBi1QN03Dw/5/r2c +ehwr4EB7iSre7MY0/33SwxKnyWfhloRHSr0Nf/DLeeM0plsyFDtSK8SFbg4pLMUUMtW vSi7papyNm9b+j3NHjkOi3LAj8GK2t+PvXpqyoCkd6RHP8H7pS15NJ4dd9bXWx6avf/H xBEQ== 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=mI45qsHPvekLbOcampYwefzmGtxV2kZwC0svZ3zB8UY=; b=uYb3tEC8ZSLX7dlAtXtxqsW45epkVF35fDakWTRft0f2mp5vsU6m3Mkj9jExE/FHM1 EyaL4O94SoFjX0ExN6XJAEYMY4AyChPq4Yxvk77pEfBn136EFSLi02ZFLEz8bH6huvG4 K4RzWf5Vf9Pti3i6G3TUwpvhayEQnHjAhPKThQDegHL8ZTkwghzyMEmISIqMKaFYQ2ps JlSPSHNpSr97qUPOMe2so+ZvAlk8zxgtYy927Ji1nffaEi26XV2uBENu0+6aCAmwnXZB KJHI6pdY2wia+PZXZASEE7aQ7CKF/RIdhTdJbzsL7HbY+4ArUlYhkzfY9OWVgab6gnl9 R3RA== 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 i30si3876561pgn.252.2018.03.02.03.05.02; Fri, 02 Mar 2018 03:05:16 -0800 (PST) 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 S1423694AbeCBIzf (ORCPT + 99 others); Fri, 2 Mar 2018 03:55:35 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50798 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423681AbeCBIzd (ORCPT ); Fri, 2 Mar 2018 03:55:33 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CD3E71242; Fri, 2 Mar 2018 08:55:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jia-Ju Bai , Radu Pirea , Mark Brown , Sasha Levin Subject: [PATCH 4.4 08/34] spi: atmel: fixed spin_lock usage inside atmel_spi_remove Date: Fri, 2 Mar 2018 09:51:04 +0100 Message-Id: <20180302084436.531804809@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180302084435.842679610@linuxfoundation.org> References: <20180302084435.842679610@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: Radu Pirea [ Upstream commit 66e900a3d225575c8b48b59ae1fe74bb6e5a65cc ] The only part of atmel_spi_remove which needs to be atomic is hardware reset. atmel_spi_stop_dma calls dma_terminate_all and this needs interrupts enabled. atmel_spi_release_dma calls dma_release_channel and dma_release_channel locks a mutex inside of spin_lock. So the call of these functions can't be inside a spin_lock. Reported-by: Jia-Ju Bai Signed-off-by: Radu Pirea Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/spi/spi-atmel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1669,12 +1669,12 @@ static int atmel_spi_remove(struct platf pm_runtime_get_sync(&pdev->dev); /* reset the hardware and block queue progress */ - spin_lock_irq(&as->lock); if (as->use_dma) { atmel_spi_stop_dma(as); atmel_spi_release_dma(as); } + spin_lock_irq(&as->lock); spi_writel(as, CR, SPI_BIT(SWRST)); spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */ spi_readl(as, SR);