[lkml]   [2004]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [RFC 2.6] Rework memory allocation in i2c chip drivers
    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:
    > >
    > >
    > >
    > > 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?


    greg k-h
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:02    [W:0.022 / U:3.380 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site