30 Jun, 2022

1 commit

  • This is the 5.15.41 stable release

    * tag 'v5.15.41': (1977 commits)
    Linux 5.15.41
    usb: gadget: uvc: allow for application to cleanly shutdown
    usb: gadget: uvc: rename function to be more consistent
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
    arch/arm64/configs/defconfig
    drivers/clk/imx/clk-imx8qxp-lpcg.c
    drivers/dma/imx-sdma.c
    drivers/gpu/drm/bridge/nwl-dsi.c
    drivers/mailbox/imx-mailbox.c
    drivers/net/phy/at803x.c
    drivers/tty/serial/fsl_lpuart.c
    security/keys/trusted-keys/trusted_core.c

    Jason Liu
     

02 Jun, 2022

1 commit


30 May, 2022

1 commit


14 Apr, 2022

1 commit

  • [ Upstream commit e2cf07654efb0fd7bbcb475c6f74be7b5755a8fd ]

    coccinelle report:
    ./drivers/ptp/ptp_sysfs.c:17:8-16:
    WARNING: use scnprintf or sprintf
    ./drivers/ptp/ptp_sysfs.c:390:8-16:
    WARNING: use scnprintf or sprintf

    Use sysfs_emit instead of scnprintf or sprintf makes more sense.

    Reported-by: Zeal Robot
    Signed-off-by: Yang Guang
    Signed-off-by: David Yang
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Yang Guang
     

08 Apr, 2022

