19 Dec, 2015

5 commits


21 Nov, 2015

1 commit

  • pci_set_dma_mask returns a negative errno value, not a bool like
    pci_dma_supported. This of course was just a giant test for attention :)

    Signed-off-by: Christoph Hellwig
    Reported-by: Jongman Heo
    Tested-by: Jongman Heo [pcnet32]
    Acked-by: Mauro Carvalho Chehab
    Cc: Hans Verkuil
    Cc: Antti Palosaari
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

11 Nov, 2015

7 commits


10 Nov, 2015

1 commit

  • Switch everything to the new and more capable implementation of abs().
    Mainly to give the new abs() a bit of a workout.

    Cc: Michal Nazarewicz
    Cc: John Stultz
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Masami Hiramatsu
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

07 Nov, 2015

1 commit

  • …d avoiding waking kswapd

    __GFP_WAIT has been used to identify atomic context in callers that hold
    spinlocks or are in interrupts. They are expected to be high priority and
    have access one of two watermarks lower than "min" which can be referred
    to as the "atomic reserve". __GFP_HIGH users get access to the first
    lower watermark and can be called the "high priority reserve".

    Over time, callers had a requirement to not block when fallback options
    were available. Some have abused __GFP_WAIT leading to a situation where
    an optimisitic allocation with a fallback option can access atomic
    reserves.

    This patch uses __GFP_ATOMIC to identify callers that are truely atomic,
    cannot sleep and have no alternative. High priority users continue to use
    __GFP_HIGH. __GFP_DIRECT_RECLAIM identifies callers that can sleep and
    are willing to enter direct reclaim. __GFP_KSWAPD_RECLAIM to identify
    callers that want to wake kswapd for background reclaim. __GFP_WAIT is
    redefined as a caller that is willing to enter direct reclaim and wake
    kswapd for background reclaim.

    This patch then converts a number of sites

    o __GFP_ATOMIC is used by callers that are high priority and have memory
    pools for those requests. GFP_ATOMIC uses this flag.

    o Callers that have a limited mempool to guarantee forward progress clear
    __GFP_DIRECT_RECLAIM but keep __GFP_KSWAPD_RECLAIM. bio allocations fall
    into this category where kswapd will still be woken but atomic reserves
    are not used as there is a one-entry mempool to guarantee progress.

    o Callers that are checking if they are non-blocking should use the
    helper gfpflags_allow_blocking() where possible. This is because
    checking for __GFP_WAIT as was done historically now can trigger false
    positives. Some exceptions like dm-crypt.c exist where the code intent
    is clearer if __GFP_DIRECT_RECLAIM is used instead of the helper due to
    flag manipulations.

    o Callers that built their own GFP flags instead of starting with GFP_KERNEL
    and friends now also need to specify __GFP_KSWAPD_RECLAIM.

    The first key hazard to watch out for is callers that removed __GFP_WAIT
    and was depending on access to atomic reserves for inconspicuous reasons.
    In some cases it may be appropriate for them to use __GFP_HIGH.

    The second key hazard is callers that assembled their own combination of
    GFP flags instead of starting with something like GFP_KERNEL. They may
    now wish to specify __GFP_KSWAPD_RECLAIM. It's almost certainly harmless
    if it's missed in most cases as other activity will wake kswapd.

    Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
    Acked-by: Vlastimil Babka <vbabka@suse.cz>
    Acked-by: Michal Hocko <mhocko@suse.com>
    Acked-by: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Vitaly Wool <vitalywool@gmail.com>
    Cc: Rik van Riel <riel@redhat.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

    Mel Gorman
     

06 Nov, 2015

