]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 25 Oct 2007 22:44:54 +0000 (15:44 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 25 Oct 2007 22:44:54 +0000 (15:44 -0700)
* 'sg' of git://git.kernel.dk/linux-2.6-block:
  fix sg_phys to use dma_addr_t
  ub: add sg_init_table for sense and read capacity commands
  x86: pci-gart fix
  blackfin: fix sg fallout
  xtensa: dma-mapping.h is using linux/scatterlist.h functions, so include it
  SG: audit of drivers that use blk_rq_map_sg()
  arch/um/drivers/ubd_kern.c: fix a building error
  SG: Change sg_set_page() to take length and offset argument
  AVR32: Fix sg_page breakage
  mmc: sg fallout
  m68k: sg fallout
  More SG build fixes
  sg: add missing sg_init_table calls to zfcp
  SG build fix

1  2 
drivers/ata/libata-core.c

index 9d10e2feb8b11094dd960d149142c3f72feef964,b5f7c5913062ed0458330e084099d0cd0923d2f7..081e3dfb64d485e9382d253add9ae07a03f4651e
@@@ -68,8 -68,7 +68,8 @@@ const unsigned long sata_deb_timing_lon
  static unsigned int ata_dev_init_params(struct ata_device *dev,
                                        u16 heads, u16 sectors);
  static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
 -static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable);
 +static unsigned int ata_dev_set_feature(struct ata_device *dev,
 +                                      u8 enable, u8 feature);
  static void ata_dev_xfermask(struct ata_device *dev);
  static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
  
@@@ -1800,7 -1799,13 +1800,7 @@@ int ata_dev_read_id(struct ata_device *
                 * SET_FEATURES spin-up subcommand before it will accept
                 * anything other than the original IDENTIFY command.
                 */
 -              ata_tf_init(dev, &tf);
 -              tf.command = ATA_CMD_SET_FEATURES;
 -              tf.feature = SETFEATURES_SPINUP;
 -              tf.protocol = ATA_PROT_NODATA;
 -              tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
 -              err_mask = ata_exec_internal(dev, &tf, NULL,
 -                                           DMA_NONE, NULL, 0, 0);
 +              err_mask = ata_dev_set_feature(dev, SETFEATURES_SPINUP, 0);
                if (err_mask && id[2] != 0x738c) {
                        rc = -EIO;
                        reason = "SPINUP failed";
@@@ -2070,8 -2075,7 +2070,8 @@@ int ata_dev_configure(struct ata_devic
                        unsigned int err_mask;
  
                        /* issue SET feature command to turn this on */
 -                      err_mask = ata_dev_set_AN(dev, SETFEATURES_SATA_ENABLE);
 +                      err_mask = ata_dev_set_feature(dev,
 +                                      SETFEATURES_SATA_ENABLE, SATA_AN);
                        if (err_mask)
                                ata_dev_printk(dev, KERN_ERR,
                                        "failed to enable ATAPI AN "
@@@ -2882,13 -2886,6 +2882,13 @@@ static int ata_dev_set_mode(struct ata_
                        dev->pio_mode <= XFER_PIO_2)
                err_mask &= ~AC_ERR_DEV;
  
 +      /* Early MWDMA devices do DMA but don't allow DMA mode setting.
 +         Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */
 +      if (dev->xfer_shift == ATA_SHIFT_MWDMA && 
 +          dev->dma_mode == XFER_MW_DMA_0 &&
 +          (dev->id[63] >> 8) & 1)
 +              err_mask &= ~AC_ERR_DEV;
 +
        if (err_mask) {
                ata_dev_printk(dev, KERN_ERR, "failed to set xfermode "
                               "(err_mask=0x%x)\n", err_mask);
@@@ -3950,6 -3947,9 +3950,6 @@@ static const struct ata_blacklist_entr
        { "_NEC DV5800A",       NULL,           ATA_HORKAGE_NODMA },
        { "SAMSUNG CD-ROM SN-124", "N001",      ATA_HORKAGE_NODMA },
        { "Seagate STT20000A", NULL,            ATA_HORKAGE_NODMA },
 -      { "IOMEGA  ZIP 250       ATAPI", NULL,  ATA_HORKAGE_NODMA }, /* temporary fix */
 -      { "IOMEGA  ZIP 250       ATAPI       Floppy",
 -                              NULL,           ATA_HORKAGE_NODMA },
        /* Odd clown on sil3726/4726 PMPs */
        { "Config  Disk",       NULL,           ATA_HORKAGE_NODMA |
                                                ATA_HORKAGE_SKIP_PM },
        { }
  };
  
 -int strn_pattern_cmp(const char *patt, const char *name, int wildchar)
 +static int strn_pattern_cmp(const char *patt, const char *name, int wildchar)
  {
        const char *p;
        int len;
@@@ -4181,14 -4181,15 +4181,14 @@@ static unsigned int ata_dev_set_xfermod
        DPRINTK("EXIT, err_mask=%x\n", err_mask);
        return err_mask;
  }
 -
  /**
 - *    ata_dev_set_AN - Issue SET FEATURES - SATA FEATURES
 + *    ata_dev_set_feature - Issue SET FEATURES - SATA FEATURES
   *    @dev: Device to which command will be sent
   *    @enable: Whether to enable or disable the feature
 + *    @feature: The sector count represents the feature to set
   *
   *    Issue SET FEATURES - SATA FEATURES command to device @dev
 - *    on port @ap with sector count set to indicate Asynchronous
 - *    Notification feature
 + *    on port @ap with sector count
   *
   *    LOCKING:
   *    PCI/etc. bus probe sem.
   *    RETURNS:
   *    0 on success, AC_ERR_* mask otherwise.
   */
 -static unsigned int ata_dev_set_AN(struct ata_device *dev, u8 enable)
 +static unsigned int ata_dev_set_feature(struct ata_device *dev, u8 enable,
 +                                      u8 feature)
  {
        struct ata_taskfile tf;
        unsigned int err_mask;
        tf.feature = enable;
        tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
        tf.protocol = ATA_PROT_NODATA;
 -      tf.nsect = SATA_AN;
 +      tf.nsect = feature;
  
        err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
  
@@@ -4689,8 -4689,8 +4689,8 @@@ static int ata_sg_setup(struct ata_queu
                 * data in this function or read data in ata_sg_clean.
                 */
                offset = lsg->offset + lsg->length - qc->pad_len;
-               sg_set_page(psg, nth_page(sg_page(lsg), offset >> PAGE_SHIFT));
-               psg->offset = offset_in_page(offset);
+               sg_set_page(psg, nth_page(sg_page(lsg), offset >> PAGE_SHIFT),
+                               qc->pad_len, offset_in_page(offset));
  
                if (qc->tf.flags & ATA_TFLAG_WRITE) {
                        void *addr = kmap_atomic(sg_page(psg), KM_IRQ0);
@@@ -6921,7 -6921,7 +6921,7 @@@ int ata_host_activate(struct ata_host *
   *    LOCKING:
   *    Kernel thread context (may sleep).
   */
 -void ata_port_detach(struct ata_port *ap)
 +static void ata_port_detach(struct ata_port *ap)
  {
        unsigned long flags;
        struct ata_link *link;