Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756980AbaJHMdb (ORCPT ); Wed, 8 Oct 2014 08:33:31 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:54491 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753787AbaJHMd3 (ORCPT ); Wed, 8 Oct 2014 08:33:29 -0400 MIME-Version: 1.0 In-Reply-To: <20141008120410.GE1990@localhost> References: <1411661254-5204-1-git-send-email-octavian.purdila@intel.com> <1411661254-5204-2-git-send-email-octavian.purdila@intel.com> <20141008092347.GB1990@localhost> <20141008120410.GE1990@localhost> Date: Wed, 8 Oct 2014 15:33:28 +0300 Message-ID: Subject: Re: [PATCH v6 1/4] mfd: add support for Diolan DLN-2 devices From: Octavian Purdila To: Johan Hovold Cc: Greg Kroah-Hartman , Linus Walleij , Alexandre Courbot , Wolfram Sang , Samuel Ortiz , Lee Jones , Arnd Bergmann , Daniel Baluta , Laurentiu Palcu , linux-usb@vger.kernel.org, lkml , "linux-gpio@vger.kernel.org" , linux-i2c@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 8, 2014 at 3:04 PM, Johan Hovold wrote: > On Wed, Oct 08, 2014 at 01:54:07PM +0300, Octavian Purdila wrote: >> On Wed, Oct 8, 2014 at 12:23 PM, Johan Hovold wrote: >> > On Thu, Sep 25, 2014 at 07:07:31PM +0300, Octavian Purdila wrote: >> > >> >> +static void dln2_rx_transfer(struct dln2_dev *dln2, struct urb *urb, >> >> + u16 handle, u16 rx_slot) >> >> +{ >> >> + struct dln2_mod_rx_slots *rxs = &dln2->mod_rx_slots[handle]; >> >> + struct dln2_rx_context *rxc; >> >> + struct device *dev = &dln2->interface->dev; >> >> + >> >> + spin_lock(&rxs->lock); >> > >> > You must use spin_lock_irqsave here as you call it from the completion >> > handler. >> >> Why? AFAICS the completion handler gets called from the HCD irq handler: > > The completion handler is currently called with local interrupts > disabled but that is about to change once all drivers have been updated: > > http://marc.info/?l=linux-usb&m=137353360511003&w=2 > > In this case you could probably get away with not disabling interrupts > anyway, but using the irqsave versions would make it obvious. > I was not assuming that interrupts are disabled while running the completion handler. Since that spinlock is not touched by any other interrupt context code I don't think irqsave is necessary. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/