Re: [PATCH 5/8 v2] staging: unisys: move parahotplug to sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 22, 2014 at 09:56:29AM -0400, Benjamin Romer wrote:
> Move the /proc/visorchipset/parahotplug interface to sysfs under
> /sys/devices/platform/visorchipset/guest/parahotplug.
> 
> The parahotplug interface is used to deal with recovery situations on s-Par
> guest partitions. The command service partition will send a message to a guest
> when a device that guest is using needs to be temporarily removed. The message
> triggers a udev event that will cause a recovery script to run. When that
> script has completed its work, it will write to the parahotplug interface to
> send a message back to Command indicating that it is safe to remove the device.
> 
> Moving this interface to sysfs orphans the visorchipset_proc_read_writeonly()
> function, so it is also removed.
> 
> Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
> ---
> v2: attribute creation was fixed and checks for controlvm_channel pointer were
> removed.
> 
>  .../unisys/visorchipset/visorchipset_main.c        | 59 ++++------------------
>  1 file changed, 11 insertions(+), 48 deletions(-)
> 
> diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> index 74ab15b..c88f95f 100644
> --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
> +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
> @@ -129,19 +129,12 @@ static MYPROCTYPE *PartitionType;
>  #define VISORCHIPSET_DIAG_PROC_ENTRY_FN "diagdump"
>  static struct proc_dir_entry *diag_proc_dir;
>  
> -#define VISORCHIPSET_PARAHOTPLUG_PROC_ENTRY_FN "parahotplug"
> -static struct proc_dir_entry *parahotplug_proc_dir;
> -
>  static LIST_HEAD(BusInfoList);
>  static LIST_HEAD(DevInfoList);
>  
>  static struct proc_dir_entry *ProcDir;
>  static VISORCHANNEL *ControlVm_channel;
>  
> -static ssize_t visorchipset_proc_read_writeonly(struct file *file,
> -						char __user *buf,
> -						size_t len, loff_t *offset);
> -
>  typedef struct {
>  	U8 __iomem *ptr;	/* pointer to base address of payload pool */
>  	U64 offset;		/* offset from beginning of controlvm
> @@ -324,6 +317,10 @@ static ssize_t chipsetready_store(struct device *dev,
>  		struct device_attribute *attr, const char *buf, size_t count);
>  static DEVICE_ATTR_WO(chipsetready);
>  
> +static ssize_t parahotplug_store(struct device *dev,
> +		struct device_attribute *attr, const char *buf, size_t count);
> +static DEVICE_ATTR_WO(parahotplug);
> +
>  static struct attribute *visorchipset_install_attrs[] = {
>  	&dev_attr_toolaction.attr,
>  	&dev_attr_boottotool.attr,
> @@ -340,6 +337,7 @@ static struct attribute_group visorchipset_install_group = {
>  
>  static struct attribute *visorchipset_guest_attrs[] = {
>  	&dev_attr_chipsetready.attr,
> +	&dev_attr_parahotplug.attr,
>  	NULL
>  };
>  
> @@ -1812,30 +1810,17 @@ parahotplug_process_message(CONTROLVM_MESSAGE *inmsg)
>  
>  /*
>   * Gets called when the udev script writes to
> - * /proc/visorchipset/parahotplug.  Expects input in the form of "<id>
> - * <active>" where <id> is the identifier passed to the script that
> - * matches a request on the request list, and <active> is 0 or 1
> - * indicating whether the device is now enabled or not.
> + * /sys/devices/platform/visorchipset/guest/parahotplug.
> + * Expects input in the form of "<id> <active>" where <id> is the identifier
> + * passed to the script that matches a request on the request list, and <active>
> + * is 0 or 1 indicating whether the device is now enabled or not.

Why isn't this information in the ABI file?

Also, 2 values for one sysfs file?  Not acceptable, sorry.

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux