mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Vamsi Attunuru" <vattunuru@marvell.com>,
	"Nathan Chancellor" <nathan@kernel.org>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [EXTERNAL] Re: [PATCH] misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI
Date: Tue, 16 Jul 2024 17:48:38 +0200	[thread overview]
Message-ID: <10d583d4-29ec-4dae-8629-f6097639cc4e@app.fastmail.com> (raw)
In-Reply-To: <MW4PR18MB5244F75E2D16051A5B838FF5A6A22@MW4PR18MB5244.namprd18.prod.outlook.com>

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

  reply	other threads:[~2024-07-16 15:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-11 12:01 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 [this message]
2024-07-17  0:28       ` Nathan Chancellor

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=10d583d4-29ec-4dae-8629-f6097639cc4e@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=vattunuru@marvell.com \
    /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 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®