FreeBSD Bugzilla – Attachment 140622 Details for
Bug 187269
AF-4Kn SATA drives have mis-interpreted sector sizes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.68 KB, created by
Ravi Pokala
on 2014-03-05 04:20:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Ravi Pokala
Created:
2014-03-05 04:20:00 UTC
Size:
1.68 KB
patch
obsolete
>Index: sys/cam/ata/ata_all.c >=================================================================== >--- sys/cam/ata/ata_all.c (revision 262757) >+++ sys/cam/ata/ata_all.c (working copy) >@@ -338,10 +338,10 @@ > uint32_t > ata_logical_sector_size(struct ata_params *ident_data) > { >- if ((ident_data->pss & 0xc000) == 0x4000 && >+ if ((ident_data->pss & ATA_PSS_VALID_MASK) == ATA_PSS_VALID_VALUE && > (ident_data->pss & ATA_PSS_LSSABOVE512)) { >- return ((u_int32_t)ident_data->lss_1 | >- ((u_int32_t)ident_data->lss_2 << 16)); >+ return (u_int32_t) (((u_int32_t)ident_data->lss_1 | >+ ((u_int32_t)ident_data->lss_2 << 16)) << 1); > } > return (512); > } >@@ -349,10 +349,13 @@ > uint64_t > ata_physical_sector_size(struct ata_params *ident_data) > { >- if ((ident_data->pss & 0xc000) == 0x4000 && >- (ident_data->pss & ATA_PSS_MULTLS)) { >- return ((uint64_t)ata_logical_sector_size(ident_data) * >- (1 << (ident_data->pss & ATA_PSS_LSPPS))); >+ if ((ident_data->pss & ATA_PSS_VALID_MASK) == ATA_PSS_VALID_VALUE) { >+ if (ident_data->pss & ATA_PSS_MULTLS) { >+ return ((uint64_t)ata_logical_sector_size(ident_data) * >+ (1 << (ident_data->pss & ATA_PSS_LSPPS))); >+ } else { >+ return (uint64_t)ata_logical_sector_size(ident_data); >+ } > } > return (512); > } >Index: sys/sys/ata.h >=================================================================== >--- sys/sys/ata.h (revision 262757) >+++ sys/sys/ata.h (working copy) >@@ -211,6 +211,8 @@ > u_int16_t reserved104; > /*105*/ u_int16_t max_dsm_blocks; > /*106*/ u_int16_t pss; >+#define ATA_PSS_VALID_MASK 0xC000 >+#define ATA_PSS_VALID_VALUE 0x4000 > #define ATA_PSS_LSPPS 0x000F > #define ATA_PSS_LSSABOVE512 0x1000 > #define ATA_PSS_MULTLS 0x2000
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 187269
: 140622