* [PATCH v1 0/1] gpio: tegra: Convert to immutable irq chip @ 2022-09-22 10:03 Svyatoslav Ryhel 2022-09-22 10:03 ` [PATCH v1 1/1] " Svyatoslav Ryhel 0 siblings, 1 reply; 3+ messages in thread From: Svyatoslav Ryhel @ 2022-09-22 10:03 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Thierry Reding, Jonathan Hunter, Dmitry Osipenko Cc: linux-gpio, linux-tegra, linux-kernel This patch updates gpio-tegra to use an immutable IRQ chip for all tegra just like it was made before on t186. Svyatoslav Ryhel (1): gpio: tegra: Convert to immutable irq chip drivers/gpio/gpio-tegra.c | 56 ++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 16 deletions(-) -- 2.34.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v1 1/1] gpio: tegra: Convert to immutable irq chip 2022-09-22 10:03 [PATCH v1 0/1] gpio: tegra: Convert to immutable irq chip Svyatoslav Ryhel @ 2022-09-22 10:03 ` Svyatoslav Ryhel 2022-09-23 10:17 ` kernel test robot 0 siblings, 1 reply; 3+ messages in thread From: Svyatoslav Ryhel @ 2022-09-22 10:03 UTC (permalink / raw) To: Linus Walleij, Bartosz Golaszewski, Thierry Reding, Jonathan Hunter, Dmitry Osipenko Cc: linux-gpio, linux-tegra, linux-kernel Update the driver to use an immutable IRQ chip to fix this warning: "not an immutable chip, please consider fixing it!" Preserve per-chip labels by adding an ->irq_print_chip() callback. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> --- drivers/gpio/gpio-tegra.c | 56 ++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index e4fb4cb38a0f..6b469253fad8 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -18,6 +18,7 @@ #include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/module.h> +#include <linux/seq_file.h> #include <linux/irqdomain.h> #include <linux/irqchip/chained_irq.h> #include <linux/pinctrl/consumer.h> @@ -94,7 +95,6 @@ struct tegra_gpio_info { struct tegra_gpio_bank *bank_info; const struct tegra_gpio_soc_config *soc; struct gpio_chip gc; - struct irq_chip ic; u32 bank_count; unsigned int *irqs; }; @@ -288,6 +288,7 @@ static void tegra_gpio_irq_mask(struct irq_data *d) unsigned int gpio = d->hwirq; tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 0); + gpiochip_disable_irq(chip, gpio); } static void tegra_gpio_irq_unmask(struct irq_data *d) @@ -296,6 +297,7 @@ static void tegra_gpio_irq_unmask(struct irq_data *d) struct tegra_gpio_info *tgi = gpiochip_get_data(chip); unsigned int gpio = d->hwirq; + gpiochip_enable_irq(chip, gpio); tegra_gpio_mask_write(tgi, GPIO_MSK_INT_ENB(tgi, gpio), gpio, 1); } @@ -598,10 +600,43 @@ static void tegra_gpio_irq_release_resources(struct irq_data *d) tegra_gpio_enable(tgi, d->hwirq); } +static void tegra_gpio_irq_print_chip(struct irq_data *d, struct seq_file *s) +{ + struct gpio_chip *chip = irq_data_get_irq_chip_data(d); + + seq_printf(s, dev_name(chip->parent)); +} + +static const struct irq_chip tegra_gpio_irq_chip = { + .irq_shutdown = tegra_gpio_irq_shutdown, + .irq_ack = tegra_gpio_irq_ack, + .irq_mask = tegra_gpio_irq_mask, + .irq_unmask = tegra_gpio_irq_unmask, + .irq_set_type = tegra_gpio_irq_set_type, + .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake), + .irq_print_chip = tegra_gpio_irq_print_chip, + .irq_request_resources = tegra_gpio_irq_request_resources, + .irq_release_resources = tegra_gpio_irq_release_resources, + .flags = IRQCHIP_IMMUTABLE, +}; + +static const struct irq_chip tegra210_gpio_irq_chip = { + .irq_shutdown = tegra_gpio_irq_shutdown, + .irq_ack = tegra_gpio_irq_ack, + .irq_mask = tegra_gpio_irq_mask, + .irq_unmask = tegra_gpio_irq_unmask, + .irq_set_affinity = tegra_gpio_irq_set_affinity, + .irq_set_type = tegra_gpio_irq_set_type, + .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake), + .irq_print_chip = tegra_gpio_irq_print_chip, + .irq_request_resources = tegra_gpio_irq_request_resources, + .irq_release_resources = tegra_gpio_irq_release_resources, + .flags = IRQCHIP_IMMUTABLE, +}; + #ifdef CONFIG_DEBUG_FS #include <linux/debugfs.h> -#include <linux/seq_file.h> static int tegra_dbg_gpio_show(struct seq_file *s, void *unused) { @@ -689,18 +724,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) tgi->gc.ngpio = tgi->bank_count * 32; tgi->gc.parent = &pdev->dev; - tgi->ic.name = "GPIO"; - tgi->ic.irq_ack = tegra_gpio_irq_ack; - tgi->ic.irq_mask = tegra_gpio_irq_mask; - tgi->ic.irq_unmask = tegra_gpio_irq_unmask; - tgi->ic.irq_set_type = tegra_gpio_irq_set_type; - tgi->ic.irq_shutdown = tegra_gpio_irq_shutdown; -#ifdef CONFIG_PM_SLEEP - tgi->ic.irq_set_wake = tegra_gpio_irq_set_wake; -#endif - tgi->ic.irq_request_resources = tegra_gpio_irq_request_resources; - tgi->ic.irq_release_resources = tegra_gpio_irq_release_resources; - platform_set_drvdata(pdev, tgi); if (tgi->soc->debounce_supported) @@ -733,7 +756,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) } irq = &tgi->gc.irq; - irq->chip = &tgi->ic; irq->fwnode = of_node_to_fwnode(pdev->dev.of_node); irq->child_to_parent_hwirq = tegra_gpio_child_to_parent_hwirq; irq->populate_parent_alloc_arg = tegra_gpio_populate_parent_fwspec; @@ -752,7 +774,9 @@ static int tegra_gpio_probe(struct platform_device *pdev) if (!irq->parent_domain) return -EPROBE_DEFER; - tgi->ic.irq_set_affinity = tegra_gpio_irq_set_affinity; + gpio_irq_chip_set_chip(irq, &tegra210_gpio_irq_chip); + } else { + gpio_irq_chip_set_chip(irq, &tegra_gpio_irq_chip); } tgi->regs = devm_platform_ioremap_resource(pdev, 0); -- 2.34.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] gpio: tegra: Convert to immutable irq chip 2022-09-22 10:03 ` [PATCH v1 1/1] " Svyatoslav Ryhel @ 2022-09-23 10:17 ` kernel test robot 0 siblings, 0 replies; 3+ messages in thread From: kernel test robot @ 2022-09-23 10:17 UTC (permalink / raw) To: Svyatoslav Ryhel, Linus Walleij, Bartosz Golaszewski, Thierry Reding, Jonathan Hunter, Dmitry Osipenko Cc: llvm, kbuild-all, linux-gpio, linux-tegra, linux-kernel Hi Svyatoslav, Thank you for the patch! Yet something to improve: [auto build test ERROR on tegra/for-next] [also build test ERROR on brgl/gpio/for-next tegra-drm/drm/tegra/for-next linus/master v6.0-rc6 next-20220921] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Svyatoslav-Ryhel/gpio-tegra-Convert-to-immutable-irq-chip/20220922-180544 base: https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next config: arm64-randconfig-r013-20220922 (https://download.01.org/0day-ci/archive/20220923/202209231809.KsxZvnZk-lkp@intel.com/config) compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://github.com/intel-lab-lkp/linux/commit/11723f8236100feb12775c232d66668969dde7fc git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Svyatoslav-Ryhel/gpio-tegra-Convert-to-immutable-irq-chip/20220922-180544 git checkout 11723f8236100feb12775c232d66668969dde7fc # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpio/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): >> drivers/gpio/gpio-tegra.c:616:32: error: use of undeclared identifier 'tegra_gpio_irq_set_wake'; did you mean 'tegra_gpio_irq_set_type'? .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake), ^~~~~~~~~~~~~~~~~~~~~~~ tegra_gpio_irq_set_type include/linux/pm.h:439:65: note: expanded from macro 'pm_sleep_ptr' #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr)) ^ include/linux/kernel.h:57:38: note: expanded from macro 'PTR_IF' #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL) ^ drivers/gpio/gpio-tegra.c:304:12: note: 'tegra_gpio_irq_set_type' declared here static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) ^ drivers/gpio/gpio-tegra.c:630:32: error: use of undeclared identifier 'tegra_gpio_irq_set_wake'; did you mean 'tegra_gpio_irq_set_type'? .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake), ^~~~~~~~~~~~~~~~~~~~~~~ tegra_gpio_irq_set_type include/linux/pm.h:439:65: note: expanded from macro 'pm_sleep_ptr' #define pm_sleep_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM_SLEEP), (_ptr)) ^ include/linux/kernel.h:57:38: note: expanded from macro 'PTR_IF' #define PTR_IF(cond, ptr) ((cond) ? (ptr) : NULL) ^ drivers/gpio/gpio-tegra.c:304:12: note: 'tegra_gpio_irq_set_type' declared here static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) ^ 2 errors generated. vim +616 drivers/gpio/gpio-tegra.c 609 610 static const struct irq_chip tegra_gpio_irq_chip = { 611 .irq_shutdown = tegra_gpio_irq_shutdown, 612 .irq_ack = tegra_gpio_irq_ack, 613 .irq_mask = tegra_gpio_irq_mask, 614 .irq_unmask = tegra_gpio_irq_unmask, 615 .irq_set_type = tegra_gpio_irq_set_type, > 616 .irq_set_wake = pm_sleep_ptr(tegra_gpio_irq_set_wake), 617 .irq_print_chip = tegra_gpio_irq_print_chip, 618 .irq_request_resources = tegra_gpio_irq_request_resources, 619 .irq_release_resources = tegra_gpio_irq_release_resources, 620 .flags = IRQCHIP_IMMUTABLE, 621 }; 622 -- 0-DAY CI Kernel Test Service https://01.org/lkp ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-23 10:17 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-09-22 10:03 [PATCH v1 0/1] gpio: tegra: Convert to immutable irq chip Svyatoslav Ryhel 2022-09-22 10:03 ` [PATCH v1 1/1] " Svyatoslav Ryhel 2022-09-23 10:17 ` kernel test robot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).