All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Alex Elder <elder@linaro.org>, davem@davemloft.net, kuba@kernel.org
Cc: bjorn.andersson@linaro.org, evgreen@chromium.org,
	cpratapa@codeaurora.org, subashab@codeaurora.org,
	elder@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/4] net: ipa: use upper_32_bits()
Date: Thu, 18 Mar 2021 09:03:32 -0700	[thread overview]
Message-ID: <75a8c09b-783a-6d05-2e56-02bd02ff3ff0@gmail.com> (raw)
In-Reply-To: <20210318135141.583977-3-elder@linaro.org>



On 3/18/2021 6:51 AM, Alex Elder wrote:
> Use upper_32_bits() to extract the high-order 32 bits of a DMA
> address.  This avoids doing a 32-position shift on a DMA address
> if it happens not to be 64 bits wide.
> 
> Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Alex Elder <elder@linaro.org>
> ---
> v2: - Switched to use the existing function, as suggested by Florian.
> 
>  drivers/net/ipa/gsi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ipa/gsi.c b/drivers/net/ipa/gsi.c
> index 2119367b93ea9..82c5a0d431ee5 100644
> --- a/drivers/net/ipa/gsi.c
> +++ b/drivers/net/ipa/gsi.c
> @@ -711,7 +711,7 @@ static void gsi_evt_ring_program(struct gsi *gsi, u32 evt_ring_id)
>  	val = evt_ring->ring.addr & GENMASK(31, 0);

Did you want to introduce another patch to use lower_32_bits() for the
assignment above?

>  	iowrite32(val, gsi->virt + GSI_EV_CH_E_CNTXT_2_OFFSET(evt_ring_id));
>  
> -	val = evt_ring->ring.addr >> 32;
> +	val = upper_32_bits(evt_ring->ring.addr);
>  	iowrite32(val, gsi->virt + GSI_EV_CH_E_CNTXT_3_OFFSET(evt_ring_id));
>  
>  	/* Enable interrupt moderation by setting the moderation delay */
> @@ -819,7 +819,7 @@ static void gsi_channel_program(struct gsi_channel *channel, bool doorbell)
>  	val = channel->tre_ring.addr & GENMASK(31, 0);

And likewise?

>  	iowrite32(val, gsi->virt + GSI_CH_C_CNTXT_2_OFFSET(channel_id));
>  
> -	val = channel->tre_ring.addr >> 32;
> +	val = upper_32_bits(channel->tre_ring.addr);
>  	iowrite32(val, gsi->virt + GSI_CH_C_CNTXT_3_OFFSET(channel_id));
>  
>  	/* Command channel gets low weighted round-robin priority */
> 

-- 
Florian

  reply	other threads:[~2021-03-18 16:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 13:51 [PATCH net-next v2 0/4] net: ipa: support 32-bit targets Alex Elder
2021-03-18 13:51 ` [PATCH net-next v2 1/4] net: ipa: fix assumptions about DMA address size Alex Elder
2021-03-18 13:51 ` [PATCH net-next v2 2/4] net: ipa: use upper_32_bits() Alex Elder
2021-03-18 16:03   ` Florian Fainelli [this message]
2021-03-18 16:24     ` Alex Elder
2021-03-18 13:51 ` [PATCH net-next v2 3/4] net: ipa: fix table alignment requirement Alex Elder
2021-03-18 13:51 ` [PATCH net-next v2 4/4] net: ipa: relax 64-bit build requirement Alex Elder

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=75a8c09b-783a-6d05-2e56-02bd02ff3ff0@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=cpratapa@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=elder@kernel.org \
    --cc=elder@linaro.org \
    --cc=evgreen@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=subashab@codeaurora.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.