From: kernel test robot <lkp@intel.com>
To: Dmitry Osipenko <digetx@gmail.com>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Viresh Kumar <vireshk@kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH v7 26/37] spi: tegra20-slink: Improve runtime PM usage
Date: Fri, 2 Jul 2021 16:29:10 +0800 [thread overview]
Message-ID: <202107021628.cUTzQbdR-lkp@intel.com> (raw)
In-Reply-To: <20210701232728.23591-27-digetx@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 13706 bytes --]
Hi Dmitry,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20210701]
[cannot apply to tegra/for-next robh/for-next tegra-drm/drm/tegra/for-next v5.13 v5.13-rc7 v5.13-rc6 v5.13]
[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]
url: https://github.com/0day-ci/linux/commits/Dmitry-Osipenko/NVIDIA-Tegra-power-management-patches-for-5-15/20210702-073048
base: fb0ca446157a86b75502c1636b0d81e642fe6bf1
config: x86_64-randconfig-b001-20210630 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9eb613b2de3163686b1a4bd1160f15ac56a4b083)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/eae252678e4ba361dc1513283e282268a7548af6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Dmitry-Osipenko/NVIDIA-Tegra-power-management-patches-for-5-15/20210702-073048
git checkout eae252678e4ba361dc1513283e282268a7548af6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/spi/spi-tegra20-slink.c:1076:6: warning: variable 'spi_irq' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (ret < 0)
^~~~~~~
drivers/spi/spi-tegra20-slink.c:1126:11: note: uninitialized use occurs here
free_irq(spi_irq, tspi);
^~~~~~~
drivers/spi/spi-tegra20-slink.c:1076:2: note: remove the 'if' if its condition is always false
if (ret < 0)
^~~~~~~~~~~~
drivers/spi/spi-tegra20-slink.c:1066:6: warning: variable 'spi_irq' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (IS_ERR(tspi->rst)) {
^~~~~~~~~~~~~~~~~
drivers/spi/spi-tegra20-slink.c:1126:11: note: uninitialized use occurs here
free_irq(spi_irq, tspi);
^~~~~~~
drivers/spi/spi-tegra20-slink.c:1066:2: note: remove the 'if' if its condition is always false
if (IS_ERR(tspi->rst)) {
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-tegra20-slink.c:1007:18: note: initialize the variable 'spi_irq' to silence this warning
int ret, spi_irq;
^
= 0
2 warnings generated.
vim +1076 drivers/spi/spi-tegra20-slink.c
dc4dc36056392c Laxman Dewangan 2012-10-30 1001
fd4a319bc933ae Grant Likely 2012-12-07 1002 static int tegra_slink_probe(struct platform_device *pdev)
dc4dc36056392c Laxman Dewangan 2012-10-30 1003 {
dc4dc36056392c Laxman Dewangan 2012-10-30 1004 struct spi_master *master;
dc4dc36056392c Laxman Dewangan 2012-10-30 1005 struct tegra_slink_data *tspi;
dc4dc36056392c Laxman Dewangan 2012-10-30 1006 struct resource *r;
dc4dc36056392c Laxman Dewangan 2012-10-30 1007 int ret, spi_irq;
dc4dc36056392c Laxman Dewangan 2012-10-30 1008 const struct tegra_slink_chip_data *cdata = NULL;
dc4dc36056392c Laxman Dewangan 2012-10-30 1009 const struct of_device_id *match;
dc4dc36056392c Laxman Dewangan 2012-10-30 1010
c60fea02141167 Stephen Warren 2013-02-15 1011 match = of_match_device(tegra_slink_of_match, &pdev->dev);
dc4dc36056392c Laxman Dewangan 2012-10-30 1012 if (!match) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1013 dev_err(&pdev->dev, "Error: No device match found\n");
dc4dc36056392c Laxman Dewangan 2012-10-30 1014 return -ENODEV;
dc4dc36056392c Laxman Dewangan 2012-10-30 1015 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1016 cdata = match->data;
dc4dc36056392c Laxman Dewangan 2012-10-30 1017
dc4dc36056392c Laxman Dewangan 2012-10-30 1018 master = spi_alloc_master(&pdev->dev, sizeof(*tspi));
dc4dc36056392c Laxman Dewangan 2012-10-30 1019 if (!master) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1020 dev_err(&pdev->dev, "master allocation failed\n");
dc4dc36056392c Laxman Dewangan 2012-10-30 1021 return -ENOMEM;
dc4dc36056392c Laxman Dewangan 2012-10-30 1022 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1023
dc4dc36056392c Laxman Dewangan 2012-10-30 1024 /* the spi->mode bits understood by this driver: */
dc4dc36056392c Laxman Dewangan 2012-10-30 1025 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
dc4dc36056392c Laxman Dewangan 2012-10-30 1026 master->setup = tegra_slink_setup;
63fc184cde2d77 Mark Brown 2013-10-05 1027 master->prepare_message = tegra_slink_prepare_message;
63fc184cde2d77 Mark Brown 2013-10-05 1028 master->transfer_one = tegra_slink_transfer_one;
63fc184cde2d77 Mark Brown 2013-10-05 1029 master->unprepare_message = tegra_slink_unprepare_message;
ce74ac80d25bcb Mark Brown 2013-07-28 1030 master->auto_runtime_pm = true;
dc4dc36056392c Laxman Dewangan 2012-10-30 1031 master->num_chipselect = MAX_CHIP_SELECT;
dc4dc36056392c Laxman Dewangan 2012-10-30 1032
24b5a82cf5709a Jingoo Han 2013-05-23 1033 platform_set_drvdata(pdev, master);
dc4dc36056392c Laxman Dewangan 2012-10-30 1034 tspi = spi_master_get_devdata(master);
dc4dc36056392c Laxman Dewangan 2012-10-30 1035 tspi->master = master;
dc4dc36056392c Laxman Dewangan 2012-10-30 1036 tspi->dev = &pdev->dev;
dc4dc36056392c Laxman Dewangan 2012-10-30 1037 tspi->chip_data = cdata;
dc4dc36056392c Laxman Dewangan 2012-10-30 1038 spin_lock_init(&tspi->lock);
dc4dc36056392c Laxman Dewangan 2012-10-30 1039
3c604de496d756 Axel Lin 2014-02-10 1040 if (of_property_read_u32(tspi->dev->of_node, "spi-max-frequency",
3c604de496d756 Axel Lin 2014-02-10 1041 &master->max_speed_hz))
3c604de496d756 Axel Lin 2014-02-10 1042 master->max_speed_hz = 25000000; /* 25MHz */
c60fea02141167 Stephen Warren 2013-02-15 1043
dc4dc36056392c Laxman Dewangan 2012-10-30 1044 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dc4dc36056392c Laxman Dewangan 2012-10-30 1045 if (!r) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1046 dev_err(&pdev->dev, "No IO memory resource\n");
dc4dc36056392c Laxman Dewangan 2012-10-30 1047 ret = -ENODEV;
dc4dc36056392c Laxman Dewangan 2012-10-30 1048 goto exit_free_master;
dc4dc36056392c Laxman Dewangan 2012-10-30 1049 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1050 tspi->phys = r->start;
b0ee5605234a24 Thierry Reding 2013-01-21 1051 tspi->base = devm_ioremap_resource(&pdev->dev, r);
b0ee5605234a24 Thierry Reding 2013-01-21 1052 if (IS_ERR(tspi->base)) {
b0ee5605234a24 Thierry Reding 2013-01-21 1053 ret = PTR_ERR(tspi->base);
dc4dc36056392c Laxman Dewangan 2012-10-30 1054 goto exit_free_master;
dc4dc36056392c Laxman Dewangan 2012-10-30 1055 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1056
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1057 /* disabled clock may cause interrupt storm upon request */
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1058 tspi->clk = devm_clk_get(&pdev->dev, NULL);
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1059 if (IS_ERR(tspi->clk)) {
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1060 ret = PTR_ERR(tspi->clk);
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1061 dev_err(&pdev->dev, "Can not get clock %d\n", ret);
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1062 goto exit_free_master;
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1063 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1064
73b32756cec312 Philipp Zabel 2017-07-19 1065 tspi->rst = devm_reset_control_get_exclusive(&pdev->dev, "spi");
ff2251e3de37b0 Stephen Warren 2013-11-06 1066 if (IS_ERR(tspi->rst)) {
ff2251e3de37b0 Stephen Warren 2013-11-06 1067 dev_err(&pdev->dev, "can not get reset\n");
ff2251e3de37b0 Stephen Warren 2013-11-06 1068 ret = PTR_ERR(tspi->rst);
ff2251e3de37b0 Stephen Warren 2013-11-06 1069 goto exit_free_irq;
ff2251e3de37b0 Stephen Warren 2013-11-06 1070 }
ff2251e3de37b0 Stephen Warren 2013-11-06 1071
dc4dc36056392c Laxman Dewangan 2012-10-30 1072 tspi->max_buf_size = SLINK_FIFO_DEPTH << 2;
dc4dc36056392c Laxman Dewangan 2012-10-30 1073 tspi->dma_buf_size = DEFAULT_SPI_DMA_BUF_LEN;
dc4dc36056392c Laxman Dewangan 2012-10-30 1074
dc4dc36056392c Laxman Dewangan 2012-10-30 1075 ret = tegra_slink_init_dma_param(tspi, true);
a915d150f68d8f Stephen Warren 2013-11-11 @1076 if (ret < 0)
dc4dc36056392c Laxman Dewangan 2012-10-30 1077 goto exit_free_irq;
dc4dc36056392c Laxman Dewangan 2012-10-30 1078 ret = tegra_slink_init_dma_param(tspi, false);
a915d150f68d8f Stephen Warren 2013-11-11 1079 if (ret < 0)
dc4dc36056392c Laxman Dewangan 2012-10-30 1080 goto exit_rx_dma_free;
dc4dc36056392c Laxman Dewangan 2012-10-30 1081 tspi->max_buf_size = tspi->dma_buf_size;
dc4dc36056392c Laxman Dewangan 2012-10-30 1082 init_completion(&tspi->tx_dma_complete);
dc4dc36056392c Laxman Dewangan 2012-10-30 1083 init_completion(&tspi->rx_dma_complete);
dc4dc36056392c Laxman Dewangan 2012-10-30 1084
dc4dc36056392c Laxman Dewangan 2012-10-30 1085 init_completion(&tspi->xfer_completion);
dc4dc36056392c Laxman Dewangan 2012-10-30 1086
dc4dc36056392c Laxman Dewangan 2012-10-30 1087 pm_runtime_enable(&pdev->dev);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1088 ret = pm_runtime_resume_and_get(&pdev->dev);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1089 if (ret) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1090 dev_err(&pdev->dev, "pm runtime get failed, e = %d\n", ret);
dc4dc36056392c Laxman Dewangan 2012-10-30 1091 goto exit_pm_disable;
dc4dc36056392c Laxman Dewangan 2012-10-30 1092 }
aceda401e84115 Jon Hunter 2021-06-08 1093
aceda401e84115 Jon Hunter 2021-06-08 1094 reset_control_assert(tspi->rst);
aceda401e84115 Jon Hunter 2021-06-08 1095 udelay(2);
aceda401e84115 Jon Hunter 2021-06-08 1096 reset_control_deassert(tspi->rst);
aceda401e84115 Jon Hunter 2021-06-08 1097
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1098 spi_irq = platform_get_irq(pdev, 0);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1099 tspi->irq = spi_irq;
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1100 ret = request_threaded_irq(tspi->irq, tegra_slink_isr,
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1101 tegra_slink_isr_thread, IRQF_ONESHOT,
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1102 dev_name(&pdev->dev), tspi);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1103 if (ret < 0) {
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1104 dev_err(&pdev->dev, "Failed to register ISR for IRQ %d\n",
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1105 tspi->irq);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1106 goto exit_pm_put;
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1107 }
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1108
dc4dc36056392c Laxman Dewangan 2012-10-30 1109 tspi->def_command_reg = SLINK_M_S;
dc4dc36056392c Laxman Dewangan 2012-10-30 1110 tspi->def_command2_reg = SLINK_CS_ACTIVE_BETWEEN;
dc4dc36056392c Laxman Dewangan 2012-10-30 1111 tegra_slink_writel(tspi, tspi->def_command_reg, SLINK_COMMAND);
dc4dc36056392c Laxman Dewangan 2012-10-30 1112 tegra_slink_writel(tspi, tspi->def_command2_reg, SLINK_COMMAND2);
dc4dc36056392c Laxman Dewangan 2012-10-30 1113
dc4dc36056392c Laxman Dewangan 2012-10-30 1114 master->dev.of_node = pdev->dev.of_node;
716db5d64f5f9b Jingoo Han 2013-09-24 1115 ret = devm_spi_register_master(&pdev->dev, master);
dc4dc36056392c Laxman Dewangan 2012-10-30 1116 if (ret < 0) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1117 dev_err(&pdev->dev, "can not register to master err %d\n", ret);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1118 goto exit_free_irq;
dc4dc36056392c Laxman Dewangan 2012-10-30 1119 }
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1120
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1121 pm_runtime_put(&pdev->dev);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1122
dc4dc36056392c Laxman Dewangan 2012-10-30 1123 return ret;
dc4dc36056392c Laxman Dewangan 2012-10-30 1124
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1125 exit_free_irq:
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1126 free_irq(spi_irq, tspi);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1127 exit_pm_put:
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1128 pm_runtime_put(&pdev->dev);
dc4dc36056392c Laxman Dewangan 2012-10-30 1129 exit_pm_disable:
dc4dc36056392c Laxman Dewangan 2012-10-30 1130 pm_runtime_disable(&pdev->dev);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1131
dc4dc36056392c Laxman Dewangan 2012-10-30 1132 tegra_slink_deinit_dma_param(tspi, false);
dc4dc36056392c Laxman Dewangan 2012-10-30 1133 exit_rx_dma_free:
dc4dc36056392c Laxman Dewangan 2012-10-30 1134 tegra_slink_deinit_dma_param(tspi, true);
dc4dc36056392c Laxman Dewangan 2012-10-30 1135 exit_free_master:
dc4dc36056392c Laxman Dewangan 2012-10-30 1136 spi_master_put(master);
dc4dc36056392c Laxman Dewangan 2012-10-30 1137 return ret;
dc4dc36056392c Laxman Dewangan 2012-10-30 1138 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1139
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 41381 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v7 26/37] spi: tegra20-slink: Improve runtime PM usage
Date: Fri, 02 Jul 2021 16:29:10 +0800 [thread overview]
Message-ID: <202107021628.cUTzQbdR-lkp@intel.com> (raw)
In-Reply-To: <20210701232728.23591-27-digetx@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 13909 bytes --]
Hi Dmitry,
I love your patch! Perhaps something to improve:
[auto build test WARNING on next-20210701]
[cannot apply to tegra/for-next robh/for-next tegra-drm/drm/tegra/for-next v5.13 v5.13-rc7 v5.13-rc6 v5.13]
[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]
url: https://github.com/0day-ci/linux/commits/Dmitry-Osipenko/NVIDIA-Tegra-power-management-patches-for-5-15/20210702-073048
base: fb0ca446157a86b75502c1636b0d81e642fe6bf1
config: x86_64-randconfig-b001-20210630 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 9eb613b2de3163686b1a4bd1160f15ac56a4b083)
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 x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/0day-ci/linux/commit/eae252678e4ba361dc1513283e282268a7548af6
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Dmitry-Osipenko/NVIDIA-Tegra-power-management-patches-for-5-15/20210702-073048
git checkout eae252678e4ba361dc1513283e282268a7548af6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/spi/spi-tegra20-slink.c:1076:6: warning: variable 'spi_irq' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (ret < 0)
^~~~~~~
drivers/spi/spi-tegra20-slink.c:1126:11: note: uninitialized use occurs here
free_irq(spi_irq, tspi);
^~~~~~~
drivers/spi/spi-tegra20-slink.c:1076:2: note: remove the 'if' if its condition is always false
if (ret < 0)
^~~~~~~~~~~~
drivers/spi/spi-tegra20-slink.c:1066:6: warning: variable 'spi_irq' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (IS_ERR(tspi->rst)) {
^~~~~~~~~~~~~~~~~
drivers/spi/spi-tegra20-slink.c:1126:11: note: uninitialized use occurs here
free_irq(spi_irq, tspi);
^~~~~~~
drivers/spi/spi-tegra20-slink.c:1066:2: note: remove the 'if' if its condition is always false
if (IS_ERR(tspi->rst)) {
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/spi/spi-tegra20-slink.c:1007:18: note: initialize the variable 'spi_irq' to silence this warning
int ret, spi_irq;
^
= 0
2 warnings generated.
vim +1076 drivers/spi/spi-tegra20-slink.c
dc4dc36056392c Laxman Dewangan 2012-10-30 1001
fd4a319bc933ae Grant Likely 2012-12-07 1002 static int tegra_slink_probe(struct platform_device *pdev)
dc4dc36056392c Laxman Dewangan 2012-10-30 1003 {
dc4dc36056392c Laxman Dewangan 2012-10-30 1004 struct spi_master *master;
dc4dc36056392c Laxman Dewangan 2012-10-30 1005 struct tegra_slink_data *tspi;
dc4dc36056392c Laxman Dewangan 2012-10-30 1006 struct resource *r;
dc4dc36056392c Laxman Dewangan 2012-10-30 1007 int ret, spi_irq;
dc4dc36056392c Laxman Dewangan 2012-10-30 1008 const struct tegra_slink_chip_data *cdata = NULL;
dc4dc36056392c Laxman Dewangan 2012-10-30 1009 const struct of_device_id *match;
dc4dc36056392c Laxman Dewangan 2012-10-30 1010
c60fea02141167 Stephen Warren 2013-02-15 1011 match = of_match_device(tegra_slink_of_match, &pdev->dev);
dc4dc36056392c Laxman Dewangan 2012-10-30 1012 if (!match) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1013 dev_err(&pdev->dev, "Error: No device match found\n");
dc4dc36056392c Laxman Dewangan 2012-10-30 1014 return -ENODEV;
dc4dc36056392c Laxman Dewangan 2012-10-30 1015 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1016 cdata = match->data;
dc4dc36056392c Laxman Dewangan 2012-10-30 1017
dc4dc36056392c Laxman Dewangan 2012-10-30 1018 master = spi_alloc_master(&pdev->dev, sizeof(*tspi));
dc4dc36056392c Laxman Dewangan 2012-10-30 1019 if (!master) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1020 dev_err(&pdev->dev, "master allocation failed\n");
dc4dc36056392c Laxman Dewangan 2012-10-30 1021 return -ENOMEM;
dc4dc36056392c Laxman Dewangan 2012-10-30 1022 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1023
dc4dc36056392c Laxman Dewangan 2012-10-30 1024 /* the spi->mode bits understood by this driver: */
dc4dc36056392c Laxman Dewangan 2012-10-30 1025 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
dc4dc36056392c Laxman Dewangan 2012-10-30 1026 master->setup = tegra_slink_setup;
63fc184cde2d77 Mark Brown 2013-10-05 1027 master->prepare_message = tegra_slink_prepare_message;
63fc184cde2d77 Mark Brown 2013-10-05 1028 master->transfer_one = tegra_slink_transfer_one;
63fc184cde2d77 Mark Brown 2013-10-05 1029 master->unprepare_message = tegra_slink_unprepare_message;
ce74ac80d25bcb Mark Brown 2013-07-28 1030 master->auto_runtime_pm = true;
dc4dc36056392c Laxman Dewangan 2012-10-30 1031 master->num_chipselect = MAX_CHIP_SELECT;
dc4dc36056392c Laxman Dewangan 2012-10-30 1032
24b5a82cf5709a Jingoo Han 2013-05-23 1033 platform_set_drvdata(pdev, master);
dc4dc36056392c Laxman Dewangan 2012-10-30 1034 tspi = spi_master_get_devdata(master);
dc4dc36056392c Laxman Dewangan 2012-10-30 1035 tspi->master = master;
dc4dc36056392c Laxman Dewangan 2012-10-30 1036 tspi->dev = &pdev->dev;
dc4dc36056392c Laxman Dewangan 2012-10-30 1037 tspi->chip_data = cdata;
dc4dc36056392c Laxman Dewangan 2012-10-30 1038 spin_lock_init(&tspi->lock);
dc4dc36056392c Laxman Dewangan 2012-10-30 1039
3c604de496d756 Axel Lin 2014-02-10 1040 if (of_property_read_u32(tspi->dev->of_node, "spi-max-frequency",
3c604de496d756 Axel Lin 2014-02-10 1041 &master->max_speed_hz))
3c604de496d756 Axel Lin 2014-02-10 1042 master->max_speed_hz = 25000000; /* 25MHz */
c60fea02141167 Stephen Warren 2013-02-15 1043
dc4dc36056392c Laxman Dewangan 2012-10-30 1044 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dc4dc36056392c Laxman Dewangan 2012-10-30 1045 if (!r) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1046 dev_err(&pdev->dev, "No IO memory resource\n");
dc4dc36056392c Laxman Dewangan 2012-10-30 1047 ret = -ENODEV;
dc4dc36056392c Laxman Dewangan 2012-10-30 1048 goto exit_free_master;
dc4dc36056392c Laxman Dewangan 2012-10-30 1049 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1050 tspi->phys = r->start;
b0ee5605234a24 Thierry Reding 2013-01-21 1051 tspi->base = devm_ioremap_resource(&pdev->dev, r);
b0ee5605234a24 Thierry Reding 2013-01-21 1052 if (IS_ERR(tspi->base)) {
b0ee5605234a24 Thierry Reding 2013-01-21 1053 ret = PTR_ERR(tspi->base);
dc4dc36056392c Laxman Dewangan 2012-10-30 1054 goto exit_free_master;
dc4dc36056392c Laxman Dewangan 2012-10-30 1055 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1056
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1057 /* disabled clock may cause interrupt storm upon request */
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1058 tspi->clk = devm_clk_get(&pdev->dev, NULL);
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1059 if (IS_ERR(tspi->clk)) {
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1060 ret = PTR_ERR(tspi->clk);
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1061 dev_err(&pdev->dev, "Can not get clock %d\n", ret);
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1062 goto exit_free_master;
7001cab1dabc0b Marcel Ziswiler 2018-08-29 1063 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1064
73b32756cec312 Philipp Zabel 2017-07-19 1065 tspi->rst = devm_reset_control_get_exclusive(&pdev->dev, "spi");
ff2251e3de37b0 Stephen Warren 2013-11-06 1066 if (IS_ERR(tspi->rst)) {
ff2251e3de37b0 Stephen Warren 2013-11-06 1067 dev_err(&pdev->dev, "can not get reset\n");
ff2251e3de37b0 Stephen Warren 2013-11-06 1068 ret = PTR_ERR(tspi->rst);
ff2251e3de37b0 Stephen Warren 2013-11-06 1069 goto exit_free_irq;
ff2251e3de37b0 Stephen Warren 2013-11-06 1070 }
ff2251e3de37b0 Stephen Warren 2013-11-06 1071
dc4dc36056392c Laxman Dewangan 2012-10-30 1072 tspi->max_buf_size = SLINK_FIFO_DEPTH << 2;
dc4dc36056392c Laxman Dewangan 2012-10-30 1073 tspi->dma_buf_size = DEFAULT_SPI_DMA_BUF_LEN;
dc4dc36056392c Laxman Dewangan 2012-10-30 1074
dc4dc36056392c Laxman Dewangan 2012-10-30 1075 ret = tegra_slink_init_dma_param(tspi, true);
a915d150f68d8f Stephen Warren 2013-11-11 @1076 if (ret < 0)
dc4dc36056392c Laxman Dewangan 2012-10-30 1077 goto exit_free_irq;
dc4dc36056392c Laxman Dewangan 2012-10-30 1078 ret = tegra_slink_init_dma_param(tspi, false);
a915d150f68d8f Stephen Warren 2013-11-11 1079 if (ret < 0)
dc4dc36056392c Laxman Dewangan 2012-10-30 1080 goto exit_rx_dma_free;
dc4dc36056392c Laxman Dewangan 2012-10-30 1081 tspi->max_buf_size = tspi->dma_buf_size;
dc4dc36056392c Laxman Dewangan 2012-10-30 1082 init_completion(&tspi->tx_dma_complete);
dc4dc36056392c Laxman Dewangan 2012-10-30 1083 init_completion(&tspi->rx_dma_complete);
dc4dc36056392c Laxman Dewangan 2012-10-30 1084
dc4dc36056392c Laxman Dewangan 2012-10-30 1085 init_completion(&tspi->xfer_completion);
dc4dc36056392c Laxman Dewangan 2012-10-30 1086
dc4dc36056392c Laxman Dewangan 2012-10-30 1087 pm_runtime_enable(&pdev->dev);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1088 ret = pm_runtime_resume_and_get(&pdev->dev);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1089 if (ret) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1090 dev_err(&pdev->dev, "pm runtime get failed, e = %d\n", ret);
dc4dc36056392c Laxman Dewangan 2012-10-30 1091 goto exit_pm_disable;
dc4dc36056392c Laxman Dewangan 2012-10-30 1092 }
aceda401e84115 Jon Hunter 2021-06-08 1093
aceda401e84115 Jon Hunter 2021-06-08 1094 reset_control_assert(tspi->rst);
aceda401e84115 Jon Hunter 2021-06-08 1095 udelay(2);
aceda401e84115 Jon Hunter 2021-06-08 1096 reset_control_deassert(tspi->rst);
aceda401e84115 Jon Hunter 2021-06-08 1097
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1098 spi_irq = platform_get_irq(pdev, 0);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1099 tspi->irq = spi_irq;
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1100 ret = request_threaded_irq(tspi->irq, tegra_slink_isr,
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1101 tegra_slink_isr_thread, IRQF_ONESHOT,
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1102 dev_name(&pdev->dev), tspi);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1103 if (ret < 0) {
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1104 dev_err(&pdev->dev, "Failed to register ISR for IRQ %d\n",
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1105 tspi->irq);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1106 goto exit_pm_put;
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1107 }
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1108
dc4dc36056392c Laxman Dewangan 2012-10-30 1109 tspi->def_command_reg = SLINK_M_S;
dc4dc36056392c Laxman Dewangan 2012-10-30 1110 tspi->def_command2_reg = SLINK_CS_ACTIVE_BETWEEN;
dc4dc36056392c Laxman Dewangan 2012-10-30 1111 tegra_slink_writel(tspi, tspi->def_command_reg, SLINK_COMMAND);
dc4dc36056392c Laxman Dewangan 2012-10-30 1112 tegra_slink_writel(tspi, tspi->def_command2_reg, SLINK_COMMAND2);
dc4dc36056392c Laxman Dewangan 2012-10-30 1113
dc4dc36056392c Laxman Dewangan 2012-10-30 1114 master->dev.of_node = pdev->dev.of_node;
716db5d64f5f9b Jingoo Han 2013-09-24 1115 ret = devm_spi_register_master(&pdev->dev, master);
dc4dc36056392c Laxman Dewangan 2012-10-30 1116 if (ret < 0) {
dc4dc36056392c Laxman Dewangan 2012-10-30 1117 dev_err(&pdev->dev, "can not register to master err %d\n", ret);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1118 goto exit_free_irq;
dc4dc36056392c Laxman Dewangan 2012-10-30 1119 }
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1120
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1121 pm_runtime_put(&pdev->dev);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1122
dc4dc36056392c Laxman Dewangan 2012-10-30 1123 return ret;
dc4dc36056392c Laxman Dewangan 2012-10-30 1124
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1125 exit_free_irq:
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1126 free_irq(spi_irq, tspi);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1127 exit_pm_put:
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1128 pm_runtime_put(&pdev->dev);
dc4dc36056392c Laxman Dewangan 2012-10-30 1129 exit_pm_disable:
dc4dc36056392c Laxman Dewangan 2012-10-30 1130 pm_runtime_disable(&pdev->dev);
eae252678e4ba3 Dmitry Osipenko 2021-07-02 1131
dc4dc36056392c Laxman Dewangan 2012-10-30 1132 tegra_slink_deinit_dma_param(tspi, false);
dc4dc36056392c Laxman Dewangan 2012-10-30 1133 exit_rx_dma_free:
dc4dc36056392c Laxman Dewangan 2012-10-30 1134 tegra_slink_deinit_dma_param(tspi, true);
dc4dc36056392c Laxman Dewangan 2012-10-30 1135 exit_free_master:
dc4dc36056392c Laxman Dewangan 2012-10-30 1136 spi_master_put(master);
dc4dc36056392c Laxman Dewangan 2012-10-30 1137 return ret;
dc4dc36056392c Laxman Dewangan 2012-10-30 1138 }
dc4dc36056392c Laxman Dewangan 2012-10-30 1139
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 41381 bytes --]
next prev parent reply other threads:[~2021-07-02 8:29 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 23:26 [PATCH v7 00/37] NVIDIA Tegra power management patches for 5.15 Dmitry Osipenko
2021-07-01 23:26 ` [PATCH v7 01/37] soc/tegra: pmc: Temporarily disable PMC state syncing Dmitry Osipenko
2021-08-12 16:02 ` Dmitry Osipenko
2021-07-01 23:26 ` [PATCH v7 02/37] soc/tegra: pmc: Implement attach_dev() of power domain drivers Dmitry Osipenko
2021-08-02 14:48 ` Ulf Hansson
2021-08-02 18:23 ` Dmitry Osipenko
2021-08-04 9:59 ` Ulf Hansson
2021-08-04 21:16 ` Dmitry Osipenko
2021-08-09 14:15 ` Ulf Hansson
2021-08-09 23:56 ` Dmitry Osipenko
2021-08-10 10:51 ` Ulf Hansson
2021-08-11 19:30 ` Dmitry Osipenko
2021-08-11 22:41 ` Dmitry Osipenko
2021-08-12 1:40 ` Dmitry Osipenko
2021-08-12 11:17 ` Ulf Hansson
2021-08-12 16:24 ` Dmitry Osipenko
2021-07-01 23:26 ` [PATCH v7 03/37] soc/tegra: Don't print error message when OPPs not available Dmitry Osipenko
2021-07-01 23:26 ` [PATCH v7 04/37] soc/tegra: Add devm_tegra_core_dev_init_opp_table_simple() Dmitry Osipenko
2021-07-01 23:26 ` [PATCH v7 05/37] dt-bindings: clock: tegra-car: Document new tegra-clocks node Dmitry Osipenko
2021-07-01 23:26 ` [PATCH v7 06/37] clk: tegra: Support runtime PM and power domain Dmitry Osipenko
2021-07-01 23:26 ` [PATCH v7 07/37] dt-bindings: host1x: Document OPP and power domain properties Dmitry Osipenko
2021-07-01 23:26 ` [PATCH v7 08/37] dt-bindings: host1x: Document Memory Client resets of Host1x, GR2D and GR3D Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 09/37] gpu: host1x: Add host1x_channel_stop() Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 10/37] gpu: host1x: Add runtime PM support Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 11/37] gpu: host1x: Add stub driver for MPE, VI, EPP and ISP Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 12/37] drm/tegra: dc: Support OPP and SoC core voltage scaling Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 13/37] drm/tegra: hdmi: Add OPP support Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 14/37] drm/tegra: gr2d: Support OPP and power management Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 15/37] drm/tegra: gr3d: " Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 16/37] drm/tegra: vic: Stop channel before suspending Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 17/37] usb: chipidea: tegra: Add runtime PM support Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 18/37] bus: tegra-gmi: " Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 19/37] pwm: tegra: Add runtime PM and OPP support Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 20/37] mmc: sdhci-tegra: " Dmitry Osipenko
2021-07-02 3:39 ` kernel test robot
2021-07-02 3:39 ` kernel test robot
2021-07-01 23:27 ` [PATCH v7 21/37] mtd: rawnand: tegra: Add runtime PM support Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 22/37] soc/tegra: fuse: Clear fuse->clk on driver probe failure Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 23/37] soc/tegra: fuse: Add runtime PM support Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 24/37] soc/tegra: fuse: Enable fuse clock on suspend Dmitry Osipenko
2021-07-21 16:00 ` Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 25/37] clk: tegra: Remove CLK_IS_CRITICAL flag from fuse clock Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 26/37] spi: tegra20-slink: Improve runtime PM usage Dmitry Osipenko
2021-07-02 8:29 ` kernel test robot [this message]
2021-07-02 8:29 ` kernel test robot
2021-07-01 23:27 ` [PATCH v7 27/37] spi: tegra20-slink: Add OPP support Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 28/37] memory: tegra20-emc: Add minimal runtime PM support Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 29/37] memory: tegra30-emc: " Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 30/37] media: dt: bindings: tegra-vde: Convert to schema Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 31/37] media: dt: bindings: tegra-vde: Document OPP and power domain Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 32/37] media: staging: tegra-vde: Support generic " Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 33/37] ARM: tegra: Add OPP tables and power domains to Tegra20 device-trees Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 34/37] ARM: tegra: Add OPP tables and power domains to Tegra30 device-trees Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 35/37] ARM: tegra: Add Memory Client resets to Tegra20 GR2D, GR3D and Host1x Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 36/37] ARM: tegra: Add Memory Client resets to Tegra30 " Dmitry Osipenko
2021-07-01 23:27 ` [PATCH v7 37/37] soc/tegra: pmc: Enable core domain support on Tegra20 and Tegra30 Dmitry Osipenko
2021-07-09 13:01 ` [PATCH v7 00/37] NVIDIA Tegra power management patches for 5.15 Ulf Hansson
2021-07-09 21:23 ` Dmitry Osipenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202107021628.cUTzQbdR-lkp@intel.com \
--to=lkp@intel.com \
--cc=clang-built-linux@googlegroups.com \
--cc=digetx@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=pdeschrijver@nvidia.com \
--cc=sboyd@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=vireshk@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.