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

Merge tag 'for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux

Pull hte/timestamp updates from Dipen Patel:

- Improve comments in the translate function

- Reflect the GPIOLIB API changes during calculation of the GPIO base

- Improve error handling in Tegra test and provider drivers

- Improve code to set the line name

* tag 'for-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux:
hte: Use kasprintf() instead of fixed buffer formatting
hte: tegra: Fix missing error code in tegra_hte_test_probe()
hte: tegra194: Switch to LATE_SIMPLE_DEV_PM_OPS()
hte: tegra194: Remove redundant dev_err()
hte: tegra194: improve the GPIO-related comment
hte: allow building modules with COMPILE_TEST enabled
hte: Annotate struct hte_device with __counted_by

+23 -26
+2 -2
drivers/hte/Kconfig
··· 16 16 17 17 config HTE_TEGRA194 18 18 tristate "NVIDIA Tegra194 HTE Support" 19 - depends on ARCH_TEGRA_194_SOC 19 + depends on (ARCH_TEGRA_194_SOC || COMPILE_TEST) 20 20 depends on GPIOLIB 21 21 help 22 22 Enable this option for integrated hardware timestamping engine also ··· 26 26 27 27 config HTE_TEGRA194_TEST 28 28 tristate "NVIDIA Tegra194 HTE Test" 29 - depends on HTE_TEGRA194 29 + depends on (HTE_TEGRA194 || COMPILE_TEST) 30 30 help 31 31 The NVIDIA Tegra194 GTE test driver demonstrates how to use HTE 32 32 framework to timestamp GPIO and LIC IRQ lines.
+3 -1
drivers/hte/hte-tegra194-test.c
··· 153 153 } 154 154 155 155 cnt = of_hte_req_count(hte.pdev); 156 - if (cnt < 0) 156 + if (cnt < 0) { 157 + ret = cnt; 157 158 goto free_irq; 159 + } 158 160 159 161 dev_info(&pdev->dev, "Total requested lines:%d\n", cnt); 160 162
+13 -13
drivers/hte/hte-tegra194.c
··· 407 407 return -EINVAL; 408 408 409 409 /* 410 + * GPIO consumers can access GPIOs in two ways: 410 411 * 411 - * There are two paths GPIO consumers can take as follows: 412 - * 1) The consumer (gpiolib-cdev for example) which uses GPIO global 413 - * number which gets assigned run time. 414 - * 2) The consumer passing GPIO from the DT which is assigned 415 - * statically for example by using TEGRA194_AON_GPIO gpio DT binding. 412 + * 1) Using the global GPIO numberspace. 413 + * 414 + * This is the old, now DEPRECATED method and should not be used in 415 + * new code. TODO: Check if tegra is even concerned by this. 416 + * 417 + * 2) Using GPIO descriptors that can be assigned to consumer devices 418 + * using device-tree, ACPI or lookup tables. 416 419 * 417 420 * The code below addresses both the consumer use cases and maps into 418 421 * HTE/GTE namespace. ··· 728 725 return -ENOMEM; 729 726 730 727 ret = platform_get_irq(pdev, 0); 731 - if (ret < 0) { 732 - dev_err_probe(dev, ret, "failed to get irq\n"); 728 + if (ret < 0) 733 729 return ret; 734 - } 735 730 hte_dev->hte_irq = ret; 736 731 ret = devm_request_irq(dev, hte_dev->hte_irq, tegra_hte_isr, 0, 737 732 dev_name(dev), hte_dev); ··· 812 811 return 0; 813 812 } 814 813 815 - static int __maybe_unused tegra_hte_resume_early(struct device *dev) 814 + static int tegra_hte_resume_early(struct device *dev) 816 815 { 817 816 u32 i; 818 817 struct tegra_hte_soc *gs = dev_get_drvdata(dev); ··· 833 832 return 0; 834 833 } 835 834 836 - static int __maybe_unused tegra_hte_suspend_late(struct device *dev) 835 + static int tegra_hte_suspend_late(struct device *dev) 837 836 { 838 837 u32 i; 839 838 struct tegra_hte_soc *gs = dev_get_drvdata(dev); ··· 853 852 } 854 853 855 854 static const struct dev_pm_ops tegra_hte_pm = { 856 - SET_LATE_SYSTEM_SLEEP_PM_OPS(tegra_hte_suspend_late, 857 - tegra_hte_resume_early) 855 + LATE_SYSTEM_SLEEP_PM_OPS(tegra_hte_suspend_late, tegra_hte_resume_early) 858 856 }; 859 857 860 858 static struct platform_driver tegra_hte_driver = { 861 859 .probe = tegra_hte_probe, 862 860 .driver = { 863 861 .name = "tegra_hte", 864 - .pm = &tegra_hte_pm, 862 + .pm = pm_sleep_ptr(&tegra_hte_pm), 865 863 .of_match_table = tegra_hte_of_match, 866 864 }, 867 865 };
+5 -10
drivers/hte/hte.c
··· 17 17 #include <linux/debugfs.h> 18 18 #include <linux/device.h> 19 19 20 - #define HTE_TS_NAME_LEN 10 21 - 22 20 /* Global list of the HTE devices */ 23 21 static DEFINE_SPINLOCK(hte_lock); 24 22 static LIST_HEAD(hte_devices); ··· 86 88 struct list_head list; 87 89 struct hte_chip *chip; 88 90 struct module *owner; 89 - struct hte_ts_info ei[]; 91 + struct hte_ts_info ei[] __counted_by(nlines); 90 92 }; 91 93 92 94 #ifdef CONFIG_DEBUG_FS ··· 387 389 388 390 atomic_inc(&gdev->ts_req); 389 391 390 - ei->line_name = NULL; 391 - if (!desc->attr.name) { 392 - ei->line_name = kzalloc(HTE_TS_NAME_LEN, GFP_KERNEL); 393 - if (ei->line_name) 394 - scnprintf(ei->line_name, HTE_TS_NAME_LEN, "ts_%u", 395 - desc->attr.line_id); 396 - } 392 + if (desc->attr.name) 393 + ei->line_name = NULL; 394 + else 395 + ei->line_name = kasprintf(GFP_KERNEL, "ts_%u", desc->attr.line_id); 397 396 398 397 hte_ts_dbgfs_init(desc->attr.name == NULL ? 399 398 ei->line_name : desc->attr.name, ei);