2 commits

  • Pull spi updates from Mark Brown:
    "Quite a lot of activity in SPI this cycle, almost all of it in drivers
    with a few minor improvements and tweaks in the core.

    - Updates to pxa2xx to support Intel Broxton and multiple chip selects.
    - Support for big endian in the bcm63xx driver.
    - Multiple slave support for the mt8173
    - New driver for the auxiliary SPI controller in bcm2835 SoCs.
    - Support for Layerscale SoCs in the Freescale DSPI driver"

    * tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits)
    spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI
    spi: pxa2xx: Add support for Intel Broxton
    spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals
    spi: pxa2xx: Add output control for multiple Intel LPSS chip selects
    spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific
    spi: Add DSPI support for layerscape family
    spi: ti-qspi: improve ->remove() callback
    spi/spi-xilinx: Fix race condition on last word read
    spi: Drop owner assignment from spi_drivers
    spi: Add THIS_MODULE to spi_driver in SPI core
    spi: Setup the master controller driver before setting the chipselect
    spi: dw: replace magic constant by DW_SPI_DR
    spi: mediatek: mt8173 spi multiple devices support
    spi: mediatek: handle controller_data in mtk_spi_setup
    spi: mediatek: remove mtk_spi_config
    spi: mediatek: Update document devicetree bindings to support multiple devices
    spi: fix kernel-doc warnings about missing return desc in spi.c
    spi: fix kernel-doc warnings about missing return desc in spi.h
    spi: pxa2xx: Align a few defines
    spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select
    ...

    Linus Torvalds
     
  • Pull media updates from Mauro Carvalho Chehab:
    "Media updates, including:

    - Lots of improvements at the kABI documentation
    - Split of Videobuf2 into a common part and a V4L2 specific one
    - Split of the VB2 tracing events into a separate header file
    - s5p-mfc got support for Exynos 5433
    - v4l2 fixes for 64-bits alignment when running 32 bits userspace
    on ARM
    - Added support for SDR radio transmitter at core, vivid and hackrf
    drivers
    - Some y2038 fixups
    - Some improvements at V4L2 colorspace support
    - saa7164 converted to use the V4L2 core control framework
    - several new boards additions, cleanups and fixups

    PS: There are two patches for scripts/kernel-doc that are needed by
    the documentation patches on Media. Jon is OK on merging those via
    my tree"

    * tag 'media/v4.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (146 commits)
    [media] c8sectpfe: Remove select on CONFIG_FW_LOADER_USER_HELPER_FALLBACK
    [media] DocBook media: update copyright/version numbers
    [media] ivtv: Convert to get_user_pages_unlocked()
    [media] media/v4l2-ctrls: fix setting autocluster to manual with VIDIOC_S_CTRL
    [media] DocBook media: Fix a typo in encoder cmd
    [media] DocBook: add SDR specific info to G_MODULATOR / S_MODULATOR
    [media] DocBook: add SDR specific info to G_TUNER / S_TUNER
    [media] hackrf: do not set human readable name for formats
    [media] hackrf: add support for transmitter
    [media] hackrf: switch to single function which configures everything
    [media] hackrf: add control for RF amplifier
    [media] DocBook: add modulator type field
    [media] v4l: add type field to v4l2_modulator struct
    [media] DocBook: document SDR transmitter
    [media] v4l2: add support for SDR transmitter
    [media] DocBook: document tuner RF gain control
    [media] v4l2: add RF gain control
    [media] v4l2: rename V4L2_TUNER_ADC to V4L2_TUNER_SDR
    [media] media/vivid-osd: fix info leak in ioctl
    [media] media: videobuf2: Move v4l2-specific stuff to videobuf2-v4l2
    ...

    Linus Torvalds
     

04 Nov, 2015

1 commit


28 Oct, 2015

1 commit


23 Oct, 2015

