Re: [PATCH 2/2] gpio: add support for GPIO controller on Siflower SoCs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/01/2025 10:11, Chuanhong Guo wrote:
> Hello Krzysztof!
> 
> On Tue, Dec 31, 2024 at 4:38 PM Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote:
>>
>> On Wed, Dec 25, 2024 at 11:58:51AM +0800, Chuanhong Guo wrote:
>>> From: Qingfang Deng <qingfang.deng@xxxxxxxxxxxxxxx>
>>>
>>> Add a driver for the GPIO controller on Siflower SoCs.
>>> This controller is found on all current Siflower MIPS and RISC-V
>>> chips including SF19A2890, SF21A6826 and SF21H8898.
>>>
>>> Signed-off-by: Qingfang Deng <qingfang.deng@xxxxxxxxxxxxxxx>
>>> Signed-off-by: Chuanhong Guo <gch981213@xxxxxxxxx>
>>> ---
>>>  drivers/gpio/Kconfig         |   9 +
>>>  drivers/gpio/Makefile        |   1 +
>>>  drivers/gpio/gpio-siflower.c | 353 +++++++++++++++++++++++++++++++++++
>>>  3 files changed, 363 insertions(+)
>>>  create mode 100644 drivers/gpio/gpio-siflower.c
>>>
>>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
>>> index add5ad29a673..fdc9a89ffbf3 100644
>>> --- a/drivers/gpio/Kconfig
>>> +++ b/drivers/gpio/Kconfig
>>> @@ -637,6 +637,15 @@ config GPIO_SIFIVE
>>>       help
>>>         Say yes here to support the GPIO device on SiFive SoCs.
>>>
>>> +config GPIO_SIFLOWER
>>> +     tristate "SiFlower GPIO support"
>>> +     depends on OF_GPIO
>>> +     depends on MIPS || RISCV || COMPILE_TEST
>>
>> This is supposed to be dependency on ARCH, not instruction set. I don't
>> se anything MIPS or RISCV here.
> 
> I haven't sent any arch patches yet. The SoCs basically work with
> MIPS/RISC-V generic kernel so I was planning to deal with it last with
> some device trees.
> Should I simply drop this dependency line for now, or should I add

This would work but OTOH it is also easy to forget to re-add it later.

> ARCH_xxx to arch/{mips,riscv}/Kconfig first?

But this is preferred. For me ARCH always comes first (or in parallel),
not the last. Why would we like to accept drivers which are not really
usable without the main parts?

> 
>>
>>> +     select GPIOLIB_IRQCHIP
>>> +     help
>>> +       GPIO controller driver for SiFlower MIPS and RISC-V SoCs
>>> +       including SF19A2890, SF21A6826 and SF21H8898.
>>
>> ...


> rm drivers/gpio/gpio-siflower.o && make ARCH=mips
> CROSS_COMPILE=mipsel-linux-gnu- W=1 drivers/gpio/gpio-siflower.o
>   CC      scripts/mod/empty.o
>   MKELF   scripts/mod/elfconfig.h
>   HOSTCC  scripts/mod/modpost.o
>   CC      scripts/mod/devicetable-offsets.s
>   HOSTCC  scripts/mod/file2alias.o
>   HOSTCC  scripts/mod/sumversion.o
>   HOSTCC  scripts/mod/symsearch.o
>   HOSTLD  scripts/mod/modpost
>   CC      kernel/bounds.s
>   CC      arch/mips/kernel/asm-offsets.s
>   CALL    scripts/checksyscalls.sh
>   CC      drivers/gpio/gpio-siflower.o
> 
>> Most of these commands (checks or W=1
>> build) can build specific targets, like some directory, to narrow the
>> scope to only your code. The code here looks like it needs a fix.
> 
> Would you mind sharing the warnings you found, and the command to
> reproduce those?

Cocci prints warning for the owner and based on owner presence I suspect
there could be more of patterns we fixed over last 10 years.

Best regards,
Krzysztof




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux