[v4,0/2] spi: loongson: add bus driver for the loongson spi

Message ID 20230328112210.23089-1-zhuyinbo@loongson.cn
Headers
Series spi: loongson: add bus driver for the loongson spi |

Message

Yinbo Zhu March 28, 2023, 11:22 a.m. UTC
  Loongson platform support spi hardware controller and this series patch
was to add spi driver and binding support.

Change in v2:
		1. This [PATCH v2 1/2] dt-bindings patch need depend on clk patch:
	 	   https://
		   lore.kernel.org/all/20230307115022.12846-1-zhuyinbo@loongson.cn/
		2. Remove the clock-names in spi yaml file.
		3. Add "loongson,ls7a-spi" compatible in spi yaml file.
		4. Add an || COMPILE_TEST and drop && PCI then add some CONFIG_PCI
		   macro to limit some pci code.
		5. Make the spi driver top code comment block that use C++ style.
		6. Drop spi->max_speed_hz.
		7. Add a spin_lock for loongson_spi_setup.
		8. Add a timeout and cpu_relax() in loongson_spi_write_read_8bit.
		9. Add spi_transfer_one and drop transfer and rework entire spi
		   driver that include some necessary changes.
		10. Use module_init replace subsys_initcall.
		11. About PM interface that I don't find any issue so I don't add
		    any changes.
Change in v3:
		1. This [PATCH v3 1/2] dt-bindings patch need depend on clk patch:
		   https://
		   lore.kernel.org/all/20230323025229.2971-1-zhuyinbo@loongson.cn/
		2. Drop the unused blank line in loongson,ls-spi.yaml file.
		3. Replace clock minItems with clock maxItems in yaml file.
		4. Separate spi driver into platform module, pci module and core
		   module.
		5. Replace DIV_ROUND_UP with DIV_ROUND_UP_ULL to fix compile error
		   "undefined reference to `__aeabi_uldivmod'" and  "__udivdi3 undefined"
		   that reported by test robot.
		6. Remove the spin lock.
		7. Clear the loongson_spi->hz and loongson_spi->mode in setup to fixup
		   the issue that multiple spi device transfer that maybe cause spi was
		   be misconfigured.
Change in v4:
		1. This [PATCH v4 1/2] dt-bindings patch need depend on clk patch:
		   https://
		   lore.kernel.org/all/20230323025229.2971-1-zhuyinbo@loongson.cn/
		2. Add "#include <linux/io.h>" in spi-loongson-core.c for fix the compile
		   issue which devm_ioremap no declaration.
		3. Add "EXPORT_SYMBOL_GPL(loongson_spi_dev_pm_ops)" in
		   spi-loongson-core.c for fix the compile issue which
		   loongson_spi_dev_pm_ops undefined.

Yinbo Zhu (2):
  dt-bindings: spi: add loongson spi
  spi: loongson: add bus driver for the loongson spi controller

 .../bindings/spi/loongson,ls-spi.yaml         |  43 +++
 MAINTAINERS                                   |  10 +
 drivers/spi/Kconfig                           |  31 ++
 drivers/spi/Makefile                          |   3 +
 drivers/spi/spi-loongson-core.c               | 304 ++++++++++++++++++
 drivers/spi/spi-loongson-pci.c                |  89 +++++
 drivers/spi/spi-loongson-plat.c               |  66 ++++
 drivers/spi/spi-loongson.h                    |  41 +++
 8 files changed, 587 insertions(+)
  

Comments

Andi Shyti March 28, 2023, 11:35 a.m. UTC | #1
Hi Yinbo,

before submitting the patches for review... can you please run
checkpatch.pl on them?

Thanks,
Andi

