s390 upstream patches.
Subsystems (3)
cover s390 upstream patches.
Seven patches for s390, minor stuff.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 1/7 Add exception handler for diagnose 224
From: Michael Holzheu <[email protected]>
To be able to run with the diagnose 224 switched off, a potential specification exception has to be handled.
---
arch/s390/hypfs/hypfs_diag.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
arch/s390/hypfs/hypfs_diag.c +14 -3
@@ -481,9 +481,17 @@ out:/* Diagnose 224 functions */ -static void diag224 (void *ptr) +static int diag224 (void *ptr) { - asmvolatile ("diag %0,%1,0x224" : :"d" (0 ),"d" (ptr) :"memory" ); +int rc = -ENOTSUPP ; + + asmvolatile ( +" diag %1,%2,0x224\n" +"0: lhi %0,0x0\n" +"1:\n" + EX_TABLE(0b,1b) + : "+d" (rc) :"d" (0), "d" (ptr) : "memory"); + return rc; }static int diag224_get_name_table (void )
@@ -492,7 +500,10 @@ static int diag224_get_name_table(void) diag224_cpu_names =kmalloc (PAGE_SIZE ,GFP_KERNEL |GFP_DMA );if (!diag224_cpu_names)return -ENOMEM ; -diag224 (diag224_cpu_names); +if (diag224 (diag224_cpu_names)) { +kfree (diag224_cpu_names); +return -ENOTSUPP ; + }EBCASC (diag224_cpu_names +16 , (*diag224_cpu_names +1 ) *16 );return 0 ; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 2/7 dasd_eer: use mutex instead of semaphore
In reply to Martin SchwidefskyFrom: Christoph Hellwig <[email protected]>
---
drivers/s390/block/dasd_eer.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/s390/block/dasd_eer.c +8 -8
@@ -14,9 +14,9 @@#include <linux/moduleparam.h> #include <linux/device.h> #include <linux/poll.h> +#include <linux/mutex.h> #include <asm/uaccess.h> -#include <asm/semaphore.h> #include <asm/atomic.h> #include <asm/ebcdic.h>
@@ -514,7 +514,7 @@ void dasd_eer_disable(struct dasd_device* to transfer in a readbuffer, which is protected by the readbuffer_mutex. */ static char readbuffer[PAGE_SIZE ]; -static DECLARE_MUTEX (readbuffer_mutex); +static DEFINE_MUTEX (readbuffer_mutex);static int dasd_eer_open (struct inode *inp,struct file *filp) {
@@ -579,7 +579,7 @@ static ssize_t dasd_eer_read(struct filestruct eerbuffer *eerb; eerb = (struct eerbuffer *) filp->private_data; -if (down_interruptible (&readbuffer_mutex)) +if (mutex_lock_interruptible (&readbuffer_mutex))return -ERESTARTSYS ;spin_lock_irqsave (&bufferlock, flags);
@@ -588,7 +588,7 @@ static ssize_t dasd_eer_read(struct file/* has been deleted */ eerb->residual =0 ;spin_unlock_irqrestore (&bufferlock, flags); -up (&readbuffer_mutex); +mutex_unlock (&readbuffer_mutex);return -EIO ; }else if (eerb->residual >0 ) {/* OK we still have a second half of a record to deliver */
@@ -602,7 +602,7 @@ static ssize_t dasd_eer_read(struct fileif (!tc) {/* no data available */ spin_unlock_irqrestore (&bufferlock, flags); -up (&readbuffer_mutex); +mutex_unlock (&readbuffer_mutex);if (filp->f_flags &O_NONBLOCK )return -EAGAIN ; rc = wait_event_interruptible(
@@ -610,7 +610,7 @@ static ssize_t dasd_eer_read(struct file eerb->head != eerb->tail);if (rc)return rc; -if (down_interruptible (&readbuffer_mutex)) +if (mutex_lock_interruptible (&readbuffer_mutex))return -ERESTARTSYS ;spin_lock_irqsave (&bufferlock, flags); }
@@ -626,11 +626,11 @@ static ssize_t dasd_eer_read(struct filespin_unlock_irqrestore (&bufferlock, flags);if (copy_to_user (buf, readbuffer, effective_count)) { -up (&readbuffer_mutex); +mutex_unlock (&readbuffer_mutex);return -EFAULT ; } -up (&readbuffer_mutex); +mutex_unlock (&readbuffer_mutex);return effective_count; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 3/7 arch/s390/kernel/debug.c: use mutex instead of semaphore
In reply to Martin SchwidefskyFrom: Christoph Hellwig <[email protected]>
---
arch/s390/kernel/debug.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
arch/s390/kernel/debug.c +11 -11
@@ -163,7 +163,7 @@ unsigned int debug_feature_version = __Dstatic debug_info_t *debug_area_first =NULL ;static debug_info_t *debug_area_last =NULL ; -static DECLARE_MUTEX (debug_lock); +static DEFINE_MUTEX (debug_mutex);static int initialized;
@@ -576,7 +576,7 @@ debug_input(struct file *file, const chaint rc =0 ;file_private_info_t *p_info; -down (&debug_lock); +mutex_lock (&debug_mutex); p_info = ((file_private_info_t *) file->private_data);if (p_info->view->input_proc) rc = p_info->view->input_proc(p_info->debug_info_org,
@@ -584,7 +584,7 @@ debug_input(struct file *file, const cha length, offset); else rc = -EPERM ; -up (&debug_lock); +mutex_unlock (&debug_mutex);return rc;/* number of input characters */ }
@@ -602,7 +602,7 @@ debug_open(struct inode *inode, struct ffile_private_info_t *p_info;debug_info_t *debug_info, *debug_info_snapshot; -down (&debug_lock); +mutex_lock (&debug_mutex); debug_info = file->f_path.dentry->d_inode->i_private;/* find debug view */ for (i =0 ; i <DEBUG_MAX_VIEWS ; i++) {
@@ -653,7 +653,7 @@ found: file->private_data = p_info;debug_info_get (debug_info); out: -up (&debug_lock); +mutex_unlock (&debug_mutex);return rc; }
@@ -688,7 +688,7 @@ debug_register (char *name, int pages_peif (!initialized)BUG (); -down (&debug_lock); +mutex_lock (&debug_mutex);/* create new debug_info */
@@ -702,7 +702,7 @@ out:if (!rc){printk (KERN_ERR "debug: debug_register failed for %s\n" ,name); } -up (&debug_lock); +mutex_unlock (&debug_mutex);return rc; }
@@ -716,9 +716,9 @@ debug_unregister(debug_info_t * id) {if (!id) goto out; -down (&debug_lock); +mutex_lock (&debug_mutex);debug_info_put (id); -up (&debug_lock); +mutex_unlock (&debug_mutex); out:return ;
@@ -1054,11 +1054,11 @@ __init debug_init(void)int rc =0 ; s390dbf_sysctl_header =register_sysctl_table (s390dbf_dir_table); -down (&debug_lock); +mutex_lock (&debug_mutex); debug_debugfs_root_entry =debugfs_create_dir (DEBUG_DIR_ROOT ,NULL );printk (KERN_INFO "debug: Initialization complete\n" ); initialized =1 ; -up (&debug_lock); +mutex_unlock (&debug_mutex);return rc; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 4/7 raw3270: use mutex instead of semaphore
In reply to Martin SchwidefskyFrom: Christoph Hellwig <[email protected]>
---
drivers/s390/char/raw3270.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/s390/char/raw3270.c +5 -5
@@ -487,7 +487,7 @@ struct raw3270_ua { /* Query Reply struc } __attribute__ ((packed));static struct diag210 raw3270_init_diag210; -static DECLARE_MUTEX (raw3270_init_sem); +static DEFINE_MUTEX (raw3270_init_mutex); static int raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq,
@@ -713,7 +713,7 @@ raw3270_size_device(struct raw3270 *rp) {int rc; -down (&raw3270_init_sem); +mutex_lock (&raw3270_init_mutex); rp->view = &raw3270_init_view; raw3270_init_view.dev = rp;if (MACHINE_IS_VM )
@@ -722,7 +722,7 @@ raw3270_size_device(struct raw3270 *rp) rc =__raw3270_size_device (rp); raw3270_init_view.dev =NULL ; rp->view =NULL ; -up (&raw3270_init_sem); +mutex_unlock (&raw3270_init_mutex);if (rc ==0 ) {/* Found something. */ /* Try to find a model. */ rp->model =0 ;
@@ -749,7 +749,7 @@ raw3270_reset_device(struct raw3270 *rp) {int rc; -down (&raw3270_init_sem); +mutex_lock (&raw3270_init_mutex);memset (&rp->init_request,0 ,sizeof (rp->init_request));memset (&rp->init_data,0 ,sizeof (rp->init_data));/* Store reset data stream to init_data/init_request */
@@ -764,7 +764,7 @@ raw3270_reset_device(struct raw3270 *rp) rc =raw3270_start_init (rp, &raw3270_init_view, &rp->init_request); raw3270_init_view.dev =NULL ; rp->view =NULL ; -up (&raw3270_init_sem); +mutex_unlock (&raw3270_init_mutex);return rc; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 5/7 Fix section annotations.
In reply to Martin SchwidefskyFrom: Heiko Carstens <[email protected]>
Use the __cpuinit instead of __devinit section annotations for code that deals with cpu hotplug. In addition add some more annotations on functions that have been left out so far.
---
arch/s390/kernel/setup.c | 4 ++-- arch/s390/kernel/smp.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
arch/s390/kernel/setup.c +2 -2
@@ -102,7 +102,7 @@ static struct resource data_resource = {/* * cpu_init() initializes state that is per-CPU. */ -void __devinit cpu_init (void ) +void __cpuinit cpu_init (void ) {int addr =hard_smp_processor_id ();
@@ -915,7 +915,7 @@ setup_arch(char **cmdline_p)setup_zfcpdump (console_devno); } -void print_cpu_info (struct cpuinfo_S390 *cpuinfo) +void __cpuinit print_cpu_info (struct cpuinfo_S390 *cpuinfo) { printk("cpu %d "#ifdef CONFIG_SMP
arch/s390/kernel/smp.c +3 -3
@@ -492,7 +492,7 @@ static unsigned int __init smp_count_cpu/* * Activate a secondary processor. */ -int __devinit start_secondary (void *cpuvoid) +int __cpuinit start_secondary (void *cpuvoid) {/* Setup the cpu */ cpu_init ();
@@ -741,7 +741,7 @@ void __init smp_prepare_cpus(unsigned insmp_create_idle (cpu); } -void __devinit smp_prepare_boot_cpu (void ) +void __init smp_prepare_boot_cpu (void ) {BUG_ON (smp_processor_id () !=0 );
@@ -750,7 +750,7 @@ void __devinit smp_prepare_boot_cpu(void current_set[0 ] = current; } -void smp_cpus_done (unsigned int max_cpus) +void __init smp_cpus_done (unsigned int max_cpus) { cpu_present_map = cpu_possible_map; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 6/7 cio: Use device_schedule_callback() for removing disconnected devices.
In reply to Martin SchwidefskyFrom: Cornelia Huck <[email protected]>
We can't deregister disconnected and orphaned devices directly from the online attribute's store method, but must take a detour.
---
drivers/s390/cio/device.c | 49 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-)
drivers/s390/cio/device.c +38 -11
@@ -296,30 +296,57 @@ static void ccw_device_unregister(structdevice_del (&cdev->dev); } +static void ccw_device_remove_orphan_cb (struct device *dev) +{ +struct ccw_device *cdev =to_ccwdev (dev); + +ccw_device_unregister (cdev); +put_device (&cdev->dev); +} + +static void ccw_device_remove_sch_cb (struct device *dev) +{ +struct subchannel *sch; + + sch =to_subchannel (dev); +css_sch_device_unregister (sch); +/* Reset intparm to zeroes. */ + sch->schib.pmcw.intparm =0 ; +cio_modify (sch); +put_device (&sch->dev); +} +static void ccw_device_remove_disconnected (struct ccw_device *cdev) { -struct subchannel *sch;unsigned long flags; +int rc; +/* * Forced offline in disconnected state means * 'throw away device'. */ if (ccw_device_is_orphan (cdev)) { -/* Deregister ccw device. */ +/* +* Deregister ccw device. +* Unfortunately, we cannot do this directly from the +* attribute method. +*/ spin_lock_irqsave (cdev->ccwlock, flags); cdev->private->state =DEV_STATE_NOT_OPER ;spin_unlock_irqrestore (cdev->ccwlock, flags); -ccw_device_unregister (cdev); -put_device (&cdev->dev); -return ; + rc =device_schedule_callback (&cdev->dev, + ccw_device_remove_orphan_cb); +if (rc) +dev_info (&cdev->dev,"Couldn't unregister orphan\n" ); +return ; } - sch =to_subchannel (cdev->dev.parent); -css_sch_device_unregister (sch); -/* Reset intparm to zeroes. */ - sch->schib.pmcw.intparm =0 ; -cio_modify (sch); -put_device (&sch->dev); +/* Deregister subchannel, which will kill the ccw device. */ + rc =device_schedule_callback (cdev->dev.parent, + ccw_device_remove_sch_cb); +if (rc) +dev_info (&cdev->dev, +"Couldn't unregister disconnected device\n" ); }int
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.
PATCH 7/7 cio: deregister ccw device when pgid disband failed
In reply to Martin SchwidefskyFrom: Peter Oberparleiter <[email protected]>
Deregister ccw device when device failure is detected during offline- processing (e.g. when no last-path-gone indication was presented by the hardware) to prevent the device from entering a non-recoverable not-operational state.
---
drivers/s390/cio/device_fsm.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/s390/cio/device_fsm.c +6 -0
@@ -688,6 +688,12 @@ ccw_device_disband_done(struct ccw_devicccw_device_done (cdev,DEV_STATE_BOXED );break ;default : + cdev->private->flags.donotify =0 ; +if (get_device (&cdev->dev)) { +PREPARE_WORK (&cdev->private->kick_work, + ccw_device_call_sch_unregister); +queue_work (ccw_device_work, &cdev->private->kick_work); + }ccw_device_done (cdev,DEV_STATE_NOT_OPER );break ; }
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.