linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] eeprom: at24: Add permission to write_timeout
@ 2021-01-28  8:10 Jenny Ho
  2021-01-28  9:04 ` Bartosz Golaszewski
  0 siblings, 1 reply; 4+ messages in thread
From: Jenny Ho @ 2021-01-28  8:10 UTC (permalink / raw)
  To: Bartosz Golaszewski, Greg Kroah-Hartman, Arnd Bergmann
  Cc: linux-i2c, linux-kernel, Jenny Ho

Need to change timeout time for different use
cases to prevent I2C error cases. Open the api
and allow Read/Write permission to write_timeout

Signed-off-by: Jenny Ho <hsiufangho@google.com>
---
 drivers/misc/eeprom/at24.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 926408b41270..39caead4058c 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -117,7 +117,7 @@ MODULE_PARM_DESC(at24_io_limit, "Maximum bytes per I/O (default 128)");
  * it's important to recover from write timeouts.
  */
 static unsigned int at24_write_timeout = 25;
-module_param_named(write_timeout, at24_write_timeout, uint, 0);
+module_param_named(write_timeout, at24_write_timeout, uint, 0600);
 MODULE_PARM_DESC(at24_write_timeout, "Time (in ms) to try writes (default 25)");
 
 struct at24_chip_data {
-- 
2.30.0.280.ga3ce27912f-goog


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

* Re: [PATCH] eeprom: at24: Add permission to write_timeout
  2021-01-28  8:10 [PATCH] eeprom: at24: Add permission to write_timeout Jenny Ho
@ 2021-01-28  9:04 ` Bartosz Golaszewski
  2021-01-28  9:11   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Bartosz Golaszewski @ 2021-01-28  9:04 UTC (permalink / raw)
  To: Jenny Ho; +Cc: Greg Kroah-Hartman, Arnd Bergmann, linux-i2c, LKML