On Tue, Mar 28, 2023 at 07:22:08PM +0800, Yinbo Zhu wrote:
> Loongson platform support spi hardware controller and this series patch
> was to add spi driver and binding support.
> 
> Change in v2:
> 		1. This [PATCH v2 1/2] dt-bindings patch need depend on clk patch:
> 	 	   https://
> 		   lore.kernel.org/all/20230307115022.12846-1-zhuyinbo@loongson.cn/
> 		2. Remove the clock-names in spi yaml file.
> 		3. Add "loongson,ls7a-spi" compatible in spi yaml file.
> 		4. Add an || COMPILE_TEST and drop && PCI then add some CONFIG_PCI
> 		   macro to limit some pci code.
> 		5. Make the spi driver top code comment block that use C++ style.
> 		6. Drop spi->max_speed_hz.
> 		7. Add a spin_lock for loongson_spi_setup.
> 		8. Add a timeout and cpu_relax() in loongson_spi_write_read_8bit.
> 		9. Add spi_transfer_one and drop transfer and rework entire spi
> 		   driver that include some necessary changes.
> 		10. Use module_init replace subsys_initcall.
> 		11. About PM interface that I don't find any issue so I don't add
> 		    any changes.
> Change in v3:
> 		1. This [PATCH v3 1/2] dt-bindings patch need depend on clk patch:
> 		   https://
> 		   lore.kernel.org/all/20230323025229.2971-1-zhuyinbo@loongson.cn/
> 		2. Drop the unused blank line in loongson,ls-spi.yaml file.
> 		3. Replace clock minItems with clock maxItems in yaml file.
> 		4. Separate spi driver into platform module, pci module and core
> 		   module.
> 		5. Replace DIV_ROUND_UP with DIV_ROUND_UP_ULL to fix compile error
> 		   "undefined reference to `__aeabi_uldivmod'" and  "__udivdi3 undefined"
> 		   that reported by test robot.
> 		6. Remove the spin lock.
> 		7. Clear the loongson_spi->hz and loongson_spi->mode in setup to fixup
> 		   the issue that multiple spi device transfer that maybe cause spi was
> 		   be misconfigured.
> Change in v4:
> 		1. This [PATCH v4 1/2] dt-bindings patch need depend on clk patch:
> 		   https://
> 		   lore.kernel.org/all/20230323025229.2971-1-zhuyinbo@loongson.cn/
> 		2. Add "#include <linux/io.h>" in spi-loongson-core.c for fix the compile
> 		   issue which devm_ioremap no declaration.
> 		3. Add "EXPORT_SYMBOL_GPL(loongson_spi_dev_pm_ops)" in
> 		   spi-loongson-core.c for fix the compile issue which
> 		   loongson_spi_dev_pm_ops undefined.
> 
> Yinbo Zhu (2):
>   dt-bindings: spi: add loongson spi
>   spi: loongson: add bus driver for the loongson spi controller
> 
>  .../bindings/spi/loongson,ls-spi.yaml         |  43 +++
>  MAINTAINERS                                   |  10 +
>  drivers/spi/Kconfig                           |  31 ++
>  drivers/spi/Makefile                          |   3 +
>  drivers/spi/spi-loongson-core.c               | 304 ++++++++++++++++++
>  drivers/spi/spi-loongson-pci.c                |  89 +++++
>  drivers/spi/spi-loongson-plat.c               |  66 ++++
>  drivers/spi/spi-loongson.h                    |  41 +++
>  8 files changed, 587 insertions(+)
> 
> -- 
> 2.20.1
>
  
Yinbo Zhu March 28, 2023, 11:53 a.m. UTC | #2
在 2023/3/28 下午7:35, Andi Shyti 写道:
> Hi Yinbo,
> 
> before submitting the patches for review... can you please run
> checkpatch.pl on them?
yes, I had used checkpatch.pl to check and no any errors and warnings.

user@user-pc:~/workspace/test/code/www.kernel.org/linux$ 
./scripts/checkpatch.pl *.patch
-----------------------
0000-cover-letter.patch
-----------------------
total: 0 errors, 0 warnings, 0 lines checked

0000-cover-letter.patch has no obvious style problems and is ready for 
submission.
-------------------------------------------
0001-dt-bindings-spi-add-loongson-spi.patch
-------------------------------------------
Traceback (most recent call last):
   File "scripts/spdxcheck.py", line 6, in <module>
     from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
total: 0 errors, 0 warnings, 55 lines checked

0001-dt-bindings-spi-add-loongson-spi.patch has no obvious style 
problems and is ready for submission.
---------------------------------------------------------------
0002-spi-loongson-add-bus-driver-for-the-loongson-spi-con.patch
---------------------------------------------------------------
Traceback (most recent call last):
   File "scripts/spdxcheck.py", line 6, in <module>
     from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
Traceback (most recent call last):
   File "scripts/spdxcheck.py", line 6, in <module>
     from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
Traceback (most recent call last):
   File "scripts/spdxcheck.py", line 6, in <module>
     from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
Traceback (most recent call last):
   File "scripts/spdxcheck.py", line 6, in <module>
     from ply import lex, yacc
