[1/5] power: vexpress: add suppress_bind_attrs to true
diff mbox series

Message ID 20200527112608.3886105-2-anders.roxell@linaro.org
State Queued
Headers show
Series
  • vexpress: modularize power reset driver
Related show

Commit Message

Anders Roxell May 27, 2020, 11:26 a.m. UTC
Make sure that the POWER_RESET_VEXPRESS driver won't have bind/unbind
attributes available via the sysfs, so lets be explicit here and use
".suppress_bind_attrs = true" to prevent userspace from doing something
silly.

Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 drivers/power/reset/vexpress-poweroff.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Rob Herring May 27, 2020, 1:26 p.m. UTC | #1
On Wed, May 27, 2020 at 5:26 AM Anders Roxell <anders.roxell@linaro.org> wrote:
>
> Make sure that the POWER_RESET_VEXPRESS driver won't have bind/unbind
> attributes available via the sysfs, so lets be explicit here and use
> ".suppress_bind_attrs = true" to prevent userspace from doing something
> silly.

This doesn't really make sense if we're going to make this a module.
Module unloading and unbind introduce the same requirements of
cleaning up (undoing whatever probe did).

Rob
Arnd Bergmann May 28, 2020, 10:25 a.m. UTC | #2
On Wed, May 27, 2020 at 3:27 PM Rob Herring <robh@kernel.org> wrote:
>
> On Wed, May 27, 2020 at 5:26 AM Anders Roxell <anders.roxell@linaro.org> wrote:
> >
> > Make sure that the POWER_RESET_VEXPRESS driver won't have bind/unbind
> > attributes available via the sysfs, so lets be explicit here and use
> > ".suppress_bind_attrs = true" to prevent userspace from doing something
> > silly.
>
> This doesn't really make sense if we're going to make this a module.
> Module unloading and unbind introduce the same requirements of
> cleaning up (undoing whatever probe did).

I still want this change as a separate patch so we can backport it to stable
kernels for correctness.

Also, as long as we don't have a working (and tested) .remove callback,
we can only allow making the driver a loadable module but not also
allowing the module to be removed.

      Arnd

Patch
diff mbox series

diff --git a/drivers/power/reset/vexpress-poweroff.c b/drivers/power/reset/vexpress-poweroff.c
index 90cbaa8341e3..0bf9ab8653ae 100644
--- a/drivers/power/reset/vexpress-poweroff.c
+++ b/drivers/power/reset/vexpress-poweroff.c
@@ -143,6 +143,7 @@  static struct platform_driver vexpress_reset_driver = {
 	.driver = {
 		.name = "vexpress-reset",
 		.of_match_table = vexpress_reset_of_match,
+		.suppress_bind_attrs = true,
 	},
 };