lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 21 May 2020 09:08:35 +0800
From:   Orson Zhai <>
To:     Arnd Bergmann <>
Cc:     Baolin Wang <>,
        Lee Jones <>,
        Mark Brown <>,
        Lyra Zhang <>,
        "" <>
Subject: Re: [PATCH v4 1/2] mfd: syscon: Support physical regmap bus

On Tue, May 19, 2020 at 9:19 PM Arnd Bergmann <> wrote:
> On Sat, May 16, 2020 at 12:13 PM Baolin Wang <> wrote:
> >
> > Some platforms such as Spreadtrum platform, define a special method to
> > update bits of the registers instead of reading and writing, which means
> > we should use a physical regmap bus to define the reg_update_bits()
> > operation instead of the MMIO regmap bus.
> >
> > Thus add a a __weak function  for the syscon driver to allow to register
> > a physical regmap bus to support this new requirement.
> >
> >  };
> >
> > +struct regmap * __weak syscon_regmap_init(struct device_node *np,
> > +                                         void __iomem *base,
> > +                                         struct regmap_config *syscon_config)
> > +{
> > +       return regmap_init_mmio(NULL, base, syscon_config);
> > +}
> > +
> Sorry, I don't think the __weak function is going to help here. I'm not
> sure whether it actually does what you want when both syscon and
> sprd_syscon are loadable modules (I would guess not), but it clearly
> won't work when syscon is built-in and sprd_syscon is a module, and
> even if the module loader knows how to resolve __weak symbols,

I happened to see module.c last week. It seems there's some code to handle
weak symbols by checking about STB_WEAK. But it is not in this case.
When syscon.c is built-in and sprd_syscon is module, this would not
work because the
__weak one has been built into kernel already. Maybe live patch
feature may work it out.
But it seems over expensive  to do things like this.

> I would not want to rely on module load ordering to make it behave
> the right way.

Agree. All other sprd modules would must be loaded behind sprd_syscon
and this will not be
handled by modprobe.

Thanks to pointing out this.


>       Arnd

Powered by blists - more mailing lists