1. 15 2月, 2017 1 次提交
  2. 21 10月, 2016 1 次提交
    • M
      [media] siano: don't break long lines · 67390d21
      Mauro Carvalho Chehab 提交于
      Due to the 80-cols restrictions, and latter due to checkpatch
      warnings, several strings were broken into multiple lines. This
      is not considered a good practice anymore, as it makes harder
      to grep for strings at the source code.
      
      As we're right now fixing other drivers due to KERN_CONT, we need
      to be able to identify what printk strings don't end with a "\n".
      It is a way easier to detect those if we don't break long lines.
      
      So, join those continuation lines.
      
      The patch was generated via the script below, and manually
      adjusted if needed.
      
      </script>
      use Text::Tabs;
      while (<>) {
      	if ($next ne "") {
      		$c=$_;
      		if ($c =~ /^\s+\"(.*)/) {
      			$c2=$1;
      			$next =~ s/\"\n$//;
      			$n = expand($next);
      			$funpos = index($n, '(');
      			$pos = index($c2, '",');
      			if ($funpos && $pos > 0) {
      				$s1 = substr $c2, 0, $pos + 2;
      				$s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2;
      				$s2 =~ s/^\s+//;
      
      				$s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne "");
      
      				print unexpand("$next$s1\n");
      				print unexpand("$s2\n") if ($s2 ne "");
      			} else {
      				print "$next$c2\n";
      			}
      			$next="";
      			next;
      		} else {
      			print $next;
      		}
      		$next="";
      	} else {
      		if (m/\"$/) {
      			if (!m/\\n\"$/) {
      				$next=$_;
      				next;
      			}
      		}
      	}
      	print $_;
      }
      </script>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      67390d21
  3. 23 2月, 2016 2 次提交
  4. 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
  5. 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
  6. 03 3月, 2015 1 次提交
  7. 26 2月, 2015 8 次提交
  8. 26 9月, 2014 1 次提交
  9. 22 8月, 2014 1 次提交
  10. 11 3月, 2014 1 次提交
  11. 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
  12. 21 3月, 2013 8 次提交
  13. 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
  14. 14 8月, 2012 1 次提交
  15. 12 6月, 2012 1 次提交
  16. 04 5月, 2012 1 次提交
  17. 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
  18. 01 11月, 2011 1 次提交
  19. 27 9月, 2011 1 次提交
  20. 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
  21. 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
  22. 29 12月, 2010 1 次提交