From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: 2.6.30-rc2-git2: Reported regressions from 2.6.29 Date: Sat, 18 Apr 2009 14:33:09 +0200 Message-ID: <200904181433.11950.rjw__35645.7792375751$1240058300$gmane$org@sisk.pl> References: <20090418125111.6646e997@linux-lm> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090418125111.6646e997@linux-lm> Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: leiming Cc: Adrian Bunk , Linux SCSI List , Network Development , Linux Kernel Mailing List , Natalie Protasevich , mchehab@infradead.org, Linux ACPI , video4linux-list@redhat.com, laurent.pinchart@skynet.be, Andrew Morton , Kernel Testers List , Linus Torvalds , Linux PM List List-Id: linux-pm@vger.kernel.org On Saturday 18 April 2009, leiming wrote: > 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 > > potentially bigger number than the already allocated buffer, no? > > > > So I think it should round down (ie use a regular divide). No? > > Yes,you are correct, please ignore my last reply, and following is > the fixed patch. > > Thanks. Thanks for the patch, I've updated the bug entry to point to it. Best, Rafael > From a3b3d72cdd57a0699fb643b41b78eb7beb211ff5 Mon Sep 17 00:00:00 2001 > From: Ming Lei > Date: Wed, 15 Apr 2009 22:32:51 +0800 > Subject: [PATCH] V4L/DVB:usbvideo:fix uvc resume failed(v2) > > Now urb buffers is not freed before suspend, so uvc_alloc_urb_buffers > should return packet counts allocated originally during uvc resume > , instead of zero. > > This version uses round down to return packet counts on Linus's > suggestions, or else may lead to buffer destructed if packet size > is changed before calling uvc_alloc_urb_buffers() in this kind of > case. > > This patch is against v2.6.30-rc2. > > Signed-off-by: Ming Lei > --- > drivers/media/video/uvc/uvc_video.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c > index a95e173..6ce974d 100644 > --- a/drivers/media/video/uvc/uvc_video.c > +++ b/drivers/media/video/uvc/uvc_video.c > @@ -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 video->urb_size / psize; > > /* Compute the number of packets. Bulk endpoints might transfer UVC > * payloads accross multiple URBs. > -- > 1.6.0.GIT