linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Please pull git390 'for-linus' branch
Date: Mon, 12 Feb 2007 16:07:29 +0100	[thread overview]
Message-ID: <20070212150729.GA7087@skybase> (raw)

Please pull from 'for-linus' branch of

	git://git390.osdl.marist.edu/pub/scm/linux-2.6.git for-linus

to receive the following updates:

 arch/s390/kernel/smp.c        |   15 +++++++++------
 drivers/s390/cio/device_id.c  |    3 ++-
 drivers/s390/cio/device_ops.c |   32 ++++++++++++++++++++++++++++++--
 drivers/s390/cio/qdio.c       |    2 +-
 include/asm-s390/ccwdev.h     |    2 ++
 include/asm-s390/io.h         |    6 +-----
 6 files changed, 45 insertions(+), 15 deletions(-)

Ahmed S. Darwish (1):
      [S390] cio: use ARRAY_SIZE in device_id.c

Cornelia Huck (1):
      [S390] cio: Fixup interface for setting options on ccw devices.

Heiko Carstens (1):
      [S390] smp_call_function/smp_call_function_on locking.

Martin Schwidefsky (1):
      [S390] remove __io_virt and mmiowb.

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 65b5232..83a4ea6 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -57,7 +57,7 @@ static void smp_ext_bitcall(int, ec_bit_sig);
 static void smp_ext_bitcall_others(ec_bit_sig);
 
 /*
-5B * Structure and data for smp_call_function(). This is designed to minimise
+ * Structure and data for smp_call_function(). This is designed to minimise
  * static memory requirements. It also looks cleaner.
  */
 static DEFINE_SPINLOCK(call_lock);
@@ -104,7 +104,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
  * remote CPUs are nearly ready to execute <<func>> or are or have executed.
  *
  * You must not call this function with disabled interrupts or from a
- * hardware interrupt handler or from a bottom half handler.
+ * hardware interrupt handler.
  */
 {
 	struct call_data_struct data;
@@ -113,8 +113,8 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	if (cpus <= 0)
 		return 0;
 
-	/* Can deadlock when called with interrupts disabled */
-	WARN_ON(irqs_disabled());
+	/* Can deadlock when interrupts are disabled or if in wrong context */
+	WARN_ON(irqs_disabled() || in_irq());
 
 	data.func = func;
 	data.info = info;
@@ -123,7 +123,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	if (wait)
 		atomic_set(&data.finished, 0);
 
-	spin_lock(&call_lock);
+	spin_lock_bh(&call_lock);
 	call_data = &data;
 	/* Send a message to all other CPUs and wait for them to respond */
         smp_ext_bitcall_others(ec_call_function);
@@ -135,7 +135,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
 	if (wait)
 		while (atomic_read(&data.finished) != cpus)
 			cpu_relax();
-	spin_unlock(&call_lock);
+	spin_unlock_bh(&call_lock);
 
 	return 0;
 }
@@ -159,6 +159,9 @@ int smp_call_function_on(void (*func) (void *info), void *info,
 	if (!cpu_online(cpu))
 		return -EINVAL;
 
+	/* Can deadlock when interrupts are disabled or if in wrong context */
+	WARN_ON(irqs_disabled() || in_irq());
+
 	/* disable preemption for local function call */
 	curr_cpu = get_cpu();
 
diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c
index f172759..997f468 100644
--- a/drivers/s390/cio/device_id.c
+++ b/drivers/s390/cio/device_id.c
@@ -11,6 +11,7 @@
 
 #include <linux/module.h>
 #include <linux/init.h>
+#include <linux/kernel.h>
 
 #include <asm/ccwdev.h>
 #include <asm/delay.h>
@@ -138,7 +139,7 @@ VM_virtual_device_info (__u16 devno, struct senseid *ps)
 		ps->cu_model = 0x60;
 		return;
 	}
