Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753442Ab1CUOJm (ORCPT ); Mon, 21 Mar 2011 10:09:42 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:48919 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753194Ab1CUOJk (ORCPT ); Mon, 21 Mar 2011 10:09:40 -0400 Date: Mon, 21 Mar 2011 10:09:38 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Oliver Neukum cc: Jiri Kosina , Greg KH , , Subject: Re: "usb_wwan: error case of resume" (16871dcac) is buggy In-Reply-To: <201103211011.07282.oneukum@suse.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1461 Lines: 40 On Mon, 21 Mar 2011, Oliver Neukum wrote: > Am Montag, 21. M?rz 2011, 01:36:45 schrieb Jiri Kosina: > > Hi, > > > > the commit in subject make the kernel with CONFIG_PM_RUNTIME unset fail > > during compilation, as struct dev_pm_info doesn't have whole bunch of > > members in such case. > > > > The commit in question adds this code: > > > > /* we have to throw away the rest */ > > do { > > unbusy_queued_urb(urb, portdata); > > //extremely dirty > > atomic_dec(&port->serial->interface->dev.power.usage_count); > > } while ((urb = usb_get_from_anchor(&portdata->delayed))); > > > > The 'extermely dirty' comment makes me a bit nervous whether the patch > > below is correct or some more thinking would be necessary. > > I've since posted a clean patch, although your fix looks correct to me. In fact the original code and Jiri's fix are both wrong. The layering violation here is not only inelegant, it is downright buggy. The USB core contains its own usage_count for interfaces, in parallel with the usage_count in interface->dev.power. Bypassing the USB layer in this way causes the two counts to get out of sync, which will lead to errors. Oliver's new fix is correct. Alan Stern -- 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/