1
0
Fork 0
alistair23-linux/drivers
Julien Beraud 15de2df386 net: stmmac: Fix sub-second increment
[ Upstream commit 91a2559c1d ]

In fine adjustement mode, which is the current default, the sub-second
    increment register is the number of nanoseconds that will be added to
    the clock when the accumulator overflows. At each clock cycle, the
    value of the addend register is added to the accumulator.
    Currently, we use 20ns = 1e09ns / 50MHz as this value whatever the
    frequency of the ptp clock actually is.
    The adjustment is then done on the addend register, only incrementing
    every X clock cycles X being the ratio between 50MHz and ptp_clock_rate
    (addend = 2^32 * 50MHz/ptp_clock_rate).
    This causes the following issues :
    - In case the frequency of the ptp clock is inferior or equal to 50MHz,
      the addend value calculation will overflow and the default
      addend value will be set to 0, causing the clock to not work at
      all. (For instance, for ptp_clock_rate = 50MHz, addend = 2^32).
    - The resolution of the timestamping clock is limited to 20ns while it
      is not needed, thus limiting the accuracy of the timestamping to
      20ns.

    Fix this by setting sub-second increment to 2e09ns / ptp_clock_rate.
    It will allow to reach the minimum possible frequency for
    ptp_clk_ref, which is 5MHz for GMII 1000Mps Full-Duplex by setting the
    sub-second-increment to a higher value. For instance, for 25MHz, it
    gives ssinc = 80ns and default_addend = 2^31.
    It will also allow to use a lower value for sub-second-increment, thus
    improving the timestamping accuracy with frequencies higher than
    100MHz, for instance, for 200MHz, ssinc = 10ns and default_addend =
    2^31.

v1->v2:
 - Remove modifications to the calculation of default addend, which broke
 compatibility with clock frequencies for which 2000000000 / ptp_clk_freq
 is not an integer.
 - Modify description according to discussions.

