[05/11] Fix i2c messsage flags in video drivers

From: Greg KH (greg_at_kroah.com)
Date: 03/11/05

  • Next message: Greg KH: "[01/11] fix amd64 2.6.11 oops on modprobe (saa7110)"
    Date:	Thu, 10 Mar 2005 15:08:35 -0800
    To: khali@linux-fr.org, rddunlap@osdl.org, dst@bostream.nu, andrei@arhont.com, icampbell@arcom.com, rbultje@ronald.bitfreak.net, kraxel@bytesex.org
    
    

    -stable review patch. If anyone has any objections, please let us know.

    ------------------

    While working on the saa7110 driver I found a problem with the way
    various video drivers (found on Zoran-based boards) prepare i2c messages
    to be used by i2c_transfer. The drivers improperly copy the i2c client
    flags as the message flags, while both sets are mostly unrelated. The
    net effect in this case is to trigger an I2C block read instead of the
    expected I2C block write. The fix is simply not to pass any flag,
    because none are needed.

    I think this patch qualifies hands down as a "critical bug fix" to be
    included in whatever bug-fix-only trees exist these days. As far as I
    can see, all Zoran-based boards are broken in 2.6.11 without this patch.

    Signed-off-by: Jean Delvare <khali@linux-fr.org>
    Signed-off-by: Chris Wright <chrisw@osdl.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    diff -u -rN linux-2.6.11-bk3/drivers/media/video.orig/adv7170.c linux-2.6.11-bk3/drivers/media/video/adv7170.c
    --- linux-2.6.11-bk3/drivers/media/video.orig/adv7170.c Tue Mar 8 10:27:14 2005
    +++ linux-2.6.11-bk3/drivers/media/video/adv7170.c Tue Mar 8 12:19:04 2005
    @@ -130,7 +130,7 @@
                     u8 block_data[32];
     
                     msg.addr = client->addr;
    - msg.flags = client->flags;
    + msg.flags = 0;
                     while (len >= 2) {
                             msg.buf = (char *) block_data;
                             msg.len = 0;
    diff -u -rN linux-2.6.11-bk3/drivers/media/video.orig/adv7175.c linux-2.6.11-bk3/drivers/media/video/adv7175.c
    --- linux-2.6.11-bk3/drivers/media/video.orig/adv7175.c Tue Mar 8 10:27:14 2005
    +++ linux-2.6.11-bk3/drivers/media/video/adv7175.c Tue Mar 8 12:18:57 2005
    @@ -126,7 +126,7 @@
                     u8 block_data[32];
     
                     msg.addr = client->addr;
    - msg.flags = client->flags;
    + msg.flags = 0;
                     while (len >= 2) {
                             msg.buf = (char *) block_data;
                             msg.len = 0;
    diff -u -rN linux-2.6.11-bk3/drivers/media/video.orig/bt819.c linux-2.6.11-bk3/drivers/media/video/bt819.c
    --- linux-2.6.11-bk3/drivers/media/video.orig/bt819.c Tue Mar 8 10:27:15 2005
    +++ linux-2.6.11-bk3/drivers/media/video/bt819.c Tue Mar 8 12:18:51 2005
    @@ -146,7 +146,7 @@
                     u8 block_data[32];
     
                     msg.addr = client->addr;
    - msg.flags = client->flags;
    + msg.flags = 0;
                     while (len >= 2) {
                             msg.buf = (char *) block_data;
                             msg.len = 0;
    diff -u -rN linux-2.6.11-bk3/drivers/media/video.orig/saa7114.c linux-2.6.11-bk3/drivers/media/video/saa7114.c
    --- linux-2.6.11-bk3/drivers/media/video.orig/saa7114.c Tue Mar 8 10:27:15 2005
    +++ linux-2.6.11-bk3/drivers/media/video/saa7114.c Tue Mar 8 12:18:20 2005
    @@ -163,7 +163,7 @@
                     u8 block_data[32];
     
                     msg.addr = client->addr;
    - msg.flags = client->flags;
    + msg.flags = 0;
                     while (len >= 2) {
                             msg.buf = (char *) block_data;
                             msg.len = 0;
    diff -u -rN linux-2.6.11-bk3/drivers/media/video.orig/saa7185.c linux-2.6.11-bk3/drivers/media/video/saa7185.c
    --- linux-2.6.11-bk3/drivers/media/video.orig/saa7185.c Tue Mar 8 10:27:15 2005
    +++ linux-2.6.11-bk3/drivers/media/video/saa7185.c Tue Mar 8 12:18:12 2005
    @@ -118,7 +118,7 @@
                     u8 block_data[32];
     
                     msg.addr = client->addr;
    - msg.flags = client->flags;
    + msg.flags = 0;
                     while (len >= 2) {
                             msg.buf = (char *) block_data;
                             msg.len = 0;

    -- 
    Jean Delvare
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Greg KH: "[01/11] fix amd64 2.6.11 oops on modprobe (saa7110)"

    Relevant Pages

    • Re: [PATCH 0/23] reboot-fixes
      ... >> Presumably it unfixes Pavel's patch? ... > the suspend path. ... > But those are among the few drivers that do anything in either ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] Real-Time Preemption, -RT-2.6.13-rc6-V0.7.53-11
      ... the patch should be okay. ... Perhaps most of the USB drivers don't care whether interrupts ... are enabled or not in their completion routines. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: RT patch acceptance
      ... Look at the patch. ... You're the one spreading FUD that preempt-RT is as good as RTAI, ... even worse than local_irq_disable isn't used in drivers or not safe to ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: BIOS overwritten during resume (was: Re: Asus L5D resume on battery power)
      ... >> This flags are little in the short supply, ... The patch I posted has been in use for quite a while, ... Nigel Cunningham ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.6 patch] PCI cleanups
      ... > The patch below does some cleanups in the PCI code: ... Care to make a patch for just this? ... I've heard rumors that those drivers will be public ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)