From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ming Lei Subject: Re: 2.6.30-rc2-git2: Reported regressions from 2.6.29 Date: Tue, 21 Apr 2009 09:47:34 +0800 Message-ID: References: <20090418125111.6646e997@linux-lm> <200904202208.23899.laurent.pinchart@skynet.be> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=OmlSzyS681yogVq+rnYc/ec05tRzsZSO8ZbRLQEOZB4=; b=ds1bKLUzwGIjNw6GZciDnqKyO7pqkjnWiMAkLD9rsGH1pikGkuhhPsEh7iTs1BzHWW VXSuqrAPk+yL9WgjMPs5+kD2qrPI9lHQ39efJ4i5OPJt7ysKD3vQuS7jbaVd5sUDap7q y9TzzMnceMxBppwHNlBAHKgj9miADHRrrYhKc= In-Reply-To: <200904202208.23899.laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org> Sender: kernel-testers-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="iso-8859-1" To: Laurent Pinchart Cc: Linus Torvalds , "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-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, mchehab-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org 2009/4/21 Laurent Pinchart : > On Saturday 18 April 2009 06:51:11 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, >> > > =A0 /* Buffers are already allocated, bail out. */ >> > > =A0 if (video->urb_size) >> > > - =A0 =A0 =A0 =A0 return 0; >> > > + =A0 =A0 =A0 =A0 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. > > psize and video->urb_size shouldn't have changed before and after res= ume, > otherwise we'll get into trouble anyway. A regular divide and a round= -up > divide should then return the same result. I'll take the regular divi= de, as it > will be more efficient. Yes. > >> Thanks. >> >> From a3b3d72cdd57a0699fb643b41b78eb7beb211ff5 Mon Sep 17 00:00:00 20= 01 >> 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_buffer= s >> 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. > > The comment is misleading. If the packet size changes we need to real= locate > the buffers anyway. Have you checked if the packet size (which depend= s on the > endpoint being selected) can be changed between suspend and resume, e= ither by > the uvcvideo driver (I don't think it can) or the USB core ? The packet size does not change between suspend and resume. I mean uvc_alloc_urb_buffers() still can be used in other cases if buffers was not freed and is reuesed in future. It seems there is no such cases in uvcvideo now, but uvc_alloc_urb_buffers() really __can__ work in such case, isn't it? IMHO It is only used to allocate or reserve UVC_URBS usb buffers, which size is video->urb_size, and npackets can be shortened or enlarged if psize is changed, after all. Thanks! --=20 Lei Ming