Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6692648imu; Wed, 14 Nov 2018 05:39:47 -0800 (PST) X-Google-Smtp-Source: AJdET5e8XEWO26FsmMl9umvLkpMuNx3rXm0LNl1/uI6oPewjcHaFqeGEcasIZlBt/qh8Cq9loY46 X-Received: by 2002:a62:8647:: with SMTP id x68-v6mr2120234pfd.252.1542202787604; Wed, 14 Nov 2018 05:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542202787; cv=none; d=google.com; s=arc-20160816; b=Ems7sqmoeab5fjYUuHsv5Yk0ij+bO91o0q2znZ/O5bcxnlEso+MkIH3+l3tedASsdd JKXgKm31TWYBwLMfOkmX1jJCi8EcHsBQFQ4vJP0NBPkv7fiPq/U68tkwvgH7NCa0nohL AkRxClYSLfggBln6I6hAZwHaVyb9K1Qdsk76yVqqpO7NpDSTD1H+99G8a1NY8USyYd/o mHsmUHs5qkRu5laQox1cdFWeioRCxu9tKySM5s8T4YuJFB/UDy0CUSNeiO45+JQSjHfD mEXWExlwleWt+qyTIy05apC8YYWrneDpq4BAUperLJPUTKLDahkKJx6/J5Q0UjBUU2Rb 84Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=H+GlFOd2kBh4I96SmNapQmNPP148th00LGr85VLOROg=; b=gnwO9cKC4MwnEMEF/8Rc0q9PmykwrVsK9/DbEAx4TBcZrc2XdnO+KdA0uWXuOv5/2J w977lv9LYcJv97QZL35SUFTyfjYEprlNYo0WmIjDOpA35unrpaZC1u8me69/5KiHuVFx A4gM4VqwF+I22l8Y+79LT35FCLfuVLTONqYa/lFKPQkoTOpHbKw7IySpZjWXSP7BpFy1 EOUzVqHXMWf/mLo4zTTcFcF1XJDOvRpibnvT5Vs+iuSPnUGzAJqyJ4T1U81vwFsuSGRd UsaWG2VWUqA3iqrsBCIj8KS0lsuH5HGrncvt+9uUodlImllFXtcdmfkwT9Tk47hgi1ST Mihg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kBguShRR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o61-v6si25144992pld.187.2018.11.14.05.39.30; Wed, 14 Nov 2018 05:39:47 -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=@linaro.org header.s=google header.b=kBguShRR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732988AbeKNXk0 (ORCPT + 99 others); Wed, 14 Nov 2018 18:40:26 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:33729 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729807AbeKNXk0 (ORCPT ); Wed, 14 Nov 2018 18:40:26 -0500 Received: by mail-lf1-f66.google.com with SMTP id i26so11529809lfc.0 for ; Wed, 14 Nov 2018 05:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H+GlFOd2kBh4I96SmNapQmNPP148th00LGr85VLOROg=; b=kBguShRR3Zkd9q3TgJ+bgzkQVeP2Z8y/qV7eLSoOutOI55ESLQU/6cCKIabvWRHg6W 6FczbfBzA4jWCwTmLJxr6kx2ZwzWEqmRYrGoFWAZ/MThlL6lVTOXHHDq82VNl2CavX3S 5rzzkkoLzK7kMzZZXROZBIxZKYhS7gWr1RNxM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H+GlFOd2kBh4I96SmNapQmNPP148th00LGr85VLOROg=; b=EQfRtMPDDAVcQomTDVJF/YPf09v0dbOl8whZEiM6tcwsD7ivuoFdQiiCdKjTK+VjuX 0ayXFWdmwkh1W3c5HJcfJr/lVeXYmJOyQF30Yt4flAeWrtIPV0emor1leofwE9/IG1F7 Nh0nUTjhGJf51xxPZDv8nzww/n42KkopoOAEoQN2JnqPhRZi+fMQmEf3pqPCsTN5KJg+ pboMwojrqo12yww5Vjo2sH3+stjpc9vvXhrZV0jw/usR45hHreomxZUgRaBRvoUfSelx YQvRRFtygRSeUKSXdKk/jCf17I8erxZHbaU3F54byT2cpXdGZ5QPznmIY70tLJZahxot Ap2g== X-Gm-Message-State: AGRZ1gKIuOBtc5cMt6czgax9KMJlnZwTGE5L1KnVpcTW7iHIMY2OC9wt kbPZ8J/Ilj+QthlucxrNat9Tz5RYiBZi0Z7RvT8Z/g== X-Received: by 2002:a19:5154:: with SMTP id f81mr1118808lfb.96.1542202627303; Wed, 14 Nov 2018 05:37:07 -0800 (PST) MIME-Version: 1.0 References: <20181106033348.27361-1-baijiaju1990@gmail.com> In-Reply-To: <20181106033348.27361-1-baijiaju1990@gmail.com> From: Linus Walleij Date: Wed, 14 Nov 2018 14:36:55 +0100 Message-ID: Subject: Re: [PATCH] dma: coh901318: Fix a double-lock bug To: baijiaju1990@gmail.com Cc: vkoul@kernel.org, Dan Williams , Linux ARM , dmaengine@vger.kernel.org, "linux-kernel@vger.kernel.org" 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 On Tue, Nov 6, 2018 at 4:33 AM Jia-Ju Bai wrote: > 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 Yours, Linus Walleij