1. 11 8月, 2010 25 次提交
  2. 10 8月, 2010 4 次提交
    • Q
      drivers/char/vt.c:vc_do_resize(): local var `end' should be unsigned long · 9e0ba741
      qiaochong 提交于
      According include/linux/console_struct.h,vc_scr_end is unsigned long.
      
      struct vc_data {
          unsigned short  vc_num;         /* Console number */
          unsigned int    vc_cols;        /* [#] Console size */
          unsigned int    vc_rows;
          unsigned int    vc_size_row;        /* Bytes per row */
          unsigned int    vc_scan_lines;      /* # of scan lines */
          unsigned long   vc_origin;      /* [!] Start of real screen */
          unsigned long   vc_scr_end;     /* [!] End of real screen */
          unsigned long   vc_visible_origin;  /* [!] Top of visible window */
          unsigned int    vc_top, vc_bottom;  /* Scrolling region */
          const struct consw *vc_sw;
          unsigned short  *vc_screenbuf;
      ...
      }
      Signed-off-by: Nqiaochong <qiaochong@loongson.cn>
      Cc: Greg KH <greg@kroah.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9e0ba741
    • Q
      drivers/char/vt.c: fix vc->vc_origin on take_over_console() · 02f0777a
      qiaochong 提交于
      kernel will die on some platform when switch from vga mode to framebuffer
      mode.  The reason of this bug is that bind_con_driver reset vc->vc_origin
      to (unsigned long)vc->vc_screenbuf.
      
      On vgacon vc->vc_origin is not releated to vc->vc_screenbuf,if set
      vc->vc_origin to vc->vc_screenbuf,kernel will die on vc_do_resize.
      
      static int vc_do_resize(struct tty_struct *tty, struct tty_struct *real_tty,
              struct vc_data *vc, unsigned int cols, unsigned int lines)
      {
          unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
          unsigned int old_cols, old_rows, old_row_size, old_screen_size;
          unsigned int new_cols, new_rows, new_row_size, new_screen_size;
          unsigned int end, user;
      ...
              end = (old_rows > new_rows) ? old_origin +
                  (old_row_size * new_rows) :
                  vc->vc_scr_end;
      
      ...
      /*
      here for a test from vgacon to framebuffer:
      old_origin=0x810814a0,end=0xb00b8fa0,vc->vc_origin=0x810814a0
      the code bellow will copy memory from 0x810814a0 to 0xb00b8fa0,
      this will cover kernel code,kernel died here.
      */
      
          while (old_origin < end) {
      
              scr_memcpyw((unsigned short *) new_origin,
                      (unsigned short *) old_origin, rlth);
              if (rrem)
                  scr_memsetw((void *)(new_origin + rlth),
                          vc->vc_video_erase_char, rrem);
              old_origin += old_row_size;
              new_origin += new_row_size;
          }
      
      ...
      }
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: Nqiaochong <qiaochong@loongson.cn>
      Cc: Greg KH <greg@kroah.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      02f0777a
    • A
      char: add WARN_ON() in misc_deregister() · b329becf
      Akinobu Mita 提交于
      misc_deregister() returns an error only when it attempts to unregister
      the device that is not registered. This is the driver's bug.
      
      Most of the drivers don't check the return value of misc_deregister().
      (It is not bad thing because most of kernel *_unregister() API always
      succeed and do not return value)
      
      So it is better to indicate the error by WARN_ON() in misc_deregister().
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b329becf
    • Y
      ipmi: fix ACPI detection with regspacing · d9e1b6c4
      Yinghai Lu 提交于
      After the commit that changed ipmi_si detecting sequence from SMBIOS/ACPI
      to ACPI/SMBIOS,
      
      | commit 754d4531
      | Author: Matthew Garrett <mjg@redhat.com>
      | Date:   Wed May 26 14:43:47 2010 -0700
      |
      |    ipmi: change device discovery order
      |
      |    The ipmi spec provides an ordering for si discovery.  Change the driver to
      |    match, with the exception of preferring smbios to SPMI as HPs (at least)
      |    contain accurate information in the former but not the latter.
      
      ipmi_si can not be initialized.
      
      [  138.799739] calling  init_ipmi_devintf+0x0/0x109 @ 1
      [  138.805050] ipmi device interface
      [  138.818131] initcall init_ipmi_devintf+0x0/0x109 returned 0 after 12797 usecs
      [  138.822998] calling  init_ipmi_si+0x0/0xa90 @ 1
      [  138.840276] IPMI System Interface driver.
      [  138.846137] ipmi_si: probing via ACPI
      [  138.849225] ipmi_si 00:09: [io  0x0ca2] regsize 1 spacing 1 irq 0
      [  138.864438] ipmi_si: Adding ACPI-specified kcs state machine
      [  138.870893] ipmi_si: probing via SMBIOS
      [  138.880945] ipmi_si: Adding SMBIOS-specified kcs state machineipmi_si: duplicate interface
      [  138.896511] ipmi_si: probing via SPMI
      [  138.899861] ipmi_si: Adding SPMI-specified kcs state machineipmi_si: duplicate interface
      [  138.917095] ipmi_si: Trying ACPI-specified kcs state machine at i/o address 0xca2, slave address 0x0, irq 0
      [  138.928658] ipmi_si: Interface detection failed
      [  138.953411] initcall init_ipmi_si+0x0/0xa90 returned 0 after 110847 usecs
      
      in smbios has
      DMI/SMBIOS
      Handle 0x00C5, DMI type 38, 18 bytes
      IPMI Device Information
              Interface Type: KCS (Keyboard Control Style)
              Specification Version: 2.0
              I2C Slave Address: 0x00
              NV Storage Device: Not Present
              Base Address: 0x0000000000000CA2 (I/O)
              Register Spacing: 32-bit Boundaries
      in DSDT has
                          Device (BMC)
                          {
      
                              Name (_HID, EisaId ("IPI0001"))
                              Method (_STA, 0, NotSerialized)
                              {
                                  If (LEqual (OSN, Zero))
                                  {
                                      Return (Zero)
                                  }
      
                                  Return (0x0F)
                              }
      
                              Name (_STR, Unicode ("IPMI_KCS"))
                              Name (_UID, Zero)
                              Name (_CRS, ResourceTemplate ()
                              {
                                  IO (Decode16,
                                      0x0CA2,             // Range Minimum
                                      0x0CA2,             // Range Maximum
                                      0x00,               // Alignment
                                      0x01,               // Length
                                      )
                                  IO (Decode16,
                                      0x0CA6,             // Range Minimum
                                      0x0CA6,             // Range Maximum
                                      0x00,               // Alignment
                                      0x01,               // Length
                                      )
                              })
                              Method (_IFT, 0, NotSerialized)
                              {
                                  Return (One)
                              }
      
                              Method (_SRV, 0, NotSerialized)
                              {
                                  Return (0x0200)
                              }
                          }
      
      so the reg spacing should be 4 instead of 1.
      
      Try to calculate regspacing for this kind of system.
      
      Observed on a Sun Fire X4800.  Other OSes work and pass certification.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
      Acked-by: NMatthew Garrett <mjg@redhat.com>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Myron Stowe <myron.stowe@hp.com>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d9e1b6c4
  3. 07 8月, 2010 1 次提交
    • D
      Fix init ordering of /dev/console vs callers of modprobe · 31d1d48e
      David Howells 提交于
      Make /dev/console get initialised before any initialisation routine that
      invokes modprobe because if modprobe fails, it's going to want to open
      /dev/console, presumably to write an error message to.
      
      The problem with that is that if the /dev/console driver is not yet
      initialised, the chardev handler will call request_module() to invoke
      modprobe, which will fail, because we never compile /dev/console as a
      module.
      
      This will lead to a modprobe loop, showing the following in the kernel
      log:
      
      	request_module: runaway loop modprobe char-major-5-1
      	request_module: runaway loop modprobe char-major-5-1
      	request_module: runaway loop modprobe char-major-5-1
      	request_module: runaway loop modprobe char-major-5-1
      	request_module: runaway loop modprobe char-major-5-1
      
      This can happen, for example, when the built in md5 module can't find
      the built in cryptomgr module (because the latter fails to initialise).
      The md5 module comes before the call to tty_init(), presumably because
      'crypto' comes before 'drivers' alphabetically.
      
      Fix this by calling tty_init() from chrdev_init().
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31d1d48e
  4. 05 8月, 2010 5 次提交
  5. 03 8月, 2010 4 次提交
    • D
      pcmcia: use struct resource for PCMCIA devices, part 2 · 0ca724d3
      Dominik Brodowski 提交于
      Use struct resource * also for iomem resources.
      
      CC: linux-mtd@lists.infradead.org
      CC: netdev@vger.kernel.org
      CC: linux-wireless@vger.kernel.org
      CC: Jiri Kosina <jkosina@suse.cz>
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      0ca724d3
    • D
      pcmcia: remove memreq_t · b5cb259e
      Dominik Brodowski 提交于
      Page already had to be set to 0; Offset can easily be passed as
      parameter to pcmcia_map_mem_page.
      
      CC: netdev@vger.kernel.org
      CC: linux-wireless@vger.kernel.org
      CC: linux-ide@vger.kernel.org
      CC: linux-usb@vger.kernel.org
      CC: laforge@gnumonks.org
      CC: linux-mtd@lists.infradead.org
      CC: linux-bluetooth@vger.kernel.org
      CC: alsa-devel@alsa-project.org
      CC: linux-serial@vger.kernel.org
      CC: Michael Buesch <mb@bu3sch.de>
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      b5cb259e
    • D
      pcmcia: do not use io_req_t when calling pcmcia_request_io() · 90abdc3b
      Dominik Brodowski 提交于
      Instead of io_req_t, drivers are now requested to fill out
      struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
      ranges. After a call to pcmcia_request_io(), the ports found there
      are reserved, after calling pcmcia_request_configuration(), they may
      be used.
      
      CC: netdev@vger.kernel.org
      CC: linux-wireless@vger.kernel.org
      CC: linux-ide@vger.kernel.org
      CC: linux-usb@vger.kernel.org
      CC: laforge@gnumonks.org
      CC: linux-mtd@lists.infradead.org
      CC: alsa-devel@alsa-project.org
      CC: linux-serial@vger.kernel.org
      CC: Michael Buesch <mb@bu3sch.de>
      Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      90abdc3b
    • D
      pcmcia: do not use io_req_t after call to pcmcia_request_io() · 9a017a91
      Dominik Brodowski 提交于
      After pcmcia_request_io(), do not make use of the values stored in
      io_req_t, but instead use those found in struct pcmcia_device->resource[].
      
      CC: netdev@vger.kernel.org
      CC: linux-wireless@vger.kernel.org
      CC: linux-ide@vger.kernel.org
      CC: linux-usb@vger.kernel.org
      CC: laforge@gnumonks.org
      CC: linux-mtd@lists.infradead.org
      CC: alsa-devel@alsa-project.org
      CC: linux-serial@vger.kernel.org
      Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      9a017a91
  6. 02 8月, 2010 1 次提交