Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311586
b: refs/heads/master
c: 7412ff1
h: refs/heads/master
v: v3
  • Loading branch information
Asai Thambi S P authored and Jens Axboe committed Jun 5, 2012
1 parent 4746ef2 commit 961bfdf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 113 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: 9b2ea86bc9e940950a088e9795ab28f006e73276
refs/heads/master: 7412ff139d73f5561492478e89a22aede7252b7b
21 changes: 0 additions & 21 deletions trunk/Documentation/ABI/testing/sysfs-block-rssd
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
What: /sys/block/rssd*/registers
Date: March 2012
KernelVersion: 3.3
Contact: Asai Thambi S P <asamymuthupa@micron.com>
Description: This is a read-only file. Dumps below driver information and
hardware registers.
- S ACTive
- Command Issue
- Completed
- PORT IRQ STAT
- HOST IRQ STAT
- Allocated
- Commands in Q

What: /sys/block/rssd*/status
Date: April 2012
KernelVersion: 3.4
Contact: Asai Thambi S P <asamymuthupa@micron.com>
Description: This is a read-only file. Indicates the status of the device.

What: /sys/block/rssd*/flags
Date: May 2012
KernelVersion: 3.5
Contact: Asai Thambi S P <asamymuthupa@micron.com>
Description: This is a read-only file. Dumps the flags in port and driver
data structure
92 changes: 1 addition & 91 deletions trunk/drivers/block/mtip32xx/mtip32xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd,
}

/*
* Sysfs register/status dump.
* Sysfs status dump.
*
* @dev Pointer to the device structure, passed by the kernrel.
* @attr Pointer to the device_attribute structure passed by the kernel.
Expand All @@ -2555,71 +2555,6 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd,
* return value
* The size, in bytes, of the data copied into buf.
*/
static ssize_t mtip_hw_show_registers(struct device *dev,
struct device_attribute *attr,
char *buf)
{
u32 group_allocated;
struct driver_data *dd = dev_to_disk(dev)->private_data;
int size = 0;
int n;

size += sprintf(&buf[size], "Hardware\n--------\n");
size += sprintf(&buf[size], "S ACTive : [ 0x");

for (n = dd->slot_groups-1; n >= 0; n--)
size += sprintf(&buf[size], "%08X ",
readl(dd->port->s_active[n]));

size += sprintf(&buf[size], "]\n");
size += sprintf(&buf[size], "Command Issue : [ 0x");

for (n = dd->slot_groups-1; n >= 0; n--)
size += sprintf(&buf[size], "%08X ",
readl(dd->port->cmd_issue[n]));

size += sprintf(&buf[size], "]\n");
size += sprintf(&buf[size], "Completed : [ 0x");

for (n = dd->slot_groups-1; n >= 0; n--)
size += sprintf(&buf[size], "%08X ",
readl(dd->port->completed[n]));

size += sprintf(&buf[size], "]\n");
size += sprintf(&buf[size], "PORT IRQ STAT : [ 0x%08X ]\n",
readl(dd->port->mmio + PORT_IRQ_STAT));
size += sprintf(&buf[size], "HOST IRQ STAT : [ 0x%08X ]\n",
readl(dd->mmio + HOST_IRQ_STAT));
size += sprintf(&buf[size], "\n");

size += sprintf(&buf[size], "Local\n-----\n");
size += sprintf(&buf[size], "Allocated : [ 0x");

for (n = dd->slot_groups-1; n >= 0; n--) {
if (sizeof(long) > sizeof(u32))
group_allocated =
dd->port->allocated[n/2] >> (32*(n&1));
else
group_allocated = dd->port->allocated[n];
size += sprintf(&buf[size], "%08X ", group_allocated);
}
size += sprintf(&buf[size], "]\n");

size += sprintf(&buf[size], "Commands in Q: [ 0x");

for (n = dd->slot_groups-1; n >= 0; n--) {
if (sizeof(long) > sizeof(u32))
group_allocated =
dd->port->cmds_to_issue[n/2] >> (32*(n&1));
else
group_allocated = dd->port->cmds_to_issue[n];
size += sprintf(&buf[size], "%08X ", group_allocated);
}
size += sprintf(&buf[size], "]\n");

return size;
}

static ssize_t mtip_hw_show_status(struct device *dev,
struct device_attribute *attr,
char *buf)
Expand All @@ -2637,24 +2572,7 @@ static ssize_t mtip_hw_show_status(struct device *dev,
return size;
}

static ssize_t mtip_hw_show_flags(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct driver_data *dd = dev_to_disk(dev)->private_data;
int size = 0;

size += sprintf(&buf[size], "Flag in port struct : [ %08lX ]\n",
dd->port->flags);
size += sprintf(&buf[size], "Flag in dd struct : [ %08lX ]\n",
dd->dd_flag);

return size;
}

static DEVICE_ATTR(registers, S_IRUGO, mtip_hw_show_registers, NULL);
static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL);
static DEVICE_ATTR(flags, S_IRUGO, mtip_hw_show_flags, NULL);

/*
* Create the sysfs related attributes.
Expand All @@ -2671,15 +2589,9 @@ static int mtip_hw_sysfs_init(struct driver_data *dd, struct kobject *kobj)
if (!kobj || !dd)
return -EINVAL;

if (sysfs_create_file(kobj, &dev_attr_registers.attr))
dev_warn(&dd->pdev->dev,
"Error creating 'registers' sysfs entry\n");
if (sysfs_create_file(kobj, &dev_attr_status.attr))
dev_warn(&dd->pdev->dev,
"Error creating 'status' sysfs entry\n");
if (sysfs_create_file(kobj, &dev_attr_flags.attr))
dev_warn(&dd->pdev->dev,
"Error creating 'flags' sysfs entry\n");
return 0;
}

Expand All @@ -2698,9 +2610,7 @@ static int mtip_hw_sysfs_exit(struct driver_data *dd, struct kobject *kobj)
if (!kobj || !dd)
return -EINVAL;

sysfs_remove_file(kobj, &dev_attr_registers.attr);
sysfs_remove_file(kobj, &dev_attr_status.attr);
sysfs_remove_file(kobj, &dev_attr_flags.attr);

return 0;
}
Expand Down

0 comments on commit 961bfdf

Please sign in to comment.