dvb_usb_v2 [RFC] draft use delayed work.
PATCH 1/1 dvb_usb_v2 [RFC] draft use delayed work.
dvb_usb_v2 [RFC] use delayed work.
The problem with an ordinary work queue it executes immediately.
changes made
1. Three extra states added DVB_USB_STATE_PROBE, DVB_USB_STATE_COLD and DVB_USB_STATE_WARM.
2. Initialise of priv moved to probe this shouldn't really be done in the work queue.
3. The initial delay 200ms waits for the probe to clear.
4. State DVB_USB_STATE_PROBE checks for interface to be BOUND then calls the identify_state(possibly extra timeout signals needed if binding fails).
5. The next schedule time now increases to 500ms execution following as before with state changing accordingly.
6. DVB_USB_STATE_INIT uses the value of 0x7 so clears the other states.
The work queue then dies forever. However, it could continue on as the remote work.
--- drivers/media/dvb/dvb-usb/dvb_usb.h | 13 ++-- drivers/media/dvb/dvb-usb/dvb_usb_init.c | 117 ++++++++++++++++-------------- 2 files changed, 69 insertions(+), 61 deletions(-)
drivers/media/dvb/dvb-usb/dvb_usb.h +8 -5
@@ -321,14 +321,17 @@ struct dvb_usb_device {const char *rc_map;struct dvb_usb_rc rc;struct usb_device *udev; -struct work_struct probe_work; +struct delayed_work probe_work;pid_t work_pid;struct usb_interface *intf; +#define DVB_USB_STATE_PROBE 0x00 +#define DVB_USB_STATE_COLD 0x01 +#define DVB_USB_STATE_WARM 0x03 +#define DVB_USB_STATE_INIT 0x07 +#define DVB_USB_STATE_I2C 0x08 +#define DVB_USB_STATE_DVB 0x10 +#define DVB_USB_STATE_REMOTE 0x20 -#define DVB_USB_STATE_INIT 0x000 -#define DVB_USB_STATE_I2C 0x001 -#define DVB_USB_STATE_DVB 0x002 -#define DVB_USB_STATE_REMOTE 0x004int state;int powered;
drivers/media/dvb/dvb-usb/dvb_usb_init.c +61 -56
165 lines not on this page · raw message
Signature · 1 line
1.7.10
Quoted 16 lines · Malcolm Priestley
dvb_usb_v2[RFC] use delayed work.The problem with an ordinary work queue it executes immediately.
changes made
1. Three extra states addedDVB_USB_STATE_PROBE,DVB_USB_STATE_COLDandDVB_USB_STATE_WARM.
2. Initialise of priv moved to probe this shouldn't really be done in the work queue.
3. The initial delay 200ms waits for the probe to clear.
4. StateDVB_USB_STATE_PROBEchecks for interface to be BOUND then calls theidentify_state(possibly extra timeout signals needed if binding fails).
5. The next schedule time now increases to 500ms execution following as before with state changing accordingly.
6.DVB_USB_STATE_INITuses the value of0x7so clears the other states.
Quoted 1 line
The work queue then dies forever. However, it could continue on as the remote work.
One question before I start to review those changes: as I explained firmware loading my earlier mail, are these changes valid any-more?
It sounds a little bit weird if I haven't meet these problems as I have tested those using multiple devices. af9015, anysee, ec168, au6610 and Cypress FX2 with warm/cold IDs.
regards
Antti
Signature · 1 line
http://palosaari.fi/