All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count
@ 2021-09-09 16:56 Michel Dänzer
  2021-09-09 18:06 ` Lyude Paul
  0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2021-09-09 16:56 UTC (permalink / raw)
  To: Alex Deucher, Christian König, Pan, Xinhui
  Cc: Guchun Chen, Lyude Paul, amd-gfx

From: Michel Dänzer <mdaenzer@redhat.com>

This was unusual; normally, inline functions are declared static as
well, and defined in a header file if used by multiple compilation
units. The latter would be more involved in this case, so just drop
the inline declaration for now.

Fixes compile failure building for ppc64le on RHEL 8:

In file included from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h:32,
                 from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:33:
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function ‘amdgpu_ras_recovery_init’:
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:90:17: error: inlining failed in call
 to ‘always_inline’ ‘amdgpu_ras_eeprom_max_record_count’: function body not available
   90 | inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1985:34: note: called from here
 1985 |         max_eeprom_records_len = amdgpu_ras_eeprom_max_record_count();
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# The function is called amdgpu_ras_eeprom_get_record_max_length on
# stable branches
Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)"
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
index 194590252bb9..210f30867870 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
@@ -756,7 +756,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,
 	return res;
 }
 
-inline uint32_t amdgpu_ras_eeprom_max_record_count(void)
+uint32_t amdgpu_ras_eeprom_max_record_count(void)
 {
 	return RAS_MAX_RECORD_COUNT;
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
index f95fc61b3021..6bb00578bfbb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
@@ -120,7 +120,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,
 int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,
 			     struct eeprom_table_record *records, const u32 num);
 
-inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
+uint32_t amdgpu_ras_eeprom_max_record_count(void);
 
 void amdgpu_ras_debugfs_set_ret_size(struct amdgpu_ras_eeprom_control *control);
 
-- 
2.33.0


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

* Re: [PATCH] drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count
  2021-09-09 16:56 [PATCH] drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count Michel Dänzer
@ 2021-09-09 18:06 ` Lyude Paul
  2021-09-13 16:49   ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Lyude Paul @ 2021-09-09 18:06 UTC (permalink / raw)
  To: Michel Dänzer, Alex Deucher, Christian König, Pan, Xinhui
  Cc: Guchun Chen, amd-gfx

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Thu, 2021-09-09 at 18:56 +0200, Michel Dänzer wrote:
> From: Michel Dänzer <mdaenzer@redhat.com>
> 
> This was unusual; normally, inline functions are declared static as
> well, and defined in a header file if used by multiple compilation
> units. The latter would be more involved in this case, so just drop
> the inline declaration for now.
> 
> Fixes compile failure building for ppc64le on RHEL 8:
> 
> In file included from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h:32,
>                  from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:33:
> ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function
> ‘amdgpu_ras_recovery_init’:
> ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:90:17: error: inlining
> failed in call
>  to ‘always_inline’ ‘amdgpu_ras_eeprom_max_record_count’: function body not
> available
>    90 | inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1985:34: note: called from here
>  1985 |         max_eeprom_records_len =
> amdgpu_ras_eeprom_max_record_count();
>       |                                 
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> # The function is called amdgpu_ras_eeprom_get_record_max_length on
> # stable branches
> Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)"
> Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> index 194590252bb9..210f30867870 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> @@ -756,7 +756,7 @@ int amdgpu_ras_eeprom_read(struct
> amdgpu_ras_eeprom_control *control,
>         return res;
>  }
>  
> -inline uint32_t amdgpu_ras_eeprom_max_record_count(void)
> +uint32_t amdgpu_ras_eeprom_max_record_count(void)
>  {
>         return RAS_MAX_RECORD_COUNT;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
> index f95fc61b3021..6bb00578bfbb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
> @@ -120,7 +120,7 @@ int amdgpu_ras_eeprom_read(struct
> amdgpu_ras_eeprom_control *control,
>  int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,
>                              struct eeprom_table_record *records, const u32
> num);
>  
> -inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
> +uint32_t amdgpu_ras_eeprom_max_record_count(void);
>  
>  void amdgpu_ras_debugfs_set_ret_size(struct amdgpu_ras_eeprom_control
> *control);
>  

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat


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

* Re: [PATCH] drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count
  2021-09-09 18:06 ` Lyude Paul
@ 2021-09-13 16:49   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2021-09-13 16:49 UTC (permalink / raw)
  To: Lyude Paul
  Cc: Michel Dänzer, Alex Deucher, Christian König, Pan,
	Xinhui, Guchun Chen, amd-gfx list

Applied.  Thanks!

Alex

On Thu, Sep 9, 2021 at 2:07 PM Lyude Paul <lyude@redhat.com> wrote:
>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
>
> On Thu, 2021-09-09 at 18:56 +0200, Michel Dänzer wrote:
> > From: Michel Dänzer <mdaenzer@redhat.com>
> >
> > This was unusual; normally, inline functions are declared static as
> > well, and defined in a header file if used by multiple compilation
> > units. The latter would be more involved in this case, so just drop
> > the inline declaration for now.
> >
> > Fixes compile failure building for ppc64le on RHEL 8:
> >
> > In file included from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h:32,
> >                  from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:33:
> > ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function
> > ‘amdgpu_ras_recovery_init’:
> > ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:90:17: error: inlining
> > failed in call
> >  to ‘always_inline’ ‘amdgpu_ras_eeprom_max_record_count’: function body not
> > available
> >    90 | inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
> >       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1985:34: note: called from here
> >  1985 |         max_eeprom_records_len =
> > amdgpu_ras_eeprom_max_record_count();
> >       |
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > # The function is called amdgpu_ras_eeprom_get_record_max_length on
> > # stable branches
> > Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)"
> > Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> > index 194590252bb9..210f30867870 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> > @@ -756,7 +756,7 @@ int amdgpu_ras_eeprom_read(struct
> > amdgpu_ras_eeprom_control *control,
> >         return res;
> >  }
> >
> > -inline uint32_t amdgpu_ras_eeprom_max_record_count(void)
> > +uint32_t amdgpu_ras_eeprom_max_record_count(void)
> >  {
> >         return RAS_MAX_RECORD_COUNT;
> >  }
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
> > index f95fc61b3021..6bb00578bfbb 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
> > @@ -120,7 +120,7 @@ int amdgpu_ras_eeprom_read(struct
> > amdgpu_ras_eeprom_control *control,
> >  int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,
> >                              struct eeprom_table_record *records, const u32
> > num);
> >
> > -inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
> > +uint32_t amdgpu_ras_eeprom_max_record_count(void);
> >
> >  void amdgpu_ras_debugfs_set_ret_size(struct amdgpu_ras_eeprom_control
> > *control);
> >
>
> --
> Cheers,
>  Lyude Paul (she/her)
>  Software Engineer at Red Hat
>

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

* Re: [PATCH] drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count
  2021-09-09 16:54 Michel Dänzer
@ 2021-09-09 16:58 ` Michel Dänzer
  0 siblings, 0 replies; 5+ messages in thread
From: Michel Dänzer @ 2021-09-09 16:58 UTC (permalink / raw)
  To: Alex Deucher, Christian König, Xinhui; +Cc: Guchun Chen, amd-gfx


Apologies, I messed up the recipients in this patch, please follow up to the fixed version I just sent.


-- 
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer

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

* [PATCH] drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count
@ 2021-09-09 16:54 Michel Dänzer
  2021-09-09 16:58 ` Michel Dänzer
  0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2021-09-09 16:54 UTC (permalink / raw)
  To: Alex Deucher, Christian König, Pan, Xinhui; +Cc: Guchun Chen, amd-gfx

From: Michel Dänzer <mdaenzer@redhat.com>

This was unusual; normally, inline functions are declared static as
well, and defined in a header file if used by multiple compilation
units. The latter would be more involved in this case, so just drop
the inline declaration for now.

Fixes compile failure building for ppc64le on RHEL 8:

In file included from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h:32,
                 from ../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:33:
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function ‘amdgpu_ras_recovery_init’:
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h:90:17: error: inlining failed in call
 to ‘always_inline’ ‘amdgpu_ras_eeprom_max_record_count’: function body not available
   90 | inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1985:34: note: called from here
 1985 |         max_eeprom_records_len = amdgpu_ras_eeprom_max_record_count();
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# The function is called amdgpu_ras_eeprom_get_record_max_length on
# stable branches
Fixes: c84d46707ebb "drm/amdgpu: validate bad page threshold in ras(v3)"
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
index 194590252bb9..210f30867870 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
@@ -756,7 +756,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,
 	return res;
 }
 
-inline uint32_t amdgpu_ras_eeprom_max_record_count(void)
+uint32_t amdgpu_ras_eeprom_max_record_count(void)
 {
 	return RAS_MAX_RECORD_COUNT;
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
index f95fc61b3021..6bb00578bfbb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.h
@@ -120,7 +120,7 @@ int amdgpu_ras_eeprom_read(struct amdgpu_ras_eeprom_control *control,
 int amdgpu_ras_eeprom_append(struct amdgpu_ras_eeprom_control *control,
 			     struct eeprom_table_record *records, const u32 num);
 
-inline uint32_t amdgpu_ras_eeprom_max_record_count(void);
+uint32_t amdgpu_ras_eeprom_max_record_count(void);
 
 void amdgpu_ras_debugfs_set_ret_size(struct amdgpu_ras_eeprom_control *control);
 
-- 
2.33.0


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

end of thread, other threads:[~2021-09-13 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 16:56 [PATCH] drm/amdgpu: Drop inline from amdgpu_ras_eeprom_max_record_count Michel Dänzer
2021-09-09 18:06 ` Lyude Paul
2021-09-13 16:49   ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2021-09-09 16:54 Michel Dänzer
2021-09-09 16:58 ` Michel Dänzer

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.