1. My HDD inside DVD enclosure is not discovered. Then I have to reset stata device 3 or 4 times by "echo "- - -" > /sys/class/scsi_host/host1/scan" command
2. After stata resets, function sata_down_spd_limit() is called.
* In Linux 4.14 this function set up link->sata_spd_limit from value 4294967295 to value 1. After this set up, HDD is discovered and works fine.
* Since patch 4.15.0-rc4 value of link->sata_spd_limit is not changed, so HDD is not working at all.
Some debug information:
Inside function sata_down_spd_limit() is called ata_sstatus_online() and it returns 0 that means link is offline.
Value of "link->sata_spd" and "spd" is 0, value of "link->sata_spd_limit" is 4294967295 and value of "bit" is 31. After statement "mask &= ~(1 << bit);" mask is set to 2147483647
Because "spd" is 0, then statement "if (spd > 1)" is not pass and "else return -EINVAL;" is called.
Patch "else link->sata_spd_limit = mask;" doesn't work, because mask is 2147483647 and it seems to not be valid value (I think it should be 1, 2, or 4).
I can split my issue into two cases:
1. My HDD inside DVD enclosure is not discovered. Then I have to reset stata device 3 or 4 times by "echo "- - -" > /sys/class/ scsi_host/ host1/scan" command
2. After stata resets, function sata_down_ spd_limit( ) is called.
* In Linux 4.14 this function set up link->sata_ spd_limit from value 4294967295 to value 1. After this set up, HDD is discovered and works fine. spd_limit is not changed, so HDD is not working at all.
* Since patch 4.15.0-rc4 value of link->sata_
Some debug information: spd_limit( ) is called ata_sstatus_ online( ) and it returns 0 that means link is offline. sata_spd_ limit" is 4294967295 and value of "bit" is 31. After statement "mask &= ~(1 << bit);" mask is set to 2147483647
Inside function sata_down_
Value of "link->sata_spd" and "spd" is 0, value of "link->
Because "spd" is 0, then statement "if (spd > 1)" is not pass and "else return -EINVAL;" is called.
Patch "else link->sata_ spd_limit = mask;" doesn't work, because mask is 2147483647 and it seems to not be valid value (I think it should be 1, 2, or 4).