netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sfc_ef100: Fix build failure on powerpc
@ 2020-08-13 14:39 Christophe Leroy
  2020-08-13 14:55 ` Edward Cree
  2020-08-13 15:57 ` Segher Boessenkool
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe Leroy @ 2020-08-13 14:39 UTC (permalink / raw)
  To: Solarflare linux maintainers, Edward Cree, Martin Habets,
	David S. Miller, Jakub Kicinski
  Cc: linux-kernel, linuxppc-dev, netdev

ppc6xx_defconfig fails building sfc.ko module, complaining
about the lack of _umoddi3 symbol.

This is due to the following test

 		if (EFX_MIN_DMAQ_SIZE % reader->value) {

Because reader->value is u64.

As EFX_MIN_DMAQ_SIZE value is 512, reader->value is obviously small
enough for an u32 calculation, so cast it as (u32) for the test, to
avoid the need for _umoddi3.

Fixes: adcfc3482fff ("sfc_ef100: read Design Parameters at probe time")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 drivers/net/ethernet/sfc/ef100_nic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/ef100_nic.c b/drivers/net/ethernet/sfc/ef100_nic.c
index 36598d0542ed..234400b69b07 100644
--- a/drivers/net/ethernet/sfc/ef100_nic.c
+++ b/drivers/net/ethernet/sfc/ef100_nic.c
@@ -979,7 +979,7 @@ static int ef100_process_design_param(struct efx_nic *efx,
 		 * EFX_MIN_DMAQ_SIZE is divisible by GRANULARITY.
 		 * This is very unlikely to fail.
 		 */
-		if (EFX_MIN_DMAQ_SIZE % reader->value) {
+		if (EFX_MIN_DMAQ_SIZE % (u32)reader->value) {
 			netif_err(efx, probe, efx->net_dev,
 				  "%s size granularity is %llu, can't guarantee safety\n",
 				  reader->type == ESE_EF100_DP_GZ_RXQ_SIZE_GRANULARITY ? "RXQ" : "TXQ",
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sfc_ef100: Fix build failure on powerpc
  2020-08-13 14:39 [PATCH] sfc_ef100: Fix build failure on powerpc Christophe Leroy
@ 2020-08-13 14:55 ` Edward Cree
  2020-08-13 15:57 ` Segher Boessenkool
  1 sibling, 0 replies; 3+ messages in thread
From: Edward Cree @ 2020-08-13 14:55 UTC (permalink / raw)
  To: Christophe Leroy, Solarflare linux maintainers, Martin Habets,
	David S. Miller, Jakub Kicinski
  Cc: linux-kernel, linuxppc-dev, netdev

On 13/08/2020 15:39, Christophe Leroy wrote:
> ppc6xx_defconfig fails building sfc.ko module, complaining
> about the lack of _umoddi3 symbol.
>
> This is due to the following test
>
>  		if (EFX_MIN_DMAQ_SIZE % reader->value) {
>
> Because reader->value is u64.
Already fixed in net.git by 41077c990266 ("sfc: fix ef100 design-param checking").
But thanks anyway.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sfc_ef100: Fix build failure on powerpc
  2020-08-13 14:39 [PATCH] sfc_ef100: Fix build failure on powerpc Christophe Leroy
  2020-08-13 14:55 ` Edward Cree
@ 2020-08-13 15:57 ` Segher Boessenkool
  1 sibling, 0 replies; 3+ messages in thread
From: Segher Boessenkool @ 2020-08-13 15:57 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Solarflare linux maintainers, Edward Cree, Martin Habets,
	David S. Miller, Jakub Kicinski, netdev, linuxppc-dev,
	linux-kernel

On Thu, Aug 13, 2020 at 02:39:10PM +0000, Christophe Leroy wrote:
> ppc6xx_defconfig fails building sfc.ko module, complaining
> about the lack of _umoddi3 symbol.
> 
> This is due to the following test
> 
>  		if (EFX_MIN_DMAQ_SIZE % reader->value) {
> 
> Because reader->value is u64.
> 
> As EFX_MIN_DMAQ_SIZE value is 512, reader->value is obviously small
> enough for an u32 calculation, so cast it as (u32) for the test, to
> avoid the need for _umoddi3.

That isn't the same e.g. if reader->value is 2**32 + small.  Which
probably cannot happen, but :-)


Segher

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-13 15:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 14:39 [PATCH] sfc_ef100: Fix build failure on powerpc Christophe Leroy
2020-08-13 14:55 ` Edward Cree
2020-08-13 15:57 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).