Line 0
Link Here
|
|
|
1 |
--- os_freebsd.cpp 2011/10/06 16:43:44 3423 |
2 |
+++ os_freebsd.cpp 2011/11/03 17:50:35 3466 |
3 |
@@ -1013,6 +1013,20 @@ |
4 |
warnx("error allocating ccb"); |
5 |
return -ENOMEM; |
6 |
} |
7 |
+ // mfi SAT layer is known to be buggy |
8 |
+ if(!strcmp("mfi",m_camdev->sim_name)) { |
9 |
+ if (iop->cmnd[0] == SAT_ATA_PASSTHROUGH_12 || iop->cmnd[0] == SAT_ATA_PASSTHROUGH_16) { |
10 |
+ // Controller does not return ATA output registers in SAT sense data |
11 |
+ if (iop->cmnd[2] & (1 << 5)) // chk_cond |
12 |
+ return set_err(ENOSYS, "ATA return descriptor not supported by controller firmware"); |
13 |
+ } |
14 |
+ // SMART WRITE LOG SECTOR causing media errors |
15 |
+ if ((iop->cmnd[0] == SAT_ATA_PASSTHROUGH_16 && iop->cmnd[14] == ATA_SMART_CMD |
16 |
+ && iop->cmnd[3]==0 && iop->cmnd[4] == ATA_SMART_WRITE_LOG_SECTOR) || |
17 |
+ (iop->cmnd[0] == SAT_ATA_PASSTHROUGH_12 && iop->cmnd[9] == ATA_SMART_CMD && |
18 |
+ iop->cmnd[3] == ATA_SMART_WRITE_LOG_SECTOR)) |
19 |
+ return set_err(ENOSYS, "SMART WRITE LOG SECTOR command is not supported by controller firmware"); |
20 |
+ } |
21 |
|
22 |
// clear out structure, except for header that was filled in for us |
23 |
bzero(&(&ccb->ccb_h)[1], |
24 |
@@ -1590,12 +1604,18 @@ |
25 |
return this; |
26 |
} |
27 |
|
28 |
- // SAT or USB ? |
29 |
+ // SAT or USB, skip MFI controllers because of bugs |
30 |
{ |
31 |
smart_device * newdev = smi()->autodetect_sat_device(this, req_buff, len); |
32 |
- if (newdev) |
33 |
+ if (newdev) { |
34 |
// NOTE: 'this' is now owned by '*newdev' |
35 |
+ if(!strcmp("mfi",m_camdev->sim_name)) { |
36 |
+ newdev->close(); |
37 |
+ newdev->set_err(ENOSYS, "SATA device detected,\n" |
38 |
+ "MegaRAID SAT layer is reportedly buggy, use '-d sat' to try anyhow"); |
39 |
+ } |
40 |
return newdev; |
41 |
+ } |
42 |
} |
43 |
|
44 |
// Nothing special found |