Signed-off-by: Julien Beraud <julien.beraud@orolia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-10 10:31:26 +02:00
..
accessibility
acpi PM: ACPI: Output correct message on target power state 2020-05-06 08:15:09 +02:00
amba
android binderfs: use refcount for binder control devices too 2020-03-25 08:25:50 +01:00
ata libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set 2020-04-17 10:50:22 +02:00
atm fore200e: Fix incorrect checks of NULL pointer dereference 2020-02-24 08:36:36 +01:00
auxdisplay
base PM: sleep: core: Switch back to async_schedule_dev() 2020-05-02 08:48:53 +02:00
bcma
block virtio-blk: improve virtqueue error to BLK_STS 2020-04-29 16:33:05 +02:00
bluetooth Bluetooth: btusb: Disable runtime suspend on Realtek devices 2020-02-11 04:35:09 -08:00
bus bus: sunxi-rsb: Return correct data when mixing 16-bit and 8-bit reads 2020-04-17 10:49:56 +02:00
cdrom cdrom: respect device capabilities during opening action 2020-01-04 19:18:25 +01:00
char tpm: ibmvtpm: retry on H_CLOSED in tpm_ibmvtpm_send() 2020-04-29 16:33:16 +02:00
clk clk: tegra: Fix Tegra PMC clock out parents 2020-04-23 10:36:29 +02:00
clocksource clocksource/drivers/hyper-v: Untangle stimers and timesync from clocksources 2020-04-01 11:02:12 +02:00
connector
counter counter: 104-quad-8: Add lock guards - generic interface 2020-05-02 08:48:44 +02:00
cpufreq cpufreq: powernv: Fix use-after-free 2020-04-17 10:50:22 +02:00
cpuidle cpuidle: teo: Avoid using "early hits" incorrectly 2020-02-05 21:22:52 +00:00
crypto crypto: caam - fix the address of the last entry of S/G 2020-05-06 08:15:07 +02:00
dax
dca
devfreq Revert "PM / devfreq: Modify the device name as devfreq(X) for sysfs" 2020-03-05 16:43:43 +01:00
dio
dma dmaengine: dmatest: Fix process hang when reading 'wait' parameter 2020-05-06 08:15:16 +02:00
dma-buf dma-buf: Fix SET_NAME ioctl uapi 2020-05-06 08:15:01 +02:00
edac EDAC/synopsys: Do not print an error with back-to-back snprintf() calls 2020-03-12 13:00:31 +01:00
eisa
extcon extcon: axp288: Add wakeup support 2020-04-08 09:08:43 +02:00
firewire net: add annotations on hh->hh_len lockless accesses 2020-01-09 10:20:06 +01:00
firmware efi/x86: Ignore the memory attributes table on i386 2020-04-17 10:50:03 +02:00
fpga fpga: dfl: pci: fix return value of cci_pci_sriov_configure 2020-04-29 16:33:22 +02:00
fsi fsi: core: Fix small accesses and unaligned offsets via sysfs 2019-12-31 16:45:09 +01:00
gnss
gpio gpiolib: acpi: Add quirk to ignore EC wakeups on HP x2 10 CHT + AXP288 model 2020-04-02 15:11:01 +02:00
gpu drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay table v0 (e.g Hawaii) 2020-05-10 10:31:25 +02:00
greybus
hid HID: add ALWAYS_POLL quirk to lenovo pixart mouse 2020-03-21 08:11:59 +01:00
hsi
hv Drivers: hv: vmbus: Fix Suspend-to-Idle for Generation-2 VM 2020-05-06 08:15:09 +02:00
hwmon hwmon: (jc42) Fix name to have no illegal characters 2020-05-02 08:48:59 +02:00
hwspinlock
hwtracing stm class: sys-t: Fix the use of time_after() 2020-03-25 08:25:56 +01:00
i2c i2c: aspeed: Avoid i2c interrupt status clear race condition. 2020-05-06 08:15:15 +02:00
i3c
ide ide: serverworks: potential overflow in svwks_set_pio_mode() 2020-02-24 08:36:53 +01:00
idle
iio iio:ad7797: Use correct attribute_group 2020-05-02 08:48:44 +02:00
infiniband RDMA/cm: Fix an error check in cm_alloc_id_priv() 2020-05-06 08:15:13 +02:00
input Input: i8042 - add Acer Aspire 5738z to nomux list 2020-04-17 10:50:21 +02:00
interconnect interconnect: qcom: qcs404: Walk the list safely on node removal 2019-12-17 19:55:39 +01:00
iommu iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system 2020-05-06 08:15:15 +02:00
ipack
irqchip irqchip/mbigen: Free msi_desc on device teardown 2020-04-23 10:36:20 +02:00
isdn
leds leds: core: Fix warning message when init_data 2020-04-23 10:36:37 +02:00
lightnvm
macintosh macintosh: windfarm: fix MODINFO regression 2020-03-18 07:17:53 +01:00
mailbox mailbox: imx: Fix Tx doorbell shutdown path 2020-01-04 19:18:30 +01:00
mcb
md dm multipath: use updated MPATHF_QUEUE_IO on mapping for bio-based mpath 2020-05-06 08:15:10 +02:00
media media: ti-vpe: cal: fix a kernel oops when unloading module 2020-04-17 10:50:08 +02:00
memory memory: mtk-smi: Add PM suspend and resume ops 2020-01-17 19:48:59 +01:00
memstick
message scsi: mptfusion: Fix double fetch bug in ioctl 2020-01-23 08:22:35 +01:00
mfd mfd: dln2: Fix sanity checking for endpoints 2020-04-17 10:50:25 +02:00
misc mei: me: add cedar fork device ids 2020-04-08 09:08:42 +02:00
mmc mmc: meson-mx-sdio: remove the broken ->card_busy() op 2020-05-06 08:15:07 +02:00
mtd mtd: phram: fix a double free issue in error path 2020-04-23 10:36:45 +02:00
mux
net net: stmmac: Fix sub-second increment 2020-05-10 10:31:26 +02:00
nfc NFC: fdp: Fix a signedness bug in fdp_nci_send_patch() 2020-04-01 11:01:38 +02:00
ntb
nubus
nvdimm libnvdimm: Out of bounds read in __nd_ioctl() 2020-04-23 10:36:42 +02:00
nvme nvme: prevent double free in nvme_alloc_ns() error handling 2020-05-06 08:15:16 +02:00
nvmem nvmem: check for NULL reg_read and reg_write before dereferencing 2020-04-08 09:08:42 +02:00
of of: overlay: kmemleak in dup_and_fixup_symbol_prop() 2020-04-23 10:36:23 +02:00
opp opp: Free static OPPs on errors while adding them 2020-02-24 08:36:34 +01:00
oprofile
parisc
parport parport: load lowlevel driver if ports not found 2019-12-31 16:45:25 +01:00
pci PCI: Move Apex Edge TPU class quirk to fix BAR assignment 2020-05-02 08:48:50 +02:00
pcmcia
perf drivers/perf: arm_pmu_acpi: Fix incorrect checking of gicc pointer 2020-03-25 08:25:47 +01:00
phy phy: uniphier-usb3ss: Add Pro5 support 2020-04-23 10:36:33 +02:00
pinctrl pinctrl: core: Remove extra kref_get which blocks hogs being freed 2020-03-18 07:17:55 +01:00
platform platform/chrome: cros_ec_rpmsg: Fix race with host event 2020-04-21 09:04:51 +02:00
pnp
power power: supply: axp288_fuel_gauge: Broaden vendor check for Intel Compute Sticks. 2020-04-23 10:36:41 +02:00
powercap powercap: intel_rapl: add NULL pointer check to rapl_mmio_cpu_online() 2020-01-14 20:08:18 +01:00
pps
ps3
ptp ptp: free ptp device pin descriptors properly 2020-01-23 08:22:51 +01:00
pwm pwm: bcm2835: Dynamically allocate base 2020-04-29 16:33:02 +02:00
rapidio
ras
regulator regulator: stm32-vrefbuf: fix a possible overshoot when re-enabling 2020-03-12 13:00:29 +01:00
remoteproc remoteproc: qcom_q6v5_mss: fix a bug in q6v5_probe() 2020-05-10 10:31:25 +02:00
reset reset: uniphier: Add SCSSI reset control for each channel 2020-02-24 08:36:41 +01:00
rpmsg rpmsg: char: release allocated memory 2020-01-14 20:08:37 +01:00
rtc rtc: 88pm860x: fix possible race condition 2020-04-23 10:36:31 +02:00
s390 s390/cio: avoid duplicated 'ADD' uevents 2020-04-29 16:33:01 +02:00
sbus
scsi scsi: qla2xxx: check UNLOADING before posting async work 2020-05-06 08:15:11 +02:00
sfi
sh
siox
slimbus
soc drivers: soc: xilinx: fix firmware driver Kconfig dependency 2020-05-02 08:48:46 +02:00
soundwire soundwire: intel: fix PDI/stream mapping for Bulk 2019-12-31 16:45:11 +01:00
spi spi: spi-fsl-dspi: Replace interruptible wait queue with a simple completion 2020-04-17 10:50:05 +02:00
spmi spmi: pmic-arb: Set lockdep class for hierarchical irq domains 2020-02-19 19:53:07 +01:00
ssb
staging PCI: Move Apex Edge TPU class quirk to fix BAR assignment 2020-05-02 08:48:50 +02:00
target scsi: target/iblock: fix WRITE SAME zeroing 2020-05-06 08:15:14 +02:00
tc
tee tee: optee: Fix compilation issue with nommu 2020-02-05 21:22:49 +00:00
thermal thermal: brcmstb_thermal: Do not use DT coefficients 2020-03-05 16:43:50 +01:00
thunderbolt thunderbolt: Prevent crash if non-active NVMem file is read 2020-02-28 17:22:13 +01:00
tty Revert "serial: uartps: Register own uart console and driver structures" 2020-04-29 16:33:24 +02:00
uio uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol() 2020-02-24 08:36:27 +01:00
usb usb: dwc3: gadget: Properly set maxpacket limit 2020-05-10 10:31:24 +02:00
vfio vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn() 2020-05-06 08:15:14 +02:00
vhost vhost: vsock: kick send_pkt worker once device is started 2020-05-10 10:31:21 +02:00
video fbmem: Adjust indentation in fb_prepare_logo and fb_blank 2020-04-23 10:36:43 +02:00
virt
virtio virtio_ring: Fix mem leak with vring_new_virtqueue() 2020-03-18 07:17:55 +01:00
visorbus visorbus: fix uninitialized variable access 2020-02-24 08:36:47 +01:00
vlynq
vme vme: bridges: reduce stack usage 2020-02-24 08:36:48 +01:00
w1
watchdog watchdog: reset last_hw_keepalive time at start 2020-04-29 16:32:57 +02:00
xen xen/xenbus: ensure xenbus_map_ring_valloc() returns proper grant status 2020-05-02 08:48:57 +02:00
zorro
Kconfig
Makefile