1 commit

  • [ Upstream commit bfcbb76b0f595ea9ede9f7a218086fef85242f10 ]

    When unregistering a physical clock which has some virtual clocks,
    unregister the virtual clocks with it.

    This fixes the following oops, which can be triggered by unloading
    a driver providing a PTP clock when it has enabled virtual clocks:

    BUG: unable to handle page fault for address: ffffffffc04fc4d8
    Oops: 0000 [#1] PREEMPT SMP NOPTI
    RIP: 0010:ptp_vclock_read+0x31/0xb0
    Call Trace:
    timecounter_read+0xf/0x50
    ptp_vclock_refresh+0x2c/0x50
    ? ptp_clock_release+0x40/0x40
    ptp_aux_kworker+0x17/0x30
    kthread_worker_fn+0x9b/0x240
    ? kthread_should_park+0x30/0x30
    kthread+0xe2/0x110
    ? kthread_complete_and_exit+0x20/0x20
    ret_from_fork+0x22/0x30

    Fixes: 73f37068d540 ("ptp: support ptp physical/virtual clocks conversion")
    Signed-off-by: Miroslav Lichvar
    Acked-by: Richard Cochran
    Cc: Yangbo Lu
    Cc: Yang Yingliang
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Miroslav Lichvar
     

11 Mar, 2022

1 commit

  • This is the 5.15.27 stable release

    * tag 'v5.15.27': (3069 commits)
    Linux 5.15.27
    hamradio: fix macro redefine warning
    KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots()
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
    arch/arm64/boot/dts/freescale/imx8mq.dtsi
    drivers/dma-buf/heaps/cma_heap.c
    drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
    drivers/gpu/drm/mxsfb/mxsfb_kms.c
    drivers/mmc/host/sdhci-esdhc-imx.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/rpmsg/rpmsg_char.c
    drivers/soc/imx/gpcv2.c
    drivers/thermal/imx_thermal.c

    Jason Liu
     

27 Jan, 2022

1 commit

  • [ Upstream commit 007747a984ea5e895b7d8b056b24ebf431e1e71d ]

    When multiple sockets using the SOF_TIMESTAMPING_BIND_PHC flag received
    a packet with a hardware timestamp (e.g. multiple PTP instances in
    different PTP domains using the UDPv4/v6 multicast or L2 transport),
    the timestamps received on some sockets were corrupted due to repeated
    conversion of the same timestamp (by the same or different vclocks).

    Fix ptp_convert_timestamp() to not modify the shared skb timestamp
    and return the converted timestamp as a ktime_t instead. If the
    conversion fails, return 0 to not confuse the application with
    timestamps corresponding to an unexpected PHC.

    Fixes: d7c088265588 ("net: socket: support hardware timestamp conversion to PHC bound")
    Signed-off-by: Miroslav Lichvar
    Cc: Yangbo Lu
    Cc: Richard Cochran
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Miroslav Lichvar
     

01 Dec, 2021

1 commit

  • This is the 5.15.5 stable release

    * tag 'v5.15.5': (1261 commits)
    Linux 5.15.5
    ALSA: hda: hdac_stream: fix potential locking issue in snd_hdac_stream_assign()
    ALSA: hda: hdac_ext_stream: fix potential locking issues
    ...

    Conflicts:
    arch/powerpc/platforms/85xx/Makefile
    drivers/crypto/caam/caampkc.c
    drivers/gpu/drm/bridge/nwl-dsi.c
    drivers/gpu/drm/imx/imx-drm-core.c
    drivers/remoteproc/imx_rproc.c
    drivers/soc/imx/gpcv2.c
    include/linux/rpmsg.h

    Jason Liu
     

25 Nov, 2021

1 commit

  • [ Upstream commit c7521d3aa2fa7fc785682758c99b5bcae503f6be ]

    The ptp_ocp_get_mem() function does not return NULL, it returns error
    pointers.

    Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.")
    Signed-off-by: Dan Carpenter
    Signed-off-by: David S. Miller
    Signed-off-by: Sasha Levin

    Dan Carpenter
     

02 Nov, 2021

2 commits


21 Oct, 2021

1 commit


20 Oct, 2021

1 commit

  • I got memory leak as follows when doing fault injection test:

    unreferenced object 0xffff88800906c618 (size 8):
    comm "i2c-idt82p33931", pid 4421, jiffies 4294948083 (age 13.188s)
    hex dump (first 8 bytes):
    70 74 70 30 00 00 00 00 ptp0....
    backtrace:
    [] __kmalloc_track_caller+0x19f/0x3a0
    [] kvasprintf+0xb5/0x150
    [] kvasprintf_const+0x60/0x190
    [] kobject_set_name_vargs+0x56/0x150
    [] dev_set_name+0xc0/0x100
    [] ptp_clock_register+0x9f4/0xd30 [ptp]
    [] idt82p33_probe.cold+0x8b6/0x1561 [ptp_idt82p33]

    When posix_clock_register() returns an error, the name allocated
    in dev_set_name() will be leaked, the put_device() should be used
    to give up the device reference, then the name will be freed in
    kobject_cleanup() and other memory will be freed in ptp_clock_release().

    Reported-by: Hulk Robot
    Fixes: a33121e5487b ("ptp: fix the race between the release of ptp_clock and cdev")
    Signed-off-by: Yang Yingliang
    Signed-off-by: David S. Miller

    Yang Yingliang
     

15 Oct, 2021

1 commit

  • Commit a86ed2cfa13c5 ("ptp: Don't print an error if ptp_kvm is not supported")
    fixes the error message print on ARM platform by only concerning about
    the case that the error returned from kvm_arch_ptp_init() is not -EOPNOTSUPP.
    Although the ARM platform returns -EOPNOTSUPP if ptp_kvm is not supported
    while X86_64 platform returns -KVM_EOPNOTSUPP, both error codes share the
    same value 95.

    Actually kvm_arch_ptp_init() on X86_64 platform can return three kinds of
    errors (-KVM_ENOSYS, -KVM_EOPNOTSUPP and -KVM_EFAULT). The problem is that
    -KVM_EOPNOTSUPP is masked out and -KVM_EFAULT is ignored among them.
    This patch fixes this by returning them to ptp_kvm_init() respectively.

    Signed-off-by: Kele Huang
    Signed-off-by: David S. Miller

    Kele Huang
     

08 Oct, 2021

1 commit

  • Pull networking fixes from Jakub Kicinski:
    "Including fixes from xfrm, bpf, netfilter, and wireless.

    Current release - regressions:

    - xfrm: fix XFRM_MSG_MAPPING ABI breakage caused by inserting a new
    value in the middle of an enum

    - unix: fix an issue in unix_shutdown causing the other end
    read/write failures

    - phy: mdio: fix memory leak

    Current release - new code bugs:

    - mlx5e: improve MQPRIO resiliency against bad configs

    Previous releases - regressions:

    - bpf: fix integer overflow leading to OOB access in map element
    pre-allocation

    - stmmac: dwmac-rk: fix ethernet on rk3399 based devices

    - netfilter: conntrack: fix boot failure with
    nf_conntrack.enable_hooks=1

    - brcmfmac: revert using ISO3166 country code and 0 rev as fallback

    - i40e: fix freeing of uninitialized misc IRQ vector

    - iavf: fix double unlock of crit_lock

    Previous releases - always broken:

    - bpf, arm: fix register clobbering in div/mod implementation

    - netfilter: nf_tables: correct issues in netlink rule change event
    notifications

    - dsa: tag_dsa: fix mask for trunked packets

    - usb: r8152: don't resubmit rx immediately to avoid soft lockup on
    device unplug

    - i40e: fix endless loop under rtnl if FW fails to correctly respond
    to capability query

    - mlx5e: fix rx checksum offload coexistence with ipsec offload

    - mlx5: force round second at 1PPS out start time and allow it only
    in supported clock modes

    - phy: pcs: xpcs: fix incorrect CL37 AN sequence, EEE disable
    sequence

    Misc:

    - xfrm: slightly rejig the new policy uAPI to make it less cryptic"

    * tag 'net-5.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (66 commits)
    net: prefer socket bound to interface when not in VRF
    iavf: fix double unlock of crit_lock
    i40e: Fix freeing of uninitialized misc IRQ vector
    i40e: fix endless loop under rtnl
    dt-bindings: net: dsa: marvell: fix compatible in example
    ionic: move filter sync_needed bit set
    gve: report 64bit tx_bytes counter from gve_handle_report_stats()
    gve: fix gve_get_stats()
    rtnetlink: fix if_nlmsg_stats_size() under estimation
    gve: Properly handle errors in gve_assign_qpl
    gve: Avoid freeing NULL pointer
    gve: Correct available tx qpl check
    unix: Fix an issue in unix_shutdown causing the other end read/write failures
    net: stmmac: trigger PCS EEE to turn off on link down
    net: pcs: xpcs: fix incorrect steps on disable EEE
    netlink: annotate data races around nlk->bound
    net: pcs: xpcs: fix incorrect CL37 AN sequence
    net: sfp: Fix typo in state machine debug string
    net/sched: sch_taprio: properly cancel timer from taprio_destroy()
    net: bridge: fix under estimation in br_get_linkxstats_size()
    ...

    Linus Torvalds
     

02 Oct, 2021

2 commits

  • The driver can't be loaded automatically because it misses
    module alias to be provided. Add corresponding MODULE_DEVICE_TABLE()
    call to the driver.

    Fixes: 863d08ece9bf ("supports eg20t ptp clock")
    Signed-off-by: Andy Shevchenko
    Signed-off-by: David S. Miller

    Andy Shevchenko
     
  • Pull more kvm fixes from Paolo Bonzini:
    "Small x86 fixes"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    KVM: selftests: Ensure all migrations are performed when test is affined
    KVM: x86: Swap order of CPUID entry "index" vs. "significant flag" checks
    ptp: Fix ptp_kvm_getcrosststamp issue for x86 ptp_kvm
    x86/kvmclock: Move this_cpu_pvti into kvmclock.h
    selftests: KVM: Don't clobber XMM register when read
    KVM: VMX: Fix a TSX_CTRL_CPUID_CLEAR field mask issue

    Linus Torvalds
     

30 Sep, 2021

1 commit

  • hv_clock is preallocated to have only HVC_BOOT_ARRAY_SIZE (64) elements;
    if the PTP_SYS_OFFSET_PRECISE ioctl is executed on vCPUs whose index is
    64 of higher, retrieving the struct pvclock_vcpu_time_info pointer with
    "src = &hv_clock[cpu].pvti" will result in an out-of-bounds access and
    a wild pointer. Change it to "this_cpu_pvti()" which is guaranteed to
    be valid.

    Fixes: 95a3d4454bb1 ("Switch kvmclock data to a PER_CPU variable")
    Signed-off-by: Zelin Deng
    Cc:
    Message-Id:
    Signed-off-by: Paolo Bonzini

    Zelin Deng
     

20 Sep, 2021

1 commit

  • Without CONFIG_COMMON_CLK, this fails to link:

    arm-linux-gnueabi-ld: drivers/ptp/ptp_ocp.o: in function `ptp_ocp_register_i2c':
    ptp_ocp.c:(.text+0xcc0): undefined reference to `__clk_hw_register_fixed_rate'
    arm-linux-gnueabi-ld: ptp_ocp.c:(.text+0xcf4): undefined reference to `devm_clk_hw_register_clkdev'
    arm-linux-gnueabi-ld: drivers/ptp/ptp_ocp.o: in function `ptp_ocp_detach':
    ptp_ocp.c:(.text+0x1c24): undefined reference to `clk_hw_unregister_fixed_rate'

    Fixes: a7e1abad13f3 ("ptp: Add clock driver for the OpenCompute TimeCard.")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: David S. Miller

    Arnd Bergmann
     

26 Aug, 2021

1 commit

  • Remove the 'imply' statements, these apparently are not doing
    what I expected. Platform modules which are used by the driver
    still need to be enabled in the overall config for them to be
    used, but there isn't a hard dependency on them.

    Use 'depend' for selectable modules which provide functions
    used directly by the driver.

    Signed-off-by: Jonathan Lemon
    Reviewed-by: Arnd Bergmann
    Reviewed-by: Randy Dunlap
    Signed-off-by: David S. Miller

    Jonathan Lemon
     

20 Aug, 2021

1 commit


17 Aug, 2021

3 commits

  • NET doesn't imply NET_DEVLINK. Select this separately, so that
    random config combinations don't complain.

    Reported-by: kernel test robot
    Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.")
    Signed-off-by: Jonathan Lemon
    Signed-off-by: Jakub Kicinski

    Jonathan Lemon
     
  • If ptp_ocp_device_init() fails, pci_disable_device() is skipped.
    Fix the error handling so this case is covered. Update ptp_ocp_remove()
    so the normal exit path is identical.

    Reported-by: Hulk Robot
    Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.")
    Signed-off-by: Jonathan Lemon
    Signed-off-by: Jakub Kicinski

    Jonathan Lemon
     
  • If attempting to flash the firmware with a blob of size 0,
    the entire write loop is skipped and the uninitialized err
    is returned. Fix by setting to 0 first.

    Fixes: 773bda964921 ("ptp: ocp: Expose various resources on the timecard.")
    Signed-off-by: Jonathan Lemon
    Signed-off-by: Jakub Kicinski

    Jonathan Lemon
     

16 Aug, 2021

2 commits

  • Fix kconfig warning on arch/s390/:

    WARNING: unmet direct dependencies detected for SERIAL_8250
    Depends on [n]: TTY [=y] && HAS_IOMEM [=y] && !S390 [=y]
    Selected by [m]:
    - PTP_1588_CLOCK_OCP [=m] && PTP_1588_CLOCK [=m] && HAS_IOMEM [=y] && PCI [=y] && SPI [=y] && I2C [=m] && MTD [=m]

    Signed-off-by: Randy Dunlap
    Cc: Richard Cochran
    Cc: Jonathan Lemon
    Signed-off-by: David S. Miller

    Randy Dunlap
     
  • During the swap dependency on PCH_GBE to selection PTP_1588_CLOCK_PCH
    incidentally dropped the implicit dependency on the PCI. Restore it.

    Fixes: 18d359ceb044 ("pch_gbe, ptp_pch: Fix the dependency direction between these drivers")
    Reported-by: kernel test robot
    Signed-off-by: Andy Shevchenko
    Signed-off-by: David S. Miller

    Andy Shevchenko
     

14 Aug, 2021

1 commit

  • The 'imply' keyword does not do what most people think it does, it only
    politely asks Kconfig to turn on another symbol, but does not prevent
    it from being disabled manually or built as a loadable module when the
    user is built-in. In the ICE driver, the latter now causes a link failure:

    aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_eth_ioctl':
    ice_main.c:(.text+0x13b0): undefined reference to `ice_ptp_get_ts_config'
    ice_main.c:(.text+0x13b0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_get_ts_config'
    aarch64-linux-ld: ice_main.c:(.text+0x13bc): undefined reference to `ice_ptp_set_ts_config'
    ice_main.c:(.text+0x13bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_set_ts_config'
    aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_prepare_for_reset':
    ice_main.c:(.text+0x31fc): undefined reference to `ice_ptp_release'
    ice_main.c:(.text+0x31fc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `ice_ptp_release'
    aarch64-linux-ld: drivers/net/ethernet/intel/ice/ice_main.o: in function `ice_rebuild':

    This is a recurring problem in many drivers, and we have discussed
    it several times befores, without reaching a consensus. I'm providing
    a link to the previous email thread for reference, which discusses
    some related problems.

    To solve the dependency issue better than the 'imply' keyword, introduce a
    separate Kconfig symbol "CONFIG_PTP_1588_CLOCK_OPTIONAL" that any driver
    can depend on if it is able to use PTP support when available, but works
    fine without it. Whenever CONFIG_PTP_1588_CLOCK=m, those drivers are
    then prevented from being built-in, the same way as with a 'depends on
    PTP_1588_CLOCK || !PTP_1588_CLOCK' dependency that does the same trick,
    but that can be rather confusing when you first see it.

    Since this should cover the dependencies correctly, the IS_REACHABLE()
    hack in the header is no longer needed now, and can be turned back
    into a normal IS_ENABLED() check. Any driver that gets the dependency
    wrong will now cause a link time failure rather than being unable to use
    PTP support when that is in a loadable module.

    However, the two recently added ptp_get_vclocks_index() and
    ptp_convert_timestamp() interfaces are only called from builtin code with
    ethtool and socket timestamps, so keep the current behavior by stubbing
    those out completely when PTP is in a loadable module. This should be
    addressed properly in a follow-up.

    As Richard suggested, we may want to actually turn PTP support into a
    'bool' option later on, preventing it from being a loadable module
    altogether, which would be one way to solve the problem with the ethtool
    interface.

    Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810 devices")
    Link: https://lore.kernel.org/netdev/20210804121318.337276-1-arnd@kernel.org/
    Link: https://lore.kernel.org/netdev/CAK8P3a06enZOf=XyZ+zcAwBczv41UuCTz+=0FMf2gBz1_cOnZQ@mail.gmail.com/
    Link: https://lore.kernel.org/netdev/CAK8P3a3=eOxE-K25754+fB_-i_0BZzf9a9RfPTX3ppSwu9WZXw@mail.gmail.com/
    Link: https://lore.kernel.org/netdev/20210726084540.3282344-1-arnd@kernel.org/
    Acked-by: Shannon Nelson
    Acked-by: Jacob Keller
    Acked-by: Richard Cochran
    Reviewed-by: Vladimir Oltean
    Signed-off-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20210812183509.1362782-1-arnd@kernel.org
    Signed-off-by: Jakub Kicinski

    Arnd Bergmann
     

13 Aug, 2021

1 commit

  • Conflicts:

    drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h
    9e26680733d5 ("bnxt_en: Update firmware call to retrieve TX PTP timestamp")
    9e518f25802c ("bnxt_en: 1PPS functions to configure TSIO pins")
    099fdeda659d ("bnxt_en: Event handler for PPS events")

    kernel/bpf/helpers.c
    include/linux/bpf-cgroup.h
    a2baf4e8bb0f ("bpf: Fix potentially incorrect results with bpf_get_local_storage()")
    c7603cfa04e7 ("bpf: Add ambient BPF runtime context stored in current")

    drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
    5957cc557dc5 ("net/mlx5: Set all field of mlx5_irq before inserting it to the xarray")
    2d0b41a37679 ("net/mlx5: Refcount mlx5_irq with integer")

    MAINTAINERS
    7b637cd52f02 ("MAINTAINERS: fix Microchip CAN BUS Analyzer Tool entry typo")
    7d901a1e878a ("net: phy: add Maxlinear GPY115/21x/24x driver")

    Signed-off-by: Jakub Kicinski

    Jakub Kicinski
     

09 Aug, 2021

1 commit

  • All kernel devlink implementations call to devlink_alloc() during
    initialization routine for specific device which is used later as
    a parent device for devlink_register().

    Such late device assignment causes to the situation which requires us to
    call to device_register() before setting other parameters, but that call
    opens devlink to the world and makes accessible for the netlink users.

    Any attempt to move devlink_register() to be the last call generates the
    following error due to access to the devlink->dev pointer.

    [ 8.758862] devlink_nl_param_fill+0x2e8/0xe50
    [ 8.760305] devlink_param_notify+0x6d/0x180
    [ 8.760435] __devlink_params_register+0x2f1/0x670
    [ 8.760558] devlink_params_register+0x1e/0x20

    The simple change of API to set devlink device in the devlink_alloc()
    instead of devlink_register() fixes all this above and ensures that
    prior to call to devlink_register() everything already set.

    Signed-off-by: Leon Romanovsky
    Reviewed-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Leon Romanovsky
     

08 Aug, 2021

1 commit

  • Fixes possible leak of PTP virtual clocks.

    The number of PTP virtual clocks to be unregistered is passed as
    'u32', but the function that unregister the devices handles that as
    'u8'.

    Fixes: 73f37068d540 ("ptp: support ptp physical/virtual clocks conversion")
    Signed-off-by: Vinicius Costa Gomes
    Signed-off-by: David S. Miller

    Vinicius Costa Gomes
     

06 Aug, 2021

6 commits

  • After writing an image blob to the flash memory, a reboot is required
    to reload the FPGA. There is no versioning prsent in the FPGA image
    file, so only a running version is available. The 'stored version'
    was set to 'pending' in order to indicate a reboot was needed.

    This isn't reliable, as the module could be unloaded/loaded, losing
    the "reboot needed" indicator. Also, the devlink 'stored version'
    information is designed to refer to the actual image version.

    Unfortunately, there is no method to determine the flash image version
    other than booting it, so remove the devlink stored version setting.

    Signed-off-by: Jonathan Lemon
    Signed-off-by: David S. Miller

    Jonathan Lemon
     
  • The TimeCard has two FPGA images in the flash: the actual firmware,
    and a manufacturing fallback version which is intended to act as a
    loader in case the flash update failed.

    Name these "fw" and "loader", which are reflected in devlink:

    [root@timecard drv]# devlink dev info
    pci/0000:04:00.0:
    driver ptp_ocp
    serial_number fc:c2:3d:2e:d7:c0
    versions:
    running:
    fw 5

    Signed-off-by: Jonathan Lemon
    Signed-off-by: David S. Miller

    Jonathan Lemon
     
  • GPS is not the only available positioning system. Use the generic
    naming of "GNSS" instead.

    Signed-off-by: Jonathan Lemon
    Signed-off-by: David S. Miller

    Jonathan Lemon
     
  • "devlink health" was used as a way to monitor the GNSS signal
    status. This isn't really the intended use, and the same
    functionality can be achived by monitoring the status file.

    Remove the devlink heath support entirely, and also remove the
    currently unused devlink parameters.

    Signed-off-by: Jonathan Lemon
    Signed-off-by: David S. Miller

    Jonathan Lemon
     
  • There are two PPS blocks: one handles the external PPS signal output,
    with the other handling the PPS signal input to the internal clock.
    Add controls for the external PPS block.

    Rename the fields so they match their function.

    Add cable_delay to the register definitions.

    Signed-off-by: Jonathan Lemon
    Signed-off-by: David S. Miller

    Jonathan Lemon
     
  • Move the put_device() call to the error handling path, so the
    device is released after the .release callback, avoiding a
    use-after-free.

    Signed-off-by: Jonathan Lemon
    Signed-off-by: David S. Miller

    Jonathan Lemon
     

04 Aug, 2021

1 commit

  • The OpenCompute timecard driver has additional functionality besides
    a clock. Make the following resources available:

    - The external timestamp channels (ts0/ts1)
    - devlink support for flashing and health reporting
    - GPS and MAC serial ports
    - board serial number (obtained from i2c device)

    Also add watchdog functionality for when GNSS goes into holdover.

    The resources are collected under a timecard class directory:

    [jlemon@timecard ~]$ ls -g /sys/class/timecard/ocp1/
    total 0
    -r--r--r--. 1 root 4096 Aug 3 19:49 available_clock_sources
    -rw-r--r--. 1 root 4096 Aug 3 19:49 clock_source
    lrwxrwxrwx. 1 root 0 Aug 3 19:49 device -> ../../../0000:04:00.0/
    -r--r--r--. 1 root 4096 Aug 3 19:49 gps_sync
    lrwxrwxrwx. 1 root 0 Aug 3 19:49 i2c -> ../../xiic-i2c.1024/i2c-2/
    drwxr-xr-x. 2 root 0 Aug 3 19:49 power/
    lrwxrwxrwx. 1 root 0 Aug 3 19:49 pps ->
    ../../../../../virtual/pps/pps1/
    lrwxrwxrwx. 1 root 0 Aug 3 19:49 ptp -> ../../ptp/ptp2/
    -r--r--r--. 1 root 4096 Aug 3 19:49 serialnum
    lrwxrwxrwx. 1 root 0 Aug 3 19:49 subsystem ->
    ../../../../../../class/timecard/
    lrwxrwxrwx. 1 root 0 Aug 3 19:49 ttyGPS -> ../../tty/ttyS7/
    lrwxrwxrwx. 1 root 0 Aug 3 19:49 ttyMAC -> ../../tty/ttyS8/
    -rw-r--r--. 1 root 4096 Aug 3 19:39 uevent

    The labeling is needed at the minimum, in order to tell the serial
    devices apart.

    Signed-off-by: Jonathan Lemon
    Signed-off-by: David S. Miller

    Jonathan Lemon
     

09 Jul, 2021

1 commit

  • An earlier commit set the pps_lookup cookie, but the line
    was somehow added to the wrong code block. Correct this.

    Fixes: 8602e40fc813 ("ptp: Set lookup cookie when creating a PTP PPS source.")
    Signed-off-by: Jonathan Lemon
    Signed-off-by: Dario Binacchi
    Acked-by: Richard Cochran
    Signed-off-by: David S. Miller

    Jonathan Lemon
     

06 Jul, 2021

2 commits