All of lore.kernel.org
 help / color / mirror / Atom feed
From: Austin Boyle <Austin.Boyle@aviatnet.com>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: <rtc-linux@googlegroups.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] rtc: ds1307: generalise ram size and offset
Date: Thu, 2 Feb 2012 13:37:37 +1300	[thread overview]
Message-ID: <1328143057.3159.34.camel@pc786-ubu.gnet.global.vpn> (raw)
In-Reply-To: <20120119194541.GA32483@pengutronix.de>

Hi Wolfram,

I'm sorry about the slow response - I was away at linux.conf.au and then
haven't found enough time since I got back. 

On Thu, 2012-01-19 at 20:45 +0100, Wolfram Sang wrote:
> Sorry, found another thing.
> 
> > +	if (chip) {
> > +		if (chip->nvram_size)
> > +			ds1307->nvram_size = chip->nvram_size;
> > +		if (chip->nvram_offset)
> > +			ds1307->nvram_offset = chip->nvram_offset;
> > +	}
> 
> I moved only the assignments...
> 
> >  
> >  	buf = ds1307->regs;
> >  	if (i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
> > @@ -893,11 +907,12 @@ read_rtc:
> >  		dev_dbg(&client->dev, "got IRQ %d\n", client->irq);
> >  	}
> >  
> > -	if (chip && chip->nvram56) {
> > +	if (chip && chip->nvram_size) {
> 
> .. to here when I saw...
> 
> > +		nvram.size = ds1307->nvram_size;
> 
> ... that nvram is static and we are changing it. Yeah, it is very unlikely but
> if we have two RTC with different nvram sizes, one of them will not work correctly.
I see the issue. Am I right that it would only occur when you have two
I2C buses, each with one of the RTC chips supported by this driver?

The fix I thought of would be to add a 'struct bin_attribute' pointer to
'struct ds1307' and then in the probe function allocate the structure,
set the size & callbacks, and pass it as an argument to
sysfs_create_bin_file. Do you think this is viable? 

It looks like Andrew Morton has already added this patch to the -mm
tree. Has he also grabbed the patches that this depends on?

Thanks,
Austin.




  reply	other threads:[~2012-02-02  0:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09 21:21 [PATCH v3] rtc: ds1307: generalise ram size and offset Austin Boyle
2012-01-09 22:17 ` Wolfram Sang
2012-01-10  0:33   ` Austin Boyle
2012-01-11 11:06 ` Wolfram Sang
2012-01-11 22:21   ` Austin Boyle
2012-01-18 21:41     ` Wolfram Sang
2012-01-19 19:45     ` Wolfram Sang
2012-02-02  0:37       ` Austin Boyle [this message]
2012-02-02 14:53         ` [rtc-linux] " Wolfram Sang
2012-02-02 22:28         ` Austin Boyle
2012-02-07 14:56           ` Wolfram Sang
2012-02-07 21:45             ` Austin Boyle
2012-02-08 22:23             ` [PATCH v4] " Austin Boyle
2012-02-08 22:36               ` Andrew Morton
2012-02-13 14:36                 ` Wolfram Sang
2012-02-14  4:23                   ` Austin Boyle
2012-02-21 14:00                     ` Wolfram Sang
  -- strict thread matches above, loose matches on Subject: below --
2011-11-03 21:07 [PATCH v3] " Austin Boyle
2011-11-03 21:25 ` David Anders
2011-12-19  1:24   ` Austin Boyle

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=1328143057.3159.34.camel@pc786-ubu.gnet.global.vpn \
    --to=austin.boyle@aviatnet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=w.sang@pengutronix.de \
    /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.