summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/remote_device.c
diff options
context:
space:
mode:
authorBartek Nowakowski2012-01-04 10:33:20 +0100
committerJames Bottomley2012-01-16 08:45:43 +0100
commit7e629841b8f8f7bc84d74de994d748b0a3282225 (patch)
tree00c823b35c8c72f3b151c3eabef95255e59b4bc0 /drivers/scsi/isci/remote_device.c
parent[SCSI] isci: Fix IO fails when pull cable from phy in x4 wideport in MPC mode. (diff)
downloadkernel-qcow2-linux-7e629841b8f8f7bc84d74de994d748b0a3282225.tar.gz
kernel-qcow2-linux-7e629841b8f8f7bc84d74de994d748b0a3282225.tar.xz
kernel-qcow2-linux-7e629841b8f8f7bc84d74de994d748b0a3282225.zip
[SCSI] isci: enable wide port targets
Arrange for task_contexts prepared for the wide targets to account for all the attached phys in the port. Signed-off-by: Bartek Nowakowski <bartek.nowakowski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/isci/remote_device.c')
-rw-r--r--drivers/scsi/isci/remote_device.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index b207cd3b15a0..dd74b6ceeb82 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -53,6 +53,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <scsi/sas.h>
+#include <linux/bitops.h>
#include "isci.h"
#include "port.h"
#include "remote_device.h"
@@ -1101,6 +1102,7 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,
struct isci_remote_device *idev)
{
enum sci_status status;
+ struct sci_port_properties properties;
struct domain_device *dev = idev->domain_dev;
sci_remote_device_construct(iport, idev);
@@ -1110,6 +1112,11 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,
* entries will be needed to store the remote node.
*/
idev->is_direct_attached = true;
+
+ sci_port_get_properties(iport, &properties);
+ /* Get accurate port width from port's phy mask for a DA device. */
+ idev->device_port_width = hweight32(properties.phy_mask);
+
status = sci_controller_allocate_remote_node_context(iport->owning_controller,
idev,
&idev->rnc.remote_node_index);
@@ -1125,9 +1132,6 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,
idev->connection_rate = sci_port_get_max_allowed_speed(iport);
- /* / @todo Should I assign the port width by reading all of the phys on the port? */
- idev->device_port_width = 1;
-
return SCI_SUCCESS;
}