···7777 12, FPIX_TIMEOUT);7878}79798080-/* workqueue */8080+/*8181+ * This function is called as a workqueue function and runs whenever the camera8282+ * is streaming data. Because it is a workqueue function it is allowed to sleep8383+ * so we can use synchronous USB calls. To avoid possible collisions with other8484+ * threads attempting to use gspca_dev->usb_buf we take the usb_lock when8585+ * performing USB operations using it. In practice we don't really need this8686+ * as the camera doesn't provide any controls.8787+ */8188static void dostream(struct work_struct *work)8289{8390 struct usb_fpix *dev = container_of(work, struct usb_fpix, work_struct);
+5-7
drivers/media/usb/gspca/jl2005bcd.c
···306306 return retval;307307}308308309309-/* This function is called as a workqueue function and runs whenever the camera309309+/*310310+ * This function is called as a workqueue function and runs whenever the camera310311 * is streaming data. Because it is a workqueue function it is allowed to sleep311312 * so we can use synchronous USB calls. To avoid possible collisions with other312312- * threads attempting to use the camera's USB interface the gspca usb_lock is313313- * used when performing the one USB control operation inside the workqueue,314314- * which tells the camera to close the stream. In practice the only thing315315- * which needs to be protected against is the usb_set_interface call that316316- * gspca makes during stream_off. Otherwise the camera doesn't provide any317317- * controls that the user could try to change.313313+ * threads attempting to use gspca_dev->usb_buf we take the usb_lock when314314+ * performing USB operations using it. In practice we don't really need this315315+ * as the camera doesn't provide any controls.318316 */319317static void jl2005c_dostream(struct work_struct *work)320318{
+2
drivers/media/usb/gspca/sn9c20x.c
···21972197 struct gspca_dev *gspca_dev = &sd->gspca_dev;21982198 s32 qual = v4l2_ctrl_g_ctrl(sd->jpegqual);2199219922002200+ /* To protect gspca_dev->usb_buf and gspca_dev->usb_err */22002201 mutex_lock(&gspca_dev->usb_lock);22012202 PDEBUG(D_STREAM, "qual_upd %d%%", qual);22032203+ gspca_dev->usb_err = 0;22022204 set_quality(gspca_dev, qual);22032205 mutex_unlock(&gspca_dev->usb_lock);22042206}
···201201 return 0;202202}203203204204-/* This function is called as a workqueue function and runs whenever the camera204204+/*205205+ * This function is called as a workqueue function and runs whenever the camera205206 * is streaming data. Because it is a workqueue function it is allowed to sleep206207 * so we can use synchronous USB calls. To avoid possible collisions with other207207- * threads attempting to use the camera's USB interface we take the gspca208208- * usb_lock when performing USB operations. In practice the only thing we need209209- * to protect against is the usb_set_interface call that gspca makes during210210- * stream_off as the camera doesn't provide any controls that the user could try211211- * to change.208208+ * threads attempting to use gspca_dev->usb_buf we take the usb_lock when209209+ * performing USB operations using it. In practice we don't really need this210210+ * as the camera doesn't provide any controls.212211 */213212static void sq905_dostream(struct work_struct *work)214213{
+5-7
drivers/media/usb/gspca/sq905c.c
···123123 return 0;124124}125125126126-/* This function is called as a workqueue function and runs whenever the camera126126+/*127127+ * This function is called as a workqueue function and runs whenever the camera127128 * is streaming data. Because it is a workqueue function it is allowed to sleep128129 * so we can use synchronous USB calls. To avoid possible collisions with other129129- * threads attempting to use the camera's USB interface the gspca usb_lock is130130- * used when performing the one USB control operation inside the workqueue,131131- * which tells the camera to close the stream. In practice the only thing132132- * which needs to be protected against is the usb_set_interface call that133133- * gspca makes during stream_off. Otherwise the camera doesn't provide any134134- * controls that the user could try to change.130130+ * threads attempting to use gspca_dev->usb_buf we take the usb_lock when131131+ * performing USB operations using it. In practice we don't really need this132132+ * as the camera doesn't provide any controls.135133 */136134static void sq905c_dostream(struct work_struct *work)137135{
+6-7
drivers/media/usb/gspca/vicam.c
···110110}111111112112/*113113- * request and read a block of data - see warning on vicam_command.113113+ * request and read a block of data114114 */115115static int vicam_read_frame(struct gspca_dev *gspca_dev, u8 *data, int size)116116{···170170 return 0;171171}172172173173-/* This function is called as a workqueue function and runs whenever the camera173173+/*174174+ * This function is called as a workqueue function and runs whenever the camera174175 * is streaming data. Because it is a workqueue function it is allowed to sleep175176 * so we can use synchronous USB calls. To avoid possible collisions with other176176- * threads attempting to use the camera's USB interface we take the gspca177177- * usb_lock when performing USB operations. In practice the only thing we need178178- * to protect against is the usb_set_interface call that gspca makes during179179- * stream_off as the camera doesn't provide any controls that the user could try180180- * to change.177177+ * threads attempting to use gspca_dev->usb_buf we take the usb_lock when178178+ * performing USB operations using it. In practice we don't really need this179179+ * as the cameras controls are only written from the workqueue.181180 */182181static void vicam_dostream(struct work_struct *work)183182{
+3-1
drivers/media/usb/gspca/zc3xx.c
···59455945 for (;;) {59465946 msleep(100);5947594759485948+ /* To protect gspca_dev->usb_buf and gspca_dev->usb_err */59485949 mutex_lock(&gspca_dev->usb_lock);59495950#ifdef CONFIG_PM59505951 if (gspca_dev->frozen)···68326831 return 0;68336832}6834683368356835-/* called on streamoff with alt 0 and on disconnect */68346834+/* called on streamoff with alt==0 and on disconnect */68356835+/* the usb_lock is held at entry - restore on exit */68366836static void sd_stop0(struct gspca_dev *gspca_dev)68376837{68386838 struct sd *sd = (struct sd *) gspca_dev;