diff options
| author | Asai Thambi S P <asamymuthupa@micron.com> | 2012-06-04 15:43:03 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2012-06-05 03:13:48 -0400 |
| commit | 7412ff139d73f5561492478e89a22aede7252b7b (patch) | |
| tree | 11ea48e3789a601e0857ef78c5f1ca7b2621d02d | |
| parent | 9b2ea86bc9e940950a088e9795ab28f006e73276 (diff) | |
mtip32xx: Remove 'registers' and 'flags' from sysfs
This patch removes entries 'registers' and 'flags' from sysfs. Updated ABI file
to reflect this change.
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
| -rw-r--r-- | Documentation/ABI/testing/sysfs-block-rssd | 21 | ||||
| -rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 92 |
2 files changed, 1 insertions, 112 deletions
diff --git a/Documentation/ABI/testing/sysfs-block-rssd b/Documentation/ABI/testing/sysfs-block-rssd index 679ce3543122..beef30c046b0 100644 --- a/Documentation/ABI/testing/sysfs-block-rssd +++ b/Documentation/ABI/testing/sysfs-block-rssd | |||
| @@ -1,26 +1,5 @@ | |||
| 1 | What: /sys/block/rssd*/registers | ||
| 2 | Date: March 2012 | ||
| 3 | KernelVersion: 3.3 | ||
| 4 | Contact: Asai Thambi S P <asamymuthupa@micron.com> | ||
| 5 | Description: This is a read-only file. Dumps below driver information and | ||
| 6 | hardware registers. | ||
| 7 | - S ACTive | ||
| 8 | - Command Issue | ||
| 9 | - Completed | ||
| 10 | - PORT IRQ STAT | ||
| 11 | - HOST IRQ STAT | ||
| 12 | - Allocated | ||
| 13 | - Commands in Q | ||
| 14 | |||
| 15 | What: /sys/block/rssd*/status | 1 | What: /sys/block/rssd*/status |
| 16 | Date: April 2012 | 2 | Date: April 2012 |
| 17 | KernelVersion: 3.4 | 3 | KernelVersion: 3.4 |
| 18 | Contact: Asai Thambi S P <asamymuthupa@micron.com> | 4 | Contact: Asai Thambi S P <asamymuthupa@micron.com> |
| 19 | Description: This is a read-only file. Indicates the status of the device. | 5 | Description: This is a read-only file. Indicates the status of the device. |
| 20 | |||
| 21 | What: /sys/block/rssd*/flags | ||
| 22 | Date: May 2012 | ||
| 23 | KernelVersion: 3.5 | ||
| 24 | Contact: Asai Thambi S P <asamymuthupa@micron.com> | ||
| 25 | Description: This is a read-only file. Dumps the flags in port and driver | ||
| 26 | data structure | ||
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 264bc77dcb91..b6e95b911b8c 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
| @@ -2546,7 +2546,7 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd, | |||
| 2546 | } | 2546 | } |
| 2547 | 2547 | ||
| 2548 | /* | 2548 | /* |
| 2549 | * Sysfs register/status dump. | 2549 | * Sysfs status dump. |
| 2550 | * | 2550 | * |
| 2551 | * @dev Pointer to the device structure, passed by the kernrel. | 2551 | * @dev Pointer to the device structure, passed by the kernrel. |
| 2552 | * @attr Pointer to the device_attribute structure passed by the kernel. | 2552 | * @attr Pointer to the device_attribute structure passed by the kernel. |
| @@ -2555,71 +2555,6 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd, | |||
| 2555 | * return value | 2555 | * return value |
| 2556 | * The size, in bytes, of the data copied into buf. | 2556 | * The size, in bytes, of the data copied into buf. |
| 2557 | */ | 2557 | */ |
| 2558 | static ssize_t mtip_hw_show_registers(struct device *dev, | ||
| 2559 | struct device_attribute *attr, | ||
| 2560 | char *buf) | ||
| 2561 | { | ||
| 2562 | u32 group_allocated; | ||
| 2563 | struct driver_data *dd = dev_to_disk(dev)->private_data; | ||
| 2564 | int size = 0; | ||
| 2565 | int n; | ||
| 2566 | |||
| 2567 | size += sprintf(&buf[size], "Hardware\n--------\n"); | ||
| 2568 | size += sprintf(&buf[size], "S ACTive : [ 0x"); | ||
| 2569 | |||
| 2570 | for (n = dd->slot_groups-1; n >= 0; n--) | ||
| 2571 | size += sprintf(&buf[size], "%08X ", | ||
| 2572 | readl(dd->port->s_active[n])); | ||
| 2573 | |||
| 2574 | size += sprintf(&buf[size], "]\n"); | ||
| 2575 | size += sprintf(&buf[size], "Command Issue : [ 0x"); | ||
| 2576 | |||
| 2577 | for (n = dd->slot_groups-1; n >= 0; n--) | ||
| 2578 | size += sprintf(&buf[size], "%08X ", | ||
| 2579 | readl(dd->port->cmd_issue[n])); | ||
| 2580 | |||
| 2581 | size += sprintf(&buf[size], "]\n"); | ||
| 2582 | size += sprintf(&buf[size], "Completed : [ 0x"); | ||
| 2583 | |||
| 2584 | for (n = dd->slot_groups-1; n >= 0; n--) | ||
| 2585 | size += sprintf(&buf[size], "%08X ", | ||
| 2586 | readl(dd->port->completed[n])); | ||
| 2587 | |||
| 2588 | size += sprintf(&buf[size], "]\n"); | ||
| 2589 | size += sprintf(&buf[size], "PORT IRQ STAT : [ 0x%08X ]\n", | ||
| 2590 | readl(dd->port->mmio + PORT_IRQ_STAT)); | ||
| 2591 | size += sprintf(&buf[size], "HOST IRQ STAT : [ 0x%08X ]\n", | ||
| 2592 | readl(dd->mmio + HOST_IRQ_STAT)); | ||
| 2593 | size += sprintf(&buf[size], "\n"); | ||
| 2594 | |||
| 2595 | size += sprintf(&buf[size], "Local\n-----\n"); | ||
| 2596 | size += sprintf(&buf[size], "Allocated : [ 0x"); | ||
| 2597 | |||
| 2598 | for (n = dd->slot_groups-1; n >= 0; n--) { | ||
| 2599 | if (sizeof(long) > sizeof(u32)) | ||
| 2600 | group_allocated = | ||
| 2601 | dd->port->allocated[n/2] >> (32*(n&1)); | ||
| 2602 | else | ||
| 2603 | group_allocated = dd->port->allocated[n]; | ||
| 2604 | size += sprintf(&buf[size], "%08X ", group_allocated); | ||
| 2605 | } | ||
| 2606 | size += sprintf(&buf[size], "]\n"); | ||
| 2607 | |||
| 2608 | size += sprintf(&buf[size], "Commands in Q: [ 0x"); | ||
| 2609 | |||
| 2610 | for (n = dd->slot_groups-1; n >= 0; n--) { | ||
| 2611 | if (sizeof(long) > sizeof(u32)) | ||
| 2612 | group_allocated = | ||
| 2613 | dd->port->cmds_to_issue[n/2] >> (32*(n&1)); | ||
| 2614 | else | ||
| 2615 | group_allocated = dd->port->cmds_to_issue[n]; | ||
| 2616 | size += sprintf(&buf[size], "%08X ", group_allocated); | ||
| 2617 | } | ||
| 2618 | size += sprintf(&buf[size], "]\n"); | ||
| 2619 | |||
| 2620 | return size; | ||
| 2621 | } | ||
| 2622 | |||
| 2623 | static ssize_t mtip_hw_show_status(struct device *dev, | 2558 | static ssize_t mtip_hw_show_status(struct device *dev, |
| 2624 | struct device_attribute *attr, | 2559 | struct device_attribute *attr, |
| 2625 | char *buf) | 2560 | char *buf) |
| @@ -2637,24 +2572,7 @@ static ssize_t mtip_hw_show_status(struct device *dev, | |||
| 2637 | return size; | 2572 | return size; |
| 2638 | } | 2573 | } |
| 2639 | 2574 | ||
| 2640 | static ssize_t mtip_hw_show_flags(struct device *dev, | ||
| 2641 | struct device_attribute *attr, | ||
| 2642 | char *buf) | ||
| 2643 | { | ||
| 2644 | struct driver_data *dd = dev_to_disk(dev)->private_data; | ||
| 2645 | int size = 0; | ||
| 2646 | |||
| 2647 | size += sprintf(&buf[size], "Flag in port struct : [ %08lX ]\n", | ||
| 2648 | dd->port->flags); | ||
| 2649 | size += sprintf(&buf[size], "Flag in dd struct : [ %08lX ]\n", | ||
| 2650 | dd->dd_flag); | ||
| 2651 | |||
| 2652 | return size; | ||
| 2653 | } | ||
| 2654 | |||
| 2655 | static DEVICE_ATTR(registers, S_IRUGO, mtip_hw_show_registers, NULL); | ||
| 2656 | static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL); | 2575 | static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL); |
| 2657 | static DEVICE_ATTR(flags, S_IRUGO, mtip_hw_show_flags, NULL); | ||
| 2658 | 2576 | ||
| 2659 | /* | 2577 | /* |
| 2660 | * Create the sysfs related attributes. | 2578 | * Create the sysfs related attributes. |
| @@ -2671,15 +2589,9 @@ static int mtip_hw_sysfs_init(struct driver_data *dd, struct kobject *kobj) | |||
| 2671 | if (!kobj || !dd) | 2589 | if (!kobj || !dd) |
| 2672 | return -EINVAL; | 2590 | return -EINVAL; |
| 2673 | 2591 | ||
| 2674 | if (sysfs_create_file(kobj, &dev_attr_registers.attr)) | ||
| 2675 | dev_warn(&dd->pdev->dev, | ||
| 2676 | "Error creating 'registers' sysfs entry\n"); | ||
| 2677 | if (sysfs_create_file(kobj, &dev_attr_status.attr)) | 2592 | if (sysfs_create_file(kobj, &dev_attr_status.attr)) |
| 2678 | dev_warn(&dd->pdev->dev, | 2593 | dev_warn(&dd->pdev->dev, |
| 2679 | "Error creating 'status' sysfs entry\n"); | 2594 | "Error creating 'status' sysfs entry\n"); |
| 2680 | if (sysfs_create_file(kobj, &dev_attr_flags.attr)) | ||
| 2681 | dev_warn(&dd->pdev->dev, | ||
| 2682 | "Error creating 'flags' sysfs entry\n"); | ||
| 2683 | return 0; | 2595 | return 0; |
| 2684 | } | 2596 | } |
| 2685 | 2597 | ||
| @@ -2698,9 +2610,7 @@ static int mtip_hw_sysfs_exit(struct driver_data *dd, struct kobject *kobj) | |||
| 2698 | if (!kobj || !dd) | 2610 | if (!kobj || !dd) |
| 2699 | return -EINVAL; | 2611 | return -EINVAL; |
| 2700 | 2612 | ||
| 2701 | sysfs_remove_file(kobj, &dev_attr_registers.attr); | ||
| 2702 | sysfs_remove_file(kobj, &dev_attr_status.attr); | 2613 | sysfs_remove_file(kobj, &dev_attr_status.attr); |
| 2703 | sysfs_remove_file(kobj, &dev_attr_flags.attr); | ||
| 2704 | 2614 | ||
| 2705 | return 0; | 2615 | return 0; |
| 2706 | } | 2616 | } |
