From: Greg KH <greg@kroah.com>
To: Sergey Vlasov <vsu@altlinux.ru>
Cc: Jean Delvare <khali@linux-fr.org>,
LM Sensors <sensors@stimpy.netroedge.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC 2.6] Rework memory allocation in i2c chip drivers
Date: Fri, 9 Apr 2004 10:31:58 -0700 [thread overview]
Message-ID: <20040409173158.GC15820@kroah.com> (raw)
In-Reply-To: <20040403202042.GA3898@sirius.home>
On Sun, Apr 04, 2004 at 12:20:42AM +0400, Sergey Vlasov wrote:
> Hello!
>
> > Some times ago, Ralf Roesch reported that the memory allocation scheme
> > used in the i2c eeprom driver was causing trouble on MIPS architecture:
> >
> > http://archives.andrew.net.au/lm-sensors/msg07233.html
> >
> > The cause of the problems is that we do allocate two structures with a
> > single kmalloc, which breaks alignment. This doesn't seem to be a
> > problem on x86, but is on mips and probably on other architectures as
> > well. It happens that all other chip drivers work the same way too, so
> > they all would need to be fixed.
>
> Instead of splitting one kmalloc in two, it would also be possible to
> add a "struct i2c_client client" field to each of the *_data
> structures - the compiler should align all fields appropriately.
> Probably this way will result in less changes to the code (and also
> less labels and less error paths).
>
> Example patch for lm75 (untested):
I like this version a lot better. It's simpler and if we do this, we
can easily switch to the proper refcount handling of the i2c_client
structures like we should do in 2.7.
Jean, care to redo your patch in this form?
thanks,
greg k-h
next prev parent reply other threads:[~2004-04-09 17:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-03 17:10 [RFC 2.6] Rework memory allocation in i2c chip drivers Jean Delvare
2004-04-03 19:07 ` Geert Uytterhoeven
2004-04-03 20:20 ` Sergey Vlasov
2004-04-09 17:31 ` Greg KH [this message]
2004-04-10 14:58 ` [PATCH 2.6] Rework memory allocation in i2c chip drivers (second try) Jean Delvare
2004-04-17 12:53 ` Jean Delvare
2004-04-18 6:01 ` Jean Delvare
2004-05-02 20:06 ` [PATCH 2.6] Fix memory leaks in w83781d and asb100 Jean Delvare
2004-05-05 22:18 ` Greg KH
2004-05-07 12:42 ` Jean Delvare
2004-05-07 22:34 ` Greg KH
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=20040409173158.GC15820@kroah.com \
--to=greg@kroah.com \
--cc=khali@linux-fr.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sensors@stimpy.netroedge.com \
--cc=vsu@altlinux.ru \
/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