An error occurred fetching the project authors.
  1. 16 Nov, 2016 1 commit
  2. 21 Oct, 2016 1 commit
  3. 24 Aug, 2016 1 commit
  4. 13 Jul, 2016 1 commit
    • Max Kellermann's avatar
      [media] dvb_frontend: eliminate blocking wait in dvb_unregister_frontend() · fe35637b
      Max Kellermann authored
      The wait_event() call in dvb_unregister_frontend() waits synchronously
      for other tasks to free a file descriptor, but it does that while
      holding several mutexes.  That alone is a bad idea, but if one user
      process happens to keep a (defunct) file descriptor open indefinitely,
      the kernel will correctly detect a hung task:
      
          INFO: task kworker/0:1:314 blocked for more than 30 seconds.
                Not tainted 4.7.0-rc1-hosting+ #50
          "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
          kworker/0:1     D ffff88003daf7a50     0   314      2 0x00000000
          Workqueue: usb_hub_wq hub_event
           ffff88003daf7a50 0000000000000296 ffff88003daf7a30 ffff88003fc13f98
           ffff88003dadce00 ffff88003daf8000 ffff88003e3fc010 ffff88003d48d4f8
           ffff88003e3b5030 ffff88003e3f8898 ffff88003daf7a68 ffffffff810cf860
          Call Trace:
           [<ffffffff810cf860>] schedule+0x30/0x80
           [<ffffffff812f88d3>] dvb_unregister_frontend+0x93/0xc0
           [<ffffffff8107a000>] ? __wake_up_common+0x80/0x80
           [<ffffffff813019c7>] dvb_usb_adapter_frontend_exit+0x37/0x70
           [<ffffffff81300614>] dvb_usb_exit+0x34/0xb0
           [<ffffffff81300d4a>] dvb_usb_device_exit+0x3a/0x50
           [<ffffffff81302dc2>] pctv452e_usb_disconnect+0x52/0x60
           [<ffffffff81295a07>] usb_unbind_interface+0x67/0x1e0
           [<ffffffff810609f3>] ? __blocking_notifier_call_chain+0x53/0x70
           [<ffffffff8127ba67>] __device_release_driver+0x77/0x110
           [<ffffffff8127c2d3>] device_release_driver+0x23/0x30
           [<ffffffff8127ab5d>] bus_remove_device+0x10d/0x150
           [<ffffffff8127879b>] device_del+0x13b/0x260
           [<ffffffff81299dea>] ? usb_remove_ep_devs+0x1a/0x30
           [<ffffffff8129468e>] usb_disable_device+0x9e/0x1e0
           [<ffffffff8128bb09>] usb_disconnect+0x89/0x260
           [<ffffffff8128db8d>] hub_event+0x30d/0xfc0
           [<ffffffff81059475>] process_one_work+0x1c5/0x4a0
           [<ffffffff8105940c>] ? process_one_work+0x15c/0x4a0
           [<ffffffff81059799>] worker_thread+0x49/0x480
           [<ffffffff81059750>] ? process_one_work+0x4a0/0x4a0
           [<ffffffff81059750>] ? process_one_work+0x4a0/0x4a0
           [<ffffffff8105f65e>] kthread+0xee/0x110
           [<ffffffff810400bf>] ret_from_fork+0x1f/0x40
           [<ffffffff8105f570>] ? __kthread_unpark+0x70/0x70
          5 locks held by kworker/0:1/314:
           #0:  ("usb_hub_wq"){......}, at: [<ffffffff8105940c>] process_one_work+0x15c/0x4a0
           #1:  ((&hub->events)){......}, at: [<ffffffff8105940c>] process_one_work+0x15c/0x4a0
           #2:  (&dev->mutex){......}, at: [<ffffffff8128d8cb>] hub_event+0x4b/0xfc0
           #3:  (&dev->mutex){......}, at: [<ffffffff8128bad2>] usb_disconnect+0x52/0x260
           #4:  (&dev->mutex){......}, at: [<ffffffff8127c2cb>] device_release_driver+0x1b/0x30
      
      This patch removes the blocking wait, and postpones the kfree() call
      until all file handles have been closed by using struct kref.
      Signed-off-by: default avatarMax Kellermann <max@duempel.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
      fe35637b
  5. 27 Feb, 2016 1 commit
  6. 04 Feb, 2016 4 commits
    • Mauro Carvalho Chehab's avatar
      [media] dvb_frontend: Don't let drivers to trash data at cache · bb31d238
      Mauro Carvalho Chehab authored
      GET_FRONTEND and G_PROPERTY can be called anytime, even when the
      tuner/demod is not fully locked. However, several parameters
      returned by those calls are available only after the demod get
      VITERBI lock.
      
      While several drivers do the right thing by checking the status before
      returning the parameter, some drivers simply blindly update the
      DTV properties cache without checking if the registers at the
      hardware contain valid values.
      
      Due to that, programs that call G_PROPERTY (or GET_FRONTEND)
      before having a tuner lock may interfere at the zigzag logic,
      as the DVB kthread calls the set_frontend() callback several
      times, to fine tune the frequency and to identify if the signal
      is inverted or not.
      
      While the drivers should be fixed to report the right status,
      we should prevent that such bugs would actually interfere at the
      device operation.
      
      So, let's use a separate var for userspace calls to get frontend.
      
      As we copy the content of the cache, this should not cause any
      troubles.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      bb31d238
    • Mauro Carvalho Chehab's avatar
      [media] dvb_frontend: pass the props cache to get_frontend() as arg · 7e3e68bc
      Mauro Carvalho Chehab authored
      Instead of using the DTV properties cache directly, pass the get
      frontend data as an argument. For now, everything should remain
      the same, but the next patch will prevent get_frontend to
      affect the global cache.
      
      This is needed because several drivers don't care enough to only
      change the properties if locked. Due to that, calling
      G_PROPERTY before locking on those drivers will make them to
      never lock. Ok, those drivers are crap and should never be
      merged like that, but the core should not rely that the drivers
      would be doing the right thing.
      Reviewed-by: default avatarMichael Ira Krufky <mkrufky@linuxtv.org>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      7e3e68bc
    • Mauro Carvalho Chehab's avatar
      [media] dvb_frontend: add props argument to dtv_get_frontend() · 2ea9a08d
      Mauro Carvalho Chehab authored
      Instead of implicitly using the DTV cache properties at
      dtv_get_frontend(), pass it as an additional argument.
      
      This patch prepares to use a separate cache for G_PROPERTY,
      in order to avoid it to mangle with the DVB thread
      zigzag logic.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      2ea9a08d
    • Mauro Carvalho Chehab's avatar
      [media] dvb_frontend: print DTV property dump also for SET_PROPERTY · c29ebb64
      Mauro Carvalho Chehab authored
      When debugging troubles with DTV properties get/set, it is
      important to be able to see not only the properties from get, but
      also the ones from set. So, improve the dumps to allow reporting
      both.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      c29ebb64
  7. 01 Feb, 2016 1 commit
  8. 11 Jan, 2016 2 commits
    • Mauro Carvalho Chehab's avatar
      [media] dvb: modify core to implement interfaces/entities at MC new gen · df2f94e5
      Mauro Carvalho Chehab authored
      The Media Controller New Generation redefines the types for both
      interfaces and entities to be used on DVB. Make the needed
      changes at the DVB core for all interfaces, entities and
      data and interface links to appear in the graph.
      Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      df2f94e5
    • Mauro Carvalho Chehab's avatar
      [media] media: convert links from array to list · 57208e5e
      Mauro Carvalho Chehab authored
      The entire logic that represent graph links were developed on a
      time where there were no needs to dynamic remove links. So,
      although links are created/removed one by one via some
      functions, they're stored as an array inside the entity struct.
      
      As the array may grow, there's a logic inside the code that
      checks if the amount of space is not enough to store
      the needed links. If it isn't the core uses krealloc()
      to change the size of the link, with is bad, as it
      leaves the memory fragmented.
      
      So, convert links into a list.
      
      Also, currently,  both source and sink entities need the link
      at the graph traversal logic inside media_entity. So there's
      a logic duplicating all links. That makes it to spend
      twice the memory needed. This is not a big deal for today's
      usage, where the number of links are not big.
      
      Yet, if during the MC workshop discussions, it was said that
      IIO graphs could have up to 4,000 entities. So, we may
      want to remove the duplication on some future. The problem
      is that it would require a separate linked list to store
      the backlinks inside the entity, or to use a more complex
      algorithm to do graph backlink traversal, with is something
      that the current graph traversal inside the core can't cope
      with. So, let's postpone a such change if/when it is actually
      needed.
      
      It should also be noticed that the media_link structure uses
      44 bytes on 32-bit architectures and 84 bytes on 64-bit
      architecture. It will thus be allocated out of the 64-bytes and
      96-bytes pools respectively. That's a 12.5% memory waste on
      64-bit architectures and 31.25% on 32-bit architecture.
      A linked list is less efficient than an array in this case, but
      this could later be optimized if we can get rid of the reverse
      links (with would reduce memory allocation by 50%).
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      57208e5e
  9. 19 Nov, 2015 1 commit
    • Mauro Carvalho Chehab's avatar
      [media] fix dvb_frontend_sleep_until() logic · a733a41a
      Mauro Carvalho Chehab authored
      As pointed by Laurent Navet:
      	"Calling ktime_add_us() seems useless as is only useful
      	 for it's return value which is ignored."
      
      That's reported by coverity CID 1309761.
      
      Laurent proposed to just remove ktime_add_us, but the fact is that
      the logic of this function is broken. Instead, we need to use the
      value of the timeout, and ensure that it will work on the loops
      to emulate the legacy DiSEqC ioctl (FE_DISHNETWORK_SEND_LEGACY_CMD).
      
      Please notice that the logic was also broken if, for any reason,
      msleep() would sleep a little less than what it was expected, as
      newdelta would be smaller than delta, and udelay() would not be called.
      
      It should also be noticed that nobody noticed that trouble before
      likely because the FE_DISHNETWORK_SEND_LEGACY_CMD is not used
      anymore by modern DVB applications.
      Reported-by: default avatarLaurent Navet <laurent.navet@gmail.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      a733a41a
  10. 18 Nov, 2015 1 commit
  11. 17 Nov, 2015 2 commits
  12. 22 Aug, 2015 1 commit
  13. 10 Jun, 2015 2 commits
  14. 09 Jun, 2015 1 commit
    • Mauro Carvalho Chehab's avatar
      [media] dvb: Get rid of typedev usage for enums · 0df289a2
      Mauro Carvalho Chehab authored
      The DVB API was originally defined using typedefs. This is against
      Kernel CodingStyle, and there's no good usage here. While we can't
      remove its usage on userspace, we can avoid its usage in Kernelspace.
      
      So, let's do it.
      
      This patch was generated by this shell script:
      
      	for j in $(grep typedef include/uapi/linux/dvb/frontend.h |cut -d' ' -f 3); do for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f); do sed "s,${j}_t,enum $j," <$i >a && mv a $i; done; done
      
      While here, make CodingStyle fixes on the affected lines.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> # for drivers/media/firewire/*
      0df289a2
  15. 20 May, 2015 1 commit
  16. 26 Feb, 2015 1 commit
  17. 23 Feb, 2015 1 commit
  18. 13 Feb, 2015 3 commits
  19. 03 Nov, 2014 1 commit
  20. 26 Sep, 2014 1 commit
    • Mauro Carvalho Chehab's avatar
      [media] dvb_frontend: Fix __user namespace · 71d1b2be
      Mauro Carvalho Chehab authored
      As reported by smatch:
      
      drivers/media/dvb-core/dvb_frontend.c:1960:45: warning: incorrect type in argument 2 (different address spaces)
      drivers/media/dvb-core/dvb_frontend.c:1960:45:    expected void const [noderef] <asn:1>*from
      drivers/media/dvb-core/dvb_frontend.c:1960:45:    got struct dtv_property *[noderef] <asn:1>props
      drivers/media/dvb-core/dvb_frontend.c:1992:45: warning: incorrect type in argument 2 (different address spaces)
      drivers/media/dvb-core/dvb_frontend.c:1992:45:    expected void const [noderef] <asn:1>*from
      drivers/media/dvb-core/dvb_frontend.c:1992:45:    got struct dtv_property *[noderef] <asn:1>props
      drivers/media/dvb-core/dvb_frontend.c:2014:38: warning: incorrect type in argument 1 (different address spaces)
      drivers/media/dvb-core/dvb_frontend.c:2014:38:    expected void [noderef] <asn:1>*to
      drivers/media/dvb-core/dvb_frontend.c:2014:38:    got struct dtv_property *[noderef] <asn:1>props
      drivers/media/dvb-core/dvb_frontend.c:1946:17: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1947:17: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1951:22: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1951:42: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1954:31: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1960:41: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1960:54: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1965:33: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1978:17: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1979:17: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1983:22: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1983:42: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1986:31: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1992:41: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:1992:54: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:2007:33: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:2014:34: warning: dereference of noderef expression
      drivers/media/dvb-core/dvb_frontend.c:2014:52: warning: dereference of noderef expression
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
      71d1b2be
  21. 26 Aug, 2014 1 commit
  22. 21 Aug, 2014 1 commit
    • Mauro Carvalho Chehab's avatar
      [media] dvb-frontend: add core support for tuner suspend/resume · 59d7889a
      Mauro Carvalho Chehab authored
      While several tuners have some sort of suspend/resume
      implementation, this is currently mangled with an optional
      .sleep callback that it is also used to put the device on
      low power mode.
      
      Not all drivers implement it, as returning the driver from
      low power may require to re-load the firmware, with takes
      some time. Also, some drivers may delay it.
      
      So, the more coherent is to add two new optional callbacks
      that will let the tuners to directy implement suspend and
      resume callbacks if they need.
      Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
      59d7889a
  23. 26 Jul, 2014 2 commits
  24. 17 Jun, 2014 1 commit
  25. 12 Mar, 2014 1 commit
  26. 04 Mar, 2014 1 commit
  27. 29 Apr, 2013 1 commit
  28. 21 Mar, 2013 1 commit
  29. 18 Mar, 2013 2 commits
  30. 15 Feb, 2013 1 commit