5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into... 20181207_1032 ti-rt-linux-4.14.y-next-20181206 ti-rt-linux-4.14.y-next-20181207 ti-rt-linux-4.14.y-next-20181208 ti-rt-linux-4.14.y-next-20181209 ti-rt-linux-4.14.y-next-20181210 ti-rt-linux-4.19.y-next-20181206 ti-rt-linux-4.19.y-next-20181207 ti-rt-linux-4.19.y-next-20181208 ti-rt-linux-4.19.y-next-20181209 ti-rt-linux-4.19.y-next-20181210
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
ti_config_fragments/v8_defconfig_map.txt: add connectivity.cfg
arm64: dts: ti: AM654: add main navss cpts node
ti_config_fragments/connectivity.cfg: enable mcu cpsw/cpts drivers
arm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs
arm64: dts: ti: k3-am6: add mcu cpsw nuss node
arm64: dts: k3-am6: add mcu system control module node
net: ethernet: ti: introduce am654 gigabit eth switch subsystem driver
dt-binding: ti: am654: document mcu cpsw nuss
net: ethernet: ti: introduce am654 common platform time sync driver
dt-binding: ti: am654: document common platform time sync cpts module
net: ethernet: ti: davinci_mdio: allow init without creating pdev
net: ethernet: ti: cpsw-phy-sel: add am654 support
net: ethernet: ti: cpsw: introduce mac sl module api
net: ethernet: ti: ale: add support for mac-only mode
HACK: soc: ti: k3: add dma descriptors pool
ti_config_fragments/defconfig_map.txt: add connectivity.cfg
ti_config_fragments: add connectivity.cfg
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
ti_config_fragments/v8_defconfig_map.txt: add connectivity.cfg
arm64: dts: ti: AM654: add main navss cpts node
ti_config_fragments/connectivity.cfg: enable mcu cpsw/cpts drivers
arm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs
arm64: dts: ti: k3-am6: add mcu cpsw nuss node
arm64: dts: k3-am6: add mcu system control module node
net: ethernet: ti: introduce am654 gigabit eth switch subsystem driver
dt-binding: ti: am654: document mcu cpsw nuss
net: ethernet: ti: introduce am654 common platform time sync driver
dt-binding: ti: am654: document common platform time sync cpts module
net: ethernet: ti: davinci_mdio: allow init without creating pdev
net: ethernet: ti: cpsw-phy-sel: add am654 support
net: ethernet: ti: cpsw: introduce mac sl module api
net: ethernet: ti: ale: add support for mac-only mode
HACK: soc: ti: k3: add dma descriptors pool
ti_config_fragments/defconfig_map.txt: add connectivity.cfg
ti_config_fragments: add connectivity.cfg
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Merge branch 'connectivity-ti-linux-4.19.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.19.y
TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-4.19.y
* 'connectivity-ti-linux-4.19.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
ti_config_fragments/v8_defconfig_map.txt: add connectivity.cfg
arm64: dts: ti: AM654: add main navss cpts node
ti_config_fragments/connectivity.cfg: enable mcu cpsw/cpts drivers
arm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs
arm64: dts: ti: k3-am6: add mcu cpsw nuss node
arm64: dts: k3-am6: add mcu system control module node
net: ethernet: ti: introduce am654 gigabit eth switch subsystem driver
dt-binding: ti: am654: document mcu cpsw nuss
net: ethernet: ti: introduce am654 common platform time sync driver
dt-binding: ti: am654: document common platform time sync cpts module
net: ethernet: ti: davinci_mdio: allow init without creating pdev
net: ethernet: ti: cpsw-phy-sel: add am654 support
net: ethernet: ti: cpsw: introduce mac sl module api
net: ethernet: ti: ale: add support for mac-only mode
HACK: soc: ti: k3: add dma descriptors pool
ti_config_fragments/defconfig_map.txt: add connectivity.cfg
ti_config_fragments: add connectivity.cfg
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-4.19.y
* 'connectivity-ti-linux-4.19.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
ti_config_fragments/v8_defconfig_map.txt: add connectivity.cfg
arm64: dts: ti: AM654: add main navss cpts node
ti_config_fragments/connectivity.cfg: enable mcu cpsw/cpts drivers
arm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs
arm64: dts: ti: k3-am6: add mcu cpsw nuss node
arm64: dts: k3-am6: add mcu system control module node
net: ethernet: ti: introduce am654 gigabit eth switch subsystem driver
dt-binding: ti: am654: document mcu cpsw nuss
net: ethernet: ti: introduce am654 common platform time sync driver
dt-binding: ti: am654: document common platform time sync cpts module
net: ethernet: ti: davinci_mdio: allow init without creating pdev
net: ethernet: ti: cpsw-phy-sel: add am654 support
net: ethernet: ti: cpsw: introduce mac sl module api
net: ethernet: ti: ale: add support for mac-only mode
HACK: soc: ti: k3: add dma descriptors pool
ti_config_fragments/defconfig_map.txt: add connectivity.cfg
ti_config_fragments: add connectivity.cfg
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
ti_config_fragments/v8_defconfig_map.txt: add connectivity.cfg
Add support for connectivity fragments on TI's ARMv8
platforms.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add support for connectivity fragments on TI's ARMv8
platforms.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arm64: dts: ti: AM654: add main navss cpts node
Add DT node for Main NAVSS CPTS module.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add DT node for Main NAVSS CPTS module.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ti_config_fragments/connectivity.cfg: enable mcu cpsw/cpts drivers
Enable CPSW/CPTS NUSS driver.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Enable CPSW/CPTS NUSS driver.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arm64: dts: k3-am654-base-board: add mcu cpsw nuss pinmux and phy defs
AM654 EVM base board has TI DP83867 PHY connected to external CPSW NUSS
Port 1 in rgmii mode.
Hence, add pinmux and Ethernet PHY configuration for TI am654 SoC Gigabit
Ethernet two ports Switch subsystem (CPSW NUSS).
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
AM654 EVM base board has TI DP83867 PHY connected to external CPSW NUSS
Port 1 in rgmii mode.
Hence, add pinmux and Ethernet PHY configuration for TI am654 SoC Gigabit
Ethernet two ports Switch subsystem (CPSW NUSS).
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arm64: dts: ti: k3-am6: add mcu cpsw nuss node
Add DT node for The TI am654 SoC Gigabit Ethernet two ports Switch
subsystem (CPSW NUSS).
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add DT node for The TI am654 SoC Gigabit Ethernet two ports Switch
subsystem (CPSW NUSS).
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arm64: dts: k3-am6: add mcu system control module node
MCU System control module support is added to the device tree to allow
drivers to access to their System control module registers.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
MCU System control module support is added to the device tree to allow
drivers to access to their System control module registers.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: introduce am654 gigabit eth switch subsystem driver
The TI am654 SoC Gigabit Ethernet Switch subsystem (CPSW NUSS) has two
ports and provides Ethernet packet communication for the device and can be
configured as an Ethernet switch. CPSW NUSS features: the Reduced Gigabit
Media Independent Interface (RGMII), Reduced Media Independent Interface
(RMII), and the Management Data Input/Output (MDIO) interface for physical
layer device (PHY) management.
The TI am654 SoC has integrated two-port Gigabit Ethernet Switch subsystem
into device MCU domain named MCU_CPSW0. One Ethernet port (port 1) with
selectable RGMII and RMII interfaces and an internal Communications Port
Programming Interface (CPPI) port (Host port 0).
Host Port 0 CPPI Packet Streaming Interface interface supports 8 TX
channels and on RX channels operating by TI am654 NAVSS Unified DMA
Peripheral Root Complex (UDMA-P) controller.
Introduced driver provides one linux net_device to user space and supports:
- ifconfig up/down
- MAC address configuration
- ethtool operation:
--driver
--change
--register-dump
--negotiate phy
--statistics
--set-eee phy
--show-ring
--show-channels
- net_device ioctl mii-control
- promisc mode
- Common Platform Time Sync (CPTS) module support:
-- support for SIOCSHWTSTAMP/SIOCGHWTSTAMP net_device ioctls
-- RX : timestamps all received packets (HWTSTAMP_FILTER_ALL)
-- TX : timestamps only PTP packets
-- PTP event messages - Sync, Delay_Req, Pdelay_Req, and Pdelay_Resp
-- IEEE 1588 Annex D, Annex E and Annex F
-- Add ethtool .get_ts_info()
- rx checksum offload support
CPSW NUSS can verify IPv4/IPv6 TCP/UDP packets checksum and fills
csum information for each packet in psdata[2] word:
- BIT(16) CHECKSUM_ERROR - indicates csum error
- BIT(17) FRAGMENT - indicates fragmented packet
- BIT(18) TCP_UDP_N - Indicates TCP packet was detected
- BIT(19) IPV6_VALID, BIT(20) IPV4_VALID - indicates IPv6/IPv4 packet
- BIT(15, 0) CHECKSUM_ADD - This is the value that was summed
during the checksum computation. This value is FFFFh for non fragmented
IPV4/6 UDP/TCP packets with no checksum error.
The CPSW NUSS driver will pass csum info to upper layer as below:
if (ipv4_valid || ipv6_valid) && fragment) then
skb->ip_summed = CHECKSUM_COMPLETE
skb->csum = CHECKSUM_ADD
if (ipv4_valid || ipv6_valid) && not fragment) then
skb->ip_summed = CHECKSUM_UNNECESSARY
if (ipv4_valid || ipv6_valid) && checksum_error) then
skb->ip_summed = CHECKSUM_NONE
else
skb->ip_summed = CHECKSUM_NONE
RX csum offload can be disabled:
ethtool -K <dev> rx-checksum on|off
- tx checksum offload support (disabled by default due to am65x HW bug)
AM65x CPSW NUSS can calculate TX packets checksum and write csum value
in specified location in the packet. How HW should calculate csum
determined in CPPI5 psdata[2] word for each packet:
- BITS 31-24 CHECKSUM_RESULT: This is the packet byte number where
the checksum result will be placed in the egress packet.
- BITS 23-16 CHECKSUM_START_BYTE: This is the packet byte number to
start the checksum calculation on.
- BIT 15 CHECKSUM_INV - When set, a zero checksum value will be
inverted and sent as FFFFh.
- BITS 13-0 CHECKSUM_BYTECOUNT: This is the number of bytes to
calculate the checksum on. The outgoing Ethernet packet will have a
checksum inserted when this value is non-zero. The bit 0 RX_CHECKSUM_EN has
to be set in P0_CONTROL_REG to enable TX csum offload.
TX csum HW offload can be enabled/disabled:
ethtool -K <dev> tx-checksum-ip-generic on|off
- multiq and switch between round robin/prio modes for cppi tx queues
By default Linux network stack does not assume the multiqueue network
device works in fixed priority mode. As result, it will try to dispatch
packets between HW queues fairly - basing on skb hash (and XPS map if
enabled). So, by default, MCU CPSW TX statistic looks like below:
tx_pri0: 14
tx_pri1: 2
tx_pri2: 0
tx_pri3: 12
tx_pri4: 12
tx_pri5: 0
tx_pri6: 306127
tx_pri7: 0
From another side, MCU CPSW HW processes TX queues in fixed priority mode
(7 - high prio) and this is does not corresponds to what Linux network
stack expects as some packets might be delayed, MCU CPSW CPPI interface set
to Round Robin mode (CPPI_P0_Pri_Ctl.p0_rx_ptype) by default.
Fixed priority can be used with multiq, prio and mqprio qdisc's.
Netdev private flag "p0-rx-ptype-rrobin" can be used to switch between
Round Robin and Fixed priority modes:
# ethtool --show-priv-flags eth0
Private flags for eth0:
p0-rx-ptype-rrobin: on
# ethtool --set-priv-flags eth0 p0-rx-ptype-rrobin off
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
The TI am654 SoC Gigabit Ethernet Switch subsystem (CPSW NUSS) has two
ports and provides Ethernet packet communication for the device and can be
configured as an Ethernet switch. CPSW NUSS features: the Reduced Gigabit
Media Independent Interface (RGMII), Reduced Media Independent Interface
(RMII), and the Management Data Input/Output (MDIO) interface for physical
layer device (PHY) management.
The TI am654 SoC has integrated two-port Gigabit Ethernet Switch subsystem
into device MCU domain named MCU_CPSW0. One Ethernet port (port 1) with
selectable RGMII and RMII interfaces and an internal Communications Port
Programming Interface (CPPI) port (Host port 0).
Host Port 0 CPPI Packet Streaming Interface interface supports 8 TX
channels and on RX channels operating by TI am654 NAVSS Unified DMA
Peripheral Root Complex (UDMA-P) controller.
Introduced driver provides one linux net_device to user space and supports:
- ifconfig up/down
- MAC address configuration
- ethtool operation:
--driver
--change
--register-dump
--negotiate phy
--statistics
--set-eee phy
--show-ring
--show-channels
- net_device ioctl mii-control
- promisc mode
- Common Platform Time Sync (CPTS) module support:
-- support for SIOCSHWTSTAMP/SIOCGHWTSTAMP net_device ioctls
-- RX : timestamps all received packets (HWTSTAMP_FILTER_ALL)
-- TX : timestamps only PTP packets
-- PTP event messages - Sync, Delay_Req, Pdelay_Req, and Pdelay_Resp
-- IEEE 1588 Annex D, Annex E and Annex F
-- Add ethtool .get_ts_info()
- rx checksum offload support
CPSW NUSS can verify IPv4/IPv6 TCP/UDP packets checksum and fills
csum information for each packet in psdata[2] word:
- BIT(16) CHECKSUM_ERROR - indicates csum error
- BIT(17) FRAGMENT - indicates fragmented packet
- BIT(18) TCP_UDP_N - Indicates TCP packet was detected
- BIT(19) IPV6_VALID, BIT(20) IPV4_VALID - indicates IPv6/IPv4 packet
- BIT(15, 0) CHECKSUM_ADD - This is the value that was summed
during the checksum computation. This value is FFFFh for non fragmented
IPV4/6 UDP/TCP packets with no checksum error.
The CPSW NUSS driver will pass csum info to upper layer as below:
if (ipv4_valid || ipv6_valid) && fragment) then
skb->ip_summed = CHECKSUM_COMPLETE
skb->csum = CHECKSUM_ADD
if (ipv4_valid || ipv6_valid) && not fragment) then
skb->ip_summed = CHECKSUM_UNNECESSARY
if (ipv4_valid || ipv6_valid) && checksum_error) then
skb->ip_summed = CHECKSUM_NONE
else
skb->ip_summed = CHECKSUM_NONE
RX csum offload can be disabled:
ethtool -K <dev> rx-checksum on|off
- tx checksum offload support (disabled by default due to am65x HW bug)
AM65x CPSW NUSS can calculate TX packets checksum and write csum value
in specified location in the packet. How HW should calculate csum
determined in CPPI5 psdata[2] word for each packet:
- BITS 31-24 CHECKSUM_RESULT: This is the packet byte number where
the checksum result will be placed in the egress packet.
- BITS 23-16 CHECKSUM_START_BYTE: This is the packet byte number to
start the checksum calculation on.
- BIT 15 CHECKSUM_INV - When set, a zero checksum value will be
inverted and sent as FFFFh.
- BITS 13-0 CHECKSUM_BYTECOUNT: This is the number of bytes to
calculate the checksum on. The outgoing Ethernet packet will have a
checksum inserted when this value is non-zero. The bit 0 RX_CHECKSUM_EN has
to be set in P0_CONTROL_REG to enable TX csum offload.
TX csum HW offload can be enabled/disabled:
ethtool -K <dev> tx-checksum-ip-generic on|off
- multiq and switch between round robin/prio modes for cppi tx queues
By default Linux network stack does not assume the multiqueue network
device works in fixed priority mode. As result, it will try to dispatch
packets between HW queues fairly - basing on skb hash (and XPS map if
enabled). So, by default, MCU CPSW TX statistic looks like below:
tx_pri0: 14
tx_pri1: 2
tx_pri2: 0
tx_pri3: 12
tx_pri4: 12
tx_pri5: 0
tx_pri6: 306127
tx_pri7: 0
From another side, MCU CPSW HW processes TX queues in fixed priority mode
(7 - high prio) and this is does not corresponds to what Linux network
stack expects as some packets might be delayed, MCU CPSW CPPI interface set
to Round Robin mode (CPPI_P0_Pri_Ctl.p0_rx_ptype) by default.
Fixed priority can be used with multiq, prio and mqprio qdisc's.
Netdev private flag "p0-rx-ptype-rrobin" can be used to switch between
Round Robin and Fixed priority modes:
# ethtool --show-priv-flags eth0
Private flags for eth0:
p0-rx-ptype-rrobin: on
# ethtool --set-priv-flags eth0 p0-rx-ptype-rrobin off
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
dt-binding: ti: am654: document mcu cpsw nuss
Document device tree bindings for TI AM654 SoC Gigabit Ethernet two ports
Switch subsystem (CPSW NUSS). The CPSW NUSS provides Ethernet packet
communication for the device and can be configured as an Ethernet switch.
CPSW NUSS features: the Reduced Gigabit Media Independent Interface
(RGMII), Reduced Media Independent Interface (RMII), and the Management
Data Input/Output (MDIO) interface for physical layer device (PHY)
management.
The TI am654 SoC has integrated two-port Gigabit Ethernet Switch subsystem
into device MCU domain named MCU_CPSW0. One Ethernet port (port 1) with
selectable RGMII and RMII interfaces and an internal Communications Port
Programming Interface (CPPI) port (Host port 0).
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Document device tree bindings for TI AM654 SoC Gigabit Ethernet two ports
Switch subsystem (CPSW NUSS). The CPSW NUSS provides Ethernet packet
communication for the device and can be configured as an Ethernet switch.
CPSW NUSS features: the Reduced Gigabit Media Independent Interface
(RGMII), Reduced Media Independent Interface (RMII), and the Management
Data Input/Output (MDIO) interface for physical layer device (PHY)
management.
The TI am654 SoC has integrated two-port Gigabit Ethernet Switch subsystem
into device MCU domain named MCU_CPSW0. One Ethernet port (port 1) with
selectable RGMII and RMII interfaces and an internal Communications Port
Programming Interface (CPPI) port (Host port 0).
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: introduce am654 common platform time sync driver
The CPTS module is used to facilitate host control of time sync operations.
Main features of CPTS module are:
- Supports the selection of multiple external clock sources
- Software control of time sync events via interrupt or polling
- Supports hardware timestamp push inputs (HWx_TS_PUSH)
- Supports timestamp counter compare output (TS_COMP)
- Supports timestamp counter bit output (TS_SYNC)
- Supports timestamp Generator function outputs (TS_GENFx)
- Supports 64-bit timestamp mode in ns with ppm and nudge adjustment.
Depending on integration it enables compliance with the IEEE 1588-2008
standard for a precision clock synchronization protocol, Ethernet Enhanced
Scheduled Traffic Operations (CPTS_ESTFn) and PCIe Subsystem Precision Time
Measurement (PTM).
Introduced driver provides Linux PTP hardware clock for each CPTS device
and network packets timestamping where applicable. CPTS PTP hardware clock
supports following operations:
- Set time
- Get time
- Shift the clock by a given offset atomically
- Adjust clock frequency
- Time stamp external events
- Periodic output signals
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
The CPTS module is used to facilitate host control of time sync operations.
Main features of CPTS module are:
- Supports the selection of multiple external clock sources
- Software control of time sync events via interrupt or polling
- Supports hardware timestamp push inputs (HWx_TS_PUSH)
- Supports timestamp counter compare output (TS_COMP)
- Supports timestamp counter bit output (TS_SYNC)
- Supports timestamp Generator function outputs (TS_GENFx)
- Supports 64-bit timestamp mode in ns with ppm and nudge adjustment.
Depending on integration it enables compliance with the IEEE 1588-2008
standard for a precision clock synchronization protocol, Ethernet Enhanced
Scheduled Traffic Operations (CPTS_ESTFn) and PCIe Subsystem Precision Time
Measurement (PTM).
Introduced driver provides Linux PTP hardware clock for each CPTS device
and network packets timestamping where applicable. CPTS PTP hardware clock
supports following operations:
- Set time
- Get time
- Shift the clock by a given offset atomically
- Adjust clock frequency
- Time stamp external events
- Periodic output signals
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
dt-binding: ti: am654: document common platform time sync cpts module
Document device tree bindings for TI AM654 SoC The Common Platform Time
Sync (CPTS) module. The CPTS module is used to facilitate host control of
time sync operations. Main features of CPTS module are:
- Supports the selection of multiple external clock sources
- Software control of time sync events via interrupt or polling
- Supports hardware timestamp push inputs (HWx_TS_PUSH)
- Supports timestamp counter compare output (TS_COMP)
- Supports timestamp counter bit output (TS_SYNC)
- Supports timestamp Generator function outputs (TS_GENFx)
- Supports 64-bit timestamp mode in ns with ppm and nudge adjustment.
- Depending on integration it enables compliance with the IEEE 1588-2008
standard for a precision clock synchronization protocol, Ethernet Enhanced
Scheduled Traffic Operations (CPTS_ESTFn) and PCIe Subsystem Precision Time
Measurement (PTM).
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Document device tree bindings for TI AM654 SoC The Common Platform Time
Sync (CPTS) module. The CPTS module is used to facilitate host control of
time sync operations. Main features of CPTS module are:
- Supports the selection of multiple external clock sources
- Software control of time sync events via interrupt or polling
- Supports hardware timestamp push inputs (HWx_TS_PUSH)
- Supports timestamp counter compare output (TS_COMP)
- Supports timestamp counter bit output (TS_SYNC)
- Supports timestamp Generator function outputs (TS_GENFx)
- Supports 64-bit timestamp mode in ns with ppm and nudge adjustment.
- Depending on integration it enables compliance with the IEEE 1588-2008
standard for a precision clock synchronization protocol, Ethernet Enhanced
Scheduled Traffic Operations (CPTS_ESTFn) and PCIe Subsystem Precision Time
Measurement (PTM).
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: davinci_mdio: allow init without creating pdev
When Davinci MDIO module is integrated as part of Gigabit Ethernet Switch
(CPSW) subsystem it shares common MMIO space, clocks and PM with CPSW, so
it make no sense to create separate Platform device for it - instead MDIO
bus can be created and registered directly by CPSW driver. Hence, add
possibility to register Davinci MDIO bus directly by parent CPSW driver.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
When Davinci MDIO module is integrated as part of Gigabit Ethernet Switch
(CPSW) subsystem it shares common MMIO space, clocks and PM with CPSW, so
it make no sense to create separate Platform device for it - instead MDIO
bus can be created and registered directly by CPSW driver. Hence, add
possibility to register Davinci MDIO bus directly by parent CPSW driver.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpsw-phy-sel: add am654 support
TI AM654 SoC contains two-port Gigabit Ethernet Switch (CPSW NUSS)
subsystem which require to select external Port MII interface type. This
patch introduces support for AM654 CPSW NUSS external Port mode selection
in cpsw-phy-sel driver.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
TI AM654 SoC contains two-port Gigabit Ethernet Switch (CPSW NUSS)
subsystem which require to select external Port MII interface type. This
patch introduces support for AM654 CPSW NUSS external Port mode selection
in cpsw-phy-sel driver.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpsw: introduce mac sl module api
MAC SL submodule has a lot of common functions between many of TI SoCs
am335x/am437x/dra7(am57), Keystone 2 66ak2hk/e/l/g and K# AM654, but there
also differences especially in registers offsets and sets of supported
functions.
This patch introduces MAC SL submodule API which is intended to provide
common way to access MAC SL submodule and hide HW integrations details.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
MAC SL submodule has a lot of common functions between many of TI SoCs
am335x/am437x/dra7(am57), Keystone 2 66ak2hk/e/l/g and K# AM654, but there
also differences especially in registers offsets and sets of supported
functions.
This patch introduces MAC SL submodule API which is intended to provide
common way to access MAC SL submodule and hide HW integrations details.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: ale: add support for mac-only mode
New CPSW ALE version, available on K3 AM654 SoCs family, allows to switch
any external port to MAC only mode. When MAC only mode enabled this port be
treated like a MAC port for the host. All traffic received is only sent to
the host. The host must direct traffic to this port as the lookup engine
will not send traffic to the ports with the p0_maconly bit set and the
p0_no_learn also set. If p0_maconly bit is set and the p0_no_learn is not
set, the host can send non-directed packets that can be sent to the
destination of a MacOnly port. It is also possible that The host can
broadcast to all ports including MacOnly ports in this mode.
This patch add ALE supprt for MAC only mode.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
New CPSW ALE version, available on K3 AM654 SoCs family, allows to switch
any external port to MAC only mode. When MAC only mode enabled this port be
treated like a MAC port for the host. All traffic received is only sent to
the host. The host must direct traffic to this port as the lookup engine
will not send traffic to the ports with the p0_maconly bit set and the
p0_no_learn also set. If p0_maconly bit is set and the p0_no_learn is not
set, the host can send non-directed packets that can be sent to the
destination of a MacOnly port. It is also possible that The host can
broadcast to all ports including MacOnly ports in this mode.
This patch add ALE supprt for MAC only mode.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: soc: ti: k3: add dma descriptors pool
Add support for creating and maintaining a pool of DMA
descriptors. Such pools are used by networking drivers
for performance reasons.
Consists of following squashed commits from previous
kernels:
k3: navss: add dma descs pool (initial)
soc: ti: k3: desc-pool: switch to SPDX Licensing
soc: ti: k3: dma_desc pool change k3_knav_pool_avail() to return num items
soc: ti: k3-navss-desc-pool: GPL export global functions
k3: k3-navss-desc-pool: allow calling k3_knav_pool_create_name() more than once
TODO:
This may not be upstream-able in current state. A more generic
solution or different way of achieving the same result has
to be looked at.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add support for creating and maintaining a pool of DMA
descriptors. Such pools are used by networking drivers
for performance reasons.
Consists of following squashed commits from previous
kernels:
k3: navss: add dma descs pool (initial)
soc: ti: k3: desc-pool: switch to SPDX Licensing
soc: ti: k3: dma_desc pool change k3_knav_pool_avail() to return num items
soc: ti: k3-navss-desc-pool: GPL export global functions
k3: k3-navss-desc-pool: allow calling k3_knav_pool_create_name() more than once
TODO:
This may not be upstream-able in current state. A more generic
solution or different way of achieving the same result has
to be looked at.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ti_config_fragments/defconfig_map.txt: add connectivity.cfg
Add support for connectivity peripheral related config fragments.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add support for connectivity peripheral related config fragments.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ti_config_fragments: add connectivity.cfg
Introduce connectivity.cfg. This is a forward port of latest
file from v4.14 kernel, with following configs dropped because
they are not recognized Kconfig symbols (yet) in v4.19 kernel.
NET_CADENCE
NET_VENDOR_EXAR
PCI_KEYSTONE_EP
PHY_TI_KEYSTONE_SERDES
PHY_AM654
NF_CONNTRACK_IPV4
TI_PRUETH
TI_ICSSG_PRUETH
TI_AM65_CPSW_NUSS
TI_AM65_CPTS
PHY_AM654_MMC
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Introduce connectivity.cfg. This is a forward port of latest
file from v4.14 kernel, with following configs dropped because
they are not recognized Kconfig symbols (yet) in v4.19 kernel.
NET_CADENCE
NET_VENDOR_EXAR
PCI_KEYSTONE_EP
PHY_TI_KEYSTONE_SERDES
PHY_AM654
NF_CONNTRACK_IPV4
TI_PRUETH
TI_ICSSG_PRUETH
TI_AM65_CPSW_NUSS
TI_AM65_CPTS
PHY_AM654_MMC
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into... ti-rt-linux-4.14.y-next-20181205 ti-rt-linux-4.19.y-next-20181205
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
dmaengine: ti: k3-udma: Try to use the highest TPL channels for MEM_TO_MEM
dmaengine: ti: k3-udma: Only allow MEM_TO_MEM transfer on the main UDMA
ti_config_fragments/defconfig_map.txt: add missing baseport.cfg entries
ti_config_fragments: v8_baseport: Forward port v8_baseport cfg from 4.14
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
dmaengine: ti: k3-udma: Try to use the highest TPL channels for MEM_TO_MEM
dmaengine: ti: k3-udma: Only allow MEM_TO_MEM transfer on the main UDMA
ti_config_fragments/defconfig_map.txt: add missing baseport.cfg entries
ti_config_fragments: v8_baseport: Forward port v8_baseport cfg from 4.14
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Merge branch 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.19.y
TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-4.19.y
* 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
dmaengine: ti: k3-udma: Try to use the highest TPL channels for MEM_TO_MEM
dmaengine: ti: k3-udma: Only allow MEM_TO_MEM transfer on the main UDMA
ti_config_fragments/defconfig_map.txt: add missing baseport.cfg entries
ti_config_fragments: v8_baseport: Forward port v8_baseport cfg from 4.14
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-4.19.y
* 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
dmaengine: ti: k3-udma: Try to use the highest TPL channels for MEM_TO_MEM
dmaengine: ti: k3-udma: Only allow MEM_TO_MEM transfer on the main UDMA
ti_config_fragments/defconfig_map.txt: add missing baseport.cfg entries
ti_config_fragments: v8_baseport: Forward port v8_baseport cfg from 4.14
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
dmaengine: ti: k3-udma: Try to use the highest TPL channels for MEM_TO_MEM
When running memcpy test with big buffers:
echo 800000 > /sys/module/dmatest/parameters/test_buf_size
echo 2000 > /sys/module/dmatest/parameters/timeout
echo 20 > /sys/module/dmatest/parameters/iterations
echo 10 > /sys/module/dmatest/parameters/max_channels
echo 1 > /sys/module/dmatest/parameters/run
The throughput with normal channels is:
dmatest: dma1chan2-copy0: summary 200 tests, 0 failures 87 iops 308840 KB/s (0)
Using High Throughput channel with the same setup:
dmatest: dma1chan2-copy0: summary 200 tests, 0 failures 295 iops 1206172 KB/s (0)
The speed increase is about 4x.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
When running memcpy test with big buffers:
echo 800000 > /sys/module/dmatest/parameters/test_buf_size
echo 2000 > /sys/module/dmatest/parameters/timeout
echo 20 > /sys/module/dmatest/parameters/iterations
echo 10 > /sys/module/dmatest/parameters/max_channels
echo 1 > /sys/module/dmatest/parameters/run
The throughput with normal channels is:
dmatest: dma1chan2-copy0: summary 200 tests, 0 failures 87 iops 308840 KB/s (0)
Using High Throughput channel with the same setup:
dmatest: dma1chan2-copy0: summary 200 tests, 0 failures 295 iops 1206172 KB/s (0)
The speed increase is about 4x.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dmaengine: ti: k3-udma: Only allow MEM_TO_MEM transfer on the main UDMA
memcpy via the mcu UDMA is much slower compared to main UDMA:
mcu_udma: dmatest: dma0chan0-copy0: summary 200 tests, 0 failures 41 iops 165997 KB/s (0)
main_udma: dmatest: dma1chan2-copy0: summary 200 tests, 0 failures 87 iops 308840 KB/s (0)
We have enough channels on the main UDMA for memcpy, so disable the support
for MEM_TO_MEM on the mcu side.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
memcpy via the mcu UDMA is much slower compared to main UDMA:
mcu_udma: dmatest: dma0chan0-copy0: summary 200 tests, 0 failures 41 iops 165997 KB/s (0)
main_udma: dmatest: dma1chan2-copy0: summary 200 tests, 0 failures 87 iops 308840 KB/s (0)
We have enough channels on the main UDMA for memcpy, so disable the support
for MEM_TO_MEM on the mcu side.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into... ti-rt-linux-4.14.y-next-20181204 ti-rt-linux-4.19.y-next-20181204
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (21 commits)
HACK: net: ethernet: ti: cpts: add return value to tx and rx timestamp funcitons
HACK: net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH
HACK: net: ethernet: ti: cpts: add support for ext rftclk selection
HACK: drivers: net: cpsw: add broadcast/multicast rate limit support
HACK: drivers; net: cpsw: add port vlan support via switch config ioctl
HACK: drivers: net: cpsw: switch-config: set/get port state
HACK: drivers: net: cpsw: switch-config: unknown vlan handling
HACK: drivers: net: cpsw: switch-config: get/set phy status support
HACK: drivers: net: cpsw: add support for switch ioctl
HACK: net: ioctl: Adding switch configuration via ioctl
net: ethernet: ti: cpsw: allow vlan tagged packets to be timestamped
net: ethernet: ti: cpts: move enable/disable flags outside of cpts module
net: ethernet: ti: cpts: purge staled skbs from txq
net: ethernet: ti: cpts: correct debug for expired txq skb
net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode
net: ethernet: ti: davinci_emac: simplify getting .driver_data
net: ethernet: ti: cpsw: simplify getting .driver_data
net: ethernet: ti: cpsw: use for mcast entries only host port
net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update
net: ethernet: ti: cpsw_ale: use const for API having pointer on mac address
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (21 commits)
HACK: net: ethernet: ti: cpts: add return value to tx and rx timestamp funcitons
HACK: net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH
HACK: net: ethernet: ti: cpts: add support for ext rftclk selection
HACK: drivers: net: cpsw: add broadcast/multicast rate limit support
HACK: drivers; net: cpsw: add port vlan support via switch config ioctl
HACK: drivers: net: cpsw: switch-config: set/get port state
HACK: drivers: net: cpsw: switch-config: unknown vlan handling
HACK: drivers: net: cpsw: switch-config: get/set phy status support
HACK: drivers: net: cpsw: add support for switch ioctl
HACK: net: ioctl: Adding switch configuration via ioctl
net: ethernet: ti: cpsw: allow vlan tagged packets to be timestamped
net: ethernet: ti: cpts: move enable/disable flags outside of cpts module
net: ethernet: ti: cpts: purge staled skbs from txq
net: ethernet: ti: cpts: correct debug for expired txq skb
net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode
net: ethernet: ti: davinci_emac: simplify getting .driver_data
net: ethernet: ti: cpsw: simplify getting .driver_data
net: ethernet: ti: cpsw: use for mcast entries only host port
net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update
net: ethernet: ti: cpsw_ale: use const for API having pointer on mac address
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Merge branch 'connectivity-ti-linux-4.19.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-4.19.y
TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-4.19.y
* 'connectivity-ti-linux-4.19.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel: (21 commits)
HACK: net: ethernet: ti: cpts: add return value to tx and rx timestamp funcitons
HACK: net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH
HACK: net: ethernet: ti: cpts: add support for ext rftclk selection
HACK: drivers: net: cpsw: add broadcast/multicast rate limit support
HACK: drivers; net: cpsw: add port vlan support via switch config ioctl
HACK: drivers: net: cpsw: switch-config: set/get port state
HACK: drivers: net: cpsw: switch-config: unknown vlan handling
HACK: drivers: net: cpsw: switch-config: get/set phy status support
HACK: drivers: net: cpsw: add support for switch ioctl
HACK: net: ioctl: Adding switch configuration via ioctl
net: ethernet: ti: cpsw: allow vlan tagged packets to be timestamped
net: ethernet: ti: cpts: move enable/disable flags outside of cpts module
net: ethernet: ti: cpts: purge staled skbs from txq
net: ethernet: ti: cpts: correct debug for expired txq skb
net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode
net: ethernet: ti: davinci_emac: simplify getting .driver_data
net: ethernet: ti: cpsw: simplify getting .driver_data
net: ethernet: ti: cpsw: use for mcast entries only host port
net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update
net: ethernet: ti: cpsw_ale: use const for API having pointer on mac address
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-4.19.y
* 'connectivity-ti-linux-4.19.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel: (21 commits)
HACK: net: ethernet: ti: cpts: add return value to tx and rx timestamp funcitons
HACK: net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH
HACK: net: ethernet: ti: cpts: add support for ext rftclk selection
HACK: drivers: net: cpsw: add broadcast/multicast rate limit support
HACK: drivers; net: cpsw: add port vlan support via switch config ioctl
HACK: drivers: net: cpsw: switch-config: set/get port state
HACK: drivers: net: cpsw: switch-config: unknown vlan handling
HACK: drivers: net: cpsw: switch-config: get/set phy status support
HACK: drivers: net: cpsw: add support for switch ioctl
HACK: net: ioctl: Adding switch configuration via ioctl
net: ethernet: ti: cpsw: allow vlan tagged packets to be timestamped
net: ethernet: ti: cpts: move enable/disable flags outside of cpts module
net: ethernet: ti: cpts: purge staled skbs from txq
net: ethernet: ti: cpts: correct debug for expired txq skb
net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode
net: ethernet: ti: davinci_emac: simplify getting .driver_data
net: ethernet: ti: cpsw: simplify getting .driver_data
net: ethernet: ti: cpsw: use for mcast entries only host port
net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update
net: ethernet: ti: cpsw_ale: use const for API having pointer on mac address
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
HACK: net: ethernet: ti: cpts: add return value to tx and rx timestamp funcitons
Added return values in tx and rx timestamp funcitons facilitate the
possibililies of timestamping by CPSW modules other than CPTS, such as
packet accelerator on Keystone 2 devices.
LKML link:
- https://patchwork.kernel.org/patch/9331419/
not accepted, so HACK.
Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Added return values in tx and rx timestamp funcitons facilitate the
possibililies of timestamping by CPSW modules other than CPTS, such as
packet accelerator on Keystone 2 devices.
LKML link:
- https://patchwork.kernel.org/patch/9331419/
not accepted, so HACK.
Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH
This patch adds optional support of the CPTS HW_TS_PUSH events which
are generated by external low frequency time stamp channels on TI's
OMAP CPSW and Keystone 2 platforms. It supports up to 8 external time
stamp channels for HW_TS_PUSH input pins (the number of supported
channel is different for different SoCs and CPTS versions, check
corresponding Data maual before enabling it). Therefore new DT
property "cpts-ext-ts-inputs" is introduced for specifying number of
available external timestamp channels.
The PTP external timestamp (extts) infrastructure can be used for
HW_TS_PUSH timestamp controlling and reporting.
This also change overflow polling period when HW_TS_PUSH feature is
enabled - overflow check work will be scheduled more often (every
200ms) for proper HW_TS_PUSH events reporting.
LKML link:
- https://lkml.org/lkml/2016/11/28/776
change request: add irq support
Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
This patch adds optional support of the CPTS HW_TS_PUSH events which
are generated by external low frequency time stamp channels on TI's
OMAP CPSW and Keystone 2 platforms. It supports up to 8 external time
stamp channels for HW_TS_PUSH input pins (the number of supported
channel is different for different SoCs and CPTS versions, check
corresponding Data maual before enabling it). Therefore new DT
property "cpts-ext-ts-inputs" is introduced for specifying number of
available external timestamp channels.
The PTP external timestamp (extts) infrastructure can be used for
HW_TS_PUSH timestamp controlling and reporting.
This also change overflow polling period when HW_TS_PUSH feature is
enabled - overflow check work will be scheduled more often (every
200ms) for proper HW_TS_PUSH events reporting.
LKML link:
- https://lkml.org/lkml/2016/11/28/776
change request: add irq support
Signed-off-by: WingMan Kwok <w-kwok2@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: net: ethernet: ti: cpts: add support for ext rftclk selection
Some CPTS instances, which can be found on KeyStone 2 1/10G Ethernet
Switch Subsystems, can control an external multiplexer that selects
one of up to 32 clocks for time sync reference (RFTCLK). This feature
can be configured through CPTS_RFTCLK_SEL register (offset: x08).
Hence, introduce optional DT cpts_rftclk_sel poperty wich, if present,
will specify CPTS reference clock. The cpts_rftclk_sel should be
omitted in DT if HW doesn't support this feature. The external fixed
rate clocks have to be modelled in board files as "fixed-clock".
LKML link:
- https://lkml.org/lkml/2016/11/28/780
change request: use clk framework and define mux_clk instead of
cpts-rftclk-sel property.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Some CPTS instances, which can be found on KeyStone 2 1/10G Ethernet
Switch Subsystems, can control an external multiplexer that selects
one of up to 32 clocks for time sync reference (RFTCLK). This feature
can be configured through CPTS_RFTCLK_SEL register (offset: x08).
Hence, introduce optional DT cpts_rftclk_sel poperty wich, if present,
will specify CPTS reference clock. The cpts_rftclk_sel should be
omitted in DT if HW doesn't support this feature. The external fixed
rate clocks have to be modelled in board files as "fixed-clock".
LKML link:
- https://lkml.org/lkml/2016/11/28/780
change request: use clk framework and define mux_clk instead of
cpts-rftclk-sel property.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: drivers: net: cpsw: add broadcast/multicast rate limit support
Add broadcast/multicast rate limit support via switch config ioctl to
limit the number of broadcast/multicast packets processed by ALE.
For CPSW ALE multicast (MC) / broadcast (BC) Rate limit, ENABLE_RATE_LIMIT
bit has to be set in ALE_CONTROL Register.
The MC/BC Rate limit feature expected to limit number of BC/MC packets per
sec which need to be configured as below:
- ale_port.BCASTMCAST/_LIMIT fields and ALE_PRESCALE register have to be
configured to achieve desired MC/BC Rate limit:
number_of_packets/sec = (Fclk / ALE_PRESCALE) * port.BCASTMCAST/_LIMIT
where: ALE_PRESCALE width is 19bit and min value 0x10.
with Fclk = 125MHz and port.BCASTMCAST/_LIMIT = 1
max number_of_packets/sec = (125MHz / 0x10) * 1 = 7 812 500
min number_of_packets/sec = (125MHz / 0xFFFFF) * 1 = 119
above values are more than enough (with higher Fclk they will be just
better), so port.BCASTMCAST/_LIMIT can be selected to be 1 while
ALE_PRESCALE is calculated as:
ALE_PRESCALE = Fclk / number_of_packets
- RATE_LIMIT_TX bit has to be set in ALE_CONTROL Register to 1 for TX and 0
for RX
- ENABLE_RATE_LIMIT bit has to be set in ALE_CONTROL Register
This patch implements above logic.
Testing:
# ifconfig - check "RX packets:X"
# switch-config --add-multi 01:00:5E:00:00:05 -n 7
# switch-config -l -n 1 -L 1000 -B 1000
# on host PC generate BC/MC traffic
(packeth: gen-b->num_packets=10000
gen-b->delay=100
# ifconfig - check "RX packets:X+1000"
TODO:
The patch is marked as a hack because switch-configuration in general
uses some non-standard private ioctls. This needs to be moved to a
standard kernel framework.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add broadcast/multicast rate limit support via switch config ioctl to
limit the number of broadcast/multicast packets processed by ALE.
For CPSW ALE multicast (MC) / broadcast (BC) Rate limit, ENABLE_RATE_LIMIT
bit has to be set in ALE_CONTROL Register.
The MC/BC Rate limit feature expected to limit number of BC/MC packets per
sec which need to be configured as below:
- ale_port.BCASTMCAST/_LIMIT fields and ALE_PRESCALE register have to be
configured to achieve desired MC/BC Rate limit:
number_of_packets/sec = (Fclk / ALE_PRESCALE) * port.BCASTMCAST/_LIMIT
where: ALE_PRESCALE width is 19bit and min value 0x10.
with Fclk = 125MHz and port.BCASTMCAST/_LIMIT = 1
max number_of_packets/sec = (125MHz / 0x10) * 1 = 7 812 500
min number_of_packets/sec = (125MHz / 0xFFFFF) * 1 = 119
above values are more than enough (with higher Fclk they will be just
better), so port.BCASTMCAST/_LIMIT can be selected to be 1 while
ALE_PRESCALE is calculated as:
ALE_PRESCALE = Fclk / number_of_packets
- RATE_LIMIT_TX bit has to be set in ALE_CONTROL Register to 1 for TX and 0
for RX
- ENABLE_RATE_LIMIT bit has to be set in ALE_CONTROL Register
This patch implements above logic.
Testing:
# ifconfig - check "RX packets:X"
# switch-config --add-multi 01:00:5E:00:00:05 -n 7
# switch-config -l -n 1 -L 1000 -B 1000
# on host PC generate BC/MC traffic
(packeth: gen-b->num_packets=10000
gen-b->delay=100
# ifconfig - check "RX packets:X+1000"
TODO:
The patch is marked as a hack because switch-configuration in general
uses some non-standard private ioctls. This needs to be moved to a
standard kernel framework.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: drivers; net: cpsw: add port vlan support via switch config ioctl
Add port vlan support via switch config ioctl to configure port vlan
in the ports to add desired vlan to the packet when an untagged VLAN
packet arrives at the port.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add port vlan support via switch config ioctl to configure port vlan
in the ports to add desired vlan to the packet when an untagged VLAN
packet arrives at the port.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: drivers: net: cpsw: switch-config: set/get port state
Add support for configuring port states handling of the packet switching
to the slave port like disabling packet forwarding/learning.
Note: Using this interface a user can disable all the slave ports which
will bring down the Ethernet interface.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add support for configuring port states handling of the packet switching
to the slave port like disabling packet forwarding/learning.
Note: Using this interface a user can disable all the slave ports which
will bring down the Ethernet interface.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: drivers: net: cpsw: switch-config: unknown vlan handling
Currently only known VLAN id packets are handled inside the switch,
when an unknown VLAN is received, the switch will drop the packets.
This ioctl allows user to subscribe the ports for unknown VLAN id
packet forwarding with combinations like packet with multicst destination
address present which is present in ALE table with unknown VLAN id and
packet with multicast destination address which is not present in ALE
table with unknown VLAN id, then switch will start forwarding these
packets as per configured by the user. Additional features of the
unknown vlan handling of the switch other than port forwarding is to
untag on egress for external ports.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Currently only known VLAN id packets are handled inside the switch,
when an unknown VLAN is received, the switch will drop the packets.
This ioctl allows user to subscribe the ports for unknown VLAN id
packet forwarding with combinations like packet with multicst destination
address present which is present in ALE table with unknown VLAN id and
packet with multicast destination address which is not present in ALE
table with unknown VLAN id, then switch will start forwarding these
packets as per configured by the user. Additional features of the
unknown vlan handling of the switch other than port forwarding is to
untag on egress for external ports.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: drivers: net: cpsw: switch-config: get/set phy status support
Support for get/set individual switch port phy link status
Use ethtool_cmd interface for switch-config.
This also enables using the same userspace application with older as
well as newer kernels.
Since CPSW switch config code exposes an interface very similar to
ethtool, we need some helper functions to convert from legacy userspace
interface to the new one. Make some helper functions from ethtool code
available for other drivers.
TODO: The complete switch config private IOCTL interface needs to be
converted to an upstream-friendly solution.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Support for get/set individual switch port phy link status
Use ethtool_cmd interface for switch-config.
This also enables using the same userspace application with older as
well as newer kernels.
Since CPSW switch config code exposes an interface very similar to
ethtool, we need some helper functions to convert from legacy userspace
interface to the new one. Make some helper functions from ethtool code
available for other drivers.
TODO: The complete switch config private IOCTL interface needs to be
converted to an upstream-friendly solution.
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: drivers: net: cpsw: add support for switch ioctl
Add support for add/delete multicast and vlan using switch ioctl
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Add support for add/delete multicast and vlan using switch ioctl
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
HACK: net: ioctl: Adding switch configuration via ioctl
A switch can be configured in various combination of switch entry for
controling packet flow between the ports
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
A switch can be configured in various combination of switch entry for
controling packet flow between the ports
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpsw: allow vlan tagged packets to be timestamped
commit 1ebb2446c3032682ffce0c665265885f46286038 upstream.
Allow vlan tagged packets to be timestamped, as no any restrictions
for this.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit 1ebb2446c3032682ffce0c665265885f46286038 upstream.
Allow vlan tagged packets to be timestamped, as no any restrictions
for this.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpts: move enable/disable flags outside of cpts module
commit a9423120343cb52efea6f471ff780eba7aab9b9f upstream
Each slave has it's own receive timestamp filter. But cpts rx/tx
timestamp enable flags are used to allow ts retrieve only for one
user. This limitation causes data path redundancy and setting overlap
if cpsw module is in dual-mac mode for instance.
If rx ts is enabled only for one port - the second interface must expect
every incoming packet to be PTP packet w/o absolutely any reason, and if
it's PTP - do unneeded stuff, as rx filter for second port is not set
and cpts fifo is not supposed to contain appropriate ts event.
That's not correct.
So, to fix control overlap and avoid redundant CPU cycles, the patch
splits rx/tx ts enable flags between network devices. After the patch,
PTP timestamping still should be used for only one port (or PTP id
counter has to be different for both ports as cpts IP is common).
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit a9423120343cb52efea6f471ff780eba7aab9b9f upstream
Each slave has it's own receive timestamp filter. But cpts rx/tx
timestamp enable flags are used to allow ts retrieve only for one
user. This limitation causes data path redundancy and setting overlap
if cpsw module is in dual-mac mode for instance.
If rx ts is enabled only for one port - the second interface must expect
every incoming packet to be PTP packet w/o absolutely any reason, and if
it's PTP - do unneeded stuff, as rx filter for second port is not set
and cpts fifo is not supposed to contain appropriate ts event.
That's not correct.
So, to fix control overlap and avoid redundant CPU cycles, the patch
splits rx/tx ts enable flags between network devices. After the patch,
PTP timestamping still should be used for only one port (or PTP id
counter has to be different for both ports as cpts IP is common).
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpts: purge staled skbs from txq
commit f19dcd5f118d1795307e28e6e99f482469303edc upstream.
The overflow event is running with 1 jiffy in case if txq is not
empty, but it can be emptied completely only if next tx event
consumes skb or deletes staled skb from the txq. In case of staled
skb, that can happen for some unpredictable reason (the ts event was
lost or timed out), the overflow event can be generated quite long
time consuming CPU w/o reason before next tx event happens. To avoid
it, purge txq before increasing overflow event rate.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit f19dcd5f118d1795307e28e6e99f482469303edc upstream.
The overflow event is running with 1 jiffy in case if txq is not
empty, but it can be emptied completely only if next tx event
consumes skb or deletes staled skb from the txq. In case of staled
skb, that can happen for some unpredictable reason (the ts event was
lost or timed out), the overflow event can be generated quite long
time consuming CPU w/o reason before next tx event happens. To avoid
it, purge txq before increasing overflow event rate.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpts: correct debug for expired txq skb
commit d0e14c4d9bcef0d4aa1057d2959adaa6f18d4a17 upstream.
The msgtype and seqid that is smth that belongs to event for
comparison but not for staled txq skb.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit d0e14c4d9bcef0d4aa1057d2959adaa6f18d4a17 upstream.
The msgtype and seqid that is smth that belongs to event for
comparison but not for staled txq skb.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode
commit 9737cc99dd14b5b8b9d267618a6061feade8ea68 upstream.
After flushing all mcast entries from the table, the ones contained in
mc list of ndev are not restored when promisc mode is toggled off,
because they are considered as synched with ALE, thus, in order to
restore them after promisc mode - reset syncing info. This fix
touches only switch mode devices, including single port boards
like Beagle Bone.
Fixes: commit 5da1948969bc
("net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update")
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit 9737cc99dd14b5b8b9d267618a6061feade8ea68 upstream.
After flushing all mcast entries from the table, the ones contained in
mc list of ndev are not restored when promisc mode is toggled off,
because they are considered as synched with ALE, thus, in order to
restore them after promisc mode - reset syncing info. This fix
touches only switch mode devices, including single port boards
like Beagle Bone.
Fixes: commit 5da1948969bc
("net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update")
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: davinci_emac: simplify getting .driver_data
commit 762b9e9abb58375ba7eb06c3522c777debebe289 upstream.
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit 762b9e9abb58375ba7eb06c3522c777debebe289 upstream.
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpsw: simplify getting .driver_data
commit 4e13c252276d3aa56f028cada2bd7cb41694d03f upstream.
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit 4e13c252276d3aa56f028cada2bd7cb41694d03f upstream.
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpsw: use for mcast entries only host port
commit 5b3a5a14f84c326413d00a213ad4c950d43af2c8 upstream.
In dual-emac mode the cpsw driver sends directed packets, that means
that packets go to the directed port, but an ALE lookup is performed
to determine untagged egress only. It means that on tx side no need
to add port bit for ALE mcast entry mask, and basically ALE entry
for port identification is needed only on rx side.
So, add only host port in dual_emac mode as used directed
transmission, and no need in one more port. For single port boards
and switch mode all ports used, as usual, so no changes for them.
Also it simplifies farther changes.
In other words, mcast entries for dual-emac should behave exactly
like unicast. It also can help avoid leaking packets between ports
with same vlan on h/w level if ports could became members of same vid.
So now, for instance, if mcast address 33:33:00:00:00:01 is added then
entries in ALE table:
vid = 1, addr = 33:33:00:00:00:01, port_mask = 0x1
vid = 2, addr = 33:33:00:00:00:01, port_mask = 0x1
Instead of:
vid = 1, addr = 33:33:00:00:00:01, port_mask = 0x3
vid = 2, addr = 33:33:00:00:00:01, port_mask = 0x5
With the same considerations, set only host port for unregistered
mcast for dual-emac mode in case of IFF_ALLMULTI is set, exactly like
it's done in cpsw_ale_set_allmulti().
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit 5b3a5a14f84c326413d00a213ad4c950d43af2c8 upstream.
In dual-emac mode the cpsw driver sends directed packets, that means
that packets go to the directed port, but an ALE lookup is performed
to determine untagged egress only. It means that on tx side no need
to add port bit for ALE mcast entry mask, and basically ALE entry
for port identification is needed only on rx side.
So, add only host port in dual_emac mode as used directed
transmission, and no need in one more port. For single port boards
and switch mode all ports used, as usual, so no changes for them.
Also it simplifies farther changes.
In other words, mcast entries for dual-emac should behave exactly
like unicast. It also can help avoid leaking packets between ports
with same vlan on h/w level if ports could became members of same vid.
So now, for instance, if mcast address 33:33:00:00:00:01 is added then
entries in ALE table:
vid = 1, addr = 33:33:00:00:00:01, port_mask = 0x1
vid = 2, addr = 33:33:00:00:00:01, port_mask = 0x1
Instead of:
vid = 1, addr = 33:33:00:00:00:01, port_mask = 0x3
vid = 2, addr = 33:33:00:00:00:01, port_mask = 0x5
With the same considerations, set only host port for unregistered
mcast for dual-emac mode in case of IFF_ALLMULTI is set, exactly like
it's done in cpsw_ale_set_allmulti().
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpsw: fix lost of mcast packets while rx_mode update
commit 5da1948969bc1991920987ce4361ea56046e5a98 upstream.
Whenever kernel or user decides to call rx mode update, it clears
every multicast entry from forwarding table and in some time adds
it again. This time can be enough to drop incoming multicast packets.
That's why clear only staled multicast entries and update or add new
one afterwards.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit 5da1948969bc1991920987ce4361ea56046e5a98 upstream.
Whenever kernel or user decides to call rx mode update, it clears
every multicast entry from forwarding table and in some time adds
it again. This time can be enough to drop incoming multicast packets.
That's why clear only staled multicast entries and update or add new
one afterwards.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ethernet: ti: cpsw_ale: use const for API having pointer on mac address
commit 58bdeac8b0e7ba6a5b60339fe3c197a52715abbf upstream.
It allows to use function under callbacks with same const qualifier of
mac address for farther changes.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit 58bdeac8b0e7ba6a5b60339fe3c197a52715abbf upstream.
It allows to use function under callbacks with same const qualifier of
mac address for farther changes.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
net: ti: Use FIELD_SIZEOF directly instead of reimplementing its function
commit a90546e83a117502c36173a2809db5d00c9ac87d upstream.
FIELD_SIZEOF is defined as a macro to calculate the specified value. Therefore,
We prefer to use the macro rather than calculating its value.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
commit a90546e83a117502c36173a2809db5d00c9ac87d upstream.
FIELD_SIZEOF is defined as a macro to calculate the specified value. Therefore,
We prefer to use the macro rather than calculating its value.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Merge branch 'linux-4.19.y' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into ti-linux-4.19.y
* 'linux-4.19.y' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (729 commits)
Linux 4.19.5
mt76x0: run vco calibration for each channel configuration
libceph: fall back to sendmsg for slab pages
HID: Add quirk for Microsoft PIXART OEM mouse
HID: Add quirk for Primax PIXART OEM mice
HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
ACPI / platform: Add SMB0001 HID to forbidden_id_list
drivers/misc/sgi-gru: fix Spectre v1 vulnerability
mtd: rawnand: atmel: fix OF child-node lookup
gnss: sirf: fix synchronous write timeout
gnss: serial: fix synchronous write timeout
USB: misc: appledisplay: add 20" Apple Cinema Display
misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hub
USB: quirks: Add no-lpm quirk for Raydium touchscreens
usb: cdc-acm: add entry for Hiro (Conexant) modem
can: kvaser_usb: Fix potential uninitialized variable use
can: kvaser_usb: Fix accessing freed memory in kvaser_usb_start_xmit()
ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
* 'linux-4.19.y' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (729 commits)
Linux 4.19.5
mt76x0: run vco calibration for each channel configuration
libceph: fall back to sendmsg for slab pages
HID: Add quirk for Microsoft PIXART OEM mouse
HID: Add quirk for Primax PIXART OEM mice
HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
ACPI / platform: Add SMB0001 HID to forbidden_id_list
drivers/misc/sgi-gru: fix Spectre v1 vulnerability
mtd: rawnand: atmel: fix OF child-node lookup
gnss: sirf: fix synchronous write timeout
gnss: serial: fix synchronous write timeout
USB: misc: appledisplay: add 20" Apple Cinema Display
misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hub
USB: quirks: Add no-lpm quirk for Raydium touchscreens
usb: cdc-acm: add entry for Hiro (Conexant) modem
can: kvaser_usb: Fix potential uninitialized variable use
can: kvaser_usb: Fix accessing freed memory in kvaser_usb_start_xmit()
ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Merge branch 'linux-4.19.y-rt' of https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel into ti-rt-linux-4.19.y
TI-Feature: linux_rt-4-19
TI-Tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
TI-Branch: linux-4.19.y-rt
* 'linux-4.19.y-rt' of https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel: (730 commits)
v4.19.5-rt4
Linux 4.19.5
mt76x0: run vco calibration for each channel configuration
libceph: fall back to sendmsg for slab pages
HID: Add quirk for Microsoft PIXART OEM mouse
HID: Add quirk for Primax PIXART OEM mice
HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
ACPI / platform: Add SMB0001 HID to forbidden_id_list
drivers/misc/sgi-gru: fix Spectre v1 vulnerability
mtd: rawnand: atmel: fix OF child-node lookup
gnss: sirf: fix synchronous write timeout
gnss: serial: fix synchronous write timeout
USB: misc: appledisplay: add 20" Apple Cinema Display
misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hub
USB: quirks: Add no-lpm quirk for Raydium touchscreens
usb: cdc-acm: add entry for Hiro (Conexant) modem
can: kvaser_usb: Fix potential uninitialized variable use
can: kvaser_usb: Fix accessing freed memory in kvaser_usb_start_xmit()
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: linux_rt-4-19
TI-Tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
TI-Branch: linux-4.19.y-rt
* 'linux-4.19.y-rt' of https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel: (730 commits)
v4.19.5-rt4
Linux 4.19.5
mt76x0: run vco calibration for each channel configuration
libceph: fall back to sendmsg for slab pages
HID: Add quirk for Microsoft PIXART OEM mouse
HID: Add quirk for Primax PIXART OEM mice
HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
ACPI / platform: Add SMB0001 HID to forbidden_id_list
drivers/misc/sgi-gru: fix Spectre v1 vulnerability
mtd: rawnand: atmel: fix OF child-node lookup
gnss: sirf: fix synchronous write timeout
gnss: serial: fix synchronous write timeout
USB: misc: appledisplay: add 20" Apple Cinema Display
misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hub
USB: quirks: Add no-lpm quirk for Raydium touchscreens
usb: cdc-acm: add entry for Hiro (Conexant) modem
can: kvaser_usb: Fix potential uninitialized variable use
can: kvaser_usb: Fix accessing freed memory in kvaser_usb_start_xmit()
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
v4.19.5-rt4
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Merge tag 'v4.19.5' into linux-4.19.y-rt
This is the 4.19.5 stable release
This is the 4.19.5 stable release
ti_config_fragments/defconfig_map.txt: add missing baseport.cfg entries
baseport.cfg is missing from some defconfig targets. Add it.
Verified that baseport.cfg was present for these targets in
v4.14 based kernel.
Boot tested on DA850 EVM, build tested with ti_sdk_omap2_rt_release
target.
Fixes: 2a38f5aebdae ("ti_config_fragments/defconfig_map.txt: add baseport.cfg")
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
baseport.cfg is missing from some defconfig targets. Add it.
Verified that baseport.cfg was present for these targets in
v4.14 based kernel.
Boot tested on DA850 EVM, build tested with ti_sdk_omap2_rt_release
target.
Fixes: 2a38f5aebdae ("ti_config_fragments/defconfig_map.txt: add baseport.cfg")
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ti_config_fragments: v8_baseport: Forward port v8_baseport cfg from 4.14
Forward port the v8_baseport config fragment from 4.14 kernel.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Forward port the v8_baseport config fragment from 4.14 kernel.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into... ti-rt-linux-4.14.y-next-20181129 ti-rt-linux-4.14.y-next-20181130 ti-rt-linux-4.19.y-next-20181129 ti-rt-linux-4.19.y-next-20181130
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
arm64: dts: ti: k3-am6: Add NAVSS and PDMA nodes
dmaengine: ti: k3-udma: Add glue layer for non DMAengine users
dmaengine: ti: New driver for K3 UDMA
dmaengine: ti: Add cppi5 header for UDMA
dt-bindings: dma: ti: Add document for K3 UDMA
dmaengine: Add function to request slave channel from a dma_device
dmaengine: Add support for reporting DMA cached data amount
dmaengine: Add metadata_ops for dma_async_tx_descriptor
dmaengine: doc: Add sections for per descriptor metadata support
soc: ti: k3: add navss ringacc driver
bindings: soc: ti: add documentation for k3 ringacc
firmware: ti_sci: Add resource management APIs for ringacc, psi-l and udma
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel:
arm64: dts: ti: k3-am6: Add NAVSS and PDMA nodes
dmaengine: ti: k3-udma: Add glue layer for non DMAengine users
dmaengine: ti: New driver for K3 UDMA
dmaengine: ti: Add cppi5 header for UDMA
dt-bindings: dma: ti: Add document for K3 UDMA
dmaengine: Add function to request slave channel from a dma_device
dmaengine: Add support for reporting DMA cached data amount
dmaengine: Add metadata_ops for dma_async_tx_descriptor
dmaengine: doc: Add sections for per descriptor metadata support
soc: ti: k3: add navss ringacc driver
bindings: soc: ti: add documentation for k3 ringacc
firmware: ti_sci: Add resource management APIs for ringacc, psi-l and udma
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Merge branch 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.19.y
TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-4.19.y
* 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
arm64: dts: ti: k3-am6: Add NAVSS and PDMA nodes
dmaengine: ti: k3-udma: Add glue layer for non DMAengine users
dmaengine: ti: New driver for K3 UDMA
dmaengine: ti: Add cppi5 header for UDMA
dt-bindings: dma: ti: Add document for K3 UDMA
dmaengine: Add function to request slave channel from a dma_device
dmaengine: Add support for reporting DMA cached data amount
dmaengine: Add metadata_ops for dma_async_tx_descriptor
dmaengine: doc: Add sections for per descriptor metadata support
soc: ti: k3: add navss ringacc driver
bindings: soc: ti: add documentation for k3 ringacc
firmware: ti_sci: Add resource management APIs for ringacc, psi-l and udma
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-4.19.y
* 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree:
arm64: dts: ti: k3-am6: Add NAVSS and PDMA nodes
dmaengine: ti: k3-udma: Add glue layer for non DMAengine users
dmaengine: ti: New driver for K3 UDMA
dmaengine: ti: Add cppi5 header for UDMA
dt-bindings: dma: ti: Add document for K3 UDMA
dmaengine: Add function to request slave channel from a dma_device
dmaengine: Add support for reporting DMA cached data amount
dmaengine: Add metadata_ops for dma_async_tx_descriptor
dmaengine: doc: Add sections for per descriptor metadata support
soc: ti: k3: add navss ringacc driver
bindings: soc: ti: add documentation for k3 ringacc
firmware: ti_sci: Add resource management APIs for ringacc, psi-l and udma
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
arm64: dts: ti: k3-am6: Add NAVSS and PDMA nodes
Add nodes and sub nodes for both NAVSS (main and mcu) and add the PDMA
nodes as well.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Add nodes and sub nodes for both NAVSS (main and mcu) and add the PDMA
nodes as well.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dmaengine: ti: k3-udma: Add glue layer for non DMAengine users
Certain users can not use right now the DMAengine API due to missing
features in the core. Prime example is Networking.
These users can use the glue layer interface to avoid misuse of DMAengine
API and when the core gains the needed features they can be converted to
use generic API.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Certain users can not use right now the DMAengine API due to missing
features in the core. Prime example is Networking.
These users can use the glue layer interface to avoid misuse of DMAengine
API and when the core gains the needed features they can be converted to
use generic API.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dmaengine: ti: New driver for K3 UDMA
DMA driver for
Texas Instruments K3 NAVSS Unified DMA – Peripheral Root Complex (UDMA-P)
The UDMA-P is intended to perform similar (but significantly upgraded) functions
as the packet-oriented DMA used on previous SoC devices. The UDMA-P module
supports the transmission and reception of various packet types. The UDMA-P is
architected to facilitate the segmentation and reassembly of SoC DMA data
structure compliant packets to/from smaller data blocks that are natively
compatible with the specific requirements of each connected peripheral. Multiple
Tx and Rx channels are provided within the DMA which allow multiple segmentation
or reassembly operations to be ongoing. The DMA controller maintains state
information for each of the channels which allows packet segmentation and
reassembly operations to be time division multiplexed between channels in order
to share the underlying DMA hardware. An external DMA scheduler is used to
control the ordering and rate at which this multiplexing occurs for Transmit
operations. The ordering and rate of Receive operations is indirectly controlled
by the order in which blocks are pushed into the DMA on the Rx PSI-L interface.
The UDMA-P also supports acting as both a UTC and UDMA-C for its internal
channels. Channels in the UDMA-P can be configured to be either Packet-Based or
Third-Party channels on a channel by channel basis.
The initial driver supports:
- MEM_TO_MEM (TR mode)
- DEV_TO_MEM (Packet / TR mode)
- MEM_TO_DEV (Packet / TR mode)
- Cyclic (Packet / TR mode)
- Metadata for descriptors
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
DMA driver for
Texas Instruments K3 NAVSS Unified DMA – Peripheral Root Complex (UDMA-P)
The UDMA-P is intended to perform similar (but significantly upgraded) functions
as the packet-oriented DMA used on previous SoC devices. The UDMA-P module
supports the transmission and reception of various packet types. The UDMA-P is
architected to facilitate the segmentation and reassembly of SoC DMA data
structure compliant packets to/from smaller data blocks that are natively
compatible with the specific requirements of each connected peripheral. Multiple
Tx and Rx channels are provided within the DMA which allow multiple segmentation
or reassembly operations to be ongoing. The DMA controller maintains state
information for each of the channels which allows packet segmentation and
reassembly operations to be time division multiplexed between channels in order
to share the underlying DMA hardware. An external DMA scheduler is used to
control the ordering and rate at which this multiplexing occurs for Transmit
operations. The ordering and rate of Receive operations is indirectly controlled
by the order in which blocks are pushed into the DMA on the Rx PSI-L interface.
The UDMA-P also supports acting as both a UTC and UDMA-C for its internal
channels. Channels in the UDMA-P can be configured to be either Packet-Based or
Third-Party channels on a channel by channel basis.
The initial driver supports:
- MEM_TO_MEM (TR mode)
- DEV_TO_MEM (Packet / TR mode)
- MEM_TO_DEV (Packet / TR mode)
- Cyclic (Packet / TR mode)
- Metadata for descriptors
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dmaengine: ti: Add cppi5 header for UDMA
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dt-bindings: dma: ti: Add document for K3 UDMA
New binding document for
Texas Instruments K3 NAVSS Unified DMA – Peripheral Root Complex (UDMA-P).
UDMA-P is introduced as part of the K3 architecture and can be found on
AM65x SoC.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
New binding document for
Texas Instruments K3 NAVSS Unified DMA – Peripheral Root Complex (UDMA-P).
UDMA-P is introduced as part of the K3 architecture and can be found on
AM65x SoC.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dmaengine: Add function to request slave channel from a dma_device
dma_get_any_slave_channel() would skip using the filter function, which
in some cases needed to be executed before the alloc_chan_resources
callback to make sure that all parameters are provided for the slave
channel.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dma_get_any_slave_channel() would skip using the filter function, which
in some cases needed to be executed before the alloc_chan_resources
callback to make sure that all parameters are provided for the slave
channel.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dmaengine: Add support for reporting DMA cached data amount
A DMA hardware can have big cache or FIFO and the amount of data sitting in
the DMA fabric can be an interest for the clients.
For example in audio we want to know the delay in the data flow and in case
the DMA have significantly large FIFO/cache, it can affect the latenc/delay
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
A DMA hardware can have big cache or FIFO and the amount of data sitting in
the DMA fabric can be an interest for the clients.
For example in audio we want to know the delay in the data flow and in case
the DMA have significantly large FIFO/cache, it can affect the latenc/delay
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dmaengine: Add metadata_ops for dma_async_tx_descriptor
The metadata is best described as side band data or parameters traveling
alongside the data DMAd by the DMA engine. It is data
which is understood by the peripheral and the peripheral driver only, the
DMA engine see it only as data block and it is not interpreting it in any
way.
The metadata can be different per descriptor as it is a parameter for the
data being transferred.
If the DMA supports per descriptor metadata it can implement the attach,
get_ptr/set_len callbacks.
Client drivers must only use either attach or get_ptr/set_len to avoid
misconfiguration.
Client driver can check if a given metadata mode is supported by the
channel during probe time with
dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_CLIENT);
dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_ENGINE);
and based on this information can use either mode.
Wrappers are also added for the metadata_ops.
To be used in DESC_METADATA_CLIENT mode:
dmaengine_desc_attach_metadata()
To be used in DESC_METADATA_ENGINE mode:
dmaengine_desc_get_metadata_ptr()
dmaengine_desc_set_metadata_len()
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
The metadata is best described as side band data or parameters traveling
alongside the data DMAd by the DMA engine. It is data
which is understood by the peripheral and the peripheral driver only, the
DMA engine see it only as data block and it is not interpreting it in any
way.
The metadata can be different per descriptor as it is a parameter for the
data being transferred.
If the DMA supports per descriptor metadata it can implement the attach,
get_ptr/set_len callbacks.
Client drivers must only use either attach or get_ptr/set_len to avoid
misconfiguration.
Client driver can check if a given metadata mode is supported by the
channel during probe time with
dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_CLIENT);
dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_ENGINE);
and based on this information can use either mode.
Wrappers are also added for the metadata_ops.
To be used in DESC_METADATA_CLIENT mode:
dmaengine_desc_attach_metadata()
To be used in DESC_METADATA_ENGINE mode:
dmaengine_desc_get_metadata_ptr()
dmaengine_desc_set_metadata_len()
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
dmaengine: doc: Add sections for per descriptor metadata support
Update the provider and client documentation with details about the
metadata support.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Update the provider and client documentation with details about the
metadata support.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
soc: ti: k3: add navss ringacc driver
The Ring Accelerator (RINGACC or RA) provides hardware acceleration to
enable straightforward passing of work between a producer and a consumer.
There is one RINGACC module per NAVSS on TI AM65x SoCs.
The RINGACC converts constant-address read and write accesses to equivalent
read or write accesses to a circular data structure in memory. The RINGACC
eliminates the need for each DMA controller which needs to access ring
elements from having to know the current state of the ring (base address,
current offset). The DMA controller performs a read or write access to a
specific address range (which maps to the source interface on the RINGACC)
and the RINGACC replaces the address for the transaction with a new address
which corresponds to the head or tail element of the ring (head for reads,
tail for writes). Since the RINGACC maintains the state, multiple DMA
controllers or channels are allowed to coherently share the same rings as
applicable. The RINGACC is able to place data which is destined towards
software into cached memory directly.
Supported ring modes:
- Ring Mode
- Messaging Mode
- Credentials Mode
- Queue Manager Mode
TI-SCI integration:
Texas Instrument's System Control Interface (TI-SCI) Message Protocol now
has control over Ringacc module resources management (RM) and Rings
configuration.
The corresponding support of TI-SCI Ringacc module RM protocol
introduced as option through DT parameters:
- ti,sci: phandle on TI-SCI firmware controller DT node
- ti,sci-dev-id: TI-SCI device identifier as per TI-SCI firmware spec
if both parameters present - Ringacc driver will configure/free/reset Rings
using TI-SCI Message Ringacc RM Protocol.
The Ringacc driver manages Rings allocation by itself now and requests
TI-SCI firmware to allocate and configure specific Rings only. It's done
this way because, Linux driver implements two stage Rings allocation and
configuration (allocate ring and configure ring) while I-SCI Message
Protocol supports only one combined operation (allocate+configure).
Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
The Ring Accelerator (RINGACC or RA) provides hardware acceleration to
enable straightforward passing of work between a producer and a consumer.
There is one RINGACC module per NAVSS on TI AM65x SoCs.
The RINGACC converts constant-address read and write accesses to equivalent
read or write accesses to a circular data structure in memory. The RINGACC
eliminates the need for each DMA controller which needs to access ring
elements from having to know the current state of the ring (base address,
current offset). The DMA controller performs a read or write access to a
specific address range (which maps to the source interface on the RINGACC)
and the RINGACC replaces the address for the transaction with a new address
which corresponds to the head or tail element of the ring (head for reads,
tail for writes). Since the RINGACC maintains the state, multiple DMA
controllers or channels are allowed to coherently share the same rings as
applicable. The RINGACC is able to place data which is destined towards
software into cached memory directly.
Supported ring modes:
- Ring Mode
- Messaging Mode
- Credentials Mode
- Queue Manager Mode
TI-SCI integration:
Texas Instrument's System Control Interface (TI-SCI) Message Protocol now
has control over Ringacc module resources management (RM) and Rings
configuration.
The corresponding support of TI-SCI Ringacc module RM protocol
introduced as option through DT parameters:
- ti,sci: phandle on TI-SCI firmware controller DT node
- ti,sci-dev-id: TI-SCI device identifier as per TI-SCI firmware spec
if both parameters present - Ringacc driver will configure/free/reset Rings
using TI-SCI Message Ringacc RM Protocol.
The Ringacc driver manages Rings allocation by itself now and requests
TI-SCI firmware to allocate and configure specific Rings only. It's done
this way because, Linux driver implements two stage Rings allocation and
configuration (allocate ring and configure ring) while I-SCI Message
Protocol supports only one combined operation (allocate+configure).
Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
bindings: soc: ti: add documentation for k3 ringacc
The Ring Accelerator (RINGACC or RA) provides hardware acceleration to
enable straightforward passing of work between a producer and a consumer.
There is one RINGACC module per NAVSS on TI AM65x SoCs.
This patch introduces RINGACC device tree bindings.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
The Ring Accelerator (RINGACC or RA) provides hardware acceleration to
enable straightforward passing of work between a producer and a consumer.
There is one RINGACC module per NAVSS on TI AM65x SoCs.
This patch introduces RINGACC device tree bindings.
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
firmware: ti_sci: Add resource management APIs for ringacc, psi-l and udma
TISCI abstracts the management of NAVSS resources, like UDMA channels,
flows, rings.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
TISCI abstracts the management of NAVSS resources, like UDMA channels,
flows, rings.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 years agoMerge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into... ti-rt-linux-4.14.y-next-20181128 ti-rt-linux-4.19.y-next-20181128
Merge branch 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel into ti-rt-linux-4.19.y
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (36 commits)
ti_config_fragments: v8_baseport: enable K3 thermal
arm64: dts: ti: am6: Add VTM node
arm64: dts: ti: am654: Add thermal zones
thermal: k3: Add support for bandgap sensors
dt-bindings: thermal: k3: Add VTM bindings documentation
arm64: dts: ti: am654-base-board: Add gpio_keys node
arm64: configs: Enable GPIO_DAVINCI
arm64: dts: ti: am6: Add gpio nodes
gpio: Davinci: Add K3 Specific dependencies
gpio: davinci: Fix the compiler warning with ARM64 config enabled
arm64: dts: ti: k3-am654-base-board: Add I2C nodes
arm64: dts: ti: am654-base-board: Add pinmux for main uart0
arm64: dts: ti: k3-am65: Add pinctrl regions
dt-bindings: pinctrl: k3: Introduce pinmux definitions
arm64: dts: ti: am654: Add interrupt controller nodes
arm64: dts: ti: am654: Update compatible for dmsc
soc: ti: am6: Enable interrupt controller drivers
irqchip: ti-sci-inta: Add support for Interrupt Aggregator driver
dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings
irqchip: ti-sci-intr: Add support for Interrupt Router driver
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: ti_linux_base_rt
TI-Tree: git@git.ti.com:ti-linux-kernel/ti-linux-kernel.git
TI-Branch: ti-linux-4.19.y
* 'ti-linux-4.19.y' of git.ti.com:ti-linux-kernel/ti-linux-kernel: (36 commits)
ti_config_fragments: v8_baseport: enable K3 thermal
arm64: dts: ti: am6: Add VTM node
arm64: dts: ti: am654: Add thermal zones
thermal: k3: Add support for bandgap sensors
dt-bindings: thermal: k3: Add VTM bindings documentation
arm64: dts: ti: am654-base-board: Add gpio_keys node
arm64: configs: Enable GPIO_DAVINCI
arm64: dts: ti: am6: Add gpio nodes
gpio: Davinci: Add K3 Specific dependencies
gpio: davinci: Fix the compiler warning with ARM64 config enabled
arm64: dts: ti: k3-am654-base-board: Add I2C nodes
arm64: dts: ti: am654-base-board: Add pinmux for main uart0
arm64: dts: ti: k3-am65: Add pinctrl regions
dt-bindings: pinctrl: k3: Introduce pinmux definitions
arm64: dts: ti: am654: Add interrupt controller nodes
arm64: dts: ti: am654: Update compatible for dmsc
soc: ti: am6: Enable interrupt controller drivers
irqchip: ti-sci-inta: Add support for Interrupt Aggregator driver
dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings
irqchip: ti-sci-intr: Add support for Interrupt Router driver
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Merge branch 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree into ti-linux-4.19.y
TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-4.19.y
* 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree: (36 commits)
ti_config_fragments: v8_baseport: enable K3 thermal
arm64: dts: ti: am6: Add VTM node
arm64: dts: ti: am654: Add thermal zones
thermal: k3: Add support for bandgap sensors
dt-bindings: thermal: k3: Add VTM bindings documentation
arm64: dts: ti: am654-base-board: Add gpio_keys node
arm64: configs: Enable GPIO_DAVINCI
arm64: dts: ti: am6: Add gpio nodes
gpio: Davinci: Add K3 Specific dependencies
gpio: davinci: Fix the compiler warning with ARM64 config enabled
arm64: dts: ti: k3-am654-base-board: Add I2C nodes
arm64: dts: ti: am654-base-board: Add pinmux for main uart0
arm64: dts: ti: k3-am65: Add pinctrl regions
dt-bindings: pinctrl: k3: Introduce pinmux definitions
arm64: dts: ti: am654: Add interrupt controller nodes
arm64: dts: ti: am654: Update compatible for dmsc
soc: ti: am6: Enable interrupt controller drivers
irqchip: ti-sci-inta: Add support for Interrupt Aggregator driver
dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings
irqchip: ti-sci-intr: Add support for Interrupt Router driver
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
TI-Feature: platform_base
TI-Tree: git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree.git
TI-Branch: platform-ti-linux-4.19.y
* 'platform-ti-linux-4.19.y' of git://git.ti.com/~rrnayak/ti-linux-kernel/platform-linux-feature-tree: (36 commits)
ti_config_fragments: v8_baseport: enable K3 thermal
arm64: dts: ti: am6: Add VTM node
arm64: dts: ti: am654: Add thermal zones
thermal: k3: Add support for bandgap sensors
dt-bindings: thermal: k3: Add VTM bindings documentation
arm64: dts: ti: am654-base-board: Add gpio_keys node
arm64: configs: Enable GPIO_DAVINCI
arm64: dts: ti: am6: Add gpio nodes
gpio: Davinci: Add K3 Specific dependencies
gpio: davinci: Fix the compiler warning with ARM64 config enabled
arm64: dts: ti: k3-am654-base-board: Add I2C nodes
arm64: dts: ti: am654-base-board: Add pinmux for main uart0
arm64: dts: ti: k3-am65: Add pinctrl regions
dt-bindings: pinctrl: k3: Introduce pinmux definitions
arm64: dts: ti: am654: Add interrupt controller nodes
arm64: dts: ti: am654: Update compatible for dmsc
soc: ti: am6: Enable interrupt controller drivers
irqchip: ti-sci-inta: Add support for Interrupt Aggregator driver
dt-bindings: irqchip: Introduce TISCI Interrupt Aggregator bindings
irqchip: ti-sci-intr: Add support for Interrupt Router driver
...
Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
Linux 4.19.5
mt76x0: run vco calibration for each channel configuration
commit 473f0a763d2c7cd68a6dedf51e7d81e8f58f78ac upstream.
According to vendor sdk, vco calibration has to be executed
for each channel configuration whereas mcu calibration has to be
performed during channel scanning. This patch fixes the mt76x0
monitor mode issue since in that configuration vco calibration
was never executed
Fixes: 10de7a8b4ab9 ("mt76x0: phy files")
Tested-by: Sid Hayn <sidhayn@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 473f0a763d2c7cd68a6dedf51e7d81e8f58f78ac upstream.
According to vendor sdk, vco calibration has to be executed
for each channel configuration whereas mcu calibration has to be
performed during channel scanning. This patch fixes the mt76x0
monitor mode issue since in that configuration vco calibration
was never executed
Fixes: 10de7a8b4ab9 ("mt76x0: phy files")
Tested-by: Sid Hayn <sidhayn@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
libceph: fall back to sendmsg for slab pages
commit 7e241f647dc7087a0401418a187f3f5b527cc690 upstream.
skb_can_coalesce() allows coalescing neighboring slab objects into
a single frag:
return page == skb_frag_page(frag) &&
off == frag->page_offset + skb_frag_size(frag);
ceph_tcp_sendpage() can be handed slab pages. One example of this is
XFS: it passes down sector sized slab objects for its metadata I/O. If
the kernel client is co-located on the OSD node, the skb may go through
loopback and pop on the receive side with the exact same set of frags.
When tcp_recvmsg() attempts to copy out such a frag, hardened usercopy
complains because the size exceeds the object's allocated size:
usercopy: kernel memory exposure attempt detected from ffff9ba917f20a00 (kmalloc-512) (1024 bytes)
Although skb_can_coalesce() could be taught to return false if the
resulting frag would cross a slab object boundary, we already have
a fallback for non-refcounted pages. Utilize it for slab pages too.
Cc: stable@vger.kernel.org # 4.8+
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 7e241f647dc7087a0401418a187f3f5b527cc690 upstream.
skb_can_coalesce() allows coalescing neighboring slab objects into
a single frag:
return page == skb_frag_page(frag) &&
off == frag->page_offset + skb_frag_size(frag);
ceph_tcp_sendpage() can be handed slab pages. One example of this is
XFS: it passes down sector sized slab objects for its metadata I/O. If
the kernel client is co-located on the OSD node, the skb may go through
loopback and pop on the receive side with the exact same set of frags.
When tcp_recvmsg() attempts to copy out such a frag, hardened usercopy
complains because the size exceeds the object's allocated size:
usercopy: kernel memory exposure attempt detected from ffff9ba917f20a00 (kmalloc-512) (1024 bytes)
Although skb_can_coalesce() could be taught to return false if the
resulting frag would cross a slab object boundary, we already have
a fallback for non-refcounted pages. Utilize it for slab pages too.
Cc: stable@vger.kernel.org # 4.8+
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
HID: Add quirk for Microsoft PIXART OEM mouse
commit e82e62e390d39c3819641cd721695702180d54fb upstream.
The PixArt OEM mice are known for disconnecting every minute in
runlevel 1 or 3 if they are not always polled. So add quirk
ALWAYS_POLL for this one as well.
References:
https://www.spinics.net/lists/linux-usb/msg88965.html
http://linet.gr.jp/~kojima/PlamoWeb/ML/htdocs/201808/msg00019.html
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit e82e62e390d39c3819641cd721695702180d54fb upstream.
The PixArt OEM mice are known for disconnecting every minute in
runlevel 1 or 3 if they are not always polled. So add quirk
ALWAYS_POLL for this one as well.
References:
https://www.spinics.net/lists/linux-usb/msg88965.html
http://linet.gr.jp/~kojima/PlamoWeb/ML/htdocs/201808/msg00019.html
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
HID: Add quirk for Primax PIXART OEM mice
commit fb862c3b199d28bee238d52e8270eae8650d6cb0 upstream.
The PixArt OEM mice are known for disconnecting every minute in
runlevel 1 or 3 if they are not always polled. So add quirk
ALWAYS_POLL for two Primax mice as well.
0x4e22 is the Dell MS111-P and 0x4d0f is the unbranded HP Portia
mouse HP 697738-001. Both were built until approx. 2014.
Those were the standard mice from those vendors and are still
around - even as new old stock.
Reference: https://github.com/sriemer/fix-linux-mouse/issues/11
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit fb862c3b199d28bee238d52e8270eae8650d6cb0 upstream.
The PixArt OEM mice are known for disconnecting every minute in
runlevel 1 or 3 if they are not always polled. So add quirk
ALWAYS_POLL for two Primax mice as well.
0x4e22 is the Dell MS111-P and 0x4d0f is the unbranded HP Portia
mouse HP 697738-001. Both were built until approx. 2014.
Those were the standard mice from those vendors and are still
around - even as new old stock.
Reference: https://github.com/sriemer/fix-linux-mouse/issues/11
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
CC: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
HID: uhid: forbid UHID_CREATE under KERNEL_DS or elevated privileges
commit 8c01db7619f07c85c5cd81ec5eb83608b56c88f5 upstream.
When a UHID_CREATE command is written to the uhid char device, a
copy_from_user() is done from a user pointer embedded in the command.
When the address limit is KERNEL_DS, e.g. as is the case during
sys_sendfile(), this can read from kernel memory. Alternatively,
information can be leaked from a setuid binary that is tricked to write
to the file descriptor. Therefore, forbid UHID_CREATE in these cases.
No other commands in uhid_char_write() are affected by this bug and
UHID_CREATE is marked as "obsolete", so apply the restriction to
UHID_CREATE only rather than to uhid_char_write() entirely.
Thanks to Dmitry Vyukov for adding uhid definitions to syzkaller and to
Jann Horn for commit 9da3f2b740544 ("x86/fault: BUG() when uaccess
helpers fault on kernel addresses"), allowing this bug to be found.
Reported-by: syzbot+72473edc9bf4eb1c6556@syzkaller.appspotmail.com
Fixes: d365c6cfd337 ("HID: uhid: add UHID_CREATE and UHID_DESTROY events")
Cc: <stable@vger.kernel.org> # v3.6+
Cc: Jann Horn <jannh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 8c01db7619f07c85c5cd81ec5eb83608b56c88f5 upstream.
When a UHID_CREATE command is written to the uhid char device, a
copy_from_user() is done from a user pointer embedded in the command.
When the address limit is KERNEL_DS, e.g. as is the case during
sys_sendfile(), this can read from kernel memory. Alternatively,
information can be leaked from a setuid binary that is tricked to write
to the file descriptor. Therefore, forbid UHID_CREATE in these cases.
No other commands in uhid_char_write() are affected by this bug and
UHID_CREATE is marked as "obsolete", so apply the restriction to
UHID_CREATE only rather than to uhid_char_write() entirely.
Thanks to Dmitry Vyukov for adding uhid definitions to syzkaller and to
Jann Horn for commit 9da3f2b740544 ("x86/fault: BUG() when uaccess
helpers fault on kernel addresses"), allowing this bug to be found.
Reported-by: syzbot+72473edc9bf4eb1c6556@syzkaller.appspotmail.com
Fixes: d365c6cfd337 ("HID: uhid: add UHID_CREATE and UHID_DESTROY events")
Cc: <stable@vger.kernel.org> # v3.6+
Cc: Jann Horn <jannh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ACPI / platform: Add SMB0001 HID to forbidden_id_list
commit 2bbb5fa37475d7aa5fa62f34db1623f3da2dfdfa upstream.
Many HP AMD based laptops contain an SMB0001 device like this:
Device (SMBD)
{
Name (_HID, "SMB0001") // _HID: Hardware ID
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
IO (Decode16,
0x0B20, // Range Minimum
0x0B20, // Range Maximum
0x20, // Alignment
0x20, // Length
)
IRQ (Level, ActiveLow, Shared, )
{7}
})
}
The legacy style IRQ resource here causes acpi_dev_get_irqresource() to
be called with legacy=true and this message to show in dmesg:
ACPI: IRQ 7 override to edge, high
This causes issues when later on the AMD0030 GPIO device gets enumerated:
Device (GPIO)
{
Name (_HID, "AMDI0030") // _HID: Hardware ID
Name (_CID, "AMDI0030") // _CID: Compatible ID
Name (_UID, Zero) // _UID: Unique ID
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Name (RBUF, ResourceTemplate ()
{
Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, )
{
0x00000007,
}
Memory32Fixed (ReadWrite,
0xFED81500, // Address Base
0x00000400, // Address Length
)
})
Return (RBUF) /* \_SB_.GPIO._CRS.RBUF */
}
}
Now acpi_dev_get_irqresource() gets called with legacy=false, but because
of the earlier override of the trigger-type acpi_register_gsi() returns
-EBUSY (because we try to register the same interrupt with a different
trigger-type) and we end up setting IORESOURCE_DISABLED in the flags.
The setting of IORESOURCE_DISABLED causes platform_get_irq() to call
acpi_irq_get() which is not implemented on x86 and returns -EINVAL.
resulting in the following in dmesg:
amd_gpio AMDI0030:00: Failed to get gpio IRQ: -22
amd_gpio: probe of AMDI0030:00 failed with error -22
The SMB0001 is a "virtual" device in the sense that the only way the OS
interacts with it is through calling a couple of methods to do SMBus
transfers. As such it is weird that it has IO and IRQ resources at all,
because the driver for it is not expected to ever access the hardware
directly.
The Linux driver for the SMB0001 device directly binds to the acpi_device
through the acpi_bus, so we do not need to instantiate a platform_device
for this ACPI device. This commit adds the SMB0001 HID to the
forbidden_id_list, avoiding the instantiating of a platform_device for it.
Not instantiating a platform_device means we will no longer call
acpi_dev_get_irqresource() for the legacy IRQ resource fixing the probe of
the AMDI0030 device failing.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1644013
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198715
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199523
Reported-by: Lukas Kahnert <openproggerfreak@gmail.com>
Tested-by: Marc <suaefar@googlemail.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 2bbb5fa37475d7aa5fa62f34db1623f3da2dfdfa upstream.
Many HP AMD based laptops contain an SMB0001 device like this:
Device (SMBD)
{
Name (_HID, "SMB0001") // _HID: Hardware ID
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
IO (Decode16,
0x0B20, // Range Minimum
0x0B20, // Range Maximum
0x20, // Alignment
0x20, // Length
)
IRQ (Level, ActiveLow, Shared, )
{7}
})
}
The legacy style IRQ resource here causes acpi_dev_get_irqresource() to
be called with legacy=true and this message to show in dmesg:
ACPI: IRQ 7 override to edge, high
This causes issues when later on the AMD0030 GPIO device gets enumerated:
Device (GPIO)
{
Name (_HID, "AMDI0030") // _HID: Hardware ID
Name (_CID, "AMDI0030") // _CID: Compatible ID
Name (_UID, Zero) // _UID: Unique ID
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Name (RBUF, ResourceTemplate ()
{
Interrupt (ResourceConsumer, Level, ActiveLow, Shared, ,, )
{
0x00000007,
}
Memory32Fixed (ReadWrite,
0xFED81500, // Address Base
0x00000400, // Address Length
)
})
Return (RBUF) /* \_SB_.GPIO._CRS.RBUF */
}
}
Now acpi_dev_get_irqresource() gets called with legacy=false, but because
of the earlier override of the trigger-type acpi_register_gsi() returns
-EBUSY (because we try to register the same interrupt with a different
trigger-type) and we end up setting IORESOURCE_DISABLED in the flags.
The setting of IORESOURCE_DISABLED causes platform_get_irq() to call
acpi_irq_get() which is not implemented on x86 and returns -EINVAL.
resulting in the following in dmesg:
amd_gpio AMDI0030:00: Failed to get gpio IRQ: -22
amd_gpio: probe of AMDI0030:00 failed with error -22
The SMB0001 is a "virtual" device in the sense that the only way the OS
interacts with it is through calling a couple of methods to do SMBus
transfers. As such it is weird that it has IO and IRQ resources at all,
because the driver for it is not expected to ever access the hardware
directly.
The Linux driver for the SMB0001 device directly binds to the acpi_device
through the acpi_bus, so we do not need to instantiate a platform_device
for this ACPI device. This commit adds the SMB0001 HID to the
forbidden_id_list, avoiding the instantiating of a platform_device for it.
Not instantiating a platform_device means we will no longer call
acpi_dev_get_irqresource() for the legacy IRQ resource fixing the probe of
the AMDI0030 device failing.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1644013
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198715
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199523
Reported-by: Lukas Kahnert <openproggerfreak@gmail.com>
Tested-by: Marc <suaefar@googlemail.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/sgi-gru: fix Spectre v1 vulnerability
commit fee05f455ceb5c670cbe48e2f9454ebc4a388554 upstream.
req.gid can be indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
vers/misc/sgi-gru/grukdump.c:200 gru_dump_chiplet_request() warn:
potential spectre issue 'gru_base' [w]
Fix this by sanitizing req.gid before calling macro GID_TO_GRU, which
uses it to index gru_base.
Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit fee05f455ceb5c670cbe48e2f9454ebc4a388554 upstream.
req.gid can be indirectly controlled by user-space, hence leading to
a potential exploitation of the Spectre variant 1 vulnerability.
This issue was detected with the help of Smatch:
vers/misc/sgi-gru/grukdump.c:200 gru_dump_chiplet_request() warn:
potential spectre issue 'gru_base' [w]
Fix this by sanitizing req.gid before calling macro GID_TO_GRU, which
uses it to index gru_base.
Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].
[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mtd: rawnand: atmel: fix OF child-node lookup
commit 5d1e9c2212ea6b4dd735e4fc3dd6279a365d5d10 upstream.
Use the new of_get_compatible_child() helper to lookup the nfc child
node instead of using of_find_compatible_node(), which searches the
entire tree from a given start node and thus can return an unrelated
(i.e. non-child) node.
This also addresses a potential use-after-free (e.g. after probe
deferral) as the tree-wide helper drops a reference to its first
argument (i.e. the node of the device being probed).
While at it, also fix a related nfc-node reference leak.
Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: stable <stable@vger.kernel.org> # 4.11
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Josh Wu <rainyfeeling@outlook.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 5d1e9c2212ea6b4dd735e4fc3dd6279a365d5d10 upstream.
Use the new of_get_compatible_child() helper to lookup the nfc child
node instead of using of_find_compatible_node(), which searches the
entire tree from a given start node and thus can return an unrelated
(i.e. non-child) node.
This also addresses a potential use-after-free (e.g. after probe
deferral) as the tree-wide helper drops a reference to its first
argument (i.e. the node of the device being probed).
While at it, also fix a related nfc-node reference leak.
Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: stable <stable@vger.kernel.org> # 4.11
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Josh Wu <rainyfeeling@outlook.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
gnss: sirf: fix synchronous write timeout
commit 1decef370456870bf448a565be95db636428e106 upstream.
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 <stable@vger.kernel.org> # 4.19
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 1decef370456870bf448a565be95db636428e106 upstream.
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 <stable@vger.kernel.org> # 4.19
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
gnss: serial: fix synchronous write timeout
commit 56a6c7268312cba9436b84cac01b3e502c5c511d upstream.
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 <stable@vger.kernel.org> # 4.19
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 56a6c7268312cba9436b84cac01b3e502c5c511d upstream.
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 <stable@vger.kernel.org> # 4.19
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: misc: appledisplay: add 20" Apple Cinema Display
commit f6501f49199097b99e4e263644d88c90d1ec1060 upstream.
Add another Apple Cinema Display to the list of supported displays
Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit f6501f49199097b99e4e263644d88c90d1ec1060 upstream.
Add another Apple Cinema Display to the list of supported displays
Signed-off-by: Mattias Jacobsson <2pi@mok.nu>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
misc: atmel-ssc: Fix section annotation on atmel_ssc_get_driver_data
commit 7c97301285b62a41d6bceded7d964085fc8cc50f upstream.
After building the kernel with Clang, the following section mismatch
warning appears:
WARNING: vmlinux.o(.text+0x3bf19a6): Section mismatch in reference from
the function ssc_probe() to the function
.init.text:atmel_ssc_get_driver_data()
The function ssc_probe() references
the function __init atmel_ssc_get_driver_data().
This is often because ssc_probe lacks a __init
annotation or the annotation of atmel_ssc_get_driver_data is wrong.
Remove __init from atmel_ssc_get_driver_data to get rid of the mismatch.
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 7c97301285b62a41d6bceded7d964085fc8cc50f upstream.
After building the kernel with Clang, the following section mismatch
warning appears:
WARNING: vmlinux.o(.text+0x3bf19a6): Section mismatch in reference from
the function ssc_probe() to the function
.init.text:atmel_ssc_get_driver_data()
The function ssc_probe() references
the function __init atmel_ssc_get_driver_data().
This is often because ssc_probe lacks a __init
annotation or the annotation of atmel_ssc_get_driver_data is wrong.
Remove __init from atmel_ssc_get_driver_data to get rid of the mismatch.
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usb: quirks: Add delay-init quirk for Corsair K70 LUX RGB
commit a77112577667cbda7c6292c52d909636aef31fd9 upstream.
Following on from this patch: https://lkml.org/lkml/2017/11/3/516,
Corsair K70 LUX RGB keyboards also require the DELAY_INIT quirk to
start correctly at boot.
Dmesg output:
usb 1-6: string descriptor 0 read error: -110
usb 1-6: New USB device found, idVendor=1b1c, idProduct=1b33
usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-6: can't set config #1, error -110
Signed-off-by: Emmanuel Pescosta <emmanuelpescosta099@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit a77112577667cbda7c6292c52d909636aef31fd9 upstream.
Following on from this patch: https://lkml.org/lkml/2017/11/3/516,
Corsair K70 LUX RGB keyboards also require the DELAY_INIT quirk to
start correctly at boot.
Dmesg output:
usb 1-6: string descriptor 0 read error: -110
usb 1-6: New USB device found, idVendor=1b1c, idProduct=1b33
usb 1-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-6: can't set config #1, error -110
Signed-off-by: Emmanuel Pescosta <emmanuelpescosta099@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: Wait for extra delay time after USB_PORT_FEAT_RESET for quirky hub
commit 781f0766cc41a9dd2e5d118ef4b1d5d89430257b upstream.
Devices connected under Terminus Technology Inc. Hub (1a40:0101) may
fail to work after the system resumes from suspend:
[ 206.063325] usb 3-2.4: reset full-speed USB device number 4 using xhci_hcd
[ 206.143691] usb 3-2.4: device descriptor read/64, error -32
[ 206.351671] usb 3-2.4: device descriptor read/64, error -32
Info for this hub:
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=480 MxCh= 4
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=1a40 ProdID=0101 Rev=01.11
S: Product=USB 2.0 Hub
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
Some expirements indicate that the USB devices connected to the hub are
innocent, it's the hub itself is to blame. The hub needs extra delay
time after it resets its port.
Hence wait for extra delay, if the device is connected to this quirky
hub.
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 781f0766cc41a9dd2e5d118ef4b1d5d89430257b upstream.
Devices connected under Terminus Technology Inc. Hub (1a40:0101) may
fail to work after the system resumes from suspend:
[ 206.063325] usb 3-2.4: reset full-speed USB device number 4 using xhci_hcd
[ 206.143691] usb 3-2.4: device descriptor read/64, error -32
[ 206.351671] usb 3-2.4: device descriptor read/64, error -32
Info for this hub:
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=480 MxCh= 4
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=1a40 ProdID=0101 Rev=01.11
S: Product=USB 2.0 Hub
C: #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
Some expirements indicate that the USB devices connected to the hub are
innocent, it's the hub itself is to blame. The hub needs extra delay
time after it resets its port.
Hence wait for extra delay, if the device is connected to this quirky
hub.
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
USB: quirks: Add no-lpm quirk for Raydium touchscreens
commit deefd24228a172d1b27d4a9adbfd2cdacd60ae64 upstream.
Raydium USB touchscreen fails to set config if LPM is enabled:
[ 2.030658] usb 1-8: New USB device found, idVendor=2386, idProduct=3119
[ 2.030659] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.030660] usb 1-8: Product: Raydium Touch System
[ 2.030661] usb 1-8: Manufacturer: Raydium Corporation
[ 7.132209] usb 1-8: can't set config #1, error -110
Same behavior can be observed on 2386:3114.
Raydium claims the touchscreen supports LPM under Windows, so I used
Microsoft USB Test Tools (MUTT) [1] to check its LPM status. MUTT shows
that the LPM doesn't work under Windows, either. So let's just disable LPM
for Raydium touchscreens.
[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-test-tools
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit deefd24228a172d1b27d4a9adbfd2cdacd60ae64 upstream.
Raydium USB touchscreen fails to set config if LPM is enabled:
[ 2.030658] usb 1-8: New USB device found, idVendor=2386, idProduct=3119
[ 2.030659] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.030660] usb 1-8: Product: Raydium Touch System
[ 2.030661] usb 1-8: Manufacturer: Raydium Corporation
[ 7.132209] usb 1-8: can't set config #1, error -110
Same behavior can be observed on 2386:3114.
Raydium claims the touchscreen supports LPM under Windows, so I used
Microsoft USB Test Tools (MUTT) [1] to check its LPM status. MUTT shows
that the LPM doesn't work under Windows, either. So let's just disable LPM
for Raydium touchscreens.
[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/usb-test-tools
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usb: cdc-acm: add entry for Hiro (Conexant) modem
commit 63529eaa6164ef7ab4b907b25ac3648177e5e78f upstream.
The cdc-acm kernel module currently does not support the Hiro (Conexant)
H05228 USB modem. The patch below adds the device specific information:
idVendor 0x0572
idProduct 0x1349
Signed-off-by: Maarten Jacobs <maarten256@outlook.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 63529eaa6164ef7ab4b907b25ac3648177e5e78f upstream.
The cdc-acm kernel module currently does not support the Hiro (Conexant)
H05228 USB modem. The patch below adds the device specific information:
idVendor 0x0572
idProduct 0x1349
Signed-off-by: Maarten Jacobs <maarten256@outlook.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
can: kvaser_usb: Fix potential uninitialized variable use
commit 95217260649aa504eb5d4a0d50959ca4e67c8f96 upstream.
If alloc_can_err_skb() fails, cf is never initialized.
Move assignment of cf inside check.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 95217260649aa504eb5d4a0d50959ca4e67c8f96 upstream.
If alloc_can_err_skb() fails, cf is never initialized.
Move assignment of cf inside check.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
can: kvaser_usb: Fix accessing freed memory in kvaser_usb_start_xmit()
commit e13fb9b37cc00616b90df2d620f30345b5ada6ff upstream.
The call to can_put_echo_skb() may result in the skb being freed. The skb
is later used in the call to dev->ops->dev_frame_to_cmd().
This is avoided by moving the call to can_put_echo_skb() after
dev->ops->dev_frame_to_cmd().
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit e13fb9b37cc00616b90df2d620f30345b5ada6ff upstream.
The call to can_put_echo_skb() may result in the skb being freed. The skb
is later used in the call to dev->ops->dev_frame_to_cmd().
This is avoided by moving the call to can_put_echo_skb() after
dev->ops->dev_frame_to_cmd().
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jimmy Assarsson <jimmyassarsson@gmail.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()
commit d99501b8575dc1248bacf1b58d2241cb4b265d49 upstream.
We need to call pci_iounmap() instead of iounmap() for the regions
obtained via pci_iomap() call for some archs that need special
treatment.
Fixes: aa31704fd81c ("ALSA: hda/ca0132: Add PCI region2 iomap for SBZ")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit d99501b8575dc1248bacf1b58d2241cb4b265d49 upstream.
We need to call pci_iounmap() instead of iounmap() for the regions
obtained via pci_iomap() call for some archs that need special
treatment.
Fixes: aa31704fd81c ("ALSA: hda/ca0132: Add PCI region2 iomap for SBZ")
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ALSA: hda/realtek - Add quirk entry for HP Pavilion 15
commit 563785edfcef02b566e64fb5292c74c1600808aa upstream.
HP Pavilion 15 (103c:820d) with ALC295 codec requires the quirk for
the mute LED control over mic3 pin. Added the corresponding quirk
entry.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201653
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 563785edfcef02b566e64fb5292c74c1600808aa upstream.
HP Pavilion 15 (103c:820d) with ALC295 codec requires the quirk for
the mute LED control over mic3 pin. Added the corresponding quirk
entry.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201653
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
uio: Fix an Oops on load
commit 432798195bbce1f8cd33d1c0284d0538835e25fb upstream.
I was trying to solve a double free but I introduced a more serious
NULL dereference bug. The problem is that if there is an IRQ which
triggers immediately, then we need "info->uio_dev" but it's not set yet.
This patch puts the original initialization back to how it was and just
sets info->uio_dev to NULL on the error path so it should solve both
the Oops and the double free.
Fixes: f019f07ecf6a ("uio: potential double frees if __uio_register_device() fails")
Reported-by: Mathias Thore <Mathias.Thore@infinera.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Tested-by: Mathias Thore <Mathias.Thore@infinera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 432798195bbce1f8cd33d1c0284d0538835e25fb upstream.
I was trying to solve a double free but I introduced a more serious
NULL dereference bug. The problem is that if there is an IRQ which
triggers immediately, then we need "info->uio_dev" but it's not set yet.
This patch puts the original initialization back to how it was and just
sets info->uio_dev to NULL on the error path so it should solve both
the Oops and the double free.
Fixes: f019f07ecf6a ("uio: potential double frees if __uio_register_device() fails")
Reported-by: Mathias Thore <Mathias.Thore@infinera.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Tested-by: Mathias Thore <Mathias.Thore@infinera.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
RISC-V: Fix raw_copy_{to,from}_user()
commit 21f70d4abf9e17c2e3d7e64b7bfa3424e017f176 upstream.
Sparse highlighted it, and appears to be a pure bug (from vs to).
./arch/riscv/include/asm/uaccess.h:403:35: warning: incorrect type in argument 1 (different address spaces)
./arch/riscv/include/asm/uaccess.h:403:39: warning: incorrect type in argument 2 (different address spaces)
./arch/riscv/include/asm/uaccess.h:409:37: warning: incorrect type in argument 1 (different address spaces)
./arch/riscv/include/asm/uaccess.h:409:41: warning: incorrect type in argument 2 (different address spaces)
Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 21f70d4abf9e17c2e3d7e64b7bfa3424e017f176 upstream.
Sparse highlighted it, and appears to be a pure bug (from vs to).
./arch/riscv/include/asm/uaccess.h:403:35: warning: incorrect type in argument 1 (different address spaces)
./arch/riscv/include/asm/uaccess.h:403:39: warning: incorrect type in argument 2 (different address spaces)
./arch/riscv/include/asm/uaccess.h:409:37: warning: incorrect type in argument 1 (different address spaces)
./arch/riscv/include/asm/uaccess.h:409:41: warning: incorrect type in argument 2 (different address spaces)
Signed-off-by: Olof Johansson <olof@lixom.net>
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
MIPS: OCTEON: cavium_octeon_defconfig: re-enable OCTEON USB driver
commit 82fba2df7f7c019627f24c5036dc99f41731d770 upstream.
Re-enable OCTEON USB driver which is needed on older hardware
(e.g. EdgeRouter Lite) for mass storage etc. This got accidentally
deleted when config options were changed for OCTEON2/3 USB.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: f922bc0ad08b ("MIPS: Octeon: cavium_octeon_defconfig: Enable more drivers")
Patchwork: https://patchwork.linux-mips.org/patch/21077/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org # 4.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 82fba2df7f7c019627f24c5036dc99f41731d770 upstream.
Re-enable OCTEON USB driver which is needed on older hardware
(e.g. EdgeRouter Lite) for mass storage etc. This got accidentally
deleted when config options were changed for OCTEON2/3 USB.
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: f922bc0ad08b ("MIPS: Octeon: cavium_octeon_defconfig: Enable more drivers")
Patchwork: https://patchwork.linux-mips.org/patch/21077/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org # 4.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
media: v4l: event: Add subscription to list before calling "add" operation
commit 92539d3eda2c090b382699bbb896d4b54e9bdece upstream.
Patch ad608fbcf166 changed how events were subscribed to address an issue
elsewhere. As a side effect of that change, the "add" callback was called
before the event subscription was added to the list of subscribed events,
causing the first event queued by the add callback (and possibly other
events arriving soon afterwards) to be lost.
Fix this by adding the subscription to the list before calling the "add"
callback, and clean up afterwards if that fails.
Fixes: ad608fbcf166 ("media: v4l: event: Prevent freeing event subscriptions while accessed")
Reported-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org (for 4.14 and up)
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 92539d3eda2c090b382699bbb896d4b54e9bdece upstream.
Patch ad608fbcf166 changed how events were subscribed to address an issue
elsewhere. As a side effect of that change, the "add" callback was called
before the event subscription was added to the list of subscribed events,
causing the first event queued by the add callback (and possibly other
events arriving soon afterwards) to be lost.
Fix this by adding the subscription to the list before calling the "add"
callback, and clean up afterwards if that fails.
Fixes: ad608fbcf166 ("media: v4l: event: Prevent freeing event subscriptions while accessed")
Reported-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: stable@vger.kernel.org (for 4.14 and up)
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
x86/ldt: Remove unused variable in map_ldt_struct()
commit b082f2dd80612015cd6d9d84e52099734ec9a0e1 upstream
Splitting out the sanity check in map_ldt_struct() moved page table syncing
into a separate function, which made the pgd variable unused. Remove it.
[ tglx: Massaged changelog ]
Fixes: 9bae3197e15d ("x86/ldt: Split out sanity check in map_ldt_struct()")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: peterz@infradead.org
Cc: boris.ostrovsky@oracle.com
Cc: jgross@suse.com
Cc: bhe@redhat.com
Cc: willy@infradead.org
Cc: linux-mm@kvack.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181026122856.66224-4-kirill.shutemov@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
commit b082f2dd80612015cd6d9d84e52099734ec9a0e1 upstream
Splitting out the sanity check in map_ldt_struct() moved page table syncing
into a separate function, which made the pgd variable unused. Remove it.
[ tglx: Massaged changelog ]
Fixes: 9bae3197e15d ("x86/ldt: Split out sanity check in map_ldt_struct()")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: peterz@infradead.org
Cc: boris.ostrovsky@oracle.com
Cc: jgross@suse.com
Cc: bhe@redhat.com
Cc: willy@infradead.org
Cc: linux-mm@kvack.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181026122856.66224-4-kirill.shutemov@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
x86/ldt: Unmap PTEs for the slot before freeing LDT pages
commit a0e6e0831c516860fc7f9be1db6c081fe902ebcf upstream
modify_ldt(2) leaves the old LDT mapped after switching over to the new
one. The old LDT gets freed and the pages can be re-used.
Leaving the mapping in place can have security implications. The mapping is
present in the userspace page tables and Meltdown-like attacks can read
these freed and possibly reused pages.
It's relatively simple to fix: unmap the old LDT and flush TLB before
freeing the old LDT memory.
This further allows to avoid flushing the TLB in map_ldt_struct() as the
slot is unmapped and flushed by unmap_ldt_struct() or has never been mapped
at all.
[ tglx: Massaged changelog and removed the needless line breaks ]
Fixes: f55f0501cbf6 ("x86/pti: Put the LDT in its own PGD if PTI is on")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: luto@kernel.org
Cc: peterz@infradead.org
Cc: boris.ostrovsky@oracle.com
Cc: jgross@suse.com
Cc: bhe@redhat.com
Cc: willy@infradead.org
Cc: linux-mm@kvack.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181026122856.66224-3-kirill.shutemov@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
commit a0e6e0831c516860fc7f9be1db6c081fe902ebcf upstream
modify_ldt(2) leaves the old LDT mapped after switching over to the new
one. The old LDT gets freed and the pages can be re-used.
Leaving the mapping in place can have security implications. The mapping is
present in the userspace page tables and Meltdown-like attacks can read
these freed and possibly reused pages.
It's relatively simple to fix: unmap the old LDT and flush TLB before
freeing the old LDT memory.
This further allows to avoid flushing the TLB in map_ldt_struct() as the
slot is unmapped and flushed by unmap_ldt_struct() or has never been mapped
at all.
[ tglx: Massaged changelog and removed the needless line breaks ]
Fixes: f55f0501cbf6 ("x86/pti: Put the LDT in its own PGD if PTI is on")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: luto@kernel.org
Cc: peterz@infradead.org
Cc: boris.ostrovsky@oracle.com
Cc: jgross@suse.com
Cc: bhe@redhat.com
Cc: willy@infradead.org
Cc: linux-mm@kvack.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181026122856.66224-3-kirill.shutemov@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
x86/mm: Move LDT remap out of KASLR region on 5-level paging
commit d52888aa2753e3063a9d3a0c9f72f94aa9809c15 upstream
On 5-level paging the LDT remap area is placed in the middle of the KASLR
randomization region and it can overlap with the direct mapping, the
vmalloc or the vmap area.
The LDT mapping is per mm, so it cannot be moved into the P4D page table
next to the CPU_ENTRY_AREA without complicating PGD table allocation for
5-level paging.
The 4 PGD slot gap just before the direct mapping is reserved for
hypervisors, so it cannot be used.
Move the direct mapping one slot deeper and use the resulting gap for the
LDT remap area. The resulting layout is the same for 4 and 5 level paging.
[ tglx: Massaged changelog ]
Fixes: f55f0501cbf6 ("x86/pti: Put the LDT in its own PGD if PTI is on")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: peterz@infradead.org
Cc: boris.ostrovsky@oracle.com
Cc: jgross@suse.com
Cc: bhe@redhat.com
Cc: willy@infradead.org
Cc: linux-mm@kvack.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181026122856.66224-2-kirill.shutemov@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
commit d52888aa2753e3063a9d3a0c9f72f94aa9809c15 upstream
On 5-level paging the LDT remap area is placed in the middle of the KASLR
randomization region and it can overlap with the direct mapping, the
vmalloc or the vmap area.
The LDT mapping is per mm, so it cannot be moved into the P4D page table
next to the CPU_ENTRY_AREA without complicating PGD table allocation for
5-level paging.
The 4 PGD slot gap just before the direct mapping is reserved for
hypervisors, so it cannot be used.
Move the direct mapping one slot deeper and use the resulting gap for the
LDT remap area. The resulting layout is the same for 4 and 5 level paging.
[ tglx: Massaged changelog ]
Fixes: f55f0501cbf6 ("x86/pti: Put the LDT in its own PGD if PTI is on")
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: bp@alien8.de
Cc: hpa@zytor.com
Cc: dave.hansen@linux.intel.com
Cc: peterz@infradead.org
Cc: boris.ostrovsky@oracle.com
Cc: jgross@suse.com
Cc: bhe@redhat.com
Cc: willy@infradead.org
Cc: linux-mm@kvack.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20181026122856.66224-2-kirill.shutemov@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
SUNRPC: drop pointless static qualifier in xdr_get_next_encode_buffer()
[ Upstream commit 025911a5f4e36955498ed50806ad1b02f0f76288 ]
There is no need to have the '__be32 *p' variable static since new value
always be assigned before use it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 025911a5f4e36955498ed50806ad1b02f0f76288 ]
There is no need to have the '__be32 *p' variable static since new value
always be assigned before use it.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Revert "scripts/setlocalversion: git: Make -dirty check more robust"
[ Upstream commit 8ef14c2c41d962756d314f1d7dc972b0ea7a180f ]
This reverts commit 6147b1cf19651c7de297e69108b141fb30aa2349.
The reverted patch results in attempted write access to the source
repository, even if that repository is mounted read-only.
Output from "strace git status -uno --porcelain":
getcwd("/tmp/linux-test", 129) = 16
open("/tmp/linux-test/.git/index.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) =
-1 EROFS (Read-only file system)
While git appears to be able to handle this situation, a monitored
build environment (such as the one used for Chrome OS kernel builds)
may detect it and bail out with an access violation error. On top of
that, the attempted write access suggests that git _will_ write to the
file even if a build output directory is specified. Users may have the
reasonable expectation that the source repository remains untouched in
that situation.
Fixes: 6147b1cf19651 ("scripts/setlocalversion: git: Make -dirty check more robust"
Cc: Genki Sky <sky@genki.is>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit 8ef14c2c41d962756d314f1d7dc972b0ea7a180f ]
This reverts commit 6147b1cf19651c7de297e69108b141fb30aa2349.
The reverted patch results in attempted write access to the source
repository, even if that repository is mounted read-only.
Output from "strace git status -uno --porcelain":
getcwd("/tmp/linux-test", 129) = 16
open("/tmp/linux-test/.git/index.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) =
-1 EROFS (Read-only file system)
While git appears to be able to handle this situation, a monitored
build environment (such as the one used for Chrome OS kernel builds)
may detect it and bail out with an access violation error. On top of
that, the attempted write access suggests that git _will_ write to the
file even if a build output directory is specified. Users may have the
reasonable expectation that the source repository remains untouched in
that situation.
Fixes: 6147b1cf19651 ("scripts/setlocalversion: git: Make -dirty check more robust"
Cc: Genki Sky <sky@genki.is>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kbuild: deb-pkg: fix too low build version number
[ Upstream commit bbcde0a7241261cd0ca8d8e6b94a4113a4b71443 ]
Since commit b41d920acff8 ("kbuild: deb-pkg: split generating packaging
and build"), the build version of the kernel contained in a deb package
is too low by 1.
Prior to the bad commit, the kernel was built first, then the number
in .version file was read out, and written into the debian control file.
Now, the debian control file is created before the kernel is actually
compiled, which is causing the version number mismatch.
Let the mkdebian script pass KBUILD_BUILD_VERSION=${revision} to require
the build system to use the specified version number.
Fixes: b41d920acff8 ("kbuild: deb-pkg: split generating packaging and build")
Reported-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
[ Upstream commit bbcde0a7241261cd0ca8d8e6b94a4113a4b71443 ]
Since commit b41d920acff8 ("kbuild: deb-pkg: split generating packaging
and build"), the build version of the kernel contained in a deb package
is too low by 1.
Prior to the bad commit, the kernel was built first, then the number
in .version file was read out, and written into the debian control file.
Now, the debian control file is created before the kernel is actually
compiled, which is causing the version number mismatch.
Let the mkdebian script pass KBUILD_BUILD_VERSION=${revision} to require
the build system to use the specified version number.
Fixes: b41d920acff8 ("kbuild: deb-pkg: split generating packaging and build")
Reported-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>