From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755915Ab2IBIlV (ORCPT ); Sun, 2 Sep 2012 04:41:21 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:35379 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752404Ab2IBIlT (ORCPT ); Sun, 2 Sep 2012 04:41:19 -0400 MIME-Version: 1.0 In-Reply-To: <1344500582-11110-1-git-send-email-qiang.liu@freescale.com> References: <1344500582-11110-1-git-send-email-qiang.liu@freescale.com> Date: Sun, 2 Sep 2012 01:41:18 -0700 X-Google-Sender-Auth: YP_b-_s0fs150wFXrRmhV7TMI0s Message-ID: Subject: Re: [PATCH v7 6/8] fsl-dma: use spin_lock_bh to instead of spin_lock_irqsave From: Dan Williams To: qiang.liu@freescale.com Cc: linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, vinod.koul@intel.com, kim.phillips@freescale.com, herbert@gondor.hengli.com.au, davem@davemloft.net, arnd@arndb.de, gregkh@linuxfoundation.org, Li Yang , Timur Tabi Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 9, 2012 at 1:23 AM, wrote: > From: Qiang Liu > > The use of spin_lock_irqsave() is a stronger locking mechanism than is > required throughout the driver. The minimum locking required should be > used instead. Interrupts will be turned off and context will be saved, > there is needless to use irqsave. > > Change all instances of spin_lock_irqsave() to spin_lock_bh(). > All manipulation of protected fields is done using tasklet context or > weaker, which makes spin_lock_bh() the correct choice. It seems you are coordinating fsl-dma copy and talitos xor operations. It looks like fsl-dma will be called through talitos_process_pending()->dma_run_dependencies(), which is potentially called in hard irq context. This all comes back to the need to fix raid offload to manage the channels explicitly rather than the current dependency chains. -- Dan