-	for (i = 0; i < sizeof(vm_devices) / sizeof(vm_devices[0]); i++)
+	for (i = 0; i < ARRAY_SIZE(vm_devices); i++)
 		if (diag_data.vrdcvcla == vm_devices[i].vrdcvcla &&
 		    diag_data.vrdcvtyp == vm_devices[i].vrdcvtyp) {
 			ps->cu_type = vm_devices[i].cu_type;
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index d7b25b8..7c7775a 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -23,8 +23,7 @@
 #include "chsc.h"
 #include "device.h"
 
-int
-ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
+int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags)
 {
        /*
 	* The flag usage is mutal exclusive ...
@@ -39,6 +38,33 @@ ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
 	return 0;
 }
 
+int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags)
+{
+       /*
+	* The flag usage is mutal exclusive ...
+	*/
+	if (((flags & CCWDEV_EARLY_NOTIFICATION) &&
+	    (flags & CCWDEV_REPORT_ALL)) ||
+	    ((flags & CCWDEV_EARLY_NOTIFICATION) &&
+	     cdev->private->options.repall) ||
+	    ((flags & CCWDEV_REPORT_ALL) &&
+	     cdev->private->options.fast))
+		return -EINVAL;
+	cdev->private->options.fast |= (flags & CCWDEV_EARLY_NOTIFICATION) != 0;
+	cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0;
+	cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0;
+	cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0;
+	return 0;
+}
+
+void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags)
+{
+	cdev->private->options.fast &= (flags & CCWDEV_EARLY_NOTIFICATION) == 0;
+	cdev->private->options.repall &= (flags & CCWDEV_REPORT_ALL) == 0;
+	cdev->private->options.pgroup &= (flags & CCWDEV_DO_PATHGROUP) == 0;
+	cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0;
+}
+
 int
 ccw_device_clear(struct ccw_device *cdev, unsigned long intparm)
 {
@@ -601,7 +627,9 @@ _ccw_device_get_device_number(struct ccw_device *cdev)
 
 
 MODULE_LICENSE("GPL");
+EXPORT_SYMBOL(ccw_device_set_options_mask);
 EXPORT_SYMBOL(ccw_device_set_options);
+EXPORT_SYMBOL(ccw_device_clear_options);
 EXPORT_SYMBOL(ccw_device_clear);
 EXPORT_SYMBOL(ccw_device_halt);
 EXPORT_SYMBOL(ccw_device_resume);
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index d726cd5..5b1e3ff 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -3194,7 +3194,7 @@ qdio_establish(struct qdio_initialize *init_data)
 
 	spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags);
 
-	ccw_device_set_options(cdev, 0);
+	ccw_device_set_options_mask(cdev, 0);
 	result=ccw_device_start_timeout(cdev,&irq_ptr->ccw,
 					QDIO_DOING_ESTABLISH,0, 0,
 					QDIO_ESTABLISH_TIMEOUT);
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 58c70ac..cfc8153 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -110,7 +110,9 @@ extern void ccw_driver_unregister (struct ccw_driver *driver);
 
 struct ccw1;
 
+extern int ccw_device_set_options_mask(struct ccw_device *, unsigned long);
 extern int ccw_device_set_options(struct ccw_device *, unsigned long);
+extern void ccw_device_clear_options(struct ccw_device *, unsigned long);
 
 /* Allow for i/o completion notification after primary interrupt status. */
 #define CCWDEV_EARLY_NOTIFICATION	0x0001
diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h
index dca6a6c..b7ff6af 100644
--- a/include/asm-s390/io.h
+++ b/include/asm-s390/io.h
@@ -17,8 +17,6 @@
 
 #define IO_SPACE_LIMIT 0xffffffff
 
