Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2300159ybl; Thu, 19 Dec 2019 11:13:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwR89mo1t2dSisDhVC41/BA6mJ7H7ZNisjwOhw6fiVIXUtN6hqFIabImoPsfKOYx63BbVKB X-Received: by 2002:a05:6830:1704:: with SMTP id 4mr10207122otk.294.1576782790582; Thu, 19 Dec 2019 11:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782790; cv=none; d=google.com; s=arc-20160816; b=KRePV93WV40ovG9iaa6AovZqTRDhZKY+Y1SKuLJkNrbJtNTF0QZ+9inJVzJzXgJNQ2 1UUh3WkO1Vnvzcw+gAd2KeBV5G6ik/KTBkzwPpQDE4A67Cx3g7BLFxiIeEO7gmlLhIfr gwGlYsDGLHGYbXTL7gByXa8C4q/HCLUywC2UyzSw4Jc0vPTAVmh5baJI6Am2DM2qss2g FzO+EF0+9RSLrElsYjQJfE8ZoW0PuuTR1g2bUUSSWF1nNOq7UoZ82/Onpqw4H4OTFnQ/ 4QUd6uuyarYkZEaCI6eCRu4I6CSMVga72DsN5ek/CfqGStJFowPBBufPi35+jnXx11n5 3y5A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z0Yt1A5Onqt7l4US9jK/xFDGKlq0J/lz67txnlWDQDg=; b=aR76z4UbEXNbzskJLl6YvE2XwGhMdSNVMGruCL1RAbUm+toS6Tb+JGa91BinC4wrsQ FVdTPhUwVSMh29OZZT5C86p6kIPGoo8nL04uXTzjoW0NcFvWArujyFXmzxOqWj3gY6oZ 4oOkS6c2iJkgpm/9b57lO+kc6LcQQWkrU4O1e39gkVv1DeT2A/EYzhlQ1E8xqGwuQ9hU 2T+0Iat0FfyGwQWqahzvGj8Q3yiEmng9LleOe4MWrtDngWGzCCyfOpeD6F9mNw3E3nEM IninpG9mtv/H/bpKJokgszrusXi+NRLmRRsElje6zI8JTYhWtt002uTkdZLXrxbV/UAu L+JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1Sstw86J; 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 r10si3699437otn.241.2019.12.19.11.12.58; Thu, 19 Dec 2019 11:13:10 -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; dkim=pass header.i=@kernel.org header.s=default header.b=1Sstw86J; 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 S1727150AbfLSTMV (ORCPT + 99 others); Thu, 19 Dec 2019 14:12:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:54238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727733AbfLSSg6 (ORCPT ); Thu, 19 Dec 2019 13:36:58 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9087F24672; Thu, 19 Dec 2019 18:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780618; bh=56QFzUMWtQU8kUR0DlruehlljdgnFAi9DLsxSd8O3Hc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Sstw86Jj6m7145POuvcQlKK30bUEvTo8/mmlcOaAFN9qTQq8M2RaVBG4wiLwC7mD Ura/hZy45TaS/3AYrRok89FuftvSkJvtc/3xRHHIldDV+EERV2VvfpSrPru4BmNqrH /iX+d02+z56fBqzuTLrccf3kJ0mIkJDf1AjE+F6Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jia-Ju Bai , Linus Walleij , Vinod Koul , Sasha Levin Subject: [PATCH 4.4 030/162] dmaengine: coh901318: Fix a double-lock bug Date: Thu, 19 Dec 2019 19:32:18 +0100 Message-Id: <20191219183209.489314295@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183150.477687052@linuxfoundation.org> References: <20191219183150.477687052@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai [ Upstream commit 627469e4445b9b12e0229b3bdf8564d5ce384dd7 ] The function coh901318_alloc_chan_resources() calls spin_lock_irqsave() before calling coh901318_config(). But coh901318_config() calls spin_lock_irqsave() again in its definition, which may cause a double-lock bug. Because coh901318_config() is only called by coh901318_alloc_chan_resources(), the bug fix is to remove the calls to spin-lock and -unlock functions in coh901318_config(). Signed-off-by: Jia-Ju Bai Reviewed-by: Linus Walleij Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/dma/coh901318.c | 4 ---- 1 file changed, 4 deletions(-) --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c @@ -1815,8 +1815,6 @@ static int coh901318_config(struct coh90 int channel = cohc->id; void __iomem *virtbase = cohc->base->virtbase; - spin_lock_irqsave(&cohc->lock, flags); - if (param) p = param; else @@ -1836,8 +1834,6 @@ static int coh901318_config(struct coh90 coh901318_set_conf(cohc, p->config); coh901318_set_ctrl(cohc, p->ctrl_lli_last); - spin_unlock_irqrestore(&cohc->lock, flags); - return 0; }