11 commits

  • Device stopped to tuning some channels after regmap conversion.
    Reason is that regmap_update_bits() works a bit differently for
    partially volatile registers than old homemade routine. Return
    back to old routine in order to fix issue.

    Fixes: 478932b16052f5ded74685d096ae920cd17d6424

    Cc: # 4.2+
    Reported-by: Mark Clarkstone
    Tested-by: Mark Clarkstone
    Signed-off-by: Antti Palosaari
    Signed-off-by: Mauro Carvalho Chehab

    Antti Palosaari
     
  • Add lock to prevent concurrent access for control message as control
    message function uses shared buffer. Without the lock there may be
    remote control polling which messes the buffer causing IO errors.
    Increase buffer size and add check for maximum supported message
    length.

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=103391
    Fixes: c56222a6b25c ("[media] rtl28xxu: move usb buffers to state")

    Cc: # 4.0+
    Signed-off-by: Antti Palosaari

    Antti Palosaari
     
  • Fixes the following randconfig problem:

    drivers/built-in.o: In function `v4l2_flash_release':
    (.text+0x12204f): undefined reference to `v4l2_async_unregister_subdev'
    drivers/built-in.o: In function `v4l2_flash_release':
    (.text+0x122057): undefined reference to `v4l2_ctrl_handler_free'
    drivers/built-in.o: In function `v4l2_flash_close':
    v4l2-flash-led-class.c:(.text+0x12208f): undefined reference to `v4l2_fh_is_singular'
    v4l2-flash-led-class.c:(.text+0x1220c8): undefined reference to `__v4l2_ctrl_s_ctrl'
    drivers/built-in.o: In function `v4l2_flash_open':
    v4l2-flash-led-class.c:(.text+0x12227f): undefined reference to `v4l2_fh_is_singular'
    drivers/built-in.o: In function `v4l2_flash_init_controls':
    v4l2-flash-led-class.c:(.text+0x12274e): undefined reference to `v4l2_ctrl_handler_init_class'
    v4l2-flash-led-class.c:(.text+0x122797): undefined reference to `v4l2_ctrl_new_std_menu'
    v4l2-flash-led-class.c:(.text+0x1227e0): undefined reference to `v4l2_ctrl_new_std'
    v4l2-flash-led-class.c:(.text+0x122826): undefined reference to `v4l2_ctrl_handler_setup'
    v4l2-flash-led-class.c:(.text+0x122839): undefined reference to `v4l2_ctrl_handler_free'
    drivers/built-in.o: In function `v4l2_flash_init':
    (.text+0x1228e2): undefined reference to `v4l2_subdev_init'
    drivers/built-in.o: In function `v4l2_flash_init':
    (.text+0x12293b): undefined reference to `v4l2_async_register_subdev'
    drivers/built-in.o: In function `v4l2_flash_init':
    (.text+0x122949): undefined reference to `v4l2_ctrl_handler_free'
    drivers/built-in.o:(.rodata+0x20ef8): undefined reference to `v4l2_subdev_queryctrl'
    drivers/built-in.o:(.rodata+0x20f10): undefined reference to `v4l2_subdev_querymenu'

    Signed-off-by: Jacek Anaszewski
    Reported-by: kbuild test robot
    Cc: Sakari Ailus
    Cc: Hans Verkuil

    Jacek Anaszewski
     
  • Signed-off-by: Abylay Ospan
    Reported-by: Dan Carpenter
    Signed-off-by: Mauro Carvalho Chehab

    Abylay Ospan
     
  • When reading the firmware and sending commands, the length must
    be bounds checked to avoid overrunning the size of the command
    buffer and smashing the stack if the firmware is not in the expected
    format:

    si2168 11-0064: found a 'Silicon Labs Si2168-B40'
    si2168 11-0064: downloading firmware from file 'dvb-demod-si2168-b40-01.fw'
    si2168 11-0064: firmware download failed -95
    Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: ffffffffa085708f

    Add the proper check.

    Cc: stable@kernel.org
    Reported-by: Stuart Auchterlonie
    Reviewed-by: Antti Palosaari
    Signed-off-by: Laura Abbott
    Signed-off-by: Mauro Carvalho Chehab

    Laura Abbott
     
  • When reading the firmware and sending commands, the length
    must be bounds checked to avoid overrunning the size of the command
    buffer and smashing the stack if the firmware is not in the
    expected format. Add the proper check.

    Cc: stable@kernel.org
    Signed-off-by: Laura Abbott
    Signed-off-by: Mauro Carvalho Chehab

    Laura Abbott
     
  • This driver doesn't claim the IR transmitter to be wakeup source. It
    even disables the clock and the IR during suspend-resume cycle.

    This patch removes yet another misuse of IRQF_NO_SUSPEND.

    Cc: Patrice Chotard
    Cc: Fabio Estevam
    Cc: Guoxiong Yan
    Signed-off-by: Sudeep Holla
    Acked-by: Zhangfei Gao
    Signed-off-by: Mauro Carvalho Chehab

    Sudeep Holla
     
  • The variable err was never initialized, that means we had been checking
    a garbage value in the for loop. Moreover if the segment is not outside
    the firmware file then also we have been returning the garbage.
    Initialize it to 0 so that on success we return the value and no need to
    check in the for loop also as it is initially 0 and whenever that value
    changes we have done a break from the loop.

    Signed-off-by: Sudip Mukherjee
    Signed-off-by: Mauro Carvalho Chehab

    Sudip Mukherjee
     
  • static analysis with cppcheck detected the following error:

    [drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c:1210]:
    (error) Uninitialized variable: ret

    ret is never initialised, so garbage is being returned. Instead
    return the error return from the call of request_firmware_nowait

    Signed-off-by: Colin Ian King

    Colin Ian King
     
  • If CONFIG_DVB_LNBH25 is disabled, a stub static inline function is
    defined that just prints a warning about the driver being disabled
    but the function return type was wrong which caused a build error.

    Fixes: e025273b86fb ("[media] lnbh25: LNBH25 SEC controller driver")

    Reported-by: Fengguang Wu
    Signed-off-by: Javier Martinez Canillas

    Javier Martinez Canillas
     
  • If CONFIG_DVB_HORUS3A is disabled a stub static inline function is
    defined that just prints a warning about the driver being disabled
    but the function parameters were wrong which caused a build error.

    Fixes: a5d32b358254f ("[media] horus3a: Sony Horus3A DVB-S/S2 tuner driver")

    Reported-by: Fengguang Wu
    Signed-off-by: Javier Martinez Canillas

    Javier Martinez Canillas
     

21 Oct, 2015

10 commits

  • c8sectpfe driver selects CONFIG_FW_LOADER_USER_HELPER_FALLBACK by some
    reason, but this option is known to be harmful, leading to minutes of
    stalls at boot time. The option was intended for only compatibility
    for an old exotic system that mandates the udev interaction, and not a
    thing a driver selects by itself. Let's remove it.

    Fixes: 850a3f7d5911 ('[media] c8sectpfe: Add Kconfig and Makefile for the driver')

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Convert ivtv_yuv_prep_user_dma() to use get_user_pages_unlocked() so
    that we don't unnecessarily leak knowledge about mm locking into drivers
    code.

    CC: Andy Walls
    Signed-off-by: Jan Kara
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Jan Kara
     
  • Since commit 5d0360a4f027576e5419d4a7c711c9ca0f1be8ca it's not possible
    anymore to set auto clusters from auto to manual using VIDIOC_S_CTRL.

    For example, setting autogain to manual with gspca/ov534 driver and this
    sequence of commands does not work:

    v4l2-ctl --set-ctrl=gain_automatic=1
    v4l2-ctl --list-ctrls | grep gain_automatic
    # The following does not work
    v4l2-ctl --set-ctrl=gain_automatic=0
    v4l2-ctl --list-ctrls | grep gain_automatic

    Changing the value using VIDIOC_S_EXT_CTRLS (like qv4l2 does) works
    fine.

    The apparent cause by looking at the changes in 5d0360a and comparing
    with the code path for VIDIOC_S_EXT_CTRLS seems to be that the code in
    v4l2-ctrls.c::set_ctrl() is not calling user_to_new() anymore after
    calling update_from_auto_cluster(master).

    However the root cause of the problem is that calling
    update_from_auto_cluster(master) overrides also the _master_ control
    state calling cur_to_new() while it was supposed to only update the
    volatile controls.

    Calling user_to_new() after update_from_auto_cluster(master) was just
    masking the original bug by restoring the correct new value of the
    master control before making the changes permanent.

    Fix the original bug by making update_from_auto_cluster() not override
    the new master control value.

    Signed-off-by: Antonio Ospite
    Cc: # for v3.17 and up
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Antonio Ospite
     
  • Format names are set by core nowadays. Remove name from driver.

    Signed-off-by: Antti Palosaari
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Antti Palosaari
     
  • HackRF SDR device has both receiver and transmitter. There is limitation
    that receiver and transmitter cannot be used at the same time
    (half-duplex operation). That patch implements transmitter support to
    existing receiver only driver.

    Signed-off-by: Antti Palosaari
    [hans.verkuil@cisco.com: fix krobot unused variable warning]
    [hans.verkuil@cisco.com: add back s_modulator from PATCHv4]
    Signed-off-by: Hans Verkuil

    Signed-off-by: Mauro Carvalho Chehab

    Antti Palosaari
     
  • Implement single funtion, hackrf_set_params(), which handles all
    needed settings. Controls and other IOCTLs are just wrappers to that
    function. That way we can get easily better control what we could do
    on different device states - sleeping, receiving, transmitting.

    Signed-off-by: Antti Palosaari
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Antti Palosaari
     
  • There is Avago MGA-81563 amplifier just right after antenna connector.
    It could be turned on/off and its gain is around 12dB.

    Signed-off-by: Antti Palosaari
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Antti Palosaari
     
  • Add type field to that struct like it counterpart v4l2_tuner
    already has. We need type field to distinguish different tuner
    types from each others for transmitter too.

    Signed-off-by: Antti Palosaari
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Antti Palosaari
     
  • New IOCTL ops:
    vidioc_enum_fmt_sdr_out
    vidioc_g_fmt_sdr_out
    vidioc_s_fmt_sdr_out
    vidioc_try_fmt_sdr_out

    New vb2 buffertype:
    V4L2_BUF_TYPE_SDR_OUTPUT

    New v4l2 capability:
    V4L2_CAP_SDR_OUTPUT

    Signed-off-by: Antti Palosaari
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Antti Palosaari
     
  • Add new RF tuner gain control named RF Gain. That is aimed for first
    amplifier chip right after antenna connector.
    There is existing LNA Gain control, which is quite same, but it is
    aimed for cases amplifier is integrated to tuner chip. Some designs
    have both, as almost all recent tuner silicons has integrated LNA/RF
    amplifier in any case.

    Signed-off-by: Antti Palosaari
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab

    Antti Palosaari