Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755506AbbHYMh7 (ORCPT ); Tue, 25 Aug 2015 08:37:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:34408 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753805AbbHYMh6 (ORCPT ); Tue, 25 Aug 2015 08:37:58 -0400 Message-ID: <1440506198.13824.5.camel@suse.com> Subject: Re: [PATCH] usbnet: Fix two races between usbnet_stop() and the BH From: Oliver Neukum To: Alan Stern Cc: David Miller , eugene.shatokhin@rosalab.ru, bjorn@mork.no, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 25 Aug 2015 14:36:38 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 895 Lines: 26 On Mon, 2015-08-24 at 14:21 -0400, Alan Stern wrote: > > In theory, an architecture could implement atomic bit operations > using > > a spinlock to insure atomicity. I don't know if any architectures > do > > this, but if they do then the scenario above could arise. > > Now that I see this in writing, I realize it's not possible after > all. > clear_bit() et al. will work with a single unsigned long, which > doesn't > leave any place for spinlocks or other mechanisms. I was thinking of > atomic_t. Refuting yourself you are making the assumption that the lock has to be inside the data structure. That is not true. Regards Oliver -- 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/