2023-07-21 17:05:44

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v3 14/42] power: reset: Add a driver for the ep93xx reset

On Thu, Jul 20, 2023 at 02:29:14PM +0300, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <[email protected]>
>
> Implement the reset behaviour of the various EP93xx SoCS in drivers/power/reset.
>
> It used to be located in arch/arm/mach-ep93xx.

...

> +// SPDX-License-Identifier: (GPL-2.0)

Are you sure this is correct form? Have you checked your patches?

...

> +#include <linux/of_device.h>

Do you need this?
Or maybe you need another (of*.h) one?

...

> + /* Issue the reboot */
> + ep93xx_devcfg_set_clear(priv->map, EP93XX_SYSCON_DEVCFG_SWRST, 0x00);
> + ep93xx_devcfg_set_clear(priv->map, 0x00, EP93XX_SYSCON_DEVCFG_SWRST);


> + mdelay(1000);

Atomic?! Such a huge delay must be explained, esp. why it's atomic.

> + pr_emerg("Unable to restart system\n");
> + return NOTIFY_DONE;

...

> + err = register_restart_handler(&priv->restart_handler);
> + if (err)
> + return dev_err_probe(dev, err, "can't register restart notifier\n");

> + return err;

return 0;

--
With Best Regards,
Andy Shevchenko




2023-07-28 15:31:31

by Nikita Shubin

[permalink] [raw]
Subject: Re: [PATCH v3 14/42] power: reset: Add a driver for the ep93xx reset

On Fri, 2023-07-21 at 19:37 +0300, Andy Shevchenko wrote:
> On Thu, Jul 20, 2023 at 02:29:14PM +0300, Nikita Shubin via B4 Relay
> wrote:
> > From: Nikita Shubin <[email protected]>
> >
> > Implement the reset behaviour of the various EP93xx SoCS in
> > drivers/power/reset.
> >
> > It used to be located in arch/arm/mach-ep93xx.
>
> ...
>
> > +// SPDX-License-Identifier: (GPL-2.0)
>
> Are you sure this is correct form? 

Should it be // SPDX-License-Identifier: GPL-2.0+ ?

> Have you checked your patches?

Could you please be more specific:
$ scripts/checkpatch.pl -f drivers/power/reset/ep93xx-restart.c
total: 0 errors, 0 warnings, 86 lines checked

$ git format-patch -1 51f03c64b8fde79fb16b146d87769b7508b6d114 --stdout
| scripts/checkpatch.pl -
WARNING: please write a help paragraph that fully describes the config
symbol
...
WARNING: added, moved or deleted file(s), does MAINTAINERS need
updating?

I don't see any license complains...

checkpatch.pl is working as intented as:

$ scripts/checkpatch.pl -f drivers/power/reset/ep93xx-restart.c
WARNING: 'SPDX-License-Identifier: (FOOOO)' is not supported in
LICENSES/...
#1: FILE: drivers/power/reset/ep93xx-restart.c:1:
+// SPDX-License-Identifier: (FOOOO)

>
> ...
>
> > +#include <linux/of_device.h>
>
> Do you need this?
> Or maybe you need another (of*.h) one?
>
> ...
>
> > +       /* Issue the reboot */
> > +       ep93xx_devcfg_set_clear(priv->map,
> > EP93XX_SYSCON_DEVCFG_SWRST, 0x00);
> > +       ep93xx_devcfg_set_clear(priv->map, 0x00,
> > EP93XX_SYSCON_DEVCFG_SWRST);
>
>
> > +       mdelay(1000);
>
> Atomic?! Such a huge delay must be explained, esp. why it's atomic.

Indeed let's drop it entirely.

>
> > +       pr_emerg("Unable to restart system\n");
> > +       return NOTIFY_DONE;
>
> ...
>
> > +       err = register_restart_handler(&priv->restart_handler);
> > +       if (err)
> > +               return dev_err_probe(dev, err, "can't register
> > restart notifier\n");
>
> > +       return err;
>
>         return 0;
>


2023-07-31 21:03:46

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v3 14/42] power: reset: Add a driver for the ep93xx reset

On Fri, Jul 28, 2023 at 04:53:19PM +0300, Nikita Shubin wrote:
> On Fri, 2023-07-21 at 19:37 +0300, Andy Shevchenko wrote:
> > On Thu, Jul 20, 2023 at 02:29:14PM +0300, Nikita Shubin via B4 Relay
> > wrote:

...

> > > +// SPDX-License-Identifier: (GPL-2.0)
> >
> > Are you sure this is correct form??
>
> Should it be // SPDX-License-Identifier: GPL-2.0+ ?

I don't know, ask your Legal department or your lawyer.

(note that the 2.0-only and 2.0-or-later are different)

I'm talking only about the form, not about the licence itself.

> > Have you checked your patches?
>
> Could you please be more specific:
> $ scripts/checkpatch.pl -f drivers/power/reset/ep93xx-restart.c
> total: 0 errors, 0 warnings, 86 lines checked
>
> $ git format-patch -1 51f03c64b8fde79fb16b146d87769b7508b6d114 --stdout
> | scripts/checkpatch.pl -
> WARNING: please write a help paragraph that fully describes the config
> symbol
> ...
> WARNING: added, moved or deleted file(s), does MAINTAINERS need
> updating?
>
> I don't see any license complains...

checkpatch is not the ideal tool...

> checkpatch.pl is working as intented as:
>
> $ scripts/checkpatch.pl -f drivers/power/reset/ep93xx-restart.c
> WARNING: 'SPDX-License-Identifier: (FOOOO)' is not supported in
> LICENSES/...
> #1: FILE: drivers/power/reset/ep93xx-restart.c:1:
> +// SPDX-License-Identifier: (FOOOO)

https://kernel.org/doc/html/latest/process/license-rules.html
doesn't mention your format.

--
With Best Regards,
Andy Shevchenko