linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-scsi@vger.kernel.org
Cc: Bartek Nowakowski <bartek.nowakowski@intel.com>
Subject: [PATCH v2 11/15] isci: enable wide port targets
Date: Wed, 04 Jan 2012 01:33:20 -0800	[thread overview]
Message-ID: <20120104093320.9147.43628.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20120104093015.9147.24234.stgit@localhost6.localdomain6>

From: Bartek Nowakowski <bartek.nowakowski@intel.com>

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>
---
 drivers/scsi/isci/port.c          |    2 +-
 drivers/scsi/isci/port.h          |    4 ++++
 drivers/scsi/isci/remote_device.c |   10 +++++++---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c
index 4cb071d..49e8a72 100644
--- a/drivers/scsi/isci/port.c
+++ b/drivers/scsi/isci/port.c
@@ -114,7 +114,7 @@ static u32 sci_port_get_phys(struct isci_port *iport)
  * value is returned if the specified port is not valid.  When this value is
  * returned, no data is copied to the properties output parameter.
  */
-static enum sci_status sci_port_get_properties(struct isci_port *iport,
+enum sci_status sci_port_get_properties(struct isci_port *iport,
 						struct sci_port_properties *prop)
 {
 	if (!iport || iport->logical_port_index == SCIC_SDS_DUMMY_PORT)
diff --git a/drivers/scsi/isci/port.h b/drivers/scsi/isci/port.h
index cb5ffbc..b3a7f12 100644
--- a/drivers/scsi/isci/port.h
+++ b/drivers/scsi/isci/port.h
@@ -250,6 +250,10 @@ bool sci_port_link_detected(
 	struct isci_port *iport,
 	struct isci_phy *iphy);
 
+enum sci_status sci_port_get_properties(
+	struct isci_port *iport,
+	struct sci_port_properties *prop);
+
 enum sci_status sci_port_link_up(struct isci_port *iport,
 				      struct isci_phy *iphy);
 enum sci_status sci_port_link_down(struct isci_port *iport,
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index b207cd3..dd74b6c 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;
 }
 


  parent reply	other threads:[~2012-01-04  9:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04  9:32 [GIT PATCH v2 00/15] isci update for 3.3 (part1) Dan Williams
2012-01-04  9:32 ` [PATCH v2 01/15] isci, firmware: Remove isci fallback parameter blob and generator Dan Williams
2012-01-04  9:32 ` [PATCH v2 02/15] isci: cleanup oem parameter and recipe handling Dan Williams
2012-01-04  9:32 ` [PATCH v2 03/15] isci: update afe (analog-front-end) recipe for C1 Dan Williams
2012-01-04  9:32 ` [PATCH v2 04/15] isci: oem parameter format v1.1 (ssc select) Dan Williams
2012-01-04  9:32 ` [PATCH v2 05/15] isci: oem parameter format v1.3 (cable select) Dan Williams
2012-01-04  9:32 ` [PATCH v2 06/15] isci: performance-fix, shorten default "no outbound task" timeout Dan Williams
2012-01-04  9:33 ` [PATCH v2 07/15] isci: link speeds default to gen 2 Dan Williams
2012-01-04  9:33 ` [PATCH v2 08/15] isci: remove unused 'isci_tmf->device' field Dan Williams
2012-01-04  9:33 ` [PATCH v2 09/15] isci: update version to 1.1 Dan Williams
2012-01-04  9:33 ` [PATCH v2 10/15] isci: Fix IO fails when pull cable from phy in x4 wideport in MPC mode Dan Williams
2012-01-04  9:33 ` Dan Williams [this message]
2012-01-04  9:33 ` [PATCH v2 12/15] isci: allow more time for wide port targets Dan Williams
2012-01-04  9:33 ` [PATCH v2 13/15] isci: fix io failures while wide port links are coming up Dan Williams
2012-01-04  9:33 ` [PATCH v2 14/15] isci: fix start OOB Dan Williams
2012-01-04  9:33 ` [PATCH v2 15/15] isci: fix, prevent port from getting stuck in the 'configuring' state Dan Williams
2012-01-06  1:54 ` [GIT PATCH v2 00/15] isci update for 3.3 (part1) Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120104093320.9147.43628.stgit@localhost6.localdomain6 \
    --to=dan.j.williams@intel.com \
    --cc=bartek.nowakowski@intel.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).