ModuleNotFoundError: No module named 'ply'
total: 0 errors, 0 warnings, 556 lines checked

0002-spi-loongson-add-bus-driver-for-the-loongson-spi-con.patch has no 
obvious style problems and is ready for submission.
user@user-pc:~/workspace/test/code/www.kernel.org/linux$
> 
> Thanks,
> Andi
> 
> On Tue, Mar 28, 2023 at 07:22:08PM +0800, Yinbo Zhu wrote:
>> Loongson platform support spi hardware controller and this series patch
>> was to add spi driver and binding support.
>>
>> Change in v2:
>> 		1. This [PATCH v2 1/2] dt-bindings patch need depend on clk patch:
>> 	 	   https://
>> 		   lore.kernel.org/all/20230307115022.12846-1-zhuyinbo@loongson.cn/
>> 		2. Remove the clock-names in spi yaml file.
>> 		3. Add "loongson,ls7a-spi" compatible in spi yaml file.
>> 		4. Add an || COMPILE_TEST and drop && PCI then add some CONFIG_PCI
>> 		   macro to limit some pci code.
>> 		5. Make the spi driver top code comment block that use C++ style.
>> 		6. Drop spi->max_speed_hz.
>> 		7. Add a spin_lock for loongson_spi_setup.
>> 		8. Add a timeout and cpu_relax() in loongson_spi_write_read_8bit.
>> 		9. Add spi_transfer_one and drop transfer and rework entire spi
>> 		   driver that include some necessary changes.
>> 		10. Use module_init replace subsys_initcall.
>> 		11. About PM interface that I don't find any issue so I don't add
>> 		    any changes.
>> Change in v3:
>> 		1. This [PATCH v3 1/2] dt-bindings patch need depend on clk patch:
>> 		   https://
>> 		   lore.kernel.org/all/20230323025229.2971-1-zhuyinbo@loongson.cn/
>> 		2. Drop the unused blank line in loongson,ls-spi.yaml file.
>> 		3. Replace clock minItems with clock maxItems in yaml file.
>> 		4. Separate spi driver into platform module, pci module and core
>> 		   module.
>> 		5. Replace DIV_ROUND_UP with DIV_ROUND_UP_ULL to fix compile error
>> 		   "undefined reference to `__aeabi_uldivmod'" and  "__udivdi3 undefined"
>> 		   that reported by test robot.
>> 		6. Remove the spin lock.
>> 		7. Clear the loongson_spi->hz and loongson_spi->mode in setup to fixup
>> 		   the issue that multiple spi device transfer that maybe cause spi was
>> 		   be misconfigured.
>> Change in v4:
>> 		1. This [PATCH v4 1/2] dt-bindings patch need depend on clk patch:
>> 		   https://
>> 		   lore.kernel.org/all/20230323025229.2971-1-zhuyinbo@loongson.cn/
>> 		2. Add "#include <linux/io.h>" in spi-loongson-core.c for fix the compile
>> 		   issue which devm_ioremap no declaration.
>> 		3. Add "EXPORT_SYMBOL_GPL(loongson_spi_dev_pm_ops)" in
>> 		   spi-loongson-core.c for fix the compile issue which
>> 		   loongson_spi_dev_pm_ops undefined.
>>
>> Yinbo Zhu (2):
>>    dt-bindings: spi: add loongson spi
>>    spi: loongson: add bus driver for the loongson spi controller
>>
>>   .../bindings/spi/loongson,ls-spi.yaml         |  43 +++
>>   MAINTAINERS                                   |  10 +
>>   drivers/spi/Kconfig                           |  31 ++
>>   drivers/spi/Makefile                          |   3 +
>>   drivers/spi/spi-loongson-core.c               | 304 ++++++++++++++++++
>>   drivers/spi/spi-loongson-pci.c                |  89 +++++
>>   drivers/spi/spi-loongson-plat.c               |  66 ++++
>>   drivers/spi/spi-loongson.h                    |  41 +++
>>   8 files changed, 587 insertions(+)
>>
>> -- 
>> 2.20.1
>>
  
