Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull char / misc driver fixes from Greg KH:
"Here are a number of small driver fixes for 5.9-rc5

Included in here are:

- habanalabs driver fixes

- interconnect driver fixes

- soundwire driver fixes

- dyndbg fixes for reported issues, and then reverts to fix it all up
to a sane state.

- phy driver fixes

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

* tag 'char-misc-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
Revert "dyndbg: accept query terms like file=bar and module=foo"
Revert "dyndbg: fix problem parsing format="foo bar""
scripts/tags.sh: exclude tools directory from tags generation
video: fbdev: fix OOB read in vga_8planes_imageblit()
dyndbg: fix problem parsing format="foo bar"
dyndbg: refine export, rename to dynamic_debug_exec_queries()
dyndbg: give %3u width in pr-format, cosmetic only
interconnect: qcom: Fix small BW votes being truncated to zero
soundwire: fix double free of dangling pointer
interconnect: Show bandwidth for disabled paths as zero in debugfs
habanalabs: fix report of RAZWI initiator coordinates
habanalabs: prevent user buff overflow
phy: omap-usb2-phy: disable PHY charger detect
phy: qcom-qmp: Use correct values for ipq8074 PCIe Gen2 PHY init
soundwire: bus: fix typo in comment on INTSTAT registers
phy: qualcomm: fix return value check in qcom_ipq806x_usb_phy_probe()
phy: qualcomm: fix platform_no_drv_owner.cocci warnings

