Merge tag 'char-misc-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
"Here are a small number of char/misc driver fixes for 5.17-rc4 for
reported issues. They contain:

- phy driver fixes

- iio driver fix

- eeprom driver fix

- speakup regression fix

- fastrpc fix

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

* tag 'char-misc-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL
speakup-dectlk: Restore pitch setting
bus: mhi: pci_generic: Add mru_default for Cinterion MV31-W
bus: mhi: pci_generic: Add mru_default for Foxconn SDX55
eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX
misc: fastrpc: avoid double fput() on failed usercopy
phy: dphy: Correct clk_pre parameter
phy: phy-mtk-tphy: Fix duplicated argument in phy-mtk-tphy
phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable()
phy: xilinx: zynqmp: Fix bus width setting for SGMII
phy: cadence: Sierra: fix error handling bugs in probe()
phy: ti: Fix missing sentinel for clk_div_table
phy: broadcom: Kconfig: Fix PHY_BRCM_USB config option
phy: usb: Leave some clocks running during suspend

+104 -37
+1
drivers/accessibility/speakup/speakup_dectlk.c
··· 44 { CAPS_START, .u.s = {"[:dv ap 160] " } }, 45 { CAPS_STOP, .u.s = {"[:dv ap 100 ] " } }, 46 { RATE, .u.n = {"[:ra %d] ", 180, 75, 650, 0, 0, NULL } }, 47 { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } }, 48 { VOL, .u.n = {"[:dv g5 %d] ", 86, 60, 86, 0, 0, NULL } }, 49 { PUNCT, .u.n = {"[:pu %c] ", 0, 0, 2, 0, 0, "nsa" } },
··· 44 { CAPS_START, .u.s = {"[:dv ap 160] " } }, 45 { CAPS_STOP, .u.s = {"[:dv ap 100 ] " } }, 46 { RATE, .u.n = {"[:ra %d] ", 180, 75, 650, 0, 0, NULL } }, 47 + { PITCH, .u.n = {"[:dv ap %d] ", 122, 50, 350, 0, 0, NULL } }, 48 { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } }, 49 { VOL, .u.n = {"[:dv g5 %d] ", 86, 60, 86, 0, 0, NULL } }, 50 { PUNCT, .u.n = {"[:pu %c] ", 0, 0, 2, 0, 0, "nsa" } },
+2
drivers/bus/mhi/pci_generic.c
··· 366 .config = &modem_foxconn_sdx55_config, 367 .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 368 .dma_data_width = 32, 369 .sideband_wake = false, 370 }; 371 ··· 402 .config = &modem_mv31_config, 403 .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 404 .dma_data_width = 32, 405 }; 406 407 static const struct mhi_channel_config mhi_sierra_em919x_channels[] = {
··· 366 .config = &modem_foxconn_sdx55_config, 367 .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 368 .dma_data_width = 32, 369 + .mru_default = 32768, 370 .sideband_wake = false, 371 }; 372 ··· 401 .config = &modem_mv31_config, 402 .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 403 .dma_data_width = 32, 404 + .mru_default = 32768, 405 }; 406 407 static const struct mhi_channel_config mhi_sierra_em919x_channels[] = {
+5 -7
drivers/gpu/drm/bridge/nwl-dsi.c
··· 7 */ 8 9 #include <linux/bitfield.h> 10 #include <linux/clk.h> 11 #include <linux/irq.h> 12 #include <linux/math64.h> ··· 197 /* 198 * ui2bc - UI time periods to byte clock cycles 199 */ 200 - static u32 ui2bc(struct nwl_dsi *dsi, unsigned long long ui) 201 { 202 - u32 bpp = mipi_dsi_pixel_format_to_bpp(dsi->format); 203 - 204 - return DIV64_U64_ROUND_UP(ui * dsi->lanes, 205 - dsi->mode.clock * 1000 * bpp); 206 } 207 208 /* ··· 230 } 231 232 /* values in byte clock cycles */ 233 - cycles = ui2bc(dsi, cfg->clk_pre); 234 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_t_pre: 0x%x\n", cycles); 235 nwl_dsi_write(dsi, NWL_DSI_CFG_T_PRE, cycles); 236 cycles = ps2bc(dsi, cfg->lpx + cfg->clk_prepare + cfg->clk_zero); 237 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_tx_gap (pre): 0x%x\n", cycles); 238 - cycles += ui2bc(dsi, cfg->clk_pre); 239 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_t_post: 0x%x\n", cycles); 240 nwl_dsi_write(dsi, NWL_DSI_CFG_T_POST, cycles); 241 cycles = ps2bc(dsi, cfg->hs_exit);
··· 7 */ 8 9 #include <linux/bitfield.h> 10 + #include <linux/bits.h> 11 #include <linux/clk.h> 12 #include <linux/irq.h> 13 #include <linux/math64.h> ··· 196 /* 197 * ui2bc - UI time periods to byte clock cycles 198 */ 199 + static u32 ui2bc(unsigned int ui) 200 { 201 + return DIV_ROUND_UP(ui, BITS_PER_BYTE); 202 } 203 204 /* ··· 232 } 233 234 /* values in byte clock cycles */ 235 + cycles = ui2bc(cfg->clk_pre); 236 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_t_pre: 0x%x\n", cycles); 237 nwl_dsi_write(dsi, NWL_DSI_CFG_T_PRE, cycles); 238 cycles = ps2bc(dsi, cfg->lpx + cfg->clk_prepare + cfg->clk_zero); 239 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_tx_gap (pre): 0x%x\n", cycles); 240 + cycles += ui2bc(cfg->clk_pre); 241 DRM_DEV_DEBUG_DRIVER(dsi->dev, "cfg_t_post: 0x%x\n", cycles); 242 nwl_dsi_write(dsi, NWL_DSI_CFG_T_POST, cycles); 243 cycles = ps2bc(dsi, cfg->hs_exit);
+11 -3
drivers/iio/industrialio-buffer.c
··· 1569 } 1570 1571 if (copy_to_user(ival, &fd, sizeof(fd))) { 1572 - put_unused_fd(fd); 1573 - ret = -EFAULT; 1574 - goto error_free_ib; 1575 } 1576 1577 return 0;
··· 1569 } 1570 1571 if (copy_to_user(ival, &fd, sizeof(fd))) { 1572 + /* 1573 + * "Leak" the fd, as there's not much we can do about this 1574 + * anyway. 'fd' might have been closed already, as 1575 + * anon_inode_getfd() called fd_install() on it, which made 1576 + * it reachable by userland. 1577 + * 1578 + * Instead of allowing a malicious user to play tricks with 1579 + * us, rely on the process exit path to do any necessary 1580 + * cleanup, as in releasing the file, if still needed. 1581 + */ 1582 + return -EFAULT; 1583 } 1584 1585 return 0;
+3
drivers/misc/eeprom/ee1004.c
··· 114 if (offset + count > EE1004_PAGE_SIZE) 115 count = EE1004_PAGE_SIZE - offset; 116 117 return i2c_smbus_read_i2c_block_data_or_emulated(client, offset, count, buf); 118 } 119
··· 114 if (offset + count > EE1004_PAGE_SIZE) 115 count = EE1004_PAGE_SIZE - offset; 116 117 + if (count > I2C_SMBUS_BLOCK_MAX) 118 + count = I2C_SMBUS_BLOCK_MAX; 119 + 120 return i2c_smbus_read_i2c_block_data_or_emulated(client, offset, count, buf); 121 } 122
+8 -1
drivers/misc/fastrpc.c
··· 1288 } 1289 1290 if (copy_to_user(argp, &bp, sizeof(bp))) { 1291 - dma_buf_put(buf->dmabuf); 1292 return -EFAULT; 1293 } 1294
··· 1288 } 1289 1290 if (copy_to_user(argp, &bp, sizeof(bp))) { 1291 + /* 1292 + * The usercopy failed, but we can't do much about it, as 1293 + * dma_buf_fd() already called fd_install() and made the 1294 + * file descriptor accessible for the current process. It 1295 + * might already be closed and dmabuf no longer valid when 1296 + * we reach this point. Therefore "leak" the fd and rely on 1297 + * the process exit path to do any required cleanup. 1298 + */ 1299 return -EFAULT; 1300 } 1301
+2 -1
drivers/phy/amlogic/phy-meson-axg-mipi-dphy.c
··· 9 10 #include <linux/bitfield.h> 11 #include <linux/bitops.h> 12 #include <linux/clk.h> 13 #include <linux/delay.h> 14 #include <linux/io.h> ··· 251 (DIV_ROUND_UP(priv->config.clk_zero, temp) << 16) | 252 (DIV_ROUND_UP(priv->config.clk_prepare, temp) << 24)); 253 regmap_write(priv->regmap, MIPI_DSI_CLK_TIM1, 254 - DIV_ROUND_UP(priv->config.clk_pre, temp)); 255 256 regmap_write(priv->regmap, MIPI_DSI_HS_TIM, 257 DIV_ROUND_UP(priv->config.hs_exit, temp) |
··· 9 10 #include <linux/bitfield.h> 11 #include <linux/bitops.h> 12 + #include <linux/bits.h> 13 #include <linux/clk.h> 14 #include <linux/delay.h> 15 #include <linux/io.h> ··· 250 (DIV_ROUND_UP(priv->config.clk_zero, temp) << 16) | 251 (DIV_ROUND_UP(priv->config.clk_prepare, temp) << 24)); 252 regmap_write(priv->regmap, MIPI_DSI_CLK_TIM1, 253 + DIV_ROUND_UP(priv->config.clk_pre, BITS_PER_BYTE)); 254 255 regmap_write(priv->regmap, MIPI_DSI_HS_TIM, 256 DIV_ROUND_UP(priv->config.hs_exit, temp) |
+1 -2
drivers/phy/broadcom/Kconfig
··· 97 depends on OF 98 select GENERIC_PHY 99 select SOC_BRCMSTB if ARCH_BRCMSTB 100 - default ARCH_BCM4908 101 - default ARCH_BRCMSTB 102 help 103 Enable this to support the Broadcom STB USB PHY. 104 This driver is required by the USB XHCI, EHCI and OHCI
··· 97 depends on OF 98 select GENERIC_PHY 99 select SOC_BRCMSTB if ARCH_BRCMSTB 100 + default ARCH_BCM4908 || ARCH_BRCMSTB 101 help 102 Enable this to support the Broadcom STB USB PHY. 103 This driver is required by the USB XHCI, EHCI and OHCI
+38
drivers/phy/broadcom/phy-brcm-usb.c
··· 18 #include <linux/soc/brcmstb/brcmstb.h> 19 #include <dt-bindings/phy/phy.h> 20 #include <linux/mfd/syscon.h> 21 22 #include "phy-brcm-usb-init.h" 23 ··· 71 int init_count; 72 int wake_irq; 73 struct brcm_usb_phy phys[BRCM_USB_PHY_ID_MAX]; 74 }; 75 76 static s8 *node_reg_names[BRCM_REGS_MAX] = { 77 "crtl", "xhci_ec", "xhci_gbl", "usb_phy", "usb_mdio", "bdc_ec" 78 }; 79 80 static irqreturn_t brcm_usb_phy_wake_isr(int irq, void *dev_id) 81 { ··· 114 struct brcm_usb_phy *phy = phy_get_drvdata(gphy); 115 struct brcm_usb_phy_data *priv = 116 container_of(phy, struct brcm_usb_phy_data, phys[phy->id]); 117 118 /* 119 * Use a lock to make sure a second caller waits until ··· 146 struct brcm_usb_phy *phy = phy_get_drvdata(gphy); 147 struct brcm_usb_phy_data *priv = 148 container_of(phy, struct brcm_usb_phy_data, phys[phy->id]); 149 150 dev_dbg(&gphy->dev, "EXIT\n"); 151 if (phy->id == BRCM_USB_PHY_2_0) ··· 518 if (err) 519 return err; 520 521 mutex_init(&priv->mutex); 522 523 /* make sure invert settings are correct */ ··· 561 562 static int brcm_usb_phy_remove(struct platform_device *pdev) 563 { 564 sysfs_remove_group(&pdev->dev.kobj, &brcm_usb_phy_group); 565 566 return 0; 567 } ··· 575 struct brcm_usb_phy_data *priv = dev_get_drvdata(dev); 576 577 if (priv->init_count) { 578 priv->ini.wake_enabled = device_may_wakeup(dev); 579 if (priv->phys[BRCM_USB_PHY_3_0].inited) 580 brcm_usb_uninit_xhci(&priv->ini); ··· 615 * Uninitialize anything that wasn't previously initialized. 616 */ 617 if (priv->init_count) { 618 if (priv->wake_irq >= 0) 619 disable_irq_wake(priv->wake_irq); 620 brcm_usb_init_common(&priv->ini);
··· 18 #include <linux/soc/brcmstb/brcmstb.h> 19 #include <dt-bindings/phy/phy.h> 20 #include <linux/mfd/syscon.h> 21 + #include <linux/suspend.h> 22 23 #include "phy-brcm-usb-init.h" 24 ··· 70 int init_count; 71 int wake_irq; 72 struct brcm_usb_phy phys[BRCM_USB_PHY_ID_MAX]; 73 + struct notifier_block pm_notifier; 74 + bool pm_active; 75 }; 76 77 static s8 *node_reg_names[BRCM_REGS_MAX] = { 78 "crtl", "xhci_ec", "xhci_gbl", "usb_phy", "usb_mdio", "bdc_ec" 79 }; 80 + 81 + static int brcm_pm_notifier(struct notifier_block *notifier, 82 + unsigned long pm_event, 83 + void *unused) 84 + { 85 + struct brcm_usb_phy_data *priv = 86 + container_of(notifier, struct brcm_usb_phy_data, pm_notifier); 87 + 88 + switch (pm_event) { 89 + case PM_HIBERNATION_PREPARE: 90 + case PM_SUSPEND_PREPARE: 91 + priv->pm_active = true; 92 + break; 93 + case PM_POST_RESTORE: 94 + case PM_POST_HIBERNATION: 95 + case PM_POST_SUSPEND: 96 + priv->pm_active = false; 97 + break; 98 + } 99 + return NOTIFY_DONE; 100 + } 101 102 static irqreturn_t brcm_usb_phy_wake_isr(int irq, void *dev_id) 103 { ··· 90 struct brcm_usb_phy *phy = phy_get_drvdata(gphy); 91 struct brcm_usb_phy_data *priv = 92 container_of(phy, struct brcm_usb_phy_data, phys[phy->id]); 93 + 94 + if (priv->pm_active) 95 + return 0; 96 97 /* 98 * Use a lock to make sure a second caller waits until ··· 119 struct brcm_usb_phy *phy = phy_get_drvdata(gphy); 120 struct brcm_usb_phy_data *priv = 121 container_of(phy, struct brcm_usb_phy_data, phys[phy->id]); 122 + 123 + if (priv->pm_active) 124 + return 0; 125 126 dev_dbg(&gphy->dev, "EXIT\n"); 127 if (phy->id == BRCM_USB_PHY_2_0) ··· 488 if (err) 489 return err; 490 491 + priv->pm_notifier.notifier_call = brcm_pm_notifier; 492 + register_pm_notifier(&priv->pm_notifier); 493 + 494 mutex_init(&priv->mutex); 495 496 /* make sure invert settings are correct */ ··· 528 529 static int brcm_usb_phy_remove(struct platform_device *pdev) 530 { 531 + struct brcm_usb_phy_data *priv = dev_get_drvdata(&pdev->dev); 532 + 533 sysfs_remove_group(&pdev->dev.kobj, &brcm_usb_phy_group); 534 + unregister_pm_notifier(&priv->pm_notifier); 535 536 return 0; 537 } ··· 539 struct brcm_usb_phy_data *priv = dev_get_drvdata(dev); 540 541 if (priv->init_count) { 542 + dev_dbg(dev, "SUSPEND\n"); 543 priv->ini.wake_enabled = device_may_wakeup(dev); 544 if (priv->phys[BRCM_USB_PHY_3_0].inited) 545 brcm_usb_uninit_xhci(&priv->ini); ··· 578 * Uninitialize anything that wasn't previously initialized. 579 */ 580 if (priv->init_count) { 581 + dev_dbg(dev, "RESUME\n"); 582 if (priv->wake_irq >= 0) 583 disable_irq_wake(priv->wake_irq); 584 brcm_usb_init_common(&priv->ini);
+20 -13
drivers/phy/cadence/phy-cadence-sierra.c
··· 1338 struct device *dev = &pdev->dev; 1339 const struct cdns_sierra_data *data; 1340 unsigned int id_value; 1341 - int i, ret, node = 0; 1342 void __iomem *base; 1343 struct device_node *dn = dev->of_node, *child; 1344 ··· 1416 dev_err(dev, "failed to get reset %s\n", 1417 child->full_name); 1418 ret = PTR_ERR(sp->phys[node].lnk_rst); 1419 - goto put_child2; 1420 } 1421 1422 if (!sp->autoconf) { ··· 1425 if (ret) { 1426 dev_err(dev, "missing property in node %s\n", 1427 child->name); 1428 - goto put_child; 1429 } 1430 } 1431 ··· 1437 1438 if (IS_ERR(gphy)) { 1439 ret = PTR_ERR(gphy); 1440 - goto put_child; 1441 } 1442 sp->phys[node].phy = gphy; 1443 phy_set_drvdata(gphy, &sp->phys[node]); ··· 1451 if (sp->num_lanes > SIERRA_MAX_LANES) { 1452 ret = -EINVAL; 1453 dev_err(dev, "Invalid lane configuration\n"); 1454 - goto put_child2; 1455 } 1456 1457 /* If more than one subnode, configure the PHY as multilink */ 1458 if (!sp->autoconf && sp->nsubnodes > 1) { 1459 ret = cdns_sierra_phy_configure_multilink(sp); 1460 if (ret) 1461 - goto put_child2; 1462 } 1463 1464 pm_runtime_enable(dev); 1465 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); 1466 - return PTR_ERR_OR_ZERO(phy_provider); 1467 1468 - put_child: 1469 - node++; 1470 - put_child2: 1471 - for (i = 0; i < node; i++) 1472 - reset_control_put(sp->phys[i].lnk_rst); 1473 - of_node_put(child); 1474 clk_disable: 1475 cdns_sierra_phy_disable_clocks(sp); 1476 reset_control_assert(sp->apb_rst);
··· 1338 struct device *dev = &pdev->dev; 1339 const struct cdns_sierra_data *data; 1340 unsigned int id_value; 1341 + int ret, node = 0; 1342 void __iomem *base; 1343 struct device_node *dn = dev->of_node, *child; 1344 ··· 1416 dev_err(dev, "failed to get reset %s\n", 1417 child->full_name); 1418 ret = PTR_ERR(sp->phys[node].lnk_rst); 1419 + of_node_put(child); 1420 + goto put_control; 1421 } 1422 1423 if (!sp->autoconf) { ··· 1424 if (ret) { 1425 dev_err(dev, "missing property in node %s\n", 1426 child->name); 1427 + of_node_put(child); 1428 + reset_control_put(sp->phys[node].lnk_rst); 1429 + goto put_control; 1430 } 1431 } 1432 ··· 1434 1435 if (IS_ERR(gphy)) { 1436 ret = PTR_ERR(gphy); 1437 + of_node_put(child); 1438 + reset_control_put(sp->phys[node].lnk_rst); 1439 + goto put_control; 1440 } 1441 sp->phys[node].phy = gphy; 1442 phy_set_drvdata(gphy, &sp->phys[node]); ··· 1446 if (sp->num_lanes > SIERRA_MAX_LANES) { 1447 ret = -EINVAL; 1448 dev_err(dev, "Invalid lane configuration\n"); 1449 + goto put_control; 1450 } 1451 1452 /* If more than one subnode, configure the PHY as multilink */ 1453 if (!sp->autoconf && sp->nsubnodes > 1) { 1454 ret = cdns_sierra_phy_configure_multilink(sp); 1455 if (ret) 1456 + goto put_control; 1457 } 1458 1459 pm_runtime_enable(dev); 1460 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); 1461 + if (IS_ERR(phy_provider)) { 1462 + ret = PTR_ERR(phy_provider); 1463 + goto put_control; 1464 + } 1465 1466 + return 0; 1467 + 1468 + put_control: 1469 + while (--node >= 0) 1470 + reset_control_put(sp->phys[node].lnk_rst); 1471 clk_disable: 1472 cdns_sierra_phy_disable_clocks(sp); 1473 reset_control_assert(sp->apb_rst);
+1 -1
drivers/phy/mediatek/phy-mtk-tphy.c
··· 992 /* no efuse, ignore it */ 993 if (!instance->efuse_intr && 994 !instance->efuse_rx_imp && 995 - !instance->efuse_rx_imp) { 996 dev_warn(dev, "no u3 intr efuse, but dts enable it\n"); 997 instance->efuse_sw_en = 0; 998 break;
··· 992 /* no efuse, ignore it */ 993 if (!instance->efuse_intr && 994 !instance->efuse_rx_imp && 995 + !instance->efuse_tx_imp) { 996 dev_warn(dev, "no u3 intr efuse, but dts enable it\n"); 997 instance->efuse_sw_en = 0; 998 break;
+2 -2
drivers/phy/phy-core-mipi-dphy.c
··· 36 37 cfg->clk_miss = 0; 38 cfg->clk_post = 60000 + 52 * ui; 39 - cfg->clk_pre = 8000; 40 cfg->clk_prepare = 38000; 41 cfg->clk_settle = 95000; 42 cfg->clk_term_en = 0; ··· 97 if (cfg->clk_post < (60000 + 52 * ui)) 98 return -EINVAL; 99 100 - if (cfg->clk_pre < 8000) 101 return -EINVAL; 102 103 if (cfg->clk_prepare < 38000 || cfg->clk_prepare > 95000)
··· 36 37 cfg->clk_miss = 0; 38 cfg->clk_post = 60000 + 52 * ui; 39 + cfg->clk_pre = 8; 40 cfg->clk_prepare = 38000; 41 cfg->clk_settle = 95000; 42 cfg->clk_term_en = 0; ··· 97 if (cfg->clk_post < (60000 + 52 * ui)) 98 return -EINVAL; 99 100 + if (cfg->clk_pre < 8) 101 return -EINVAL; 102 103 if (cfg->clk_prepare < 38000 || cfg->clk_prepare > 95000)
+2 -1
drivers/phy/rockchip/phy-rockchip-inno-dsidphy.c
··· 5 * Author: Wyon Bi <bivvy.bi@rock-chips.com> 6 */ 7 8 #include <linux/kernel.h> 9 #include <linux/clk.h> 10 #include <linux/iopoll.h> ··· 365 * The value of counter for HS Tclk-pre 366 * Tclk-pre = Tpin_txbyteclkhs * value 367 */ 368 - clk_pre = DIV_ROUND_UP(cfg->clk_pre, t_txbyteclkhs); 369 370 /* 371 * The value of counter for HS Tlpx Time
··· 5 * Author: Wyon Bi <bivvy.bi@rock-chips.com> 6 */ 7 8 + #include <linux/bits.h> 9 #include <linux/kernel.h> 10 #include <linux/clk.h> 11 #include <linux/iopoll.h> ··· 364 * The value of counter for HS Tclk-pre 365 * Tclk-pre = Tpin_txbyteclkhs * value 366 */ 367 + clk_pre = DIV_ROUND_UP(cfg->clk_pre, BITS_PER_BYTE); 368 369 /* 370 * The value of counter for HS Tlpx Time
+1 -1
drivers/phy/st/phy-stm32-usbphyc.c
··· 304 305 ret = __stm32_usbphyc_pll_disable(usbphyc); 306 if (ret) 307 - return ret; 308 } 309 310 ret = stm32_usbphyc_regulators_enable(usbphyc);
··· 304 305 ret = __stm32_usbphyc_pll_disable(usbphyc); 306 if (ret) 307 + goto dec_n_pll_cons; 308 } 309 310 ret = stm32_usbphyc_regulators_enable(usbphyc);
+1
drivers/phy/ti/phy-j721e-wiz.c
··· 233 { .val = 1, .div = 2, }, 234 { .val = 2, .div = 4, }, 235 { .val = 3, .div = 8, }, 236 }; 237 238 static const struct wiz_clk_div_sel clk_div_sel[] = {
··· 233 { .val = 1, .div = 2, }, 234 { .val = 2, .div = 4, }, 235 { .val = 3, .div = 8, }, 236 + { /* sentinel */ }, 237 }; 238 239 static const struct wiz_clk_div_sel clk_div_sel[] = {
+6 -5
drivers/phy/xilinx/phy-zynqmp.c
··· 134 #define PROT_BUS_WIDTH_10 0x0 135 #define PROT_BUS_WIDTH_20 0x1 136 #define PROT_BUS_WIDTH_40 0x2 137 - #define PROT_BUS_WIDTH_SHIFT 2 138 139 /* Number of GT lanes */ 140 #define NUM_LANES 4 ··· 446 static void xpsgtr_phy_init_sgmii(struct xpsgtr_phy *gtr_phy) 447 { 448 struct xpsgtr_dev *gtr_dev = gtr_phy->dev; 449 450 /* Set SGMII protocol TX and RX bus width to 10 bits. */ 451 - xpsgtr_write(gtr_dev, TX_PROT_BUS_WIDTH, 452 - PROT_BUS_WIDTH_10 << (gtr_phy->lane * PROT_BUS_WIDTH_SHIFT)); 453 - xpsgtr_write(gtr_dev, RX_PROT_BUS_WIDTH, 454 - PROT_BUS_WIDTH_10 << (gtr_phy->lane * PROT_BUS_WIDTH_SHIFT)); 455 456 xpsgtr_bypass_scrambler_8b10b(gtr_phy); 457 }
··· 134 #define PROT_BUS_WIDTH_10 0x0 135 #define PROT_BUS_WIDTH_20 0x1 136 #define PROT_BUS_WIDTH_40 0x2 137 + #define PROT_BUS_WIDTH_SHIFT(n) ((n) * 2) 138 + #define PROT_BUS_WIDTH_MASK(n) GENMASK((n) * 2 + 1, (n) * 2) 139 140 /* Number of GT lanes */ 141 #define NUM_LANES 4 ··· 445 static void xpsgtr_phy_init_sgmii(struct xpsgtr_phy *gtr_phy) 446 { 447 struct xpsgtr_dev *gtr_dev = gtr_phy->dev; 448 + u32 mask = PROT_BUS_WIDTH_MASK(gtr_phy->lane); 449 + u32 val = PROT_BUS_WIDTH_10 << PROT_BUS_WIDTH_SHIFT(gtr_phy->lane); 450 451 /* Set SGMII protocol TX and RX bus width to 10 bits. */ 452 + xpsgtr_clr_set(gtr_dev, TX_PROT_BUS_WIDTH, mask, val); 453 + xpsgtr_clr_set(gtr_dev, RX_PROT_BUS_WIDTH, mask, val); 454 455 xpsgtr_bypass_scrambler_8b10b(gtr_phy); 456 }