Krzysztof Kozlowski March 29, 2023, 8:07 a.m. UTC | #3
On 28/03/2023 13:53, zhuyinbo wrote:
> 
> 
> 在 2023/3/28 下午7:35, Andi Shyti 写道:
>> Hi Yinbo,
>>
>> before submitting the patches for review... can you please run
>> checkpatch.pl on them?
> yes, I had used checkpatch.pl to check and no any errors and warnings.
> 
> user@user-pc:~/workspace/test/code/www.kernel.org/linux$ 
> ./scripts/checkpatch.pl *.patch
> -----------------------
> 0000-cover-letter.patch
> -----------------------
> total: 0 errors, 0 warnings, 0 lines checked
> 
> 0000-cover-letter.patch has no obvious style problems and is ready for 
> submission.
> -------------------------------------------
> 0001-dt-bindings-spi-add-loongson-spi.patch
> -------------------------------------------
> Traceback (most recent call last):
>    File "scripts/spdxcheck.py", line 6, in <module>
>      from ply import lex, yacc
> ModuleNotFoundError: No module named 'ply'
> total: 0 errors, 0 warnings, 55 lines checked
> 
> 0001-dt-bindings-spi-add-loongson-spi.patch has no obvious style 
> problems and is ready for submission.
> ---------------------------------------------------------------
> 0002-spi-loongson-add-bus-driver-for-the-loongson-spi-con.patch
> ---------------------------------------------------------------
> Traceback (most recent call last):
>    File "scripts/spdxcheck.py", line 6, in <module>
>      from ply import lex, yacc
> ModuleNotFoundError: No module named 'ply'
> Traceback (most recent call last):
>    File "scripts/spdxcheck.py", line 6, in <module>
>      from ply import lex, yacc
> ModuleNotFoundError: No module named 'ply'
> Traceback (most recent call last):
>    File "scripts/spdxcheck.py", line 6, in <module>
>      from ply import lex, yacc
> ModuleNotFoundError: No module named 'ply'
> Traceback (most recent call last):
>    File "scripts/spdxcheck.py", line 6, in <module>
>      from ply import lex, yacc
> ModuleNotFoundError: No module named 'ply'

You have errors here... Fix your setup for spdx check.

Best regards,
Krzysztof
  
Yinbo Zhu March 30, 2023, 3:46 a.m. UTC | #4
在 2023/3/29 下午4:07, Krzysztof Kozlowski 写道:
> On 28/03/2023 13:53, zhuyinbo wrote:
>>
>>
>> 在 2023/3/28 下午7:35, Andi Shyti 写道:
>>> Hi Yinbo,
>>>
>>> before submitting the patches for review... can you please run
>>> checkpatch.pl on them?
>> yes, I had used checkpatch.pl to check and no any errors and warnings.
>>
>> user@user-pc:~/workspace/test/code/www.kernel.org/linux$
>> ./scripts/checkpatch.pl *.patch
>> -----------------------
>> 0000-cover-letter.patch
>> -----------------------
>> total: 0 errors, 0 warnings, 0 lines checked
>>
>> 0000-cover-letter.patch has no obvious style problems and is ready for
>> submission.
>> -------------------------------------------
>> 0001-dt-bindings-spi-add-loongson-spi.patch
>> -------------------------------------------
>> Traceback (most recent call last):
>>     File "scripts/spdxcheck.py", line 6, in <module>
>>       from ply import lex, yacc
>> ModuleNotFoundError: No module named 'ply'
>> total: 0 errors, 0 warnings, 55 lines checked
>>
>> 0001-dt-bindings-spi-add-loongson-spi.patch has no obvious style
>> problems and is ready for submission.
>> ---------------------------------------------------------------
>> 0002-spi-loongson-add-bus-driver-for-the-loongson-spi-con.patch
>> ---------------------------------------------------------------
>> Traceback (most recent call last):
>>     File "scripts/spdxcheck.py", line 6, in <module>
>>       from ply import lex, yacc
>> ModuleNotFoundError: No module named 'ply'
>> Traceback (most recent call last):
>>     File "scripts/spdxcheck.py", line 6, in <module>
>>       from ply import lex, yacc
>> ModuleNotFoundError: No module named 'ply'
>> Traceback (most recent call last):
>>     File "scripts/spdxcheck.py", line 6, in <module>
>>       from ply import lex, yacc
>> ModuleNotFoundError: No module named 'ply'
>> Traceback (most recent call last):
>>     File "scripts/spdxcheck.py", line 6, in <module>
>>       from ply import lex, yacc
>> ModuleNotFoundError: No module named 'ply'
> 
> You have errors here... Fix your setup for spdx check.
I installed ply and gitpython package locally, and then there was no 
spdxcheck and other error when use checkpatch.pl to check this series patch.

Thanks.
> 
> Best regards,
> Krzysztof
>