6.3.2-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 541/694 scripts/gdb: raise error with reduced debugging information
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit 8af055ae25bff48f57227f5e3d48a4306f3dd1c4 ]
If CONFIG_DEBUG_INFO_REDUCED is enabled in the kernel configuration, we will typically not be able to load vmlinux-gdb.py and will fail with:
Traceback (most recent call last):
File "/home/fainelli/work/buildroot/output/arm64/build/linux-custom/vmlinux-gdb.py", line 25, in <module>
import linux.utils
File "/home/fainelli/work/buildroot/output/arm64/build/linux-custom/scripts/gdb/linux/utils.py", line 131, in <module>
atomic_long_counter_offset = atomic_long_type.get_type()['counter'].bitpos
KeyError: 'counter'
Rather be left wondering what is happening only to find out that reduced debug information is the cause, raise an eror. This was not typically a problem until e3c8d33e0d62 ("scripts/gdb: fix 'lx-dmesg' on 32 bits arch") but it has since then.
--- scripts/gdb/linux/constants.py.in | 2 ++ scripts/gdb/vmlinux-gdb.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-)
scripts/gdb/linux/constants.py.in +2 -0
@@ -39,6 +39,8 @@ import gdb +LX_CONFIG(CONFIG_DEBUG_INFO_REDUCED) + /* linux/clk-provider.h */ if IS_BUILTIN(CONFIG_COMMON_CLK): LX_GDBPARSED(CLK_GET_RATE_NOCACHE)
scripts/gdb/vmlinux-gdb.py +4 -1
@@ -22,6 +22,10 @@ except: gdb.write("NOTE: gdb 7.2 or later required for Linux helper scripts to " "work.\n") else: + import linux.constants + if linux.constants.LX_CONFIG_DEBUG_INFO_REDUCED: + raise gdb.GdbError("Reduced debug information will prevent GDB " + "from having complete types.\n") import linux.utils import linux.symbols import linux.modules
@@ -32,7 +36,6 @@ else: import linux.lists import linux.rbtree import linux.proc - import linux.constants import linux.timerlist import linux.clk import linux.genpd
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 542/694 uapi/linux/const.h: prefer ISO-friendly __typeof__
In reply to Greg Kroah-HartmanFrom: Kevin Brodsky <[email protected]>
[ Upstream commit 31088f6f7906253ef4577f6a9b84e2d42447dba0 ]
typeof is (still) a GNU extension, which means that it cannot be used when building ISO C (e.g. -std=c99). It should therefore be avoided in uapi headers in favour of the ISO-friendly __typeof__.
Unfortunately this issue could not be detected by CONFIG_UAPI_HEADER_TEST=y as the __ALIGN_KERNEL() macro is not expanded in any uapi header.
This matters from a userspace perspective, not a kernel one. uapi headers and their contents are expected to be usable in a variety of situations, and in particular when building ISO C applications (with -std=c99 or similar).
This particular problem can be reproduced by trying to use the __ALIGN_KERNEL macro directly in application code, say:
#include <linux/const.h>
int align(int x, int a)
{
return __KERNEL_ALIGN(x, a);
}and trying to build that with -std=c99.
--- include/uapi/linux/const.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/const.h +1 -1
@@ -28,7 +28,7 @@#define _BITUL (x) (_UL(1) << (x))#define _BITULL (x) (_ULL(1) << (x)) -#define __ALIGN_KERNEL (x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) +#define __ALIGN_KERNEL (x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1)#define __ALIGN_KERNEL_MASK (x, mask) (((x) + (mask)) & ~(mask))#define __KERNEL_DIV_ROUND_UP (n, d) (((n) + (d) - 1) / (d))
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 543/694 sh: sq: Fix incorrect element size for allocating bitmap buffer
In reply to Greg Kroah-HartmanFrom: John Paul Adrian Glaubitz <[email protected]>
[ Upstream commit 80f746e2bd0e1da3fdb49a53570e54a1a225faac ]
The Store Queue code allocates a bitmap buffer with the size of multiple of sizeof(long) in sq_api_init(). While the buffer size is calculated correctly, the code uses the wrong element size to allocate the buffer which results in the allocated bitmap buffer being too small.
Fix this by allocating the buffer with kcalloc() with element size sizeof(long) instead of kzalloc() whose elements size defaults to sizeof(char).
--- arch/sh/kernel/cpu/sh4/sq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/kernel/cpu/sh4/sq.c +1 -1
@@ -382,7 +382,7 @@ static int __init sq_api_init(void)if (unlikely (!sq_cache))return ret; - sq_bitmap =kzalloc (size,GFP_KERNEL ); + sq_bitmap =kcalloc (size,sizeof (long ),GFP_KERNEL );if (unlikely (!sq_bitmap)) goto out;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 544/694 usb: gadget: tegra-xudc: Fix crash in vbus_draw
In reply to Greg Kroah-HartmanFrom: Jon Hunter <[email protected]>
[ Upstream commit 5629d31955297ca47b9283c64fff70f2f34aa528 ]
Commit ac82b56bda5f ("usb: gadget: tegra-xudc: Add vbus_draw support") populated the vbus_draw callback for the Tegra XUDC driver. The function tegra_xudc_gadget_vbus_draw(), that was added by this commit, assumes that the pointer 'curr_usbphy' has been initialised, which is not always the case because this is only initialised when the USB role is updated. Fix this crash, by checking that the 'curr_usbphy' is valid before dereferencing.
--- drivers/usb/gadget/udc/tegra-xudc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/tegra-xudc.c +1 -1
@@ -2167,7 +2167,7 @@ static int tegra_xudc_gadget_vbus_draw(struct usb_gadget *gadget,dev_dbg (xudc->dev,"%s: %u mA\n" , __func__, m_a); -if (xudc->curr_usbphy->chg_type ==SDP_TYPE ) +if (xudc->curr_usbphy && xudc->curr_usbphy->chg_type ==SDP_TYPE ) ret =usb_phy_set_power (xudc->curr_usbphy, m_a);return ret;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 545/694 usb: chipidea: fix missing goto in `ci_hdrc_probe`
In reply to Greg Kroah-HartmanFrom: Yinhao Hu <[email protected]>
[ Upstream commit d6f712f53b79f5017cdcefafb7a5aea9ec52da5d ]
Quoted 1 line
From the comment of
ci_usb_phy_init, it returns an error code if
usb_phy_init has failed, and it should do some clean up, not just return directly.
Fix this by goto the error handling.
--- drivers/usb/chipidea/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/chipidea/core.c +1 -1
@@ -1108,7 +1108,7 @@ static int ci_hdrc_probe(struct platform_device *pdev) ret =ci_usb_phy_init (ci);if (ret) {dev_err (dev,"unable to init phy: %d\n" , ret); -return ret; + goto ulpi_exit; } ci->hw_bank.phys = res->start;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 546/694 usb: mtu3: fix kernel panic at qmu transfer done irq handler
In reply to Greg Kroah-HartmanFrom: Chunfeng Yun <[email protected]>
[ Upstream commit d28f4091ea7ec3510fd6a3c6d433234e7a2bef14 ]
When handle qmu transfer irq, it will unlock @mtu->lock before give back request, if another thread handle disconnect event at the same time, and try to disable ep, it may lock @mtu->lock and free qmu ring, then qmu irq hanlder may get a NULL gpd, avoid the KE by checking gpd's value before handling it.
e.g.
qmu done irq on cpu0 thread running on cpu1
qmu_done_tx()
handle gpd [0]
mtu3_requ_complete() mtu3_gadget_ep_disable()
unlock @mtu->lock
give back request lock @mtu->lock
mtu3_ep_disable()
mtu3_gpd_ring_free()
unlock @mtu->lock
lock @mtu->lock
get next gpd [1][1]: goto [0] to handle next gpd, and next gpd may be NULL.
--- drivers/usb/mtu3/mtu3_qmu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/usb/mtu3/mtu3_qmu.c +3 -2
@@ -210,6 +210,7 @@ static struct qmu_gpd *advance_enq_gpd(struct mtu3_gpd_ring *ring)return ring->enqueue; } +/* @dequeue may be NULL if ring is unallocated or freed */ static struct qmu_gpd *advance_deq_gpd (struct mtu3_gpd_ring *ring) {if (ring->dequeue < ring->end)
@@ -491,7 +492,7 @@ static void qmu_done_tx(struct mtu3 *mtu, u8 epnum)dev_dbg (mtu->dev,"%s EP%d, last=%p, current=%p, enq=%p\n" , __func__, epnum, gpd, gpd_current, ring->enqueue); -while (gpd != gpd_current && !GET_GPD_HWO (gpd)) { +while (gpd && gpd != gpd_current && !GET_GPD_HWO (gpd)) { mreq =next_request (mep);
@@ -530,7 +531,7 @@ static void qmu_done_rx(struct mtu3 *mtu, u8 epnum)dev_dbg (mtu->dev,"%s EP%d, last=%p, current=%p, enq=%p\n" , __func__, epnum, gpd, gpd_current, ring->enqueue); -while (gpd != gpd_current && !GET_GPD_HWO (gpd)) { +while (gpd && gpd != gpd_current && !GET_GPD_HWO (gpd)) { mreq =next_request (mep);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 547/694 firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit e1d6ca042e62c2a69513235f8629eb6e62ca79c5 ]
The svc_create_memory_pool() function returns error pointers. It never returns NULL. Fix the check.
--- drivers/firmware/stratix10-svc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/stratix10-svc.c +2 -2
@@ -1133,8 +1133,8 @@ static int stratix10_svc_drv_probe(struct platform_device *pdev)return ret; genpool =svc_create_memory_pool (pdev, sh_memory); -if (!genpool) -return -ENOMEM ; +if (IS_ERR (genpool)) +return PTR_ERR (genpool);/* allocate service controller and supporting channel */ controller =devm_kzalloc (dev,sizeof (*controller),GFP_KERNEL );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 548/694 tty: serial: fsl_lpuart: adjust buffer length to the intended size
In reply to Greg Kroah-HartmanFrom: Shenwei Wang <[email protected]>
[ Upstream commit f73fd750552524b06b5d77ebfdd106ccc8fcac61 ]
Based on the fls function definition provided below, we should not subtract 1 to obtain the correct buffer length:
fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
--- drivers/tty/serial/fsl_lpuart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/fsl_lpuart.c +1 -1
@@ -1296,7 +1296,7 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)* 10ms at any baud rate. */ sport->rx_dma_rng_buf_len = (DMA_RX_TIMEOUT * baud / bits /1000 ) *2 ; - sport->rx_dma_rng_buf_len = (1 << (fls (sport->rx_dma_rng_buf_len) -1 )); + sport->rx_dma_rng_buf_len = (1 <<fls (sport->rx_dma_rng_buf_len));if (sport->rx_dma_rng_buf_len <16 ) sport->rx_dma_rng_buf_len =16 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 549/694 serial: 8250: Add missing wakeup event reporting
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit 0ba9e3a13c6adfa99e32b2576d20820ab10ad48a ]
An 8250 UART configured as a wake-up source would not have reported itself through sysfs as being the source of wake-up, correct that.
--- drivers/tty/serial/8250/8250_port.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/tty/serial/8250/8250_port.c +4 -0
@@ -15,6 +15,7 @@#include <linux/moduleparam.h> #include <linux/ioport.h> #include <linux/init.h> +#include <linux/irq.h> #include <linux/console.h> #include <linux/gpio/consumer.h> #include <linux/sysrq.h>
@@ -1932,6 +1933,7 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)int serial8250_handle_irq (struct uart_port *port,unsigned int iir) {struct uart_8250_port *up =up_to_u8250p (port); +struct tty_port *tport = &port->state->port;bool skip_rx = false;unsigned long flags;u16 status;
@@ -1957,6 +1959,8 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) skip_rx = true;if (status & (UART_LSR_DR |UART_LSR_BI ) && !skip_rx) { +if (irqd_is_wakeup_set (irq_get_irq_data (port->irq))) +pm_wakeup_event (tport->tty->dev,0 );if (!up->dma ||handle_rx_dma (up, iir)) status =serial8250_rx_chars (up, status); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 550/694 spi: cadence-quadspi: use macro DEFINE_SIMPLE_DEV_PM_OPS
In reply to Greg Kroah-HartmanFrom: Dhruva Gole <[email protected]>
[ Upstream commit be3206e8906e7a93df673ab2e96d69304a008edc ]
Using this macro makes the code more readable.
It also inits the members of dev_pm_ops in the following manner without us explicitly needing to:
.suspend = cqspi_suspend, \
.resume = cqspi_resume, \
.freeze = cqspi_suspend, \
.thaw = cqspi_resume, \
.poweroff = cqspi_suspend, \
.restore = cqspi_resume
Also get rid of conditional compilation based on CONFIG_PM_SLEEP because it introduces build issues with certain configs when CQSPI_DEV_PM_OPS is just NULL.
--- drivers/spi/spi-cadence-quadspi.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/spi/spi-cadence-quadspi.c +2 -11
@@ -1802,7 +1802,6 @@ static int cqspi_remove(struct platform_return 0 ; } -#ifdef CONFIG_PM_SLEEP static int cqspi_suspend (struct device *dev) {struct cqspi_st *cqspi =dev_get_drvdata (dev);
@@ -1832,15 +1831,7 @@ static int cqspi_resume(struct device *dreturn spi_master_resume (master); } -static const struct dev_pm_ops cqspi__dev_pm_ops = { - .suspend = cqspi_suspend, - .resume = cqspi_resume, -}; - -#define CQSPI_DEV_PM_OPS (&cqspi__dev_pm_ops) -#else -#define CQSPI_DEV_PM_OPS NULL -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(cqspi_dev_pm_ops, cqspi_suspend, cqspi_resume);static const struct cqspi_driver_platdata cdns_qspi = { .quirks =CQSPI_DISABLE_DAC_MODE ,
@@ -1907,7 +1898,7 @@ static struct platform_driver cqspi_plat .remove = cqspi_remove, .driver = { .name = CQSPI_NAME, - .pm = CQSPI_DEV_PM_OPS, + .pm = &cqspi_dev_pm_ops, .of_match_table = cqspi_dt_ids, }, };
Greg Kroah-Hartman
maintainerPATCH 551/694 staging: rtl8192e: Fix W_DISABLE# does not work after stop/start
In reply to Greg Kroah-HartmanFrom: Philipp Hortmann <[email protected]>
[ Upstream commit 3fac2397f562eb669ddc2f45867a253f3fc26184 ]
When loading the driver for rtl8192e, the W_DISABLE# switch is working as intended. But when the WLAN is turned off in software and then turned on again the W_DISABLE# does not work anymore. Reason for this is that in the function _rtl92e_dm_check_rf_ctrl_gpio() the bfirst_after_down is checked and returned when true. bfirst_after_down is set true when switching the WLAN off in software. But it is not set to false again when WLAN is turned on again.
Add bfirst_after_down = false in _rtl92e_sta_up to reset bit and fix above described bug.
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -0
@@ -713,6 +713,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)else netif_wake_queue (dev); + priv->bfirst_after_down = false;return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 552/694 spmi: Add a check for remove callback when removing a SPMI driver
In reply to Greg Kroah-HartmanFrom: Jishnu Prakash <[email protected]>
[ Upstream commit b56eef3e16d888883fefab47425036de80dd38fc ]
When removing a SPMI driver, there can be a crash due to NULL pointer dereference if it does not have a remove callback defined. This is one such call trace observed when removing the QCOM SPMI PMIC driver:
dump_backtrace.cfi_jt+0x0/0x8 dump_stack_lvl+0xd8/0x16c panic+0x188/0x498 __cfi_slowpath+0x0/0x214 __cfi_slowpath+0x1dc/0x214 spmi_drv_remove+0x16c/0x1e0 device_release_driver_internal+0x468/0x79c driver_detach+0x11c/0x1a0 bus_remove_driver+0xc4/0x124 driver_unregister+0x58/0x84 cleanup_module+0x1c/0xc24 [qcom_spmi_pmic] __do_sys_delete_module+0x3ec/0x53c __arm64_sys_delete_module+0x18/0x28 el0_svc_common+0xdc/0x294 el0_svc+0x38/0x9c el0_sync_handler+0x8c/0xf0 el0_sync+0x1b4/0x1c0
If a driver has all its resources allocated through devm_() APIs and does not need any other explicit cleanup, it would not require a remove callback to be defined. Hence, add a check for remove callback presence before calling it when removing a SPMI driver.
--- drivers/spmi/spmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/spmi/spmi.c +2 -1
@@ -350,7 +350,8 @@ static void spmi_drv_remove(struct device *dev)const struct spmi_driver *sdrv =to_spmi_driver (dev->driver);pm_runtime_get_sync (dev); - sdrv->remove (to_spmi_device (dev)); +if (sdrv->remove) + sdrv->remove (to_spmi_device (dev));pm_runtime_put_noidle (dev);pm_runtime_disable (dev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 553/694 vdpa/mlx5: Avoid losing link state updates
In reply to Greg Kroah-HartmanFrom: Eli Cohen <[email protected]>
[ Upstream commit c384c2401eed99a2e1f84191e573f15b898babe6 ]
Current code ignores link state updates if VIRTIO_NET_F_STATUS was not negotiated. However, link state updates could be received before feature negotiation was completed , therefore causing link state events to be lost, possibly leaving the link state down.
Modify the code so link state notifier is registered after DRIVER_OK was negotiated and carry the registration only if VIRTIO_NET_F_STATUS was negotiated. Unregister the notifier when the device is reset.
Message-Id: <[email protected]>
--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 203 +++++++++++++++++------------- 1 file changed, 114 insertions(+), 89 deletions(-)
drivers/vdpa/mlx5/net/mlx5_vnet.c +114 -89
@@ -2298,6 +2298,113 @@ static void update_cvq_info(struct mlx5_vdpa_dev *mvdev) } } +static u8 query_vport_state (struct mlx5_core_dev *mdev,u8 opmod,u16 vport) +{ +u32 out[MLX5_ST_SZ_DW (query_vport_state_out)] = {}; +u32 in[MLX5_ST_SZ_DW (query_vport_state_in)] = {}; +int err; + +MLX5_SET (query_vport_state_in, in, opcode,MLX5_CMD_OP_QUERY_VPORT_STATE ); +MLX5_SET (query_vport_state_in, in, op_mod, opmod); +MLX5_SET (query_vport_state_in, in, vport_number, vport); +if (vport) +MLX5_SET (query_vport_state_in, in, other_vport,1 ); + + err =mlx5_cmd_exec_inout (mdev, query_vport_state, in, out); +if (err) +return 0 ; + +return MLX5_GET (query_vport_state_out, out, state); +} + +static bool get_link_state (struct mlx5_vdpa_dev *mvdev) +{ +if (query_vport_state (mvdev->mdev,MLX5_VPORT_STATE_OP_MOD_VNIC_VPORT ,0 ) == +VPORT_STATE_UP ) +return true; + +return false; +} + +static void update_carrier (struct work_struct *work) +{ +struct mlx5_vdpa_wq_ent *wqent; +struct mlx5_vdpa_dev *mvdev; +struct mlx5_vdpa_net *ndev; + + wqent = container_of(work, struct mlx5_vdpa_wq_ent, work); + mvdev = wqent->mvdev; + ndev =to_mlx5_vdpa_ndev (mvdev); +if (get_link_state (mvdev)) + ndev->config.status |=cpu_to_mlx5vdpa16 (mvdev,VIRTIO_NET_S_LINK_UP ); +else + ndev->config.status &=cpu_to_mlx5vdpa16 (mvdev, ~VIRTIO_NET_S_LINK_UP ); + +if (ndev->config_cb.callback) + ndev->config_cb.callback (ndev->config_cb.private); + +kfree (wqent); +} + +static int queue_link_work (struct mlx5_vdpa_net *ndev) +{ +struct mlx5_vdpa_wq_ent *wqent; + + wqent =kzalloc (sizeof (*wqent),GFP_ATOMIC ); +if (!wqent) +return -ENOMEM ; + + wqent->mvdev = &ndev->mvdev; +INIT_WORK (&wqent->work, update_carrier); +queue_work (ndev->mvdev.wq, &wqent->work); +return 0 ; +} + +static int event_handler (struct notifier_block *nb,unsigned long event,void *param) +{ + struct mlx5_vdpa_net *ndev = container_of(nb, struct mlx5_vdpa_net, nb); +struct mlx5_eqe *eqe = param; +int ret =NOTIFY_DONE ; + +if (event ==MLX5_EVENT_TYPE_PORT_CHANGE ) { +switch (eqe->sub_type) { +case MLX5_PORT_CHANGE_SUBTYPE_DOWN : +case MLX5_PORT_CHANGE_SUBTYPE_ACTIVE : +if (queue_link_work (ndev)) +return NOTIFY_DONE ; + + ret =NOTIFY_OK ; +break ; +default : +return NOTIFY_DONE ; + } +return ret; + } +return ret; +} + +static void register_link_notifier (struct mlx5_vdpa_net *ndev) +{ +if (!(ndev->mvdev.actual_features &BIT_ULL (VIRTIO_NET_F_STATUS ))) +return ; + + ndev->nb.notifier_call = event_handler; +mlx5_notifier_register (ndev->mvdev.mdev, &ndev->nb); + ndev->nb_registered = true; +queue_link_work (ndev); +} + +static void unregister_link_notifier (struct mlx5_vdpa_net *ndev) +{ +if (!ndev->nb_registered) +return ; + + ndev->nb_registered = false; +mlx5_notifier_unregister (ndev->mvdev.mdev, &ndev->nb); +if (ndev->mvdev.wq) +flush_workqueue (ndev->mvdev.wq); +} +static int mlx5_vdpa_set_driver_features (struct vdpa_device *vdev,u64 features) {struct mlx5_vdpa_dev *mvdev =to_mvdev (vdev);
@@ -2567,10 +2674,11 @@ static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status)mlx5_vdpa_warn (mvdev,"failed to setup control VQ vring\n" ); goto err_setup; } +register_link_notifier (ndev); err =setup_driver (mvdev);if (err) {mlx5_vdpa_warn (mvdev,"failed to setup driver\n" ); - goto err_setup; + goto err_driver; } }else {mlx5_vdpa_warn (mvdev,"did not expect DRIVER_OK to be cleared\n" );
@@ -2582,6 +2690,8 @@ static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status)up_write (&ndev->reslock);return ; +err_driver: +unregister_link_notifier (ndev); err_setup:mlx5_vdpa_destroy_mr (&ndev->mvdev); ndev->mvdev.status |=VIRTIO_CONFIG_S_FAILED ;
@@ -2607,6 +2717,7 @@ static int mlx5_vdpa_reset(struct vdpa_device *vdev)mlx5_vdpa_info (mvdev,"performing device reset\n" );down_write (&ndev->reslock); +unregister_link_notifier (ndev);teardown_driver (ndev);clear_vqs_ready (ndev);mlx5_vdpa_destroy_mr (&ndev->mvdev);
@@ -2861,9 +2972,7 @@ static int mlx5_vdpa_suspend(struct vdpa_device *vdev)mlx5_vdpa_info (mvdev,"suspending device\n" );down_write (&ndev->reslock); - ndev->nb_registered = false; -mlx5_notifier_unregister (mvdev->mdev, &ndev->nb); -flush_workqueue (ndev->mvdev.wq); +unregister_link_notifier (ndev);for (i =0 ; i < ndev->cur_num_vqs; i++) { mvq = &ndev->vqs[i];suspend_vq (ndev, mvq);
@@ -3000,84 +3109,6 @@ struct mlx5_vdpa_mgmtdev {struct mlx5_vdpa_net *ndev; }; -static u8 query_vport_state (struct mlx5_core_dev *mdev,u8 opmod,u16 vport) -{ -u32 out[MLX5_ST_SZ_DW (query_vport_state_out)] = {}; -u32 in[MLX5_ST_SZ_DW (query_vport_state_in)] = {}; -int err; - -MLX5_SET (query_vport_state_in, in, opcode,MLX5_CMD_OP_QUERY_VPORT_STATE ); -MLX5_SET (query_vport_state_in, in, op_mod, opmod); -MLX5_SET (query_vport_state_in, in, vport_number, vport); -if (vport) -MLX5_SET (query_vport_state_in, in, other_vport,1 ); - - err =mlx5_cmd_exec_inout (mdev, query_vport_state, in, out); -if (err) -return 0 ; - -return MLX5_GET (query_vport_state_out, out, state); -} - -static bool get_link_state (struct mlx5_vdpa_dev *mvdev) -{ -if (query_vport_state (mvdev->mdev,MLX5_VPORT_STATE_OP_MOD_VNIC_VPORT ,0 ) == -VPORT_STATE_UP ) -return true; - -return false; -} - -static void update_carrier (struct work_struct *work) -{ -struct mlx5_vdpa_wq_ent *wqent; -struct mlx5_vdpa_dev *mvdev; -struct mlx5_vdpa_net *ndev; - - wqent = container_of(work, struct mlx5_vdpa_wq_ent, work); - mvdev = wqent->mvdev; - ndev =to_mlx5_vdpa_ndev (mvdev); -if (get_link_state (mvdev)) - ndev->config.status |=cpu_to_mlx5vdpa16 (mvdev,VIRTIO_NET_S_LINK_UP ); -else - ndev->config.status &=cpu_to_mlx5vdpa16 (mvdev, ~VIRTIO_NET_S_LINK_UP ); - -if (ndev->nb_registered && ndev->config_cb.callback) - ndev->config_cb.callback (ndev->config_cb.private); - -kfree (wqent); -} - -static int event_handler (struct notifier_block *nb,unsigned long event,void *param) -{ - struct mlx5_vdpa_net *ndev = container_of(nb, struct mlx5_vdpa_net, nb); -struct mlx5_eqe *eqe = param; -int ret =NOTIFY_DONE ; -struct mlx5_vdpa_wq_ent *wqent; - -if (event ==MLX5_EVENT_TYPE_PORT_CHANGE ) { -if (!(ndev->mvdev.actual_features &BIT_ULL (VIRTIO_NET_F_STATUS ))) -return NOTIFY_DONE ; -switch (eqe->sub_type) { -case MLX5_PORT_CHANGE_SUBTYPE_DOWN : -case MLX5_PORT_CHANGE_SUBTYPE_ACTIVE : - wqent =kzalloc (sizeof (*wqent),GFP_ATOMIC ); -if (!wqent) -return NOTIFY_DONE ; - - wqent->mvdev = &ndev->mvdev; -INIT_WORK (&wqent->work, update_carrier); -queue_work (ndev->mvdev.wq, &wqent->work); - ret =NOTIFY_OK ; -break ; -default : -return NOTIFY_DONE ; - } -return ret; - } -return ret; -} -static int config_func_mtu (struct mlx5_core_dev *mdev,u16 mtu) {int inlen =MLX5_ST_SZ_BYTES (modify_nic_vport_context_in);
@@ -3258,9 +3289,6 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name, goto err_res2; } - ndev->nb.notifier_call = event_handler; -mlx5_notifier_register (mdev, &ndev->nb); - ndev->nb_registered = true; mvdev->vdev.mdev = &mgtdev->mgtdev; err =_vdpa_register_device (&mvdev->vdev, max_vqs +1 );if (err)
@@ -3294,10 +3322,7 @@ static void mlx5_vdpa_dev_del(struct vdpa_mgmt_dev *v_mdev, struct vdpa_device *mlx5_vdpa_remove_debugfs (ndev->debugfs); ndev->debugfs =NULL ; -if (ndev->nb_registered) { - ndev->nb_registered = false; -mlx5_notifier_unregister (mvdev->mdev, &ndev->nb); - } +unregister_link_notifier (ndev); wq = mvdev->wq; mvdev->wq =NULL ;destroy_workqueue (wq);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 554/694 virtio_ring: dont update event idx on get_buf
In reply to Greg Kroah-HartmanFrom: Albert Huang <[email protected]>
[ Upstream commit 6c0b057cec5eade4c3afec3908821176931a9997 ]
In virtio_net, if we disable napi_tx, when we trigger a tx interrupt, the vq->event_triggered will be set to true. It is then never reset until we explicitly call virtqueue_enable_cb_delayed or virtqueue_enable_cb_prepare.
If we disable the napi_tx, virtqueue_enable_cb* will only be called when the tx ring is getting relatively empty.
Since event_triggered is true, VRING_AVAIL_F_NO_INTERRUPT or VRING_PACKED_EVENT_FLAG_DISABLE will not be set. As a result we update vring_used_event(&vq->split.vring) or vq->packed.vring.driver->off_wrap every time we call virtqueue_get_buf_ctx. This causes more interrupts.
To summarize:
1) event_triggered was set to true in vring_interrupt()
2) after this nothing will happen in virtqueue_disable_cb() so VRING_AVAIL_F_NO_INTERRUPT is not set in avail_flags_shadow
3) virtqueue_get_buf_ctx_split() will still think the cb is enabled and then it will publish a new event index
To fix:
update VRING_AVAIL_F_NO_INTERRUPT or VRING_PACKED_EVENT_FLAG_DISABLE in the vq when we call virtqueue_disable_cb even when event_triggered is true.
Tested with iperf:
iperf3 tcp stream:
vm1 -----------------> vm2
vm2 just receives tcp data stream from vm1, and sends acks to vm1, there are many tx interrupts in vm2.
with the patch applied there are just a few tx interrupts.
v2->v3:
-update the interrupt disable flag even with the event_triggered is set, -instead of checking whether event_triggered is set in -virtqueue_get_buf_ctx_{packed/split}, will cause the drivers which have -not called virtqueue_{enable/disable}_cb to miss notifications.
v3->v4:
-remove change for
-"if (vq->packed.event_flags_shadow != VRING_PACKED_EVENT_FLAG_DISABLE)" -in virtqueue_disable_cb_packed
Message-Id: <[email protected]>
--- drivers/virtio/virtio_ring.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-)
drivers/virtio/virtio_ring.c +16 -6
@@ -854,6 +854,14 @@ static void virtqueue_disable_cb_split(struct virtqueue *_vq)if (!(vq->split.avail_flags_shadow &VRING_AVAIL_F_NO_INTERRUPT )) { vq->split.avail_flags_shadow |=VRING_AVAIL_F_NO_INTERRUPT ; + +/* +* If device triggered an event already it won't trigger one again: +* no need to disable. +*/ +if (vq->event_triggered) +return ; +if (vq->event)/* TODO: this is a hack. Figure out a cleaner value to write. */ vring_used_event (&vq->split.vring) =0x0 ;
@@ -1699,6 +1707,14 @@ static void virtqueue_disable_cb_packed(struct virtqueue *_vq)if (vq->packed.event_flags_shadow !=VRING_PACKED_EVENT_FLAG_DISABLE ) { vq->packed.event_flags_shadow =VRING_PACKED_EVENT_FLAG_DISABLE ; + +/* +* If device triggered an event already it won't trigger one again: +* no need to disable. +*/ +if (vq->event_triggered) +return ; + vq->packed.vring.driver->flags =cpu_to_le16 (vq->packed.event_flags_shadow); }
@@ -2330,12 +2346,6 @@ void virtqueue_disable_cb(struct virtqueue *_vq) {struct vring_virtqueue *vq =to_vvq (_vq); -/* If device triggered an event already it won't trigger one again: -* no need to disable. -*/ -if (vq->event_triggered) -return ; -if (vq->packed_ring)virtqueue_disable_cb_packed (_vq);else
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 555/694 spi: bcm63xx: remove PM_SLEEP based conditional compilation
In reply to Greg Kroah-HartmanFrom: Dhruva Gole <[email protected]>
[ Upstream commit 25f0617109496e1aff49594fbae5644286447a0f ]
Get rid of conditional compilation based on CONFIG_PM_SLEEP because it may introduce build issues with certain configs where it maybe disabled This is because if above config is not enabled the suspend-resume functions are never part of the code but the bcm63xx_spi_pm_ops struct still inits them to non-existent suspend-resume functions.
--- drivers/spi/spi-bcm63xx.c | 2 -- 1 file changed, 2 deletions(-)
drivers/spi/spi-bcm63xx.c +0 -2
@@ -629,7 +629,6 @@ static int bcm63xx_spi_remove(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM_SLEEP static int bcm63xx_spi_suspend (struct device *dev) {struct spi_master *master =dev_get_drvdata (dev);
@@ -656,7 +655,6 @@ static int bcm63xx_spi_resume(struct device *dev)return 0 ; } -#endif static const struct dev_pm_ops bcm63xx_spi_pm_ops = {SET_SYSTEM_SLEEP_PM_OPS (bcm63xx_spi_suspend, bcm63xx_spi_resume)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 556/694 fbdev: mmp: Fix deferred clk handling in mmphw_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit b3a7a9ab65ae2f2626c7222fb79cdd433f8c5252 ]
When dev_err_probe() is called, 'ret' holds the value of the previous successful devm_request_irq() call.
'ret' should be assigned with a meaningful value before being used in dev_err_probe().
While at it, use and return "PTR_ERR(ctrl->clk)" instead of a hard-coded "-ENOENT" so that -EPROBE_DEFER is handled and propagated correctly.
--- drivers/video/fbdev/mmp/hw/mmp_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/mmp/hw/mmp_ctrl.c +1 -1
@@ -514,9 +514,9 @@ static int mmphw_probe(struct platform_device *pdev)/* get clock */ ctrl->clk =devm_clk_get (ctrl->dev, mi->clk_name);if (IS_ERR (ctrl->clk)) { + ret =PTR_ERR (ctrl->clk);dev_err_probe (ctrl->dev, ret,"unable to get clk %s\n" , mi->clk_name); - ret = -ENOENT ; goto failed; }clk_prepare_enable (ctrl->clk);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 557/694 selftests/powerpc/pmu: Fix sample field check in the mmcra_thresh_marked_sample_test
In reply to Greg Kroah-HartmanFrom: Kajol Jain <[email protected]>
[ Upstream commit 8a32341cf04ba05974931b4664683c2c9fb84e56 ]
The testcase verifies the setting of different fields in Monitor Mode Control Register A (MMCRA). In the current code, EV_CODE_EXTRACT macro is used to extract the "sample" field, which then needs to be further processed to fetch rand_samp_elig and rand_samp_mode bits. But the current code is not passing valid sample field to EV_CODE_EXTRACT macro. Patch addresses this by fixing the input for EV_CODE_EXTRACT.
--- .../pmu/sampling_tests/mmcra_thresh_marked_sample_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/powerpc/pmu/sampling_tests/mmcra_thresh_marked_sample_test.c +2 -2
@@ -63,9 +63,9 @@ static int mmcra_thresh_marked_sample(void) get_mmcra_thd_stop(get_reg_value(intr_regs, "MMCRA"), 4));FAIL_IF (EV_CODE_EXTRACT (event.attr.config, marked) !=get_mmcra_marked (get_reg_value (intr_regs,"MMCRA" ),4 )); -FAIL_IF (EV_CODE_EXTRACT (event.attr.config, sample >>2 ) != +FAIL_IF ((EV_CODE_EXTRACT (event.attr.config, sample) >>2 ) !=get_mmcra_rand_samp_elig (get_reg_value (intr_regs,"MMCRA" ),4 )); -FAIL_IF (EV_CODE_EXTRACT (event.attr.config, sample &0x3 ) != +FAIL_IF ((EV_CODE_EXTRACT (event.attr.config, sample) &0x3 ) !=get_mmcra_sample_mode (get_reg_value (intr_regs,"MMCRA" ),4 ));FAIL_IF (EV_CODE_EXTRACT (event.attr.config, sm) !=get_mmcra_sm (get_reg_value (intr_regs,"MMCRA" ),4 ));
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 558/694 macintosh/windfarm_smu_sat: Add missing of_node_put()
In reply to Greg Kroah-HartmanFrom: Liang He <[email protected]>
[ Upstream commit 631cf002826007ab7415258ee647dcaf8845ad5a ]
We call of_node_get() in wf_sat_probe() after sat is created, so we need the of_node_put() before *kfree(sat)*.
--- drivers/macintosh/windfarm_smu_sat.c | 1 + 1 file changed, 1 insertion(+)
drivers/macintosh/windfarm_smu_sat.c +1 -0
@@ -171,6 +171,7 @@ static void wf_sat_release(struct kref *ref)if (sat->nr >=0 ) sats[sat->nr] =NULL ; +of_node_put (sat->node);kfree (sat); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 559/694 powerpc/perf: Properly detect mpc7450 family
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
[ Upstream commit e7299f961fe5e4496db0bfaa9e819f5e97f3846b ]
Unlike PVR_POWER8, etc ...., PVR_7450 represents a full PVR value and not a family value.
To avoid confusion, do like E500 family and define the relevant PVR_VER_xxxx values for the 7450 family:
0x8000 ==> 7450
0x8001 ==> 7455
0x8002 ==> 7447
0x8003 ==> 7447A
0x8004 ==> 7448
And use them to detect 7450 family for perf events.
--- arch/powerpc/include/asm/reg.h | 5 +++++ arch/powerpc/perf/mpc7450-pmu.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/reg.h +5 -0
@@ -1310,6 +1310,11 @@#define PVR_VER_E500MC 0x8023#define PVR_VER_E5500 0x8024#define PVR_VER_E6500 0x8040 +#define PVR_VER_7450 0x8000 +#define PVR_VER_7455 0x8001 +#define PVR_VER_7447 0x8002 +#define PVR_VER_7447A 0x8003 +#define PVR_VER_7448 0x8004/* * For the 8xx processors, all of them report the same PVR family for
arch/powerpc/perf/mpc7450-pmu.c +3 -3
@@ -417,9 +417,9 @@ struct power_pmu mpc7450_pmu = {static int __init init_mpc7450_pmu (void ) { -unsigned int pvr =mfspr (SPRN_PVR ); - -if (PVR_VER (pvr) !=PVR_7450 ) +if (!pvr_version_is (PVR_VER_7450 ) && !pvr_version_is (PVR_VER_7455 ) && + !pvr_version_is (PVR_VER_7447 ) && !pvr_version_is (PVR_VER_7447A ) && + !pvr_version_is (PVR_VER_7448 ))return -ENODEV ;return register_power_pmu (&mpc7450_pmu);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 560/694 powerpc/mpc512x: fix resource printk format warning
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 7538c97e2b80ff6b7a8ea2ecf16a04355461b439 ]
Use "%pa" format specifier for resource_size_t to avoid a compiler printk format warning.
../arch/powerpc/platforms/512x/clock-commonclk.c: In function 'mpc5121_clk_provide_backwards_compat':../arch/powerpc/platforms/512x/clock-commonclk.c:989:44: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]
989 | snprintf(devname, sizeof(devname), "%08x.%s", res.start, np->name); \
| ^~~~~~~~~ ~~~~~~~~~
| |
| resource_size_t {aka long long unsigned int}Prevents 24 such warnings.
--- arch/powerpc/platforms/512x/clock-commonclk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/512x/clock-commonclk.c +1 -1
@@ -986,7 +986,7 @@ static void __init mpc5121_clk_provide_migration_support(void)#define NODE_PREP do { \ of_address_to_resource(np, 0, &res); \ - snprintf(devname, sizeof(devname), "%08x.%s", res.start, np->name); \ + snprintf(devname, sizeof(devname), "%pa.%s", &res.start, np->name); \ } while (0)#define NODE_CHK (clkname, clkitem, regnode, regflag) do { \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 561/694 powerpc/wii: fix resource printk format warnings
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 7b69600d4da0049244e9be2f5ef5a2f8e04fcd9a ]
Use "%pa" format specifier for resource_size_t to avoid compiler printk format warnings.
../arch/powerpc/platforms/embedded6xx/flipper-pic.c: In function 'flipper_pic_init':../include/linux/kern_levels.h:5:25: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] ../arch/powerpc/platforms/embedded6xx/flipper-pic.c:148:9: note: in expansion of macro 'pr_info'
148 | pr_info("controller at 0x%08x mapped to 0x%p\n", res.start, io_base);
| ^~~~~~~../arch/powerpc/platforms/embedded6xx/hlwd-pic.c: In function 'hlwd_pic_init':../include/linux/kern_levels.h:5:25: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] ../arch/powerpc/platforms/embedded6xx/hlwd-pic.c:174:9: note: in expansion of macro 'pr_info'
174 | pr_info("controller at 0x%08x mapped to 0x%p\n", res.start, io_base);
| ^~~~~~~../arch/powerpc/platforms/embedded6xx/wii.c: In function 'wii_ioremap_hw_regs':../include/linux/kern_levels.h:5:25: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] ../arch/powerpc/platforms/embedded6xx/wii.c:77:17: note: in expansion of macro 'pr_info'
77 | pr_info("%s at 0x%08x mapped to 0x%p\n", name,
| ^~~~~~~--- arch/powerpc/platforms/embedded6xx/flipper-pic.c | 2 +- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 2 +- arch/powerpc/platforms/embedded6xx/wii.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/embedded6xx/flipper-pic.c +1 -1
@@ -145,7 +145,7 @@ static struct irq_domain * __init flipper_pic_init(struct device_node *np) } io_base =ioremap (res.start,resource_size (&res)); -pr_info ("controller at 0x%08x mapped to 0x%p\n" , res.start, io_base); +pr_info ("controller at 0x%pa mapped to 0x%p\n" , &res.start, io_base);__flipper_quiesce (io_base);
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +1 -1
@@ -171,7 +171,7 @@ static struct irq_domain *__init hlwd_pic_init(struct device_node *np)return NULL ; } -pr_info ("controller at 0x%08x mapped to 0x%p\n" , res.start, io_base); +pr_info ("controller at 0x%pa mapped to 0x%p\n" , &res.start, io_base);__hlwd_quiesce (io_base);
arch/powerpc/platforms/embedded6xx/wii.c +2 -2
@@ -74,8 +74,8 @@ static void __iomem *__init wii_ioremap_hw_regs(char *name, char *compatible) hw_regs =ioremap (res.start,resource_size (&res));if (hw_regs) { -pr_info ("%s at 0x%08x mapped to 0x%p\n" , name, - res.start, hw_regs); +pr_info ("%s at 0x%pa mapped to 0x%p\n" , name, + &res.start, hw_regs); } out_put:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 562/694 powerpc/sysdev/tsi108: fix resource printk format warnings
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 55d8bd02cc1b9f1063993b5c42c9cabf4af67dea ]
Use "%pa" format specifier for resource_size_t to avoid a compiler printk format warning.
arch/powerpc/sysdev/tsi108_pci.c: In function 'tsi108_setup_pci':
include/linux/kern_levels.h:5:25: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t'
--- arch/powerpc/sysdev/tsi108_pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/powerpc/sysdev/tsi108_pci.c +2 -3
@@ -217,9 +217,8 @@ int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary) (hose)->ops = &tsi108_direct_pci_ops; -printk (KERN_INFO "Found tsi108 PCI host bridge at 0x%08x. " -"Firmware bus number: %d->%d\n" , - rsrc.start, hose->first_busno, hose->last_busno); +pr_info ("Found tsi108 PCI host bridge at 0x%pa. Firmware bus number: %d->%d\n" , + &rsrc.start, hose->first_busno, hose->last_busno);/* Interpret the "ranges" property */ /* This also maps the I/O region and sets isa_io/mem_base */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 563/694 macintosh: via-pmu-led: requires ATA to be set
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 05dce4ba125336875cd3eed3c1503fa81cd2f691 ]
LEDS_TRIGGER_DISK depends on ATA, so selecting LEDS_TRIGGER_DISK when ATA is not set/enabled causes a Kconfig warning:
WARNING: unmet direct dependencies detected for LEDS_TRIGGER_DISK
Depends on [n]: NEW_LEDS [=y] && LEDS_TRIGGERS [=y] && ATA [=n]
Selected by [y]:
- ADB_PMU_LED_DISK [=y] && MACINTOSH_DRIVERS [=y] && ADB_PMU_LED [=y] && LEDS_CLASS [=y]
Fix this by making ADB_PMU_LED_DISK depend on ATA.
Seen on both PPC32 and PPC64.
--- drivers/macintosh/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/macintosh/Kconfig +1 -0
@@ -86,6 +86,7 @@ config ADB_PMU_LED config ADB_PMU_LED_DISK bool "Use front LED as DISK LED by default" + depends on ATA depends on ADB_PMU_LED depends on LEDS_CLASS select LEDS_TRIGGERS
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 564/694 powerpc/rtas: use memmove for potentially overlapping buffer copy
In reply to Greg Kroah-HartmanFrom: Nathan Lynch <[email protected]>
[ Upstream commit 271208ee5e335cb1ad280d22784940daf7ddf820 ]
Using memcpy() isn't safe when buf is identical to rtas_err_buf, which can happen during boot before slab is up. Full context which may not be obvious from the diff:
if (altbuf) {
buf = altbuf;
} else {
buf = rtas_err_buf;
if (slab_is_available())
buf = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC);
}
if (buf)
memcpy(buf, rtas_err_buf, RTAS_ERROR_LOG_MAX);This was found by inspection and I'm not aware of it causing problems in practice. It appears to have been introduced by commit 033ef338b6e0 ("powerpc: Merge rtas.c into arch/powerpc/kernel"); the old ppc64 version of this code did not have this problem.
Use memmove() instead.
--- arch/powerpc/kernel/rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/rtas.c +1 -1
@@ -981,7 +981,7 @@ static char *__fetch_rtas_last_error(char *altbuf) buf =kmalloc (RTAS_ERROR_LOG_MAX ,GFP_ATOMIC ); }if (buf) -memcpy (buf, rtas_err_buf,RTAS_ERROR_LOG_MAX ); +memmove (buf, rtas_err_buf,RTAS_ERROR_LOG_MAX ); }return buf;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 565/694 sched/fair: Fix inaccurate tally of ttwu_move_affine
In reply to Greg Kroah-HartmanFrom: Libo Chen <[email protected]>
[ Upstream commit 39afe5d6fc59237ff7738bf3ede5a8856822d59d ]
There are scenarios where non-affine wakeups are incorrectly counted as affine wakeups by schedstats.
When wake_affine_idle() returns prev_cpu which doesn't equal to nr_cpumask_bits, it will slip through the check: target == nr_cpumask_bits in wake_affine() and be counted as if target == this_cpu in schedstats.
Replace target == nr_cpumask_bits with target != this_cpu to make sure affine wakeups are accurately tallied.
--- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -6614,7 +6614,7 @@ static int wake_affine(struct sched_domain *sd, struct task_struct *p, target =wake_affine_weight (sd, p, this_cpu, prev_cpu, sync);schedstat_inc (p->stats.nr_wakeups_affine_attempts); -if (target == nr_cpumask_bits) +if (target != this_cpu)return prev_cpu;schedstat_inc (sd->ttwu_move_affine);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 566/694 perf/core: Fix hardlockup failure caused by perf throttle
In reply to Greg Kroah-HartmanFrom: Yang Jihong <[email protected]>
[ Upstream commit 15def34e2635ab7e0e96f1bc32e1b69609f14942 ]
commit e050e3f0a71bf ("perf: Fix broken interrupt rate throttling") introduces a change in throttling threshold judgment. Before this, compare hwc->interrupts and max_samples_per_tick, then increase hwc->interrupts by 1, but this commit reverses order of these two behaviors, causing the semantics of max_samples_per_tick to change. In literal sense of "max_samples_per_tick", if hwc->interrupts == max_samples_per_tick, it should not be throttled, therefore, the judgment condition should be changed to "hwc->interrupts > max_samples_per_tick".
In fact, this may cause the hardlockup to fail, The minimum value of max_samples_per_tick may be 1, in this case, the return value of __perf_event_account_interrupt function is 1.
As a result, nmi_watchdog gets throttled, which would stop PMU (Use x86 architecture as an example, see x86_pmu_handle_irq).
--- kernel/events/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/core.c +2 -2
@@ -9433,8 +9433,8 @@ __perf_event_account_interrupt(struct perf_event *event, int throttle) hwc->interrupts =1 ; }else { hwc->interrupts++; -if (unlikely (throttle - && hwc->interrupts >= max_samples_per_tick)) { +if (unlikely (throttle && + hwc->interrupts > max_samples_per_tick)) {__this_cpu_inc (perf_throttled_count);tick_dep_set_cpu (smp_processor_id (),TICK_DEP_BIT_PERF_EVENTS ); hwc->interrupts =MAX_INTERRUPTS ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 567/694 Revert "objtool: Support addition to set CFA base"
In reply to Greg Kroah-HartmanFrom: Josh Poimboeuf <[email protected]>
[ Upstream commit e18398e80c73e3cc7d9c3d2e0bc06a4af8f4f1cb ]
Commit 468af56a7bba ("objtool: Support addition to set CFA base") was added as a preparatory patch for arm64 support, but that support never came. It triggers a false positive warning on x86, so just revert it for now.
Fixes the following warning:
vmlinux.o: warning: objtool: cdce925_regmap_i2c_write+0xdb: stack state mismatch: cfa1=4+120 cfa2=5+40
--- tools/objtool/check.c | 11 ----------- 1 file changed, 11 deletions(-)
tools/objtool/check.c +0 -11
@@ -2976,17 +2976,6 @@ static int update_cfi_state(struct instruction *insn,break ; } -if (!cfi->drap && op->src.reg ==CFI_SP && - op->dest.reg ==CFI_BP && cfa->base ==CFI_SP && -check_reg_frame_pos (®s[CFI_BP ], -cfa->offset + op->src.offset)) { - -/* lea disp(%rsp), %rbp */ - cfa->base =CFI_BP ; - cfa->offset -= op->src.offset; - cfi->bp_scratch = false; -break ; - } -if (op->src.reg ==CFI_SP && cfa->base ==CFI_SP ) {/* drap: lea disp(%rsp), %drap */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 568/694 riscv: Fix ptdump when KASAN is enabled
In reply to Greg Kroah-HartmanFrom: Alexandre Ghiti <[email protected]>
[ Upstream commit ecd7ebaf0b5a094a6180b299a5635c0eea42be4b ]
The KASAN shadow region was moved next to the kernel mapping but the ptdump code was not updated and it appears to break the dump of the kernel page table, so fix this by moving the KASAN shadow region in ptdump.
--- arch/riscv/mm/ptdump.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
arch/riscv/mm/ptdump.c +12 -12
@@ -59,10 +59,6 @@ struct ptd_mm_info { };enum address_markers_idx { -#ifdef CONFIG_KASAN -KASAN_SHADOW_START_NR , -KASAN_SHADOW_END_NR , -#endif FIXMAP_START_NR ,FIXMAP_END_NR ,PCI_IO_START_NR ,
@@ -74,6 +70,10 @@ enum address_markers_idx {VMALLOC_START_NR ,VMALLOC_END_NR ,PAGE_OFFSET_NR , +#ifdef CONFIG_KASAN +KASAN_SHADOW_START_NR , +KASAN_SHADOW_END_NR , +#endif #ifdef CONFIG_64BITMODULES_MAPPING_NR , KERNEL_MAPPING_NR,
@@ -82,10 +82,6 @@ enum address_markers_idx { };static struct addr_marker address_markers[] = { -#ifdef CONFIG_KASAN - {0, "Kasan shadow start"}, - {0, "Kasan shadow end"}, -#endif {0 ,"Fixmap start" }, {0 ,"Fixmap end" }, {0 ,"PCI I/O start" },
@@ -97,6 +93,10 @@ static struct addr_marker address_markers[] = { {0, "vmalloc() area"}, {0, "vmalloc() end"}, {0, "Linear mapping"}, +#ifdef CONFIG_KASAN + {0, "Kasan shadow start"}, + {0, "Kasan shadow end"}, +#endif #ifdef CONFIG_64BIT {0, "Modules/BPF mapping"}, {0, "Kernel mapping"},
@@ -362,10 +362,6 @@ static int __init ptdump_init(void) {unsigned int i, j; -#ifdef CONFIG_KASAN - address_markers[KASAN_SHADOW_START_NR ].start_address =KASAN_SHADOW_START ; - address_markers[KASAN_SHADOW_END_NR ].start_address =KASAN_SHADOW_END ; -#endif address_markers[FIXMAP_START_NR ].start_address =FIXADDR_START ; address_markers[FIXMAP_END_NR ].start_address =FIXADDR_TOP ; address_markers[PCI_IO_START_NR ].start_address =PCI_IO_START ;
@@ -377,6 +373,10 @@ static int __init ptdump_init(void) address_markers[VMALLOC_START_NR ].start_address =VMALLOC_START ; address_markers[VMALLOC_END_NR ].start_address =VMALLOC_END ; address_markers[PAGE_OFFSET_NR ].start_address =PAGE_OFFSET ; +#ifdef CONFIG_KASAN + address_markers[KASAN_SHADOW_START_NR ].start_address =KASAN_SHADOW_START ; + address_markers[KASAN_SHADOW_END_NR ].start_address =KASAN_SHADOW_END ; +#endif #ifdef CONFIG_64BIT address_markers[MODULES_MAPPING_NR ].start_address =MODULES_VADDR ; address_markers[KERNEL_MAPPING_NR ].start_address = kernel_map.virt_addr;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 569/694 sched/rt: Fix bad task migration for rt tasks
In reply to Greg Kroah-HartmanFrom: Schspa Shi <[email protected]>
[ Upstream commit feffe5bb274dd3442080ef0e4053746091878799 ]
Commit 95158a89dd50 ("sched,rt: Use the full cpumask for balancing") allows find_lock_lowest_rq() to pick a task with migration disabled. The purpose of the commit is to push the current running task on the CPU that has the migrate_disable() task away.
However, there is a race which allows a migrate_disable() task to be migrated. Consider:
CPU0 CPU1
push_rt_task
check is_migration_disabled(next_task)
task not running and
migration_disabled == 0
find_lock_lowest_rq(next_task, rq);
_double_lock_balance(this_rq, busiest);
raw_spin_rq_unlock(this_rq);
double_rq_lock(this_rq, busiest);
<<wait for busiest rq>>
<wakeup>
task become running
migrate_disable();
<context out>
deactivate_task(rq, next_task, 0);
set_task_cpu(next_task, lowest_rq->cpu);
WARN_ON_ONCE(is_migration_disabled(p));--- kernel/sched/deadline.c | 1 + kernel/sched/rt.c | 4 ++++ 2 files changed, 5 insertions(+)
kernel/sched/deadline.c +1 -0
@@ -2246,6 +2246,7 @@ static struct rq *find_lock_later_rq(struct task_struct *task, struct rq *rq) !cpumask_test_cpu(later_rq->cpu, &task->cpus_mask) || task_on_cpu(rq, task) || !dl_task(task) || + is_migration_disabled(task) || !task_on_rq_queued(task))) {double_unlock_balance (rq, later_rq); later_rq =NULL ;
kernel/sched/rt.c +4 -0
@@ -2000,11 +2000,15 @@ static struct rq *find_lock_lowest_rq(struct task_struct *task, struct rq *rq)* the mean time, task could have * migrated already or had its affinity changed. * Also make sure that it wasn't scheduled on its rq. +* It is possible the task was scheduled, set +* "migrate_disabled" and then got preempted, so we must +* check the task migration disable flag here too. */ if (unlikely (task_rq (task) != rq || !cpumask_test_cpu (lowest_rq->cpu, &task->cpus_mask) ||task_on_cpu (rq, task) || !rt_task (task) || +is_migration_disabled (task) || !task_on_rq_queued (task))) {double_unlock_balance (rq, lowest_rq);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 570/694 sched/clock: Fix local_clock() before sched_clock_init()
In reply to Greg Kroah-HartmanFrom: Aaron Thompson <[email protected]>
[ Upstream commit f31dcb152a3d0816e2f1deab4e64572336da197d ]
Have local_clock() return sched_clock() if sched_clock_init() has not yet run. sched_clock_cpu() has this check but it was not included in the new noinstr implementation of local_clock().
The effect can be seen on x86 with CONFIG_PRINTK_TIME enabled, for instance. scd->clock quickly reaches the value of TICK_NSEC and that value is returned until sched_clock_init() runs.
dmesg without this patch:
[ 0.000000] kvm-clock: ...
[ 0.000002] kvm-clock: ...
[ 0.000672] clocksource: ...
[ 0.001000] tsc: ...
[ 0.001000] e820: ...
[ 0.001000] e820: ...
...
[ 0.001000] ..TIMER: ...
[ 0.001000] clocksource: ...
[ 0.378956] Calibrating delay loop ...
[ 0.379955] pid_max: ...dmesg with this patch:
[ 0.000000] kvm-clock: ...
[ 0.000001] kvm-clock: ...
[ 0.000675] clocksource: ...
[ 0.002685] tsc: ...
[ 0.003331] e820: ...
[ 0.004190] e820: ...
...
[ 0.421939] ..TIMER: ...
[ 0.422842] clocksource: ...
[ 0.424582] Calibrating delay loop ...
[ 0.425580] pid_max: ...--- kernel/sched/clock.c | 3 +++ 1 file changed, 3 insertions(+)
kernel/sched/clock.c +3 -0
@@ -300,6 +300,9 @@ noinstr u64 local_clock(void)if (static_branch_likely (&__sched_clock_stable))return sched_clock () + __sched_clock_offset; +if (!static_branch_likely (&sched_clock_running)) +return sched_clock (); +preempt_disable_notrace (); clock =sched_clock_local (this_scd ());preempt_enable_notrace ();
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 571/694 Fix addition on an uninitialized variable run
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
[ Upstream commit 54a0dffa62de0c91b406ff32082a121ccfa0d7f1 ]
The variable run is not initialized however it is being accumulated by the return value from the call to ikm_run_monitor. Fix this by initializing run to zero at the start of the function.
--- tools/verification/rv/src/rv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/verification/rv/src/rv.c +1 -1
@@ -74,7 +74,7 @@ static void rv_list(int argc, char **argv)static void rv_mon (int argc,char **argv) {char *monitor_name; -int i, run; +int i, run =0 ;static const char *const usage[] = {"" ,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 572/694 rtla/timerlat: Fix "Previous IRQ" auto analysis line
In reply to Greg Kroah-HartmanFrom: Daniel Bristot de Oliveira <[email protected]>
[ Upstream commit 82253a271aae9271fcf0aaa5e0ecc6dd38fb872b ]
The "Previous IRQ interference" line is misaligned and without a \n, breaking the tool's output:
## CPU 12 hit stop tracing, analyzing it ##
Previous IRQ interference: up to 2.22 us IRQ handler delay: 18.06 us (0.00 %)
IRQ latency: 18.52 us
Timerlat IRQ duration: 4.41 us (0.00 %)
Blocking thread: 216.93 us (0.03 %)
Fix the output:
## CPU 7 hit stop tracing, analyzing it ##
Previous IRQ interference: up to 8.93 us
IRQ handler delay: 0.98 us (0.00 %)
IRQ latency: 2.95 us
Timerlat IRQ duration: 11.26 us (0.03 %)
--- tools/tracing/rtla/src/timerlat_aa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/tracing/rtla/src/timerlat_aa.c +1 -1
@@ -548,7 +548,7 @@ static void timerlat_thread_analysis(struct timerlat_aa_data *taa_data, int cpu, exp_irq_ts = taa_data->timer_irq_start_time - taa_data->timer_irq_start_delay;if (exp_irq_ts < taa_data->prev_irq_timstamp + taa_data->prev_irq_duration) -printf (" Previous IRQ interference: \t up to %9.2f us" , +printf (" Previous IRQ interference: \t\t up to %9.2f us\n" ,ns_to_usf (taa_data->prev_irq_duration));/*
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 573/694 tracing/user_events: Ensure write index cannot be negative
In reply to Greg Kroah-HartmanFrom: Beau Belgrave <[email protected]>
[ Upstream commit cd98c93286a30cc4588dfd02453bec63c2f4acf4 ]
The write index indicates which event the data is for and accesses a per-file array. The index is passed by user processes during write() calls as the first 4 bytes. Ensure that it cannot be negative by returning -EINVAL to prevent out of bounds accesses.
Update ftrace self-test to ensure this occurs properly.
--- kernel/trace/trace_events_user.c | 3 +++ tools/testing/selftests/user_events/ftrace_test.c | 5 +++++ 2 files changed, 8 insertions(+)
kernel/trace/trace_events_user.c +3 -0
@@ -1398,6 +1398,9 @@ static ssize_t user_events_write_core(struct file *file, struct iov_iter *i)if (unlikely (copy_from_iter (&idx,sizeof (idx), i) !=sizeof (idx)))return -EFAULT ; +if (idx <0 ) +return -EINVAL ; +rcu_read_lock_sched (); refs =rcu_dereference_sched (info->refs);
tools/testing/selftests/user_events/ftrace_test.c +5 -0
@@ -294,6 +294,11 @@ TEST_F(user, write_events) {ASSERT_NE (-1 ,writev (self->data_fd, (const struct iovec *)io,3 )); after =trace_bytes ();ASSERT_GT (after, before); + +/* Negative index should fail with EINVAL */ + reg.write_index =-1 ; +ASSERT_EQ (-1 ,writev (self->data_fd, (const struct iovec *)io,3 )); +ASSERT_EQ (EINVAL , errno); } TEST_F(user, write_fault) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 574/694 clk: at91: clk-sam9x60-pll: fix return value check
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 1bd8e27fd0db0fe7f489213836dcbab92934f8fa ]
sam9x60_frac_pll_compute_mul_frac() can't return zero. Remove the check against zero to reflect this.
--- drivers/clk/at91/clk-sam9x60-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/at91/clk-sam9x60-pll.c +1 -1
@@ -668,7 +668,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, ret =sam9x60_frac_pll_compute_mul_frac (&frac->core,FCORE_MIN , parent_rate, true); -if (ret <=0 ) { +if (ret <0 ) { hw =ERR_PTR (ret); goto free; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 575/694 IB/hifi1: add a null check of kzalloc_node in hfi1_ipoib_txreq_init
In reply to Greg Kroah-HartmanFrom: Kang Chen <[email protected]>
[ Upstream commit c874ad879c2f29ebe040a34b974389875c0d81eb ]
kzalloc_node may fails, check it and do the cleanup.
--- drivers/infiniband/hw/hfi1/ipoib_tx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hfi1/ipoib_tx.c +4 -1
@@ -737,10 +737,13 @@ int hfi1_ipoib_txreq_init(struct hfi1_ipoib_dev_priv *priv) txq->tx_ring.shift =ilog2 (tx_item_size); txq->tx_ring.avail =hfi1_ipoib_ring_hwat (txq); tx_ring = &txq->tx_ring; -for (j =0 ; j < tx_ring_size; j++) +for (j =0 ; j < tx_ring_size; j++) {hfi1_txreq_from_idx (tx_ring, j)->sdma_hdr =kzalloc_node (sizeof (*tx->sdma_hdr),GFP_KERNEL , priv->dd->node); +if (!hfi1_txreq_from_idx (tx_ring, j)->sdma_hdr) + goto free_txqs; + }netif_napi_add_tx (dev, &txq->napi, hfi1_ipoib_poll_tx_ring); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 576/694 RDMA/siw: Fix potential page_array out of range access
In reply to Greg Kroah-HartmanFrom: Daniil Dulov <[email protected]>
[ Upstream commit 271bfcfb83a9f77cbae3d6e1a16e3c14132922f0 ]
When seg is equal to MAX_ARRAY, the loop should break, otherwise it will result in out of range access.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/infiniband/sw/siw/siw_qp_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/siw/siw_qp_tx.c +1 -1
@@ -558,7 +558,7 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s) data_len -= plen; fp_off =0 ; -if (++seg > (int )MAX_ARRAY ) { +if (++seg >= (int )MAX_ARRAY ) {siw_dbg_qp (tx_qp (c_tx),"to many fragments\n" );siw_unmap_pages (iov, kmap_mask, seg-1 ); wqe->processed -= c_tx->bytes_unsent;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 577/694 clk: mediatek: mt2712: Add error handling to clk_mt2712_apmixed_probe()
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 20cace1b9d7e33f68f0ee17196bf0df618dbacbe ]
This function was completely missing error handling: add it.
--- drivers/clk/mediatek/clk-mt2712.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/clk/mediatek/clk-mt2712.c +14 -4
@@ -1283,15 +1283,25 @@ static int clk_mt2712_apmixed_probe(struct platform_device *pdev)struct device_node *node = pdev->dev.of_node; clk_data =mtk_alloc_clk_data (CLK_APMIXED_NR_CLK ); +if (!clk_data) +return -ENOMEM ; -mtk_clk_register_plls (node, plls,ARRAY_SIZE (plls), clk_data); + r =mtk_clk_register_plls (node, plls,ARRAY_SIZE (plls), clk_data); +if (r) + goto free_clk_data; r =of_clk_add_hw_provider (node, of_clk_hw_onecell_get, clk_data); +if (r) { +dev_err (&pdev->dev,"Cannot register clock provider: %d\n" , r); + goto unregister_plls; + } -if (r !=0 ) -pr_err ("%s(): could not register clock provider: %d\n" , - __func__, r); +return 0 ; +unregister_plls: +mtk_clk_unregister_plls (plls,ARRAY_SIZE (plls), clk_data); +free_clk_data: +mtk_free_clk_data (clk_data);return r; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 578/694 clk: mediatek: Consistently use GATE_MTK() macro
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 4c85e20b656607897e3bb06ff565822fa4b4de95 ]
All the various MediaTek clock drivers are, in a way or another, redefining the GATE_MTK() macro with different names: while some are doing that by actually using GATE_MTK(), others are copying it entirely (hence, entirely redefining it).
Change all clock drivers to always and consistently use this macro.
Stable-dep-of: fa8c0d01df62 ("clk: mediatek: mt7622: Properly use CLK_IS_CRITICAL flag")
--- drivers/clk/mediatek/clk-mt2701-aud.c | 40 +++-------- drivers/clk/mediatek/clk-mt2701-bdp.c | 20 ++---- drivers/clk/mediatek/clk-mt2701-eth.c | 10 +-- drivers/clk/mediatek/clk-mt2701-g3d.c | 10 +-- drivers/clk/mediatek/clk-mt2701-hif.c | 10 +-- drivers/clk/mediatek/clk-mt2701-img.c | 10 +-- drivers/clk/mediatek/clk-mt2701-mm.c | 20 ++---- drivers/clk/mediatek/clk-mt2701-vdec.c | 20 ++---- drivers/clk/mediatek/clk-mt2701.c | 40 +++-------- drivers/clk/mediatek/clk-mt2712-bdp.c | 10 +-- drivers/clk/mediatek/clk-mt2712-img.c | 10 +-- drivers/clk/mediatek/clk-mt2712-jpgdec.c | 10 +-- drivers/clk/mediatek/clk-mt2712-mfg.c | 10 +-- drivers/clk/mediatek/clk-mt2712-mm.c | 34 +++------ drivers/clk/mediatek/clk-mt2712-vdec.c | 20 ++---- drivers/clk/mediatek/clk-mt2712-venc.c | 10 +-- drivers/clk/mediatek/clk-mt2712.c | 60 ++++------------ drivers/clk/mediatek/clk-mt6765-audio.c | 20 ++---- drivers/clk/mediatek/clk-mt6765-cam.c | 10 +-- drivers/clk/mediatek/clk-mt6765-img.c | 10 +-- drivers/clk/mediatek/clk-mt6765-mipi0a.c | 10 +-- drivers/clk/mediatek/clk-mt6765-mm.c | 10 +-- drivers/clk/mediatek/clk-mt6765-vcodec.c | 10 +-- drivers/clk/mediatek/clk-mt6765.c | 80 +++++----------------- drivers/clk/mediatek/clk-mt6797-img.c | 10 +-- drivers/clk/mediatek/clk-mt6797-mm.c | 20 ++---- drivers/clk/mediatek/clk-mt6797-vdec.c | 20 ++---- drivers/clk/mediatek/clk-mt6797-venc.c | 10 +-- drivers/clk/mediatek/clk-mt6797.c | 42 ++++-------- drivers/clk/mediatek/clk-mt7622-aud.c | 40 +++-------- drivers/clk/mediatek/clk-mt7622-eth.c | 20 ++---- drivers/clk/mediatek/clk-mt7622-hif.c | 22 ++---- drivers/clk/mediatek/clk-mt7622.c | 61 ++++------------- drivers/clk/mediatek/clk-mt7629-eth.c | 20 ++---- drivers/clk/mediatek/clk-mt7629-hif.c | 22 ++---- drivers/clk/mediatek/clk-mt7629.c | 40 +++-------- drivers/clk/mediatek/clk-mt7986-eth.c | 24 ++----- drivers/clk/mediatek/clk-mt7986-infracfg.c | 24 ++----- drivers/clk/mediatek/clk-mt8135.c | 30 ++------ drivers/clk/mediatek/clk-mt8167-aud.c | 11 +-- drivers/clk/mediatek/clk-mt8167-img.c | 10 +-- drivers/clk/mediatek/clk-mt8167-mfgcfg.c | 10 +-- drivers/clk/mediatek/clk-mt8167-mm.c | 22 ++---- drivers/clk/mediatek/clk-mt8167-vdec.c | 20 ++---- drivers/clk/mediatek/clk-mt8173-mm.c | 22 ++---- drivers/clk/mediatek/clk-mt8516-aud.c | 10 +-- drivers/clk/mediatek/clk-mt8516.c | 60 ++++------------ 47 files changed, 224 insertions(+), 840 deletions(-)
drivers/clk/mediatek/clk-mt2701-aud.c +8 -32
@@ -15,41 +15,17 @@#include <dt-bindings/clock/mt2701-clk.h> -#define GATE_AUDIO0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) -#define GATE_AUDIO1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) -#define GATE_AUDIO2 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio2_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO2 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio2_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) -#define GATE_AUDIO3 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio3_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO3 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio3_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)static const struct mtk_gate_regs audio0_cg_regs = { .set_ofs =0x0 ,
drivers/clk/mediatek/clk-mt2701-bdp.c +4 -16
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs bdp1_cg_regs = { .sta_ofs = 0x0110, }; -#define GATE_BDP0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &bdp0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_BDP0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &bdp0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) -#define GATE_BDP1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &bdp1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_BDP1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &bdp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate bdp_clks[] = {GATE_BDP0 (CLK_BDP_BRG_BA ,"brg_baclk" ,"mm_sel" ,0 ),
drivers/clk/mediatek/clk-mt2701-eth.c +2 -8
@@ -16,14 +16,8 @@ static const struct mtk_gate_regs eth_cg_regs = { .sta_ofs = 0x0030, }; -#define GATE_ETH (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = ð_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_ETH (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, ð_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate eth_clks[] = {GATE_DUMMY (CLK_DUMMY ,"eth_dummy" ),
drivers/clk/mediatek/clk-mt2701-g3d.c +2 -8
@@ -16,14 +16,8 @@#include <dt-bindings/clock/mt2701-clk.h> -#define GATE_G3D (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &g3d_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_G3D (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &g3d_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate_regs g3d_cg_regs = { .sta_ofs =0x0 ,
drivers/clk/mediatek/clk-mt2701-hif.c +2 -8
@@ -16,14 +16,8 @@ static const struct mtk_gate_regs hif_cg_regs = { .sta_ofs = 0x0030, }; -#define GATE_HIF (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &hif_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_HIF (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &hif_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate hif_clks[] = {GATE_DUMMY (CLK_DUMMY ,"hif_dummy" ),
drivers/clk/mediatek/clk-mt2701-img.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs img_cg_regs = { .sta_ofs = 0x0000, }; -#define GATE_IMG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &img_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_IMG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate img_clks[] = {GATE_IMG (CLK_IMG_SMI_COMM ,"img_smi_comm" ,"mm_sel" ,0 ),
drivers/clk/mediatek/clk-mt2701-mm.c +4 -16
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs disp1_cg_regs = { .sta_ofs = 0x0110, }; -#define GATE_DISP0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &disp0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_DISP0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &disp0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) -#define GATE_DISP1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &disp1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_DISP1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &disp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mm_clks[] = {GATE_DISP0 (CLK_MM_SMI_COMMON ,"mm_smi_comm" ,"mm_sel" ,0 ),
drivers/clk/mediatek/clk-mt2701-vdec.c +4 -16
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs vdec1_cg_regs = { .sta_ofs = 0x0008, }; -#define GATE_VDEC0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &vdec0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VDEC0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) -#define GATE_VDEC1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &vdec1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VDEC1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate vdec_clks[] = {GATE_VDEC0 (CLK_VDEC_CKGEN ,"vdec_cken" ,"vdec_sel" ,0 ),
drivers/clk/mediatek/clk-mt2701.c +8 -32
@@ -636,14 +636,8 @@ static const struct mtk_gate_regs top_aud_cg_regs = { .sta_ofs = 0x012C, }; -#define GATE_TOP_AUD (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &top_aud_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_TOP_AUD (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &top_aud_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)static const struct mtk_gate top_clks[] = { GATE_TOP_AUD(CLK_TOP_AUD_48K_TIMING, "a1sys_hp_ck", "aud_mux1_div",
@@ -702,14 +696,8 @@ static const struct mtk_gate_regs infra_cg_regs = { .sta_ofs = 0x0048, }; -#define GATE_ICG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &infra_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_ICG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate infra_clks[] = {GATE_ICG (CLK_INFRA_DBG ,"dbgclk" ,"axi_sel" ,0 ),
@@ -823,23 +811,11 @@ static const struct mtk_gate_regs peri1_cg_regs = { .sta_ofs = 0x001c, }; -#define GATE_PERI0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &peri0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_PERI0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) -#define GATE_PERI1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &peri1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_PERI1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate peri_clks[] = {GATE_PERI0 (CLK_PERI_USB0_MCU ,"usb0_mcu_ck" ,"axi_sel" ,31 ),
drivers/clk/mediatek/clk-mt2712-bdp.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs bdp_cg_regs = { .sta_ofs = 0x100, }; -#define GATE_BDP (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &bdp_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_BDP (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &bdp_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)static const struct mtk_gate bdp_clks[] = {GATE_BDP (CLK_BDP_BRIDGE_B ,"bdp_bridge_b" ,"mm_sel" ,0 ),
drivers/clk/mediatek/clk-mt2712-img.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs img_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_IMG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &img_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_IMG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)static const struct mtk_gate img_clks[] = {GATE_IMG (CLK_IMG_SMI_LARB2 ,"img_smi_larb2" ,"mm_sel" ,0 ),
drivers/clk/mediatek/clk-mt2712-jpgdec.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs jpgdec_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_JPGDEC (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &jpgdec_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_JPGDEC (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &jpgdec_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate jpgdec_clks[] = {GATE_JPGDEC (CLK_JPGDEC_JPGDEC1 ,"jpgdec_jpgdec1" ,"jpgdec_sel" ,0 ),
drivers/clk/mediatek/clk-mt2712-mfg.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs mfg_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_MFG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mfg_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_MFG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mfg_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mfg_clks[] = {GATE_MFG (CLK_MFG_BG3D ,"mfg_bg3d" ,"mfg_sel" ,0 ),
drivers/clk/mediatek/clk-mt2712-mm.c +8 -26
@@ -30,32 +30,14 @@ static const struct mtk_gate_regs mm2_cg_regs = { .sta_ofs = 0x220, }; -#define GATE_MM0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } - -#define GATE_MM1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } - -#define GATE_MM2 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm2_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_MM0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + +#define GATE_MM1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm1_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + +#define GATE_MM2 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm2_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mm_clks[] = {/* MM0 */
drivers/clk/mediatek/clk-mt2712-vdec.c +4 -16
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs vdec1_cg_regs = { .sta_ofs = 0x8, }; -#define GATE_VDEC0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &vdec0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VDEC0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) -#define GATE_VDEC1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &vdec1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VDEC1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate vdec_clks[] = {/* VDEC0 */
drivers/clk/mediatek/clk-mt2712-venc.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs venc_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_VENC (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &venc_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VENC (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &venc_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate venc_clks[] = {GATE_VENC (CLK_VENC_SMI_COMMON_CON ,"venc_smi" ,"mm_sel" ,0 ),
drivers/clk/mediatek/clk-mt2712.c +12 -48
81 lines not on this page · raw message
drivers/clk/mediatek/clk-mt6765-audio.c +4 -16
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs audio1_cg_regs = { .sta_ofs = 0x4, }; -#define GATE_AUDIO0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) -#define GATE_AUDIO1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)static const struct mtk_gate audio_clks[] = {/* AUDIO0 */
drivers/clk/mediatek/clk-mt6765-cam.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs cam_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_CAM (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &cam_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_CAM (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &cam_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate cam_clks[] = {GATE_CAM (CLK_CAM_LARB3 ,"cam_larb3" ,"mm_ck" ,0 ),
drivers/clk/mediatek/clk-mt6765-img.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs img_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_IMG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &img_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_IMG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate img_clks[] = {GATE_IMG (CLK_IMG_LARB2 ,"img_larb2" ,"mm_ck" ,0 ),
drivers/clk/mediatek/clk-mt6765-mipi0a.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs mipi0a_cg_regs = { .sta_ofs = 0x80, }; -#define GATE_MIPI0A (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mipi0a_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_MIPI0A (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mipi0a_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate mipi0a_clks[] = { GATE_MIPI0A(CLK_MIPI0A_CSR_CSI_EN_0A,
drivers/clk/mediatek/clk-mt6765-mm.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs mm_cg_regs = { .sta_ofs = 0x100, }; -#define GATE_MM (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_MM (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mm_clks[] = {/* MM */
drivers/clk/mediatek/clk-mt6765-vcodec.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs venc_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_VENC (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &venc_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VENC (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &venc_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate venc_clks[] = {GATE_VENC (CLK_VENC_SET0_LARB ,"venc_set0_larb" ,"mm_ck" ,0 ),
drivers/clk/mediatek/clk-mt6765.c +16 -64
103 lines not on this page · raw message
drivers/clk/mediatek/clk-mt6797-img.c +2 -8
@@ -16,14 +16,8 @@ static const struct mtk_gate_regs img_cg_regs = { .sta_ofs = 0x0000, }; -#define GATE_IMG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &img_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_IMG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate img_clks[] = {GATE_IMG (CLK_IMG_FDVT ,"img_fdvt" ,"mm_sel" ,11 ),
drivers/clk/mediatek/clk-mt6797-mm.c +4 -16
@@ -23,23 +23,11 @@ static const struct mtk_gate_regs mm1_cg_regs = { .sta_ofs = 0x0110, }; -#define GATE_MM0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ -} +#define GATE_MM0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) -#define GATE_MM1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ -} +#define GATE_MM1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mm_clks[] = {GATE_MM0 (CLK_MM_SMI_COMMON ,"mm_smi_common" ,"mm_sel" ,0 ),
drivers/clk/mediatek/clk-mt6797-vdec.c +4 -16
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs vdec1_cg_regs = { .sta_ofs = 0x0008, }; -#define GATE_VDEC0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &vdec0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ -} +#define GATE_VDEC0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) -#define GATE_VDEC1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &vdec1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ -} +#define GATE_VDEC1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate vdec_clks[] = {GATE_VDEC0 (CLK_VDEC_CKEN_ENG ,"vdec_cken_eng" ,"vdec_sel" ,8 ),
drivers/clk/mediatek/clk-mt6797-venc.c +2 -8
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs venc_cg_regs = { .sta_ofs = 0x0000, }; -#define GATE_VENC (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &venc_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VENC (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &venc_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate venc_clks[] = {GATE_VENC (CLK_VENC_0 ,"venc_0" ,"mm_sel" ,0 ),
drivers/clk/mediatek/clk-mt6797.c +12 -30
52 lines not on this page · raw message
drivers/clk/mediatek/clk-mt7622-aud.c +8 -32
@@ -16,41 +16,17 @@#include <dt-bindings/clock/mt7622-clk.h> -#define GATE_AUDIO0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) -#define GATE_AUDIO1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) -#define GATE_AUDIO2 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio2_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO2 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio2_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) -#define GATE_AUDIO3 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &audio3_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUDIO3 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &audio3_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)static const struct mtk_gate_regs audio0_cg_regs = { .set_ofs =0x0 ,
drivers/clk/mediatek/clk-mt7622-eth.c +4 -16
@@ -16,14 +16,8 @@#include <dt-bindings/clock/mt7622-clk.h> -#define GATE_ETH (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = ð_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_ETH (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, ð_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate_regs eth_cg_regs = { .set_ofs =0x30 ,
@@ -45,14 +39,8 @@ static const struct mtk_gate_regs sgmii_cg_regs = { .sta_ofs = 0xE4, }; -#define GATE_SGMII (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &sgmii_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_SGMII (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &sgmii_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate sgmii_clks[] = { GATE_SGMII(CLK_SGMII_TX250M_EN, "sgmii_tx250m_en",
drivers/clk/mediatek/clk-mt7622-hif.c +5 -17
@@ -16,23 +16,11 @@#include <dt-bindings/clock/mt7622-clk.h> -#define GATE_PCIE (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &pcie_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } - -#define GATE_SSUSB (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &ssusb_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_PCIE (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &pcie_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv) + +#define GATE_SSUSB (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &ssusb_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate_regs pcie_cg_regs = { .set_ofs =0x30 ,
drivers/clk/mediatek/clk-mt7622.c +13 -48
72 lines not on this page · raw message
drivers/clk/mediatek/clk-mt7629-eth.c +4 -16
@@ -16,14 +16,8 @@#include <dt-bindings/clock/mt7629-clk.h> -#define GATE_ETH (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = ð_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_ETH (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, ð_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate_regs eth_cg_regs = { .set_ofs =0x30 ,
@@ -45,14 +39,8 @@ static const struct mtk_gate_regs sgmii_cg_regs = { .sta_ofs = 0xE4, }; -#define GATE_SGMII (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &sgmii_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_SGMII (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &sgmii_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate sgmii_clks[2 ][4 ] = { {
drivers/clk/mediatek/clk-mt7629-hif.c +5 -17
@@ -16,23 +16,11 @@#include <dt-bindings/clock/mt7629-clk.h> -#define GATE_PCIE (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &pcie_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } - -#define GATE_SSUSB (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &ssusb_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_PCIE (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &pcie_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv) + +#define GATE_SSUSB (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &ssusb_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate_regs pcie_cg_regs = { .set_ofs =0x30 ,
drivers/clk/mediatek/clk-mt7629.c +8 -32
@@ -50,41 +50,17 @@ _pd_reg, _pd_shift, _tuner_reg, _pcw_reg, _pcw_shift, \ NULL, "clk20m") -#define GATE_APMIXED (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &apmixed_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_APMIXED (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &apmixed_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv) -#define GATE_INFRA (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &infra_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_INFRA (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr) -#define GATE_PERI0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &peri0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_PERI0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) -#define GATE_PERI1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &peri1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_PERI1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static DEFINE_SPINLOCK (mt7629_clk_lock);
drivers/clk/mediatek/clk-mt7986-eth.c +6 -18
@@ -22,12 +22,8 @@ static const struct mtk_gate_regs sgmii0_cg_regs = { .sta_ofs = 0xe4, }; -#define GATE_SGMII0 (_id, _name, _parent, _shift) \ - { \ - .id = _id, .name = _name, .parent_name = _parent, \ - .regs = &sgmii0_cg_regs, .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_SGMII0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &sgmii0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate sgmii0_clks[]__initconst = {GATE_SGMII0 (CLK_SGMII0_TX250M_EN ,"sgmii0_tx250m_en" ,"top_xtal" ,2 ),
@@ -42,12 +38,8 @@ static const struct mtk_gate_regs sgmii1_cg_regs = { .sta_ofs = 0xe4, }; -#define GATE_SGMII1 (_id, _name, _parent, _shift) \ - { \ - .id = _id, .name = _name, .parent_name = _parent, \ - .regs = &sgmii1_cg_regs, .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_SGMII1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &sgmii1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate sgmii1_clks[]__initconst = {GATE_SGMII1 (CLK_SGMII1_TX250M_EN ,"sgmii1_tx250m_en" ,"top_xtal" ,2 ),
@@ -62,12 +54,8 @@ static const struct mtk_gate_regs eth_cg_regs = { .sta_ofs = 0x30, }; -#define GATE_ETH (_id, _name, _parent, _shift) \ - { \ - .id = _id, .name = _name, .parent_name = _parent, \ - .regs = ð_cg_regs, .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr_inv, \ - } +#define GATE_ETH (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, ð_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)static const struct mtk_gate eth_clks[]__initconst = {GATE_ETH (CLK_ETH_FE_EN ,"eth_fe_en" ,"netsys_2x_sel" ,6 ),
drivers/clk/mediatek/clk-mt7986-infracfg.c +6 -18
@@ -87,26 +87,14 @@ static const struct mtk_gate_regs infra2_cg_regs = { .sta_ofs = 0x68, }; -#define GATE_INFRA0 (_id, _name, _parent, _shift) \ - { \ - .id = _id, .name = _name, .parent_name = _parent, \ - .regs = &infra0_cg_regs, .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_INFRA0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &infra0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) -#define GATE_INFRA1 (_id, _name, _parent, _shift) \ - { \ - .id = _id, .name = _name, .parent_name = _parent, \ - .regs = &infra1_cg_regs, .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_INFRA1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &infra1_cg_regs, _shift, &mtk_clk_gate_ops_setclr) -#define GATE_INFRA2 (_id, _name, _parent, _shift) \ - { \ - .id = _id, .name = _name, .parent_name = _parent, \ - .regs = &infra2_cg_regs, .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_INFRA2 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &infra2_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate infra_clks[] = {/* INFRA0 */
drivers/clk/mediatek/clk-mt8135.c +6 -24
@@ -401,14 +401,8 @@ static const struct mtk_gate_regs infra_cg_regs = { .sta_ofs = 0x0048, }; -#define GATE_ICG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &infra_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_ICG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate infra_clks[]__initconst = {GATE_ICG (CLK_INFRA_PMIC_WRAP ,"pmic_wrap_ck" ,"axi_sel" ,23 ),
@@ -438,23 +432,11 @@ static const struct mtk_gate_regs peri1_cg_regs = { .sta_ofs = 0x001c, }; -#define GATE_PERI0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &peri0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_PERI0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) -#define GATE_PERI1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &peri1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_PERI1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate peri_gates[]__initconst = {/* PERI0 */
drivers/clk/mediatek/clk-mt8167-aud.c +3 -8
@@ -23,14 +23,9 @@ static const struct mtk_gate_regs aud_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_AUD (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &aud_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUD (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &aud_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr) +static const struct mtk_gate aud_clks[]__initconst = {GATE_AUD (CLK_AUD_AFE ,"aud_afe" ,"clk26m_ck" ,2 ),
drivers/clk/mediatek/clk-mt8167-img.c +2 -8
@@ -23,14 +23,8 @@ static const struct mtk_gate_regs img_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_IMG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &img_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_IMG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate img_clks[]__initconst = {GATE_IMG (CLK_IMG_LARB1_SMI ,"img_larb1_smi" ,"smi_mm" ,0 ),
drivers/clk/mediatek/clk-mt8167-mfgcfg.c +2 -8
@@ -23,14 +23,8 @@ static const struct mtk_gate_regs mfg_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_MFG (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mfg_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_MFG (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mfg_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mfg_clks[]__initconst = {GATE_MFG (CLK_MFG_BAXI ,"mfg_baxi" ,"ahb_infra_sel" ,0 ),
drivers/clk/mediatek/clk-mt8167-mm.c +5 -17
@@ -29,23 +29,11 @@ static const struct mtk_gate_regs mm1_cg_regs = { .sta_ofs = 0x110, }; -#define GATE_MM0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } - -#define GATE_MM1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_MM0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + +#define GATE_MM1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mm_clks[] = {/* MM0 */
drivers/clk/mediatek/clk-mt8167-vdec.c +4 -16
@@ -29,23 +29,11 @@ static const struct mtk_gate_regs vdec1_cg_regs = { .sta_ofs = 0x8, }; -#define GATE_VDEC0_I (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &vdec0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VDEC0_I (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) -#define GATE_VDEC1_I (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &vdec1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr_inv, \ - } +#define GATE_VDEC1_I (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)static const struct mtk_gate vdec_clks[]__initconst = {/* VDEC0 */
drivers/clk/mediatek/clk-mt8173-mm.c +5 -17
@@ -25,23 +25,11 @@ static const struct mtk_gate_regs mm1_cg_regs = { .sta_ofs = 0x0110, }; -#define GATE_MM0 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm0_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } - -#define GATE_MM1 (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &mm1_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_setclr, \ - } +#define GATE_MM0 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + +#define GATE_MM1 (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &mm1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)static const struct mtk_gate mt8173_mm_clks[] = {/* MM0 */
drivers/clk/mediatek/clk-mt8516-aud.c +2 -8
@@ -22,14 +22,8 @@ static const struct mtk_gate_regs aud_cg_regs = { .sta_ofs = 0x0, }; -#define GATE_AUD (_id, _name, _parent, _shift) { \ - .id = _id, \ - .name = _name, \ - .parent_name = _parent, \ - .regs = &aud_cg_regs, \ - .shift = _shift, \ - .ops = &mtk_clk_gate_ops_no_setclr, \ - } +#define GATE_AUD (_id, _name, _parent, _shift) \ + GATE_MTK(_id, _name, _parent, &aud_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)static const struct mtk_gate aud_clks[]__initconst = {GATE_AUD (CLK_AUD_AFE ,"aud_afe" ,"clk26m_ck" ,2 ),
drivers/clk/mediatek/clk-mt8516.c +12 -48
71 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 579/694 clk: mediatek: mt7622: Properly use CLK_IS_CRITICAL flag
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit fa8c0d01df62130ff596d560380a6f844f62639e ]
Instead of calling clk_prepare_enable() for clocks that shall stay enabled, use the CLK_IS_CRITICAL flag, which purpose is exactly that.
--- drivers/clk/mediatek/clk-mt7622.c | 35 +++++++++++++------------------ 1 file changed, 15 insertions(+), 20 deletions(-)
drivers/clk/mediatek/clk-mt7622.c +15 -20
@@ -50,9 +50,9 @@ _pd_reg, _pd_shift, _tuner_reg, _pcw_reg, _pcw_shift, \ NULL, "clkxtal") -#define GATE_APMIXED (_id, _name, _parent, _shift) \ - GATE_MTK(_id, _name, _parent, &apmixed_cg_regs, _shift, \ - &mtk_clk_gate_ops_no_setclr_inv) +#define GATE_APMIXED_AO (_id, _name, _parent, _shift) \ + GATE_MTK_FLAGS(_id, _name, _parent, &apmixed_cg_regs, _shift, \ + &mtk_clk_gate_ops_no_setclr_inv, CLK_IS_CRITICAL)#define GATE_INFRA (_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
@@ -66,6 +66,10 @@#define GATE_PERI0 (_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr) +#define GATE_PERI0_AO (_id, _name, _parent, _shift) \ + GATE_MTK_FLAGS(_id, _name, _parent, &peri0_cg_regs, _shift, \ + &mtk_clk_gate_ops_setclr, CLK_IS_CRITICAL) +#define GATE_PERI1 (_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
@@ -315,7 +319,7 @@ static const struct mtk_pll_data plls[] = { };static const struct mtk_gate apmixed_clks[] = { -GATE_APMIXED (CLK_APMIXED_MAIN_CORE_EN ,"main_core_en" ,"mainpll" ,5 ), +GATE_APMIXED_AO (CLK_APMIXED_MAIN_CORE_EN ,"main_core_en" ,"mainpll" ,5 ), };static const struct mtk_gate infra_clks[] = {
@@ -450,7 +454,7 @@ static const struct mtk_gate peri_clks[] = {GATE_PERI0 (CLK_PERI_AP_DMA_PD ,"peri_ap_dma_pd" ,"axi_sel" ,12 ),GATE_PERI0 (CLK_PERI_MSDC30_0_PD ,"peri_msdc30_0" ,"msdc30_0_sel" ,13 ),GATE_PERI0 (CLK_PERI_MSDC30_1_PD ,"peri_msdc30_1" ,"msdc30_1_sel" ,14 ), -GATE_PERI0 (CLK_PERI_UART0_PD ,"peri_uart0_pd" ,"axi_sel" ,17 ), +GATE_PERI0_AO (CLK_PERI_UART0_PD ,"peri_uart0_pd" ,"axi_sel" ,17 ),GATE_PERI0 (CLK_PERI_UART1_PD ,"peri_uart1_pd" ,"axi_sel" ,18 ),GATE_PERI0 (CLK_PERI_UART2_PD ,"peri_uart2_pd" ,"axi_sel" ,19 ), GATE_PERI0(CLK_PERI_UART3_PD, "peri_uart3_pd", "axi_sel", 20),
@@ -478,12 +482,12 @@ static struct mtk_composite infra_muxes[] = {static struct mtk_composite top_muxes[] = {/* CLK_CFG_0 */ -MUX_GATE (CLK_TOP_AXI_SEL ,"axi_sel" , axi_parents, -0x040 ,0 ,3 ,7 ), -MUX_GATE (CLK_TOP_MEM_SEL ,"mem_sel" , mem_parents, -0x040 ,8 ,1 ,15 ), -MUX_GATE (CLK_TOP_DDRPHYCFG_SEL ,"ddrphycfg_sel" , ddrphycfg_parents, -0x040 ,16 ,1 ,23 ), +MUX_GATE_FLAGS (CLK_TOP_AXI_SEL ,"axi_sel" , axi_parents, +0x040 ,0 ,3 ,7 ,CLK_IS_CRITICAL ), +MUX_GATE_FLAGS (CLK_TOP_MEM_SEL ,"mem_sel" , mem_parents, +0x040 ,8 ,1 ,15 ,CLK_IS_CRITICAL ), +MUX_GATE_FLAGS (CLK_TOP_DDRPHYCFG_SEL ,"ddrphycfg_sel" , ddrphycfg_parents, +0x040 ,16 ,1 ,23 ,CLK_IS_CRITICAL ),MUX_GATE (CLK_TOP_ETH_SEL ,"eth_sel" , eth_parents,0x040 ,24 ,3 ,31 ),
@@ -621,10 +625,6 @@ static int mtk_topckgen_init(struct platform_device *pdev)mtk_clk_register_gates (&pdev->dev, node, top_clks,ARRAY_SIZE (top_clks), clk_data); -clk_prepare_enable (clk_data->hws[CLK_TOP_AXI_SEL ]->clk); -clk_prepare_enable (clk_data->hws[CLK_TOP_MEM_SEL ]->clk); -clk_prepare_enable (clk_data->hws[CLK_TOP_DDRPHYCFG_SEL ]->clk); -return of_clk_add_hw_provider (node, of_clk_hw_onecell_get, clk_data); }
@@ -667,9 +667,6 @@ static int mtk_apmixedsys_init(struct platform_device *pdev)mtk_clk_register_gates (&pdev->dev, node, apmixed_clks,ARRAY_SIZE (apmixed_clks), clk_data); -clk_prepare_enable (clk_data->hws[CLK_APMIXED_ARMPLL ]->clk); -clk_prepare_enable (clk_data->hws[CLK_APMIXED_MAIN_CORE_EN ]->clk); -return of_clk_add_hw_provider (node, of_clk_hw_onecell_get, clk_data); }
@@ -697,8 +694,6 @@ static int mtk_pericfg_init(struct platform_device *pdev)if (r)return r; -clk_prepare_enable (clk_data->hws[CLK_PERI_UART0_PD ]->clk); -mtk_register_reset_controller_with_dev (&pdev->dev, &clk_rst_desc[1 ]);return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 580/694 clk: mediatek: mt8135: Properly use CLK_IS_CRITICAL flag
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit f4f9a9c003b52ea3cffda186753bfb3e37b970f8 ]
Instead of calling clk_prepare_enable() for clocks that shall stay enabled, use the CLK_IS_CRITICAL flag, which purpose is exactly that.
--- drivers/clk/mediatek/clk-mt8135.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/clk/mediatek/clk-mt8135.c +8 -6
@@ -2,6 +2,8 @@/* * Copyright (c) 2014 MediaTek Inc. * Author: James Liao <[email protected]> +* Copyright (c) 2023 Collabora, Ltd. +* AngeloGioacchino Del Regno <[email protected]> */ #include <linux/clk.h>
@@ -390,7 +392,7 @@ static const struct mtk_composite top_muxes[] __initconst = {MUX_GATE (CLK_TOP_GCPU_SEL ,"gcpu_sel" , gcpu_parents,0x0164 ,24 ,3 ,31 ),/* CLK_CFG_9 */ MUX_GATE (CLK_TOP_DPI1_SEL ,"dpi1_sel" , dpi1_parents,0x0168 ,0 ,2 ,7 ), -MUX_GATE (CLK_TOP_CCI_SEL ,"cci_sel" , cci_parents,0x0168 ,8 ,3 ,15 ), +MUX_GATE_FLAGS (CLK_TOP_CCI_SEL ,"cci_sel" , cci_parents,0x0168 ,8 ,3 ,15 ,CLK_IS_CRITICAL ),MUX_GATE (CLK_TOP_APLL_SEL ,"apll_sel" , apll_parents,0x0168 ,16 ,3 ,23 ), MUX_GATE(CLK_TOP_HDMIPLL_SEL, "hdmipll_sel", hdmipll_parents, 0x0168, 24, 2, 31), };
@@ -404,6 +406,10 @@ static const struct mtk_gate_regs infra_cg_regs = {#define GATE_ICG (_id, _name, _parent, _shift) \ GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr) +#define GATE_ICG_AO (_id, _name, _parent, _shift) \ + GATE_MTK_FLAGS(_id, _name, _parent, &infra_cg_regs, _shift, \ + &mtk_clk_gate_ops_setclr, CLK_IS_CRITICAL) +static const struct mtk_gate infra_clks[]__initconst = {GATE_ICG (CLK_INFRA_PMIC_WRAP ,"pmic_wrap_ck" ,"axi_sel" ,23 ),GATE_ICG (CLK_INFRA_PMICSPI ,"pmicspi_ck" ,"pmicspi_sel" ,22 ),
@@ -411,7 +417,7 @@ static const struct mtk_gate infra_clks[] __initconst = {GATE_ICG (CLK_INFRA_CCIF0_AP_CTRL ,"ccif0_ap_ctrl" ,"axi_sel" ,20 ),GATE_ICG (CLK_INFRA_KP ,"kp_ck" ,"axi_sel" ,16 ),GATE_ICG (CLK_INFRA_CPUM ,"cpum_ck" ,"cpum_tck_in" ,15 ), -GATE_ICG (CLK_INFRA_M4U ,"m4u_ck" ,"mem_sel" ,8 ), +GATE_ICG_AO (CLK_INFRA_M4U ,"m4u_ck" ,"mem_sel" ,8 ),GATE_ICG (CLK_INFRA_MFGAXI ,"mfgaxi_ck" ,"axi_sel" ,7 ),GATE_ICG (CLK_INFRA_DEVAPC ,"devapc_ck" ,"axi_sel" ,6 ), GATE_ICG(CLK_INFRA_AUDIO, "audio_ck", "aud_intbus_sel", 5),
@@ -534,8 +540,6 @@ static void __init mtk_topckgen_init(struct device_node *node)ARRAY_SIZE (top_muxes), base, &mt8135_clk_lock, clk_data); -clk_prepare_enable (clk_data->hws[CLK_TOP_CCI_SEL ]->clk); - r =of_clk_add_hw_provider (node, of_clk_hw_onecell_get, clk_data);if (r) pr_err("%s(): could not register clock provider: %d\n",
@@ -553,8 +557,6 @@ static void __init mtk_infrasys_init(struct device_node *node)mtk_clk_register_gates (NULL , node, infra_clks,ARRAY_SIZE (infra_clks), clk_data); -clk_prepare_enable (clk_data->hws[CLK_INFRA_M4U ]->clk); - r =of_clk_add_hw_provider (node, of_clk_hw_onecell_get, clk_data);if (r) pr_err("%s(): could not register clock provider: %d\n",
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 581/694 RDMA/rdmavt: Delete unnecessary NULL check
In reply to Greg Kroah-HartmanFrom: Natalia Petrova <[email protected]>
[ Upstream commit b73a0b80c69de77d8d4942abb37066531c0169b2 ]
There is no need to check 'rdi->qp_dev' for NULL. The field 'qp_dev' is created in rvt_register_device() which will fail if the 'qp_dev' allocation fails in rvt_driver_qp_init(). Overwise this pointer doesn't changed and passed to rvt_qp_exit() by the next step.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/infiniband/sw/rdmavt/qp.c | 2 -- 1 file changed, 2 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +0 -2
@@ -464,8 +464,6 @@ void rvt_qp_exit(struct rvt_dev_info *rdi)if (qps_inuse)rvt_pr_err (rdi,"QP memory leak! %u still in use\n" , qps_inuse); -if (!rdi->qp_dev) -return ;kfree (rdi->qp_dev->qp_table);free_qpn_table (&rdi->qp_dev->qpn_table);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 582/694 clk: mediatek: clk-pllfh: fix missing of_node_put() in fhctl_parse_dt()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit f1d97a37f975ac615e4d6875c27516150642d499 ]
The device_node pointer returned by of_find_compatible_node() with refcount incremented, when finish using it, the refcount need be decreased.
--- drivers/clk/mediatek/clk-pllfh.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/clk/mediatek/clk-pllfh.c +9 -2
@@ -75,13 +75,13 @@ void fhctl_parse_dt(const u8 *compatible_node, struct mtk_pllfh_data *pllfhs, base =of_iomap (node,0 );if (!base) {pr_err ("%s(): ioremap failed\n" , __func__); -return ; + goto out_node_put; } num_clocks =of_clk_get_parent_count (node);if (!num_clocks) {pr_err ("%s(): failed to get clocks property\n" , __func__); -return ; + goto err; }for (i =0 ; i < num_clocks; i++) {
@@ -102,6 +102,13 @@ void fhctl_parse_dt(const u8 *compatible_node, struct mtk_pllfh_data *pllfhs, pllfh->state.ssc_rate = ssc_rate; pllfh->state.base = base; } + +out_node_put: +of_node_put (node); +return ; +err: +iounmap (base); + goto out_node_put; }static void pllfh_init (struct mtk_fh *fh,struct mtk_pllfh_data *pllfh_data)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 583/694 clk: qcom: gcc-qcm2290: Fix up gcc_sdcc2_apps_clk_src
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 1bf088a9f0e50acd175ba8deef0db11c099fa26e ]
Add the PARENT_ENABLE flag to prevent the clock from getting stuck at boot and use floor_ops to avoid SDHCI overclocking.
--- drivers/clk/qcom/gcc-qcm2290.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/qcom/gcc-qcm2290.c +2 -1
@@ -1243,7 +1243,8 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = { .name = "gcc_sdcc2_apps_clk_src", .parent_data = gcc_parents_12, .num_parents = ARRAY_SIZE(gcc_parents_12), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_floor_ops, + .flags = CLK_OPS_PARENT_ENABLE, }, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 584/694 workqueue: Fix hung time report of worker pools
In reply to Greg Kroah-HartmanFrom: Petr Mladek <[email protected]>
[ Upstream commit 335a42ebb0ca8ee9997a1731aaaae6dcd704c113 ]
The workqueue watchdog prints a warning when there is no progress in a worker pool. Where the progress means that the pool started processing a pending work item.
Note that it is perfectly fine to process work items much longer. The progress should be guaranteed by waking up or creating idle workers.
show_one_worker_pool() prints state of non-idle worker pool. It shows a delay since the last pool->watchdog_ts.
The timestamp is updated when a first pending work is queued in __queue_work(). Also it is updated when a work is dequeued for processing in worker_thread() and rescuer_thread().
The delay is misleading when there is no pending work item. In this case it shows how long the last work item is being proceed. Show zero instead. There is no stall if there is no pending work.
--- kernel/workqueue.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
kernel/workqueue.c +7 -3
@@ -5002,10 +5002,16 @@ static void show_one_worker_pool(struct worker_pool *pool)struct worker *worker;bool first = true;unsigned long flags; +unsigned long hung =0 ;raw_spin_lock_irqsave (&pool->lock, flags);if (pool->nr_workers == pool->nr_idle) goto next_pool; + +/* How long the first pending work is waiting for a worker. */ +if (!list_empty (&pool->worklist)) + hung =jiffies_to_msecs (jiffies - pool->watchdog_ts) /1000 ; +/* * Defer printing to avoid deadlocks in console drivers that * queue work while holding locks also taken in their write
@@ -5014,9 +5020,7 @@ static void show_one_worker_pool(struct worker_pool *pool)printk_deferred_enter ();pr_info ("pool %d:" , pool->id);pr_cont_pool_info (pool); -pr_cont (" hung=%us workers=%d" , -jiffies_to_msecs (jiffies - pool->watchdog_ts) /1000 , - pool->nr_workers); +pr_cont (" hung=%lus workers=%d" , hung, pool->nr_workers);if (pool->manager)pr_cont (" manager: %d" ,task_pid_nr (pool->manager->task));
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 585/694 rtc: omap: include header for omap_rtc_power_off_program prototype
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit f69c2b5420497b7a54181ce170d682cbeb1f119f ]
Non-static functions should have a prototype:
drivers/rtc/rtc-omap.c:410:5: error: no previous prototype for ‘omap_rtc_power_off_program’ [-Werror=missing-prototypes]
--- drivers/rtc/rtc-omap.c | 1 + 1 file changed, 1 insertion(+)
drivers/rtc/rtc-omap.c +1 -0
@@ -25,6 +25,7 @@#include <linux/platform_device.h> #include <linux/pm_runtime.h> #include <linux/rtc.h> +#include <linux/rtc/rtc-omap.h> /* * The OMAP RTC is a year/month/day/hours/minutes/seconds BCD clock
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 586/694 RDMA/mlx4: Prevent shift wrapping in set_user_sq_size()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit d50b3c73f1ac20dabc53dc6e9d64ce9c79a331eb ]
The ucmd->log_sq_bb_count variable is controlled by the user so this shift can wrap. Fix it by using check_shl_overflow() in the same way that it was done in commit 515f60004ed9 ("RDMA/hns: Prevent undefined behavior in hns_roce_set_user_sq_size()").
--- drivers/infiniband/hw/mlx4/qp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx4/qp.c +6 -2
@@ -447,9 +447,13 @@ static int set_user_sq_size(struct mlx4_ib_dev *dev,struct mlx4_ib_qp *qp, struct mlx4_ib_create_qp *ucmd) { + u32 cnt; +/* Sanity check SQ size before proceeding */ -if ((1 << ucmd->log_sq_bb_count) > dev->dev->caps.max_wqes || - ucmd->log_sq_stride > +if (check_shl_overflow (1 , ucmd->log_sq_bb_count, &cnt) || + cnt > dev->dev->caps.max_wqes) +return -EINVAL ; +if (ucmd->log_sq_stride >ilog2 (roundup_pow_of_two (dev->dev->caps.max_sq_desc_sz)) || ucmd->log_sq_stride <MLX4_IB_MIN_SQ_STRIDE )return -EINVAL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 587/694 rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time
In reply to Greg Kroah-HartmanFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit 0e6255fa3f649170da6bd1a544680589cfae1131 ]
The VRTC alarm register can be programmed with an amount of seconds after which the SoC will be woken up by the VRTC timer again. We are already converting the alarm time from meson_vrtc_set_alarm() to "seconds since 1970". This means we also need to use "seconds since 1970" for the current time.
This fixes a problem where setting the alarm to one minute in the future results in the firmware (which handles wakeup) to output (on the serial console) that the system will be woken up in billions of seconds. ktime_get_raw_ts64() returns the time since boot, not since 1970. Switch to ktime_get_real_ts64() to fix the calculation of the alarm time and to make the SoC wake up at the specified date/time. Also the firmware (which manages suspend) now prints either 59 or 60 seconds until wakeup (depending on how long it takes for the system to enter suspend).
--- drivers/rtc/rtc-meson-vrtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/rtc/rtc-meson-vrtc.c +2 -2
@@ -23,7 +23,7 @@ static int meson_vrtc_read_time(struct device *dev, struct rtc_time *tm)struct timespec64 time;dev_dbg (dev,"%s\n" , __func__); -ktime_get_raw_ts64 (&time); +ktime_get_real_ts64 (&time);rtc_time64_to_tm (time.tv_sec, tm);return 0 ;
@@ -96,7 +96,7 @@ static int __maybe_unused meson_vrtc_suspend(struct device *dev)long alarm_secs;struct timespec64 time; -ktime_get_raw_ts64 (&time); +ktime_get_real_ts64 (&time); local_time = time.tv_sec; dev_dbg(dev, "alarm_time = %lus, local_time=%lus\n",
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 588/694 rtc: k3: handle errors while enabling wake irq
In reply to Greg Kroah-HartmanFrom: Dhruva Gole <[email protected]>
[ Upstream commit d31d7300ebc0c43021ec48c0e6a3a427386f4617 ]
Due to the potential failure of enable_irq_wake(), it would be better to return error if it fails.
--- drivers/rtc/rtc-ti-k3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rtc/rtc-ti-k3.c +2 -1
@@ -632,7 +632,8 @@ static int __maybe_unused ti_k3_rtc_suspend(struct device *dev)struct ti_k3_rtc *priv =dev_get_drvdata (dev);if (device_may_wakeup (dev)) -enable_irq_wake (priv->irq); +return enable_irq_wake (priv->irq); +return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 589/694 RDMA/rxe: Replace exists by rxe in rxe.c
In reply to Greg Kroah-HartmanFrom: Bob Pearson <[email protected]>
[ Upstream commit 9168d125ea032ad199275193493c13cb077da5cc ]
'exists' looks like a boolean. This patch replaces it by the normal name used for the rxe device, 'rxe', which should be a little less confusing. The second rxe_dbg() message is incorrect since rxe is known to be NULL and this will cause a seg fault if this message were ever sent. Replace it by pr_debug for the moment.
--- drivers/infiniband/sw/rxe/rxe.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/infiniband/sw/rxe/rxe.c +6 -6
@@ -175,7 +175,7 @@ int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name)static int rxe_newlink (const char *ibdev_name,struct net_device *ndev) { -struct rxe_dev *exists; +struct rxe_dev *rxe;int err =0 ;if (is_vlan_dev (ndev)) {
@@ -184,17 +184,17 @@ static int rxe_newlink(const char *ibdev_name, struct net_device *ndev) goto err; } - exists =rxe_get_dev_from_net (ndev); -if (exists) { -ib_device_put (&exists->ib_dev); -rxe_dbg (exists,"already configured on %s\n" , ndev->name); + rxe =rxe_get_dev_from_net (ndev); +if (rxe) { +ib_device_put (&rxe->ib_dev); +rxe_dbg (rxe,"already configured on %s\n" , ndev->name); err = -EEXIST ; goto err; } err =rxe_net_add (ibdev_name, ndev);if (err) { -rxe_dbg (exists,"failed to add %s\n" , ndev->name); +pr_debug ("failed to add %s\n" , ndev->name); goto err; } err:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 590/694 RDMA/erdma: Use fixed hardware page size
In reply to Greg Kroah-HartmanFrom: Cheng Xu <[email protected]>
[ Upstream commit d649c638dc26f3501da510cf7fceb5c15ca54258 ]
Hardware's page size is 4096, but the kernel's page size may vary. Driver should use hardware's page size when communicating with hardware.
--- drivers/infiniband/hw/erdma/erdma_hw.h | 4 ++++ drivers/infiniband/hw/erdma/erdma_verbs.c | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-)
drivers/infiniband/hw/erdma/erdma_hw.h +4 -0
@@ -112,6 +112,10 @@#define ERDMA_PAGE_SIZE_SUPPORT 0x7FFFF000 +/* Hardware page size definition */ +#define ERDMA_HW_PAGE_SHIFT 12 +#define ERDMA_HW_PAGE_SIZE 4096 +/* WQE related. */ #define EQE_SIZE 16#define EQE_SHIFT 4
drivers/infiniband/hw/erdma/erdma_verbs.c +9 -8
@@ -38,7 +38,7 @@ static int create_qp_cmd(struct erdma_dev *dev, struct erdma_qp *qp)FIELD_PREP (ERDMA_CMD_CREATE_QP_PD_MASK , pd->pdn);if (rdma_is_kernel_res (&qp->ibqp.res)) { -u32 pgsz_range =ilog2 (SZ_1M ) -PAGE_SHIFT ; +u32 pgsz_range =ilog2 (SZ_1M ) -ERDMA_HW_PAGE_SHIFT ; req.sq_cqn_mtt_cfg = FIELD_PREP(ERDMA_CMD_CREATE_QP_PAGE_SIZE_MASK,
@@ -66,13 +66,13 @@ static int create_qp_cmd(struct erdma_dev *dev, struct erdma_qp *qp) user_qp = &qp->user_qp; req.sq_cqn_mtt_cfg =FIELD_PREP (ERDMA_CMD_CREATE_QP_PAGE_SIZE_MASK , -ilog2 (user_qp->sq_mtt.page_size) -PAGE_SHIFT ); +ilog2 (user_qp->sq_mtt.page_size) -ERDMA_HW_PAGE_SHIFT ); req.sq_cqn_mtt_cfg |=FIELD_PREP (ERDMA_CMD_CREATE_QP_CQN_MASK , qp->scq->cqn); req.rq_cqn_mtt_cfg =FIELD_PREP (ERDMA_CMD_CREATE_QP_PAGE_SIZE_MASK , -ilog2 (user_qp->rq_mtt.page_size) -PAGE_SHIFT ); +ilog2 (user_qp->rq_mtt.page_size) -ERDMA_HW_PAGE_SHIFT ); req.rq_cqn_mtt_cfg |=FIELD_PREP (ERDMA_CMD_CREATE_QP_CQN_MASK , qp->rcq->cqn);
@@ -162,7 +162,7 @@ static int create_cq_cmd(struct erdma_dev *dev, struct erdma_cq *cq)if (rdma_is_kernel_res (&cq->ibcq.res)) { page_size =SZ_32M ; req.cfg0 |=FIELD_PREP (ERDMA_CMD_CREATE_CQ_PAGESIZE_MASK , -ilog2 (page_size) -PAGE_SHIFT ); +ilog2 (page_size) -ERDMA_HW_PAGE_SHIFT ); req.qbuf_addr_l =lower_32_bits (cq->kern_cq.qbuf_dma_addr); req.qbuf_addr_h =upper_32_bits (cq->kern_cq.qbuf_dma_addr);
@@ -175,8 +175,9 @@ static int create_cq_cmd(struct erdma_dev *dev, struct erdma_cq *cq) cq->kern_cq.qbuf_dma_addr + (cq->depth <<CQE_SHIFT ); }else { mtt = &cq->user_cq.qbuf_mtt; - req.cfg0 |=FIELD_PREP (ERDMA_CMD_CREATE_CQ_PAGESIZE_MASK , -ilog2 (mtt->page_size) -PAGE_SHIFT ); + req.cfg0 |= +FIELD_PREP (ERDMA_CMD_CREATE_CQ_PAGESIZE_MASK , +ilog2 (mtt->page_size) -ERDMA_HW_PAGE_SHIFT );if (mtt->mtt_nents ==1 ) { req.qbuf_addr_l =lower_32_bits (*(u64 *)mtt->mtt_buf); req.qbuf_addr_h =upper_32_bits (*(u64 *)mtt->mtt_buf);
@@ -636,7 +637,7 @@ static int init_user_qp(struct erdma_qp *qp, struct erdma_ucontext *uctx,u32 rq_offset;int ret; -if (len < (PAGE_ALIGN (qp->attrs.sq_size *SQEBB_SIZE ) + +if (len < (ALIGN (qp->attrs.sq_size *SQEBB_SIZE ,ERDMA_HW_PAGE_SIZE ) + qp->attrs.rq_size *RQE_SIZE ))return -EINVAL ;
@@ -646,7 +647,7 @@ static int init_user_qp(struct erdma_qp *qp, struct erdma_ucontext *uctx,if (ret)return ret; - rq_offset =PAGE_ALIGN (qp->attrs.sq_size <<SQEBB_SHIFT ); + rq_offset =ALIGN (qp->attrs.sq_size <<SQEBB_SHIFT ,ERDMA_HW_PAGE_SIZE ); qp->user_qp.rq_offset = rq_offset; ret = get_mtt_entries(qp->dev, &qp->user_qp.rq_mtt, va + rq_offset,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 591/694 fs/ntfs3: Fix memory leak if ntfs_read_mft failed
In reply to Greg Kroah-HartmanFrom: Chen Zhongjin <[email protected]>
[ Upstream commit bfa434c60157c9793e9b12c9b68ade02aff9f803 ]
Label ATTR_ROOT in ntfs_read_mft() sets is_root = true and ni->ni_flags |= NI_FLAG_DIR, then next attr will goto label ATTR_ALLOC and alloc ni->dir.alloc_run. However two states are not always consistent and can make memory leak.
1) attr_name in ATTR_ROOT does not fit the condition it will set is_root = true but NI_FLAG_DIR is not set.
2) next attr_name in ATTR_ALLOC fits the condition and alloc ni->dir.alloc_run
3) in cleanup function ni_clear(), when NI_FLAG_DIR is set, it frees ni->dir.alloc_run, otherwise it frees ni->file.run
4) because NI_FLAG_DIR is not set in this case, ni->dir.alloc_run is leaked as kmemleak reported:
unreferenced object 0xffff888003bc5480 (size 64):
backtrace:
[<000000003d42e6b0>] __kmalloc_node+0x4e/0x1c0
[<00000000d8e19b8a>] kvmalloc_node+0x39/0x1f0
[<00000000fc3eb5b8>] run_add_entry+0x18a/0xa40 [ntfs3]
[<0000000011c9f978>] run_unpack+0x75d/0x8e0 [ntfs3]
[<00000000e7cf1819>] run_unpack_ex+0xbc/0x500 [ntfs3]
[<00000000bbf0a43d>] ntfs_iget5+0xb25/0x2dd0 [ntfs3]
[<00000000a6e50693>] ntfs_fill_super+0x218d/0x3580 [ntfs3]
[<00000000b9170608>] get_tree_bdev+0x3fb/0x710
[<000000004833798a>] vfs_get_tree+0x8e/0x280
[<000000006e20b8e6>] path_mount+0xf3c/0x1930
[<000000007bf15a5f>] do_mount+0xf3/0x110
...Fix this by always setting is_root and NI_FLAG_DIR together.
--- fs/ntfs3/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs3/inode.c +1 -1
@@ -259,7 +259,6 @@ static struct inode *ntfs_read_mft(struct inode *inode, goto out; root =Add2Ptr (attr, roff); - is_root = true;if (attr->name_len !=ARRAY_SIZE (I30_NAME ) ||memcmp (attr_name (attr),I30_NAME ,sizeof (I30_NAME )))
@@ -272,6 +271,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,if (!is_dir) goto next_attr; + is_root = true; ni->ni_flags |=NI_FLAG_DIR ; err =indx_init (&ni->dir, sbi, attr,INDEX_MUTEX_I30 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 592/694 fs/ntfs3: Add check for kmemdup
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit e6c3cef24cb0d045f99d5cb039b344874e3cfd74 ]
Since the kmemdup may return NULL pointer,
it should be better to add check for the return value in order to avoid NULL pointer dereference.
--- fs/ntfs3/fslog.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ntfs3/fslog.c +4 -0
@@ -4256,6 +4256,10 @@ int log_replay(struct ntfs_inode *ni, bool *initialized) rec_len -= t32; attr_names =kmemdup (Add2Ptr (lrh, t32), rec_len,GFP_NOFS ); +if (!attr_names) { + err = -ENOMEM ; + goto out; + }lcb_put (lcb); lcb =NULL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 593/694 fs/ntfs3: Fix null-ptr-deref on inode->i_op in ntfs_lookup()
In reply to Greg Kroah-HartmanFrom: ZhangPeng <[email protected]>
[ Upstream commit 254e69f284d7270e0abdc023ee53b71401c3ba0c ]
Syzbot reported a null-ptr-deref bug:
ntfs3: loop0: Different NTFS' sector size (1024) and media sector size
(512)
ntfs3: loop0: Mark volume as dirty due to NTFS errors
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] RIP: 0010:d_flags_for_inode fs/dcache.c:1980 [inline] RIP: 0010:__d_add+0x5ce/0x800 fs/dcache.c:2796 Call Trace: <TASK> d_splice_alias+0x122/0x3b0 fs/dcache.c:3191 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3688 do_filp_open+0x264/0x4f0 fs/namei.c:3718 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_open fs/open.c:1334 [inline] __se_sys_open fs/open.c:1330 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1330 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
If the MFT record of ntfs inode is not a base record, inode->i_op can be NULL. And a null-ptr-deref may happen:
ntfs_lookup()
dir_search_u() # inode->i_op is set to NULL
d_splice_alias()
__d_add()
d_flags_for_inode() # inode->i_op->get_link null-ptr-derefFix this by adding a Check on inode->i_op before calling the d_splice_alias() function.
--- fs/ntfs3/namei.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
fs/ntfs3/namei.c +10 -0
@@ -88,6 +88,16 @@ static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *dentry,__putname (uni); } +/* +* Check for a null pointer +* If the MFT record of ntfs inode is not a base record, inode->i_op can be NULL. +* This causes null pointer dereference in d_splice_alias(). +*/ +if (!IS_ERR (inode) && inode->i_op ==NULL ) { +iput (inode); + inode =ERR_PTR (-EINVAL ); + } +return d_splice_alias (inode, dentry); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 594/694 fs/ntfs3: Fix OOB read in indx_insert_into_buffer
In reply to Greg Kroah-HartmanFrom: ZhangPeng <[email protected]>
[ Upstream commit b8c44949044e5f7f864525fdffe8e95135ce9ce5 ]
Syzbot reported a OOB read bug:
BUG: KASAN: slab-out-of-bounds in indx_insert_into_buffer+0xaa3/0x13b0 fs/ntfs3/index.c:1755 Read of size 17168 at addr ffff8880255e06c0 by task syz-executor308/3630 Call Trace: <TASK> memmove+0x25/0x60 mm/kasan/shadow.c:54 indx_insert_into_buffer+0xaa3/0x13b0 fs/ntfs3/index.c:1755 indx_insert_entry+0x446/0x6b0 fs/ntfs3/index.c:1863 ntfs_create_inode+0x1d3f/0x35c0 fs/ntfs3/inode.c:1548 ntfs_create+0x3e/0x60 fs/ntfs3/namei.c:100 lookup_open fs/namei.c:3413 [inline]
If the member struct INDEX_BUFFER *index of struct indx_node is incorrect, that is, the value of __le32 used is greater than the value of __le32 total in struct INDEX_HDR. Therefore, OOB read occurs when memmove is called in indx_insert_into_buffer().
Fix this by adding a check in hdr_find_e().
--- fs/ntfs3/index.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ntfs3/index.c +4 -0
@@ -725,9 +725,13 @@ static struct NTFS_DE *hdr_find_e(const struct ntfs_index *indx,u32 e_size, e_key_len;u32 end =le32_to_cpu (hdr->used);u32 off =le32_to_cpu (hdr->de_off); +u32 total =le32_to_cpu (hdr->total);u16 offs[128 ]; fill_table: +if (end > total) +return NULL ; +if (off +sizeof (struct NTFS_DE ) > end)return NULL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 595/694 fs/ntfs3: Fix slab-out-of-bounds read in hdr_delete_de()
In reply to Greg Kroah-HartmanFrom: Zeng Heng <[email protected]>
[ Upstream commit ab84eee4c7ab929996602eda7832854c35a6dda2 ]
Here is a BUG report from syzbot:
BUG: KASAN: slab-out-of-bounds in hdr_delete_de+0xe0/0x150 fs/ntfs3/index.c:806 Read of size 16842960 at addr ffff888079cc0600 by task syz-executor934/3631 Call Trace: memmove+0x25/0x60 mm/kasan/shadow.c:54 hdr_delete_de+0xe0/0x150 fs/ntfs3/index.c:806 indx_delete_entry+0x74f/0x3670 fs/ntfs3/index.c:2193 ni_remove_name+0x27a/0x980 fs/ntfs3/frecord.c:2910 ntfs_unlink_inode+0x3d4/0x720 fs/ntfs3/inode.c:1712 ntfs_rename+0x41a/0xcb0 fs/ntfs3/namei.c:276
Before using the meta-data in struct INDEX_HDR, we need to check index header valid or not. Otherwise, the corruptedi (or malicious) fs image can cause out-of-bounds access which could make kernel panic.
--- fs/ntfs3/fslog.c | 2 +- fs/ntfs3/index.c | 4 ++++ fs/ntfs3/ntfs_fs.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-)
fs/ntfs3/fslog.c +1 -1
@@ -2575,7 +2575,7 @@ static int read_next_log_rec(struct ntfs_log *log, struct lcb *lcb, u64 *lsn)return find_log_rec (log, *lsn, lcb); } -static inline bool check_index_header (const struct INDEX_HDR *hdr,size_t bytes) +bool check_index_header (const struct INDEX_HDR *hdr,size_t bytes) {__le16 mask;u32 min_de, de_off, used, total;
fs/ntfs3/index.c +4 -0
@@ -848,6 +848,10 @@ static inline struct NTFS_DE *hdr_delete_de(struct INDEX_HDR *hdr,u32 off =PtrOffset (hdr, re);int bytes = used - (off + esize); +/* check INDEX_HDR valid before using INDEX_HDR */ +if (!check_index_header (hdr,le32_to_cpu (hdr->total))) +return NULL ; +if (off >= used || esize <sizeof (struct NTFS_DE ) || bytes <sizeof (struct NTFS_DE ))return NULL ;
fs/ntfs3/ntfs_fs.h +1 -0
@@ -581,6 +581,7 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,bool ni_is_dirty (struct inode *inode);/* Globals from fslog.c */ +bool check_index_header (const struct INDEX_HDR *hdr,size_t bytes);int log_replay (struct ntfs_inode *ni,bool *initialized);/* Globals from fsntfs.c */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 596/694 iommu/mediatek: Set dma_mask for PGTABLE_PA_35_EN
In reply to Greg Kroah-HartmanFrom: Yong Wu <[email protected]>
[ Upstream commit f045e9df6537175d02565f21616ac1a9dd59b61c ]
When we enable PGTABLE_PA_35_EN, the PA for pgtable may be 35bits. Thus add dma_mask for it.
--- drivers/iommu/mtk_iommu.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/iommu/mtk_iommu.c +8 -0
@@ -1258,6 +1258,14 @@ static int mtk_iommu_probe(struct platform_device *pdev)return PTR_ERR (data->bclk); } +if (MTK_IOMMU_HAS_FLAG (data->plat_data,PGTABLE_PA_35_EN )) { + ret =dma_set_mask (dev,DMA_BIT_MASK (35 )); +if (ret) { +dev_err (dev,"Failed to set dma_mask 35.\n" ); +return ret; + } + } +pm_runtime_enable (dev);if (MTK_IOMMU_IS_TYPE (data->plat_data,MTK_IOMMU_TYPE_MM )) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 597/694 RDMA/rxe: Remove tasklet call from rxe_cq.c
In reply to Greg Kroah-HartmanFrom: Bob Pearson <[email protected]>
[ Upstream commit 78b26a335310a097d6b22581b706050db42f196c ]
Remove the tasklet call in rxe_cq.c and also the is_dying in the cq struct. There is no reason for the rxe driver to defer the call to the cq completion handler by scheduling a tasklet. rxe_cq_post() is not called in a hard irq context.
The rxe driver currently is incorrect because the tasklet call is made without protecting the cq pointer with a reference from having the underlying memory freed before the deferred routine is called. Executing the comp_handler inline fixes this problem.
--- drivers/infiniband/sw/rxe/rxe_cq.c | 32 +++----------------------------- drivers/infiniband/sw/rxe/rxe_verbs.c | 2 -- drivers/infiniband/sw/rxe/rxe_verbs.h | 2 -- 3 files changed, 3 insertions(+), 33 deletions(-)
drivers/infiniband/sw/rxe/rxe_cq.c +3 -29
@@ -39,21 +39,6 @@ err1:return -EINVAL ; } -static void rxe_send_complete (struct tasklet_struct *t) -{ -struct rxe_cq *cq =from_tasklet (cq, t, comp_task); -unsigned long flags; - -spin_lock_irqsave (&cq->cq_lock, flags); -if (cq->is_dying) { -spin_unlock_irqrestore (&cq->cq_lock, flags); -return ; - } -spin_unlock_irqrestore (&cq->cq_lock, flags); - - cq->ibcq.comp_handler (&cq->ibcq, cq->ibcq.cq_context); -} -int rxe_cq_from_init (struct rxe_dev *rxe,struct rxe_cq *cq,int cqe,int comp_vector,struct ib_udata *udata,struct rxe_create_cq_resp __user *uresp)
@@ -79,10 +64,6 @@ int rxe_cq_from_init(struct rxe_dev *rxe cq->is_user = uresp; - cq->is_dying = false; - -tasklet_setup (&cq->comp_task, rxe_send_complete); -spin_lock_init (&cq->cq_lock); cq->ibcq.cqe = cqe;return 0 ;
@@ -103,6 +84,7 @@ int rxe_cq_resize_queue(struct rxe_cq *creturn err; } +/* caller holds reference to cq */ int rxe_cq_post (struct rxe_cq *cq,struct rxe_cqe *cqe,int solicited) {struct ib_event ev;
@@ -135,21 +117,13 @@ int rxe_cq_post(struct rxe_cq *cq, strucif ((cq->notify ==IB_CQ_NEXT_COMP ) || (cq->notify ==IB_CQ_SOLICITED && solicited)) { cq->notify =0 ; -tasklet_schedule (&cq->comp_task); + + cq->ibcq.comp_handler (&cq->ibcq, cq->ibcq.cq_context); }return 0 ; } -void rxe_cq_disable (struct rxe_cq *cq) -{ -unsigned long flags; - -spin_lock_irqsave (&cq->cq_lock, flags); - cq->is_dying = true; -spin_unlock_irqrestore (&cq->cq_lock, flags); -} -void rxe_cq_cleanup (struct rxe_pool_elem *elem) {struct rxe_cq *cq =container_of (elem,typeof (*cq), elem);
drivers/infiniband/sw/rxe/rxe_verbs.c +0 -2
@@ -786,8 +786,6 @@ static int rxe_destroy_cq(struct ib_cq *if (atomic_read (&cq->num_wq))return -EINVAL ; -rxe_cq_disable (cq); -rxe_cleanup (cq);return 0 ; }
drivers/infiniband/sw/rxe/rxe_verbs.h +0 -2
@@ -63,9 +63,7 @@ struct rxe_cq {struct rxe_queue *queue;spinlock_t cq_lock;u8 notify; -bool is_dying;bool is_user; -struct tasklet_struct comp_task;atomic_t num_wq; };
Greg Kroah-Hartman
maintainerPATCH 598/694 power: supply: generic-adc-battery: fix unit scaling
In reply to Greg Kroah-HartmanFrom: Sebastian Reichel <[email protected]>
[ Upstream commit 44263f50065969f2344808388bd589740f026167 ]
power-supply properties are reported in µV, µA and µW. The IIO API provides mV, mA, mW, so the values need to be multiplied by 1000.
--- drivers/power/supply/generic-adc-battery.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/power/supply/generic-adc-battery.c +3 -0
@@ -135,6 +135,9 @@ static int read_channel(struct gab *adc_bat, enum power_supply_property psp, result);if (ret <0 )pr_err ("read channel error\n" ); +else + *result *=1000 ; +return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 599/694 clk: add missing of_node_put() in "assigned-clocks" property parsing
In reply to Greg Kroah-HartmanFrom: Clément Léger <[email protected]>
[ Upstream commit 27a6e1b09a782517fddac91259970ac466a3f7b6 ]
When returning from of_parse_phandle_with_args(), the np member of the of_phandle_args structure should be put after usage. Add missing of_node_put() calls in both __set_clk_parents() and __set_clk_rates().
--- drivers/clk/clk-conf.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/clk/clk-conf.c +10 -2
@@ -33,9 +33,12 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)else return rc; } -if (clkspec.np == node && !clk_supplier) +if (clkspec.np == node && !clk_supplier) { +of_node_put (clkspec.np);return 0 ; + } pclk =of_clk_get_from_provider (&clkspec); +of_node_put (clkspec.np);if (IS_ERR (pclk)) {if (PTR_ERR (pclk) != -EPROBE_DEFER ) pr_warn("clk: couldn't get parent clock %d for %pOF\n",
@@ -48,10 +51,12 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)if (rc <0 ) goto err;if (clkspec.np == node && !clk_supplier) { +of_node_put (clkspec.np); rc =0 ; goto err; } clk =of_clk_get_from_provider (&clkspec); +of_node_put (clkspec.np);if (IS_ERR (clk)) {if (PTR_ERR (clk) != -EPROBE_DEFER ) pr_warn("clk: couldn't get assigned clock %d for %pOF\n",
@@ -93,10 +98,13 @@ static int __set_clk_rates(struct device_node *node, bool clk_supplier)else return rc; } -if (clkspec.np == node && !clk_supplier) +if (clkspec.np == node && !clk_supplier) { +of_node_put (clkspec.np);return 0 ; + } clk =of_clk_get_from_provider (&clkspec); +of_node_put (clkspec.np);if (IS_ERR (clk)) {if (PTR_ERR (clk) != -EPROBE_DEFER ) pr_warn("clk: couldn't get clock %d for %pOF\n",
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 600/694 RDMA/siw: Remove namespace check from siw_netdev_event()
In reply to Greg Kroah-HartmanFrom: Tetsuo Handa <[email protected]>
[ Upstream commit 266e9b3475ba82212062771fdbc40be0e3c06ec8 ]
syzbot is reporting that siw_netdev_event(NETDEV_UNREGISTER) cannot destroy siw_device created after unshare(CLONE_NEWNET) due to net namespace check. It seems that this check was by error there and should be removed.
--- drivers/infiniband/sw/siw/siw_main.c | 3 --- 1 file changed, 3 deletions(-)
drivers/infiniband/sw/siw/siw_main.c +0 -3
@@ -437,9 +437,6 @@ static int siw_netdev_event(struct notifier_block *nb, unsigned long event,dev_dbg (&netdev->dev,"siw: event %lu\n" , event); -if (dev_net (netdev) != &init_net) -return NOTIFY_OK ; - base_dev =ib_device_get_by_netdev (netdev,RDMA_DRIVER_SIW );if (!base_dev)return NOTIFY_OK ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 601/694 clk: qcom: gcc-sm6115: Mark RCGs shared where applicable
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 996c32b745a15a637e8244a25f06b74acce98976 ]
The vast majority of shared RCGs were not marked as such. Fix it.
--- drivers/clk/qcom/gcc-sm6115.c | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-)
drivers/clk/qcom/gcc-sm6115.c +25 -25
@@ -694,7 +694,7 @@ static struct clk_rcg2 gcc_camss_axi_clk_src = { .parent_data = gcc_parents_7, .num_parents = ARRAY_SIZE(gcc_parents_7), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -715,7 +715,7 @@ static struct clk_rcg2 gcc_camss_cci_clk_src = { .parent_data = gcc_parents_9, .num_parents = ARRAY_SIZE(gcc_parents_9), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -738,7 +738,7 @@ static struct clk_rcg2 gcc_camss_csi0phytimer_clk_src = { .parent_data = gcc_parents_4, .num_parents = ARRAY_SIZE(gcc_parents_4), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -753,7 +753,7 @@ static struct clk_rcg2 gcc_camss_csi1phytimer_clk_src = { .parent_data = gcc_parents_4, .num_parents = ARRAY_SIZE(gcc_parents_4), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -768,7 +768,7 @@ static struct clk_rcg2 gcc_camss_csi2phytimer_clk_src = { .parent_data = gcc_parents_4, .num_parents = ARRAY_SIZE(gcc_parents_4), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -790,7 +790,7 @@ static struct clk_rcg2 gcc_camss_mclk0_clk_src = { .parent_data = gcc_parents_3, .num_parents = ARRAY_SIZE(gcc_parents_3), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -805,7 +805,7 @@ static struct clk_rcg2 gcc_camss_mclk1_clk_src = { .parent_data = gcc_parents_3, .num_parents = ARRAY_SIZE(gcc_parents_3), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -820,7 +820,7 @@ static struct clk_rcg2 gcc_camss_mclk2_clk_src = { .parent_data = gcc_parents_3, .num_parents = ARRAY_SIZE(gcc_parents_3), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -835,7 +835,7 @@ static struct clk_rcg2 gcc_camss_mclk3_clk_src = { .parent_data = gcc_parents_3, .num_parents = ARRAY_SIZE(gcc_parents_3), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -857,7 +857,7 @@ static struct clk_rcg2 gcc_camss_ope_ahb_clk_src = { .parent_data = gcc_parents_8, .num_parents = ARRAY_SIZE(gcc_parents_8), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -881,7 +881,7 @@ static struct clk_rcg2 gcc_camss_ope_clk_src = { .parent_data = gcc_parents_8, .num_parents = ARRAY_SIZE(gcc_parents_8), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -916,7 +916,7 @@ static struct clk_rcg2 gcc_camss_tfe_0_clk_src = { .parent_data = gcc_parents_5, .num_parents = ARRAY_SIZE(gcc_parents_5), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -941,7 +941,7 @@ static struct clk_rcg2 gcc_camss_tfe_0_csid_clk_src = { .parent_data = gcc_parents_6, .num_parents = ARRAY_SIZE(gcc_parents_6), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -956,7 +956,7 @@ static struct clk_rcg2 gcc_camss_tfe_1_clk_src = { .parent_data = gcc_parents_5, .num_parents = ARRAY_SIZE(gcc_parents_5), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -971,7 +971,7 @@ static struct clk_rcg2 gcc_camss_tfe_1_csid_clk_src = { .parent_data = gcc_parents_6, .num_parents = ARRAY_SIZE(gcc_parents_6), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -986,7 +986,7 @@ static struct clk_rcg2 gcc_camss_tfe_2_clk_src = { .parent_data = gcc_parents_5, .num_parents = ARRAY_SIZE(gcc_parents_5), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1001,7 +1001,7 @@ static struct clk_rcg2 gcc_camss_tfe_2_csid_clk_src = { .parent_data = gcc_parents_6, .num_parents = ARRAY_SIZE(gcc_parents_6), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1024,7 +1024,7 @@ static struct clk_rcg2 gcc_camss_tfe_cphy_rx_clk_src = { .parent_data = gcc_parents_10, .num_parents = ARRAY_SIZE(gcc_parents_10), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1046,7 +1046,7 @@ static struct clk_rcg2 gcc_camss_top_ahb_clk_src = { .parent_data = gcc_parents_7, .num_parents = ARRAY_SIZE(gcc_parents_7), .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1116,7 +1116,7 @@ static struct clk_rcg2 gcc_pdm2_clk_src = { .name = "gcc_pdm2_clk_src", .parent_data = gcc_parents_0, .num_parents = ARRAY_SIZE(gcc_parents_0), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1329,7 +1329,7 @@ static struct clk_rcg2 gcc_ufs_phy_axi_clk_src = { .name = "gcc_ufs_phy_axi_clk_src", .parent_data = gcc_parents_0, .num_parents = ARRAY_SIZE(gcc_parents_0), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1351,7 +1351,7 @@ static struct clk_rcg2 gcc_ufs_phy_ice_core_clk_src = { .name = "gcc_ufs_phy_ice_core_clk_src", .parent_data = gcc_parents_0, .num_parents = ARRAY_SIZE(gcc_parents_0), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1392,7 +1392,7 @@ static struct clk_rcg2 gcc_ufs_phy_unipro_core_clk_src = { .name = "gcc_ufs_phy_unipro_core_clk_src", .parent_data = gcc_parents_0, .num_parents = ARRAY_SIZE(gcc_parents_0), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1414,7 +1414,7 @@ static struct clk_rcg2 gcc_usb30_prim_master_clk_src = { .name = "gcc_usb30_prim_master_clk_src", .parent_data = gcc_parents_0, .num_parents = ARRAY_SIZE(gcc_parents_0), - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
@@ -1483,7 +1483,7 @@ static struct clk_rcg2 gcc_video_venus_clk_src = { .parent_data = gcc_parents_13, .num_parents = ARRAY_SIZE(gcc_parents_13), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 602/694 power: supply: rk817: Fix low SOC bugs
In reply to Greg Kroah-HartmanFrom: Chris Morgan <[email protected]>
[ Upstream commit baba1315a74d12772d4940a05d58dc03e6ec0635 ]
When the SOC approaches zero, an integer overflows in the columb counter causing the driver to react poorly. This makes the driver think it's at (above) the fully charged capacity when in fact it's zero. It would then write this full capacity to NVRAM which would be used on boot if the device remained off for less than 5 hours and not plugged in.
This can be fixed and guarded against by doing the following:
- Changing the type of tmp in rk817_read_or_set_full_charge_on_boot() to be an int instead of a u32. That way we can account for negative numbers.
- Guard against negative values for the full charge on boot by setting the charge to 0 if the system charge reports less than 0.
- Catch scenarios where the battery voltage is below the design minimum voltage and set the system SOC to 0 at that time and update the columb counter with a charge level of 0.
- Change the off time value from 5 hours to 30 minutes before we recalculate the current capacity based on the OCV tables.
These changes allow the driver to operate better at low voltage/low capacity conditions.
--- drivers/power/supply/rk817_charger.c | 33 ++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 7 deletions(-)
drivers/power/supply/rk817_charger.c +26 -7
@@ -335,6 +335,20 @@ static int rk817_bat_calib_cap(struct rk817_charger *charger) charger->fcc_mah * 1000); } +/* +* Set the SOC to 0 if we are below the minimum system voltage. +*/ +if (volt_avg <= charger->bat_voltage_min_design_uv) { + charger->soc =0 ; + charge_now_adc =CHARGE_TO_ADC (0 , charger->res_div); +put_unaligned_be32 (charge_now_adc, bulk_reg); +regmap_bulk_write (rk808->regmap, +RK817_GAS_GAUGE_Q_INIT_H3 , bulk_reg,4 ); +dev_warn (charger->dev, +"Battery voltage %d below minimum voltage %d\n" , + volt_avg, charger->bat_voltage_min_design_uv); + } +rk817_record_battery_nvram_values (charger);return 0 ;
@@ -710,9 +724,10 @@ static int rk817_read_battery_nvram_values(struct rk817_charger *charger)/* * Read the nvram for state of charge. Sanity check for values greater -* than 100 (10000). If the value is off it should get corrected -* automatically when the voltage drops to the min (soc is 0) or when -* the battery is full (soc is 100). +* than 100 (10000) or less than 0, because other things (BSP kernels, +* U-Boot, or even i2cset) can write to this register. If the value is +* off it should get corrected automatically when the voltage drops to +* the min (soc is 0) or when the battery is full (soc is 100). */ ret =regmap_bulk_read (charger->rk808->regmap,RK817_GAS_GAUGE_BAT_R1 , bulk_reg,3 );
@@ -721,6 +736,8 @@ static int rk817_read_battery_nvram_values(struct rk817_charger *charger) charger->soc =get_unaligned_le24 (bulk_reg);if (charger->soc >10000 ) charger->soc =10000 ; +if (charger->soc <0 ) + charger->soc =0 ;return 0 ; }
@@ -731,8 +748,8 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger, {struct rk808 *rk808 = charger->rk808;u8 bulk_reg[4 ]; -u32 boot_voltage, boot_charge_mah, tmp; -int ret, reg, off_time; +u32 boot_voltage, boot_charge_mah; +int ret, reg, off_time, tmp;bool first_boot;/*
@@ -785,10 +802,12 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,regmap_bulk_read (rk808->regmap,RK817_GAS_GAUGE_Q_PRES_H3 , bulk_reg,4 ); tmp =get_unaligned_be32 (bulk_reg); +if (tmp <0 ) + tmp =0 ; boot_charge_mah =ADC_TO_CHARGE_UAH (tmp, charger->res_div) /1000 ;/* -* Check if the columb counter has been off for more than 300 +* Check if the columb counter has been off for more than 30 * minutes as it tends to drift downward. If so, re-init soc * with the boot voltage instead. Note the unit values for the * OFF_CNT register appear to be in decaminutes and stops
@@ -799,7 +818,7 @@ rk817_read_or_set_full_charge_on_boot(struct rk817_charger *charger,* than 0 on a reboot anyway. */ regmap_read (rk808->regmap,RK817_GAS_GAUGE_OFF_CNT , &off_time); -if (off_time >=30 ) { +if (off_time >=3 ) {regmap_bulk_read (rk808->regmap,RK817_GAS_GAUGE_PWRON_VOL_H , bulk_reg,2 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 603/694 RDMA/cm: Trace icm_send_rej event before the cm state is reset
In reply to Greg Kroah-HartmanFrom: Mark Zhang <[email protected]>
[ Upstream commit bd9de1badac7e4ff6780365d4aa38983f5e2a436 ]
Trace icm_send_rej event before the cm state is reset to idle, so that correct cm state will be logged. For example when an incoming request is rejected, the old trace log was:
icm_send_rej: local_id=961102742 remote_id=3829151631 state=IDLE reason=REJ_CONSUMER_DEFINED
With this patch:
icm_send_rej: local_id=312971016 remote_id=3778819983 state=MRA_REQ_SENT reason=REJ_CONSUMER_DEFINED--- drivers/infiniband/core/cm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/core/cm.c +2 -1
@@ -2912,6 +2912,8 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv, (ari && ari_length > IB_CM_REJ_ARI_LENGTH))return -EINVAL ; +trace_icm_send_rej (&cm_id_priv->id, reason); +switch (state) {case IB_CM_REQ_SENT :case IB_CM_MRA_REQ_RCVD :
@@ -2942,7 +2944,6 @@ static int cm_send_rej_locked(struct cm_id_private *cm_id_priv,return -EINVAL ; } -trace_icm_send_rej (&cm_id_priv->id, reason); ret =ib_post_send_mad (msg,NULL );if (ret) {cm_free_msg (msg);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 604/694 RDMA/srpt: Add a check for valid mad_agent pointer
In reply to Greg Kroah-HartmanFrom: Saravanan Vajravel <[email protected]>
[ Upstream commit eca5cd9474cd26d62f9756f536e2e656d3f62f3a ]
When unregistering MAD agent, srpt module has a non-null check for 'mad_agent' pointer before invoking ib_unregister_mad_agent(). This check can pass if 'mad_agent' variable holds an error value. The 'mad_agent' can have an error value for a short window when srpt_add_one() and srpt_remove_one() is executed simultaneously.
In srpt module, added a valid pointer check for 'sport->mad_agent' before unregistering MAD agent.
This issue can hit when RoCE driver unregisters ib_device
Stack Trace:
------------
BUG: kernel NULL pointer dereference, address: 000000000000004d PGD 145003067 P4D 145003067 PUD 2324fe067 PMD 0 Oops: 0002 [#1] PREEMPT SMP NOPTI CPU: 10 PID: 4459 Comm: kworker/u80:0 Kdump: loaded Tainted: P Hardware name: Dell Inc. PowerEdge R640/06NR82, BIOS 2.5.4 01/13/2020 Workqueue: bnxt_re bnxt_re_task [bnxt_re] RIP: 0010:_raw_spin_lock_irqsave+0x19/0x40 Call Trace: ib_unregister_mad_agent+0x46/0x2f0 [ib_core] IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready ? __schedule+0x20b/0x560 srpt_unregister_mad_agent+0x93/0xd0 [ib_srpt] srpt_remove_one+0x20/0x150 [ib_srpt] remove_client_context+0x88/0xd0 [ib_core] bond0: (slave p2p1): link status definitely up, 100000 Mbps full duplex disable_device+0x8a/0x160 [ib_core] bond0: active interface up! ? kernfs_name_hash+0x12/0x80 (NULL device *): Bonding Info Received: rdev: 000000006c0b8247 __ib_unregister_device+0x42/0xb0 [ib_core] (NULL device *): Master: mode: 4 num_slaves:2 ib_unregister_device+0x22/0x30 [ib_core] (NULL device *): Slave: id: 105069936 name:p2p1 link:0 state:0 bnxt_re_stopqps_and_ib_uninit+0x83/0x90 [bnxt_re] bnxt_re_alloc_lag+0x12e/0x4e0 [bnxt_re]
--- drivers/infiniband/ulp/srpt/ib_srpt.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +13 -10
@@ -549,6 +549,7 @@ static int srpt_format_guid(char *buf, unsigned int size, const __be64 *guid)*/ static int srpt_refresh_port (struct srpt_port *sport) { +struct ib_mad_agent *mad_agent;struct ib_mad_reg_req reg_req;struct ib_port_modify port_modify;struct ib_port_attr port_attr;
@@ -593,24 +594,26 @@ static int srpt_refresh_port(struct srpt_port *sport)set_bit (IB_MGMT_METHOD_GET , reg_req.method_mask);set_bit (IB_MGMT_METHOD_SET , reg_req.method_mask); - sport->mad_agent =ib_register_mad_agent (sport->sdev->device, - sport->port, -IB_QPT_GSI , - ®_req,0 , - srpt_mad_send_handler, - srpt_mad_recv_handler, - sport,0 ); -if (IS_ERR (sport->mad_agent)) { + mad_agent =ib_register_mad_agent (sport->sdev->device, + sport->port, +IB_QPT_GSI , + ®_req,0 , + srpt_mad_send_handler, + srpt_mad_recv_handler, + sport,0 ); +if (IS_ERR (mad_agent)) {pr_err ("%s-%d: MAD agent registration failed (%ld). Note: this is expected if SR-IOV is enabled.\n" ,dev_name (&sport->sdev->device->dev), sport->port, -PTR_ERR (sport->mad_agent)); +PTR_ERR (mad_agent)); sport->mad_agent =NULL ;memset (&port_modify,0 ,sizeof (port_modify)); port_modify.clr_port_cap_mask =IB_PORT_DEVICE_MGMT_SUP ;ib_modify_port (sport->sdev->device, sport->port,0 , &port_modify); - +return 0 ; } + + sport->mad_agent = mad_agent; }return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 605/694 IB/hfi1: Fix SDMA mmu_rb_node not being evicted in LRU order
In reply to Greg Kroah-HartmanFrom: Patrick Kelsey <[email protected]>
[ Upstream commit 9fe8fec5e43d5a80f43cbf61aaada1b047a1eb61 ]
hfi1_mmu_rb_remove_unless_exact() did not move mmu_rb_node objects in mmu_rb_handler->lru_list after getting a cache hit on an mmu_rb_node.
As a result, hfi1_mmu_rb_evict() was not guaranteed to evict truly least-recently used nodes.
This could be a performance issue for an application when that application:
- Uses some long-lived buffers frequently.
- Uses a large number of buffers once.
- Hits the mmu_rb_handler cache size or pinned-page limits, forcing mmu_rb_handler cache entries to be evicted.
In this case, the one-time use buffers cause the long-lived buffer entries to eventually filter to the end of the LRU list where hfi1_mmu_rb_evict() will consider evicting a frequently-used long-lived entry instead of evicting one of the one-time use entries.
Fix this by inserting new mmu_rb_node at the tail of mmu_rb_handler->lru_list and move mmu_rb_ndoe to the tail of mmu_rb_handler->lru_list when the mmu_rb_node is a hit in hfi1_mmu_rb_remove_unless_exact(). Change hfi1_mmu_rb_evict() to evict from the head of mmu_rb_handler->lru_list instead of the tail.
--- drivers/infiniband/hw/hfi1/mmu_rb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/infiniband/hw/hfi1/mmu_rb.c +6 -7
@@ -130,7 +130,7 @@ int hfi1_mmu_rb_insert(struct mmu_rb_handler *handler, goto unlock; }__mmu_int_rb_insert (mnode, &handler->root); -list_add (&mnode->list, &handler->lru_list); +list_add_tail (&mnode->list, &handler->lru_list); ret = handler->ops->insert (handler->ops_arg, mnode);if (ret) {
@@ -181,8 +181,10 @@ bool hfi1_mmu_rb_remove_unless_exact(struct mmu_rb_handler *handler,spin_lock_irqsave (&handler->lock, flags); node =__mmu_rb_search (handler, addr, len);if (node) { -if (node->addr == addr && node->len == len) +if (node->addr == addr && node->len == len) { +list_move_tail (&node->list, &handler->lru_list); goto unlock; + }__mmu_int_rb_remove (node, &handler->root);list_del (&node->list);/* remove from LRU list */ ret = true;
@@ -206,8 +208,7 @@ void hfi1_mmu_rb_evict(struct mmu_rb_handler *handler, void *evict_arg)INIT_LIST_HEAD (&del_list);spin_lock_irqsave (&handler->lock, flags); -list_for_each_entry_safe_reverse (rbnode, ptr, &handler->lru_list, - list) { +list_for_each_entry_safe (rbnode, ptr, &handler->lru_list, list) {if (handler->ops->evict (handler->ops_arg, rbnode, evict_arg, &stop)) {__mmu_int_rb_remove (rbnode, &handler->root);
@@ -219,9 +220,7 @@ void hfi1_mmu_rb_evict(struct mmu_rb_handler *handler, void *evict_arg) }spin_unlock_irqrestore (&handler->lock, flags); -while (!list_empty (&del_list)) { - rbnode = list_first_entry(&del_list, struct mmu_rb_node, list); -list_del (&rbnode->list); +list_for_each_entry_safe (rbnode, ptr, &del_list, list) { handler->ops->remove (handler->ops_arg, rbnode); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 606/694 IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests
In reply to Greg Kroah-HartmanFrom: Patrick Kelsey <[email protected]>
[ Upstream commit 00cbce5cbf88459cd1aa1d60d0f1df15477df127 ]
hfi1 user SDMA request processing has two bugs that can cause data corruption for user SDMA requests that have multiple payload iovecs where an iovec other than the tail iovec does not run up to the page boundary for the buffer pointed to by that iovec.a
Here are the specific bugs:
1. user_sdma_txadd() does not use struct user_sdma_iovec->iov.iov_len. Rather, user_sdma_txadd() will add up to PAGE_SIZE bytes from iovec to the packet, even if some of those bytes are past iovec->iov.iov_len and are thus not intended to be in the packet.
2. user_sdma_txadd() and user_sdma_send_pkts() fail to advance to the next iovec in user_sdma_request->iovs when the current iovec is not PAGE_SIZE and does not contain enough data to complete the packet. The transmitted packet will contain the wrong data from the iovec pages.
This has not been an issue with SDMA packets from hfi1 Verbs or PSM2 because they only produce iovecs that end short of PAGE_SIZE as the tail iovec of an SDMA request.
Fixing these bugs exposes other bugs with the SDMA pin cache (struct mmu_rb_handler) that get in way of supporting user SDMA requests with multiple payload iovecs whose buffers do not end at PAGE_SIZE. So this commit fixes those issues as well.
Here are the mmu_rb_handler bugs that non-PAGE_SIZE-end multi-iovec payload user SDMA requests can hit:
1. Overlapping memory ranges in mmu_rb_handler will result in duplicate pinnings.
2. When extending an existing mmu_rb_handler entry (struct mmu_rb_node), the mmu_rb code (1) removes the existing entry under a lock, (2) releases that lock, pins the new pages, (3) then reacquires the lock to insert the extended mmu_rb_node.
If someone else comes in and inserts an overlapping entry between (2) and (3), insert in (3) will fail.
The failure path code in this case unpins _all_ pages in either the original mmu_rb_node or the new mmu_rb_node that was inserted between
(2) and (3).
3. In hfi1_mmu_rb_remove_unless_exact(), mmu_rb_node->refcount is incremented outside of mmu_rb_handler->lock. As a result, mmu_rb_node could be evicted by another thread that gets mmu_rb_handler->lock and checks mmu_rb_node->refcount before mmu_rb_node->refcount is incremented.
4. Related to #2 above, SDMA request submission failure path does not check mmu_rb_node->refcount before freeing mmu_rb_node object.
If there are other SDMA requests in progress whose iovecs have pointers to the now-freed mmu_rb_node(s), those pointers to the now-freed mmu_rb nodes will be dereferenced when those SDMA requests complete.
--- drivers/infiniband/hw/hfi1/ipoib_tx.c | 1 + drivers/infiniband/hw/hfi1/mmu_rb.c | 66 +-- drivers/infiniband/hw/hfi1/mmu_rb.h | 8 +- drivers/infiniband/hw/hfi1/sdma.c | 21 +- drivers/infiniband/hw/hfi1/sdma.h | 16 +- drivers/infiniband/hw/hfi1/sdma_txreq.h | 1 + drivers/infiniband/hw/hfi1/trace_mmu.h | 4 - drivers/infiniband/hw/hfi1/user_sdma.c | 600 +++++++++++++++--------- drivers/infiniband/hw/hfi1/user_sdma.h | 5 - drivers/infiniband/hw/hfi1/verbs.c | 4 +- drivers/infiniband/hw/hfi1/vnic_sdma.c | 1 + 11 files changed, 423 insertions(+), 304 deletions(-)
drivers/infiniband/hw/hfi1/ipoib_tx.c +1 -0
@@ -215,6 +215,7 @@ static int hfi1_ipoib_build_ulp_payload(struct ipoib_txreq *tx,const skb_frag_t *frag = &skb_shinfo (skb)->frags[i]; ret = sdma_txadd_page(dd, + NULL, txreq, skb_frag_page(frag), frag->bv_offset,
drivers/infiniband/hw/hfi1/mmu_rb.c +14 -52
90 lines not on this page · raw message
drivers/infiniband/hw/hfi1/mmu_rb.h +3 -5
@@ -52,10 +52,8 @@ void hfi1_mmu_rb_unregister(struct mmu_rb_handler *handler);int hfi1_mmu_rb_insert (struct mmu_rb_handler *handler,struct mmu_rb_node *mnode);void hfi1_mmu_rb_evict (struct mmu_rb_handler *handler,void *evict_arg); -void hfi1_mmu_rb_remove (struct mmu_rb_handler *handler, -struct mmu_rb_node *mnode); -bool hfi1_mmu_rb_remove_unless_exact (struct mmu_rb_handler *handler, -unsigned long addr,unsigned long len, -struct mmu_rb_node **rb_node); +struct mmu_rb_node *hfi1_mmu_rb_get_first (struct mmu_rb_handler *handler, +unsigned long addr, +unsigned long len);#endif /* _HFI1_MMU_RB_H */
drivers/infiniband/hw/hfi1/sdma.c +4 -17
@@ -1593,22 +1593,7 @@ static inline void sdma_unmap_desc(struct hfi1_devdata *dd, struct sdma_desc *descp) { - switch (sdma_mapping_type(descp)) { - case SDMA_MAP_SINGLE: -dma_unmap_single ( - &dd->pcidev->dev, -sdma_mapping_addr (descp ), -sdma_mapping_len (descp ), -DMA_TO_DEVICE ); -break ; -case SDMA_MAP_PAGE : -dma_unmap_page ( - &dd->pcidev->dev, -sdma_mapping_addr (descp), -sdma_mapping_len (descp), -DMA_TO_DEVICE ); -break ; - } +system_descriptor_complete (dd ,descp ); }/*
@@ -3128,7 +3113,7 @@ int ext_coal_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx,/* Add descriptor for coalesce buffer */ tx->desc_limit =MAX_DESC ; -return _sdma_txadd_daddr (dd,SDMA_MAP_SINGLE , tx, +return _sdma_txadd_daddr (dd,SDMA_MAP_SINGLE ,NULL , tx, addr, tx->tlen); }
@@ -3167,10 +3152,12 @@ int _pad_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx)return rval; } } +/* finish the one just added */ make_tx_sdma_desc ( tx,SDMA_MAP_NONE , +NULL , dd->sdma_pad_phys,sizeof (u32) - (tx->packet_len & (sizeof (u32) -1 ))); tx->num_desc++;
drivers/infiniband/hw/hfi1/sdma.h +11 -5
@@ -594,6 +594,7 @@ static inline dma_addr_t sdma_mapping_addr(struct sdma_desc *d)static inline void make_tx_sdma_desc (struct sdma_txreq *tx,int type, +void *pinning_ctx,dma_addr_t addr,size_t len) {
@@ -612,6 +613,7 @@ static inline void make_tx_sdma_desc( << SDMA_DESC0_PHY_ADDR_SHIFT) | (((u64 )len &SDMA_DESC0_BYTE_COUNT_MASK ) <<SDMA_DESC0_BYTE_COUNT_SHIFT ); + desc->pinning_ctx = pinning_ctx; }/* helper to extend txreq */
@@ -643,6 +645,7 @@ static inline void _sdma_close_tx(struct hfi1_devdata *dd,static inline int _sdma_txadd_daddr (struct hfi1_devdata *dd,int type, +void *pinning_ctx,struct sdma_txreq *tx,dma_addr_t addr,u16 len)
@@ -652,6 +655,7 @@ static inline int _sdma_txadd_daddr(make_tx_sdma_desc ( tx, type, + pinning_ctx, addr, len);WARN_ON (len > tx->tlen); tx->num_desc++;
@@ -672,6 +676,7 @@ static inline int _sdma_txadd_daddr(/** * sdma_txadd_page() - add a page to the sdma_txreq * @dd: the device to use for mapping +* @pinning_ctx: context to be released at descriptor retirement * @tx: tx request to which the page is added * @page: page to map * @offset: offset within the page
@@ -687,6 +692,7 @@ static inline int _sdma_txadd_daddr(*/ static inline int sdma_txadd_page( struct hfi1_devdata *dd, + void *pinning_ctx, struct sdma_txreq *tx, struct page *page, unsigned long offset,
@@ -714,8 +720,7 @@ static inline int sdma_txadd_page(return -ENOSPC ; } -return _sdma_txadd_daddr ( - dd,SDMA_MAP_PAGE , tx, addr, len); +return _sdma_txadd_daddr (dd,SDMA_MAP_PAGE , pinning_ctx, tx, addr, len); }/**
@@ -749,7 +754,8 @@ static inline int sdma_txadd_daddr(return rval; } -return _sdma_txadd_daddr (dd,SDMA_MAP_NONE , tx, addr, len); +return _sdma_txadd_daddr (dd,SDMA_MAP_NONE ,NULL , tx, + addr, len); }/**
@@ -795,8 +801,7 @@ static inline int sdma_txadd_kvaddr(return -ENOSPC ; } -return _sdma_txadd_daddr ( - dd,SDMA_MAP_SINGLE , tx, addr, len); +return _sdma_txadd_daddr (dd,SDMA_MAP_SINGLE ,NULL , tx, addr, len); }struct iowait_work ;
@@ -1030,4 +1035,5 @@ extern uint mod_num_sdma;void sdma_update_lmc (struct hfi1_devdata *dd,u64 mask,u32 lid); +void system_descriptor_complete (struct hfi1_devdata *dd,struct sdma_desc *descp);#endif
drivers/infiniband/hw/hfi1/sdma_txreq.h +1 -0
@@ -19,6 +19,7 @@struct sdma_desc {/* private: don't use directly */ u64 qw[2 ]; +void *pinning_ctx; };/**
drivers/infiniband/hw/hfi1/trace_mmu.h +0 -4
@@ -37,10 +37,6 @@ DEFINE_EVENT(hfi1_mmu_rb_template, hfi1_mmu_rb_search, TP_PROTO(unsigned long addr, unsigned long len), TP_ARGS(addr, len)); -DEFINE_EVENT (hfi1_mmu_rb_template, hfi1_mmu_rb_remove, - TP_PROTO(unsigned long addr, unsigned long len), -TP_ARGS (addr, len)); -DEFINE_EVENT (hfi1_mmu_rb_template, hfi1_mmu_mem_invalidate, TP_PROTO(unsigned long addr, unsigned long len),TP_ARGS (addr, len));
drivers/infiniband/hw/hfi1/user_sdma.c +386 -214
700 lines not on this page · raw message
drivers/infiniband/hw/hfi1/user_sdma.h +0 -5
@@ -112,16 +112,11 @@ struct sdma_mmu_node {struct user_sdma_iovec {struct list_head list;struct iovec iov; -/* number of pages in this vector */ -unsigned int npages; -/* array of pinned pages for this vector */ -struct page **pages;/* * offset into the virtual address space of the vector at * which we last left off. */ u64 offset; -struct sdma_mmu_node *node; };/* evict operation argument */
drivers/infiniband/hw/hfi1/verbs.c +2 -2
@@ -778,8 +778,8 @@ static int build_verbs_tx_desc(/* add icrc, lt byte, and padding to flit */ if (extra_bytes) - ret =sdma_txadd_daddr (sde->dd, &tx->txreq, - sde->dd->sdma_pad_phys, extra_bytes); + ret =sdma_txadd_daddr (sde->dd, &tx->txreq, sde->dd->sdma_pad_phys, + extra_bytes); bail_txadd:return ret;
drivers/infiniband/hw/hfi1/vnic_sdma.c +1 -0
@@ -64,6 +64,7 @@ static noinline int build_vnic_ulp_payload(struct sdma_engine *sde,/* combine physically continuous fragments later? */ ret = sdma_txadd_page(sde->dd, + NULL, &tx->txreq, skb_frag_page(frag), skb_frag_off(frag),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 607/694 clk: imx: fracn-gppll: fix the rate table
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
[ Upstream commit cf8dccfedce848f67eaa42e8839305d028319161 ]
The Fvco should be range 2.4GHz to 5GHz, the original table voilate the spec, so update the table to fix it.
--- drivers/clk/imx/clk-fracn-gppll.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/clk/imx/clk-fracn-gppll.c +9 -7
@@ -60,18 +60,20 @@ struct clk_fracn_gppll { };/* -* Fvco = Fref * (MFI + MFN / MFD) -* Fout = Fvco / (rdiv * odiv) +* Fvco = (Fref / rdiv) * (MFI + MFN / MFD) +* Fout = Fvco / odiv +* The (Fref / rdiv) should be in range 20MHz to 40MHz +* The Fvco should be in range 2.5Ghz to 5Ghz */ static const struct imx_fracn_gppll_rate_table fracn_tbl[] = { -PLL_FRACN_GP (650000000U ,81 ,0 ,1 ,0 ,3 ), +PLL_FRACN_GP (650000000U ,162 ,50 ,100 ,0 ,6 ),PLL_FRACN_GP (594000000U ,198 ,0 ,1 ,0 ,8 ), -PLL_FRACN_GP (560000000U ,70 ,0 ,1 ,0 ,3 ), -PLL_FRACN_GP (498000000U ,83 ,0 ,1 ,0 ,4 ), +PLL_FRACN_GP (560000000U ,140 ,0 ,1 ,0 ,6 ), +PLL_FRACN_GP (498000000U ,166 ,0 ,1 ,0 ,8 ),PLL_FRACN_GP (484000000U ,121 ,0 ,1 ,0 ,6 ),PLL_FRACN_GP (445333333U ,167 ,0 ,1 ,0 ,9 ), -PLL_FRACN_GP (400000000U ,50 ,0 ,1 ,0 ,3 ), -PLL_FRACN_GP (393216000U ,81 ,92 ,100 ,0 ,5 ) +PLL_FRACN_GP (400000000U ,200 ,0 ,1 ,0 ,12 ), +PLL_FRACN_GP (393216000U ,163 ,84 ,100 ,0 ,10 ) };struct imx_fracn_gppll_clk imx_fracn_gppll = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 608/694 clk: imx: fracn-gppll: disable hardware select control
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
[ Upstream commit 4435467b15b069e5a6f50ca9a9260e86b74dbc13 ]
When programming PLL, should disable Hardware control select to make PLL controlled by register, not hardware inputs through OSCPLL.
--- drivers/clk/imx/clk-fracn-gppll.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/clk/imx/clk-fracn-gppll.c +6 -0
@@ -15,6 +15,7 @@#include "clk.h" #define PLL_CTRL 0x0 +#define HW_CTRL_SEL BIT(16)#define CLKMUX_BYPASS BIT(2)#define CLKMUX_EN BIT(1)#define POWERUP_MASK BIT(0)
@@ -193,6 +194,11 @@ static int clk_fracn_gppll_set_rate(struct clk_hw *hw, unsigned long drate, rate =imx_get_pll_settings (pll, drate); +/* Hardware control select disable. PLL is control by register */ + tmp =readl_relaxed (pll->base +PLL_CTRL ); + tmp &= ~HW_CTRL_SEL ; +writel_relaxed (tmp, pll->base +PLL_CTRL ); +/* Disable output */ tmp =readl_relaxed (pll->base +PLL_CTRL ); tmp &= ~CLKMUX_EN ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 609/694 clk: imx: imx8ulp: Fix XBAR_DIVBUS and AD_SLOW clock parents
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
[ Upstream commit d608c18018c897b88d66f1340fe274b7181817fa ]
XBAR_DIVBUS and AD_SLOW should set parent to XBAR_AD_DIVPLAT and XBAR_DIVBUS respectively, not the NIC_AD. otherwise we will get wrong clock rate.
--- drivers/clk/imx/clk-imx8ulp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/imx/clk-imx8ulp.c +2 -2
@@ -200,8 +200,8 @@ static int imx8ulp_clk_cgc1_init(struct platform_device *pdev) clks[IMX8ULP_CLK_NIC_AD_DIVPLAT ] =imx_clk_hw_divider_flags ("nic_ad_divplat" ,"nic_sel" , base +0x34 ,21 ,6 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); clks[IMX8ULP_CLK_NIC_PER_DIVPLAT ] =imx_clk_hw_divider_flags ("nic_per_divplat" ,"nic_ad_divplat" , base +0x34 ,14 ,6 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); clks[IMX8ULP_CLK_XBAR_AD_DIVPLAT ] =imx_clk_hw_divider_flags ("xbar_ad_divplat" ,"nic_ad_divplat" , base +0x38 ,14 ,6 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); - clks[IMX8ULP_CLK_XBAR_DIVBUS ] =imx_clk_hw_divider_flags ("xbar_divbus" ,"nic_ad_divplat" , base +0x38 ,7 ,6 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); - clks[IMX8ULP_CLK_XBAR_AD_SLOW ] =imx_clk_hw_divider_flags ("xbar_ad_slow" ,"nic_ad_divplat" , base +0x38 ,0 ,6 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); + clks[IMX8ULP_CLK_XBAR_DIVBUS ] =imx_clk_hw_divider_flags ("xbar_divbus" ,"xbar_ad_divplat" , base +0x38 ,7 ,6 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); + clks[IMX8ULP_CLK_XBAR_AD_SLOW ] =imx_clk_hw_divider_flags ("xbar_ad_slow" ,"xbar_divbus" , base +0x38 ,0 ,6 ,CLK_SET_RATE_PARENT |CLK_IS_CRITICAL ); clks[IMX8ULP_CLK_SOSC_DIV1_GATE ] =imx_clk_hw_gate_dis ("sosc_div1_gate" ,"sosc" , base +0x108 ,7 ); clks[IMX8ULP_CLK_SOSC_DIV2_GATE ] =imx_clk_hw_gate_dis ("sosc_div2_gate" ,"sosc" , base +0x108 ,15 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 610/694 NFSv4.1: Always send a RECLAIM_COMPLETE after establishing lease
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
[ Upstream commit 40882deb83c29d8df4470d4e5e7f137b6acf7ad1 ]
The spec requires that we always at least send a RECLAIM_COMPLETE when we're done establishing the lease and recovering any state.
--- fs/nfs/nfs4state.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/nfs/nfs4state.c +4 -0
@@ -67,6 +67,8 @@#define OPENOWNER_POOL_SIZE 8 +static void nfs4_state_start_reclaim_reboot (struct nfs_client *clp); +const nfs4_stateid zero_stateid = { { .data = {0 } }, .type =NFS4_SPECIAL_STATEID_TYPE ,
@@ -330,6 +332,8 @@ int nfs41_init_clientid(struct nfs_client *clp, const struct cred *cred) status =nfs4_proc_create_session (clp, cred);if (status !=0 ) goto out; +if (!(clp->cl_exchange_flags &EXCHGID4_FLAG_CONFIRMED_R )) +nfs4_state_start_reclaim_reboot (clp);nfs41_finish_session_reset (clp);nfs_mark_client_ready (clp,NFS_CS_READY ); out:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 611/694 iommu/amd: Set page size bitmap during V2 domain allocation
In reply to Greg Kroah-HartmanFrom: Jerry Snitselaar <[email protected]>
[ Upstream commit 8f880d19e6ad645a4b8066d5ff091c980b3231e7 ]
With the addition of the V2 page table support, the domain page size bitmap needs to be set prior to iommu core setting up direct mappings for reserved regions. When reserved regions are mapped, if this is not done, it will be looking at the V1 page size bitmap when determining the page size to use in iommu_pgsize(). When it gets into the actual amd mapping code, a check of see if the page size is supported can fail, because at that point it is checking it against the V2 page size bitmap which only supports 4K, 2M, and 1G.
Add a check to __iommu_domain_alloc() to not override the bitmap if it was already set by the iommu ops domain_alloc() code path.
--- drivers/iommu/amd/iommu.c | 6 ++---- drivers/iommu/iommu.c | 9 +++++++-- 2 files changed, 9 insertions(+), 6 deletions(-)
drivers/iommu/amd/iommu.c +2 -4
@@ -1666,10 +1666,6 @@ static void do_attach(struct iommu_dev_data *dev_data, domain->dev_iommu[iommu->index] +=1 ; domain->dev_cnt +=1 ; -/* Override supported page sizes */ -if (domain->flags &PD_GIOV_MASK ) - domain->domain.pgsize_bitmap =AMD_IOMMU_PGSIZES_V2 ; -/* Update device table */ set_dte_entry (iommu, dev_data->devid, domain, ats, dev_data->iommu_v2);
@@ -2048,6 +2044,8 @@ static int protection_domain_init_v2(struct protection_domain *domain) domain->flags |=PD_GIOV_MASK ; + domain->domain.pgsize_bitmap =AMD_IOMMU_PGSIZES_V2 ; +if (domain_enable_v2 (domain,1 )) {domain_id_free (domain->id);return -ENOMEM ;
drivers/iommu/iommu.c +7 -2
@@ -1964,8 +1964,13 @@ static struct iommu_domain *__iommu_domain_alloc(struct bus_type *bus,return NULL ; domain->type = type; -/* Assume all sizes by default; the driver may override this later */ - domain->pgsize_bitmap = bus->iommu_ops->pgsize_bitmap; +/* +* If not already set, assume all sizes by default; the driver +* may override this later +*/ +if (!domain->pgsize_bitmap) + domain->pgsize_bitmap = bus->iommu_ops->pgsize_bitmap; +if (!domain->ops) domain->ops = bus->iommu_ops->default_domain_ops;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 612/694 s390/checksum: always use cksm instruction
In reply to Greg Kroah-HartmanFrom: Heiko Carstens <[email protected]>
[ Upstream commit e42ac7789df64120d7d3d57433dfc9f37ec0cb99 ]
Commit dfe843dce775 ("s390/checksum: support GENERIC_CSUM, enable it for KASAN") switched s390 to use the generic checksum functions, so that KASAN instrumentation also works checksum functions by avoiding architecture specific inline assemblies.
There is however the problem that the generic csum_partial() function returns a 32 bit value with a 16 bit folded checksum, while the original s390 variant does not fold to 16 bit. This in turn causes that the ipib_checksum in lowcore contains different values depending on kernel config options.
The ipib_checksum is used by system dumpers to verify if pointers in lowcore point to valid data. Verification is done by comparing checksum values. The system dumpers still use 32 bit checksum values which are not folded, and therefore the checksum verification fails (incorrectly).
Symptom is that reboot after dump does not work anymore when a KASAN instrumented kernel is dumped.
Fix this by not using the generic checksum implementation. Instead add an explicit kasan_check_read() so that KASAN knows about the read access from within the inline assembly.
--- arch/s390/Kconfig | 4 ---- arch/s390/include/asm/checksum.h | 9 ++------- 2 files changed, 2 insertions(+), 11 deletions(-)
arch/s390/Kconfig +0 -4
@@ -26,10 +26,6 @@ config GENERIC_BUG config GENERIC_BUG_RELATIVE_POINTERS def_bool y -config GENERIC_CSUM - bool - default y if KASAN - config GENERIC_LOCKBREAK def_bool y if PREEMPTION
arch/s390/include/asm/checksum.h +2 -7
@@ -12,12 +12,7 @@#ifndef _S390_CHECKSUM_H#define _S390_CHECKSUM_H -#ifdef CONFIG_GENERIC_CSUM - -#include <asm-generic/checksum.h> - -#else /* CONFIG_GENERIC_CSUM */ - +#include <linux/kasan-checks.h> #include <linux/uaccess.h> #include <linux/in6.h>
@@ -40,6 +35,7 @@ static inline __wsum csum_partial(const void *buff, int len, __wsum sum) .odd = (unsigned long) len, }; +kasan_check_read (buff, len); asmvolatile ("0: cksm %[sum],%[rp]\n" " jo 0b\n"
@@ -135,5 +131,4 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, return csum_fold((__force __wsum)(sum >> 32)); } -#endif /* CONFIG_GENERIC_CSUM */ #endif /* _S390_CHECKSUM_H */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 613/694 clk: qcom: lpasscc-sc7280: Skip qdsp6ss clock registration
In reply to Greg Kroah-HartmanFrom: Srinivasa Rao Mandadapu <[email protected]>
[ Upstream commit 4fc1c2d9a2b7a394f3b873aae5e03bffd8b5cd31 ]
The qdsp6ss memory region is being shared by ADSP remoteproc device and lpasscc clock device, hence causing memory conflict.
To avoid this, when qdsp6ss clocks are being enabled in remoteproc driver, skip qdsp6ss clock registration if "qcom,adsp-pil-mode" is enabled and also assign max_register value.
--- drivers/clk/qcom/lpasscc-sc7280.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/clk/qcom/lpasscc-sc7280.c +10 -6
@@ -121,14 +121,18 @@ static int lpass_cc_sc7280_probe(struct platform_device *pdev) goto destroy_pm_clk; } - lpass_regmap_config.name ="qdsp6ss" ; - desc = &lpass_qdsp6ss_sc7280_desc; - - ret =qcom_cc_probe_by_index (pdev,0 , desc); -if (ret) - goto destroy_pm_clk; +if (!of_property_read_bool (pdev->dev.of_node,"qcom,adsp-pil-mode" )) { + lpass_regmap_config.name ="qdsp6ss" ; + lpass_regmap_config.max_register =0x3f ; + desc = &lpass_qdsp6ss_sc7280_desc; + + ret =qcom_cc_probe_by_index (pdev,0 , desc); +if (ret) + goto destroy_pm_clk; + } lpass_regmap_config.name ="top_cc" ; + lpass_regmap_config.max_register =0x4 ; desc = &lpass_cc_top_sc7280_desc; ret =qcom_cc_probe_by_index (pdev,1 , desc);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 614/694 clk: qcom: lpassaudiocc-sc7280: Add required gdsc power domain clks in lpass_cc_sc7280_desc
In reply to Greg Kroah-HartmanFrom: Mohammad Rafi Shaik <[email protected]>
[ Upstream commit aad09fc7c4a522892eb64a79627b17a3869936cb ]
Add GDSCs in lpass_cc_sc7280_desc struct.
When qcom,adsp-pil-mode is enabled, GDSCs required to solve dependencies in lpass_audiocc probe().
--- drivers/clk/qcom/lpassaudiocc-sc7280.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/qcom/lpassaudiocc-sc7280.c +2 -0
@@ -696,6 +696,8 @@ static const struct qcom_cc_desc lpass_cc_sc7280_desc = { .config = &lpass_audio_cc_sc7280_regmap_config, .clks = lpass_cc_sc7280_clocks, .num_clks = ARRAY_SIZE(lpass_cc_sc7280_clocks), + .gdscs = lpass_aon_cc_sc7280_gdscs, + .num_gdscs = ARRAY_SIZE(lpass_aon_cc_sc7280_gdscs), };static const struct qcom_cc_desc lpass_audio_cc_sc7280_desc = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 615/694 clk: qcom: gcc-sm8350: fix PCIe PIPE clocks handling
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 1a500e0bc97b6cb3c0d9859e81973b8dd07d1b7b ]
On SM8350 platform the PCIe PIPE clocks require additional handling to function correctly. They are to be switched to the tcxo source before turning PCIe GDSCs off and should be switched to PHY PIPE source once they are working. Switch PCIe PHY clocks to use clk_regmap_phy_mux_ops, which provide support for this dance.
--- drivers/clk/qcom/gcc-sm8350.c | 47 ++++++++++------------------------- 1 file changed, 13 insertions(+), 34 deletions(-)
drivers/clk/qcom/gcc-sm8350.c +13 -34
@@ -17,6 +17,7 @@#include "clk-regmap.h" #include "clk-regmap-divider.h" #include "clk-regmap-mux.h" +#include "clk-regmap-phy-mux.h" #include "gdsc.h" #include "reset.h"
@@ -158,26 +159,6 @@ static const struct clk_parent_data gcc_parent_data_3[] = { { .fw_name = "bi_tcxo" }, }; -static const struct parent_map gcc_parent_map_4[] = { - {P_PCIE_0_PIPE_CLK ,0 }, - {P_BI_TCXO ,2 }, -}; - -static const struct clk_parent_data gcc_parent_data_4[] = { - { .fw_name ="pcie_0_pipe_clk" , }, - { .fw_name ="bi_tcxo" }, -}; - -static const struct parent_map gcc_parent_map_5[] = { - {P_PCIE_1_PIPE_CLK ,0 }, - {P_BI_TCXO ,2 }, -}; - -static const struct clk_parent_data gcc_parent_data_5[] = { - { .fw_name ="pcie_1_pipe_clk" }, - { .fw_name ="bi_tcxo" }, -}; -static const struct parent_map gcc_parent_map_6[] = { {P_BI_TCXO ,0 }, {P_GCC_GPLL0_OUT_MAIN ,1 },
@@ -274,32 +255,30 @@ static const struct clk_parent_data gcc_parent_data_14[] = { { .fw_name = "bi_tcxo" }, }; -static struct clk_regmap_mux gcc_pcie_0_pipe_clk_src = { +static struct clk_regmap_phy_mux gcc_pcie_0_pipe_clk_src = { .reg =0x6b054 , - .shift =0 , - .width =2 , - .parent_map = gcc_parent_map_4, .clkr = { .hw.init = &(struct clk_init_data ){ .name ="gcc_pcie_0_pipe_clk_src" , - .parent_data = gcc_parent_data_4, - .num_parents =ARRAY_SIZE (gcc_parent_data_4), - .ops = &clk_regmap_mux_closest_ops, + .parent_data = &(const struct clk_parent_data ){ + .fw_name ="pcie_0_pipe_clk" , + }, + .num_parents =1 , + .ops = &clk_regmap_phy_mux_ops, }, }, }; -static struct clk_regmap_mux gcc_pcie_1_pipe_clk_src = { +static struct clk_regmap_phy_mux gcc_pcie_1_pipe_clk_src = { .reg =0x8d054 , - .shift =0 , - .width =2 , - .parent_map = gcc_parent_map_5, .clkr = { .hw.init = &(struct clk_init_data ){ .name ="gcc_pcie_1_pipe_clk_src" , - .parent_data = gcc_parent_data_5, - .num_parents =ARRAY_SIZE (gcc_parent_data_5), - .ops = &clk_regmap_mux_closest_ops, + .parent_data = &(const struct clk_parent_data ){ + .fw_name ="pcie_1_pipe_clk" , + }, + .num_parents =1 , + .ops = &clk_regmap_phy_mux_ops, }, }, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 616/694 clk: qcom: dispcc-qcm2290: Remove inexistent DSI1PHY clk
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 68d1151f03067533827fc50b770954ef33149533 ]
There's only one DSI PHY on this SoC. Remove the ghost entry for the clock produced by a secondary one.
--- drivers/clk/qcom/dispcc-qcm2290.c | 3 --- 1 file changed, 3 deletions(-)
drivers/clk/qcom/dispcc-qcm2290.c +0 -3
@@ -26,7 +26,6 @@ enum {P_DISP_CC_PLL0_OUT_MAIN ,P_DSI0_PHY_PLL_OUT_BYTECLK ,P_DSI0_PHY_PLL_OUT_DSICLK , -P_DSI1_PHY_PLL_OUT_DSICLK ,P_GPLL0_OUT_MAIN , P_SLEEP_CLK, };
@@ -106,13 +105,11 @@ static const struct clk_parent_data disp_cc_parent_data_3[] = {static const struct parent_map disp_cc_parent_map_4[] = { {P_BI_TCXO ,0 }, {P_DSI0_PHY_PLL_OUT_DSICLK ,1 }, - {P_DSI1_PHY_PLL_OUT_DSICLK ,2 }, };static const struct clk_parent_data disp_cc_parent_data_4[] = { { .fw_name ="bi_tcxo" }, { .fw_name ="dsi0_phy_pll_out_dsiclk" }, - { .fw_name ="dsi1_phy_pll_out_dsiclk" }, };static const struct parent_map disp_cc_parent_map_5[] = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 617/694 Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 5bca3688bdbc3b58a2894b8671a8e2378efe28bd ]
rpi_firmware_get() take reference, we need to release it in error paths as well. Use devm_rpi_firmware_get() helper to handling the resources. Also remove the existing rpi_firmware_put().
--- drivers/input/touchscreen/raspberrypi-ts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/input/touchscreen/raspberrypi-ts.c +1 -2
@@ -134,7 +134,7 @@ static int rpi_ts_probe(struct platform_device *pdev)return -ENOENT ; } - fw =rpi_firmware_get (fw_node); + fw =devm_rpi_firmware_get (&pdev->dev, fw_node);of_node_put (fw_node);if (!fw)return -EPROBE_DEFER ;
@@ -160,7 +160,6 @@ static int rpi_ts_probe(struct platform_device *pdev) touchbuf = (u32 )ts->fw_regs_phys; error =rpi_firmware_property (fw,RPI_FIRMWARE_FRAMEBUFFER_SET_TOUCHBUF , &touchbuf,sizeof (touchbuf)); -rpi_firmware_put (fw);if (error || touchbuf !=0 ) {dev_warn (dev,"Failed to set touchbuf, %d\n" , error);return error;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 618/694 swiotlb: relocate PageHighMem test away from rmem_swiotlb_setup
In reply to Greg Kroah-HartmanFrom: Doug Berger <[email protected]>
[ Upstream commit a90922fa25370902322e9de6640e58737d459a50 ]
The reservedmem_of_init_fn's are invoked very early at boot before the memory zones have even been defined. This makes it inappropriate to test whether the page corresponding to a PFN is in ZONE_HIGHMEM from within one.
Removing the check allows an ARM 32-bit kernel with SPARSEMEM enabled to boot properly since otherwise we would be de-referencing an uninitialized sparsemem map to perform pfn_to_page() check.
The arm64 architecture happens to work (and also has no high memory) but other 32-bit architectures could also be having similar issues.
While it would be nice to provide early feedback about a reserved DMA pool residing in highmem, it is not possible to do that until the first time we try to use it, which is where the check is moved to.
--- kernel/dma/swiotlb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
kernel/dma/swiotlb.c +5 -5
@@ -998,6 +998,11 @@ static int rmem_swiotlb_device_init(struct reserved_mem *rmem,/* Set Per-device io tlb area to one */ unsigned int nareas =1 ; +if (PageHighMem (pfn_to_page (PHYS_PFN (rmem->base)))) { +dev_err (dev,"Restricted DMA pool must be accessible within the linear mapping." ); +return -EINVAL ; + } +/* * Since multiple devices can share the same pool, the private data, * io_tlb_mem struct, will be initialized by the first device attached
@@ -1059,11 +1064,6 @@ static int __init rmem_swiotlb_setup(struct reserved_mem *rmem) of_get_flat_dt_prop(node, "no-map", NULL))return -EINVAL ; -if (PageHighMem (pfn_to_page (PHYS_PFN (rmem->base)))) { -pr_err ("Restricted DMA pool must be accessible within the linear mapping." ); -return -EINVAL ; - } - rmem->ops = &rmem_swiotlb_ops;pr_info ("Reserved memory: created restricted DMA pool at %pa, size %ld MiB\n" , &rmem->base, (unsigned long )rmem->size /SZ_1M );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 619/694 swiotlb: fix debugfs reporting of reserved memory pools
In reply to Greg Kroah-HartmanFrom: Michael Kelley <[email protected]>
[ Upstream commit 5499d01c029069044a3b3e50501c77b474c96178 ]
For io_tlb_nslabs, the debugfs code reports the correct value for a specific reserved memory pool. But for io_tlb_used, the value reported is always for the default pool, not the specific reserved pool. Fix this.
--- kernel/dma/swiotlb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/dma/swiotlb.c +4 -2
@@ -930,7 +930,9 @@ EXPORT_SYMBOL_GPL(is_swiotlb_active);static int io_tlb_used_get (void *data,u64 *val) { - *val =mem_used (&io_tlb_default_mem); +struct io_tlb_mem *mem = data; + + *val =mem_used (mem);return 0 ; }DEFINE_DEBUGFS_ATTRIBUTE (fops_io_tlb_used, io_tlb_used_get,NULL ,"%llu\n" );
@@ -943,7 +945,7 @@ static void swiotlb_create_debugfs_files(struct io_tlb_mem *mem,return ;debugfs_create_ulong ("io_tlb_nslabs" ,0400 , mem->debugfs, &mem->nslabs); -debugfs_create_file ("io_tlb_used" ,0400 , mem->debugfs,NULL , +debugfs_create_file ("io_tlb_used" ,0400 , mem->debugfs, mem, &fops_io_tlb_used); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 620/694 RDMA/rxe: Convert tasklet args to queue pairs
In reply to Greg Kroah-HartmanFrom: Bob Pearson <[email protected]>
[ Upstream commit 3946fc2a42b18cf0b675121158a2625825ce27b5 ]
Originally is was thought that the tasklet machinery in rxe_task.c would be used in other applications but that has not happened for years. This patch replaces the 'void *arg' by struct 'rxe_qp *qp' in the parameters to the tasklet calls. This change will have no affect on performance but may make the code a little clearer.
Stable-dep-of: b2b1ddc45745 ("RDMA/rxe: Fix the error "trying to register non-static key in rxe_cleanup_task"")
--- drivers/infiniband/sw/rxe/rxe_comp.c | 3 +-- drivers/infiniband/sw/rxe/rxe_loc.h | 6 +++--- drivers/infiniband/sw/rxe/rxe_req.c | 3 +-- drivers/infiniband/sw/rxe/rxe_resp.c | 3 +-- drivers/infiniband/sw/rxe/rxe_task.c | 11 ++++++----- drivers/infiniband/sw/rxe/rxe_task.h | 9 +++++---- 6 files changed, 17 insertions(+), 18 deletions(-)
drivers/infiniband/sw/rxe/rxe_comp.c +1 -2
@@ -571,9 +571,8 @@ static void free_pkt(struct rxe_pkt_infoib_device_put (dev); } -int rxe_completer (void *arg) +int rxe_completer (struct rxe_qp *qp) { -struct rxe_qp *qp = (struct rxe_qp *)arg;struct rxe_dev *rxe =to_rdev (qp->ibqp.device);struct rxe_send_wqe *wqe =NULL ;struct sk_buff *skb =NULL ;
drivers/infiniband/sw/rxe/rxe_loc.h +3 -3
@@ -171,9 +171,9 @@ void rxe_srq_cleanup(struct rxe_pool_elevoid rxe_dealloc (struct ib_device *ib_dev); -int rxe_completer (void *arg); -int rxe_requester (void *arg); -int rxe_responder (void *arg); +int rxe_completer (struct rxe_qp *qp); +int rxe_requester (struct rxe_qp *qp); +int rxe_responder (struct rxe_qp *qp);/* rxe_icrc.c */ int rxe_icrc_init (struct rxe_dev *rxe);
drivers/infiniband/sw/rxe/rxe_req.c +1 -2
@@ -635,9 +635,8 @@ static int rxe_do_local_ops(struct rxe_qreturn 0 ; } -int rxe_requester (void *arg) +int rxe_requester (struct rxe_qp *qp) { -struct rxe_qp *qp = (struct rxe_qp *)arg;struct rxe_dev *rxe =to_rdev (qp->ibqp.device);struct rxe_pkt_info pkt;struct sk_buff *skb;
drivers/infiniband/sw/rxe/rxe_resp.c +1 -2
@@ -1439,9 +1439,8 @@ static void rxe_drain_req_pkts(struct rxqueue_advance_consumer (q, q->type); } -int rxe_responder (void *arg) +int rxe_responder (struct rxe_qp *qp) { -struct rxe_qp *qp = (struct rxe_qp *)arg;struct rxe_dev *rxe =to_rdev (qp->ibqp.device);enum resp_states state;struct rxe_pkt_info *pkt =NULL ;
drivers/infiniband/sw/rxe/rxe_task.c +6 -5
@@ -11,7 +11,7 @@ int __rxe_do_task(struct rxe_task *task) {int ret; -while ((ret = task->func (task->arg)) ==0 ) +while ((ret = task->func (task->qp)) ==0 ) ; task->ret = ret;
@@ -29,7 +29,7 @@ static void do_task(struct tasklet_strucint cont;int ret;struct rxe_task *task =from_tasklet (task, t, tasklet); -struct rxe_qp *qp = (struct rxe_qp *)task->arg; +struct rxe_qp *qp = (struct rxe_qp *)task->qp;unsigned int iterations =RXE_MAX_ITERATIONS ;spin_lock_bh (&task->lock);
@@ -54,7 +54,7 @@ static void do_task(struct tasklet_struc do { cont = 0; - ret = task->func(task->arg); + ret = task->func(task->qp); spin_lock_bh(&task->lock); switch (task->state) {
@@ -91,9 +91,10 @@ static void do_task(struct tasklet_struc task->ret = ret; } -int rxe_init_task (struct rxe_task *task,void *arg,int (*func)(void *)) +int rxe_init_task (struct rxe_task *task,struct rxe_qp *qp, +int (*func)(struct rxe_qp *)) { - task->arg = arg; + task->qp = qp; task->func = func; task->destroyed = false;
drivers/infiniband/sw/rxe/rxe_task.h +5 -4
@@ -22,18 +22,19 @@ struct rxe_task {struct tasklet_struct tasklet;int state;spinlock_t lock; -void *arg; -int (*func)(void *arg); +struct rxe_qp *qp; +int (*func)(struct rxe_qp *qp);int ret;bool destroyed; };/* * init rxe_task structure -* arg => parameter to pass to fcn +* qp => parameter to pass to func * func => function to call until it returns != 0 */ -int rxe_init_task (struct rxe_task *task,void *arg,int (*func)(void *)); +int rxe_init_task (struct rxe_task *task,struct rxe_qp *qp, +int (*func)(struct rxe_qp *));/* cleanup task */ void rxe_cleanup_task (struct rxe_task *task);
Greg Kroah-Hartman
maintainerPATCH 621/694 RDMA/rxe: Remove __rxe_do_task()
In reply to Greg Kroah-HartmanFrom: Bob Pearson <[email protected]>
[ Upstream commit 960ebe97e5238565d15063c8f4d1b2108efe2e65 ]
The subroutine __rxe_do_task is not thread safe and it has no way to guarantee that the tasks, which are designed with the assumption that they are non-reentrant, are not reentered. All of its uses are non-performance critical.
This patch replaces calls to __rxe_do_task with calls to rxe_sched_task. It also removes irrelevant or unneeded if tests.
Instead of calling the task machinery a single call to the tasklet function (rxe_requester, etc.) is sufficient to draing the queues if task execution has been disabled or stopped.
Together these changes allow the removal of __rxe_do_task.
Stable-dep-of: b2b1ddc45745 ("RDMA/rxe: Fix the error "trying to register non-static key in rxe_cleanup_task"")
--- drivers/infiniband/sw/rxe/rxe_qp.c | 56 +++++++++------------------- drivers/infiniband/sw/rxe/rxe_task.c | 13 ------- drivers/infiniband/sw/rxe/rxe_task.h | 6 --- 3 files changed, 17 insertions(+), 58 deletions(-)
drivers/infiniband/sw/rxe/rxe_qp.c +17 -39
@@ -473,29 +473,23 @@ static void rxe_qp_reset(struct rxe_qp *qp) {/* stop tasks from running */ rxe_disable_task (&qp->resp.task); - -/* stop request/comp */ -if (qp->sq.queue) { -if (qp_type (qp) ==IB_QPT_RC ) -rxe_disable_task (&qp->comp.task); -rxe_disable_task (&qp->req.task); - } +rxe_disable_task (&qp->comp.task); +rxe_disable_task (&qp->req.task);/* move qp to the reset state */ qp->req.state =QP_STATE_RESET ; qp->comp.state =QP_STATE_RESET ; qp->resp.state =QP_STATE_RESET ; -/* let state machines reset themselves drain work and packet queues -* etc. -*/ -__rxe_do_task (&qp->resp.task); +/* drain work and packet queuesc */ +rxe_requester (qp); +rxe_completer (qp); +rxe_responder (qp); -if (qp->sq.queue) { -__rxe_do_task (&qp->comp.task); -__rxe_do_task (&qp->req.task); +if (qp->rq.queue) +rxe_queue_reset (qp->rq.queue); +if (qp->sq.queue)rxe_queue_reset (qp->sq.queue); - }/* cleanup attributes */ atomic_set (&qp->ssn,0 );
@@ -518,13 +512,8 @@ static void rxe_qp_reset(struct rxe_qp *qp)/* reenable tasks */ rxe_enable_task (&qp->resp.task); - -if (qp->sq.queue) { -if (qp_type (qp) ==IB_QPT_RC ) -rxe_enable_task (&qp->comp.task); - -rxe_enable_task (&qp->req.task); - } +rxe_enable_task (&qp->comp.task); +rxe_enable_task (&qp->req.task); }/* drain the send queue */
@@ -533,10 +522,7 @@ static void rxe_qp_drain(struct rxe_qp *qp)if (qp->sq.queue) {if (qp->req.state !=QP_STATE_DRAINED ) { qp->req.state =QP_STATE_DRAIN ; -if (qp_type (qp) ==IB_QPT_RC ) -rxe_sched_task (&qp->comp.task); -else -__rxe_do_task (&qp->comp.task); +rxe_sched_task (&qp->comp.task);rxe_sched_task (&qp->req.task); } }
@@ -552,11 +538,7 @@ void rxe_qp_error(struct rxe_qp *qp)/* drain work and packet queues */ rxe_sched_task (&qp->resp.task); - -if (qp_type (qp) ==IB_QPT_RC ) -rxe_sched_task (&qp->comp.task); -else -__rxe_do_task (&qp->comp.task); +rxe_sched_task (&qp->comp.task);rxe_sched_task (&qp->req.task); }
@@ -773,24 +755,20 @@ static void rxe_qp_do_cleanup(struct work_struct *work) qp->valid =0 ; qp->qp_timeout_jiffies =0 ; -rxe_cleanup_task (&qp->resp.task);if (qp_type (qp) ==IB_QPT_RC ) {del_timer_sync (&qp->retrans_timer);del_timer_sync (&qp->rnr_nak_timer); } +rxe_cleanup_task (&qp->resp.task);rxe_cleanup_task (&qp->req.task);rxe_cleanup_task (&qp->comp.task);/* flush out any receive wr's or pending requests */ -if (qp->req.task.func) -__rxe_do_task (&qp->req.task); - -if (qp->sq.queue) { -__rxe_do_task (&qp->comp.task); -__rxe_do_task (&qp->req.task); - } +rxe_requester (qp); +rxe_completer (qp); +rxe_responder (qp);if (qp->sq.queue)rxe_queue_cleanup (qp->sq.queue);
drivers/infiniband/sw/rxe/rxe_task.c +0 -13
@@ -6,19 +6,6 @@#include "rxe.h" -int __rxe_do_task (struct rxe_task *task) - -{ -int ret; - -while ((ret = task->func (task->qp)) ==0 ) - ; - - task->ret = ret; - -return ret; -} -/* * this locking is due to a potential race where * a second caller finds the task already running
drivers/infiniband/sw/rxe/rxe_task.h +0 -6
@@ -39,12 +39,6 @@ int rxe_init_task(struct rxe_task *task, struct rxe_qp *qp,/* cleanup task */ void rxe_cleanup_task (struct rxe_task *task); -/* -* raw call to func in loop without any checking -* can call when tasklets are disabled -*/ -int __rxe_do_task (struct rxe_task *task); -void rxe_run_task (struct rxe_task *task);void rxe_sched_task (struct rxe_task *task);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 622/694 RDMA/rxe: Fix the error "trying to register non-static key in rxe_cleanup_task"
In reply to Greg Kroah-HartmanFrom: Zhu Yanjun <[email protected]>
[ Upstream commit b2b1ddc457458fecd1c6f385baa9fbda5f0c63ad ]
In the function rxe_create_qp(), rxe_qp_from_init() is called to initialize qp, internally things like rxe_init_task are not setup until rxe_qp_init_req().
If an error occurred before this point then the unwind will call rxe_cleanup() and eventually to rxe_qp_do_cleanup()/rxe_cleanup_task() which will oops when trying to access the uninitialized spinlock.
If rxe_init_task is not executed, rxe_cleanup_task will not be called.
--- drivers/infiniband/sw/rxe/rxe_qp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/infiniband/sw/rxe/rxe_qp.c +8 -3
@@ -761,9 +761,14 @@ static void rxe_qp_do_cleanup(struct work_struct *work)del_timer_sync (&qp->rnr_nak_timer); } -rxe_cleanup_task (&qp->resp.task); -rxe_cleanup_task (&qp->req.task); -rxe_cleanup_task (&qp->comp.task); +if (qp->resp.task.func) +rxe_cleanup_task (&qp->resp.task); + +if (qp->req.task.func) +rxe_cleanup_task (&qp->req.task); + +if (qp->comp.task.func) +rxe_cleanup_task (&qp->comp.task);/* flush out any receive wr's or pending requests */ rxe_requester (qp);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 623/694 RDMA/mlx5: Check pcie_relaxed_ordering_enabled() in UMR
In reply to Greg Kroah-HartmanFrom: Avihai Horon <[email protected]>
[ Upstream commit d43b020b0f82c088ef8ff3196ef00575a97d200e ]
relaxed_ordering_read HCA capability is set if both the device supports relaxed ordering (RO) read and RO is set in PCI config space.
RO in PCI config space can change during runtime. This will change the value of relaxed_ordering_read HCA capability in FW, but the driver will not see it since it queries the capabilities only once.
This can lead to the following scenario:
1. RO in PCI config space is enabled.
2. User creates MKey without RO.
3. RO in PCI config space is disabled.
As a result, relaxed_ordering_read HCA capability is turned off in FW but remains on in driver copy of the capabilities.
4. User requests to reconfig the MKey with RO via UMR.
5. Driver will try to reconfig the MKey with RO read although it shouldn't (as relaxed_ordering_read HCA capability is really off).
To fix this, check pcie_relaxed_ordering_enabled() before setting RO read in UMR.
--- drivers/infiniband/hw/mlx5/umr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/umr.c +4 -2
@@ -380,6 +380,9 @@ static void mlx5r_umr_set_access_flags(struct mlx5_ib_dev *dev,struct mlx5_mkey_seg *seg, unsigned int access_flags) { + bool ro_read = (access_flags & IB_ACCESS_RELAXED_ORDERING) && +pcie_relaxed_ordering_enabled (dev->mdev->pdev); +MLX5_SET (mkc, seg, a, !!(access_flags &IB_ACCESS_REMOTE_ATOMIC ));MLX5_SET (mkc, seg, rw, !!(access_flags &IB_ACCESS_REMOTE_WRITE ));MLX5_SET (mkc, seg, rr, !!(access_flags &IB_ACCESS_REMOTE_READ ));
@@ -387,8 +390,7 @@ static void mlx5r_umr_set_access_flags(struct mlx5_ib_dev *dev,MLX5_SET (mkc, seg, lr,1 );MLX5_SET (mkc, seg, relaxed_ordering_write, !!(access_flags &IB_ACCESS_RELAXED_ORDERING )); -MLX5_SET (mkc, seg, relaxed_ordering_read, - !!(access_flags &IB_ACCESS_RELAXED_ORDERING )); +MLX5_SET (mkc, seg, relaxed_ordering_read, ro_read); } int mlx5r_umr_rereg_pd_access(struct mlx5_ib_mr *mr, struct ib_pd *pd,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 624/694 RDMA/mlx5: Fix flow counter query via DEVX
In reply to Greg Kroah-HartmanFrom: Mark Bloch <[email protected]>
[ Upstream commit 3e358ea8614ddfbc59ca7a3f5dff5dde2b350b2c ]
Commit cited in "fixes" tag added bulk support for flow counters but it didn't account that's also possible to query a counter using a non-base id if the counter was allocated as bulk.
When a user performs a query, validate the flow counter id given in the mailbox is inside the valid range taking bulk value into account.
--- drivers/infiniband/hw/mlx5/devx.c | 31 ++++++++++++++++++++++++++----- include/linux/mlx5/mlx5_ifc.h | 3 ++- 2 files changed, 28 insertions(+), 6 deletions(-)
drivers/infiniband/hw/mlx5/devx.c +26 -5
@@ -666,7 +666,21 @@ static bool devx_is_valid_obj_id(struct uverbs_attr_bundle *attrs, obj_id;case MLX5_IB_OBJECT_DEVX_OBJ : -return ((struct devx_obj *)uobj->object)->obj_id == obj_id; + { +u16 opcode =MLX5_GET (general_obj_in_cmd_hdr, in, opcode); +struct devx_obj *devx_uobj = uobj->object; + +if (opcode ==MLX5_CMD_OP_QUERY_FLOW_COUNTER && + devx_uobj->flow_counter_bulk_size) { +u64 end; + + end = devx_uobj->obj_id + + devx_uobj->flow_counter_bulk_size; +return devx_uobj->obj_id <= obj_id && end > obj_id; + } + +return devx_uobj->obj_id == obj_id; + }default :return false;
@@ -1517,10 +1531,17 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_OBJ_CREATE)( goto obj_free;if (opcode ==MLX5_CMD_OP_ALLOC_FLOW_COUNTER ) { -u8 bulk =MLX5_GET (alloc_flow_counter_in, - cmd_in, - flow_counter_bulk); - obj->flow_counter_bulk_size =128UL * bulk; +u32 bulk =MLX5_GET (alloc_flow_counter_in, + cmd_in, + flow_counter_bulk_log_size); + +if (bulk) + bulk =1 << bulk; +else + bulk =128UL *MLX5_GET (alloc_flow_counter_in, + cmd_in, + flow_counter_bulk); + obj->flow_counter_bulk_size = bulk; } uobj->object = obj;
include/linux/mlx5/mlx5_ifc.h +2 -1
@@ -9271,7 +9271,8 @@ struct mlx5_ifc_alloc_flow_counter_in_bits {u8 reserved_at_20[0x10 ];u8 op_mod[0x10 ]; -u8 reserved_at_40[0x38 ]; +u8 reserved_at_40[0x33 ]; +u8 flow_counter_bulk_log_size[0x5 ];u8 flow_counter_bulk[0x8 ]; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 625/694 SUNRPC: remove the maximum number of retries in call_bind_status
In reply to Greg Kroah-HartmanFrom: Dai Ngo <[email protected]>
[ Upstream commit 691d0b782066a6eeeecbfceb7910a8f6184e6105 ]
Currently call_bind_status places a hard limit of 3 to the number of retries on EACCES error. This limit was done to prevent NLM unlock requests from being hang forever when the server keeps returning garbage. However this change causes problem for cases when NLM service takes longer than 9 seconds to register with the port mapper after a restart.
This patch removes this hard coded limit and let the RPC handles the retry based on the standard hard/soft task semantics.
--- include/linux/sunrpc/sched.h | 3 +-- net/sunrpc/clnt.c | 3 --- net/sunrpc/sched.c | 1 - 3 files changed, 1 insertion(+), 6 deletions(-)
include/linux/sunrpc/sched.h +1 -2
@@ -90,8 +90,7 @@ struct rpc_task {#endif unsigned char tk_priority : 2,/* Task priority */ tk_garb_retry : 2, - tk_cred_retry : 2, - tk_rebind_retry : 2; + tk_cred_retry : 2; };typedef void (*rpc_action )(struct rpc_task *);
net/sunrpc/clnt.c +0 -3
@@ -2050,9 +2050,6 @@ call_bind_status(struct rpc_task *task) status = -EOPNOTSUPP ;break ; } -if (task->tk_rebind_retry ==0 ) -break ; - task->tk_rebind_retry--;rpc_delay (task,3 *HZ ); goto retry_timeout;case -ENOBUFS :
net/sunrpc/sched.c +0 -1
@@ -817,7 +817,6 @@ rpc_init_task_statistics(struct rpc_task *task)/* Initialize retry counters */ task->tk_garb_retry =2 ; task->tk_cred_retry =2 ; - task->tk_rebind_retry =2 ;/* starting timestamp */ task->tk_start =ktime_get ();
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 626/694 RDMA/mlx5: Use correct device num_ports when modify DC
In reply to Greg Kroah-HartmanFrom: Mark Zhang <[email protected]>
[ Upstream commit 746aa3c8cb1a650ff2583497ac646e505831b9b9 ]
Just like other QP types, when modify DC, the port_num should be compared with dev->num_ports, instead of HCA_CAP.num_ports. Otherwise Multi-port vHCA on DC may not work.
--- drivers/infiniband/hw/mlx5/qp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +1 -1
@@ -4485,7 +4485,7 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr,return -EINVAL ;if (attr->port_num ==0 || - attr->port_num >MLX5_CAP_GEN (dev->mdev, num_ports)) { + attr->port_num > dev->num_ports) {mlx5_ib_dbg (dev,"invalid port number %d. number of ports is %d\n" , attr->port_num, dev->num_ports);return -EINVAL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 627/694 clocksource/drivers/davinci: Fix memory leak in davinci_timer_register when init fails
In reply to Greg Kroah-HartmanFrom: Qinrun Dai <[email protected]>
[ Upstream commit fb73556386e074e9bee9fa2d253aeaefe4e063e0 ]
Smatch reports:drivers/clocksource/timer-davinci.c:332 davinci_timer_register()
warn: 'base' from ioremap() not released on lines: 274.
Fix this and other potential memory leak problems
by adding a set of corresponding exit lables.
--- drivers/clocksource/timer-davinci.c | 30 +++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-)
drivers/clocksource/timer-davinci.c +24 -6
@@ -257,21 +257,25 @@ int __init davinci_timer_register(struct clk *clk, resource_size(&timer_cfg->reg), "davinci-timer")) {pr_err ("Unable to request memory region\n" ); -return -EBUSY ; + rv = -EBUSY ; + goto exit_clk_disable; } base =ioremap (timer_cfg->reg.start,resource_size (&timer_cfg->reg));if (!base) {pr_err ("Unable to map the register range\n" ); -return -ENOMEM ; + rv = -ENOMEM ; + goto exit_mem_region; }davinci_timer_init (base); tick_rate =clk_get_rate (clk); clockevent =kzalloc (sizeof (*clockevent),GFP_KERNEL ); -if (!clockevent) -return -ENOMEM ; +if (!clockevent) { + rv = -ENOMEM ; + goto exit_iounmap_base; + } clockevent->dev.name ="tim12" ; clockevent->dev.features =CLOCK_EVT_FEAT_ONESHOT ;
@@ -296,7 +300,7 @@ int __init davinci_timer_register(struct clk *clk, "clockevent/tim12", clockevent);if (rv) {pr_err ("Unable to request the clockevent interrupt\n" ); -return rv; + goto exit_free_clockevent; } davinci_clocksource.dev.rating =300 ;
@@ -323,13 +327,27 @@ int __init davinci_timer_register(struct clk *clk, rv =clocksource_register_hz (&davinci_clocksource.dev, tick_rate);if (rv) {pr_err ("Unable to register clocksource\n" ); -return rv; + goto exit_free_irq; }sched_clock_register (davinci_timer_read_sched_clock,DAVINCI_TIMER_CLKSRC_BITS , tick_rate);return 0 ; + +exit_free_irq: +free_irq (timer_cfg->irq[DAVINCI_TIMER_CLOCKEVENT_IRQ ].start, + clockevent); +exit_free_clockevent: +kfree (clockevent); +exit_iounmap_base: +iounmap (base); +exit_mem_region: +release_mem_region (timer_cfg->reg.start, +resource_size (&timer_cfg->reg)); +exit_clk_disable: +clk_disable_unprepare (clk); +return rv; }static int __init of_davinci_timer_register (struct device_node *np)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 628/694 openrisc: Properly store r31 to pt_regs on unhandled exceptions
In reply to Greg Kroah-HartmanFrom: Stafford Horne <[email protected]>
[ Upstream commit 812489ac4dd91144a74ce65ecf232252a2e406fb ]
In commit 91993c8c2ed5 ("openrisc: use shadow registers to save regs on exception") the unhandled exception path was changed to do an early store of r30 instead of r31. The entry code was not updated and r31 is not getting stored to pt_regs.
This patch updates the entry handler to store r31 instead of r30. We also remove some misleading commented out store r30 and r31 instructrions.
I noticed this while working on adding floating point exception handling, This issue probably would never impact anything since we kill the process or Oops right away on unhandled exceptions.
--- arch/openrisc/kernel/entry.S | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/openrisc/kernel/entry.S +2 -4
@@ -173,7 +173,6 @@ handler: ;\ l.sw PT_GPR28(r1),r28 ;\ l.sw PT_GPR29(r1),r29 ;\ /* r30 already save */ ;\ -/* l.sw PT_GPR30(r1),r30*/ ;\ l.sw PT_GPR31(r1),r31 ;\ TRACE_IRQS_OFF_ENTRY ;\ /* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\
@@ -211,9 +210,8 @@ handler: ;\ l.sw PT_GPR27(r1),r27 ;\ l.sw PT_GPR28(r1),r28 ;\ l.sw PT_GPR29(r1),r29 ;\ - /* r31 already saved */ ;\ - l.sw PT_GPR30(r1),r30 ;\ -/* l.sw PT_GPR31(r1),r31 */ ;\ + /* r30 already saved */ ;\ + l.sw PT_GPR31(r1),r31 ;\ /* Store -1 in orig_gpr11 for non-syscall exceptions */ ;\ l.addi r30,r0,-1 ;\ l.sw PT_ORIG_GPR11(r1),r30 ;\
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 629/694 timekeeping: Fix references to nonexistent ktime_get_fast_ns()
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 158009f1b4a33bc0f354b994eea361362bd83226 ]
There was never a function named ktime_get_fast_ns(). Presumably these should refer to ktime_get_mono_fast_ns() instead.
--- kernel/time/timekeeping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/time/timekeeping.c +2 -2
@@ -526,7 +526,7 @@ EXPORT_SYMBOL_GPL(ktime_get_raw_fast_ns);* partially updated. Since the tk->offs_boot update is a rare event, this * should be a rare occurrence which postprocessing should be able to handle. * -* The caveats vs. timestamp ordering as documented for ktime_get_fast_ns() +* The caveats vs. timestamp ordering as documented for ktime_get_mono_fast_ns() * apply as well. */ u64 notrace ktime_get_boot_fast_ns(void)
@@ -576,7 +576,7 @@ static __always_inline u64 __ktime_get_real_fast(struct tk_fast *tkf, u64 *mono)/** * ktime_get_real_fast_ns: - NMI safe and fast access to clock realtime. * -* See ktime_get_fast_ns() for documentation of the time stamp ordering. +* See ktime_get_mono_fast_ns() for documentation of the time stamp ordering. */ u64 ktime_get_real_fast_ns (void ) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 630/694 SMB3: Add missing locks to protect deferred close file list
In reply to Greg Kroah-HartmanFrom: Bharath SM <[email protected]>
[ Upstream commit ab9ddc87a9055c4bebd6524d5d761d605d52e557 ]
cifs_del_deferred_close function has a critical section which modifies the deferred close file list. We must acquire deferred_lock before calling cifs_del_deferred_close function.
--- fs/cifs/misc.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/cifs/misc.c +6 -0
@@ -749,7 +749,9 @@ cifs_close_deferred_file(struct cifsInodeInfo *cifs_inode)list_for_each_entry (cfile, &cifs_inode->openFileList, flist) {if (delayed_work_pending (&cfile->deferred)) {if (cancel_delayed_work (&cfile->deferred)) { +spin_lock (&cifs_inode->deferred_lock);cifs_del_deferred_close (cfile); +spin_unlock (&cifs_inode->deferred_lock); tmp_list =kmalloc (sizeof (struct file_list ),GFP_ATOMIC );if (tmp_list ==NULL )
@@ -780,7 +782,9 @@ cifs_close_all_deferred_files(struct cifs_tcon *tcon)list_for_each_entry (cfile, &tcon->openFileList, tlist) {if (delayed_work_pending (&cfile->deferred)) {if (cancel_delayed_work (&cfile->deferred)) { +spin_lock (&CIFS_I (d_inode (cfile->dentry))->deferred_lock);cifs_del_deferred_close (cfile); +spin_unlock (&CIFS_I (d_inode (cfile->dentry))->deferred_lock); tmp_list =kmalloc (sizeof (struct file_list ),GFP_ATOMIC );if (tmp_list ==NULL )
@@ -815,7 +819,9 @@ cifs_close_deferred_file_under_dentry(struct cifs_tcon *tcon, const char *path)if (strstr (full_path, path)) {if (delayed_work_pending (&cfile->deferred)) {if (cancel_delayed_work (&cfile->deferred)) { +spin_lock (&CIFS_I (d_inode (cfile->dentry))->deferred_lock);cifs_del_deferred_close (cfile); +spin_unlock (&CIFS_I (d_inode (cfile->dentry))->deferred_lock); tmp_list =kmalloc (sizeof (struct file_list ),GFP_ATOMIC );if (tmp_list ==NULL )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 631/694 SMB3: Close deferred file handles in case of handle lease break
In reply to Greg Kroah-HartmanFrom: Bharath SM <[email protected]>
[ Upstream commit d906be3fa571f6fc9381911304a0eca99f1b6951 ]
We should not cache deferred file handles if we dont have handle lease on a file. And we should immediately close all deferred handles in case of handle lease break.
--- fs/cifs/file.c | 16 ++++++++++++++++ fs/cifs/misc.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-)
fs/cifs/file.c +16 -0
@@ -4882,6 +4882,8 @@ void cifs_oplock_break(struct work_struct *work)struct TCP_Server_Info *server = tcon->ses->server;int rc =0 ;bool purge_cache = false; +struct cifs_deferred_close *dclose; +bool is_deferred = false;wait_on_bit (&cinode->flags,CIFS_INODE_PENDING_WRITERS ,TASK_UNINTERRUPTIBLE );
@@ -4917,6 +4919,20 @@ void cifs_oplock_break(struct work_struct *work)cifs_dbg (VFS ,"Push locks rc = %d\n" , rc); oplock_break_ack: +/* +* When oplock break is received and there are no active +* file handles but cached, then schedule deferred close immediately. +* So, new open will not use cached handle. +*/ +spin_lock (&CIFS_I (inode)->deferred_lock); + is_deferred =cifs_is_deferred_close (cfile, &dclose); +spin_unlock (&CIFS_I (inode)->deferred_lock); + +if (!CIFS_CACHE_HANDLE (cinode) && is_deferred && + cfile->deferred_close_scheduled &&delayed_work_pending (&cfile->deferred)) { +cifs_close_deferred_file (cinode); + } +/* * releasing stale oplock after recent reconnect of smb session using * a now incorrect file handle is not a data integrity issue but do
fs/cifs/misc.c +1 -1
@@ -764,7 +764,7 @@ cifs_close_deferred_file(struct cifsInodeInfo *cifs_inode)spin_unlock (&cifs_inode->open_file_lock);list_for_each_entry_safe (tmp_list, tmp_next_list, &file_head, list) { -_cifsFileInfo_put (tmp_list->cfile, true, false); +_cifsFileInfo_put (tmp_list->cfile, false, false);list_del (&tmp_list->list);kfree (tmp_list); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 632/694 rtc: jz4740: Make sure clock provider gets removed
In reply to Greg Kroah-HartmanFrom: Lars-Peter Clausen <[email protected]>
[ Upstream commit c7a639dac8e4d7e63450bef2f3a19fb331566fb1 ]
The jz4740 RTC driver registers a clock provider, but never removes it. This leaves a stale clock provider behind that references freed clocks when the device is unbound.
Use the managed devm_of_clk_add_hw_provider() instead of of_clk_add_hw_provider() to make sure the provider gets automatically removed on unbind.
--- drivers/rtc/rtc-jz4740.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rtc/rtc-jz4740.c +2 -1
@@ -414,7 +414,8 @@ static int jz4740_rtc_probe(struct platform_device *pdev)return dev_err_probe (dev, ret,"Unable to register clk32k clock\n" ); - ret =of_clk_add_hw_provider (np, of_clk_hw_simple_get, &rtc->clk32k); + ret =devm_of_clk_add_hw_provider (dev, of_clk_hw_simple_get, + &rtc->clk32k);if (ret)return dev_err_probe (dev, ret,"Unable to register clk32k clock provider\n" );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 633/694 ext4: fix i_disksize exceeding i_size problem in paritally written case
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
[ Upstream commit 1dedde690303c05ef732b7c5c8356fdf60a4ade3 ]
It is possible for i_disksize can exceed i_size, triggering a warning.
generic_perform_write
copied = iov_iter_copy_from_user_atomic(len) // copied < len ext4_da_write_end
| ext4_update_i_disksize | new_i_size = pos + copied; | WRITE_ONCE(EXT4_I(inode)->i_disksize, newsize) // update i_disksize | generic_write_end | copied = block_write_end(copied, len) // copied = 0 | if (unlikely(copied < len)) | if (!PageUptodate(page)) | copied = 0; | if (pos + copied > inode->i_size) // return false
if (unlikely(copied == 0))
goto again;
if (unlikely(iov_iter_fault_in_readable(i, bytes))) {
status = -EFAULT;
break;
}
We get i_disksize greater than i_size here, which could trigger WARNING check 'i_size_read(inode) < EXT4_I(inode)->i_disksize' while doing dio:
ext4_dio_write_iter
iomap_dio_rw
__iomap_dio_rw // return err, length is not aligned to 512
ext4_handle_inode_extension
WARN_ON_ONCE(i_size_read(inode) < EXT4_I(inode)->i_disksize) // Oops
WARNING: CPU: 2 PID: 2609 at fs/ext4/file.c:319 CPU: 2 PID: 2609 Comm: aa Not tainted 6.3.0-rc2 RIP: 0010:ext4_file_write_iter+0xbc7 Call Trace: vfs_write+0x3b1 ksys_write+0x77 do_syscall_64+0x39
Fix it by updating 'copied' value before updating i_disksize just like ext4_write_inline_data_end() does.
A reproducer can be found in the buganizer link below.
--- fs/ext4/inode.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ext4/inode.c +3 -0
@@ -3148,6 +3148,9 @@ static int ext4_da_write_end(struct file *file, ext4_has_inline_data(inode))return ext4_write_inline_data_end (inode, pos, len, copied, page); +if (unlikely (copied < len) && !PageUptodate (page)) + copied =0 ; + start = pos & (PAGE_SIZE -1 ); end = start + copied -1 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 634/694 ext4: fix use-after-free read in ext4_find_extent for bigalloc + inline
In reply to Greg Kroah-HartmanFrom: Ye Bin <[email protected]>
[ Upstream commit 835659598c67907b98cd2aa57bb951dfaf675c69 ]
Syzbot found the following issue:
loop0: detected capacity change from 0 to 2048
EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 without journal. Quota mode: none.
==================================================================
BUG: KASAN: use-after-free in ext4_ext_binsearch_idx fs/ext4/extents.c:768 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0x76e/0xd90 fs/ext4/extents.c:931 Read of size 4 at addr ffff888073644750 by task syz-executor420/5067 CPU: 0 PID: 5067 Comm: syz-executor420 Not tainted 6.2.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x290 lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:306 print_report+0x107/0x1f0 mm/kasan/report.c:417 kasan_report+0xcd/0x100 mm/kasan/report.c:517 ext4_ext_binsearch_idx fs/ext4/extents.c:768 [inline] ext4_find_extent+0x76e/0xd90 fs/ext4/extents.c:931 ext4_clu_mapped+0x117/0x970 fs/ext4/extents.c:5809 ext4_insert_delayed_block fs/ext4/inode.c:1696 [inline] ext4_da_map_blocks fs/ext4/inode.c:1806 [inline] ext4_da_get_block_prep+0x9e8/0x13c0 fs/ext4/inode.c:1870 ext4_block_write_begin+0x6a8/0x2290 fs/ext4/inode.c:1098 ext4_da_write_begin+0x539/0x760 fs/ext4/inode.c:3082 generic_perform_write+0x2e4/0x5e0 mm/filemap.c:3772 ext4_buffered_write_iter+0x122/0x3a0 fs/ext4/file.c:285 ext4_file_write_iter+0x1d0/0x18f0 call_write_iter include/linux/fs.h:2186 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7dc/0xc50 fs/read_write.c:584 ksys_write+0x177/0x2a0 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4b7a9737b9 RSP: 002b:00007ffc5cac3668 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f4b7a9737b9 RDX: 00000000175d9003 RSI: 0000000020000200 RDI: 0000000000000004 RBP: 00007f4b7a933050 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000079f R11: 0000000000000246 R12: 00007f4b7a9330e0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 </TASK>
Above issue is happens when enable bigalloc and inline data feature. As commit 131294c35ed6 fixed delayed allocation bug in ext4_clu_mapped for bigalloc + inline. But it only resolved issue when has inline data, if inline data has been converted to extent(ext4_da_convert_inline_data_to_extent) before writepages, there is no EXT4_STATE_MAY_INLINE_DATA flag. However i_data is still store inline data in this scene. Then will trigger UAF when find extent.
To resolve above issue, there is need to add judge "ext4_has_inline_data(inode)" in ext4_clu_mapped().
--- fs/ext4/extents.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/extents.c +2 -1
@@ -5802,7 +5802,8 @@ int ext4_clu_mapped(struct inode *inode, ext4_lblk_t lclu)* mapped - no physical clusters have been allocated, and the * file has no extents */ -if (ext4_test_inode_state (inode,EXT4_STATE_MAY_INLINE_DATA )) +if (ext4_test_inode_state (inode,EXT4_STATE_MAY_INLINE_DATA ) || +ext4_has_inline_data (inode))return 0 ;/* search for the extent closest to the first block in the cluster */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 635/694 pinctrl: renesas: r8a779a0: Remove incorrect AVB[01] pinmux configuration
In reply to Greg Kroah-HartmanFrom: Hai Pham <[email protected]>
[ Upstream commit a145c9a8674ac8fbfa1595276e1b6cbfc5139038 ]
AVB[01]_{MAGIC,MDC,MDIO,TXCREFCLK} are registered as both PINMUX_SINGLE(fn) and PINMUX_IPSR_GPSR(fn) in the pinmux_data array.
The latter are correct, hence remove the former.
Without this fix, the Ethernet PHY is not operational on the MDIO bus.
--- drivers/pinctrl/renesas/pfc-r8a779a0.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/pinctrl/renesas/pfc-r8a779a0.c +0 -8
@@ -696,16 +696,8 @@ static const u16 pinmux_data[] = {PINMUX_SINGLE (PCIE0_CLKREQ_N ),PINMUX_SINGLE (AVB0_PHY_INT ), -PINMUX_SINGLE (AVB0_MAGIC ), -PINMUX_SINGLE (AVB0_MDC ), -PINMUX_SINGLE (AVB0_MDIO ), -PINMUX_SINGLE (AVB0_TXCREFCLK ),PINMUX_SINGLE (AVB1_PHY_INT ), -PINMUX_SINGLE (AVB1_MAGIC ), -PINMUX_SINGLE (AVB1_MDC ), -PINMUX_SINGLE (AVB1_MDIO ), -PINMUX_SINGLE (AVB1_TXCREFCLK ),PINMUX_SINGLE (AVB2_AVTP_PPS ), PINMUX_SINGLE(AVB2_AVTP_CAPTURE),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 636/694 pinctrl: renesas: r8a779f0: Fix tsn1_avtp_pps pin group
In reply to Greg Kroah-HartmanFrom: Phong Hoang <[email protected]>
[ Upstream commit 60003351e99167d8cfa7c161e95856efc016f381 ]
Correct a typo mistake in the definition of the tsn1_avtp_pps pin group mux.
--- drivers/pinctrl/renesas/pfc-r8a779f0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/renesas/pfc-r8a779f0.c +1 -1
@@ -1213,7 +1213,7 @@ static const unsigned int tsn1_avtp_pps_pins[] = { RCAR_GP_PIN(3, 13), };static const unsigned int tsn1_avtp_pps_mux[] = { -TSN0_AVTP_PPS_MARK , +TSN1_AVTP_PPS_MARK , };static const unsigned int tsn1_avtp_capture_a_pins[] = {/* TSN1_AVTP_CAPTURE_A */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 637/694 pinctrl: renesas: r8a779g0: Fix Group 4/5 pin functions
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 0a7a5226e7b177c68800985a19a80c1df9bceff6 ]
According to R-Car V4H Series User’s Manual: Hardware Rev. 0.54, pin groups 4 and 5 do not use Module Select Registers to configure pin functions, but use Peripheral Function Select Registers instead.
Hence:
- Remove the non-existent Module Select Registers (MODSEL[45]),
- Add the missing Peripheral Function Select Registers (IPxSR[45]),
- Correct the GPIO / Peripheral Function Select Register definitions
(GPSR]45_*),
- Correct the affected PINMUX definitions.
--- drivers/pinctrl/renesas/pfc-r8a779g0.c | 467 +++++++++++++++---------- 1 file changed, 279 insertions(+), 188 deletions(-)
drivers/pinctrl/renesas/pfc-r8a779g0.c +279 -188
@@ -156,54 +156,54 @@#define GPSR3_0 F_(MMC_SD_D1, IP0SR3_3_0)/* GPSR4 */ -#define GPSR4_24 FM(AVS1) -#define GPSR4_23 FM(AVS0) -#define GPSR4_22 FM(PCIE1_CLKREQ_N) -#define GPSR4_21 FM(PCIE0_CLKREQ_N) -#define GPSR4_20 FM(TSN0_TXCREFCLK) -#define GPSR4_19 FM(TSN0_TD2) -#define GPSR4_18 FM(TSN0_TD3) -#define GPSR4_17 FM(TSN0_RD2) -#define GPSR4_16 FM(TSN0_RD3) -#define GPSR4_15 FM(TSN0_TD0) -#define GPSR4_14 FM(TSN0_TD1) -#define GPSR4_13 FM(TSN0_RD1) -#define GPSR4_12 FM(TSN0_TXC) -#define GPSR4_11 FM(TSN0_RXC) -#define GPSR4_10 FM(TSN0_RD0) -#define GPSR4_9 FM(TSN0_TX_CTL) -#define GPSR4_8 FM(TSN0_AVTP_PPS0) -#define GPSR4_7 FM(TSN0_RX_CTL) -#define GPSR4_6 FM(TSN0_AVTP_CAPTURE) -#define GPSR4_5 FM(TSN0_AVTP_MATCH) -#define GPSR4_4 FM(TSN0_LINK) -#define GPSR4_3 FM(TSN0_PHY_INT) -#define GPSR4_2 FM(TSN0_AVTP_PPS1) -#define GPSR4_1 FM(TSN0_MDC) -#define GPSR4_0 FM(TSN0_MDIO) +#define GPSR4_24 F_(AVS1, IP3SR4_3_0) +#define GPSR4_23 F_(AVS0, IP2SR4_31_28) +#define GPSR4_22 F_(PCIE1_CLKREQ_N, IP2SR4_27_24) +#define GPSR4_21 F_(PCIE0_CLKREQ_N, IP2SR4_23_20) +#define GPSR4_20 F_(TSN0_TXCREFCLK, IP2SR4_19_16) +#define GPSR4_19 F_(TSN0_TD2, IP2SR4_15_12) +#define GPSR4_18 F_(TSN0_TD3, IP2SR4_11_8) +#define GPSR4_17 F_(TSN0_RD2, IP2SR4_7_4) +#define GPSR4_16 F_(TSN0_RD3, IP2SR4_3_0) +#define GPSR4_15 F_(TSN0_TD0, IP1SR4_31_28) +#define GPSR4_14 F_(TSN0_TD1, IP1SR4_27_24) +#define GPSR4_13 F_(TSN0_RD1, IP1SR4_23_20) +#define GPSR4_12 F_(TSN0_TXC, IP1SR4_19_16) +#define GPSR4_11 F_(TSN0_RXC, IP1SR4_15_12) +#define GPSR4_10 F_(TSN0_RD0, IP1SR4_11_8) +#define GPSR4_9 F_(TSN0_TX_CTL, IP1SR4_7_4) +#define GPSR4_8 F_(TSN0_AVTP_PPS0, IP1SR4_3_0) +#define GPSR4_7 F_(TSN0_RX_CTL, IP0SR4_31_28) +#define GPSR4_6 F_(TSN0_AVTP_CAPTURE, IP0SR4_27_24) +#define GPSR4_5 F_(TSN0_AVTP_MATCH, IP0SR4_23_20) +#define GPSR4_4 F_(TSN0_LINK, IP0SR4_19_16) +#define GPSR4_3 F_(TSN0_PHY_INT, IP0SR4_15_12) +#define GPSR4_2 F_(TSN0_AVTP_PPS1, IP0SR4_11_8) +#define GPSR4_1 F_(TSN0_MDC, IP0SR4_7_4) +#define GPSR4_0 F_(TSN0_MDIO, IP0SR4_3_0)/* GPSR 5 */ -#define GPSR5_20 FM(AVB2_RX_CTL) -#define GPSR5_19 FM(AVB2_TX_CTL) -#define GPSR5_18 FM(AVB2_RXC) -#define GPSR5_17 FM(AVB2_RD0) -#define GPSR5_16 FM(AVB2_TXC) -#define GPSR5_15 FM(AVB2_TD0) -#define GPSR5_14 FM(AVB2_RD1) -#define GPSR5_13 FM(AVB2_RD2) -#define GPSR5_12 FM(AVB2_TD1) -#define GPSR5_11 FM(AVB2_TD2) -#define GPSR5_10 FM(AVB2_MDIO) -#define GPSR5_9 FM(AVB2_RD3) -#define GPSR5_8 FM(AVB2_TD3) -#define GPSR5_7 FM(AVB2_TXCREFCLK) -#define GPSR5_6 FM(AVB2_MDC) -#define GPSR5_5 FM(AVB2_MAGIC) -#define GPSR5_4 FM(AVB2_PHY_INT) -#define GPSR5_3 FM(AVB2_LINK) -#define GPSR5_2 FM(AVB2_AVTP_MATCH) -#define GPSR5_1 FM(AVB2_AVTP_CAPTURE) -#define GPSR5_0 FM(AVB2_AVTP_PPS) +#define GPSR5_20 F_(AVB2_RX_CTL, IP2SR5_19_16) +#define GPSR5_19 F_(AVB2_TX_CTL, IP2SR5_15_12) +#define GPSR5_18 F_(AVB2_RXC, IP2SR5_11_8) +#define GPSR5_17 F_(AVB2_RD0, IP2SR5_7_4) +#define GPSR5_16 F_(AVB2_TXC, IP2SR5_3_0) +#define GPSR5_15 F_(AVB2_TD0, IP1SR5_31_28) +#define GPSR5_14 F_(AVB2_RD1, IP1SR5_27_24) +#define GPSR5_13 F_(AVB2_RD2, IP1SR5_23_20) +#define GPSR5_12 F_(AVB2_TD1, IP1SR5_19_16) +#define GPSR5_11 F_(AVB2_TD2, IP1SR5_15_12) +#define GPSR5_10 F_(AVB2_MDIO, IP1SR5_11_8) +#define GPSR5_9 F_(AVB2_RD3, IP1SR5_7_4) +#define GPSR5_8 F_(AVB2_TD3, IP1SR5_3_0) +#define GPSR5_7 F_(AVB2_TXCREFCLK, IP0SR5_31_28) +#define GPSR5_6 F_(AVB2_MDC, IP0SR5_27_24) +#define GPSR5_5 F_(AVB2_MAGIC, IP0SR5_23_20) +#define GPSR5_4 F_(AVB2_PHY_INT, IP0SR5_19_16) +#define GPSR5_3 F_(AVB2_LINK, IP0SR5_15_12) +#define GPSR5_2 F_(AVB2_AVTP_MATCH, IP0SR5_11_8) +#define GPSR5_1 F_(AVB2_AVTP_CAPTURE, IP0SR5_7_4) +#define GPSR5_0 F_(AVB2_AVTP_PPS, IP0SR5_3_0)/* GPSR 6 */ #define GPSR6_20 F_(AVB1_TXCREFCLK, IP2SR6_19_16)
@@ -397,6 +397,68 @@#define IP3SR3_19_16 FM(RPC_WP_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)#define IP3SR3_23_20 FM(RPC_INT_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* SR4 */ +/* IP0SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR4_3_0 FM(TSN0_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_7_4 FM(TSN0_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_11_8 FM(TSN0_AVTP_PPS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_15_12 FM(TSN0_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_19_16 FM(TSN0_LINK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_23_20 FM(TSN0_AVTP_MATCH) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_27_24 FM(TSN0_AVTP_CAPTURE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_31_28 FM(TSN0_RX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR4_3_0 FM(TSN0_AVTP_PPS0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_7_4 FM(TSN0_TX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_11_8 FM(TSN0_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_15_12 FM(TSN0_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_19_16 FM(TSN0_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_23_20 FM(TSN0_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_27_24 FM(TSN0_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_31_28 FM(TSN0_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR4_3_0 FM(TSN0_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_7_4 FM(TSN0_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_11_8 FM(TSN0_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_15_12 FM(TSN0_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_19_16 FM(TSN0_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_23_20 FM(PCIE0_CLKREQ_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_27_24 FM(PCIE1_CLKREQ_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_31_28 FM(AVS0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP3SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP3SR4_3_0 FM(AVS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* SR5 */ +/* IP0SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR5_3_0 FM(AVB2_AVTP_PPS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_7_4 FM(AVB2_AVTP_CAPTURE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_11_8 FM(AVB2_AVTP_MATCH) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_15_12 FM(AVB2_LINK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_19_16 FM(AVB2_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_23_20 FM(AVB2_MAGIC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_27_24 FM(AVB2_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_31_28 FM(AVB2_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR5_3_0 FM(AVB2_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_7_4 FM(AVB2_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_11_8 FM(AVB2_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_15_12 FM(AVB2_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_19_16 FM(AVB2_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_23_20 FM(AVB2_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_27_24 FM(AVB2_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_31_28 FM(AVB2_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR5_3_0 FM(AVB2_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR5_7_4 FM(AVB2_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR5_11_8 FM(AVB2_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR5_15_12 FM(AVB2_TX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR5_19_16 FM(AVB2_RX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* SR6 */ /* IP0SR6 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ #define IP0SR6_3_0 FM(AVB1_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
@@ -542,6 +604,24 @@ FM(IP0SR3_23_20) IP0SR3_23_20 FM(IP1SR3_23_20) IP1SR3_23_20 FM(IP2SR3_23_20) IP2 FM(IP0SR3_27_24) IP0SR3_27_24 FM(IP1SR3_27_24) IP1SR3_27_24 FM(IP2SR3_27_24) IP2SR3_27_24 \ FM(IP0SR3_31_28) IP0SR3_31_28 FM(IP1SR3_31_28) IP1SR3_31_28 FM(IP2SR3_31_28) IP2SR3_31_28 \ \ +FM(IP0SR4_3_0) IP0SR4_3_0 FM(IP1SR4_3_0) IP1SR4_3_0 FM(IP2SR4_3_0) IP2SR4_3_0 FM(IP3SR4_3_0) IP3SR4_3_0 \ +FM(IP0SR4_7_4) IP0SR4_7_4 FM(IP1SR4_7_4) IP1SR4_7_4 FM(IP2SR4_7_4) IP2SR4_7_4 \ +FM(IP0SR4_11_8) IP0SR4_11_8 FM(IP1SR4_11_8) IP1SR4_11_8 FM(IP2SR4_11_8) IP2SR4_11_8 \ +FM(IP0SR4_15_12) IP0SR4_15_12 FM(IP1SR4_15_12) IP1SR4_15_12 FM(IP2SR4_15_12) IP2SR4_15_12 \ +FM(IP0SR4_19_16) IP0SR4_19_16 FM(IP1SR4_19_16) IP1SR4_19_16 FM(IP2SR4_19_16) IP2SR4_19_16 \ +FM(IP0SR4_23_20) IP0SR4_23_20 FM(IP1SR4_23_20) IP1SR4_23_20 FM(IP2SR4_23_20) IP2SR4_23_20 \ +FM(IP0SR4_27_24) IP0SR4_27_24 FM(IP1SR4_27_24) IP1SR4_27_24 FM(IP2SR4_27_24) IP2SR4_27_24 \ +FM(IP0SR4_31_28) IP0SR4_31_28 FM(IP1SR4_31_28) IP1SR4_31_28 FM(IP2SR4_31_28) IP2SR4_31_28 \ +\ +FM(IP0SR5_3_0) IP0SR5_3_0 FM(IP1SR5_3_0) IP1SR5_3_0 FM(IP2SR5_3_0) IP2SR5_3_0 \ +FM(IP0SR5_7_4) IP0SR5_7_4 FM(IP1SR5_7_4) IP1SR5_7_4 FM(IP2SR5_7_4) IP2SR5_7_4 \ +FM(IP0SR5_11_8) IP0SR5_11_8 FM(IP1SR5_11_8) IP1SR5_11_8 FM(IP2SR5_11_8) IP2SR5_11_8 \ +FM(IP0SR5_15_12) IP0SR5_15_12 FM(IP1SR5_15_12) IP1SR5_15_12 FM(IP2SR5_15_12) IP2SR5_15_12 \ +FM(IP0SR5_19_16) IP0SR5_19_16 FM(IP1SR5_19_16) IP1SR5_19_16 FM(IP2SR5_19_16) IP2SR5_19_16 \ +FM(IP0SR5_23_20) IP0SR5_23_20 FM(IP1SR5_23_20) IP1SR5_23_20 \ +FM(IP0SR5_27_24) IP0SR5_27_24 FM(IP1SR5_27_24) IP1SR5_27_24 \ +FM(IP0SR5_31_28) IP0SR5_31_28 FM(IP1SR5_31_28) IP1SR5_31_28 \ +\ FM(IP0SR6_3_0) IP0SR6_3_0 FM(IP1SR6_3_0) IP1SR6_3_0 FM(IP2SR6_3_0) IP2SR6_3_0 \ FM(IP0SR6_7_4) IP0SR6_7_4 FM(IP1SR6_7_4) IP1SR6_7_4 FM(IP2SR6_7_4) IP2SR6_7_4 \ FM(IP0SR6_11_8) IP0SR6_11_8 FM(IP1SR6_11_8) IP1SR6_11_8 FM(IP2SR6_11_8) IP2SR6_11_8 \
@@ -569,30 +649,6 @@ FM(IP0SR8_23_20) IP0SR8_23_20 FM(IP1SR8_23_20) IP1SR8_23_20 \ FM(IP0SR8_27_24) IP0SR8_27_24 \FM (IP0SR8_31_28)IP0SR8_31_28 -/* MOD_SEL4 */ /* 0 */ /* 1 */ -#define MOD_SEL4_19 FM(SEL_TSN0_TD2_0) FM(SEL_TSN0_TD2_1) -#define MOD_SEL4_18 FM(SEL_TSN0_TD3_0) FM(SEL_TSN0_TD3_1) -#define MOD_SEL4_15 FM(SEL_TSN0_TD0_0) FM(SEL_TSN0_TD0_1) -#define MOD_SEL4_14 FM(SEL_TSN0_TD1_0) FM(SEL_TSN0_TD1_1) -#define MOD_SEL4_12 FM(SEL_TSN0_TXC_0) FM(SEL_TSN0_TXC_1) -#define MOD_SEL4_9 FM(SEL_TSN0_TX_CTL_0) FM(SEL_TSN0_TX_CTL_1) -#define MOD_SEL4_8 FM(SEL_TSN0_AVTP_PPS0_0) FM(SEL_TSN0_AVTP_PPS0_1) -#define MOD_SEL4_5 FM(SEL_TSN0_AVTP_MATCH_0) FM(SEL_TSN0_AVTP_MATCH_1) -#define MOD_SEL4_2 FM(SEL_TSN0_AVTP_PPS1_0) FM(SEL_TSN0_AVTP_PPS1_1) -#define MOD_SEL4_1 FM(SEL_TSN0_MDC_0) FM(SEL_TSN0_MDC_1) - -/* MOD_SEL5 */ /* 0 */ /* 1 */ -#define MOD_SEL5_19 FM(SEL_AVB2_TX_CTL_0) FM(SEL_AVB2_TX_CTL_1) -#define MOD_SEL5_16 FM(SEL_AVB2_TXC_0) FM(SEL_AVB2_TXC_1) -#define MOD_SEL5_15 FM(SEL_AVB2_TD0_0) FM(SEL_AVB2_TD0_1) -#define MOD_SEL5_12 FM(SEL_AVB2_TD1_0) FM(SEL_AVB2_TD1_1) -#define MOD_SEL5_11 FM(SEL_AVB2_TD2_0) FM(SEL_AVB2_TD2_1) -#define MOD_SEL5_8 FM(SEL_AVB2_TD3_0) FM(SEL_AVB2_TD3_1) -#define MOD_SEL5_6 FM(SEL_AVB2_MDC_0) FM(SEL_AVB2_MDC_1) -#define MOD_SEL5_5 FM(SEL_AVB2_MAGIC_0) FM(SEL_AVB2_MAGIC_1) -#define MOD_SEL5_2 FM(SEL_AVB2_AVTP_MATCH_0) FM(SEL_AVB2_AVTP_MATCH_1) -#define MOD_SEL5_0 FM(SEL_AVB2_AVTP_PPS_0) FM(SEL_AVB2_AVTP_PPS_1) - /* MOD_SEL6 */ /* 0 */ /* 1 */#define MOD_SEL6_18 FM(SEL_AVB1_TD3_0) FM(SEL_AVB1_TD3_1)#define MOD_SEL6_16 FM(SEL_AVB1_TD2_0) FM(SEL_AVB1_TD2_1)
@@ -633,26 +689,23 @@ FM(IP0SR8_31_28) IP0SR8_31_28#define PINMUX_MOD_SELS \ \ -MOD_SEL4_19 MOD_SEL5_19 \ -MOD_SEL4_18 MOD_SEL6_18 \ - \ - MOD_SEL5_16 MOD_SEL6_16 MOD_SEL7_16 \ -MOD_SEL4_15 MOD_SEL5_15 MOD_SEL7_15 \ -MOD_SEL4_14 \ - MOD_SEL6_13 MOD_SEL7_13 \ -MOD_SEL4_12 MOD_SEL5_12 MOD_SEL6_12 \ - MOD_SEL5_11 MOD_SEL7_11 MOD_SEL8_11 \ - MOD_SEL6_10 MOD_SEL7_10 MOD_SEL8_10 \ -MOD_SEL4_9 MOD_SEL8_9 \ -MOD_SEL4_8 MOD_SEL5_8 MOD_SEL8_8 \ - MOD_SEL6_7 MOD_SEL7_7 MOD_SEL8_7 \ - MOD_SEL5_6 MOD_SEL6_6 MOD_SEL7_6 MOD_SEL8_6 \ -MOD_SEL4_5 MOD_SEL5_5 MOD_SEL6_5 MOD_SEL8_5 \ - MOD_SEL8_4 \ - MOD_SEL7_3 MOD_SEL8_3 \ -MOD_SEL4_2 MOD_SEL5_2 MOD_SEL6_2 MOD_SEL7_2 MOD_SEL8_2 \ -MOD_SEL4_1 MOD_SEL6_1 MOD_SEL8_1 \ - MOD_SEL5_0 MOD_SEL7_0 MOD_SEL8_0 +MOD_SEL6_18 \ +MOD_SEL6_16 MOD_SEL7_16 \ + MOD_SEL7_15 \ +MOD_SEL6_13 MOD_SEL7_13 \ +MOD_SEL6_12 \ + MOD_SEL7_11 MOD_SEL8_11 \ +MOD_SEL6_10 MOD_SEL7_10 MOD_SEL8_10 \ + MOD_SEL8_9 \ + MOD_SEL8_8 \ +MOD_SEL6_7 MOD_SEL7_7 MOD_SEL8_7 \ +MOD_SEL6_6 MOD_SEL7_6 MOD_SEL8_6 \ +MOD_SEL6_5 MOD_SEL8_5 \ + MOD_SEL8_4 \ + MOD_SEL7_3 MOD_SEL8_3 \ +MOD_SEL6_2 MOD_SEL7_2 MOD_SEL8_2 \ +MOD_SEL6_1 MOD_SEL8_1 \ + MOD_SEL7_0 MOD_SEL8_0enum {PINMUX_RESERVED =0 ,
@@ -686,59 +739,6 @@ enum {static const u16 pinmux_data[] = {PINMUX_DATA_GP_ALL (), -PINMUX_SINGLE (AVS1 ), -PINMUX_SINGLE (AVS0 ), -PINMUX_SINGLE (PCIE1_CLKREQ_N ), -PINMUX_SINGLE (PCIE0_CLKREQ_N ), - -/* TSN0 without MODSEL4 */ -PINMUX_SINGLE (TSN0_TXCREFCLK ), -PINMUX_SINGLE (TSN0_RD2 ), -PINMUX_SINGLE (TSN0_RD3 ), -PINMUX_SINGLE (TSN0_RD1 ), -PINMUX_SINGLE (TSN0_RXC ), -PINMUX_SINGLE (TSN0_RD0 ), -PINMUX_SINGLE (TSN0_RX_CTL ), -PINMUX_SINGLE (TSN0_AVTP_CAPTURE ), -PINMUX_SINGLE (TSN0_LINK ), -PINMUX_SINGLE (TSN0_PHY_INT ), -PINMUX_SINGLE (TSN0_MDIO ), -/* TSN0 with MODSEL4 */ -PINMUX_IPSR_NOGM (0 ,TSN0_TD2 ,SEL_TSN0_TD2_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_TD3 ,SEL_TSN0_TD3_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_TD0 ,SEL_TSN0_TD0_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_TD1 ,SEL_TSN0_TD1_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_TXC ,SEL_TSN0_TXC_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_TX_CTL ,SEL_TSN0_TX_CTL_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_AVTP_PPS0 ,SEL_TSN0_AVTP_PPS0_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_AVTP_MATCH ,SEL_TSN0_AVTP_MATCH_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_AVTP_PPS1 ,SEL_TSN0_AVTP_PPS1_1 ), -PINMUX_IPSR_NOGM (0 ,TSN0_MDC ,SEL_TSN0_MDC_1 ), - -/* TSN0 without MODSEL5 */ -PINMUX_SINGLE (AVB2_RX_CTL ), -PINMUX_SINGLE (AVB2_RXC ), -PINMUX_SINGLE (AVB2_RD0 ), -PINMUX_SINGLE (AVB2_RD1 ), -PINMUX_SINGLE (AVB2_RD2 ), -PINMUX_SINGLE (AVB2_MDIO ), -PINMUX_SINGLE (AVB2_RD3 ), -PINMUX_SINGLE (AVB2_TXCREFCLK ), -PINMUX_SINGLE (AVB2_PHY_INT ), -PINMUX_SINGLE (AVB2_LINK ), -PINMUX_SINGLE (AVB2_AVTP_CAPTURE ), -/* TSN0 with MODSEL5 */ -PINMUX_IPSR_NOGM (0 ,AVB2_TX_CTL ,SEL_AVB2_TX_CTL_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_TXC ,SEL_AVB2_TXC_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_TD0 ,SEL_AVB2_TD0_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_TD1 ,SEL_AVB2_TD1_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_TD2 ,SEL_AVB2_TD2_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_TD3 ,SEL_AVB2_TD3_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_MDC ,SEL_AVB2_MDC_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_MAGIC ,SEL_AVB2_MAGIC_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_AVTP_MATCH ,SEL_AVB2_AVTP_MATCH_1 ), -PINMUX_IPSR_NOGM (0 ,AVB2_AVTP_PPS ,SEL_AVB2_AVTP_PPS_1 ), -/* IP0SR0 */ PINMUX_IPSR_GPSR (IP0SR0_3_0 ,ERROROUTC_B ),PINMUX_IPSR_GPSR (IP0SR0_3_0 ,TCLK2_A ),
@@ -1029,6 +1029,66 @@ static const u16 pinmux_data[] = {PINMUX_IPSR_GPSR (IP3SR3_19_16 ,RPC_WP_N ),PINMUX_IPSR_GPSR (IP3SR3_23_20 ,RPC_INT_N ), +/* IP0SR4 */ +PINMUX_IPSR_GPSR (IP0SR4_3_0 ,TSN0_MDIO ), +PINMUX_IPSR_GPSR (IP0SR4_7_4 ,TSN0_MDC ), +PINMUX_IPSR_GPSR (IP0SR4_11_8 ,TSN0_AVTP_PPS1 ), +PINMUX_IPSR_GPSR (IP0SR4_15_12 ,TSN0_PHY_INT ), +PINMUX_IPSR_GPSR (IP0SR4_19_16 ,TSN0_LINK ), +PINMUX_IPSR_GPSR (IP0SR4_23_20 ,TSN0_AVTP_MATCH ), +PINMUX_IPSR_GPSR (IP0SR4_27_24 ,TSN0_AVTP_CAPTURE ), +PINMUX_IPSR_GPSR (IP0SR4_31_28 ,TSN0_RX_CTL ), + +/* IP1SR4 */ +PINMUX_IPSR_GPSR (IP1SR4_3_0 ,TSN0_AVTP_PPS0 ), +PINMUX_IPSR_GPSR (IP1SR4_7_4 ,TSN0_TX_CTL ), +PINMUX_IPSR_GPSR (IP1SR4_11_8 ,TSN0_RD0 ), +PINMUX_IPSR_GPSR (IP1SR4_15_12 ,TSN0_RXC ), +PINMUX_IPSR_GPSR (IP1SR4_19_16 ,TSN0_TXC ), +PINMUX_IPSR_GPSR (IP1SR4_23_20 ,TSN0_RD1 ), +PINMUX_IPSR_GPSR (IP1SR4_27_24 ,TSN0_TD1 ), +PINMUX_IPSR_GPSR (IP1SR4_31_28 ,TSN0_TD0 ), + +/* IP2SR4 */ +PINMUX_IPSR_GPSR (IP2SR4_3_0 ,TSN0_RD3 ), +PINMUX_IPSR_GPSR (IP2SR4_7_4 ,TSN0_RD2 ), +PINMUX_IPSR_GPSR (IP2SR4_11_8 ,TSN0_TD3 ), +PINMUX_IPSR_GPSR (IP2SR4_15_12 ,TSN0_TD2 ), +PINMUX_IPSR_GPSR (IP2SR4_19_16 ,TSN0_TXCREFCLK ), +PINMUX_IPSR_GPSR (IP2SR4_23_20 ,PCIE0_CLKREQ_N ), +PINMUX_IPSR_GPSR (IP2SR4_27_24 ,PCIE1_CLKREQ_N ), +PINMUX_IPSR_GPSR (IP2SR4_31_28 ,AVS0 ), + +/* IP3SR4 */ +PINMUX_IPSR_GPSR (IP3SR4_3_0 ,AVS1 ), + +/* IP0SR5 */ +PINMUX_IPSR_GPSR (IP0SR5_3_0 ,AVB2_AVTP_PPS ), +PINMUX_IPSR_GPSR (IP0SR5_7_4 ,AVB2_AVTP_CAPTURE ), +PINMUX_IPSR_GPSR (IP0SR5_11_8 ,AVB2_AVTP_MATCH ), +PINMUX_IPSR_GPSR (IP0SR5_15_12 ,AVB2_LINK ), +PINMUX_IPSR_GPSR (IP0SR5_19_16 ,AVB2_PHY_INT ), +PINMUX_IPSR_GPSR (IP0SR5_23_20 ,AVB2_MAGIC ), +PINMUX_IPSR_GPSR (IP0SR5_27_24 ,AVB2_MDC ), +PINMUX_IPSR_GPSR (IP0SR5_31_28 ,AVB2_TXCREFCLK ), + +/* IP1SR5 */ +PINMUX_IPSR_GPSR (IP1SR5_3_0 ,AVB2_TD3 ), +PINMUX_IPSR_GPSR (IP1SR5_7_4 ,AVB2_RD3 ), +PINMUX_IPSR_GPSR (IP1SR5_11_8 ,AVB2_MDIO ), +PINMUX_IPSR_GPSR (IP1SR5_15_12 ,AVB2_TD2 ), +PINMUX_IPSR_GPSR (IP1SR5_19_16 ,AVB2_TD1 ), +PINMUX_IPSR_GPSR (IP1SR5_23_20 ,AVB2_RD2 ), +PINMUX_IPSR_GPSR (IP1SR5_27_24 ,AVB2_RD1 ), +PINMUX_IPSR_GPSR (IP1SR5_31_28 ,AVB2_TD0 ), + +/* IP2SR5 */ +PINMUX_IPSR_GPSR (IP2SR5_3_0 ,AVB2_TXC ), +PINMUX_IPSR_GPSR (IP2SR5_7_4 ,AVB2_RD0 ), +PINMUX_IPSR_GPSR (IP2SR5_11_8 ,AVB2_RXC ), +PINMUX_IPSR_GPSR (IP2SR5_15_12 ,AVB2_TX_CTL ), +PINMUX_IPSR_GPSR (IP2SR5_19_16 ,AVB2_RX_CTL ), +/* IP0SR6 */ PINMUX_IPSR_GPSR(IP0SR6_3_0, AVB1_MDIO),
@@ -3419,6 +3479,82 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = { IP3SR3_7_4 IP3SR3_3_0)) }, + { PINMUX_CFG_REG_VAR("IP0SR4", 0xE6060060, 32, + GROUP(4, 4, 4, 4, 4, 4, 4, 4), + GROUP( + IP0SR4_31_28 + IP0SR4_27_24 + IP0SR4_23_20 + IP0SR4_19_16 + IP0SR4_15_12 + IP0SR4_11_8 + IP0SR4_7_4 + IP0SR4_3_0)) + }, + { PINMUX_CFG_REG_VAR("IP1SR4", 0xE6060064, 32, + GROUP(4, 4, 4, 4, 4, 4, 4, 4), + GROUP( + IP1SR4_31_28 + IP1SR4_27_24 + IP1SR4_23_20 + IP1SR4_19_16 + IP1SR4_15_12 + IP1SR4_11_8 + IP1SR4_7_4 + IP1SR4_3_0)) + }, + { PINMUX_CFG_REG_VAR("IP2SR4", 0xE6060068, 32, + GROUP(4, 4, 4, 4, 4, 4, 4, 4), + GROUP( + IP2SR4_31_28 + IP2SR4_27_24 + IP2SR4_23_20 + IP2SR4_19_16 + IP2SR4_15_12 + IP2SR4_11_8 + IP2SR4_7_4 + IP2SR4_3_0)) + }, + { PINMUX_CFG_REG_VAR("IP3SR4", 0xE606006C, 32, + GROUP(-28, 4), + GROUP( + /* IP3SR4_31_4 RESERVED */ + IP3SR4_3_0)) + }, + { PINMUX_CFG_REG_VAR("IP0SR5", 0xE6060860, 32, + GROUP(4, 4, 4, 4, 4, 4, 4, 4), + GROUP( + IP0SR5_31_28 + IP0SR5_27_24 + IP0SR5_23_20 + IP0SR5_19_16 + IP0SR5_15_12 + IP0SR5_11_8 + IP0SR5_7_4 + IP0SR5_3_0)) + }, + { PINMUX_CFG_REG_VAR("IP1SR5", 0xE6060864, 32, + GROUP(4, 4, 4, 4, 4, 4, 4, 4), + GROUP( + IP1SR5_31_28 + IP1SR5_27_24 + IP1SR5_23_20 + IP1SR5_19_16 + IP1SR5_15_12 + IP1SR5_11_8 + IP1SR5_7_4 + IP1SR5_3_0)) + }, + { PINMUX_CFG_REG_VAR("IP2SR5", 0xE6060868, 32, + GROUP(-12, 4, 4, 4, 4, 4), + GROUP( + /* IP2SR5_31_20 RESERVED */ + IP2SR5_19_16 + IP2SR5_15_12 + IP2SR5_11_8 + IP2SR5_7_4 + IP2SR5_3_0)) + }, { PINMUX_CFG_REG("IP0SR6", 0xE6061060, 32, 4, GROUP( IP0SR6_31_28 IP0SR6_27_24
@@ -3505,51 +3641,6 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {#define F_ (x, y) x,#define FM (x) FN_##x, - {PINMUX_CFG_REG_VAR ("MOD_SEL4" ,0xE6060100 ,32 , -GROUP (-12 ,1 ,1 ,-2 ,1 ,1 ,-1 ,1 ,-2 ,1 ,1 ,-2 ,1 , --2 ,1 ,1 ,-1 ), -GROUP ( -/* RESERVED 31-20 */ - MOD_SEL4_19 - MOD_SEL4_18 -/* RESERVED 17-16 */ - MOD_SEL4_15 - MOD_SEL4_14 -/* RESERVED 13 */ - MOD_SEL4_12 - /* RESERVED 11-10 */ - MOD_SEL4_9 - MOD_SEL4_8 - /* RESERVED 7-6 */ - MOD_SEL4_5 - /* RESERVED 4-3 */ - MOD_SEL4_2 -MOD_SEL4_1 -/* RESERVED 0 */ - )) - }, - { PINMUX_CFG_REG_VAR("MOD_SEL5", 0xE6060900, 32, -GROUP (-12 ,1 ,-2 ,1 ,1 ,-2 ,1 ,1 ,-2 ,1 ,-1 , -1 ,1 ,-2 ,1 ,-1 ,1 ), -GROUP ( -/* RESERVED 31-20 */ - MOD_SEL5_19 - /* RESERVED 18-17 */ - MOD_SEL5_16 - MOD_SEL5_15 - /* RESERVED 14-13 */ - MOD_SEL5_12 - MOD_SEL5_11 - /* RESERVED 10-9 */ - MOD_SEL5_8 - /* RESERVED 7 */ - MOD_SEL5_6 - MOD_SEL5_5 - /* RESERVED 4-3 */ - MOD_SEL5_2 -/* RESERVED 1 */ -MOD_SEL5_0 )) - }, { PINMUX_CFG_REG_VAR("MOD_SEL6", 0xE6061100, 32, GROUP(-13, 1, -1, 1, -2, 1, 1, -1, 1, -2, 1, 1, 1, -2, 1, 1, -1),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 638/694 pinctrl: renesas: r8a779g0: Fix Group 6/7 pin functions
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 203734a0419cade9c76016f66e2c7ba354c249b4 ]
According to R-Car V4H Series User’s Manual: Hardware Rev. 0.54, pin groups 6 and 7 do not use Module Select Registers to configure pin functions.
Hence:
- Remove the non-existent Module Select Registers (MODSEL[67]),
- Correct the affected PINMUX definitions.
--- drivers/pinctrl/renesas/pfc-r8a779g0.c | 171 +++++++------------------ 1 file changed, 49 insertions(+), 122 deletions(-)
drivers/pinctrl/renesas/pfc-r8a779g0.c +49 -122
@@ -649,30 +649,6 @@ FM(IP0SR8_23_20) IP0SR8_23_20 FM(IP1SR8_23_20) IP1SR8_23_20 \ FM(IP0SR8_27_24) IP0SR8_27_24 \FM (IP0SR8_31_28)IP0SR8_31_28 -/* MOD_SEL6 */ /* 0 */ /* 1 */ -#define MOD_SEL6_18 FM(SEL_AVB1_TD3_0) FM(SEL_AVB1_TD3_1) -#define MOD_SEL6_16 FM(SEL_AVB1_TD2_0) FM(SEL_AVB1_TD2_1) -#define MOD_SEL6_13 FM(SEL_AVB1_TD0_0) FM(SEL_AVB1_TD0_1) -#define MOD_SEL6_12 FM(SEL_AVB1_TD1_0) FM(SEL_AVB1_TD1_1) -#define MOD_SEL6_10 FM(SEL_AVB1_AVTP_PPS_0) FM(SEL_AVB1_AVTP_PPS_1) -#define MOD_SEL6_7 FM(SEL_AVB1_TX_CTL_0) FM(SEL_AVB1_TX_CTL_1) -#define MOD_SEL6_6 FM(SEL_AVB1_TXC_0) FM(SEL_AVB1_TXC_1) -#define MOD_SEL6_5 FM(SEL_AVB1_AVTP_MATCH_0) FM(SEL_AVB1_AVTP_MATCH_1) -#define MOD_SEL6_2 FM(SEL_AVB1_MDC_0) FM(SEL_AVB1_MDC_1) -#define MOD_SEL6_1 FM(SEL_AVB1_MAGIC_0) FM(SEL_AVB1_MAGIC_1) - -/* MOD_SEL7 */ /* 0 */ /* 1 */ -#define MOD_SEL7_16 FM(SEL_AVB0_TX_CTL_0) FM(SEL_AVB0_TX_CTL_1) -#define MOD_SEL7_15 FM(SEL_AVB0_TXC_0) FM(SEL_AVB0_TXC_1) -#define MOD_SEL7_13 FM(SEL_AVB0_MDC_0) FM(SEL_AVB0_MDC_1) -#define MOD_SEL7_11 FM(SEL_AVB0_TD0_0) FM(SEL_AVB0_TD0_1) -#define MOD_SEL7_10 FM(SEL_AVB0_MAGIC_0) FM(SEL_AVB0_MAGIC_1) -#define MOD_SEL7_7 FM(SEL_AVB0_TD1_0) FM(SEL_AVB0_TD1_1) -#define MOD_SEL7_6 FM(SEL_AVB0_TD2_0) FM(SEL_AVB0_TD2_1) -#define MOD_SEL7_3 FM(SEL_AVB0_TD3_0) FM(SEL_AVB0_TD3_1) -#define MOD_SEL7_2 FM(SEL_AVB0_AVTP_MATCH_0) FM(SEL_AVB0_AVTP_MATCH_1) -#define MOD_SEL7_0 FM(SEL_AVB0_AVTP_PPS_0) FM(SEL_AVB0_AVTP_PPS_1) - /* MOD_SEL8 */ /* 0 */ /* 1 */#define MOD_SEL8_11 FM(SEL_SDA5_0) FM(SEL_SDA5_1)#define MOD_SEL8_10 FM(SEL_SCL5_0) FM(SEL_SCL5_1)
@@ -689,23 +665,18 @@ FM(IP0SR8_31_28) IP0SR8_31_28#define PINMUX_MOD_SELS \ \ -MOD_SEL6_18 \ -MOD_SEL6_16 MOD_SEL7_16 \ - MOD_SEL7_15 \ -MOD_SEL6_13 MOD_SEL7_13 \ -MOD_SEL6_12 \ - MOD_SEL7_11 MOD_SEL8_11 \ -MOD_SEL6_10 MOD_SEL7_10 MOD_SEL8_10 \ - MOD_SEL8_9 \ - MOD_SEL8_8 \ -MOD_SEL6_7 MOD_SEL7_7 MOD_SEL8_7 \ -MOD_SEL6_6 MOD_SEL7_6 MOD_SEL8_6 \ -MOD_SEL6_5 MOD_SEL8_5 \ - MOD_SEL8_4 \ - MOD_SEL7_3 MOD_SEL8_3 \ -MOD_SEL6_2 MOD_SEL7_2 MOD_SEL8_2 \ -MOD_SEL6_1 MOD_SEL8_1 \ - MOD_SEL7_0 MOD_SEL8_0 +MOD_SEL8_11 \ +MOD_SEL8_10 \ +MOD_SEL8_9 \ +MOD_SEL8_8 \ +MOD_SEL8_7 \ +MOD_SEL8_6 \ +MOD_SEL8_5 \ +MOD_SEL8_4 \ +MOD_SEL8_3 \ +MOD_SEL8_2 \ +MOD_SEL8_1 \ +MOD_SEL8_0enum {PINMUX_RESERVED =0 ,
@@ -1092,23 +1063,23 @@ static const u16 pinmux_data[] = {/* IP0SR6 */ PINMUX_IPSR_GPSR (IP0SR6_3_0 ,AVB1_MDIO ), -PINMUX_IPSR_MSEL (IP0SR6_7_4 ,AVB1_MAGIC ,SEL_AVB1_MAGIC_1 ), +PINMUX_IPSR_GPSR (IP0SR6_7_4 ,AVB1_MAGIC ), -PINMUX_IPSR_MSEL (IP0SR6_11_8 ,AVB1_MDC ,SEL_AVB1_MDC_1 ), +PINMUX_IPSR_GPSR (IP0SR6_11_8 ,AVB1_MDC ),PINMUX_IPSR_GPSR (IP0SR6_15_12 ,AVB1_PHY_INT ),PINMUX_IPSR_GPSR (IP0SR6_19_16 ,AVB1_LINK ),PINMUX_IPSR_GPSR (IP0SR6_19_16 ,AVB1_MII_TX_ER ), -PINMUX_IPSR_MSEL (IP0SR6_23_20 ,AVB1_AVTP_MATCH ,SEL_AVB1_AVTP_MATCH_1 ), -PINMUX_IPSR_MSEL (IP0SR6_23_20 ,AVB1_MII_RX_ER ,SEL_AVB1_AVTP_MATCH_0 ), +PINMUX_IPSR_GPSR (IP0SR6_23_20 ,AVB1_AVTP_MATCH ), +PINMUX_IPSR_GPSR (IP0SR6_23_20 ,AVB1_MII_RX_ER ), -PINMUX_IPSR_MSEL (IP0SR6_27_24 ,AVB1_TXC ,SEL_AVB1_TXC_1 ), -PINMUX_IPSR_MSEL (IP0SR6_27_24 ,AVB1_MII_TXC ,SEL_AVB1_TXC_0 ), +PINMUX_IPSR_GPSR (IP0SR6_27_24 ,AVB1_TXC ), +PINMUX_IPSR_GPSR (IP0SR6_27_24 ,AVB1_MII_TXC ), -PINMUX_IPSR_MSEL (IP0SR6_31_28 ,AVB1_TX_CTL ,SEL_AVB1_TX_CTL_1 ), -PINMUX_IPSR_MSEL (IP0SR6_31_28 ,AVB1_MII_TX_EN ,SEL_AVB1_TX_CTL_0 ), +PINMUX_IPSR_GPSR (IP0SR6_31_28 ,AVB1_TX_CTL ), +PINMUX_IPSR_GPSR (IP0SR6_31_28 ,AVB1_MII_TX_EN ),/* IP1SR6 */ PINMUX_IPSR_GPSR(IP1SR6_3_0, AVB1_RXC),
@@ -1117,17 +1088,17 @@ static const u16 pinmux_data[] = {PINMUX_IPSR_GPSR (IP1SR6_7_4 ,AVB1_RX_CTL ),PINMUX_IPSR_GPSR (IP1SR6_7_4 ,AVB1_MII_RX_DV ), -PINMUX_IPSR_MSEL (IP1SR6_11_8 ,AVB1_AVTP_PPS ,SEL_AVB1_AVTP_PPS_1 ), -PINMUX_IPSR_MSEL (IP1SR6_11_8 ,AVB1_MII_COL ,SEL_AVB1_AVTP_PPS_0 ), +PINMUX_IPSR_GPSR (IP1SR6_11_8 ,AVB1_AVTP_PPS ), +PINMUX_IPSR_GPSR (IP1SR6_11_8 ,AVB1_MII_COL ),PINMUX_IPSR_GPSR (IP1SR6_15_12 ,AVB1_AVTP_CAPTURE ),PINMUX_IPSR_GPSR (IP1SR6_15_12 ,AVB1_MII_CRS ), -PINMUX_IPSR_MSEL (IP1SR6_19_16 ,AVB1_TD1 ,SEL_AVB1_TD1_1 ), -PINMUX_IPSR_MSEL (IP1SR6_19_16 ,AVB1_MII_TD1 ,SEL_AVB1_TD1_0 ), +PINMUX_IPSR_GPSR (IP1SR6_19_16 ,AVB1_TD1 ), +PINMUX_IPSR_GPSR (IP1SR6_19_16 ,AVB1_MII_TD1 ), -PINMUX_IPSR_MSEL (IP1SR6_23_20 ,AVB1_TD0 ,SEL_AVB1_TD0_1 ), -PINMUX_IPSR_MSEL (IP1SR6_23_20 ,AVB1_MII_TD0 ,SEL_AVB1_TD0_0 ), +PINMUX_IPSR_GPSR (IP1SR6_23_20 ,AVB1_TD0 ), +PINMUX_IPSR_GPSR (IP1SR6_23_20 ,AVB1_MII_TD0 ),PINMUX_IPSR_GPSR (IP1SR6_27_24 ,AVB1_RD1 ), PINMUX_IPSR_GPSR(IP1SR6_27_24, AVB1_MII_RD1),
@@ -1136,14 +1107,14 @@ static const u16 pinmux_data[] = {PINMUX_IPSR_GPSR (IP1SR6_31_28 ,AVB1_MII_RD0 ),/* IP2SR6 */ -PINMUX_IPSR_MSEL (IP2SR6_3_0 ,AVB1_TD2 ,SEL_AVB1_TD2_1 ), -PINMUX_IPSR_MSEL (IP2SR6_3_0 ,AVB1_MII_TD2 ,SEL_AVB1_TD2_0 ), +PINMUX_IPSR_GPSR (IP2SR6_3_0 ,AVB1_TD2 ), +PINMUX_IPSR_GPSR (IP2SR6_3_0 ,AVB1_MII_TD2 ),PINMUX_IPSR_GPSR (IP2SR6_7_4 ,AVB1_RD2 ),PINMUX_IPSR_GPSR (IP2SR6_7_4 ,AVB1_MII_RD2 ), -PINMUX_IPSR_MSEL (IP2SR6_11_8 ,AVB1_TD3 ,SEL_AVB1_TD3_1 ), -PINMUX_IPSR_MSEL (IP2SR6_11_8 ,AVB1_MII_TD3 ,SEL_AVB1_TD3_0 ), +PINMUX_IPSR_GPSR (IP2SR6_11_8 ,AVB1_TD3 ), +PINMUX_IPSR_GPSR (IP2SR6_11_8 ,AVB1_MII_TD3 ),PINMUX_IPSR_GPSR (IP2SR6_15_12 ,AVB1_RD3 ), PINMUX_IPSR_GPSR(IP2SR6_15_12, AVB1_MII_RD3),
@@ -1151,29 +1122,29 @@ static const u16 pinmux_data[] = {PINMUX_IPSR_GPSR (IP2SR6_19_16 ,AVB1_TXCREFCLK ),/* IP0SR7 */ -PINMUX_IPSR_MSEL (IP0SR7_3_0 ,AVB0_AVTP_PPS ,SEL_AVB0_AVTP_PPS_1 ), -PINMUX_IPSR_MSEL (IP0SR7_3_0 ,AVB0_MII_COL ,SEL_AVB0_AVTP_PPS_0 ), +PINMUX_IPSR_GPSR (IP0SR7_3_0 ,AVB0_AVTP_PPS ), +PINMUX_IPSR_GPSR (IP0SR7_3_0 ,AVB0_MII_COL ),PINMUX_IPSR_GPSR (IP0SR7_7_4 ,AVB0_AVTP_CAPTURE ),PINMUX_IPSR_GPSR (IP0SR7_7_4 ,AVB0_MII_CRS ), -PINMUX_IPSR_MSEL (IP0SR7_11_8 ,AVB0_AVTP_MATCH ,SEL_AVB0_AVTP_MATCH_1 ), -PINMUX_IPSR_MSEL (IP0SR7_11_8 ,AVB0_MII_RX_ER ,SEL_AVB0_AVTP_MATCH_0 ), -PINMUX_IPSR_MSEL (IP0SR7_11_8 ,CC5_OSCOUT ,SEL_AVB0_AVTP_MATCH_0 ), +PINMUX_IPSR_GPSR (IP0SR7_11_8 ,AVB0_AVTP_MATCH ), +PINMUX_IPSR_GPSR (IP0SR7_11_8 ,AVB0_MII_RX_ER ), +PINMUX_IPSR_GPSR (IP0SR7_11_8 ,CC5_OSCOUT ), -PINMUX_IPSR_MSEL (IP0SR7_15_12 ,AVB0_TD3 ,SEL_AVB0_TD3_1 ), -PINMUX_IPSR_MSEL (IP0SR7_15_12 ,AVB0_MII_TD3 ,SEL_AVB0_TD3_0 ), +PINMUX_IPSR_GPSR (IP0SR7_15_12 ,AVB0_TD3 ), +PINMUX_IPSR_GPSR (IP0SR7_15_12 ,AVB0_MII_TD3 ),PINMUX_IPSR_GPSR (IP0SR7_19_16 ,AVB0_LINK ),PINMUX_IPSR_GPSR (IP0SR7_19_16 ,AVB0_MII_TX_ER ),PINMUX_IPSR_GPSR (IP0SR7_23_20 ,AVB0_PHY_INT ), -PINMUX_IPSR_MSEL (IP0SR7_27_24 ,AVB0_TD2 ,SEL_AVB0_TD2_1 ), -PINMUX_IPSR_MSEL (IP0SR7_27_24 ,AVB0_MII_TD2 ,SEL_AVB0_TD2_0 ), +PINMUX_IPSR_GPSR (IP0SR7_27_24 ,AVB0_TD2 ), +PINMUX_IPSR_GPSR (IP0SR7_27_24 ,AVB0_MII_TD2 ), -PINMUX_IPSR_MSEL (IP0SR7_31_28 ,AVB0_TD1 ,SEL_AVB0_TD1_1 ), -PINMUX_IPSR_MSEL (IP0SR7_31_28 ,AVB0_MII_TD1 ,SEL_AVB0_TD1_0 ), +PINMUX_IPSR_GPSR (IP0SR7_31_28 ,AVB0_TD1 ), +PINMUX_IPSR_GPSR (IP0SR7_31_28 ,AVB0_MII_TD1 ),/* IP1SR7 */ PINMUX_IPSR_GPSR(IP1SR7_3_0, AVB0_RD3),
@@ -1181,24 +1152,24 @@ static const u16 pinmux_data[] = {PINMUX_IPSR_GPSR (IP1SR7_7_4 ,AVB0_TXCREFCLK ), -PINMUX_IPSR_MSEL (IP1SR7_11_8 ,AVB0_MAGIC ,SEL_AVB0_MAGIC_1 ), +PINMUX_IPSR_GPSR (IP1SR7_11_8 ,AVB0_MAGIC ), -PINMUX_IPSR_MSEL (IP1SR7_15_12 ,AVB0_TD0 ,SEL_AVB0_TD0_1 ), -PINMUX_IPSR_MSEL (IP1SR7_15_12 ,AVB0_MII_TD0 ,SEL_AVB0_TD0_0 ), +PINMUX_IPSR_GPSR (IP1SR7_15_12 ,AVB0_TD0 ), +PINMUX_IPSR_GPSR (IP1SR7_15_12 ,AVB0_MII_TD0 ),PINMUX_IPSR_GPSR (IP1SR7_19_16 ,AVB0_RD2 ),PINMUX_IPSR_GPSR (IP1SR7_19_16 ,AVB0_MII_RD2 ), -PINMUX_IPSR_MSEL (IP1SR7_23_20 ,AVB0_MDC ,SEL_AVB0_MDC_1 ), +PINMUX_IPSR_GPSR (IP1SR7_23_20 ,AVB0_MDC ),PINMUX_IPSR_GPSR (IP1SR7_27_24 ,AVB0_MDIO ), -PINMUX_IPSR_MSEL (IP1SR7_31_28 ,AVB0_TXC ,SEL_AVB0_TXC_1 ), -PINMUX_IPSR_MSEL (IP1SR7_31_28 ,AVB0_MII_TXC ,SEL_AVB0_TXC_0 ), +PINMUX_IPSR_GPSR (IP1SR7_31_28 ,AVB0_TXC ), +PINMUX_IPSR_GPSR (IP1SR7_31_28 ,AVB0_MII_TXC ),/* IP2SR7 */ -PINMUX_IPSR_MSEL (IP2SR7_3_0 ,AVB0_TX_CTL ,SEL_AVB0_TX_CTL_1 ), -PINMUX_IPSR_MSEL (IP2SR7_3_0 ,AVB0_MII_TX_EN ,SEL_AVB0_TX_CTL_0 ), +PINMUX_IPSR_GPSR (IP2SR7_3_0 ,AVB0_TX_CTL ), +PINMUX_IPSR_GPSR (IP2SR7_3_0 ,AVB0_MII_TX_EN ),PINMUX_IPSR_GPSR (IP2SR7_7_4 ,AVB0_RD1 ), PINMUX_IPSR_GPSR(IP2SR7_7_4, AVB0_MII_RD1),
@@ -3641,50 +3612,6 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {#define F_ (x, y) x,#define FM (x) FN_##x, - {PINMUX_CFG_REG_VAR ("MOD_SEL6" ,0xE6061100 ,32 , -GROUP (-13 ,1 ,-1 ,1 ,-2 ,1 ,1 , --1 ,1 ,-2 ,1 ,1 ,1 ,-2 ,1 ,1 ,-1 ), -GROUP ( -/* RESERVED 31-19 */ - MOD_SEL6_18 - /* RESERVED 17 */ - MOD_SEL6_16 -/* RESERVED 15-14 */ - MOD_SEL6_13 - MOD_SEL6_12 -/* RESERVED 11 */ - MOD_SEL6_10 - /* RESERVED 9-8 */ - MOD_SEL6_7 - MOD_SEL6_6 - MOD_SEL6_5 - /* RESERVED 4-3 */ - MOD_SEL6_2 -MOD_SEL6_1 -/* RESERVED 0 */ - )) - }, - { PINMUX_CFG_REG_VAR("MOD_SEL7", 0xE6061900, 32, -GROUP (-15 ,1 ,1 ,-1 ,1 ,-1 ,1 ,1 ,-2 ,1 ,1 , --2 ,1 ,1 ,-1 ,1 ), -GROUP ( -/* RESERVED 31-17 */ - MOD_SEL7_16 - MOD_SEL7_15 -/* RESERVED 14 */ - MOD_SEL7_13 - /* RESERVED 12 */ - MOD_SEL7_11 - MOD_SEL7_10 - /* RESERVED 9-8 */ - MOD_SEL7_7 - MOD_SEL7_6 - /* RESERVED 5-4 */ - MOD_SEL7_3 - MOD_SEL7_2 -/* RESERVED 1 */ -MOD_SEL7_0 )) - }, { PINMUX_CFG_REG_VAR("MOD_SEL8", 0xE6068100, 32, GROUP(-20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), GROUP(
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 639/694 pinctrl: renesas: r8a779g0: Fix ERROROUTC function names
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 9da805344d2a2d27a32cc9271230055d8818e887 ]
According to R-Car V4H Series User’s Manual: Hardware Rev. 0.54, the ERROROUTC signal is active-low. Hence add the missing "_N" suffix to the pin function's names.
Resize column 2 of all IPxSR* definitions to accomodate the longer names.
--- drivers/pinctrl/renesas/pfc-r8a779g0.c | 502 ++++++++++++------------- 1 file changed, 251 insertions(+), 251 deletions(-)
drivers/pinctrl/renesas/pfc-r8a779g0.c +251 -251
@@ -268,271 +268,271 @@#define GPSR8_0 F_(SCL0, IP0SR8_3_0)/* SR0 */ -/* IP0SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR0_3_0 F_(0, 0) FM(ERROROUTC_B) FM(TCLK2_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR0_7_4 F_(0, 0) FM(MSIOF3_SS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR0_11_8 F_(0, 0) FM(MSIOF3_SS2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR0_15_12 FM(IRQ3) FM(MSIOF3_SCK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR0_19_16 FM(IRQ2) FM(MSIOF3_TXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR0_23_20 FM(IRQ1) FM(MSIOF3_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR0_27_24 FM(IRQ0) FM(MSIOF3_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR0_31_28 FM(MSIOF5_SS2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR0_3_0 FM(MSIOF5_SS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR0_7_4 FM(MSIOF5_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR0_11_8 FM(MSIOF5_TXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR0_15_12 FM(MSIOF5_SCK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR0_19_16 FM(MSIOF5_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR0_23_20 FM(MSIOF2_SS2) FM(TCLK1) FM(IRQ2_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR0_27_24 FM(MSIOF2_SS1) FM(HTX1) FM(TX1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR0_31_28 FM(MSIOF2_SYNC) FM(HRX1) FM(RX1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP2SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP2SR0_3_0 FM(MSIOF2_TXD) FM(HCTS1_N) FM(CTS1_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR0_7_4 FM(MSIOF2_SCK) FM(HRTS1_N) FM(RTS1_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR0_11_8 FM(MSIOF2_RXD) FM(HSCK1) FM(SCK1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR0_3_0 F_(0, 0) FM(ERROROUTC_N_B) FM(TCLK2_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR0_7_4 F_(0, 0) FM(MSIOF3_SS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR0_11_8 F_(0, 0) FM(MSIOF3_SS2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR0_15_12 FM(IRQ3) FM(MSIOF3_SCK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR0_19_16 FM(IRQ2) FM(MSIOF3_TXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR0_23_20 FM(IRQ1) FM(MSIOF3_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR0_27_24 FM(IRQ0) FM(MSIOF3_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR0_31_28 FM(MSIOF5_SS2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR0_3_0 FM(MSIOF5_SS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR0_7_4 FM(MSIOF5_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR0_11_8 FM(MSIOF5_TXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR0_15_12 FM(MSIOF5_SCK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR0_19_16 FM(MSIOF5_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR0_23_20 FM(MSIOF2_SS2) FM(TCLK1) FM(IRQ2_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR0_27_24 FM(MSIOF2_SS1) FM(HTX1) FM(TX1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR0_31_28 FM(MSIOF2_SYNC) FM(HRX1) FM(RX1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR0_3_0 FM(MSIOF2_TXD) FM(HCTS1_N) FM(CTS1_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR0_7_4 FM(MSIOF2_SCK) FM(HRTS1_N) FM(RTS1_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR0_11_8 FM(MSIOF2_RXD) FM(HSCK1) FM(SCK1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)/* SR1 */ -/* IP0SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR1_3_0 FM(MSIOF1_SS2) FM(HTX3_A) FM(TX3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR1_7_4 FM(MSIOF1_SS1) FM(HCTS3_N_A) FM(RX3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR1_11_8 FM(MSIOF1_SYNC) FM(HRTS3_N_A) FM(RTS3_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR1_15_12 FM(MSIOF1_SCK) FM(HSCK3_A) FM(CTS3_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR1_19_16 FM(MSIOF1_TXD) FM(HRX3_A) FM(SCK3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR1_23_20 FM(MSIOF1_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR1_27_24 FM(MSIOF0_SS2) FM(HTX1_X) FM(TX1_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR1_31_28 FM(MSIOF0_SS1) FM(HRX1_X) FM(RX1_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR1_3_0 FM(MSIOF0_SYNC) FM(HCTS1_N_X) FM(CTS1_N_X) FM(CANFD5_TX_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR1_7_4 FM(MSIOF0_TXD) FM(HRTS1_N_X) FM(RTS1_N_X) FM(CANFD5_RX_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR1_11_8 FM(MSIOF0_SCK) FM(HSCK1_X) FM(SCK1_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR1_15_12 FM(MSIOF0_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR1_19_16 FM(HTX0) FM(TX0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR1_23_20 FM(HCTS0_N) FM(CTS0_N) FM(PWM8_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR1_27_24 FM(HRTS0_N) FM(RTS0_N) FM(PWM9_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR1_31_28 FM(HSCK0) FM(SCK0) FM(PWM0_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP2SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP2SR1_3_0 FM(HRX0) FM(RX0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR1_7_4 FM(SCIF_CLK) FM(IRQ4_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR1_11_8 FM(SSI_SCK) FM(TCLK3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR1_15_12 FM(SSI_WS) FM(TCLK4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR1_19_16 FM(SSI_SD) FM(IRQ0_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR1_23_20 FM(AUDIO_CLKOUT) FM(IRQ1_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR1_27_24 FM(AUDIO_CLKIN) FM(PWM3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR1_31_28 F_(0, 0) FM(TCLK2) FM(MSIOF4_SS1) FM(IRQ3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP3SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP3SR1_3_0 FM(HRX3) FM(SCK3_A) FM(MSIOF4_SS2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR1_7_4 FM(HSCK3) FM(CTS3_N_A) FM(MSIOF4_SCK) FM(TPU0TO0_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR1_11_8 FM(HRTS3_N) FM(RTS3_N_A) FM(MSIOF4_TXD) FM(TPU0TO1_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR1_15_12 FM(HCTS3_N) FM(RX3_A) FM(MSIOF4_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR1_19_16 FM(HTX3) FM(TX3_A) FM(MSIOF4_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR1_3_0 FM(MSIOF1_SS2) FM(HTX3_A) FM(TX3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR1_7_4 FM(MSIOF1_SS1) FM(HCTS3_N_A) FM(RX3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR1_11_8 FM(MSIOF1_SYNC) FM(HRTS3_N_A) FM(RTS3_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR1_15_12 FM(MSIOF1_SCK) FM(HSCK3_A) FM(CTS3_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR1_19_16 FM(MSIOF1_TXD) FM(HRX3_A) FM(SCK3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR1_23_20 FM(MSIOF1_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR1_27_24 FM(MSIOF0_SS2) FM(HTX1_X) FM(TX1_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR1_31_28 FM(MSIOF0_SS1) FM(HRX1_X) FM(RX1_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR1_3_0 FM(MSIOF0_SYNC) FM(HCTS1_N_X) FM(CTS1_N_X) FM(CANFD5_TX_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR1_7_4 FM(MSIOF0_TXD) FM(HRTS1_N_X) FM(RTS1_N_X) FM(CANFD5_RX_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR1_11_8 FM(MSIOF0_SCK) FM(HSCK1_X) FM(SCK1_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR1_15_12 FM(MSIOF0_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR1_19_16 FM(HTX0) FM(TX0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR1_23_20 FM(HCTS0_N) FM(CTS0_N) FM(PWM8_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR1_27_24 FM(HRTS0_N) FM(RTS0_N) FM(PWM9_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR1_31_28 FM(HSCK0) FM(SCK0) FM(PWM0_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR1_3_0 FM(HRX0) FM(RX0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR1_7_4 FM(SCIF_CLK) FM(IRQ4_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR1_11_8 FM(SSI_SCK) FM(TCLK3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR1_15_12 FM(SSI_WS) FM(TCLK4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR1_19_16 FM(SSI_SD) FM(IRQ0_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR1_23_20 FM(AUDIO_CLKOUT) FM(IRQ1_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR1_27_24 FM(AUDIO_CLKIN) FM(PWM3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR1_31_28 F_(0, 0) FM(TCLK2) FM(MSIOF4_SS1) FM(IRQ3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP3SR1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP3SR1_3_0 FM(HRX3) FM(SCK3_A) FM(MSIOF4_SS2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR1_7_4 FM(HSCK3) FM(CTS3_N_A) FM(MSIOF4_SCK) FM(TPU0TO0_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR1_11_8 FM(HRTS3_N) FM(RTS3_N_A) FM(MSIOF4_TXD) FM(TPU0TO1_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR1_15_12 FM(HCTS3_N) FM(RX3_A) FM(MSIOF4_RXD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR1_19_16 FM(HTX3) FM(TX3_A) FM(MSIOF4_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)/* SR2 */ -/* IP0SR2 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR2_3_0 FM(FXR_TXDA) FM(CANFD1_TX) FM(TPU0TO2_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR2_7_4 FM(FXR_TXENA_N) FM(CANFD1_RX) FM(TPU0TO3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR2_11_8 FM(RXDA_EXTFXR) FM(CANFD5_TX) FM(IRQ5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR2_15_12 FM(CLK_EXTFXR) FM(CANFD5_RX) FM(IRQ4_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR2_19_16 FM(RXDB_EXTFXR) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR2_23_20 FM(FXR_TXENB_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR2_27_24 FM(FXR_TXDB) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR2_31_28 FM(TPU0TO1) FM(CANFD6_TX) F_(0, 0) FM(TCLK2_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR2 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR2_3_0 FM(TPU0TO0) FM(CANFD6_RX) F_(0, 0) FM(TCLK1_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR2_7_4 FM(CAN_CLK) FM(FXR_TXENA_N_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR2_11_8 FM(CANFD0_TX) FM(FXR_TXENB_N_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR2_15_12 FM(CANFD0_RX) FM(STPWT_EXTFXR) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR2_19_16 FM(CANFD2_TX) FM(TPU0TO2) F_(0, 0) FM(TCLK3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR2_23_20 FM(CANFD2_RX) FM(TPU0TO3) FM(PWM1_B) FM(TCLK4_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR2_27_24 FM(CANFD3_TX) F_(0, 0) FM(PWM2_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR2_31_28 FM(CANFD3_RX) F_(0, 0) FM(PWM3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP2SR2 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP2SR2_3_0 FM(CANFD4_TX) F_(0, 0) FM(PWM4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR2_7_4 FM(CANFD4_RX) F_(0, 0) FM(PWM5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR2_11_8 FM(CANFD7_TX) F_(0, 0) FM(PWM6) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR2_15_12 FM(CANFD7_RX) F_(0, 0) FM(PWM7) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR2 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR2_3_0 FM(FXR_TXDA) FM(CANFD1_TX) FM(TPU0TO2_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR2_7_4 FM(FXR_TXENA_N) FM(CANFD1_RX) FM(TPU0TO3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR2_11_8 FM(RXDA_EXTFXR) FM(CANFD5_TX) FM(IRQ5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR2_15_12 FM(CLK_EXTFXR) FM(CANFD5_RX) FM(IRQ4_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR2_19_16 FM(RXDB_EXTFXR) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR2_23_20 FM(FXR_TXENB_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR2_27_24 FM(FXR_TXDB) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR2_31_28 FM(TPU0TO1) FM(CANFD6_TX) F_(0, 0) FM(TCLK2_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR2 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR2_3_0 FM(TPU0TO0) FM(CANFD6_RX) F_(0, 0) FM(TCLK1_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR2_7_4 FM(CAN_CLK) FM(FXR_TXENA_N_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR2_11_8 FM(CANFD0_TX) FM(FXR_TXENB_N_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR2_15_12 FM(CANFD0_RX) FM(STPWT_EXTFXR) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR2_19_16 FM(CANFD2_TX) FM(TPU0TO2) F_(0, 0) FM(TCLK3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR2_23_20 FM(CANFD2_RX) FM(TPU0TO3) FM(PWM1_B) FM(TCLK4_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR2_27_24 FM(CANFD3_TX) F_(0, 0) FM(PWM2_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR2_31_28 FM(CANFD3_RX) F_(0, 0) FM(PWM3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR2 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR2_3_0 FM(CANFD4_TX) F_(0, 0) FM(PWM4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR2_7_4 FM(CANFD4_RX) F_(0, 0) FM(PWM5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR2_11_8 FM(CANFD7_TX) F_(0, 0) FM(PWM6) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR2_15_12 FM(CANFD7_RX) F_(0, 0) FM(PWM7) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)/* SR3 */ -/* IP0SR3 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR3_3_0 FM(MMC_SD_D1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR3_7_4 FM(MMC_SD_D0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR3_11_8 FM(MMC_SD_D2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR3_15_12 FM(MMC_SD_CLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR3_19_16 FM(MMC_DS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR3_23_20 FM(MMC_SD_D3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR3_27_24 FM(MMC_D5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR3_31_28 FM(MMC_D4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR3 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR3_3_0 FM(MMC_D7) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR3_7_4 FM(MMC_D6) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR3_11_8 FM(MMC_SD_CMD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR3_15_12 FM(SD_CD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR3_19_16 FM(SD_WP) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR3_23_20 FM(IPC_CLKIN) FM(IPC_CLKEN_IN) FM(PWM1_A) FM(TCLK3_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR3_27_24 FM(IPC_CLKOUT) FM(IPC_CLKEN_OUT) FM(ERROROUTC_A) FM(TCLK4_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR3_31_28 FM(QSPI0_SSL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP2SR3 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP2SR3_3_0 FM(QSPI0_IO3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR3_7_4 FM(QSPI0_IO2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR3_11_8 FM(QSPI0_MISO_IO1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR3_15_12 FM(QSPI0_MOSI_IO0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR3_19_16 FM(QSPI0_SPCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR3_23_20 FM(QSPI1_MOSI_IO0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR3_27_24 FM(QSPI1_SPCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR3_31_28 FM(QSPI1_MISO_IO1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP3SR3 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP3SR3_3_0 FM(QSPI1_IO2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR3_7_4 FM(QSPI1_SSL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR3_11_8 FM(QSPI1_IO3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR3_15_12 FM(RPC_RESET_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR3_19_16 FM(RPC_WP_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP3SR3_23_20 FM(RPC_INT_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR3 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR3_3_0 FM(MMC_SD_D1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR3_7_4 FM(MMC_SD_D0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR3_11_8 FM(MMC_SD_D2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR3_15_12 FM(MMC_SD_CLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR3_19_16 FM(MMC_DS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR3_23_20 FM(MMC_SD_D3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR3_27_24 FM(MMC_D5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR3_31_28 FM(MMC_D4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR3 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR3_3_0 FM(MMC_D7) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR3_7_4 FM(MMC_D6) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR3_11_8 FM(MMC_SD_CMD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR3_15_12 FM(SD_CD) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR3_19_16 FM(SD_WP) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR3_23_20 FM(IPC_CLKIN) FM(IPC_CLKEN_IN) FM(PWM1_A) FM(TCLK3_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR3_27_24 FM(IPC_CLKOUT) FM(IPC_CLKEN_OUT) FM(ERROROUTC_N_A) FM(TCLK4_X) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR3_31_28 FM(QSPI0_SSL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR3 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR3_3_0 FM(QSPI0_IO3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR3_7_4 FM(QSPI0_IO2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR3_11_8 FM(QSPI0_MISO_IO1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR3_15_12 FM(QSPI0_MOSI_IO0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR3_19_16 FM(QSPI0_SPCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR3_23_20 FM(QSPI1_MOSI_IO0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR3_27_24 FM(QSPI1_SPCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR3_31_28 FM(QSPI1_MISO_IO1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP3SR3 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP3SR3_3_0 FM(QSPI1_IO2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR3_7_4 FM(QSPI1_SSL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR3_11_8 FM(QSPI1_IO3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR3_15_12 FM(RPC_RESET_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR3_19_16 FM(RPC_WP_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP3SR3_23_20 FM(RPC_INT_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)/* SR4 */ -/* IP0SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR4_3_0 FM(TSN0_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR4_7_4 FM(TSN0_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR4_11_8 FM(TSN0_AVTP_PPS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR4_15_12 FM(TSN0_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR4_19_16 FM(TSN0_LINK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR4_23_20 FM(TSN0_AVTP_MATCH) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR4_27_24 FM(TSN0_AVTP_CAPTURE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR4_31_28 FM(TSN0_RX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR4_3_0 FM(TSN0_AVTP_PPS0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR4_7_4 FM(TSN0_TX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR4_11_8 FM(TSN0_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR4_15_12 FM(TSN0_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR4_19_16 FM(TSN0_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR4_23_20 FM(TSN0_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR4_27_24 FM(TSN0_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR4_31_28 FM(TSN0_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP2SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP2SR4_3_0 FM(TSN0_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR4_7_4 FM(TSN0_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR4_11_8 FM(TSN0_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR4_15_12 FM(TSN0_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR4_19_16 FM(TSN0_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR4_23_20 FM(PCIE0_CLKREQ_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR4_27_24 FM(PCIE1_CLKREQ_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR4_31_28 FM(AVS0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP3SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP3SR4_3_0 FM(AVS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR4_3_0 FM(TSN0_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_7_4 FM(TSN0_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_11_8 FM(TSN0_AVTP_PPS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_15_12 FM(TSN0_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_19_16 FM(TSN0_LINK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_23_20 FM(TSN0_AVTP_MATCH) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_27_24 FM(TSN0_AVTP_CAPTURE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR4_31_28 FM(TSN0_RX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR4_3_0 FM(TSN0_AVTP_PPS0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_7_4 FM(TSN0_TX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_11_8 FM(TSN0_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_15_12 FM(TSN0_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_19_16 FM(TSN0_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_23_20 FM(TSN0_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_27_24 FM(TSN0_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR4_31_28 FM(TSN0_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR4_3_0 FM(TSN0_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_7_4 FM(TSN0_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_11_8 FM(TSN0_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_15_12 FM(TSN0_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_19_16 FM(TSN0_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_23_20 FM(PCIE0_CLKREQ_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_27_24 FM(PCIE1_CLKREQ_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR4_31_28 FM(AVS0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP3SR4 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP3SR4_3_0 FM(AVS1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)/* SR5 */ -/* IP0SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR5_3_0 FM(AVB2_AVTP_PPS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR5_7_4 FM(AVB2_AVTP_CAPTURE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR5_11_8 FM(AVB2_AVTP_MATCH) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR5_15_12 FM(AVB2_LINK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR5_19_16 FM(AVB2_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR5_23_20 FM(AVB2_MAGIC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR5_27_24 FM(AVB2_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR5_31_28 FM(AVB2_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR5_3_0 FM(AVB2_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR5_7_4 FM(AVB2_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR5_11_8 FM(AVB2_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR5_15_12 FM(AVB2_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR5_19_16 FM(AVB2_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR5_23_20 FM(AVB2_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR5_27_24 FM(AVB2_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR5_31_28 FM(AVB2_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP2SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP2SR5_3_0 FM(AVB2_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR5_7_4 FM(AVB2_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR5_11_8 FM(AVB2_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR5_15_12 FM(AVB2_TX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR5_19_16 FM(AVB2_RX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR5_3_0 FM(AVB2_AVTP_PPS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_7_4 FM(AVB2_AVTP_CAPTURE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_11_8 FM(AVB2_AVTP_MATCH) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_15_12 FM(AVB2_LINK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_19_16 FM(AVB2_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_23_20 FM(AVB2_MAGIC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_27_24 FM(AVB2_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR5_31_28 FM(AVB2_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR5_3_0 FM(AVB2_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_7_4 FM(AVB2_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_11_8 FM(AVB2_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_15_12 FM(AVB2_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_19_16 FM(AVB2_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_23_20 FM(AVB2_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_27_24 FM(AVB2_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR5_31_28 FM(AVB2_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR5 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR5_3_0 FM(AVB2_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR5_7_4 FM(AVB2_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR5_11_8 FM(AVB2_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR5_15_12 FM(AVB2_TX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR5_19_16 FM(AVB2_RX_CTL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)/* SR6 */ -/* IP0SR6 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR6_3_0 FM(AVB1_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR6_7_4 FM(AVB1_MAGIC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR6_11_8 FM(AVB1_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR6_15_12 FM(AVB1_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR6_19_16 FM(AVB1_LINK) FM(AVB1_MII_TX_ER) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR6_23_20 FM(AVB1_AVTP_MATCH) FM(AVB1_MII_RX_ER) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR6_27_24 FM(AVB1_TXC) FM(AVB1_MII_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR6_31_28 FM(AVB1_TX_CTL) FM(AVB1_MII_TX_EN) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR6 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR6_3_0 FM(AVB1_RXC) FM(AVB1_MII_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR6_7_4 FM(AVB1_RX_CTL) FM(AVB1_MII_RX_DV) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR6_11_8 FM(AVB1_AVTP_PPS) FM(AVB1_MII_COL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR6_15_12 FM(AVB1_AVTP_CAPTURE) FM(AVB1_MII_CRS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR6_19_16 FM(AVB1_TD1) FM(AVB1_MII_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR6_23_20 FM(AVB1_TD0) FM(AVB1_MII_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR6_27_24 FM(AVB1_RD1) FM(AVB1_MII_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR6_31_28 FM(AVB1_RD0) FM(AVB1_MII_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP2SR6 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP2SR6_3_0 FM(AVB1_TD2) FM(AVB1_MII_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR6_7_4 FM(AVB1_RD2) FM(AVB1_MII_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR6_11_8 FM(AVB1_TD3) FM(AVB1_MII_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR6_15_12 FM(AVB1_RD3) FM(AVB1_MII_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR6_19_16 FM(AVB1_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR6 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR6_3_0 FM(AVB1_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR6_7_4 FM(AVB1_MAGIC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR6_11_8 FM(AVB1_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR6_15_12 FM(AVB1_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR6_19_16 FM(AVB1_LINK) FM(AVB1_MII_TX_ER) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR6_23_20 FM(AVB1_AVTP_MATCH) FM(AVB1_MII_RX_ER) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR6_27_24 FM(AVB1_TXC) FM(AVB1_MII_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR6_31_28 FM(AVB1_TX_CTL) FM(AVB1_MII_TX_EN) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR6 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR6_3_0 FM(AVB1_RXC) FM(AVB1_MII_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR6_7_4 FM(AVB1_RX_CTL) FM(AVB1_MII_RX_DV) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR6_11_8 FM(AVB1_AVTP_PPS) FM(AVB1_MII_COL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR6_15_12 FM(AVB1_AVTP_CAPTURE) FM(AVB1_MII_CRS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR6_19_16 FM(AVB1_TD1) FM(AVB1_MII_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR6_23_20 FM(AVB1_TD0) FM(AVB1_MII_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR6_27_24 FM(AVB1_RD1) FM(AVB1_MII_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR6_31_28 FM(AVB1_RD0) FM(AVB1_MII_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR6 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR6_3_0 FM(AVB1_TD2) FM(AVB1_MII_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR6_7_4 FM(AVB1_RD2) FM(AVB1_MII_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR6_11_8 FM(AVB1_TD3) FM(AVB1_MII_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR6_15_12 FM(AVB1_RD3) FM(AVB1_MII_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR6_19_16 FM(AVB1_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)/* SR7 */ -/* IP0SR7 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR7_3_0 FM(AVB0_AVTP_PPS) FM(AVB0_MII_COL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR7_7_4 FM(AVB0_AVTP_CAPTURE) FM(AVB0_MII_CRS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR7_11_8 FM(AVB0_AVTP_MATCH) FM(AVB0_MII_RX_ER) FM(CC5_OSCOUT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR7_15_12 FM(AVB0_TD3) FM(AVB0_MII_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR7_19_16 FM(AVB0_LINK) FM(AVB0_MII_TX_ER) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR7_23_20 FM(AVB0_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR7_27_24 FM(AVB0_TD2) FM(AVB0_MII_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR7_31_28 FM(AVB0_TD1) FM(AVB0_MII_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR7 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR7_3_0 FM(AVB0_RD3) FM(AVB0_MII_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR7_7_4 FM(AVB0_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR7_11_8 FM(AVB0_MAGIC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR7_15_12 FM(AVB0_TD0) FM(AVB0_MII_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR7_19_16 FM(AVB0_RD2) FM(AVB0_MII_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR7_23_20 FM(AVB0_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR7_27_24 FM(AVB0_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR7_31_28 FM(AVB0_TXC) FM(AVB0_MII_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP2SR7 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP2SR7_3_0 FM(AVB0_TX_CTL) FM(AVB0_MII_TX_EN) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR7_7_4 FM(AVB0_RD1) FM(AVB0_MII_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR7_11_8 FM(AVB0_RD0) FM(AVB0_MII_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR7_15_12 FM(AVB0_RXC) FM(AVB0_MII_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP2SR7_19_16 FM(AVB0_RX_CTL) FM(AVB0_MII_RX_DV) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR7 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR7_3_0 FM(AVB0_AVTP_PPS) FM(AVB0_MII_COL) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR7_7_4 FM(AVB0_AVTP_CAPTURE) FM(AVB0_MII_CRS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR7_11_8 FM(AVB0_AVTP_MATCH) FM(AVB0_MII_RX_ER) FM(CC5_OSCOUT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR7_15_12 FM(AVB0_TD3) FM(AVB0_MII_TD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR7_19_16 FM(AVB0_LINK) FM(AVB0_MII_TX_ER) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR7_23_20 FM(AVB0_PHY_INT) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR7_27_24 FM(AVB0_TD2) FM(AVB0_MII_TD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR7_31_28 FM(AVB0_TD1) FM(AVB0_MII_TD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR7 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR7_3_0 FM(AVB0_RD3) FM(AVB0_MII_RD3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR7_7_4 FM(AVB0_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR7_11_8 FM(AVB0_MAGIC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR7_15_12 FM(AVB0_TD0) FM(AVB0_MII_TD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR7_19_16 FM(AVB0_RD2) FM(AVB0_MII_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR7_23_20 FM(AVB0_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR7_27_24 FM(AVB0_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR7_31_28 FM(AVB0_TXC) FM(AVB0_MII_TXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP2SR7 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP2SR7_3_0 FM(AVB0_TX_CTL) FM(AVB0_MII_TX_EN) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR7_7_4 FM(AVB0_RD1) FM(AVB0_MII_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR7_11_8 FM(AVB0_RD0) FM(AVB0_MII_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR7_15_12 FM(AVB0_RXC) FM(AVB0_MII_RXC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP2SR7_19_16 FM(AVB0_RX_CTL) FM(AVB0_MII_RX_DV) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)/* SR8 */ -/* IP0SR8 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP0SR8_3_0 FM(SCL0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR8_7_4 FM(SDA0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR8_11_8 FM(SCL1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR8_15_12 FM(SDA1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR8_19_16 FM(SCL2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR8_23_20 FM(SDA2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR8_27_24 FM(SCL3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP0SR8_31_28 FM(SDA3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) - -/* IP1SR8 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ -#define IP1SR8_3_0 FM(SCL4) FM(HRX2) FM(SCK4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR8_7_4 FM(SDA4) FM(HTX2) FM(CTS4_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR8_11_8 FM(SCL5) FM(HRTS2_N) FM(RTS4_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR8_15_12 FM(SDA5) FM(SCIF_CLK2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR8_19_16 F_(0, 0) FM(HCTS2_N) FM(TX4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) -#define IP1SR8_23_20 F_(0, 0) FM(HSCK2) FM(RX4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +/* IP0SR8 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP0SR8_3_0 FM(SCL0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR8_7_4 FM(SDA0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR8_11_8 FM(SCL1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR8_15_12 FM(SDA1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR8_19_16 FM(SCL2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR8_23_20 FM(SDA2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR8_27_24 FM(SCL3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP0SR8_31_28 FM(SDA3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) + +/* IP1SR8 */ /* 0 */ /* 1 */ /* 2 */ /* 3 4 5 6 7 8 9 A B C D E F */ +#define IP1SR8_3_0 FM(SCL4) FM(HRX2) FM(SCK4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR8_7_4 FM(SDA4) FM(HTX2) FM(CTS4_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR8_11_8 FM(SCL5) FM(HRTS2_N) FM(RTS4_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR8_15_12 FM(SDA5) FM(SCIF_CLK2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR8_19_16 F_(0, 0) FM(HCTS2_N) FM(TX4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) +#define IP1SR8_23_20 F_(0, 0) FM(HSCK2) FM(RX4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)#define PINMUX_GPSR \ GPSR3_29 \
@@ -711,7 +711,7 @@ static const u16 pinmux_data[] = {PINMUX_DATA_GP_ALL (),/* IP0SR0 */ -PINMUX_IPSR_GPSR (IP0SR0_3_0 ,ERROROUTC_B ), +PINMUX_IPSR_GPSR (IP0SR0_3_0 ,ERROROUTC_N_B ),PINMUX_IPSR_GPSR (IP0SR0_3_0 ,TCLK2_A ), PINMUX_IPSR_GPSR(IP0SR0_7_4, MSIOF3_SS1),
@@ -977,7 +977,7 @@ static const u16 pinmux_data[] = {PINMUX_IPSR_GPSR (IP1SR3_27_24 ,IPC_CLKOUT ),PINMUX_IPSR_GPSR (IP1SR3_27_24 ,IPC_CLKEN_OUT ), -PINMUX_IPSR_GPSR (IP1SR3_27_24 ,ERROROUTC_A ), +PINMUX_IPSR_GPSR (IP1SR3_27_24 ,ERROROUTC_N_A ),PINMUX_IPSR_GPSR (IP1SR3_27_24 ,TCLK4_X ), PINMUX_IPSR_GPSR(IP1SR3_31_28, QSPI0_SSL),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 640/694 leds: TI_LMU_COMMON: select REGMAP instead of depending on it
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit a61079efc87888587e463afaed82417b162fbd69 ]
REGMAP is a hidden (not user visible) symbol. Users cannot set it directly thru "make *config", so drivers should select it instead of depending on it if they need it.
Consistently using "select" or "depends on" can also help reduce Kconfig circular dependency issues.
Therefore, change the use of "depends on REGMAP" to "select REGMAP".
--- drivers/leds/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/Kconfig +1 -1
@@ -795,7 +795,7 @@ config LEDS_SPI_BYTE config LEDS_TI_LMU_COMMON tristate "LED driver for TI LMU" depends on LEDS_CLASS - depends on REGMAP + select REGMAP help Say Y to enable the LED driver for TI LMU devices. This supports common features between the TI LM3532, LM3631, LM3632,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 641/694 pinctrl: ralink: reintroduce ralink,rt2880-pinmux compatible string
In reply to Greg Kroah-HartmanFrom: Arınç ÜNAL <[email protected]>
[ Upstream commit 7c19147d9cfc0f9328049d2e278279150d7de9ca ]
There have been stable releases with the ralink,rt2880-pinmux compatible string included. Having it removed breaks the ABI. Reintroduce it.
--- drivers/pinctrl/ralink/pinctrl-mt7620.c | 1 + drivers/pinctrl/ralink/pinctrl-mt7621.c | 1 + drivers/pinctrl/ralink/pinctrl-rt2880.c | 1 + drivers/pinctrl/ralink/pinctrl-rt305x.c | 1 + drivers/pinctrl/ralink/pinctrl-rt3883.c | 1 + 5 files changed, 5 insertions(+)
drivers/pinctrl/ralink/pinctrl-mt7620.c +1 -0
@@ -372,6 +372,7 @@ static int mt7620_pinctrl_probe(struct platform_device *pdev)static const struct of_device_id mt7620_pinctrl_match[] = { { .compatible ="ralink,mt7620-pinctrl" }, + { .compatible ="ralink,rt2880-pinmux" }, {} };MODULE_DEVICE_TABLE (of, mt7620_pinctrl_match);
drivers/pinctrl/ralink/pinctrl-mt7621.c +1 -0
@@ -97,6 +97,7 @@ static int mt7621_pinctrl_probe(struct platform_device *pdev)static const struct of_device_id mt7621_pinctrl_match[] = { { .compatible ="ralink,mt7621-pinctrl" }, + { .compatible ="ralink,rt2880-pinmux" }, {} };MODULE_DEVICE_TABLE (of, mt7621_pinctrl_match);
drivers/pinctrl/ralink/pinctrl-rt2880.c +1 -0
@@ -41,6 +41,7 @@ static int rt2880_pinctrl_probe(struct platform_device *pdev)static const struct of_device_id rt2880_pinctrl_match[] = { { .compatible ="ralink,rt2880-pinctrl" }, + { .compatible ="ralink,rt2880-pinmux" }, {} };MODULE_DEVICE_TABLE (of, rt2880_pinctrl_match);
drivers/pinctrl/ralink/pinctrl-rt305x.c +1 -0
@@ -118,6 +118,7 @@ static int rt305x_pinctrl_probe(struct platform_device *pdev)static const struct of_device_id rt305x_pinctrl_match[] = { { .compatible ="ralink,rt305x-pinctrl" }, + { .compatible ="ralink,rt2880-pinmux" }, {} };MODULE_DEVICE_TABLE (of, rt305x_pinctrl_match);
drivers/pinctrl/ralink/pinctrl-rt3883.c +1 -0
@@ -88,6 +88,7 @@ static int rt3883_pinctrl_probe(struct platform_device *pdev)static const struct of_device_id rt3883_pinctrl_match[] = { { .compatible ="ralink,rt3883-pinctrl" }, + { .compatible ="ralink,rt2880-pinmux" }, {} };MODULE_DEVICE_TABLE (of, rt3883_pinctrl_match);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 642/694 dmaengine: mv_xor_v2: Fix an error code.
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 827026ae2e56ec05ef1155661079badbbfc0b038 ]
If the probe is deferred, -EPROBE_DEFER should be returned, not +EPROBE_DEFER.
--- drivers/dma/mv_xor_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/mv_xor_v2.c +1 -1
@@ -752,7 +752,7 @@ static int mv_xor_v2_probe(struct platform_device *pdev) xor_dev->clk =devm_clk_get (&pdev->dev,NULL );if (PTR_ERR (xor_dev->clk) == -EPROBE_DEFER ) { - ret =EPROBE_DEFER ; + ret = -EPROBE_DEFER ; goto disable_reg_clk; }if (!IS_ERR (xor_dev->clk)) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 643/694 leds: tca6507: Fix error handling of using fwnode_property_read_string
In reply to Greg Kroah-HartmanFrom: H. Nikolaus Schaller <[email protected]>
[ Upstream commit c1087c29e96a48e9080377e168d35dcb52fb068b ]
Commit 96f524105b9c ("leds: tca6507: use fwnode API instead of OF")
changed to fwnode API but did not take into account that a missing property "linux,default-trigger" now seems to return an error and as a side effect sets value to -1. This seems to be different from of_get_property() which always returned NULL in any case of error.
Neglecting this side-effect leads to
[ 11.201965] Unable to handle kernel paging request at virtual address ffffffff when read
in the strcmp() of led_trigger_set_default() if there is no led-trigger defined in the DTS.
I don't know if this was recently introduced somewhere in the fwnode lib or if the effect was missed in initial testing. Anyways it seems to be a bug to ignore the error return value of an optional value here in the driver.
--- drivers/leds/leds-tca6507.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/leds/leds-tca6507.c +3 -2
@@ -691,8 +691,9 @@ tca6507_led_dt_init(struct device *dev)if (fwnode_property_read_string (child,"label" , &led.name)) led.name =fwnode_get_name (child); -fwnode_property_read_string (child,"linux,default-trigger" , - &led.default_trigger); +if (fwnode_property_read_string (child,"linux,default-trigger" , + &led.default_trigger)) + led.default_trigger =NULL ; led.flags =0 ;if (fwnode_device_is_compatible (child,"gpio" ))
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 644/694 pwm: mtk-disp: Disable shadow registers before setting backlight values
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 36dd7f530ae7d9ce9e853ffb8aa337de65c6600b ]
If shadow registers usage is not desired, disable that before performing any write to CON0/1 registers in the .apply() callback, otherwise we may lose clkdiv or period/width updates.
--- drivers/pwm/pwm-mtk-disp.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
drivers/pwm/pwm-mtk-disp.c +13 -11
@@ -138,6 +138,19 @@ static int mtk_disp_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, high_width =mul_u64_u64_div_u64 (state->duty_cycle, rate, div); value = period | (high_width <<PWM_HIGH_WIDTH_SHIFT ); +if (mdp->data->bls_debug && !mdp->data->has_commit) { +/* +* For MT2701, disable double buffer before writing register +* and select manual mode and use PWM_PERIOD/PWM_HIGH_WIDTH. +*/ +mtk_disp_pwm_update_bits (mdp, mdp->data->bls_debug, + mdp->data->bls_debug_mask, + mdp->data->bls_debug_mask); +mtk_disp_pwm_update_bits (mdp, mdp->data->con0, + mdp->data->con0_sel, + mdp->data->con0_sel); + } +mtk_disp_pwm_update_bits (mdp, mdp->data->con0,PWM_CLKDIV_MASK , clk_div <<PWM_CLKDIV_SHIFT );
@@ -152,17 +165,6 @@ static int mtk_disp_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,mtk_disp_pwm_update_bits (mdp, mdp->data->commit, mdp->data->commit_mask,0x0 ); - }else { -/* -* For MT2701, disable double buffer before writing register -* and select manual mode and use PWM_PERIOD/PWM_HIGH_WIDTH. -*/ -mtk_disp_pwm_update_bits (mdp, mdp->data->bls_debug, - mdp->data->bls_debug_mask, - mdp->data->bls_debug_mask); -mtk_disp_pwm_update_bits (mdp, mdp->data->con0, - mdp->data->con0_sel, - mdp->data->con0_sel); } mtk_disp_pwm_update_bits(mdp, DISP_PWM_EN, mdp->data->enable_mask,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 645/694 pwm: mtk-disp: Configure double buffering before reading in .get_state()
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit b16c310115f2084b8826a35b77ef42bab6786d9f ]
The DISP_PWM controller's default behavior is to always use register double buffering: all reads/writes are then performed on shadow registers instead of working registers and this becomes an issue in case our chosen configuration in Linux is different from the default (or from the one that was pre-applied by the bootloader).
An example of broken behavior is when the controller is configured to use shadow registers, but this driver wants to configure it
otherwise: what happens is that the .get_state() callback is called right after registering the pwmchip and checks whether the PWM is enabled by reading the DISP_PWM_EN register;
At this point, if shadow registers are enabled but their content was not committed before booting Linux, we are *not* reading the current PWM enablement status, leading to the kernel knowing that the hardware is actually enabled when, in reality, it's not.
The aforementioned issue emerged since this driver was fixed with commit 0b5ef3429d8f ("pwm: mtk-disp: Fix the parameters calculated by the enabled flag of disp_pwm") making it to read the enablement status from the right register.
Configure the controller in the .get_state() callback to avoid this desync issue and get the backlight properly working again.
--- drivers/pwm/pwm-mtk-disp.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/pwm/pwm-mtk-disp.c +10 -0
@@ -196,6 +196,16 @@ static int mtk_disp_pwm_get_state(struct pwm_chip *chip,return err; } +/* +* Apply DISP_PWM_DEBUG settings to choose whether to enable or disable +* registers double buffer and manual commit to working register before +* performing any read/write operation +*/ +if (mdp->data->bls_debug) +mtk_disp_pwm_update_bits (mdp, mdp->data->bls_debug, + mdp->data->bls_debug_mask, + mdp->data->bls_debug_mask); + rate =clk_get_rate (mdp->clk_main); con0 =readl (mdp->base + mdp->data->con0); con1 =readl (mdp->base + mdp->data->con1);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 646/694 soundwire: intel: dont save hw_params for use in prepare
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 0a0d1740bd8fd7dafb81fcb102fb5d0b83b1ce73 ]
The existing code copies the hw_params pointer and reuses it later in .prepare, specifically to re-initialize the ALH DMA channel information that's lost in suspend-resume cycles.
This is not needed, we can directly access the information from the substream/rtd - as done for the HDAudio DAIs in sound/soc/sof/intel/hda-dai.c
In addition, using the saved pointer causes the suspend-resume test cases to fail on specific platforms, depending on which version of GCC is used. Péter Ujfalusi and I have spent long hours to root-cause this problem that was reported by the Intel CI first with 6.2-rc1 and again v6.3-rc1. In the latter case we were lucky that the problem was 100% reproducible on local test devices, and found out that adding a dev_dbg() or adding a call to usleep_range() just before accessing the saved pointer "fixed" the issue. With errors appearing just by changing the compiler version or minor changes in the code generated, clearly we have a memory management Heisenbug.
The root-cause seems to be that the hw_params pointer is not persistent. The soc-pcm code allocates the hw_params structure on the stack, and passes it to the BE dailink hw_params and DAIs hw_params. Saving such a pointer and reusing it later during the .prepare stage cannot possibly work reliably, it's broken-by-design since v5.10. It's astonishing that the problem was not seen earlier.
This simple fix will have to be back-ported to -stable, due to changes to avoid the use of the get/set_dmadata routines this patch will only apply on kernels older than v6.1.
--- drivers/soundwire/cadence_master.h | 2 -- drivers/soundwire/intel.c | 11 +++++++---- 2 files changed, 7 insertions(+), 6 deletions(-)
drivers/soundwire/cadence_master.h +0 -2
@@ -84,7 +84,6 @@ struct sdw_cdns_stream_config {* @bus: Bus handle * @stream_type: Stream type * @link_id: Master link id -* @hw_params: hw_params to be applied in .prepare step * @suspended: status set when suspended, to be used in .prepare * @paused: status set in .trigger, to be used in suspend * @direction: stream direction
@@ -96,7 +95,6 @@ struct sdw_cdns_dai_runtime {struct sdw_bus *bus;enum sdw_stream_type stream_type;int link_id; -struct snd_pcm_hw_params *hw_params;bool suspended;bool paused;int direction;
drivers/soundwire/intel.c +7 -4
@@ -817,7 +817,6 @@ static int intel_hw_params(struct snd_pcm_substream *substream, dai_runtime->paused = false; dai_runtime->suspended = false; dai_runtime->pdi = pdi; - dai_runtime->hw_params = params;/* Inform DSP about PDI stream number */ ret = intel_params_stream(sdw, substream->stream, dai, params,
@@ -870,6 +869,11 @@ static int intel_prepare(struct snd_pcm_substream *substream, }if (dai_runtime->suspended) { +struct snd_soc_pcm_runtime *rtd =asoc_substream_to_rtd (substream); +struct snd_pcm_hw_params *hw_params; + + hw_params = &rtd->dpcm[substream->stream].hw_params; + dai_runtime->suspended = false;/*
@@ -881,7 +885,7 @@ static int intel_prepare(struct snd_pcm_substream *substream,*/ /* configure stream */ - ch =params_channels (dai_runtime->hw_params); + ch =params_channels (hw_params);if (substream->stream ==SNDRV_PCM_STREAM_CAPTURE ) dir =SDW_DATA_DIR_RX ;else
@@ -893,7 +897,7 @@ static int intel_prepare(struct snd_pcm_substream *substream,/* Inform DSP about PDI stream number */ ret =intel_params_stream (sdw, substream->stream, dai, - dai_runtime->hw_params, + hw_params, sdw->instance, dai_runtime->pdi->intel_alh_id); }
@@ -932,7 +936,6 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)return ret; } - dai_runtime->hw_params =NULL ; dai_runtime->pdi =NULL ;return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 647/694 phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port
In reply to Greg Kroah-HartmanFrom: Gaosheng Cui <[email protected]>
[ Upstream commit e024854048e733391b31fe5a398704b31b9af803 ]
The tegra_xusb_port_unregister should be called when usb2_port and ulpi_port map fails in tegra_xusb_add_usb2_port() or in tegra_xusb_add_ulpi_port(), fix it.
--- drivers/phy/tegra/xusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/phy/tegra/xusb.c +2 -0
@@ -805,6 +805,7 @@ static int tegra_xusb_add_usb2_port(struct tegra_xusb_padctl *padctl, usb2->base.lane = usb2->base.ops->map (&usb2->base);if (IS_ERR (usb2->base.lane)) { err =PTR_ERR (usb2->base.lane); +tegra_xusb_port_unregister (&usb2->base); goto out; }
@@ -871,6 +872,7 @@ static int tegra_xusb_add_ulpi_port(struct tegra_xusb_padctl *padctl, ulpi->base.lane = ulpi->base.ops->map (&ulpi->base);if (IS_ERR (ulpi->base.lane)) { err =PTR_ERR (ulpi->base.lane); +tegra_xusb_port_unregister (&ulpi->base); goto out; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 648/694 phy: ti: j721e-wiz: Fix unreachable code in wiz_mode_select()
In reply to Greg Kroah-HartmanFrom: Siddharth Vadapalli <[email protected]>
[ Upstream commit 57c0e1362fdd57d0cea7ab1e583b58abf4bd8c2d ]
In the wiz_mode_select() function, the configuration performed for PHY_TYPE_USXGMII is unreachable. Fix it.
--- drivers/phy/ti/phy-j721e-wiz.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/phy/ti/phy-j721e-wiz.c +5 -6
@@ -443,18 +443,17 @@ static int wiz_mode_select(struct wiz *wiz)int i;for (i =0 ; i < num_lanes; i++) { -if (wiz->lane_phy_type[i] ==PHY_TYPE_DP ) +if (wiz->lane_phy_type[i] ==PHY_TYPE_DP ) { mode =LANE_MODE_GEN1 ; -else if (wiz->lane_phy_type[i] ==PHY_TYPE_QSGMII ) + }else if (wiz->lane_phy_type[i] ==PHY_TYPE_QSGMII ) { mode =LANE_MODE_GEN2 ; -else -continue ; - -if (wiz->lane_phy_type[i] ==PHY_TYPE_USXGMII ) { + }else if (wiz->lane_phy_type[i] ==PHY_TYPE_USXGMII ) { ret =regmap_field_write (wiz->p0_mac_src_sel[i],0x3 ); ret =regmap_field_write (wiz->p0_rxfclk_sel[i],0x3 ); ret =regmap_field_write (wiz->p0_refclk_sel[i],0x3 ); mode =LANE_MODE_GEN1 ; + }else { +continue ; } ret =regmap_field_write (wiz->p_standard_mode[i], mode);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 649/694 dma: gpi: remove spurious unlock in gpi_ch_init
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 91d6a468e335571f1e67e046050dea9af5fa4ebe ]
gpi_ch_init() doesn't lock the ctrl_lock mutex, so there is no need to unlock it too. Instead the mutex is handled by the function gpi_alloc_chan_resources(), which properly locks and unlocks the mutex.
=====================================
WARNING: bad unlock balance detected! 6.3.0-rc5-00253-g99792582ded1-dirty #15 Not tainted
-------------------------------------
kworker/u16:0/9 is trying to release lock (&gpii->ctrl_lock) at:
[<ffffb99d04e1284c>] gpi_alloc_chan_resources+0x108/0x5bc but there are no more locks to release!
other info that might help us debug this:
6 locks held by kworker/u16:0/9:
#0: ffff575740010938 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x220/0x594 #1: ffff80000809bdd0 (deferred_probe_work){+.+.}-{0:0}, at: process_one_work+0x220/0x594 #2: ffff575740f2a0f8 (&dev->mutex){....}-{3:3}, at: __device_attach+0x38/0x188
#3: ffff57574b5570f8 (&dev->mutex){....}-{3:3}, at: __device_attach+0x38/0x188
#4: ffffb99d06a2f180 (of_dma_lock){+.+.}-{3:3}, at: of_dma_request_slave_channel+0x138/0x280 #5: ffffb99d06a2ee20 (dma_list_mutex){+.+.}-{3:3}, at: dma_get_slave_channel+0x28/0x10c
stack backtrace: CPU: 7 PID: 9 Comm: kworker/u16:0 Not tainted 6.3.0-rc5-00253-g99792582ded1-dirty #15 Hardware name: Google Pixel 3 (DT) Workqueue: events_unbound deferred_probe_work_func Call trace: dump_backtrace+0xa0/0xfc show_stack+0x18/0x24 dump_stack_lvl+0x60/0xac dump_stack+0x18/0x24 print_unlock_imbalance_bug+0x130/0x148 lock_release+0x270/0x300 __mutex_unlock_slowpath+0x48/0x2cc mutex_unlock+0x20/0x2c gpi_alloc_chan_resources+0x108/0x5bc dma_chan_get+0x84/0x188 dma_get_slave_channel+0x5c/0x10c gpi_of_dma_xlate+0x110/0x1a0 of_dma_request_slave_channel+0x174/0x280 dma_request_chan+0x3c/0x2d4 geni_i2c_probe+0x544/0x63c platform_probe+0x68/0xc4 really_probe+0x148/0x2ac __driver_probe_device+0x78/0xe0 driver_probe_device+0x3c/0x160 __device_attach_driver+0xb8/0x138 bus_for_each_drv+0x84/0xe0 __device_attach+0x9c/0x188 device_initial_probe+0x14/0x20 bus_probe_device+0xac/0xb0 device_add+0x60c/0x7d8 of_device_add+0x44/0x60 of_platform_device_create_pdata+0x90/0x124 of_platform_bus_create+0x15c/0x3c8 of_platform_populate+0x58/0xf8 devm_of_platform_populate+0x58/0xbc geni_se_probe+0xf0/0x164 platform_probe+0x68/0xc4 really_probe+0x148/0x2ac __driver_probe_device+0x78/0xe0 driver_probe_device+0x3c/0x160 __device_attach_driver+0xb8/0x138 bus_for_each_drv+0x84/0xe0 __device_attach+0x9c/0x188 device_initial_probe+0x14/0x20 bus_probe_device+0xac/0xb0 deferred_probe_work_func+0x8c/0xc8 process_one_work+0x2bc/0x594 worker_thread+0x228/0x438 kthread+0x108/0x10c ret_from_fork+0x10/0x20
--- drivers/dma/qcom/gpi.c | 1 - 1 file changed, 1 deletion(-)
drivers/dma/qcom/gpi.c +0 -1
@@ -1966,7 +1966,6 @@ static int gpi_ch_init(struct gchan *gchan) error_config_int:gpi_free_ring (&gpii->ev_ring, gpii); exit_gpi_init: -mutex_unlock (&gpii->ctrl_lock);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 650/694 dmaengine: dw-edma: Fix to change for continuous transfer
In reply to Greg Kroah-HartmanFrom: Shunsuke Mie <[email protected]>
[ Upstream commit a251994a441ee0a69ba7062c8cd2d08ead3db379 ]
The dw-edma driver stops after processing a DMA request even if a request remains in the issued queue, which is not the expected behavior. The DMA engine API requires continuous processing.
Add a trigger to start after one processing finished if there are requests remain.
--- drivers/dma/dw-edma/dw-edma-core.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/dma/dw-edma/dw-edma-core.c +11 -9
@@ -181,7 +181,7 @@ static void vchan_free_desc(struct virt_dma_desc *vdesc)dw_edma_free_desc (vd2dw_edma_desc (vdesc)); } -static void dw_edma_start_transfer (struct dw_edma_chan *chan) +static int dw_edma_start_transfer (struct dw_edma_chan *chan) {struct dw_edma_chunk *child;struct dw_edma_desc *desc;
@@ -189,16 +189,16 @@ static void dw_edma_start_transfer(struct dw_edma_chan *chan) vd =vchan_next_desc (&chan->vc);if (!vd) -return ; +return 0 ; desc =vd2dw_edma_desc (vd);if (!desc) -return ; +return 0 ; child =list_first_entry_or_null (&desc->chunk->list, struct dw_edma_chunk, list);if (!child) -return ; +return 0 ;dw_edma_v0_core_start (child, !desc->xfer_sz); desc->xfer_sz += child->ll_region.sz;
@@ -206,6 +206,8 @@ static void dw_edma_start_transfer(struct dw_edma_chan *chan)list_del (&child->list);kfree (child); desc->chunks_alloc--; + +return 1 ; } static void dw_edma_device_caps(struct dma_chan *dchan,
@@ -602,14 +604,14 @@ static void dw_edma_done_interrupt(struct dw_edma_chan *chan)switch (chan->request) {case EDMA_REQ_NONE : desc =vd2dw_edma_desc (vd); -if (desc->chunks_alloc) { - chan->status =EDMA_ST_BUSY ; -dw_edma_start_transfer (chan); - }else { +if (!desc->chunks_alloc) {list_del (&vd->node);vchan_cookie_complete (vd); - chan->status =EDMA_ST_IDLE ; } + +/* Continue transferring if there are remaining chunks or issued requests. +*/ + chan->status =dw_edma_start_transfer (chan) ?EDMA_ST_BUSY :EDMA_ST_IDLE ;break ;case EDMA_REQ_STOP :
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 651/694 dmaengine: dw-edma: Fix to enable to issue dma request on DMA processing
In reply to Greg Kroah-HartmanFrom: Shunsuke Mie <[email protected]>
[ Upstream commit 970b17dfe264a9085ba4e593730ecfd496b950ab ]
The issue_pending request is ignored while driver is processing a DMA request. Fix to issue the pending requests on any dma channel status.
--- drivers/dma/dw-edma/dw-edma-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/dma/dw-edma/dw-edma-core.c +5 -2
@@ -308,9 +308,12 @@ static void dw_edma_device_issue_pending(struct dma_chan *dchan)struct dw_edma_chan *chan =dchan2dw_edma_chan (dchan);unsigned long flags; +if (!chan->configured) +return ; +spin_lock_irqsave (&chan->vc.lock, flags); -if (chan->configured && chan->request ==EDMA_REQ_NONE && - chan->status ==EDMA_ST_IDLE &&vchan_issue_pending (&chan->vc)) { +if (vchan_issue_pending (&chan->vc) && chan->request ==EDMA_REQ_NONE && + chan->status ==EDMA_ST_IDLE ) { chan->status =EDMA_ST_BUSY ;dw_edma_start_transfer (chan); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 652/694 dmaengine: at_xdmac: disable/enable clock directly on suspend/resume
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 2de5ddb5e68c94b781b3789bca1ce52000d7d0e0 ]
Runtime PM APIs for at_xdmac just plays with clk_enable()/clk_disable() letting aside the clk_prepare()/clk_unprepare() that needs to be executed as the clock is also prepared on probe. Thus instead of using runtime PM force suspend/resume APIs use clk_disable_unprepare() + pm_runtime_put_noidle() on suspend and clk_prepare_enable() + pm_runtime_get_noresume() on resume. This approach as been chosen instead of using runtime PM force suspend/resume with clk_unprepare()/clk_prepare() as it looks simpler and the final code is better.
While at it added the missing pm_runtime_mark_last_busy() on suspend before decrementing the reference counter.
--- drivers/dma/at_xdmac.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/dma/at_xdmac.c +9 -3
@@ -2130,7 +2130,11 @@ static int __maybe_unused atmel_xdmac_suspend(struct device *dev) atxdmac->save_gim =at_xdmac_read (atxdmac,AT_XDMAC_GIM );at_xdmac_off (atxdmac); -return pm_runtime_force_suspend (atxdmac->dev); +pm_runtime_mark_last_busy (atxdmac->dev); +pm_runtime_put_noidle (atxdmac->dev); +clk_disable_unprepare (atxdmac->clk); + +return 0 ; }static int __maybe_unused atmel_xdmac_resume (struct device *dev)
@@ -2142,10 +2146,12 @@ static int __maybe_unused atmel_xdmac_resume(struct device *dev)int i;int ret; - ret =pm_runtime_force_resume (atxdmac->dev); -if (ret <0 ) + ret =clk_prepare_enable (atxdmac->clk); +if (ret)return ret; +pm_runtime_get_noresume (atxdmac->dev); +at_xdmac_axi_config (pdev);/* Clear pending interrupts. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 653/694 dmaengine: at_xdmac: fix imbalanced runtime PM reference counter
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit e53957e1ec5196671e49a48f90a5c9555153189a ]
In case there are channels not paused during suspend (which on AT91 case is valid for serial driver when no_console_suspend boot argument is used) the at_xdmac_runtime_suspend_descriptors() was called more than one time due to at_xdmac_off(). To fix this add a new argument to at_xdmac_off() to specify if runtime PM reference counter needs to be decremented for queued active descriptors. Along with it moved the at_xdmac_runtime_suspend_descriptors() call under at_xdmac_chan_is_paused() check on suspend path as for the rest of channels the suspend is delayed by atmel_xdmac_prepare() in case channel is enabled. Same approach has been applied on resume path.
--- drivers/dma/at_xdmac.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/dma/at_xdmac.c +13 -13
@@ -412,7 +412,7 @@ static bool at_xdmac_chan_is_enabled(struct at_xdmac_chan *atchan)return ret; } -static void at_xdmac_off (struct at_xdmac *atxdmac) +static void at_xdmac_off (struct at_xdmac *atxdmac,bool suspend_descriptors) {struct dma_chan *chan, *_chan;struct at_xdmac_chan *atchan;
@@ -431,7 +431,7 @@ static void at_xdmac_off(struct at_xdmac *atxdmac)at_xdmac_write (atxdmac,AT_XDMAC_GID ,-1L );/* Decrement runtime PM ref counter for each active descriptor. */ -if (!list_empty (&atxdmac->dma.channels)) { +if (!list_empty (&atxdmac->dma.channels) && suspend_descriptors) {list_for_each_entry_safe (chan, _chan, &atxdmac->dma.channels, device_node) { atchan =to_at_xdmac_chan (chan);
@@ -2118,18 +2118,18 @@ static int __maybe_unused atmel_xdmac_suspend(struct device *dev) atchan->save_cc =at_xdmac_chan_read (atchan,AT_XDMAC_CC );if (at_xdmac_chan_is_cyclic (atchan)) { -if (!at_xdmac_chan_is_paused (atchan)) +if (!at_xdmac_chan_is_paused (atchan)) {at_xdmac_device_pause (chan); +at_xdmac_runtime_suspend_descriptors (atchan); + } atchan->save_cim =at_xdmac_chan_read (atchan,AT_XDMAC_CIM ); atchan->save_cnda =at_xdmac_chan_read (atchan,AT_XDMAC_CNDA ); atchan->save_cndc =at_xdmac_chan_read (atchan,AT_XDMAC_CNDC ); } - -at_xdmac_runtime_suspend_descriptors (atchan); } atxdmac->save_gim =at_xdmac_read (atxdmac,AT_XDMAC_GIM ); -at_xdmac_off (atxdmac); +at_xdmac_off (atxdmac, false);pm_runtime_mark_last_busy (atxdmac->dev);pm_runtime_put_noidle (atxdmac->dev);clk_disable_unprepare (atxdmac->clk);
@@ -2165,14 +2165,14 @@ static int __maybe_unused atmel_xdmac_resume(struct device *dev)list_for_each_entry_safe (chan, _chan, &atxdmac->dma.channels, device_node) { atchan =to_at_xdmac_chan (chan); - ret =at_xdmac_runtime_resume_descriptors (atchan); -if (ret <0 ) -return ret; -at_xdmac_chan_write (atchan,AT_XDMAC_CC , atchan->save_cc);if (at_xdmac_chan_is_cyclic (atchan)) { -if (at_xdmac_chan_is_paused (atchan)) +if (at_xdmac_chan_is_paused (atchan)) { + ret =at_xdmac_runtime_resume_descriptors (atchan); +if (ret <0 ) +return ret;at_xdmac_device_resume (chan); + }at_xdmac_chan_write (atchan,AT_XDMAC_CNDA , atchan->save_cnda);at_xdmac_chan_write (atchan,AT_XDMAC_CNDC , atchan->save_cndc);at_xdmac_chan_write (atchan,AT_XDMAC_CIE , atchan->save_cim);
@@ -2318,7 +2318,7 @@ static int at_xdmac_probe(struct platform_device *pdev)INIT_LIST_HEAD (&atxdmac->dma.channels);/* Disable all chans and interrupts. */ -at_xdmac_off (atxdmac); +at_xdmac_off (atxdmac, true);for (i =0 ; i < nr_channels; i++) {struct at_xdmac_chan *atchan = &atxdmac->chan[i];
@@ -2382,7 +2382,7 @@ static int at_xdmac_remove(struct platform_device *pdev)struct at_xdmac *atxdmac = (struct at_xdmac *)platform_get_drvdata (pdev);int i; -at_xdmac_off (atxdmac); +at_xdmac_off (atxdmac, true);of_dma_controller_free (pdev->dev.of_node);dma_async_device_unregister (&atxdmac->dma);pm_runtime_disable (atxdmac->dev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 654/694 dmaengine: at_xdmac: do not resume channels paused by consumers
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 44fe8440bda545b5d167329df88c47609a645168 ]
In case there are DMA channels not paused by consumers in suspend process (valid on AT91 SoCs for serial driver when no_console_suspend) the driver pauses them (using at_xdmac_device_pause() which is also the same function called by dmaengine_pause()) and then in the resume process the driver resumes them calling at_xdmac_device_resume() which is the same function called by dmaengine_resume()). This is good for DMA channels not paused by consumers but for drivers that calls dmaengine_pause()/dmaegine_resume() on suspend/resume path this may lead to DMA channel being enabled before the IP is enabled. For IPs that needs strict ordering with regards to DMA channel enablement this will lead to wrong behavior. To fix this add a new set of functions at_xdmac_device_pause_internal()/at_xdmac_device_resume_internal() to be called only on suspend/resume.
--- drivers/dma/at_xdmac.c | 52 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 7 deletions(-)
drivers/dma/at_xdmac.c +45 -7
@@ -187,6 +187,7 @@enum atc_status {AT_XDMAC_CHAN_IS_CYCLIC =0 ,AT_XDMAC_CHAN_IS_PAUSED , +AT_XDMAC_CHAN_IS_PAUSED_INTERNAL , };struct at_xdmac_layout {
@@ -347,6 +348,11 @@ static inline int at_xdmac_chan_is_paused(struct at_xdmac_chan *atchan)return test_bit (AT_XDMAC_CHAN_IS_PAUSED , &atchan->status); } +static inline int at_xdmac_chan_is_paused_internal (struct at_xdmac_chan *atchan) +{ +return test_bit (AT_XDMAC_CHAN_IS_PAUSED_INTERNAL , &atchan->status); +} +static inline bool at_xdmac_chan_is_peripheral_xfer (u32 cfg) {return cfg &AT_XDMAC_CC_TYPE_PER_TRAN ;
@@ -1898,6 +1904,26 @@ static int at_xdmac_device_config(struct dma_chan *chan,return ret; } +static void at_xdmac_device_pause_set (struct at_xdmac *atxdmac, +struct at_xdmac_chan *atchan) +{ +at_xdmac_write (atxdmac, atxdmac->layout->grws, atchan->mask); +while (at_xdmac_chan_read (atchan,AT_XDMAC_CC ) & + (AT_XDMAC_CC_WRIP |AT_XDMAC_CC_RDIP )) +cpu_relax (); +} + +static void at_xdmac_device_pause_internal (struct at_xdmac_chan *atchan) +{ +struct at_xdmac *atxdmac =to_at_xdmac (atchan->chan.device); +unsigned long flags; + +spin_lock_irqsave (&atchan->lock, flags); +set_bit (AT_XDMAC_CHAN_IS_PAUSED_INTERNAL , &atchan->status); +at_xdmac_device_pause_set (atxdmac, atchan); +spin_unlock_irqrestore (&atchan->lock, flags); +} +static int at_xdmac_device_pause (struct dma_chan *chan) {struct at_xdmac_chan *atchan =to_at_xdmac_chan (chan);
@@ -1915,11 +1941,8 @@ static int at_xdmac_device_pause(struct dma_chan *chan)return ret;spin_lock_irqsave (&atchan->lock, flags); -at_xdmac_write (atxdmac, atxdmac->layout->grws, atchan->mask); -while (at_xdmac_chan_read (atchan,AT_XDMAC_CC ) - & (AT_XDMAC_CC_WRIP |AT_XDMAC_CC_RDIP )) -cpu_relax (); +at_xdmac_device_pause_set (atxdmac, atchan);/* Decrement runtime PM ref counter for each active descriptor. */ at_xdmac_runtime_suspend_descriptors (atchan);
@@ -1931,6 +1954,17 @@ static int at_xdmac_device_pause(struct dma_chan *chan)return 0 ; } +static void at_xdmac_device_resume_internal (struct at_xdmac_chan *atchan) +{ +struct at_xdmac *atxdmac =to_at_xdmac (atchan->chan.device); +unsigned long flags; + +spin_lock_irqsave (&atchan->lock, flags); +at_xdmac_write (atxdmac, atxdmac->layout->grwr, atchan->mask); +clear_bit (AT_XDMAC_CHAN_IS_PAUSED_INTERNAL , &atchan->status); +spin_unlock_irqrestore (&atchan->lock, flags); +} +static int at_xdmac_device_resume (struct dma_chan *chan) {struct at_xdmac_chan *atchan =to_at_xdmac_chan (chan);
@@ -2119,7 +2153,7 @@ static int __maybe_unused atmel_xdmac_suspend(struct device *dev) atchan->save_cc =at_xdmac_chan_read (atchan,AT_XDMAC_CC );if (at_xdmac_chan_is_cyclic (atchan)) {if (!at_xdmac_chan_is_paused (atchan)) { -at_xdmac_device_pause (chan); +at_xdmac_device_pause_internal (atchan);at_xdmac_runtime_suspend_descriptors (atchan); } atchan->save_cim =at_xdmac_chan_read (atchan,AT_XDMAC_CIM );
@@ -2167,11 +2201,15 @@ static int __maybe_unused atmel_xdmac_resume(struct device *dev)at_xdmac_chan_write (atchan,AT_XDMAC_CC , atchan->save_cc);if (at_xdmac_chan_is_cyclic (atchan)) { -if (at_xdmac_chan_is_paused (atchan)) { +/* +* Resume only channels not explicitly paused by +* consumers. +*/ +if (at_xdmac_chan_is_paused_internal (atchan)) { ret =at_xdmac_runtime_resume_descriptors (atchan);if (ret <0 )return ret; -at_xdmac_device_resume (chan); +at_xdmac_device_resume_internal (atchan); }at_xdmac_chan_write (atchan,AT_XDMAC_CNDA , atchan->save_cnda);at_xdmac_chan_write (atchan,AT_XDMAC_CNDC , atchan->save_cndc);
Signature · 1 line
2.39.2