Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632765

Re: [PATCHv2 2/2] arm64: cpufeature: use static_branch_enable_cpuslocked()

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCHv2 2/2] arm64: cpufeature: use static_branch_enable_cpuslocked()
Date 2017-04-28 12:10 +0200
Message-ID <tBb0C-5UI-21@gated-at.bofh.it> (permalink)
References <tAVId-3OA-5@gated-at.bofh.it> <tAVIe-3OA-21@gated-at.bofh.it> <tAW1z-4ez-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 27, 2017 at 07:01:04PM +0100, Will Deacon wrote:
> On Thu, Apr 27, 2017 at 06:44:37PM +0100, Mark Rutland wrote:
> > diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c
> > index f6cc67e..379ad8d 100644
> > --- a/arch/arm64/kernel/cpu_errata.c
> > +++ b/arch/arm64/kernel/cpu_errata.c
> > @@ -175,9 +175,20 @@ void verify_local_cpu_errata_workarounds(void)
> >  		}
> >  }
> >  
> > -void update_cpu_errata_workarounds(void)
> > +/*
> > + * Secondary CPUs are booted with the waker holding the
> > + * CPU hotplug lock, hence we don't need to lock it here again.
> > + */
> > +void update_secondary_cpu_errata_workarounds(void)
> > +{
> > +	update_cpu_capabilities(arm64_errata, "enabling workaround for");
> > +}
> > +
> > +void update_boot_cpu_errata_workarounds(void)
> >  {
> > +	get_online_cpus();
> >  	update_cpu_capabilities(arm64_errata, "enabling workaround for");
> > +	put_online_cpus();
> >  }
> 
> These functions seem to have unhelpful names, especially when compared to
> the naming scheme used by the core code. I'd prefer to have:
> 
> update_cpu_errata_workarounds: just calls update_cpu_capabilities
> 
> update_cpu_errata_workarounds_cpuslocked: does get_online_cpus(), then calls
> update_cpu_errata_workarounds, then does put_online_cpus();

That's the opposite polarity to the other _cpuslocked functions, where
_cpuslocked means that the lock is already held (and should not be taken
by the _cpuslocked function itself.

So I'll make those changes, but I'll swap that so:
update_cpu_errata_workarounds() does:

  get_online_cpus()
  update_cpu_errata_workarounds_cpuslocked()
  put_online_cpus()

> With that change:
> 
> Acked-by: Will Deacon <will.deacon@arm.com>

I assume that will stand with the above change. Please shout if not!

Thanks,
Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv2 0/2] arm64: fix hotplug rwsem boot fallout Mark Rutland <mark.rutland@arm.com> - 2017-04-27 19:50 +0200
  [PATCHv2 2/2] arm64: cpufeature: use static_branch_enable_cpuslocked() Mark Rutland <mark.rutland@arm.com> - 2017-04-27 19:50 +0200
    Re: [PATCHv2 2/2] arm64: cpufeature: use  static_branch_enable_cpuslocked() Will Deacon <will.deacon@arm.com> - 2017-04-27 20:10 +0200
      Re: [PATCHv2 2/2] arm64: cpufeature: use  static_branch_enable_cpuslocked() Mark Rutland <mark.rutland@arm.com> - 2017-04-28 12:10 +0200
        Re: [PATCHv2 2/2] arm64: cpufeature: use  static_branch_enable_cpuslocked() Will Deacon <will.deacon@arm.com> - 2017-04-28 12:10 +0200
  [PATCHv2 1/2] jump_label: Provide static_key_[enable|/slow_inc]_cpuslocked() Mark Rutland <mark.rutland@arm.com> - 2017-04-27 19:50 +0200

csiph-web