LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 1/1] spi: tegra114: Fix set_cs_timing param
@ 2021-08-03  2:13 Mason Zhang
  2021-08-03  9:14 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Mason Zhang @ 2021-08-03  2:13 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger
  Cc: Laxman Dewangan, linux-spi, linux-kernel, linux-arm-kernel,
	linux-mediatek, wsd_upstream, Mason Zhang

This patch fixed set_cs_timing param, because cs timing delay has
been moved to spi_device.

Signed-off-by: Mason Zhang <Mason.Zhang@mediatek.com>
---
 drivers/spi/spi-tegra114.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index 5131141bbf0d..e9de1d958bbd 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -717,12 +717,12 @@ static void tegra_spi_deinit_dma_param(struct tegra_spi_data *tspi,
 	dma_release_channel(dma_chan);
 }
 
-static int tegra_spi_set_hw_cs_timing(struct spi_device *spi,
-				      struct spi_delay *setup,
-				      struct spi_delay *hold,
-				      struct spi_delay *inactive)
+static int tegra_spi_set_hw_cs_timing(struct spi_device *spi)
 {
 	struct tegra_spi_data *tspi = spi_master_get_devdata(spi->master);
+	struct spi_delay *setup = &spi->cs_setup;
+	struct spi_delay *hold = &spi->cs_hold;
+	struct spi_delay *inactive = &spi->cs_inactive;
 	u8 setup_dly, hold_dly, inactive_dly;
 	u32 setup_hold;
 	u32 spi_cs_timing;
-- 
2.18.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] spi: tegra114: Fix set_cs_timing param
  2021-08-03  2:13 [PATCH 1/1] spi: tegra114: Fix set_cs_timing param Mason Zhang
@ 2021-08-03  9:14 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-08-03  9:14 UTC (permalink / raw)
  To: Mason Zhang, Mark Brown, Matthias Brugger
  Cc: kbuild-all, Laxman Dewangan, linux-spi, linux-kernel,
	linux-arm-kernel, linux-mediatek, wsd_upstream, Mason Zhang

[-- Attachment #1: Type: text/plain, Size: 4963 bytes --]

Hi Mason,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on spi/for-next]
[also build test ERROR on v5.14-rc4 next-20210802]
[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/Mason-Zhang/spi-tegra114-Fix-set_cs_timing-param/20210803-103149
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 10.3.0
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
        # https://github.com/0day-ci/linux/commit/8920b64abf63231756f3910e4954bdda80d01257
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Mason-Zhang/spi-tegra114-Fix-set_cs_timing-param/20210803-103149
        git checkout 8920b64abf63231756f3910e4954bdda80d01257
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash drivers/net/ethernet/stmicro/stmmac/ drivers/spi/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   drivers/spi/spi-tegra114.c: In function 'tegra_spi_set_hw_cs_timing':
>> drivers/spi/spi-tegra114.c:723:32: error: 'struct spi_device' has no member named 'cs_setup'
     723 |  struct spi_delay *setup = &spi->cs_setup;
         |                                ^~
>> drivers/spi/spi-tegra114.c:724:31: error: 'struct spi_device' has no member named 'cs_hold'
     724 |  struct spi_delay *hold = &spi->cs_hold;
         |                               ^~
>> drivers/spi/spi-tegra114.c:725:35: error: 'struct spi_device' has no member named 'cs_inactive'
     725 |  struct spi_delay *inactive = &spi->cs_inactive;
         |                                   ^~
   drivers/spi/spi-tegra114.c: In function 'tegra_spi_probe':
>> drivers/spi/spi-tegra114.c:1328:24: error: assignment to 'int (*)(struct spi_device *, struct spi_delay *, struct spi_delay *, struct spi_delay *)' from incompatible pointer type 'int (*)(struct spi_device *)' [-Werror=incompatible-pointer-types]
    1328 |  master->set_cs_timing = tegra_spi_set_hw_cs_timing;
         |                        ^
   cc1: some warnings being treated as errors


vim +723 drivers/spi/spi-tegra114.c

   719	
   720	static int tegra_spi_set_hw_cs_timing(struct spi_device *spi)
   721	{
   722		struct tegra_spi_data *tspi = spi_master_get_devdata(spi->master);
 > 723		struct spi_delay *setup = &spi->cs_setup;
 > 724		struct spi_delay *hold = &spi->cs_hold;
 > 725		struct spi_delay *inactive = &spi->cs_inactive;
   726		u8 setup_dly, hold_dly, inactive_dly;
   727		u32 setup_hold;
   728		u32 spi_cs_timing;
   729		u32 inactive_cycles;
   730		u8 cs_state;
   731	
   732		if ((setup && setup->unit != SPI_DELAY_UNIT_SCK) ||
   733		    (hold && hold->unit != SPI_DELAY_UNIT_SCK) ||
   734		    (inactive && inactive->unit != SPI_DELAY_UNIT_SCK)) {
   735			dev_err(&spi->dev,
   736				"Invalid delay unit %d, should be SPI_DELAY_UNIT_SCK\n",
   737				SPI_DELAY_UNIT_SCK);
   738			return -EINVAL;
   739		}
   740	
   741		setup_dly = setup ? setup->value : 0;
   742		hold_dly = hold ? hold->value : 0;
   743		inactive_dly = inactive ? inactive->value : 0;
   744	
   745		setup_dly = min_t(u8, setup_dly, MAX_SETUP_HOLD_CYCLES);
   746		hold_dly = min_t(u8, hold_dly, MAX_SETUP_HOLD_CYCLES);
   747		if (setup_dly && hold_dly) {
   748			setup_hold = SPI_SETUP_HOLD(setup_dly - 1, hold_dly - 1);
   749			spi_cs_timing = SPI_CS_SETUP_HOLD(tspi->spi_cs_timing1,
   750							  spi->chip_select,
   751							  setup_hold);
   752			if (tspi->spi_cs_timing1 != spi_cs_timing) {
   753				tspi->spi_cs_timing1 = spi_cs_timing;
   754				tegra_spi_writel(tspi, spi_cs_timing, SPI_CS_TIMING1);
   755			}
   756		}
   757	
   758		inactive_cycles = min_t(u8, inactive_dly, MAX_INACTIVE_CYCLES);
   759		if (inactive_cycles)
   760			inactive_cycles--;
   761		cs_state = inactive_cycles ? 0 : 1;
   762		spi_cs_timing = tspi->spi_cs_timing2;
   763		SPI_SET_CS_ACTIVE_BETWEEN_PACKETS(spi_cs_timing, spi->chip_select,
   764						  cs_state);
   765		SPI_SET_CYCLES_BETWEEN_PACKETS(spi_cs_timing, spi->chip_select,
   766					       inactive_cycles);
   767		if (tspi->spi_cs_timing2 != spi_cs_timing) {
   768			tspi->spi_cs_timing2 = spi_cs_timing;
   769			tegra_spi_writel(tspi, spi_cs_timing, SPI_CS_TIMING2);
   770		}
   771	
   772		return 0;
   773	}
   774	

---
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: 60677 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-03  9:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03  2:13 [PATCH 1/1] spi: tegra114: Fix set_cs_timing param Mason Zhang
2021-08-03  9:14 ` 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).