Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] mvsas: update comments

Remove obsolete comments and add new comments

Signed-off-by: Xiangliang Yu <yuxiangl@marvell.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Xiangliang Yu and committed by
James Bottomley
e144f7ef 84fbd0ce

+24 -55
+4 -13
drivers/scsi/mvsas/mv_64xx.c
··· 33 33 u32 reg; 34 34 struct mvs_phy *phy = &mvi->phy[i]; 35 35 36 - /* TODO check & save device type */ 37 36 reg = mr32(MVS_GBL_PORT_TYPE); 38 37 phy->phy_type &= ~(PORT_TYPE_SAS | PORT_TYPE_SATA); 39 38 if (reg & MODE_SAS_SATA & (1 << i)) ··· 62 63 mvs_phy_hacks(mvi); 63 64 64 65 if (!(mvi->flags & MVF_FLAG_SOC)) { 65 - /* TEST - for phy decoding error, adjust voltage levels */ 66 66 for (i = 0; i < MVS_SOC_PORTS; i++) { 67 67 mvs_write_port_vsr_addr(mvi, i, VSR_PHY_MODE8); 68 68 mvs_write_port_vsr_data(mvi, i, 0x2F0); ··· 373 375 mvs_update_phyinfo(mvi, i, 1); 374 376 } 375 377 376 - /* FIXME: update wide port bitmaps */ 377 - 378 378 /* little endian for open address and command table, etc. */ 379 - /* 380 - * it seems that ( from the spec ) turning on big-endian won't 381 - * do us any good on big-endian machines, need further confirmation 382 - */ 383 379 cctl = mr32(MVS_CTL); 384 380 cctl |= CCTL_ENDIAN_CMD; 385 381 cctl |= CCTL_ENDIAN_DATA; ··· 386 394 tmp |= PCS_CMD_RST; 387 395 tmp &= ~PCS_SELF_CLEAR; 388 396 mw32(MVS_PCS, tmp); 389 - /* interrupt coalescing may cause missing HW interrput in some case, 390 - * and the max count is 0x1ff, while our max slot is 0x200, 397 + /* 398 + * the max count is 0x1ff, while our max slot is 0x200, 391 399 * it will make count 0. 392 400 */ 393 401 tmp = 0; ··· 624 632 { 625 633 u32 tmp; 626 634 struct mvs_phy *phy = &mvi->phy[i]; 627 - /* workaround for HW phy decoding error on 1.5g disk drive */ 628 635 mvs_write_port_vsr_addr(mvi, i, VSR_PHY_MODE6); 629 636 tmp = mvs_read_port_vsr_data(mvi, i); 630 637 if (((phy->phy_status & PHY_NEG_SPP_PHYS_LINK_RATE_MASK) >> ··· 756 765 { 757 766 void __iomem *regs = mvi->regs; 758 767 u32 tmp = 0; 759 - /* interrupt coalescing may cause missing HW interrput in some case, 760 - * and the max count is 0x1ff, while our max slot is 0x200, 768 + /* 769 + * the max count is 0x1ff, while our max slot is 0x200, 761 770 * it will make count 0. 762 771 */ 763 772 if (time == 0) {
+6 -13
drivers/scsi/mvsas/mv_94xx.c
··· 460 460 mvs_update_phyinfo(mvi, i, 1); 461 461 } 462 462 463 - /* FIXME: update wide port bitmaps */ 464 - 465 463 /* little endian for open address and command table, etc. */ 466 - /* 467 - * it seems that ( from the spec ) turning on big-endian won't 468 - * do us any good on big-endian machines, need further confirmation 469 - */ 470 464 cctl = mr32(MVS_CTL); 471 465 cctl |= CCTL_ENDIAN_CMD; 472 466 cctl &= ~CCTL_ENDIAN_OPEN; ··· 472 478 tmp |= PCS_CMD_RST; 473 479 tmp &= ~PCS_SELF_CLEAR; 474 480 mw32(MVS_PCS, tmp); 475 - /* interrupt coalescing may cause missing HW interrput in some case, 476 - * and the max count is 0x1ff, while our max slot is 0x200, 481 + /* 482 + * the max count is 0x1ff, while our max slot is 0x200, 477 483 * it will make count 0. 478 484 */ 479 485 tmp = 0; ··· 482 488 else 483 489 mw32(MVS_INT_COAL, MVS_CHIP_SLOT_SZ | COAL_EN); 484 490 491 + /* default interrupt coalescing time is 128us */ 485 492 tmp = 0x10000 | interrupt_coalescing; 486 493 mw32(MVS_INT_COAL_TMOUT, tmp); 487 494 ··· 740 745 { 741 746 u32 phy_st; 742 747 phy_st = mvs_read_phy_ctl(mvi, i); 743 - if (phy_st & PHY_READY_MASK) /* phy ready */ 748 + if (phy_st & PHY_READY_MASK) 744 749 return 1; 745 750 return 0; 746 751 } ··· 765 770 int i; 766 771 u32 id_frame[7]; 767 772 768 - /* mvs_hexdump(28, (u8 *)id_frame, 0); */ 769 773 for (i = 0; i < 7; i++) { 770 774 mvs_write_port_cfg_addr(mvi, port_id, 771 775 CONFIG_ATT_ID_FRAME0 + i * 4); ··· 772 778 mv_dprintk("94xx phy %d atta frame %d %x.\n", 773 779 port_id + mvi->id * mvi->chip->n_phy, i, id_frame[i]); 774 780 } 775 - /* mvs_hexdump(28, (u8 *)id_frame, 0); */ 776 781 memcpy(id, id_frame, 28); 777 782 } 778 783 ··· 955 962 { 956 963 void __iomem *regs = mvi->regs; 957 964 u32 tmp = 0; 958 - /* interrupt coalescing may cause missing HW interrput in some case, 959 - * and the max count is 0x1ff, while our max slot is 0x200, 965 + /* 966 + * the max count is 0x1ff, while our max slot is 0x200, 960 967 * it will make count 0. 961 968 */ 962 969 if (time == 0) {
+12 -12
drivers/scsi/mvsas/mv_94xx.h
··· 121 121 122 122 /* SAS/SATA Vendor Specific Port Registers */ 123 123 enum sas_sata_vsp_regs { 124 - VSR_PHY_STAT = 0x00 * 4, /* Phy Status */ 125 - VSR_PHY_MODE1 = 0x01 * 4, /* phy tx */ 126 - VSR_PHY_MODE2 = 0x02 * 4, /* tx scc */ 127 - VSR_PHY_MODE3 = 0x03 * 4, /* pll */ 128 - VSR_PHY_MODE4 = 0x04 * 4, /* VCO */ 129 - VSR_PHY_MODE5 = 0x05 * 4, /* Rx */ 130 - VSR_PHY_MODE6 = 0x06 * 4, /* CDR */ 131 - VSR_PHY_MODE7 = 0x07 * 4, /* Impedance */ 132 - VSR_PHY_MODE8 = 0x08 * 4, /* Voltage */ 133 - VSR_PHY_MODE9 = 0x09 * 4, /* Test */ 134 - VSR_PHY_MODE10 = 0x0A * 4, /* Power */ 135 - VSR_PHY_MODE11 = 0x0B * 4, /* Phy Mode */ 124 + VSR_PHY_STAT = 0x00 * 4, /* Phy Interrupt Status */ 125 + VSR_PHY_MODE1 = 0x01 * 4, /* phy Interrupt Enable */ 126 + VSR_PHY_MODE2 = 0x02 * 4, /* Phy Configuration */ 127 + VSR_PHY_MODE3 = 0x03 * 4, /* Phy Status */ 128 + VSR_PHY_MODE4 = 0x04 * 4, /* Phy Counter 0 */ 129 + VSR_PHY_MODE5 = 0x05 * 4, /* Phy Counter 1 */ 130 + VSR_PHY_MODE6 = 0x06 * 4, /* Event Counter Control */ 131 + VSR_PHY_MODE7 = 0x07 * 4, /* Event Counter Select */ 132 + VSR_PHY_MODE8 = 0x08 * 4, /* Event Counter 0 */ 133 + VSR_PHY_MODE9 = 0x09 * 4, /* Event Counter 1 */ 134 + VSR_PHY_MODE10 = 0x0A * 4, /* Event Counter 2 */ 135 + VSR_PHY_MODE11 = 0x0B * 4, /* Event Counter 3 */ 136 136 VSR_PHY_ACT_LED = 0x0C * 4, /* Activity LED control */ 137 137 138 138 VSR_PHY_FFE_CONTROL = 0x10C,
-2
drivers/scsi/mvsas/mv_chips.h
··· 164 164 { 165 165 u32 tmp; 166 166 167 - /* workaround for SATA R-ERR, to ignore phy glitch */ 168 167 tmp = mvs_cr32(mvi, CMD_PHY_TIMER); 169 168 tmp &= ~(1 << 9); 170 169 tmp |= (1 << 10); ··· 178 179 tmp |= 0x3fff; 179 180 mvs_cw32(mvi, CMD_SAS_CTL0, tmp); 180 181 181 - /* workaround for WDTIMEOUT , set to 550 ms */ 182 182 mvs_cw32(mvi, CMD_WD_TIMER, 0x7a0000); 183 183 184 184 /* not to halt for different port op during wideport link change */
+1 -1
drivers/scsi/mvsas/mv_defs.h
··· 160 160 TXQ_CMD_SSP = 1, /* SSP protocol */ 161 161 TXQ_CMD_SMP = 2, /* SMP protocol */ 162 162 TXQ_CMD_STP = 3, /* STP/SATA protocol */ 163 - TXQ_CMD_SSP_FREE_LIST = 4, /* add to SSP targ free list */ 163 + TXQ_CMD_SSP_FREE_LIST = 4, /* add to SSP target free list */ 164 164 TXQ_CMD_SLOT_RESET = 7, /* reset command slot */ 165 165 TXQ_MODE_I = (1U << 28), /* mode: 0=target,1=initiator */ 166 166 TXQ_MODE_TARGET = 0,
-1
drivers/scsi/mvsas/mv_init.c
··· 405 405 return NULL; 406 406 } 407 407 408 - /* move to PCI layer or libata core? */ 409 408 static int pci_go_64(struct pci_dev *pdev) 410 409 { 411 410 int rc;
+1 -13
drivers/scsi/mvsas/mv_sas.c
··· 102 102 103 103 } 104 104 105 - /* FIXME */ 106 105 int mvs_find_dev_phyno(struct domain_device *dev, int *phyno) 107 106 { 108 107 unsigned long i = 0, j = 0, n = 0, num = 0; ··· 176 177 } 177 178 } 178 179 179 - /* FIXME: locking? */ 180 180 int mvs_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func, 181 181 void *funcdata) 182 182 { ··· 502 504 flags |= MCH_ATAPI; 503 505 } 504 506 505 - /* FIXME: fill in port multiplier number */ 506 - 507 507 hdr->flags = cpu_to_le32(flags); 508 508 509 - /* FIXME: the low order order 5 bits for the TAG if enable NCQ */ 510 509 if (task->ata_task.use_ncq && mvs_get_ncq_tag(task, &hdr_tag)) 511 510 task->ata_task.fis.sector_count |= (u8) (hdr_tag << 3); 512 511 else ··· 547 552 buf_tmp_dma += i; 548 553 549 554 /* region 4: status buffer (larger the PRD, smaller this buf) ****** */ 550 - /* FIXME: probably unused, for SATA. kept here just in case 551 - * we get a STP/SATA error information record 552 - */ 553 555 slot->response = buf_tmp; 554 556 hdr->status_buf = cpu_to_le64(buf_tmp_dma); 555 557 if (mvi->flags & MVF_FLAG_SOC) ··· 1118 1126 MVS_CHIP_DISP->write_port_cfg_addr(mvi, i, PHYR_SATA_SIG0); 1119 1127 s[0] = cpu_to_le32(MVS_CHIP_DISP->read_port_cfg_data(mvi, i)); 1120 1128 1121 - /* Workaround: take some ATAPI devices for ATA */ 1122 1129 if (((s[1] & 0x00FFFFFF) == 0x00EB1401) && (*(u8 *)&s[3] == 0x01)) 1123 1130 s[1] = 0x00EB1401 | (*((u8 *)&s[1] + 3) & 0x10); 1124 1131 ··· 1424 1433 complete(&task->completion); 1425 1434 } 1426 1435 1427 - /* XXX */ 1428 1436 #define MVS_TASK_TIMEOUT 20 1429 1437 static int mvs_exec_internal_tmf_task(struct domain_device *dev, 1430 1438 void *parameter, u32 para_len, struct mvs_tmf_task *tmf) ··· 1567 1577 mv_printk("%s for device[%x]:rc= %d\n", 1568 1578 __func__, mvi_dev->device_id, rc); 1569 1579 1570 - /* housekeeper */ 1571 1580 spin_lock_irqsave(&mvi->lock, flags); 1572 1581 mvs_release_task(mvi, dev); 1573 1582 spin_unlock_irqrestore(&mvi->lock, flags); ··· 1670 1681 1671 1682 } else if (task->task_proto & SAS_PROTOCOL_SATA || 1672 1683 task->task_proto & SAS_PROTOCOL_STP) { 1673 - /* to do free register_set */ 1674 1684 if (SATA_DEV == dev->dev_type) { 1675 1685 struct mvs_slot_info *slot = task->lldd_task; 1676 1686 u32 slot_idx = (u32)(slot - mvi->slot_info); ··· 1889 1901 return -1; 1890 1902 } 1891 1903 1904 + /* when no device attaching, go ahead and complete by error handling*/ 1892 1905 if (unlikely(!mvi_dev || flags)) { 1893 1906 if (!mvi_dev) 1894 1907 mv_dprintk("port has not device.\n"); ··· 2006 2017 struct domain_device *dev) 2007 2018 { 2008 2019 int i, phyno[WIDE_PORT_MAX_PHY], num; 2009 - /* housekeeper */ 2010 2020 num = mvs_find_dev_phyno(dev, phyno); 2011 2021 for (i = 0; i < num; i++) 2012 2022 mvs_do_release_task(mvi, phyno[i], dev);