+172 -92
-1
Documentation/admin-guide/dynamic-debug-howto.rst
··· 156 156 ``line-range`` cannot contain space, e.g. 157 157 "1-30" is valid range but "1 - 30" is not. 158 158 159 - ``module=foo`` combined keyword=value form is interchangably accepted 160 159 161 160 The meanings of each keyword are: 162 161
+8 -2
drivers/interconnect/core.c
··· 55 55 56 56 icc_summary_show_one(s, n); 57 57 hlist_for_each_entry(r, &n->req_list, req_node) { 58 + u32 avg_bw = 0, peak_bw = 0; 59 + 58 60 if (!r->dev) 59 61 continue; 60 62 63 + if (r->enabled) { 64 + avg_bw = r->avg_bw; 65 + peak_bw = r->peak_bw; 66 + } 67 + 61 68 seq_printf(s, " %-27s %12u %12u %12u\n", 62 - dev_name(r->dev), r->tag, r->avg_bw, 63 - r->peak_bw); 69 + dev_name(r->dev), r->tag, avg_bw, peak_bw); 64 70 } 65 71 } 66 72 }
+19 -8
drivers/interconnect/qcom/bcm-voter.c
··· 52 52 return 1; 53 53 } 54 54 55 + static u64 bcm_div(u64 num, u32 base) 56 + { 57 + /* Ensure that small votes aren't lost. */ 58 + if (num && num < base) 59 + return 1; 60 + 61 + do_div(num, base); 62 + 63 + return num; 64 + } 65 + 55 66 static void bcm_aggregate(struct qcom_icc_bcm *bcm) 56 67 { 68 + struct qcom_icc_node *node; 57 69 size_t i, bucket; 58 70 u64 agg_avg[QCOM_ICC_NUM_BUCKETS] = {0}; 59 71 u64 agg_peak[QCOM_ICC_NUM_BUCKETS] = {0}; ··· 73 61 74 62 for (bucket = 0; bucket < QCOM_ICC_NUM_BUCKETS; bucket++) { 75 63 for (i = 0; i < bcm->num_nodes; i++) { 76 - temp = bcm->nodes[i]->sum_avg[bucket] * bcm->aux_data.width; 77 - do_div(temp, bcm->nodes[i]->buswidth * bcm->nodes[i]->channels); 64 + node = bcm->nodes[i]; 65 + temp = bcm_div(node->sum_avg[bucket] * bcm->aux_data.width, 66 + node->buswidth * node->channels); 78 67 agg_avg[bucket] = max(agg_avg[bucket], temp); 79 68 80 - temp = bcm->nodes[i]->max_peak[bucket] * bcm->aux_data.width; 81 - do_div(temp, bcm->nodes[i]->buswidth); 69 + temp = bcm_div(node->max_peak[bucket] * bcm->aux_data.width, 70 + node->buswidth); 82 71 agg_peak[bucket] = max(agg_peak[bucket], temp); 83 72 } 84 73 85 74 temp = agg_avg[bucket] * 1000ULL; 86 - do_div(temp, bcm->aux_data.unit); 87 - bcm->vote_x[bucket] = temp; 75 + bcm->vote_x[bucket] = bcm_div(temp, bcm->aux_data.unit); 88 76 89 77 temp = agg_peak[bucket] * 1000ULL; 90 - do_div(temp, bcm->aux_data.unit); 91 - bcm->vote_y[bucket] = temp; 78 + bcm->vote_y[bucket] = bcm_div(temp, bcm->aux_data.unit); 92 79 } 93 80 94 81 if (bcm->keepalive && bcm->vote_x[QCOM_ICC_BUCKET_AMC] == 0 &&
+1 -1
drivers/misc/habanalabs/common/debugfs.c
··· 982 982 return 0; 983 983 984 984 sprintf(tmp_buf, "0x%llx\n", hdev->clock_gating_mask); 985 - rc = simple_read_from_buffer(buf, strlen(tmp_buf) + 1, ppos, tmp_buf, 985 + rc = simple_read_from_buffer(buf, count, ppos, tmp_buf, 986 986 strlen(tmp_buf) + 1); 987 987 988 988 return rc;
+16 -16
drivers/misc/habanalabs/include/gaudi/gaudi_masks.h
··· 378 378 ((((y) & RAZWI_INITIATOR_Y_MASK) << RAZWI_INITIATOR_Y_SHIFT) | \ 379 379 (((x) & RAZWI_INITIATOR_X_MASK) << RAZWI_INITIATOR_X_SHIFT)) 380 380 381 - #define RAZWI_INITIATOR_ID_X_Y_TPC0_NIC0 RAZWI_INITIATOR_ID_X_Y(1, 0) 382 - #define RAZWI_INITIATOR_ID_X_Y_TPC1 RAZWI_INITIATOR_ID_X_Y(2, 0) 383 - #define RAZWI_INITIATOR_ID_X_Y_MME0_0 RAZWI_INITIATOR_ID_X_Y(3, 0) 384 - #define RAZWI_INITIATOR_ID_X_Y_MME0_1 RAZWI_INITIATOR_ID_X_Y(4, 0) 385 - #define RAZWI_INITIATOR_ID_X_Y_MME1_0 RAZWI_INITIATOR_ID_X_Y(5, 0) 386 - #define RAZWI_INITIATOR_ID_X_Y_MME1_1 RAZWI_INITIATOR_ID_X_Y(6, 0) 387 - #define RAZWI_INITIATOR_ID_X_Y_TPC2 RAZWI_INITIATOR_ID_X_Y(7, 0) 381 + #define RAZWI_INITIATOR_ID_X_Y_TPC0_NIC0 RAZWI_INITIATOR_ID_X_Y(1, 1) 382 + #define RAZWI_INITIATOR_ID_X_Y_TPC1 RAZWI_INITIATOR_ID_X_Y(2, 1) 383 + #define RAZWI_INITIATOR_ID_X_Y_MME0_0 RAZWI_INITIATOR_ID_X_Y(3, 1) 384 + #define RAZWI_INITIATOR_ID_X_Y_MME0_1 RAZWI_INITIATOR_ID_X_Y(4, 1) 385 + #define RAZWI_INITIATOR_ID_X_Y_MME1_0 RAZWI_INITIATOR_ID_X_Y(5, 1) 386 + #define RAZWI_INITIATOR_ID_X_Y_MME1_1 RAZWI_INITIATOR_ID_X_Y(6, 1) 387 + #define RAZWI_INITIATOR_ID_X_Y_TPC2 RAZWI_INITIATOR_ID_X_Y(7, 1) 388 388 #define RAZWI_INITIATOR_ID_X_Y_TPC3_PCI_CPU_PSOC \ 389 - RAZWI_INITIATOR_ID_X_Y(8, 0) 389 + RAZWI_INITIATOR_ID_X_Y(8, 1) 390 390 #define RAZWI_INITIATOR_ID_X_Y_DMA_IF_W_S_0 RAZWI_INITIATOR_ID_X_Y(0, 1) 391 391 #define RAZWI_INITIATOR_ID_X_Y_DMA_IF_E_S_0 RAZWI_INITIATOR_ID_X_Y(9, 1) 392 392 #define RAZWI_INITIATOR_ID_X_Y_DMA_IF_W_S_1 RAZWI_INITIATOR_ID_X_Y(0, 2) ··· 395 395 #define RAZWI_INITIATOR_ID_X_Y_DMA_IF_E_N_0 RAZWI_INITIATOR_ID_X_Y(9, 3) 396 396 #define RAZWI_INITIATOR_ID_X_Y_DMA_IF_W_N_1 RAZWI_INITIATOR_ID_X_Y(0, 4) 397 397 #define RAZWI_INITIATOR_ID_X_Y_DMA_IF_E_N_1 RAZWI_INITIATOR_ID_X_Y(9, 4) 398 - #define RAZWI_INITIATOR_ID_X_Y_TPC4_NIC1_NIC2 RAZWI_INITIATOR_ID_X_Y(1, 5) 399 - #define RAZWI_INITIATOR_ID_X_Y_TPC5 RAZWI_INITIATOR_ID_X_Y(2, 5) 400 - #define RAZWI_INITIATOR_ID_X_Y_MME2_0 RAZWI_INITIATOR_ID_X_Y(3, 5) 401 - #define RAZWI_INITIATOR_ID_X_Y_MME2_1 RAZWI_INITIATOR_ID_X_Y(4, 5) 402 - #define RAZWI_INITIATOR_ID_X_Y_MME3_0 RAZWI_INITIATOR_ID_X_Y(5, 5) 403 - #define RAZWI_INITIATOR_ID_X_Y_MME3_1 RAZWI_INITIATOR_ID_X_Y(6, 5) 404 - #define RAZWI_INITIATOR_ID_X_Y_TPC6 RAZWI_INITIATOR_ID_X_Y(7, 5) 405 - #define RAZWI_INITIATOR_ID_X_Y_TPC7_NIC4_NIC5 RAZWI_INITIATOR_ID_X_Y(8, 5) 398 + #define RAZWI_INITIATOR_ID_X_Y_TPC4_NIC1_NIC2 RAZWI_INITIATOR_ID_X_Y(1, 6) 399 + #define RAZWI_INITIATOR_ID_X_Y_TPC5 RAZWI_INITIATOR_ID_X_Y(2, 6) 400 + #define RAZWI_INITIATOR_ID_X_Y_MME2_0 RAZWI_INITIATOR_ID_X_Y(3, 6) 401 + #define RAZWI_INITIATOR_ID_X_Y_MME2_1 RAZWI_INITIATOR_ID_X_Y(4, 6) 402 + #define RAZWI_INITIATOR_ID_X_Y_MME3_0 RAZWI_INITIATOR_ID_X_Y(5, 6) 403 + #define RAZWI_INITIATOR_ID_X_Y_MME3_1 RAZWI_INITIATOR_ID_X_Y(6, 6) 404 + #define RAZWI_INITIATOR_ID_X_Y_TPC6 RAZWI_INITIATOR_ID_X_Y(7, 6) 405 + #define RAZWI_INITIATOR_ID_X_Y_TPC7_NIC4_NIC5 RAZWI_INITIATOR_ID_X_Y(8, 6) 406 406 407 407 #define PSOC_ETR_AXICTL_PROTCTRLBIT1_SHIFT 1 408 408
+2 -3
drivers/phy/qualcomm/phy-qcom-ipq806x-usb.c
··· 505 505 size = resource_size(res); 506 506 phy_dwc3->base = devm_ioremap(phy_dwc3->dev, res->start, size); 507 507 508 - if (IS_ERR(phy_dwc3->base)) { 508 + if (!phy_dwc3->base) { 509 509 dev_err(phy_dwc3->dev, "failed to map reg\n"); 510 - return PTR_ERR(phy_dwc3->base); 510 + return -ENOMEM; 511 511 } 512 512 513 513 phy_dwc3->ref_clk = devm_clk_get(phy_dwc3->dev, "ref"); ··· 557 557 .probe = qcom_ipq806x_usb_phy_probe, 558 558 .driver = { 559 559 .name = "qcom-ipq806x-usb-phy", 560 - .owner = THIS_MODULE, 561 560 .of_match_table = qcom_ipq806x_usb_phy_table, 562 561 }, 563 562 };
+9 -7
drivers/phy/qualcomm/phy-qcom-qmp.c
··· 604 604 QMP_PHY_INIT_CFG(QSERDES_COM_BG_TRIM, 0xf), 605 605 QMP_PHY_INIT_CFG(QSERDES_COM_LOCK_CMP_EN, 0x1), 606 606 QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_MAP, 0x0), 607 - QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER1, 0x1f), 608 - QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER2, 0x3f), 607 + QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER1, 0xff), 608 + QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER2, 0x1f), 609 609 QMP_PHY_INIT_CFG(QSERDES_COM_CMN_CONFIG, 0x6), 610 610 QMP_PHY_INIT_CFG(QSERDES_COM_PLL_IVCO, 0xf), 611 611 QMP_PHY_INIT_CFG(QSERDES_COM_HSCLK_SEL, 0x0), ··· 631 631 QMP_PHY_INIT_CFG(QSERDES_COM_INTEGLOOP_GAIN1_MODE0, 0x0), 632 632 QMP_PHY_INIT_CFG(QSERDES_COM_INTEGLOOP_GAIN0_MODE0, 0x80), 633 633 QMP_PHY_INIT_CFG(QSERDES_COM_BIAS_EN_CTRL_BY_PSM, 0x1), 634 - QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_CTRL, 0xa), 635 634 QMP_PHY_INIT_CFG(QSERDES_COM_SSC_EN_CENTER, 0x1), 636 635 QMP_PHY_INIT_CFG(QSERDES_COM_SSC_PER1, 0x31), 637 636 QMP_PHY_INIT_CFG(QSERDES_COM_SSC_PER2, 0x1), ··· 639 640 QMP_PHY_INIT_CFG(QSERDES_COM_SSC_STEP_SIZE1, 0x2f), 640 641 QMP_PHY_INIT_CFG(QSERDES_COM_SSC_STEP_SIZE2, 0x19), 641 642 QMP_PHY_INIT_CFG(QSERDES_COM_CLK_EP_DIV, 0x19), 642 - QMP_PHY_INIT_CFG(QSERDES_RX_SIGDET_CNTRL, 0x7), 643 643 }; 644 644 645 645 static const struct qmp_phy_init_tbl ipq8074_pcie_tx_tbl[] = { ··· 646 648 QMP_PHY_INIT_CFG(QSERDES_TX_LANE_MODE, 0x6), 647 649 QMP_PHY_INIT_CFG(QSERDES_TX_RES_CODE_LANE_OFFSET, 0x2), 648 650 QMP_PHY_INIT_CFG(QSERDES_TX_RCV_DETECT_LVL_2, 0x12), 651 + QMP_PHY_INIT_CFG(QSERDES_TX_EMP_POST1_LVL, 0x36), 652 + QMP_PHY_INIT_CFG(QSERDES_TX_SLEW_CNTL, 0x0a), 649 653 }; 650 654 651 655 static const struct qmp_phy_init_tbl ipq8074_pcie_rx_tbl[] = { ··· 658 658 QMP_PHY_INIT_CFG(QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4, 0xdb), 659 659 QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x4b), 660 660 QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_GAIN, 0x4), 661 - QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_GAIN_HALF, 0x4), 662 661 }; 663 662 664 663 static const struct qmp_phy_init_tbl ipq8074_pcie_pcs_tbl[] = { ··· 2045 2046 .pwrdn_ctrl = SW_PWRDN, 2046 2047 }; 2047 2048 2049 + static const char * const ipq8074_pciephy_clk_l[] = { 2050 + "aux", "cfg_ahb", 2051 + }; 2048 2052 /* list of resets */ 2049 2053 static const char * const ipq8074_pciephy_reset_l[] = { 2050 2054 "phy", "common", ··· 2065 2063 .rx_tbl_num = ARRAY_SIZE(ipq8074_pcie_rx_tbl), 2066 2064 .pcs_tbl = ipq8074_pcie_pcs_tbl, 2067 2065 .pcs_tbl_num = ARRAY_SIZE(ipq8074_pcie_pcs_tbl), 2068 - .clk_list = NULL, 2069 - .num_clks = 0, 2066 + .clk_list = ipq8074_pciephy_clk_l, 2067 + .num_clks = ARRAY_SIZE(ipq8074_pciephy_clk_l), 2070 2068 .reset_list = ipq8074_pciephy_reset_l, 2071 2069 .num_resets = ARRAY_SIZE(ipq8074_pciephy_reset_l), 2072 2070 .vreg_list = NULL,
+2
drivers/phy/qualcomm/phy-qcom-qmp.h
··· 77 77 #define QSERDES_COM_CORECLK_DIV_MODE1 0x1bc 78 78 79 79 /* Only for QMP V2 PHY - TX registers */ 80 + #define QSERDES_TX_EMP_POST1_LVL 0x018 81 + #define QSERDES_TX_SLEW_CNTL 0x040 80 82 #define QSERDES_TX_RES_CODE_LANE_OFFSET 0x054 81 83 #define QSERDES_TX_DEBUG_BUS_SEL 0x064 82 84 #define QSERDES_TX_HIGHZ_TRANSCEIVEREN_BIAS_DRVR_EN 0x068
+40 -7
drivers/phy/ti/phy-omap-usb2.c
··· 22 22 #include <linux/mfd/syscon.h> 23 23 #include <linux/regmap.h> 24 24 #include <linux/of_platform.h> 25 + #include <linux/sys_soc.h> 25 26 26 27 #define USB2PHY_ANA_CONFIG1 0x4c 27 28 #define USB2PHY_DISCON_BYP_LATCH BIT(31) 29 + 30 + #define USB2PHY_CHRG_DET 0x14 31 + #define USB2PHY_CHRG_DET_USE_CHG_DET_REG BIT(29) 32 + #define USB2PHY_CHRG_DET_DIS_CHG_DET BIT(28) 28 33 29 34 /* SoC Specific USB2_OTG register definitions */ 30 35 #define AM654_USB2_OTG_PD BIT(8) ··· 48 43 #define OMAP_USB2_HAS_START_SRP BIT(0) 49 44 #define OMAP_USB2_HAS_SET_VBUS BIT(1) 50 45 #define OMAP_USB2_CALIBRATE_FALSE_DISCONNECT BIT(2) 46 + #define OMAP_USB2_DISABLE_CHRG_DET BIT(3) 51 47 52 48 struct omap_usb { 53 49 struct usb_phy phy; ··· 242 236 omap_usb_writel(phy->phy_base, USB2PHY_ANA_CONFIG1, val); 243 237 } 244 238 239 + if (phy->flags & OMAP_USB2_DISABLE_CHRG_DET) { 240 + val = omap_usb_readl(phy->phy_base, USB2PHY_CHRG_DET); 241 + val |= USB2PHY_CHRG_DET_USE_CHG_DET_REG | 242 + USB2PHY_CHRG_DET_DIS_CHG_DET; 243 + omap_usb_writel(phy->phy_base, USB2PHY_CHRG_DET, val); 244 + } 245 + 245 246 return 0; 246 247 } 247 248 ··· 342 329 }; 343 330 MODULE_DEVICE_TABLE(of, omap_usb2_id_table); 344 331 332 + static void omap_usb2_init_errata(struct omap_usb *phy) 333 + { 334 + static const struct soc_device_attribute am65x_sr10_soc_devices[] = { 335 + { .family = "AM65X", .revision = "SR1.0" }, 336 + { /* sentinel */ } 337 + }; 338 + 339 + /* 340 + * Errata i2075: USB2PHY: USB2PHY Charger Detect is Enabled by 341 + * Default Without VBUS Presence. 342 + * 343 + * AM654x SR1.0 has a silicon bug due to which D+ is pulled high after 344 + * POR, which could cause enumeration failure with some USB hubs. 345 + * Disabling the USB2_PHY Charger Detect function will put D+ 346 + * into the normal state. 347 + */ 348 + if (soc_device_match(am65x_sr10_soc_devices)) 349 + phy->flags |= OMAP_USB2_DISABLE_CHRG_DET; 350 + } 351 + 345 352 static int omap_usb2_probe(struct platform_device *pdev) 346 353 { 347 354 struct omap_usb *phy; ··· 399 366 phy->mask = phy_data->mask; 400 367 phy->power_on = phy_data->power_on; 401 368 phy->power_off = phy_data->power_off; 369 + phy->flags = phy_data->flags; 402 370 403 - if (phy_data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) { 404 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 405 - phy->phy_base = devm_ioremap_resource(&pdev->dev, res); 406 - if (IS_ERR(phy->phy_base)) 407 - return PTR_ERR(phy->phy_base); 408 - phy->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT; 409 - } 371 + omap_usb2_init_errata(phy); 372 + 373 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 374 + phy->phy_base = devm_ioremap_resource(&pdev->dev, res); 375 + if (IS_ERR(phy->phy_base)) 376 + return PTR_ERR(phy->phy_base); 410 377 411 378 phy->syscon_phy_power = syscon_regmap_lookup_by_phandle(node, 412 379 "syscon-phy-power");
+1 -1
drivers/soundwire/bus.c
··· 1372 1372 return ret; 1373 1373 } 1374 1374 1375 - /* Read Instat 1, Instat 2 and Instat 3 registers */ 1375 + /* Read Intstat 1, Intstat 2 and Intstat 3 registers */ 1376 1376 ret = sdw_read(slave, SDW_SCP_INT1); 1377 1377 if (ret < 0) { 1378 1378 dev_err(slave->bus->dev,
+5 -3
drivers/soundwire/stream.c
··· 717 717 kfree(wbuf); 718 718 error_1: 719 719 kfree(wr_msg); 720 + bus->defer_msg.msg = NULL; 720 721 return ret; 721 722 } 722 723 ··· 841 840 error: 842 841 list_for_each_entry(m_rt, &stream->master_list, stream_node) { 843 842 bus = m_rt->bus; 844 - 845 - kfree(bus->defer_msg.msg->buf); 846 - kfree(bus->defer_msg.msg); 843 + if (bus->defer_msg.msg) { 844 + kfree(bus->defer_msg.msg->buf); 845 + kfree(bus->defer_msg.msg); 846 + } 847 847 } 848 848 849 849 msg_unlock:
+1 -1
drivers/video/fbdev/vga16fb.c
··· 1121 1121 char oldop = setop(0); 1122 1122 char oldsr = setsr(0); 1123 1123 char oldmask = selectmask(); 1124 - const char *cdat = image->data; 1124 + const unsigned char *cdat = image->data; 1125 1125 u32 dx = image->dx; 1126 1126 char __iomem *where; 1127 1127 int y;
+16 -4
include/linux/dynamic_debug.h
··· 49 49 50 50 51 51 #if defined(CONFIG_DYNAMIC_DEBUG_CORE) 52 + 53 + /* exported for module authors to exercise >control */ 54 + int dynamic_debug_exec_queries(const char *query, const char *modname); 55 + 52 56 int ddebug_add_module(struct _ddebug *tab, unsigned int n, 53 57 const char *modname); 54 58 extern int ddebug_remove_module(const char *mod_name); ··· 109 105 static_branch_unlikely(&descriptor.key.dd_key_false) 110 106 #endif 111 107 112 - #else /* !HAVE_JUMP_LABEL */ 108 + #else /* !CONFIG_JUMP_LABEL */ 113 109 114 110 #define _DPRINTK_KEY_INIT 115 111 ··· 121 117 unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) 122 118 #endif 123 119 124 - #endif 120 + #endif /* CONFIG_JUMP_LABEL */ 125 121 126 122 #define __dynamic_func_call(id, fmt, func, ...) do { \ 127 123 DEFINE_DYNAMIC_DEBUG_METADATA(id, fmt); \ ··· 176 172 KERN_DEBUG, prefix_str, prefix_type, \ 177 173 rowsize, groupsize, buf, len, ascii) 178 174 179 - #else 175 + #else /* !CONFIG_DYNAMIC_DEBUG_CORE */ 180 176 181 177 #include <linux/string.h> 182 178 #include <linux/errno.h> 179 + #include <linux/printk.h> 183 180 184 181 static inline int ddebug_add_module(struct _ddebug *tab, unsigned int n, 185 182 const char *modname) ··· 215 210 print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, \ 216 211 rowsize, groupsize, buf, len, ascii); \ 217 212 } while (0) 218 - #endif 213 + 214 + static inline int dynamic_debug_exec_queries(const char *query, const char *modname) 215 + { 216 + pr_warn("kernel not built with CONFIG_DYNAMIC_DEBUG_CORE\n"); 217 + return 0; 218 + } 219 + 220 + #endif /* !CONFIG_DYNAMIC_DEBUG_CORE */ 219 221 220 222 #endif
+46 -36
lib/dynamic_debug.c
··· 353 353 354 354 /* 355 355 * Parse words[] as a ddebug query specification, which is a series 356 - * of (keyword, value) pairs or combined keyword=value terms, 357 - * chosen from these possibilities: 356 + * of (keyword, value) pairs chosen from these possibilities: 358 357 * 359 358 * func <function-name> 360 359 * file <full-pathname> ··· 372 373 unsigned int i; 373 374 int rc = 0; 374 375 char *fline; 375 - char *keyword, *arg; 376 + 377 + /* check we have an even number of words */ 378 + if (nwords % 2 != 0) { 379 + pr_err("expecting pairs of match-spec <value>\n"); 380 + return -EINVAL; 381 + } 376 382 377 383 if (modname) 378 384 /* support $modname.dyndbg=<multiple queries> */ 379 385 query->module = modname; 380 386 381 - for (i = 0; i < nwords; i++) { 382 - /* accept keyword=arg */ 383 - vpr_info("%d w:%s\n", i, words[i]); 384 - 385 - keyword = words[i]; 386 - arg = strchr(keyword, '='); 387 - if (arg) { 388 - *arg++ = '\0'; 389 - } else { 390 - i++; /* next word is arg */ 391 - if (!(i < nwords)) { 392 - pr_err("missing arg to keyword: %s\n", keyword); 393 - return -EINVAL; 394 - } 395 - arg = words[i]; 396 - } 397 - vpr_info("%d key:%s arg:%s\n", i, keyword, arg); 398 - 399 - if (!strcmp(keyword, "func")) { 400 - rc = check_set(&query->function, arg, "func"); 401 - } else if (!strcmp(keyword, "file")) { 402 - if (check_set(&query->filename, arg, "file")) 387 + for (i = 0; i < nwords; i += 2) { 388 + if (!strcmp(words[i], "func")) { 389 + rc = check_set(&query->function, words[i+1], "func"); 390 + } else if (!strcmp(words[i], "file")) { 391 + if (check_set(&query->filename, words[i+1], "file")) 403 392 return -EINVAL; 404 393 405 394 /* tail :$info is function or line-range */ ··· 403 416 if (parse_linerange(query, fline)) 404 417 return -EINVAL; 405 418 } 406 - } else if (!strcmp(keyword, "module")) { 407 - rc = check_set(&query->module, arg, "module"); 408 - } else if (!strcmp(keyword, "format")) { 409 - string_unescape_inplace(arg, UNESCAPE_SPACE | 419 + } else if (!strcmp(words[i], "module")) { 420 + rc = check_set(&query->module, words[i+1], "module"); 421 + } else if (!strcmp(words[i], "format")) { 422 + string_unescape_inplace(words[i+1], UNESCAPE_SPACE | 410 423 UNESCAPE_OCTAL | 411 424 UNESCAPE_SPECIAL); 412 - rc = check_set(&query->format, arg, "format"); 413 - } else if (!strcmp(keyword, "line")) { 414 - if (parse_linerange(query, arg)) 425 + rc = check_set(&query->format, words[i+1], "format"); 426 + } else if (!strcmp(words[i], "line")) { 427 + if (parse_linerange(query, words[i+1])) 415 428 return -EINVAL; 416 429 } else { 417 - pr_err("unknown keyword \"%s\"\n", keyword); 430 + pr_err("unknown keyword \"%s\"\n", words[i]); 418 431 return -EINVAL; 419 432 } 420 433 if (rc) ··· 512 525 last error or number of matching callsites. Module name is either 513 526 in param (for boot arg) or perhaps in query string. 514 527 */ 515 - int ddebug_exec_queries(char *query, const char *modname) 528 + static int ddebug_exec_queries(char *query, const char *modname) 516 529 { 517 530 char *split; 518 531 int i, errs = 0, exitcode = 0, rc, nfound = 0; ··· 544 557 return exitcode; 545 558 return nfound; 546 559 } 547 - EXPORT_SYMBOL_GPL(ddebug_exec_queries); 560 + 561 + /** 562 + * dynamic_debug_exec_queries - select and change dynamic-debug prints 563 + * @query: query-string described in admin-guide/dynamic-debug-howto 564 + * @modname: string containing module name, usually &module.mod_name 565 + * 566 + * This uses the >/proc/dynamic_debug/control reader, allowing module 567 + * authors to modify their dynamic-debug callsites. The modname is 568 + * canonically struct module.mod_name, but can also be null or a 569 + * module-wildcard, for example: "drm*". 570 + */ 571 + int dynamic_debug_exec_queries(const char *query, const char *modname) 572 + { 573 + int rc; 574 + char *qry = kstrndup(query, PAGE_SIZE, GFP_KERNEL); 575 + 576 + if (!query) 577 + return -ENOMEM; 578 + 579 + rc = ddebug_exec_queries(qry, modname); 580 + kfree(qry); 581 + return rc; 582 + } 583 + EXPORT_SYMBOL_GPL(dynamic_debug_exec_queries); 548 584 549 585 #define PREFIX_SIZE 64 550 586 ··· 957 947 list_add(&dt->link, &ddebug_tables); 958 948 mutex_unlock(&ddebug_lock); 959 949 960 - v2pr_info("%u debug prints in module %s\n", n, dt->mod_name); 950 + v2pr_info("%3u debug prints in module %s\n", n, dt->mod_name); 961 951 return 0; 962 952 } 963 953
+6 -2
scripts/tags.sh
··· 26 26 fi 27 27 28 28 # ignore userspace tools 29 - ignore="$ignore ( -path ${tree}tools ) -prune -o" 29 + if [ -n "$COMPILED_SOURCE" ]; then 30 + ignore="$ignore ( -path ./tools ) -prune -o" 31 + else 32 + ignore="$ignore ( -path ${tree}tools ) -prune -o" 33 + fi 30 34 31 35 # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH 32 36 if [ "${ALLSOURCE_ARCHS}" = "" ]; then ··· 96 92 all_compiled_sources() 97 93 { 98 94 realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) \ 99 - include/generated/autoconf.h $(find -name "*.cmd" -exec \ 95 + include/generated/autoconf.h $(find $ignore -name "*.cmd" -exec \ 100 96 grep -Poh '(?(?=^source_.* \K).*|(?=^ \K\S).*(?= \\))' {} \+ | 101 97 awk '!a[$0]++') | sort -u 102 98 }