From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: Fix in eeprom.c
Date: Thu, 19 May 2005 06:24:49 +0000 [thread overview]
Message-ID: <20040330204007.48d1bd8a.khali@linux-fr.org> (raw)
In-Reply-To: <20040329193435.7d9a587d.khali@linux-fr.org>
> I have seen another problem regarding (MIPS) architecture:
> if (!(new_client = kmalloc(sizeof(struct i2c_client) +
> sizeof(struct eeprom_data),
> GFP_KERNEL))) {
> err = -ENOMEM;
> goto ERROR0;
> }
>
> you request memory for two structures at a time.
> The problem is, that the eeprom_data structure is not
> aligned on an 8 byte boundary, which catches an
> unaligned kernel exception when working on the update_lock semaphore
> on our machine (www.cantastic.de)
> I would propose that you use two kmalloc() (kfree) for each
> individual structure, which solves our problem.
This is quite a problem you reveal there. It happens that all our chip
drivers in both CVS and Linux 2.6 use this single memory allocation
method. This suggests that no i2c chip driver (at least coming from the
lm_sensors project) would work on any architecture not supporting
non-aligned memory accesses.
I'm a bit surprised that this would have been uncovered until today.
Greg, I would be interested in your opinion. Should we update all our
chip drivers to have two memory allocations instead of a single one for
this?
Thanks.
--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
next prev parent reply other threads:[~2005-05-19 6:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-19 6:24 Fix in eeprom.c Jean Delvare
2005-05-19 6:24 ` Jean Delvare [this message]
2005-05-19 6:24 ` Greg KH
2005-05-19 6:24 ` AW: " Ralf Rosch
2005-05-19 6:24 ` Mark Studebaker
2005-05-19 6:24 ` AW: " Ralf Rosch
2005-05-19 6:24 ` Jean Delvare
2005-05-19 6:24 ` Jean Delvare
2005-05-19 6:24 ` Greg KH
2005-05-19 6:24 ` Jean Delvare
2005-05-19 6:24 ` AW: " Ralf Rosch
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=20040330204007.48d1bd8a.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.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 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.