linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] media: cros-ec-cec: do not bail on device_init_wakeup failure
@ 2020-06-22 10:05 Dariusz Marcinkiewicz
  2020-06-22 10:23 ` Hans Verkuil
  0 siblings, 1 reply; 5+ messages in thread
From: Dariusz Marcinkiewicz @ 2020-06-22 10:05 UTC (permalink / raw)
  To: linux-media
  Cc: narmstrong, Dariusz Marcinkiewicz, Hans Verkuil,
	Mauro Carvalho Chehab, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, Alexandre Belloni, Lee Jones, Sebastian Reichel,
	Dariusz Marcinkiewicz, linux-kernel

Do not fail probing when device_init_wakeup fails.

device_init_wakeup fails when the device is already enabled as wakeup
device. Hence, the driver fails to probe the device if:
- The device has already been enabled for wakeup (via e.g. sysfs)
- The driver has been unloaded and is being loaded again.

This goal of the patch is to fix the above cases.

Overwhelming majority of the drivers do not check device_init_wakeup
return value.

Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
---
 drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
index 0e7e2772f08f..2d95e16cd248 100644
--- a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
+++ b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
@@ -277,11 +277,7 @@ static int cros_ec_cec_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, cros_ec_cec);
 	cros_ec_cec->cros_ec = cros_ec;
 
-	ret = device_init_wakeup(&pdev->dev, 1);
-	if (ret) {
-		dev_err(&pdev->dev, "failed to initialize wakeup\n");
-		return ret;
-	}
+	device_init_wakeup(&pdev->dev, 1);
 
 	cros_ec_cec->adap = cec_allocate_adapter(&cros_ec_cec_ops, cros_ec_cec,
 						 DRV_NAME,
-- 
2.27.0.290.gba653c62da-goog


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

* Re: [PATCH RESEND] media: cros-ec-cec: do not bail on device_init_wakeup failure
  2020-06-22 10:05 [PATCH RESEND] media: cros-ec-cec: do not bail on device_init_wakeup failure Dariusz Marcinkiewicz
@ 2020-06-22 10:23 ` Hans Verkuil
  2020-06-24 12:40   ` Dariusz Marcinkiewicz
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Verkuil @ 2020-06-22 10:23 UTC (permalink / raw)
  To: Dariusz Marcinkiewicz, linux-media
  Cc: narmstrong, Mauro Carvalho Chehab, Benson Leung,
	Enric Balletbo i Serra, Guenter Roeck, Alexandre Belloni,
	Lee Jones, Sebastian Reichel, Dariusz Marcinkiewicz,
	linux-kernel

On 22/06/2020 12:05, Dariusz Marcinkiewicz wrote:
> Do not fail probing when device_init_wakeup fails.
> 
> device_init_wakeup fails when the device is already enabled as wakeup
> device. Hence, the driver fails to probe the device if:
> - The device has already been enabled for wakeup (via e.g. sysfs)
> - The driver has been unloaded and is being loaded again.
> 
> This goal of the patch is to fix the above cases.
> 
> Overwhelming majority of the drivers do not check device_init_wakeup
> return value.
> 
> Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>

This can be CCed to stable, I guess?

Can you provide a Fixes: tag as well?

Regards,

	Hans

> ---
>  drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
> index 0e7e2772f08f..2d95e16cd248 100644
> --- a/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
> +++ b/drivers/media/cec/platform/cros-ec/cros-ec-cec.c
> @@ -277,11 +277,7 @@ static int cros_ec_cec_probe(struct platform_device *pdev)
>  	platform_set_drvdata(pdev, cros_ec_cec);
>  	cros_ec_cec->cros_ec = cros_ec;
>  
> -	ret = device_init_wakeup(&pdev->dev, 1);
> -	if (ret) {
> -		dev_err(&pdev->dev, "failed to initialize wakeup\n");
> -		return ret;
> -	}
> +	device_init_wakeup(&pdev->dev, 1);
>  
>  	cros_ec_cec->adap = cec_allocate_adapter(&cros_ec_cec_ops, cros_ec_cec,
>  						 DRV_NAME,
> 


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

* Re: [PATCH RESEND] media: cros-ec-cec: do not bail on device_init_wakeup failure
  2020-06-22 10:23 ` Hans Verkuil