-#define __io_virt(x)            ((void *)(PAGE_OFFSET | (unsigned long)(x)))
-
 /*
  * Change virtual addresses to physical addresses and vv.
  * These are pretty trivial
@@ -37,11 +35,9 @@ static inline unsigned long virt_to_phys(volatile void * address)
 
 static inline void * phys_to_virt(unsigned long address)
 {
-        return __io_virt(address);
+	return (void *) address;
 }
 
-#define mmiowb()	do { } while (0)
-
 /*
  * Convert a physical pointer to a virtual kernel pointer for /dev/mem
  * access

             reply	other threads:[~2007-02-12 15:07 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12 15:07 Martin Schwidefsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-07-08 10:20 Please pull git390 'for-linus' branch Martin Schwidefsky
2008-06-10  8:21 Martin Schwidefsky
2008-05-30  8:41 Martin Schwidefsky
2008-05-15 15:02 Martin Schwidefsky
2008-05-07  7:29 Martin Schwidefsky
2008-04-30 12:06 Martin Schwidefsky
2008-03-20 16:13 Martin Schwidefsky
2008-03-05 11:58 Martin Schwidefsky
2008-02-19 14:46 Martin Schwidefsky
2008-02-09 12:05 Martin Schwidefsky
2008-02-05 15:43 Martin Schwidefsky
2008-01-26 13:23 Martin Schwidefsky
2007-12-17 15:42 Martin Schwidefsky
2007-12-04 17:27 Martin Schwidefsky
2007-11-20 11:38 Martin Schwidefsky
2007-11-05 11:39 Martin Schwidefsky
2007-10-22 10:54 Martin Schwidefsky
2007-10-12 14:22 Martin Schwidefsky
2007-08-22 12:44 Martin Schwidefsky
2007-08-07 11:27 Martin Schwidefsky
2007-07-27 11:40 Martin Schwidefsky
2007-07-23  8:59 Martin Schwidefsky
2007-07-17 12:24 Martin Schwidefsky
2007-07-10 10:11 Martin Schwidefsky
2007-06-19  8:50 Martin Schwidefsky
2007-05-31 15:40 Martin Schwidefsky
2007-05-21 11:16 Martin Schwidefsky
2007-05-10 14:00 Martin Schwidefsky
2007-05-06 11:34 Martin Schwidefsky
2007-05-04 16:59 Martin Schwidefsky
2007-04-04 16:39 Martin Schwidefsky
2007-03-26 20:58 Heiko Carstens
2007-03-19 13:16 Martin Schwidefsky
2007-03-12 13:52 Martin Schwidefsky
2007-03-05 22:49 Martin Schwidefsky
2007-02-21 10:10 Martin Schwidefsky
2007-02-06 21:18 Martin Schwidefsky
2007-01-09  9:26 Martin Schwidefsky
2007-01-07 10:44 Martin Schwidefsky
2006-12-28 10:39 Martin Schwidefsky
2006-12-15 16:24 Martin Schwidefsky
2006-12-08 15:22 Martin Schwidefsky
2006-11-06 13:09 Martin Schwidefsky
2006-10-27 11:18 Martin Schwidefsky
2006-10-18 16:34 Martin Schwidefsky
2006-10-11 13:38 Martin Schwidefsky
2006-10-06 14:56 Martin Schwidefsky
2006-10-04 18:05 Martin Schwidefsky
2006-09-28 15:55 Martin Schwidefsky
2006-09-20 14:11 Martin Schwidefsky
2006-08-30 12:43 Martin Schwidefsky
2006-08-16 12:14 Martin Schwidefsky
2006-08-16 15:53 ` Greg KH
2006-08-16 16:28   ` Martin Schwidefsky
2006-08-16 17:02     ` Greg KH
2006-08-17  9:21       ` Martin Schwidefsky
2006-08-07 15:16 Martin Schwidefsky
2006-08-07 17:27 ` Greg KH
2006-07-28  9:00 Martin Schwidefsky
2006-07-18 11:59 Martin Schwidefsky
2006-07-12 15:09 Martin Schwidefsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070212150729.GA7087@skybase \
    --to=schwidefsky@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).