]> err.no Git - linux-2.6/blobdiff - drivers/ata/sata_mv.c
HID: Implement horizontal wheel handling for A4 Tech X5-005D
[linux-2.6] / drivers / ata / sata_mv.c
index 8d864e5e97edd46f27556a7290502ce4242e2ed7..7e72463a90eb8b84a9ea76ad13e91aea2b5249d8 100644 (file)
@@ -1136,9 +1136,10 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
        struct mv_port_priv *pp = qc->ap->private_data;
        struct scatterlist *sg;
        struct mv_sg *mv_sg, *last_sg = NULL;
+       unsigned int si;
 
        mv_sg = pp->sg_tbl;
-       ata_for_each_sg(sg, qc) {
+       for_each_sg(qc->sg, sg, qc->n_elem, si) {
                dma_addr_t addr = sg_dma_address(sg);
                u32 sg_len = sg_dma_len(sg);
 
@@ -2503,6 +2504,35 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
 
        case chip_7042:
                hp_flags |= MV_HP_PCIE;
+               if (pdev->vendor == PCI_VENDOR_ID_TTI &&
+                   (pdev->device == 0x2300 || pdev->device == 0x2310))
+               {
+                       /*
+                        * Highpoint RocketRAID PCIe 23xx series cards:
+                        *
+                        * Unconfigured drives are treated as "Legacy"
+                        * by the BIOS, and it overwrites sector 8 with
+                        * a "Lgcy" metadata block prior to Linux boot.
+                        *
+                        * Configured drives (RAID or JBOD) leave sector 8
+                        * alone, but instead overwrite a high numbered
+                        * sector for the RAID metadata.  This sector can
+                        * be determined exactly, by truncating the physical
+                        * drive capacity to a nice even GB value.
+                        *
+                        * RAID metadata is at: (dev->n_sectors & ~0xfffff)
+                        *
+                        * Warn the user, lest they think we're just buggy.
+                        */
+                       printk(KERN_WARNING DRV_NAME ": Highpoint RocketRAID"
+                               " BIOS CORRUPTS DATA on all attached drives,"
+                               " regardless of if/how they are configured."
+                               " BEWARE!\n");
+                       printk(KERN_WARNING DRV_NAME ": For data safety, do not"
+                               " use sectors 8-9 on \"Legacy\" drives,"
+                               " and avoid the final two gigabytes on"
+                               " all RocketRAID BIOS initialized drives.\n");
+               }
        case chip_6042:
                hpriv->ops = &mv6xxx_ops;
                hp_flags |= MV_HP_GEN_IIE;