17 Aug, 2020

1 commit

  • With commit f70f74d15ca8 ("kconfig: remove '---help---' support") the
    "---help---" marking is no longer allowed in Kconfig files.
    Unfortunately some old ANDROID patches used this deprecated markings,
    which breaks the build.

    Fix this up by converting them to the correct style "help"

    Bug: 156285741
    Bug: 146517987
    Bug: 31622239
    Bug: 120445368
    Bug: 119769411
    Bug: 129280212
    Fixes: 7f62740112ef ("ANDROID: add support for vendor hooks")
    Fixes: 2dec8234fe73 ("ANDROID: gnss: Add command line test driver")
    Fixes: 611561983150 ("ANDROID: AVB error handler to invalidate vbmeta partition.")
    Fixes: 0ce3eb37e9ea ("ANDROID: dm-bow: Add dm-bow feature")
    Cc: Todd Kjos
    Cc: Alistair Delva
    Cc: David Zeuthen
    Cc: Paul Lawrence
    Signed-off-by: Greg Kroah-Hartman
    Change-Id: I8a503c34b5b4dac6dc3e24afbefa10223a6fd946

    Greg Kroah-Hartman
     

25 Jun, 2020

1 commit


24 Jun, 2020

1 commit


14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

13 May, 2020

2 commits

  • The current codebase makes use of the zero-length array language
    extension to the C90 standard, but the preferred mechanism to declare
    variable-length types such as these ones is a flexible array
    member[1][2], introduced in C99:

    struct foo {
    int stuff;
    struct boo array[];
    };

    By making use of the mechanism above, we will get a compiler warning in
    case the flexible array does not occur last in the structure, which will
    help us prevent some kind of undefined behavior bugs from being
    inadvertently introduced[3] to the codebase from now on.

    Also, notice that, dynamic memory allocations won't be affected by
    this change:

    "Flexible array members have incomplete type, and so the sizeof operator
    may not be applied. As a quirk of the original implementation of
    zero-length arrays, sizeof evaluates to zero."[1]

    sizeof(flexible-array-member) triggers a warning because flexible array
    members have incomplete type[1]. There are some instances of code in
    which the sizeof operator is being incorrectly/erroneously applied to
    zero-length arrays and the result is zero. Such instances may be hiding
    some bugs. So, this work (flexible-array member conversions) will also
    help to get completely rid of those sorts of issues.

    This issue was found with the help of Coccinelle.

    [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
    [2] https://github.com/KSPP/linux/issues/21
    [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

    Signed-off-by: Gustavo A. R. Silva
    Signed-off-by: Johan Hovold

    Gustavo A. R. Silva
     
  • Fix to return a negative error code from the error handling
    case instead of 0, as done elsewhere in this function.

    This avoids a use-after-free in case the driver is later unbound.

    Fixes: d2efbbd18b1e ("gnss: add driver for sirfstar-based receivers")
    Reported-by: Hulk Robot
    Signed-off-by: Wei Yongjun
    [ johan: amend commit message; mention potential use-after-free ]
    Cc: stable # 4.19
    Signed-off-by: Johan Hovold

    Wei Yongjun
     

20 Dec, 2019

1 commit

  • This driver enables the "takeover" of a serdev bus device by the GNSS
    subsystem. It can be used to test the GNSS subsystem without needing to
    write a specific hardware backend.

    The new module supports the following parameters:

    gnss_cmdline.serdev=driver/port/serdev
    gnss_cmdline.type=

    An example which allows GNSS to wrap a platform serial8250 port and
    advertise NMEA-0183 data is:

    gnss_cmdline.serdev=serial8250/serial0/serial0-0
    ^ ^ ^
    driver port serdev
    gnss_cmdline.type=0
    ^
    GNSS_TYPE_NMEA

    Bug: 146517987
    Change-Id: I421386ee4f2ba8f1f0832d9c56a067a600892d3c
    Signed-off-by: Alistair Delva

    Alistair Delva
     

21 May, 2019

1 commit


08 May, 2019

1 commit

  • …/git/gregkh/char-misc

    Pull char/misc update part 2 from Greg KH:
    "Here is the "real" big set of char/misc driver patches for 5.2-rc1

    Loads of different driver subsystem stuff in here, all over the places:
    - thunderbolt driver updates
    - habanalabs driver updates
    - nvmem driver updates
    - extcon driver updates
    - intel_th driver updates
    - mei driver updates
    - coresight driver updates
    - soundwire driver cleanups and updates
    - fastrpc driver updates
    - other minor driver updates
    - chardev minor fixups

    Feels like this tree is getting to be a dumping ground of "small
    driver subsystems" these days. Which is fine with me, if it makes
    things easier for those subsystem maintainers.

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'char-misc-5.2-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (255 commits)
    intel_th: msu: Add current window tracking
    intel_th: msu: Add a sysfs attribute to trigger window switch
    intel_th: msu: Correct the block wrap detection
    intel_th: Add switch triggering support
    intel_th: gth: Factor out trace start/stop
    intel_th: msu: Factor out pipeline draining
    intel_th: msu: Switch over to scatterlist
    intel_th: msu: Replace open-coded list_{first,last,next}_entry variants
    intel_th: Only report useful IRQs to subdevices
    intel_th: msu: Start handling IRQs
    intel_th: pci: Use MSI interrupt signalling
    intel_th: Communicate IRQ via resource
    intel_th: Add "rtit" source device
    intel_th: Skip subdevices if their MMIO is missing
    intel_th: Rework resource passing between glue layers and core
    intel_th: SPDX-ify the documentation
    intel_th: msu: Fix single mode with IOMMU
    coresight: funnel: Support static funnel
    dt-bindings: arm: coresight: Unify funnel DT binding
    coresight: replicator: Add new device id for static replicator
    ...

    Linus Torvalds
     

06 May, 2019

1 commit

  • Using scripts/coccinelle/api/stream_open.cocci added in 10dce8af3422
    ("fs: stream_open - opener for stream-like files so that read and write
    can run simultaneously without deadlock"), search and convert to
    stream_open all in-kernel nonseekable_open users for which read and
    write actually do not depend on ppos and where there is no other methods
    in file_operations which assume @offset access.

    I've verified each generated change manually - that it is correct to convert -
    and each other nonseekable_open instance left - that it is either not correct
    to convert there, or that it is not converted due to current stream_open.cocci
    limitations. The script also does not convert files that should be valid to
    convert, but that currently have .llseek = noop_llseek or generic_file_llseek
    for unknown reason despite file being opened with nonseekable_open (e.g.
    drivers/input/mousedev.c)

    Among cases converted 14 were potentially vulnerable to read vs write deadlock
    (see details in 10dce8af3422):

    drivers/char/pcmcia/cm4000_cs.c:1685:7-23: ERROR: cm4000_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/gnss/core.c:45:1-17: ERROR: gnss_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/hid/uhid.c:635:1-17: ERROR: uhid_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/infiniband/core/user_mad.c:988:1-17: ERROR: umad_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/input/evdev.c:527:1-17: ERROR: evdev_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/input/misc/uinput.c:401:1-17: ERROR: uinput_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/isdn/capi/capi.c:963:8-24: ERROR: capi_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/leds/uleds.c:77:1-17: ERROR: uleds_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/media/rc/lirc_dev.c:198:1-17: ERROR: lirc_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/s390/char/fs3270.c:488:1-17: ERROR: fs3270_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/usb/misc/ldusb.c:310:1-17: ERROR: ld_usb_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    drivers/xen/evtchn.c:667:8-24: ERROR: evtchn_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    net/batman-adv/icmp_socket.c:80:1-17: ERROR: batadv_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
    net/rfkill/core.c:1146:8-24: ERROR: rfkill_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.

    and the rest were just safe to convert to stream_open because their read and
    write do not use ppos at all and corresponding file_operations do not
    have methods that assume @offset file access(*):

    arch/powerpc/platforms/52xx/mpc52xx_gpt.c:631:8-24: WARNING: mpc52xx_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    arch/powerpc/platforms/cell/spufs/file.c:591:8-24: WARNING: spufs_ibox_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    arch/powerpc/platforms/cell/spufs/file.c:591:8-24: WARNING: spufs_ibox_stat_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    arch/powerpc/platforms/cell/spufs/file.c:591:8-24: WARNING: spufs_mbox_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    arch/powerpc/platforms/cell/spufs/file.c:591:8-24: WARNING: spufs_mbox_stat_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    arch/powerpc/platforms/cell/spufs/file.c:591:8-24: WARNING: spufs_wbox_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    arch/powerpc/platforms/cell/spufs/file.c:591:8-24: WARNING: spufs_wbox_stat_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    arch/um/drivers/harddog_kern.c:88:8-24: WARNING: harddog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    arch/x86/kernel/cpu/microcode/core.c:430:33-49: WARNING: microcode_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/char/ds1620.c:215:8-24: WARNING: ds1620_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/char/dtlk.c:301:1-17: WARNING: dtlk_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/char/ipmi/ipmi_watchdog.c:840:9-25: WARNING: ipmi_wdog_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/char/pcmcia/scr24x_cs.c:95:8-24: WARNING: scr24x_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/char/tb0219.c:246:9-25: WARNING: tb0219_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/firewire/nosy.c:306:8-24: WARNING: nosy_ops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/hwmon/fschmd.c:840:8-24: WARNING: watchdog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/hwmon/w83793.c:1344:8-24: WARNING: watchdog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/infiniband/core/ucma.c:1747:8-24: WARNING: ucma_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/infiniband/core/ucm.c:1178:8-24: WARNING: ucm_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/infiniband/core/uverbs_main.c:1086:8-24: WARNING: uverbs_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/input/joydev.c:282:1-17: WARNING: joydev_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/pci/switch/switchtec.c:393:1-17: WARNING: switchtec_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/platform/chrome/cros_ec_debugfs.c:135:8-24: WARNING: cros_ec_console_log_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/rtc/rtc-ds1374.c:470:9-25: WARNING: ds1374_wdt_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/rtc/rtc-m41t80.c:805:9-25: WARNING: wdt_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/s390/char/tape_char.c:293:2-18: WARNING: tape_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/s390/char/zcore.c:194:8-24: WARNING: zcore_reipl_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/s390/crypto/zcrypt_api.c:528:8-24: WARNING: zcrypt_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/spi/spidev.c:594:1-17: WARNING: spidev_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/staging/pi433/pi433_if.c:974:1-17: WARNING: pi433_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/acquirewdt.c:203:8-24: WARNING: acq_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/advantechwdt.c:202:8-24: WARNING: advwdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/alim1535_wdt.c:252:8-24: WARNING: ali_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/alim7101_wdt.c:217:8-24: WARNING: wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/ar7_wdt.c:166:8-24: WARNING: ar7_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/at91rm9200_wdt.c:113:8-24: WARNING: at91wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/ath79_wdt.c:135:8-24: WARNING: ath79_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/bcm63xx_wdt.c:119:8-24: WARNING: bcm63xx_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/cpu5wdt.c:143:8-24: WARNING: cpu5wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/cpwd.c:397:8-24: WARNING: cpwd_fops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/eurotechwdt.c:319:8-24: WARNING: eurwdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/f71808e_wdt.c:528:8-24: WARNING: watchdog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/gef_wdt.c:232:8-24: WARNING: gef_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/geodewdt.c:95:8-24: WARNING: geodewdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/ib700wdt.c:241:8-24: WARNING: ibwdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/ibmasr.c:326:8-24: WARNING: asr_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/indydog.c:80:8-24: WARNING: indydog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/intel_scu_watchdog.c:307:8-24: WARNING: intel_scu_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/iop_wdt.c:104:8-24: WARNING: iop_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/it8712f_wdt.c:330:8-24: WARNING: it8712f_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/ixp4xx_wdt.c:68:8-24: WARNING: ixp4xx_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/ks8695_wdt.c:145:8-24: WARNING: ks8695wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/m54xx_wdt.c:88:8-24: WARNING: m54xx_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/machzwd.c:336:8-24: WARNING: zf_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/mixcomwd.c:153:8-24: WARNING: mixcomwd_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/mtx-1_wdt.c:121:8-24: WARNING: mtx1_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/mv64x60_wdt.c:136:8-24: WARNING: mv64x60_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/nuc900_wdt.c:134:8-24: WARNING: nuc900wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/nv_tco.c:164:8-24: WARNING: nv_tco_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pc87413_wdt.c:289:8-24: WARNING: pc87413_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pcwd.c:698:8-24: WARNING: pcwd_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pcwd.c:737:8-24: WARNING: pcwd_temp_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pcwd_pci.c:581:8-24: WARNING: pcipcwd_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pcwd_pci.c:623:8-24: WARNING: pcipcwd_temp_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pcwd_usb.c:488:8-24: WARNING: usb_pcwd_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pcwd_usb.c:527:8-24: WARNING: usb_pcwd_temperature_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pika_wdt.c:121:8-24: WARNING: pikawdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/pnx833x_wdt.c:119:8-24: WARNING: pnx833x_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/rc32434_wdt.c:153:8-24: WARNING: rc32434_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/rdc321x_wdt.c:145:8-24: WARNING: rdc321x_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/riowd.c:79:1-17: WARNING: riowd_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sa1100_wdt.c:62:8-24: WARNING: sa1100dog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sbc60xxwdt.c:211:8-24: WARNING: wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sbc7240_wdt.c:139:8-24: WARNING: wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sbc8360.c:274:8-24: WARNING: sbc8360_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sbc_epx_c3.c:81:8-24: WARNING: epx_c3_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sbc_fitpc2_wdt.c:78:8-24: WARNING: fitpc2_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sb_wdog.c:108:1-17: WARNING: sbwdog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sc1200wdt.c:181:8-24: WARNING: sc1200wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sc520_wdt.c:261:8-24: WARNING: wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/sch311x_wdt.c:319:8-24: WARNING: sch311x_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/scx200_wdt.c:105:8-24: WARNING: scx200_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/smsc37b787_wdt.c:369:8-24: WARNING: wb_smsc_wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/w83877f_wdt.c:227:8-24: WARNING: wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/w83977f_wdt.c:301:8-24: WARNING: wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wafer5823wdt.c:200:8-24: WARNING: wafwdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/watchdog_dev.c:828:8-24: WARNING: watchdog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wdrtas.c:379:8-24: WARNING: wdrtas_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wdrtas.c:445:8-24: WARNING: wdrtas_temp_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wdt285.c:104:1-17: WARNING: watchdog_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wdt977.c:276:8-24: WARNING: wdt977_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wdt.c:424:8-24: WARNING: wdt_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wdt.c:484:8-24: WARNING: wdt_temp_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wdt_pci.c:464:8-24: WARNING: wdtpci_fops: .write() has stream semantic; safe to change nonseekable_open -> stream_open.
    drivers/watchdog/wdt_pci.c:527:8-24: WARNING: wdtpci_temp_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    net/batman-adv/log.c:105:1-17: WARNING: batadv_log_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    sound/core/control.c:57:7-23: WARNING: snd_ctl_f_ops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
    sound/core/rawmidi.c:385:7-23: WARNING: snd_rawmidi_f_ops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    sound/core/seq/seq_clientmgr.c:310:7-23: WARNING: snd_seq_f_ops: .read() and .write() have stream semantic; safe to change nonseekable_open -> stream_open.
    sound/core/timer.c:1428:7-23: WARNING: snd_timer_f_ops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.

    One can also recheck/review the patch via generating it with explanation comments included via

    $ make coccicheck MODE=patch COCCI=scripts/coccinelle/api/stream_open.cocci SPFLAGS="-D explain"

    (*) This second group also contains cases with read/write deadlocks that
    stream_open.cocci don't yet detect, but which are still valid to convert to
    stream_open since ppos is not used. For example drivers/pci/switch/switchtec.c
    calls wait_for_completion_interruptible() in its .read, but stream_open.cocci
    currently detects only "wait_event*" as blocking.

    Cc: Michael Kerrisk
    Cc: Yongzhi Pan
    Cc: Jonathan Corbet
    Cc: David Vrabel
    Cc: Juergen Gross
    Cc: Miklos Szeredi
    Cc: Tejun Heo
    Cc: Kirill Tkhai
    Cc: Arnd Bergmann
    Cc: Christoph Hellwig
    Cc: Greg Kroah-Hartman
    Cc: Julia Lawall
    Cc: Nikolaus Rath
    Cc: Han-Wen Nienhuys
    Cc: Anatolij Gustschin
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Anton Ivanov
    Cc: Borislav Petkov
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "James R. Van Zandt"
    Cc: Corey Minyard
    Cc: Harald Welte
    Acked-by: Lubomir Rintel [scr24x_cs]
    Cc: Stefan Richter
    Cc: Johan Hovold
    Cc: David Herrmann
    Cc: Jiri Kosina
    Cc: Benjamin Tissoires
    Cc: Jean Delvare
    Acked-by: Guenter Roeck [watchdog/* hwmon/*]
    Cc: Rudolf Marek
    Cc: Dmitry Torokhov
    Cc: Karsten Keil
    Cc: Jacek Anaszewski
    Cc: Pavel Machek
    Cc: Mauro Carvalho Chehab
    Cc: Kurt Schwemmer
    Acked-by: Logan Gunthorpe [drivers/pci/switch/switchtec]
    Acked-by: Bjorn Helgaas [drivers/pci/switch/switchtec]
    Cc: Benson Leung
    Acked-by: Enric Balletbo i Serra [platform/chrome]
    Cc: Alessandro Zummo
    Acked-by: Alexandre Belloni [rtc/*]
    Cc: Mark Brown
    Cc: Wim Van Sebroeck
    Cc: Florian Fainelli
    Cc: bcm-kernel-feedback-list@broadcom.com
    Cc: Wan ZongShun
    Cc: Zwane Mwaikambo
    Cc: Marek Lindner
    Cc: Simon Wunderlich
    Cc: Antonio Quartulli
    Cc: "David S. Miller"
    Cc: Johannes Berg
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Kirill Smelkov

    Kirill Smelkov
     

04 Apr, 2019

1 commit


15 Feb, 2019

2 commits

  • Add driver for serial-connected Mediatek-based GNSS receivers.

    These devices typically boot transmitting vendor specific NMEA output
    sequences. The serial port bit rate is read from the device tree
    "current-speed".

    Note that the driver uses the generic GNSS serial implementation and
    therefore essentially only manages power abstracted into three power
    states: ACTIVE, STANDBY, and OFF.

    For mediatek receivers with a main supply and no enable-gpios, this simply
    means that the main supply is disabled in STANDBY and OFF (the optional
    backup supply is kept enabled while the driver is bound).

    Note that the timepulse-support is left unimplemented.

    Signed-off-by: Loys Ollivier
    [ johan: rename backup supply ]
    Signed-off-by: Johan Hovold

    Loys Ollivier
     
  • Add an MTK (Mediatek) type to the "GNSS_TYPE" attribute.

    Note that MTK receivers support a subset of NMEA 0183 with vendor
    extensions.

    Signed-off-by: Loys Ollivier
    Signed-off-by: Johan Hovold

    Loys Ollivier
     

25 Jan, 2019

6 commits


10 Dec, 2018

1 commit


07 Dec, 2018

1 commit

  • Fix activation helper which would return -ETIMEDOUT even if the last
    retry attempt was successful.

    Also change the semantics of the retries variable so that it actually
    holds the number of retries (rather than tries).

    Fixes: d2efbbd18b1e ("gnss: add driver for sirfstar-based receivers")
    Cc: stable # 4.19
    Signed-off-by: Johan Hovold

    Johan Hovold
     

28 Nov, 2018

1 commit

  • Make the synchronous serdev_device_write() helper behave analogous to
    the asynchronous serdev_device_write_buf() by returning the number of
    bytes written (or rather buffered) also on timeout.

    This will allow drivers to distinguish the case where data was partially
    written from the case where no data was written.

    Also update the only two users that checked the return value.

    Signed-off-by: Johan Hovold
    Reviewed-by: Rob Herring
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     

15 Nov, 2018

2 commits

  • Passing a timeout of zero to the synchronous serdev_device_write()
    helper does currently not imply to wait forever (unlike passing zero to
    serdev_device_wait_until_sent()). Instead, if there's insufficient
    room in the write buffer, we'd end up with an incomplete write.

    Fixes: d2efbbd18b1e ("gnss: add driver for sirfstar-based receivers")
    Cc: stable # 4.19
    Signed-off-by: Johan Hovold

    Johan Hovold
     
  • Passing a timeout of zero to the synchronous serdev_device_write()
    helper does currently not imply to wait forever (unlike passing zero to
    serdev_device_wait_until_sent()). Instead, if there's insufficient
    room in the write buffer, we'd end up with an incomplete write.

    Fixes: 37768b054f20 ("gnss: add generic serial driver")
    Cc: stable # 4.19
    Signed-off-by: Johan Hovold

    Johan Hovold
     

16 Jul, 2018

2 commits

  • The gnss_allocate_device() function returns a mix of NULL and error
    pointers on error. It should only return one or the other. Since the
    callers both check for NULL, I've modified it to return NULL on error.

    Fixes: 2b6a44035143 ("gnss: add GNSS receiver subsystem")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • The structure ubx_gserial_ops is local to the source and does not need
    to be in global scope, so make it static.

    Cleans up sparse warning:
    symbol 'ubx_gserial_ops' was not declared. Should it be static?

    Signed-off-by: Colin Ian King
    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

28 Jun, 2018

5 commits

  • Add a "type" device attribute and a "GNSS_TYPE" uevent variable which
    can be used to determine the type of a GNSS receiver. The currently
    identified types reflect the protocol(s) supported by a receiver:

    "NMEA" NMEA 0183
    "SiRF" SiRF Binary
    "UBX" UBX

    Note that both SiRF and UBX type receivers typically support a subset of
    NMEA 0183 with vendor extensions (e.g. to allow switching to the vendor
    protocol).

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Add driver for serial-connected SiRFstar-based GNSS receivers.

    These devices typically boot into hibernate mode from which they can be
    woken using a pulse on the ON_OFF input pin. Once active, a pulse on the
    same ON_OFF pin is used to put the device back into hibernate mode. The
    current state can be determined by sampling the WAKEUP output.

    Hardware configurations where WAKEUP has been connected to ON_OFF (and
    where an initial WAKEUP pulse during boot is sufficient to have the
    device boot into active mode) are also supported. In this case, device
    power is managed using the main-supply regulator only.

    Note that configurations where WAKEUP is left not connected, so that the
    device power state can only indirectly be determined using the I/O
    interface, is currently not supported. It should be fairly
    straight-forward to extend the current implementation with such support
    however (and this this is the main reason for not using the generic
    serial implementation for this driver).

    Note that timepulse-support is left unimplemented.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Add driver for serial-connected u-blox GNSS receivers.

    Note that the driver uses the generic GNSS serial implementation and
    therefore essentially only manages power abstracted into three power
    states: ACTIVE, STANDBY, and OFF.

    For u-blox receivers with a main supply and no enable-gpios, this simply
    means that the main supply is disabled in STANDBY and OFF (the optional
    backup supply is kept enabled while the driver is bound).

    Note that timepulse-support is not yet implemented.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Add a generic serial GNSS driver (library) which provides a common
    implementation for the gnss interface and power management (runtime and
    system suspend). This allows GNSS drivers for specific chip to be
    implemented by simply providing a set_power() callback to handle three
    states: ACTIVE, STANDBY and OFF.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • Add a new subsystem for GNSS (e.g. GPS) receivers.

    While GNSS receivers are typically accessed using a UART interface they
    often also support other I/O interfaces such as I2C, SPI and USB, while
    yet other devices use iomem or even some form of remote-processor
    messaging (rpmsg).

    The new GNSS subsystem abstracts the underlying interface and provides a
    new "gnss" class type, which exposes a character-device interface (e.g.
    /dev/gnss0) to user space. This allows GNSS receivers to have a
    representation in the Linux device model, something which is important
    not least for power management purposes.

    Note that the character-device interface provides raw access to whatever
    protocol the receiver is (currently) using, such as NMEA 0183, UBX or
    SiRF Binary. These protocols are expected to be continued to be handled
    by user space for the time being, even if some hybrid solutions are also
    conceivable (e.g. to have kernel drivers issue management commands).

    This will still allow for better platform integration by allowing GNSS
    devices and their resources (e.g. regulators and enable-gpios) to be
    described by firmware and managed by kernel drivers rather than
    platform-specific scripts and services.

    While the current interface is kept minimal, it could be extended using
    IOCTLs, sysfs or uevents as needs and proper abstraction levels are
    identified and determined (e.g. for device and feature identification).

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold