From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH v4] New-style EEPROM driver using device_ids (superseding the old eeprom driver)
Date: Wed, 2 Jul 2008 16:57:05 +0200 [thread overview]
Message-ID: <20080702145705.GD4253@pengutronix.de> (raw)
In-Reply-To: <20080702163004.722059ea-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2521 bytes --]
On Wed, Jul 02, 2008 at 04:30:04PM +0200, Jean Delvare wrote:
> Great. The code looks very nice now, I think it's ready for merge.
Hooray! \o/
> > +/*
> > + * Specs often allow 5 msec for a page write, sometimes 20 msec;
> > + * it's important to recover from write timeouts.
> > + */
> > +static unsigned write_timeout = 25;
> > +module_param(write_timeout, uint, 0);
>
> No longer changeable at run-time? I don't mind, but I'm curious why you
> changed it.
Sorry, forgot to document it. When wearing my paranoia-hat, I wondered
what happened if you start writing to an EEPROM with a sufficent value
and change it to an insufficent one while still writing to it. You will
most probably end up with broken eeprom content. This is why I thought
one should better measuer a good value once, and then keep it. Measuring
can easily be done by reloading the module with a different parameter
(or hacking the source if you want to change it run-time).
> > + { "24c02", AT24_DEVICE_MAGIC(2048 / 8, 0) },
> > + /* spd is a 24c02 in memory DIMMs */
> > + { "spd", AT24_DEVICE_MAGIC(2048 / 8,
> > + AT24_FLAG_READONLY | AT24_FLAG_IRUGO) },
> > + /* pcf8570 has SRAM only, write it all */
> > + { "pcf8570", AT24_DEVICE_MAGIC(2048 / 8, 0) },
>
> Now that you use page-size of 1 in all cases, this comment is a bit
> confusing. And I am curious if anyone will use this entry, given that
> its the same as "24c02", and anyone who is certain to have a PCF8570
> would provide platform data to take benefit of the lack of pages of
> this chip.
>
> I would at least remove the second part of the comment, and maybe even
> the entry, unless you add a new flag AT2C_FLAG_SRAM which automatically
> sets a large page size (if that makes sense) or restore the possibility
> to set the page size, just for this entry.
ACK. I'd say, delete this entry for now. I guess the 'page_size'-issue
will arise sooner or later anyhow, maybe then this entry can be
reactivated.
> > + if (chip.flags & AT24_FLAG_TAKE8ADDR)
> > + num_addresses = 8;
> > + else
> > + num_addresses = DIV_ROUND_UP(chip.byte_len,
> > + chip.flags & AT24_FLAG_ADDR16 ? 65536 : 256);
>
> Extra parentheses wouldn't hurt... I wouldn't know off the top of my
> head, which of & and ?: has greater precedence.
Okay. Seems I got used to it that ?: is really low.
All the best,
Wolfram
--
Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
Pengutronix - Linux Solutions for Science and Industry
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
next prev parent reply other threads:[~2008-07-02 14:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-01 17:22 [PATCH v4] New-style EEPROM driver using device_ids (superseding the old eeprom driver) Wolfram Sang
[not found] ` <20080701172050.16801.66380.stgit-WosDo8ZsKtpoC+DoxizDebTfikLOBL9CDsAVuJBuCrE@public.gmane.org>
2008-07-02 14:30 ` Jean Delvare
[not found] ` <20080702163004.722059ea-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-02 14:57 ` Wolfram Sang [this message]
2008-07-02 19:59 ` Ben Dooks
[not found] ` <20080702195929.GE30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-07-03 12:35 ` Wolfram Sang
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=20080702145705.GD4253@pengutronix.de \
--to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
--cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox