==== //depot/users/kenm/FreeBSD-test3/sys/cam/ata/ata_da.c#24 - /usr/home/kenm/perforce4/kenm/FreeBSD-test3/sys/cam/ata/ata_da.c ==== *** /tmp/tmp.78414.6 Tue May 24 07:59:30 2016 --- /usr/home/kenm/perforce4/kenm/FreeBSD-test3/sys/cam/ata/ata_da.c Tue May 24 07:56:17 2016 *************** *** 115,126 **** ADA_Q_NONE = 0x00, ADA_Q_4K = 0x01, ADA_Q_NCQ_TRIM_BROKEN = 0x02, } ada_quirks; #define ADA_Q_BIT_STRING \ "\020" \ "\0014K" \ ! "\002NCQ_TRIM_BROKEN" typedef enum { ADA_CCB_RAHEAD = 0x01, --- 115,128 ---- ADA_Q_NONE = 0x00, ADA_Q_4K = 0x01, ADA_Q_NCQ_TRIM_BROKEN = 0x02, + ADA_Q_LOG_BROKEN = 0x04 } ada_quirks; #define ADA_Q_BIT_STRING \ "\020" \ "\0014K" \ ! "\002NCQ_TRIM_BROKEN" \ ! "\004LOG_BROKEN" typedef enum { ADA_CCB_RAHEAD = 0x01, *************** *** 680,685 **** --- 682,697 ---- /*quirks*/ADA_Q_4K }, { + /* + * Samsung drive that doesn't support READ LOG EXT or + * READ LOG DMA EXT, despite reporting that it does in + * ATA identify data: + * SAMSUNG HD200HJ KF100-06 + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "SAMSUNG HD200*", "*" }, + /*quirks*/ADA_Q_LOG_BROKEN + }, + { /* Default */ { T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED, *************** *** 1581,1587 **** */ adasetdeletemethod(softc); ! if (cgd->ident_data.support.extension & ATA_SUPPORT_GENLOG) softc->flags |= ADA_FLAG_CAN_LOG; else softc->flags &= ~ADA_FLAG_CAN_LOG; --- 1593,1600 ---- */ adasetdeletemethod(softc); ! if ((cgd->ident_data.support.extension & ATA_SUPPORT_GENLOG) ! && ((softc->quirks & ADA_Q_LOG_BROKEN) == 0)) softc->flags |= ADA_FLAG_CAN_LOG; else softc->flags &= ~ADA_FLAG_CAN_LOG; *************** *** 1639,1649 **** return(CAM_REQ_CMP_ERR); } - /* - * Set support flags based on the Identify data. - */ - adasetflags(softc, cgd); - periph->softc = softc; /* --- 1652,1657 ---- *************** *** 1653,1662 **** (caddr_t)ada_quirk_table, nitems(ada_quirk_table), sizeof(*ada_quirk_table), ata_identify_match); ! if (match != NULL) softc->quirks = ((struct ada_quirk_entry *)match)->quirks; ! else softc->quirks = ADA_Q_NONE; bzero(&cpi, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); --- 1661,1674 ---- (caddr_t)ada_quirk_table, nitems(ada_quirk_table), sizeof(*ada_quirk_table), ata_identify_match); ! if (match != NULL) { softc->quirks = ((struct ada_quirk_entry *)match)->quirks; ! xpt_print(periph->path, "%s: match found, quirks 0x%02x\n", ! __func__, softc->quirks); ! } else { softc->quirks = ADA_Q_NONE; + xpt_print(periph->path, "%s: NO quirk match found\n", __func__); + } bzero(&cpi, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); *************** *** 1675,1680 **** --- 1687,1695 ---- quirks = softc->quirks; TUNABLE_INT_FETCH(announce_buf, &quirks); softc->quirks = quirks; + + xpt_print(periph->path, "%s: quirks now 0x%02x\n", __func__, + softc->quirks); softc->read_ahead = -1; snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.read_ahead", periph->unit_number); *************** *** 1683,1688 **** --- 1698,1709 ---- snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); + + /* + * Set support flags based on the Identify data. + */ + adasetflags(softc, cgd); + /* Disable queue sorting for non-rotational media by default. */ if (cgd->ident_data.media_rotation_rate == ATA_RATE_NON_ROTATING) { softc->rotating = 0;