From mboxrd@z Thu Jan 1 00:00:00 1970 From: leiming Subject: Re: 2.6.30-rc2-git2: Reported regressions from 2.6.29 Date: Sat, 18 Apr 2009 11:50:51 +0800 Message-ID: <20090418115051.175f292f@linux-lm> References: <200904172336.12414.rjw@sisk.pl> <20090418103226.54250420@linux-lm> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=X32QZXZOqn02ZMWC7oAzrf7qELpjYyH7VpsmtBNHY3E=; b=SlmlLCplmfjyCMpMT9zyIUcpBBE/soO94F+6ud4CD5QBfIFGeYB8Vf2EDuHM1Tom17 N4ZrRjTo/8zi8ohdW9KsW9vChNNRFjtNBMKpqSts8HUlOZIdvG2TOFxSqVjNqv0HoS7F WmKV4tfCUw4ECi5kIzIrKwuvpu5m636rKKDzE= In-Reply-To: Sender: linux-acpi-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Linus Torvalds Cc: "Rafael J. Wysocki" , Linux Kernel Mailing List , Adrian Bunk , Andrew Morton , Natalie Protasevich , Kernel Testers List , Network Development , Linux ACPI , Linux PM List , Linux SCSI List , video4linux-list@redhat.com, laurent.pinchart@skynet.be, mchehab@infradead.org On Fri, 17 Apr 2009 19:55:29 -0700 (PDT) Linus Torvalds wrote: > @@ -742,7 +742,7 @@ static int uvc_alloc_urb_buffers(struct > > uvc_video_device *video, > > /* Buffers are already allocated, bail out. */ > > if (video->urb_size) > > - return 0; > > + return DIV_ROUND_UP(video->urb_size, psize); > > I don't think this is right. It should round _down_. > > It's supposed to return 'npackets', but if you pass it a different > packet size than it was passed originally, it can now return a Now uvc only uses the previous allocated buffer in suspend/resume path, so the packet size doen't change in this path. > potentially bigger number than the already allocated buffer, no? If this case does exist, the URBs need to be updated and the patch is not enough. > > So I think it should round down (ie use a regular divide). No? Because the following fact: uvc_alloc_urb_buffers() { ... video->urb_size = psize * npackets; ... } so DIV_ROUND_UP still can work correctly. Thanks! -- Lei Ming