23 Feb, 2016

2 commits

  • Right now, media_device_pci_init and media_device_usb_init does
    media_device allocation internaly. That preents its usage when
    the media_device struct is embedded on some other structure.

    Move memory allocation outside it, to make it more generic.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     
  • Those ancillary functions could be called even when compiled
    without V4L2 support, as warned by ktest build robot:

    All errors (new ones prefixed by >>):

    >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb/dvb-usb.ko] undefined!
    >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/dvb-usb-v2/dvb_usb_v2.ko] undefined!
    >> ERROR: "__v4l2_mc_usb_media_device_init" [drivers/media/usb/au0828/au0828.ko] undefined!

    Also, there's nothing there that are specific to V4L2. So, move
    those ancillary functions to MC core.

    No functional changes. Just function rename.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

16 Feb, 2016

2 commits

  • 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: Mauro Carvalho Chehab

    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): [] copy_process.part.7+0x10e7/0x56d0
    softirqs last enabled at (0): [] 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:
    [] dump_stack+0x85/0xc4
    [] ___might_sleep+0x245/0x3a0
    [] __might_sleep+0x95/0x1a0
    [] ? list_add_locked+0xca/0x140 [smsmdtv]
    [] smscore_getbuffer+0x7d/0x120 [smsmdtv]
    [] ? trace_hardirqs_off+0xd/0x10
    [] ? smscore_sendrequest_and_wait.isra.5+0x120/0x120 [smsmdtv]
    [] ? list_add_locked+0xca/0x140 [smsmdtv]
    [] ? smscore_putbuffer+0x3a/0x40 [smsmdtv]
    [] smsusb_submit_urb+0x2ec/0x4f0 [smsusb]
    [] smsusb_onresponse+0x476/0x720 [smsusb]

    Let's add a work queue to handle the bottom half, preventing this
    problem.

    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

11 Jan, 2016

1 commit

  • 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: Sakari Ailus
    Signed-off-by: Javier Martinez Canillas
    Acked-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab

    Javier Martinez Canillas
     

03 Mar, 2015

1 commit


26 Feb, 2015

8 commits


02 Feb, 2015

1 commit

  • The USB and MMC front-ends to the siano driver both only make
    sense when combined with the SMS_SIANO_MDTV driver. That driver
    already requires RC_CORE to not be a module, so we also need
    to add that dependency here.

    drivers/built-in.o: In function `smssdio_remove':
    :(.text+0x155bd8): undefined reference to `smscore_putbuffer'
    :(.text+0x155bdc): undefined reference to `smscore_unregister_device'
    drivers/built-in.o: In function `smssdio_interrupt':
    :(.text+0x155e4c): undefined reference to `smsendian_handle_rx_message'
    :(.text+0x155e50): undefined reference to `smscore_onresponse'
    :(.text+0x155e54): undefined reference to `smscore_getbuffer'
    :(.text+0x155e58): undefined reference to `smscore_putbuffer'
    drivers/built-in.o: In function `smssdio_sendrequest':
    :(.text+0x155f20): undefined reference to `smsendian_handle_tx_message'
    drivers/built-in.o: In function `smssdio_probe':
    :(.text+0x15610c): undefined reference to `sms_get_board'
    :(.text+0x156114): undefined reference to `smscore_register_device'
    :(.text+0x156118): undefined reference to `smscore_set_board_id'
    :(.text+0x156128): undefined reference to `smscore_unregister_device'
    :(.text+0x156140): undefined reference to `smscore_start_device'

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Arnd Bergmann
     

26 Sep, 2014

1 commit


22 Aug, 2014

1 commit


11 Mar, 2014

1 commit


14 Oct, 2013

3 commits

  • The Stellar firmware load routine is different. Improve it to use
    the default firmware, if no modprobe parameter tells otherwise.

    Signed-off-by: Mauro Carvalho Chehab
    Tested-by: André Roth
    Signed-off-by: Mauro Carvalho Chehab

    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: Mauro Carvalho Chehab
    Tested-by: André Roth
    Signed-off-by: Mauro Carvalho Chehab

    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: Mauro Carvalho Chehab
    Tested-by: André Roth
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

21 Mar, 2013

8 commits


04 Jan, 2013

1 commit

  • 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
    Cc: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

07 Nov, 2012

1 commit

  • As reported by Antti and by Stephen:
    drivers/built-in.o: In function `sms_ir_event':
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:48: undefined reference to `ir_raw_event_store'
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:50: undefined reference to `ir_raw_event_handle'
    drivers/built-in.o: In function `sms_ir_init':
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:56: undefined reference to `smscore_get_board_id'
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:60: undefined reference to `rc_allocate_device'
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:72: undefined reference to `sms_get_board'
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:92: undefined reference to `sms_get_board'
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:97: undefined reference to `rc_register_device'
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:100: undefined reference to `rc_free_device'
    drivers/built-in.o: In function `sms_ir_exit':
    /home/david/checkouts/linux/drivers/media/common/siano/smsir.c:111: undefined reference to `rc_unregister_device'
    make: *** [vmlinux] Error 1

    Caused by commit fdd1eeb49d36 "[media] siano: allow compiling it without RC support"
    And it happens when CONFIG_SMS_SIANO_RC=y and CONFIG_RC_CORE=m .

    Reported-by: Stephen Rothwell
    Reported-by: Antti Palosaari
    Signed-off-by: Mauro Carvalho Chehab

    Mauro Carvalho Chehab
     

18 Oct, 2012

1 commit


24 Aug, 2012

1 commit

  • Linux 3.6-rc3

    * tag 'v3.6-rc3': (764 commits)
    Linux 3.6-rc3
    task_work: add a scheduling point in task_work_run()
    fs: fix fs/namei.c kernel-doc warnings
    eventpoll: use-after-possible-free in epoll_create1()
    vfio: grab vfio_device reference *before* exposing the sucker via fd_install()
    vfio: get rid of vfio_device_put()/vfio_group_get_device* races
    vfio: get rid of open-coding kref_put_mutex
    introduce kref_put_mutex()
    vfio: don't dereference after kfree...
    fbcon: fix race condition between console lock and cursor timer (v1.1)
    mm: compaction: Abort async compaction if locks are contended or taking too long
    mm: have order > 0 compaction start near a pageblock with free pages
    rapidio/tsi721: fix unused variable compiler warning
    rapidio/tsi721: fix inbound doorbell interrupt handling
    drivers/rtc/rtc-rs5c348.c: fix hour decoding in 12-hour mode
    mm: correct page->pfmemalloc to fix deactivate_slab regression
    drivers/rtc/rtc-pcf2123.c: initialize dynamic sysfs attributes
    mm/compaction.c: fix deferring compaction mistake
    drivers/misc/sgi-xp/xpc_uv.c: SGI XPC fails to load when cpu 0 is out of IRQ resources
    string: do not export memweight() to userspace
    ...

    Mauro Carvalho Chehab
     

14 Aug, 2012

2 commits