All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Kari Argillander <kari.argillander@gmail.com>
Cc: Carlis <zhangxuezhi3@gmail.com>,
	devel@driverdev.osuosl.org, linux-fbdev@vger.kernel.org,
	mh12gx2825@gmail.com, gregkh@linuxfoundation.org,
	oliver.graute@kococonnector.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, sbrivio@redhat.com,
	colin.king@canonical.com, zhangxuezhi1@yulong.com
Subject: Re: [PATCH v10] staging: fbtft: add tearing signal detect
Date: Thu, 28 Jan 2021 18:13:07 +0300	[thread overview]
Message-ID: <20210128151306.GG2696@kadam> (raw)
In-Reply-To: <20210127223222.3lavtl3roc4cabso@kari-VirtualBox>

On Thu, Jan 28, 2021 at 12:32:22AM +0200, Kari Argillander wrote:
> On Wed, Jan 27, 2021 at 09:42:52PM +0800, Carlis wrote:
> > @@ -82,6 +111,33 @@ enum st7789v_command {
> >   */
> >  static int init_display(struct fbtft_par *par)
> >  {
> > +	int rc;
> > +	struct device *dev = par->info->device;
> > +
> > +	par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0, GPIOD_IN);
> > +	if (IS_ERR(par->gpio.te)) {
> > +		rc = PTR_ERR(par->gpio.te);
> > +		dev_err(par->info->device, "Failed to request te gpio: %d\n", rc);
> > +		return rc;
> > +	}
> 
> You request with optinal and you still want to error out? We could just
> continue and not care about that error. User will be happier if device
> still works somehow.
> 

Carlis tried that approach in previous versions.  See the discussion
about -EPROBEi_DEFER.

That's not the right way to think about it anyway.  It's optional but
the user *chose* to enable it so if an error occurs then it's still an
error and should be treated like an error.  The user should fix the
error or disable the feature if they want to continue.

There are lots of places in the kernel where the error handling could
be written to try continue but in a crippled state.  It's not the right
approach.  Over engineering like that just leads to bugs.

regards,
dan carpenter


WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Kari Argillander <kari.argillander@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-fbdev@vger.kernel.org,
	mh12gx2825@gmail.com, gregkh@linuxfoundation.org,
	oliver.graute@kococonnector.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, sbrivio@redhat.com,
	Carlis <zhangxuezhi3@gmail.com>,
	colin.king@canonical.com, zhangxuezhi1@yulong.com
Subject: Re: [PATCH v10] staging: fbtft: add tearing signal detect
Date: Thu, 28 Jan 2021 18:13:07 +0300	[thread overview]
Message-ID: <20210128151306.GG2696@kadam> (raw)
In-Reply-To: <20210127223222.3lavtl3roc4cabso@kari-VirtualBox>

On Thu, Jan 28, 2021 at 12:32:22AM +0200, Kari Argillander wrote:
> On Wed, Jan 27, 2021 at 09:42:52PM +0800, Carlis wrote:
> > @@ -82,6 +111,33 @@ enum st7789v_command {
> >   */
> >  static int init_display(struct fbtft_par *par)
> >  {
> > +	int rc;
> > +	struct device *dev = par->info->device;
> > +
> > +	par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0, GPIOD_IN);
> > +	if (IS_ERR(par->gpio.te)) {
> > +		rc = PTR_ERR(par->gpio.te);
> > +		dev_err(par->info->device, "Failed to request te gpio: %d\n", rc);
> > +		return rc;
> > +	}
> 
> You request with optinal and you still want to error out? We could just
> continue and not care about that error. User will be happier if device
> still works somehow.
> 

Carlis tried that approach in previous versions.  See the discussion
about -EPROBEi_DEFER.

That's not the right way to think about it anyway.  It's optional but
the user *chose* to enable it so if an error occurs then it's still an
error and should be treated like an error.  The user should fix the
error or disable the feature if they want to continue.

There are lots of places in the kernel where the error handling could
be written to try continue but in a crippled state.  It's not the right
approach.  Over engineering like that just leads to bugs.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Kari Argillander <kari.argillander@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-fbdev@vger.kernel.org,
	mh12gx2825@gmail.com, gregkh@linuxfoundation.org,
	oliver.graute@kococonnector.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, sbrivio@redhat.com,
	Carlis <zhangxuezhi3@gmail.com>,
	colin.king@canonical.com, zhangxuezhi1@yulong.com
Subject: Re: [PATCH v10] staging: fbtft: add tearing signal detect
Date: Thu, 28 Jan 2021 18:13:07 +0300	[thread overview]
Message-ID: <20210128151306.GG2696@kadam> (raw)
In-Reply-To: <20210127223222.3lavtl3roc4cabso@kari-VirtualBox>

On Thu, Jan 28, 2021 at 12:32:22AM +0200, Kari Argillander wrote:
> On Wed, Jan 27, 2021 at 09:42:52PM +0800, Carlis wrote:
> > @@ -82,6 +111,33 @@ enum st7789v_command {
> >   */
> >  static int init_display(struct fbtft_par *par)
> >  {
> > +	int rc;
> > +	struct device *dev = par->info->device;
> > +
> > +	par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0, GPIOD_IN);
> > +	if (IS_ERR(par->gpio.te)) {
> > +		rc = PTR_ERR(par->gpio.te);
> > +		dev_err(par->info->device, "Failed to request te gpio: %d\n", rc);
> > +		return rc;
> > +	}
> 
> You request with optinal and you still want to error out? We could just
> continue and not care about that error. User will be happier if device
> still works somehow.
> 

Carlis tried that approach in previous versions.  See the discussion
about -EPROBEi_DEFER.

That's not the right way to think about it anyway.  It's optional but
the user *chose* to enable it so if an error occurs then it's still an
error and should be treated like an error.  The user should fix the
error or disable the feature if they want to continue.

There are lots of places in the kernel where the error handling could
be written to try continue but in a crippled state.  It's not the right
approach.  Over engineering like that just leads to bugs.

regards,
dan carpenter

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2021-01-28 15:16 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 13:42 [PATCH v10] staging: fbtft: add tearing signal detect Carlis
2021-01-27 13:42 ` Carlis
2021-01-27 13:42 ` Carlis
2021-01-27 13:51 ` Greg KH
2021-01-27 13:51   ` Greg KH
2021-01-27 13:51   ` Greg KH
2021-01-27 14:08   ` carlis
2021-01-27 14:08     ` carlis
2021-01-27 14:08     ` carlis
2021-01-27 14:13     ` Greg KH
2021-01-27 14:13       ` Greg KH
2021-01-27 14:13       ` Greg KH
2021-01-27 14:17       ` carlis
2021-01-27 14:17         ` carlis
2021-01-27 14:17         ` carlis
2021-01-27 14:25         ` Greg KH
2021-01-27 14:25           ` Greg KH
2021-01-27 14:25           ` Greg KH
2021-01-27 14:49           ` Dan Carpenter
2021-01-27 14:49             ` Dan Carpenter
2021-01-27 14:49             ` Dan Carpenter
2021-01-27 15:02             ` Greg KH
2021-01-27 15:02               ` Greg KH
2021-01-27 15:02               ` Greg KH
2021-01-28  1:12               ` carlis
2021-01-28  1:12                 ` carlis
2021-01-28  1:12                 ` carlis
2021-01-27 17:42             ` Joe Perches
2021-01-27 17:42               ` Joe Perches
2021-01-27 17:42               ` Joe Perches
2021-01-27 18:21             ` Joe Perches
2021-01-27 18:21               ` Joe Perches
2021-01-27 18:21               ` Joe Perches
2021-01-27 22:32 ` Kari Argillander
2021-01-27 22:32   ` Kari Argillander
2021-01-27 22:32   ` Kari Argillander
2021-01-28  1:42   ` carlis
2021-01-28  1:42     ` carlis
2021-01-28  1:42     ` carlis
2021-01-28  6:52     ` Kari Argillander
2021-01-28  6:52       ` Kari Argillander
2021-01-28  6:52       ` Kari Argillander
2021-01-28  9:24       ` carlis
2021-01-28  9:24         ` carlis
2021-01-28  9:24         ` carlis
2021-01-28  9:42       ` Geert Uytterhoeven
2021-01-28  9:42         ` Geert Uytterhoeven
2021-01-28  9:42         ` Geert Uytterhoeven
2021-01-28  9:59         ` Kari Argillander
2021-01-28  9:59           ` Kari Argillander
2021-01-28  9:59           ` Kari Argillander
2021-01-28 11:03         ` carlis
2021-01-28 11:03           ` carlis
2021-01-28 11:03           ` carlis
2021-01-28 11:15           ` Geert Uytterhoeven
2021-01-28 11:15             ` Geert Uytterhoeven
2021-01-28 11:15             ` Geert Uytterhoeven
2021-01-28 11:42             ` carlis
2021-01-28 11:42               ` carlis
2021-01-28 11:42               ` carlis
2021-01-28 15:13   ` Dan Carpenter [this message]
2021-01-28 15:13     ` Dan Carpenter
2021-01-28 15:13     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210128151306.GG2696@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=colin.king@canonical.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kari.argillander@gmail.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mh12gx2825@gmail.com \
    --cc=oliver.graute@kococonnector.com \
    --cc=sbrivio@redhat.com \
    --cc=zhangxuezhi1@yulong.com \
    --cc=zhangxuezhi3@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.