1. 23 2月, 2016 2 次提交
  2. 16 2月, 2016 2 次提交
    • M
      [media] siano: use generic function to create MC device · 3d0ccad0
      Mauro Carvalho Chehab 提交于
      Currently, it is initializing the driver name using the wrong
      name ("usb"). Use the generic function, as its logic works
      best, and avoids repeating the very same code everywhere.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      3d0ccad0
    • M
      [media] smsusb: don't sleep while atomic · dd47fbd4
      Mauro Carvalho Chehab 提交于
      smscore_getbuffer() calls internally wait_event(), with can sleep.
      As smsusb_onresponse() is called on interrupt context, this causes
      the following warning:
      
      	BUG: sleeping function called from invalid context at drivers/media/common/siano/smscoreapi.c:1653
      	in_atomic(): 1, irqs_disabled(): 1, pid: 11084, name: systemd-udevd
      	INFO: lockdep is turned off.
      	irq event stamp: 0
      	hardirqs last  enabled at (0): [<          (null)>]           (null)
      	hardirqs last disabled at (0): [<ffffffff811480f7>] copy_process.part.7+0x10e7/0x56d0
      	softirqs last  enabled at (0): [<ffffffff81148193>] copy_process.part.7+0x1183/0x56d0
      	softirqs last disabled at (0): [<          (null)>]           (null)
      	CPU: 2 PID: 11084 Comm: systemd-udevd Tainted: G    B   W       4.5.0-rc3+ #47
      	Hardware name:                  /NUC5i7RYB, BIOS RYBDWi35.86A.0350.2015.0812.1722 08/12/2015
      	 0000000000000000 ffff8803c6907a80 ffffffff81933901 ffff8802bd916000
      	 ffff8802bd9165c8 ffff8803c6907aa8 ffffffff811c6af5 ffff8802bd916000
      	 ffffffffa0ce9b60 0000000000000675 ffff8803c6907ae8 ffffffff811c6ce5
      	Call Trace:
      	 <IRQ>  [<ffffffff81933901>] dump_stack+0x85/0xc4
      	 [<ffffffff811c6af5>] ___might_sleep+0x245/0x3a0
      	 [<ffffffff811c6ce5>] __might_sleep+0x95/0x1a0
      	 [<ffffffffa0ce020a>] ? list_add_locked+0xca/0x140 [smsmdtv]
      	 [<ffffffffa0ce3b8d>] smscore_getbuffer+0x7d/0x120 [smsmdtv]
      	 [<ffffffff8123819d>] ? trace_hardirqs_off+0xd/0x10
      	 [<ffffffffa0ce3b10>] ? smscore_sendrequest_and_wait.isra.5+0x120/0x120 [smsmdtv]
      	 [<ffffffffa0ce020a>] ? list_add_locked+0xca/0x140 [smsmdtv]
      	 [<ffffffffa0ce13ca>] ? smscore_putbuffer+0x3a/0x40 [smsmdtv]
      	 [<ffffffffa0d107bc>] smsusb_submit_urb+0x2ec/0x4f0 [smsusb]
      	 [<ffffffffa0d10e36>] smsusb_onresponse+0x476/0x720 [smsusb]
      
      Let's add a work queue to handle the bottom half, preventing this
      problem.
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      dd47fbd4
  3. 11 1月, 2016 1 次提交
    • J
      [media] media-device: split media initialization and registration · 9832e155
      Javier Martinez Canillas 提交于
      The media device node is registered and so made visible to user-space
      before entities are registered and links created which means that the
      media graph obtained by user-space could be only partially enumerated
      if that happens too early before all the graph has been created.
      
      To avoid this race condition, split the media init and registration
      in separate functions and only register the media device node when
      all the pending subdevices have been registered, either explicitly
      by the driver or asynchronously using v4l2_async_register_subdev().
      
      The media_device_register() had a check for drivers not filling dev
      and model fields but all drivers in mainline set them and not doing
      it will be a driver bug so change the function return to void and
      add a BUG_ON() for dev being NULL instead.
      
      Also, add a media_device_cleanup() function that will destroy the
      graph_mutex that is initialized in media_device_init().
      
      [mchehab@osg.samsung.com: Fix compilation if !CONFIG_MEDIA_CONTROLLER
       and remove two warnings added by this changeset]
      Suggested-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
      9832e155
  4. 03 3月, 2015 1 次提交
  5. 26 2月, 2015 8 次提交
  6. 26 9月, 2014 1 次提交
  7. 22 8月, 2014 1 次提交
  8. 11 3月, 2014 1 次提交
  9. 14 10月, 2013 3 次提交
    • M
      [media] siano: Use the default firmware for Stellar · b00ade2b
      Mauro Carvalho Chehab 提交于
      The Stellar firmware load routine is different. Improve it to use
      the default firmware, if no modprobe parameter tells otherwise.
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      Tested-by: NAndré Roth <neolynx@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      b00ade2b
    • M
      [media] siano: Fix initialization for Stellar models · 811a4f6d
      Mauro Carvalho Chehab 提交于
      Since kernel 3.8, the initialization for Stellar (sms1000)
      devices are broken.
      Those devices have a behaviour different than usual sms1100
      and sms2270: they start with one USB ID (devices in cold state),
      but after firmware load, they get a different USB ID.
      This weren't docummented at the driver. So, the patches that added
      support for sms2270 broke it.
      Properly documment it, and provide a debug log that allows to
      follow all phases of the device initialization:
      	smsusb_probe: board id=13, interface number 0
      	smsusb_probe: interface 0 won't be used. Expecting interface 1 to popup
      	smsusb_probe: board id=13, interface number 1
      	smsusb_probe: smsusb_probe 1
      	smsusb_probe: endpoint 0 81 02 64
      	smsusb_probe: endpoint 1 02 02 64
      	smsusb_probe: stellar device in cold state was found at usb\4-2.
      	smsusb1_load_firmware: sent 38144(38144) bytes, rc 0
      	smsusb1_load_firmware: read FW dvbt_bda_stellar_usb.inp, size=38144
      	smsusb_probe: stellar device now in warm state
      	usbcore: registered new interface driver smsusb
      	usb 4-2: USB disconnect, device number 52
      	usb 4-2: new full-speed USB device number 53 using uhci_hcd
      	usb 4-2: New USB device found, idVendor=187f, idProduct=0100
      	usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
      	usb 4-2: Product: SMS DVBT-BDA Receiver
      	usb 4-2: Manufacturer: Siano Mobile Silicon
      	smsusb_probe: board id=1, interface number 0
      	smsusb_probe: smsusb_probe 0
      	smsusb_probe: endpoint 0 81 02 64
      	smsusb_probe: endpoint 1 02 02 64
      	smsusb_init_device: in_ep = 81, out_ep = 02
      	smscore_register_device: allocated 50 buffers
      	smscore_register_device: device ffff88012a00bc00 created
      	smsusb_init_device: smsusb_start_streaming(...).
      	smscore_set_device_mode: set device mode to 4
      	smsusb1_detectmode: 4 "SMS DVBT-BDA Receiver"
      	smsusb_sendrequest: sending MSG_SMS_INIT_DEVICE_REQ(578) size: 12
      	smsusb_onresponse: received MSG_SMS_INIT_DEVICE_RES(579) size: 12
      	smscore_set_device_mode: Success setting device mode.
      	smscore_init_ir: IR port has not been detected
      	smscore_start_device: device ffff88012a00bc00 started, rc 0
      	smsusb_init_device: device 0xffff88002cfa6000 created
      	smsusb_probe: Device initialized with return code 0
      	DVB: registering new adapter (Siano Stellar Digital Receiver)
      	usb 4-2: DVB: registering adapter 0 frontend 0 (Siano Mobile Digital MDTV Receiver)...
      	smscore_register_client: ffff88012174a000 693 1
      	sms_board_dvb3_event: DVB3_EVENT_HOTPLUG
      	smsdvb_hotplug: success
      	smsdvb_module_init:
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      Tested-by: NAndré Roth <neolynx@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      811a4f6d
    • M
      [media] siano: Improve debug/info messages · f43b396c
      Mauro Carvalho Chehab 提交于
      Some messages are not clear, some are debug data, but are
      shown as errors, and one message is duplicated.
      Cleanup that mess in order to provide a cleaner log.
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      Tested-by: NAndré Roth <neolynx@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
      f43b396c
  10. 21 3月, 2013 8 次提交
  11. 04 1月, 2013 1 次提交
    • G
      Drivers: media: remove __dev* attributes. · 4c62e976
      Greg Kroah-Hartman 提交于
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      __devinitconst, and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4c62e976
  12. 14 8月, 2012 1 次提交
  13. 12 6月, 2012 1 次提交
  14. 04 5月, 2012 1 次提交
  15. 19 11月, 2011 1 次提交
    • G
      USB: convert drivers/media/* to use module_usb_driver() · ecb3b2b3
      Greg Kroah-Hartman 提交于
      This converts the drivers in drivers/media/* to use the
      module_usb_driver() macro which makes the code smaller and a bit
      simpler.
      
      Added bonus is that it removes some unneeded kernel log messages about
      drivers loading and/or unloading.
      
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Luca Risolia <luca.risolia@studio.unibo.it>
      Cc: Jean-Francois Moine <moinejf@free.fr>
      Cc: Frank Zago <frank@zago.net>
      Cc: Olivier Lorin <o.lorin@laposte.net>
      Cc: Erik Andren <erik.andren@gmail.com>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Brian Johnson <brijohn@gmail.com>
      Cc: Leandro Costantino <lcostantino@gmail.com>
      Cc: Antoine Jacquet <royale@zerezo.com>
      Cc: Jarod Wilson <jarod@redhat.com>
      Cc: Florian Mickler <florian@mickler.org>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Michael Krufky <mkrufky@kernellabs.com>
      Cc: "David Härdeman" <david@hardeman.nu>
      Cc: Florent Audebert <florent.audebert@anevia.com>
      Cc: Sam Doshi <sam@metal-fish.co.uk>
      Cc: Manu Abraham <manu@linuxtv.org>
      Cc: Olivier Grenie <olivier.grenie@dibcom.fr>
      Cc: Patrick Boettcher <patrick.boettcher@dibcom.fr>
      Cc: "Igor M. Liplianin" <liplianin@me.by>
      Cc: Derek Kelly <user.vdr@gmail.com>
      Cc: Malcolm Priestley <tvboxspy@gmail.com>
      Cc: Steven Toth <stoth@kernellabs.com>
      Cc: "André Weidemann" <Andre.Weidemann@web.de>
      Cc: Martin Wilks <m.wilks@technisat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Jose Alberto Reguero <jareguero@telefonica.net>
      Cc: David Henningsson <david.henningsson@canonical.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Jesper Juhl <jj@chaosbits.net>
      Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
      Cc: Hans Verkuil <hans.verkuil@cisco.com>
      Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
      Cc: Anssi Hannula <anssi.hannula@iki.fi>
      Cc: Rafi Rubin <rafi@seas.upenn.edu>
      Cc: Dan Carpenter <error27@gmail.com>
      Cc: Paul Bender <pebender@gmail.com>
      Cc: Devin Heitmueller <dheitmueller@kernellabs.com>
      Cc: "Márcio A Alves" <froooozen@gmail.com>
      Cc: Julia Lawall <julia@diku.dk>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Chris Rankin <rankincj@yahoo.com>
      Cc: Lee Jones <lee.jones@canonical.com>
      Cc: Andy Walls <awalls@md.metrocast.net>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Dean Anderson <linux-dev@sensoray.com>
      Cc: Pete Eberlein <pete@sensoray.com>
      Cc: Arvydas Sidorenko <asido4@gmail.com>
      Cc: Andrea Anacleto <andreaanacleto@libero.it>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ecb3b2b3
  16. 01 11月, 2011 1 次提交
  17. 27 9月, 2011 1 次提交
  18. 27 8月, 2011 1 次提交
    • D
      [media] siano: apply debug flag to module level · ea370943
      Doron Cohen 提交于
      Siano modules already had sms_dbg flag which is a module parameter which
      sets the debug mode so module prints messages to dmesg for debugging.
      The variable was static therefore apply only to the file which defines
      the module. In modules as smsmdtv.ko that contain a few files, the debug
      flag applied only for functions in that main file.
      flag was changed to be non-static and therefore can be accessed by all
      module files (although it is still not exported out of the module).
      Signed-off-by: NDoron Cohen <doronc@siano-ms.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      ea370943
  19. 20 5月, 2011 1 次提交
    • J
      [media] Media, DVB, Siano, smsusb: Avoid static analysis report about 'use after free' · 08921ac9
      Jesper Juhl 提交于
      In drivers/media/dvb/siano/smsusb.c we have this code:
       ...
                     kfree(dev);
      
                     sms_info("device %p destroyed", dev);
       ...
      
      at least one static analysis tool (Coverity Prevent) complains about this
      as a use-after-free bug.
      While it's true that we do use the pointer variable after freeing it, the
      only use is to print the value of the pointer, so there's not actually any
      problem here. But still, silencing the complaint is trivial by just moving
      the kfree() call below the sms_info(), so why not just do it?. It doesn't
      change the workings of the code in any way, but it makes the tool shut up.
      The patch below also removes a rather pointless blank line.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      08921ac9
  20. 29 12月, 2010 1 次提交
  21. 03 8月, 2010 1 次提交
  22. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6