Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35007
b: refs/heads/master
c: f4ad7b5
h: refs/heads/master
i:
  35005: c667f7b
  35003: 9b2bbf9
  34999: b5a197c
  34991: e5c53a2
  34975: 0501ddf
  34943: 6abb836
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Aug 28, 2006
1 parent 06bd56b commit dbb6ba9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ce7a9c159c8c4eb480f0a65c6af753dbf9a1a70
refs/heads/master: f4ad7b5807385ad1fed0347d966e51a797cd1013
11 changes: 8 additions & 3 deletions trunk/drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,10 @@ static int mptsas_get_linkerrors(struct sas_phy *phy)
dma_addr_t dma_handle;
int error;

/* FIXME: only have link errors on local phys */
if (!scsi_is_sas_phy_local(phy))
return -EINVAL;

hdr.PageVersion = MPI_SASPHY1_PAGEVERSION;
hdr.ExtPageLength = 0;
hdr.PageNumber = 1 /* page number 1*/;
Expand Down Expand Up @@ -924,6 +928,10 @@ static int mptsas_phy_reset(struct sas_phy *phy, int hard_reset)
unsigned long timeleft;
int error = -ERESTARTSYS;

/* FIXME: fusion doesn't allow non-local phy reset */
if (!scsi_is_sas_phy_local(phy))
return -EINVAL;

/* not implemented for expanders */
if (phy->identify.target_port_protocols & SAS_PROTOCOL_SMP)
return -ENXIO;
Expand Down Expand Up @@ -1570,9 +1578,6 @@ static int mptsas_probe_one_phy(struct device *dev,

if (!phy_info->phy) {

if (local)
phy->local_attached = 1;

error = sas_phy_add(phy);
if (error) {
sas_phy_free(phy);
Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/scsi/scsi_transport_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ show_sas_phy_##field(struct class_device *cdev, char *buf) \
struct sas_internal *i = to_sas_internal(shost->transportt); \
int error; \
\
if (!phy->local_attached) \
return -EINVAL; \
\
error = i->f->get_linkerrors ? i->f->get_linkerrors(phy) : 0; \
if (error) \
return error; \
Expand Down Expand Up @@ -299,9 +296,6 @@ static ssize_t do_sas_phy_reset(struct class_device *cdev,
struct sas_internal *i = to_sas_internal(shost->transportt);
int error;

if (!phy->local_attached)
return -EINVAL;

error = i->f->phy_reset(phy, hard_reset);
if (error)
return error;
Expand Down Expand Up @@ -849,7 +843,7 @@ show_sas_rphy_enclosure_identifier(struct class_device *cdev, char *buf)
* Only devices behind an expander are supported, because the
* enclosure identifier is a SMP feature.
*/
if (phy->local_attached)
if (scsi_is_sas_phy_local(phy))
return -EINVAL;

error = i->f->get_enclosure_identifier(rphy, &identifier);
Expand All @@ -870,7 +864,7 @@ show_sas_rphy_bay_identifier(struct class_device *cdev, char *buf)
struct sas_internal *i = to_sas_internal(shost->transportt);
int val;

if (phy->local_attached)
if (scsi_is_sas_phy_local(phy))
return -EINVAL;

val = i->f->get_bay_identifier(rphy);
Expand Down
5 changes: 2 additions & 3 deletions trunk/include/scsi/scsi_transport_sas.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ struct sas_phy {
enum sas_linkrate maximum_linkrate_hw;
enum sas_linkrate maximum_linkrate;

/* internal state */
unsigned int local_attached : 1;

/* link error statistics */
u32 invalid_dword_count;
u32 running_disparity_error_count;
Expand Down Expand Up @@ -196,4 +193,6 @@ scsi_is_sas_expander_device(struct device *dev)
rphy->identify.device_type == SAS_EDGE_EXPANDER_DEVICE;
}

#define scsi_is_sas_phy_local(phy) scsi_is_host_device((phy)->dev.parent)

#endif /* SCSI_TRANSPORT_SAS_H */

0 comments on commit dbb6ba9

Please sign in to comment.