On Thu, Jan 28, 2021 at 9:10 AM Jenny Ho <hsiufangho@google.com> wrote:
>
> Need to change timeout time for different use
> cases to prevent I2C error cases. Open the api
> and allow Read/Write permission to write_timeout
>
> Signed-off-by: Jenny Ho <hsiufangho@google.com>
> ---
>  drivers/misc/eeprom/at24.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> index 926408b41270..39caead4058c 100644
> --- a/drivers/misc/eeprom/at24.c
> +++ b/drivers/misc/eeprom/at24.c
> @@ -117,7 +117,7 @@ MODULE_PARM_DESC(at24_io_limit, "Maximum bytes per I/O (default 128)");
>   * it's important to recover from write timeouts.
>   */
>  static unsigned int at24_write_timeout = 25;
> -module_param_named(write_timeout, at24_write_timeout, uint, 0);
> +module_param_named(write_timeout, at24_write_timeout, uint, 0600);
>  MODULE_PARM_DESC(at24_write_timeout, "Time (in ms) to try writes (default 25)");
>
>  struct at24_chip_data {
> --
> 2.30.0.280.ga3ce27912f-goog
>

IMO this should be a per-chip device property and not a global module
param. Any chance you could maybe try and extend the driver with a new
property for that?

Bart

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

* Re: [PATCH] eeprom: at24: Add permission to write_timeout
  2021-01-28  9:04 ` Bartosz Golaszewski
@ 2021-01-28  9:11   ` Greg Kroah-Hartman
  2021-01-28  9:44     ` Bartosz Golaszewski
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-01-28  9:11 UTC (permalink / raw)
  To: Bartosz Golaszewski; +Cc: Jenny Ho, Arnd Bergmann, linux-i2c, LKML

On Thu, Jan 28, 2021 at 10:04:42AM +0100, Bartosz Golaszewski wrote:
> On Thu, Jan 28, 2021 at 9:10 AM Jenny Ho <hsiufangho@google.com> wrote:
> >
> > Need to change timeout time for different use
> > cases to prevent I2C error cases. Open the api
> > and allow Read/Write permission to write_timeout
> >
> > Signed-off-by: Jenny Ho <hsiufangho@google.com>
> > ---
> >  drivers/misc/eeprom/at24.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> > index 926408b41270..39caead4058c 100644
> > --- a/drivers/misc/eeprom/at24.c
> > +++ b/drivers/misc/eeprom/at24.c
> > @@ -117,7 +117,7 @@ MODULE_PARM_DESC(at24_io_limit, "Maximum bytes per I/O (default 128)");
> >   * it's important to recover from write timeouts.
> >   */
> >  static unsigned int at24_write_timeout = 25;
> > -module_param_named(write_timeout, at24_write_timeout, uint, 0);
> > +module_param_named(write_timeout, at24_write_timeout, uint, 0600);
> >  MODULE_PARM_DESC(at24_write_timeout, "Time (in ms) to try writes (default 25)");
> >
> >  struct at24_chip_data {
> > --
> > 2.30.0.280.ga3ce27912f-goog
> >
> 
> IMO this should be a per-chip device property and not a global module
> param. Any chance you could maybe try and extend the driver with a new
> property for that?

This already is a global module parameter :)

But I agree, having it per-device would be much better, a sysfs
attribute would easily work for that.

thanks,

greg k-h

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

* Re: [PATCH] eeprom: at24: Add permission to write_timeout
  2021-01-28  9:11   ` Greg Kroah-Hartman
@ 2021-01-28  9:44     ` Bartosz Golaszewski
  0 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2021-01-28  9:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Jenny Ho, Arnd Bergmann, linux-i2c, LKML

On Thu, Jan 28, 2021 at 10:12 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Thu, Jan 28, 2021 at 10:04:42AM +0100, Bartosz Golaszewski wrote:
> > On Thu, Jan 28, 2021 at 9:10 AM Jenny Ho <hsiufangho@google.com> wrote:
> > >
> > > Need to change timeout time for different use
> > > cases to prevent I2C error cases. Open the api
> > > and allow Read/Write permission to write_timeout
> > >
> > > Signed-off-by: Jenny Ho <hsiufangho@google.com>
> > > ---
> > >  drivers/misc/eeprom/at24.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> > > index 926408b41270..39caead4058c 100644
> > > --- a/drivers/misc/eeprom/at24.c
> > > +++ b/drivers/misc/eeprom/at24.c
> > > @@ -117,7 +117,7 @@ MODULE_PARM_DESC(at24_io_limit, "Maximum bytes per I/O (default 128)");
> > >   * it's important to recover from write timeouts.
> > >   */
> > >  static unsigned int at24_write_timeout = 25;
> > > -module_param_named(write_timeout, at24_write_timeout, uint, 0);
> > > +module_param_named(write_timeout, at24_write_timeout, uint, 0600);
> > >  MODULE_PARM_DESC(at24_write_timeout, "Time (in ms) to try writes (default 25)");
> > >
> > >  struct at24_chip_data {
> > > --
> > > 2.30.0.280.ga3ce27912f-goog
> > >
> >
> > IMO this should be a per-chip device property and not a global module
> > param. Any chance you could maybe try and extend the driver with a new
> > property for that?
>
> This already is a global module parameter :)
>

I know but if we're touching it, then better do the right thing. :)

> But I agree, having it per-device would be much better, a sysfs
> attribute would easily work for that.
>

I was thinking about a generic device property that could be set from
device tree etc. I doubt there's much need to change this at runtime
outside of development?

Bart

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

end of thread, other threads:[~2021-01-28  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28  8:10 [PATCH] eeprom: at24: Add permission to write_timeout Jenny Ho
2021-01-28  9:04 ` Bartosz Golaszewski
2021-01-28  9:11   ` Greg Kroah-Hartman
2021-01-28  9:44     ` Bartosz Golaszewski

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).