* [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI @ 2024-07-11 12:01 Vamsi Attunuru 2024-07-16 13:26 ` Nathan Chancellor 0 siblings, 1 reply; 6+ messages in thread From: Vamsi Attunuru @ 2024-07-11 12:01 UTC (permalink / raw) To: arnd, gregkh; +Cc: linux-kernel, vattunuru DPI hardware is an on-chip PCIe device on Marvell's arm64 SoC platforms. As Arnd suggested, CN10K belongs to ARCH_THUNDER lineage. Patch makes mrvl_cn10k_dpi driver dependent on CONFIG_ARCH_THUNDER. Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com> --- drivers/misc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 64fcca9e44d7..f3bb75384627 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -588,6 +588,7 @@ config NSM config MARVELL_CN10K_DPI tristate "Octeon CN10K DPI driver" depends on PCI + depends on ARCH_THUNDER || COMPILE_TEST help Enables Octeon CN10K DMA packet interface (DPI) driver which intializes DPI hardware's physical function (PF) device's -- 2.25.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI 2024-07-11 12:01 [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI Vamsi Attunuru @ 2024-07-16 13:26 ` Nathan Chancellor 2024-07-16 13:51 ` Arnd Bergmann 0 siblings, 1 reply; 6+ messages in thread From: Nathan Chancellor @ 2024-07-16 13:26 UTC (permalink / raw) To: Vamsi Attunuru; +Cc: arnd, gregkh, linux-kernel Hi Vamsi, On Thu, Jul 11, 2024 at 05:01:15AM -0700, Vamsi Attunuru wrote: > DPI hardware is an on-chip PCIe device on Marvell's arm64 SoC > platforms. As Arnd suggested, CN10K belongs to ARCH_THUNDER > lineage. > > Patch makes mrvl_cn10k_dpi driver dependent on CONFIG_ARCH_THUNDER. > > Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com> > --- > drivers/misc/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig > index 64fcca9e44d7..f3bb75384627 100644 > --- a/drivers/misc/Kconfig > +++ b/drivers/misc/Kconfig > @@ -588,6 +588,7 @@ config NSM > config MARVELL_CN10K_DPI > tristate "Octeon CN10K DPI driver" > depends on PCI > + depends on ARCH_THUNDER || COMPILE_TEST > help > Enables Octeon CN10K DMA packet interface (DPI) driver which > intializes DPI hardware's physical function (PF) device's > -- > 2.25.1 > After this change, ARCH=arm allmodconfig fails with: drivers/misc/mrvl_cn10k_dpi.c: In function 'dpi_reg_write': drivers/misc/mrvl_cn10k_dpi.c:190:9: error: implicit declaration of function 'writeq'; did you mean 'writeb'? [-Wimplicit-function-declaration] 190 | writeq(val, dpi->reg_base + offset); | ^~~~~~ | writeb drivers/misc/mrvl_cn10k_dpi.c: In function 'dpi_reg_read': drivers/misc/mrvl_cn10k_dpi.c:195:16: error: implicit declaration of function 'readq'; did you mean 'readb'? [-Wimplicit-function-declaration] 195 | return readq(dpi->reg_base + offset); | ^~~~~ | readb Including one of the io-64-nonatomic headers would resolve this but I am not sure which one would be appropriate (or perhaps the dependency should be tightened to requiring 64BIT, as some other drivers have done). Cheers, Nathan ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI 2024-07-16 13:26 ` Nathan Chancellor @ 2024-07-16 13:51 ` Arnd Bergmann 2024-07-16 15:33 ` [EXTERNAL] " Vamsi Krishna Attunuru 0 siblings, 1 reply; 6+ messages in thread From: Arnd Bergmann @ 2024-07-16 13:51 UTC (permalink / raw) To: Nathan Chancellor, Vamsi Attunuru; +Cc: Greg Kroah-Hartman, linux-kernel On Tue, Jul 16, 2024, at 15:26, Nathan Chancellor wrote: > On Thu, Jul 11, 2024 at 05:01:15AM -0700, Vamsi Attunuru wrote: >> > > After this change, ARCH=arm allmodconfig fails with: > > drivers/misc/mrvl_cn10k_dpi.c: In function 'dpi_reg_write': > drivers/misc/mrvl_cn10k_dpi.c:190:9: error: implicit declaration of > function 'writeq'; did you mean 'writeb'? > [-Wimplicit-function-declaration] > 190 | writeq(val, dpi->reg_base + offset); > | ^~~~~~ > | writeb > drivers/misc/mrvl_cn10k_dpi.c: In function 'dpi_reg_read': > drivers/misc/mrvl_cn10k_dpi.c:195:16: error: implicit declaration of > function 'readq'; did you mean 'readb'? > [-Wimplicit-function-declaration] > 195 | return readq(dpi->reg_base + offset); > | ^~~~~ > | readb > > Including one of the io-64-nonatomic headers would resolve this but I am > not sure which one would be appropriate (or perhaps the dependency > should be tightened to requiring 64BIT, as some other drivers have > done). Right, a dependency on 64BIT makes sense here. The alternative is to include linux/io-64-nonatomic-hi-lo.h or linux/io-64-nonatomic-lo-hi.h in order to have a replacement readq/writeq implementation that works on 32-bit architectures. However, doing this requires understanding whether what the side-effects of accessing the 64-bit registers are and whether they require writing the upper or lower half of the register last. Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [EXTERNAL] Re: [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI 2024-07-16 13:51 ` Arnd Bergmann @ 2024-07-16 15:33 ` Vamsi Krishna Attunuru 2024-07-16 15:48 ` Arnd Bergmann 2024-07-17 0:28 ` Nathan Chancellor 0 siblings, 2 replies; 6+ messages in thread From: Vamsi Krishna Attunuru @ 2024-07-16 15:33 UTC (permalink / raw) To: Arnd Bergmann, Nathan Chancellor; +Cc: Greg Kroah-Hartman, linux-kernel >-----Original Message----- >From: Arnd Bergmann <arnd@arndb.de> >Sent: Tuesday, July 16, 2024 7:21 PM >To: Nathan Chancellor <nathan@kernel.org>; Vamsi Krishna Attunuru ><vattunuru@marvell.com> >Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux- >kernel@vger.kernel.org >Subject: [EXTERNAL] Re: [PATCH] misc: Kconfig: add a new dependency for >MARVELL_CN10K_DPI > >On Tue, Jul 16, 2024, at 15: 26, Nathan Chancellor wrote: > On Thu, Jul 11, 2024 >at 05: 01: 15AM -0700, Vamsi Attunuru wrote: >> > > After this change, >ARCH=arm allmodconfig fails with: > > drivers/misc/mrvl_cn10k_dpi. c: In > >On Tue, Jul 16, 2024, at 15:26, Nathan Chancellor wrote: >> On Thu, Jul 11, 2024 at 05:01:15AM -0700, Vamsi Attunuru wrote: >>> >> >> After this change, ARCH=arm allmodconfig fails with: >> >> drivers/misc/mrvl_cn10k_dpi.c: In function 'dpi_reg_write': >> drivers/misc/mrvl_cn10k_dpi.c:190:9: error: implicit declaration of >> function 'writeq'; did you mean 'writeb'? >> [-Wimplicit-function-declaration] >> 190 | writeq(val, dpi->reg_base + offset); >> | ^~~~~~ >> | writeb >> drivers/misc/mrvl_cn10k_dpi.c: In function 'dpi_reg_read': >> drivers/misc/mrvl_cn10k_dpi.c:195:16: error: implicit declaration of >> function 'readq'; did you mean 'readb'? >> [-Wimplicit-function-declaration] >> 195 | return readq(dpi->reg_base + offset); >> | ^~~~~ >> | readb >> >> Including one of the io-64-nonatomic headers would resolve this but I >> am not sure which one would be appropriate (or perhaps the dependency >> should be tightened to requiring 64BIT, as some other drivers have >> done). > >Right, a dependency on 64BIT makes sense here. The alternative is to include >linux/io-64-nonatomic-hi-lo.h or linux/io-64-nonatomic-lo-hi.h in order to >have a replacement readq/writeq implementation that works on 32-bit >architectures. However, doing this requires understanding whether what the >side-effects of accessing the 64-bit registers are and whether they require >writing the upper or lower half of the register last. > Yes Arnd, I am checking the functionality using lo-hi calls that you suggested. If it has any implications, I will fix it with the 64BIT dependency. Thanks, Nathan, for reaching out. Could you please advise on the branch where I should implement the fix. > Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [EXTERNAL] Re: [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI 2024-07-16 15:33 ` [EXTERNAL] " Vamsi Krishna Attunuru @ 2024-07-16 15:48 ` Arnd Bergmann 2024-07-17 0:28 ` Nathan Chancellor 1 sibling, 0 replies; 6+ messages in thread From: Arnd Bergmann @ 2024-07-16 15:48 UTC (permalink / raw) To: Vamsi Attunuru, Nathan Chancellor; +Cc: Greg Kroah-Hartman, linux-kernel On Tue, Jul 16, 2024, at 17:33, Vamsi Krishna Attunuru wrote: >>> Including one of the io-64-nonatomic headers would resolve this but I >>> am not sure which one would be appropriate (or perhaps the dependency >>> should be tightened to requiring 64BIT, as some other drivers have >>> done). >> >>Right, a dependency on 64BIT makes sense here. The alternative is to include >>linux/io-64-nonatomic-hi-lo.h or linux/io-64-nonatomic-lo-hi.h in order to >>have a replacement readq/writeq implementation that works on 32-bit >>architectures. However, doing this requires understanding whether what the >>side-effects of accessing the 64-bit registers are and whether they require >>writing the upper or lower half of the register last. >> > > Yes Arnd, I am checking the functionality using lo-hi calls that you suggested. > If it has any implications, I will fix it with the 64BIT dependency. > If the datasheet does not give you any insight about how it works, you can try it out on a 64-bit kernel by changing all the readq/writeq into lo_hi_readq()/lo_hi_writeq() or hi_lo_readq()/hi_lo_writeq() after including the corresponding header. Usually only one of the two works, or possibly neither if the registers require 64-bit access. If you figure out which one works, you can change the calls back to readq/writeq and leave the correct header included that will provide fallback implementations on 32-bit architectures but use the native 64-bit access on 64-bit architectures. In practice this is not really important because nobody will ever need to use this driver on a 32-bit kernel, given that this SoC only supports 32-bit usermode but not kernel. Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [EXTERNAL] Re: [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI 2024-07-16 15:33 ` [EXTERNAL] " Vamsi Krishna Attunuru 2024-07-16 15:48 ` Arnd Bergmann @ 2024-07-17 0:28 ` Nathan Chancellor 1 sibling, 0 replies; 6+ messages in thread From: Nathan Chancellor @ 2024-07-17 0:28 UTC (permalink / raw) To: Vamsi Krishna Attunuru; +Cc: Arnd Bergmann, Greg Kroah-Hartman, linux-kernel On Tue, Jul 16, 2024 at 03:33:49PM +0000, Vamsi Krishna Attunuru wrote: > Thanks, Nathan, for reaching out. Could you please advise on the branch where > I should implement the fix. I assume char-misc-next, as that is where the broken changes are. https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/log/?h=char-misc-next Cheers, Nathan ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-07-17 0:28 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-07-11 12:01 [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI Vamsi Attunuru 2024-07-16 13:26 ` Nathan Chancellor 2024-07-16 13:51 ` Arnd Bergmann 2024-07-16 15:33 ` [EXTERNAL] " Vamsi Krishna Attunuru 2024-07-16 15:48 ` Arnd Bergmann 2024-07-17 0:28 ` Nathan Chancellor
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®