Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Asai Thambi S P and committed by
Jens Axboe
7412ff13 9b2ea86b

+1 -112
-21
Documentation/ABI/testing/sysfs-block-rssd
··· 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 1 What: /sys/block/rssd*/status 16 2 Date: April 2012 17 3 KernelVersion: 3.4 18 4 Contact: Asai Thambi S P <asamymuthupa@micron.com> 19 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
+1 -91
drivers/block/mtip32xx/mtip32xx.c
··· 2546 2546 } 2547 2547 2548 2548 /* 2549 - * Sysfs register/status dump. 2549 + * Sysfs status dump. 2550 2550 * 2551 2551 * @dev Pointer to the device structure, passed by the kernrel. 2552 2552 * @attr Pointer to the device_attribute structure passed by the kernel. ··· 2555 2555 * return value 2556 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 2558 static ssize_t mtip_hw_show_status(struct device *dev, 2624 2559 struct device_attribute *attr, 2625 2560 char *buf) ··· 2572 2637 return size; 2573 2638 } 2574 2639 2575 - static ssize_t mtip_hw_show_flags(struct device *dev, 2576 - struct device_attribute *attr, 2577 - char *buf) 2578 - { 2579 - struct driver_data *dd = dev_to_disk(dev)->private_data; 2580 - int size = 0; 2581 - 2582 - size += sprintf(&buf[size], "Flag in port struct : [ %08lX ]\n", 2583 - dd->port->flags); 2584 - size += sprintf(&buf[size], "Flag in dd struct : [ %08lX ]\n", 2585 - dd->dd_flag); 2586 - 2587 - return size; 2588 - } 2589 - 2590 - static DEVICE_ATTR(registers, S_IRUGO, mtip_hw_show_registers, NULL); 2591 2640 static DEVICE_ATTR(status, S_IRUGO, mtip_hw_show_status, NULL); 2592 - static DEVICE_ATTR(flags, S_IRUGO, mtip_hw_show_flags, NULL); 2593 2641 2594 2642 /* 2595 2643 * Create the sysfs related attributes. ··· 2589 2671 if (!kobj || !dd) 2590 2672 return -EINVAL; 2591 2673 2592 - if (sysfs_create_file(kobj, &dev_attr_registers.attr)) 2593 - dev_warn(&dd->pdev->dev, 2594 - "Error creating 'registers' sysfs entry\n"); 2595 2674 if (sysfs_create_file(kobj, &dev_attr_status.attr)) 2596 2675 dev_warn(&dd->pdev->dev, 2597 2676 "Error creating 'status' sysfs entry\n"); 2598 - if (sysfs_create_file(kobj, &dev_attr_flags.attr)) 2599 - dev_warn(&dd->pdev->dev, 2600 - "Error creating 'flags' sysfs entry\n"); 2601 2677 return 0; 2602 2678 } 2603 2679 ··· 2610 2698 if (!kobj || !dd) 2611 2699 return -EINVAL; 2612 2700 2613 - sysfs_remove_file(kobj, &dev_attr_registers.attr); 2614 2701 sysfs_remove_file(kobj, &dev_attr_status.attr); 2615 - sysfs_remove_file(kobj, &dev_attr_flags.attr); 2616 2702 2617 2703 return 0; 2618 2704 }