@ 2020-06-24 12:40   ` Dariusz Marcinkiewicz
  2020-06-24 14:45     ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Dariusz Marcinkiewicz @ 2020-06-24 12:40 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Neil Armstrong, Mauro Carvalho Chehab, Benson Leung,
	Enric Balletbo i Serra, Guenter Roeck, Alexandre Belloni,
	Lee Jones, Sebastian Reichel, Dariusz Marcinkiewicz, open list

Hello.

I realized that I sent the previous answer using HTML, and as a
consequence it was blocked from mailing lists. Sending it again
(apologies for double posting).

On Mon, Jun 22, 2020 at 12:23 PM Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
>
> On 22/06/2020 12:05, Dariusz Marcinkiewicz wrote:
> > Do not fail probing when device_init_wakeup fails.
> >
> > device_init_wakeup fails when the device is already enabled as wakeup
> > device. Hence, the driver fails to probe the device if:
> > - The device has already been enabled for wakeup (via e.g. sysfs)
> > - The driver has been unloaded and is being loaded again.
> >
> > This goal of the patch is to fix the above cases.
> >
> > Overwhelming majority of the drivers do not check device_init_wakeup
> > return value.
> >
> > Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
>
> This can be CCed to stable, I guess?
>

That issue is not a recent regression but has been in there since the
very beginning.  So it might be argued that is it not severe enough to
warrant cc'ing stable. Happy to do that anyways if you think
otherwise.

> Can you provide a Fixes: tag as well?
>

Done, submitted v2 with that a couple of days ago.

Thank you and best regards.

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

* Re: [PATCH RESEND] media: cros-ec-cec: do not bail on device_init_wakeup failure
  2020-06-24 12:40   ` Dariusz Marcinkiewicz
@ 2020-06-24 14:45     ` Guenter Roeck
  2020-06-24 16:39       ` Dariusz Marcinkiewicz
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2020-06-24 14:45 UTC (permalink / raw)
  To: Dariusz Marcinkiewicz
  Cc: Hans Verkuil, linux-media, Neil Armstrong, Mauro Carvalho Chehab,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck,
	Alexandre Belloni, Lee Jones, Sebastian Reichel,
	Dariusz Marcinkiewicz, open list

On Wed, Jun 24, 2020 at 5:40 AM Dariusz Marcinkiewicz <darekm@google.com> wrote:
>
> Hello.
>
> I realized that I sent the previous answer using HTML, and as a
> consequence it was blocked from mailing lists. Sending it again
> (apologies for double posting).
>
> On Mon, Jun 22, 2020 at 12:23 PM Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
> >
> > On 22/06/2020 12:05, Dariusz Marcinkiewicz wrote:
> > > Do not fail probing when device_init_wakeup fails.
> > >
> > > device_init_wakeup fails when the device is already enabled as wakeup
> > > device. Hence, the driver fails to probe the device if:
> > > - The device has already been enabled for wakeup (via e.g. sysfs)
> > > - The driver has been unloaded and is being loaded again.
> > >
> > > This goal of the patch is to fix the above cases.
> > >
> > > Overwhelming majority of the drivers do not check device_init_wakeup
> > > return value.
> > >
> > > Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
> >
> > This can be CCed to stable, I guess?
> >
>
> That issue is not a recent regression but has been in there since the
> very beginning.  So it might be argued that is it not severe enough to
> warrant cc'ing stable. Happy to do that anyways if you think
> otherwise.
>

Confused. Internally you would like to have this patch applied to
chromeos-4.4. Here you suggest that it may not be important enough to
apply to stable releases. Which one is it ?

Thanks,
Guenter

> > Can you provide a Fixes: tag as well?
> >
>
> Done, submitted v2 with that a couple of days ago.
>
> Thank you and best regards.

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

* Re: [PATCH RESEND] media: cros-ec-cec: do not bail on device_init_wakeup failure
  2020-06-24 14:45     ` Guenter Roeck
@ 2020-06-24 16:39       ` Dariusz Marcinkiewicz
  0 siblings, 0 replies; 5+ messages in thread
From: Dariusz Marcinkiewicz @ 2020-06-24 16:39 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Hans Verkuil, linux-media, Neil Armstrong, Mauro Carvalho Chehab,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck,
	Alexandre Belloni, Lee Jones, Sebastian Reichel,
	Dariusz Marcinkiewicz, open list

Hi.

On Wed, Jun 24, 2020 at 4:45 PM Guenter Roeck <groeck@google.com> wrote:

> > On Mon, Jun 22, 2020 at 12:23 PM Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
> > >
> > > > Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
> > >
> > > This can be CCed to stable, I guess?
> > >
> >
> > That issue is not a recent regression but has been in there since the
> > very beginning.  So it might be argued that is it not severe enough to
> > warrant cc'ing stable. Happy to do that anyways if you think
> > otherwise.
> >
>
> Confused. Internally you would like to have this patch applied to
> chromeos-4.4. Here you suggest that it may not be important enough to
> apply to stable releases. Which one is it ?
>

It affects us on 4.4, hence the backport to 4.4. I have nothing
against this being merged into the mainline stable. I simply wasn't
sure if that should be considered severe enough to be backported
there. As said before, I am happy to CC this to stable.

Thank you and best regards.

(apologies for double post again)

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

end of thread, other threads:[~2020-06-24 16:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 10:05 [PATCH RESEND] media: cros-ec-cec: do not bail on device_init_wakeup failure Dariusz Marcinkiewicz
2020-06-22 10:23 ` Hans Verkuil
2020-06-24 12:40   ` Dariusz Marcinkiewicz
2020-06-24 14:45     ` Guenter Roeck
2020-06-24 16:39       ` Dariusz Marcinkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).