1. 26 1月, 2008 5 次提交
    • B
      ide: remove ->dma_master field from ide_hwif_t (take 5) · 1c029fd6
      Bartlomiej Zolnierkiewicz 提交于
      * Convert cmd64x, hpt366 and pdc202xx_old host drivers to use
        pci_resource_start(hwif->pci_dev, 4) instead of hwif->dma_master.
      
      * Remove no longer needed ->dma_master field from ide_hwif_t.
      
      v2:
      * Use the more readable 'hwif->dma_base - (hwif->channel * 8)' instead of
        pci_resource_start(hwif->pci_dev, 4).
      
      v3:
      * Use hwif->extra_base in hpt366/pdc20xx_old + some cosmetic fixups over v2
        (suggested by Sergei).
      
      v4:
      * Correct offsets in hpt3xxn_set_clock().
      
      v5:
      * Use hwif->extra_base in hpt366 for _real_ this time. (Noticed by Sergei)
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      1c029fd6
    • S
      hpt366: merge set_dma_mode() methods · 866664d7
      Sergei Shtylyov 提交于
      Group the array of pointers to the timing tables with the timing register masks
      which allows us to merge HPT36x/HPT37x set_dma_mode() methods into one.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      866664d7
    • S
      hpt366: kill set_dma_mode() method wrapper · a488f34e
      Sergei Shtylyov 提交于
      There's no reason to keep the set_dma_mode() method wrapper for two different
      chip families, so get rid of it...
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      a488f34e
    • S
      hpt366: change timing register masks · ceb1b2c5
      Sergei Shtylyov 提交于
      Since PIO autotuning is now done always, there's no need anymore to program
      the taskfile timings also on DMA modes, so change the IDE timing register
      masks accordingly, "inverting the polarity" of the masks while at it...
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ceb1b2c5
    • A
      ide-io: set REQ_FAILED when drive is dead · b5e1a4e2
      Aristeu Rozanski 提交于
      Currently it's possible to ide-cd to set an incorrect blocksize by
      reading garbage if the drive is dead:
      
      ide_cd_probe()
       -> cdrom_read_toc()
           -> cdrom_read_capacity()
               -> cdrom_queue_packet_command()
                   -> ide_do_drive_cmd()
                       -> ide_do_request()
                           -> start_request()
      
      on start_request():
      
              /* bail early if we've exceeded max_failures */
              if (drive->max_failures && (drive->failures > drive->max_failures)) {
                      goto kill_rq;
              }
      (...)
      kill_rq:
              ide_kill_rq(drive, rq);
              return ide_stopped;
      
      ide_kill_rq() and the next calls won't set REQ_FAILED on rq->cmd_flags and thus
      cdrom_queue_packet_command() won't return an error. then:
      
              stat = cdrom_queue_packet_command(drive, &req);
              if (stat == 0) {
                      *capacity = 1 + be32_to_cpu(capbuf.lba);
                      *sectors_per_frame =
                              be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
              }
      
      cdrom_read_capacity() ends believing capbuf is valid but in fact it's just
      uninitialized data. back to cdrom_read_toc():
      
              /* Try to get the total cdrom capacity and sector size. */
              stat = cdrom_read_capacity(drive, &toc->capacity, &sectors_per_frame,
                                         sense);
              if (stat)
                      toc->capacity = 0x1fffff;
      
              set_capacity(info->disk, toc->capacity * sectors_per_frame);
              /* Save a private copy of te TOC capacity for error handling */
              drive->probed_capacity = toc->capacity * sectors_per_frame;
      
              blk_queue_hardsect_size(drive->queue,
                                      sectors_per_frame << SECTOR_BITS);
      
      that will set drive->queue->hardsect_size to be the random value.
      hardsect_size is used to calculate inode->i_blkbits. later on, on a read
      path:
      
      void create_empty_buffers(struct page *page,
                              unsigned long blocksize, unsigned long b_state)
      {       
              struct buffer_head *bh, *head, *tail;
      
              head = alloc_page_buffers(page, blocksize, 1);
              bh = head;
              do {    
                      bh->b_state |= b_state;
                      tail = bh;
                      bh = bh->b_this_page;
              } while (bh);
              tail->b_this_page = head;
      
      alloc_page_buffers() will return NULL if blocksize > 4096. blocksize is
      calculed based on inode->i_blkbits. that will trigger a null
      dereference on create_empty_buffers().
      Signed-off-by: NAristeu Rozanski <arozansk@redhat.com>
      Cc: Borislav Petkov <bbpetkov@yahoo.de>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      b5e1a4e2
  2. 25 1月, 2008 2 次提交
    • K
      Driver core: convert block from raw kobjects to core devices · edfaa7c3
      Kay Sievers 提交于
      This moves the block devices to /sys/class/block. It will create a
      flat list of all block devices, with the disks and partitions in one
      directory. For compatibility /sys/block is created and contains symlinks
      to the disks.
      
        /sys/class/block
        |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1
        |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10
        |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5
        |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6
        |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7
        |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
        |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9
        `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      
        /sys/block/
        |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
        `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      edfaa7c3
    • T
      IDE: Convert from class_device to device for ide-tape · dbc1272e
      Tony Jones 提交于
      Signed-off-by: NTony Jones <tonyj@suse.de>
      Cc: Gadi Oxman <gadio@netvision.net.il>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      dbc1272e
  3. 12 1月, 2008 1 次提交
  4. 11 1月, 2008 3 次提交
  5. 24 12月, 2007 11 次提交
  6. 13 12月, 2007 13 次提交
  7. 28 11月, 2007 5 次提交