summaryrefslogtreecommitdiff
path: root/drivers/s390/cio/chsc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 11:49:56 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 11:49:56 -0700
commit6c09931b3f987898f5c581d267ef269f5e2e9575 (patch)
tree27cc7d7304e189505e53b25c6284b1aa9a4f31d3 /drivers/s390/cio/chsc.c
parentb3eda8d05c1afe722dc19be3fee7eeadc75e25e2 (diff)
parentc397031f58f9a0a5d808dc998105781b1945b6fe (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Martin Schwidefsky: "The main new feature is machine support for System zEC12 including transactional memory, runtime instrumentation, support for scm block devices via eadm subchannels, and support for CEX4 crypto cards. In addition there are some nice improvements: bpf jit compiler, arch backend for cmpxchg_double, relative exception table entries, dasd partition detection independent from the dasd driver ioctls, and cpu cache information in /proc/cpuinfo and /sys/device/cpu. And last but not least a series of cleanup patches from Heiko." Fix up trivial add-add conflict in arch/s390/Kconfig due to commit b952741c8079 ("cputime: Generalize CONFIG_VIRT_CPU_ACCOUNTING") * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (76 commits) s390: update defconfig s390/jump label,nss: let shared kernel support depend on !JUMP_LABEL s390/disassembler: fix decoding of risblg instruction s390/bpf,jit: add support for BPF_S_ANC_ALU_XOR_X instruction s390/traps: move call to print_modules() out of show_regs() s390/mm: mark free_initrd_mem() as __init s390/dasd: check count address during online setting drivers/s390/char/monreader.c: fix error return code s390/cmpxchg,percpu: implement cmpxchg_double() s390/percpu: implement this_cpu_add_return() s390/percpu: implement this_cpu_xchg() s390/kexec: remove CONFIG_KEXEC s390/irq: use designated initializers for irq class array s390: add uninitialized_var() to suppress false positive compiler warnings s390/crashdump: move fill_cpu_elf_notes() prototype to header file s390/process: add missing header include s390/ptrace: add missing ifdef s390/ipl,decrompressor: disable branch profiling s390/perf_events: compile only for CONFIG_64BIT s390/tape: remove even more tape block leftovers ...
Diffstat (limited to 'drivers/s390/cio/chsc.c')
-rw-r--r--drivers/s390/cio/chsc.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index cfe0c087fe5c..4d51a7c4eb8b 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -52,6 +52,11 @@ int chsc_error_from_response(int response)
return -EINVAL;
case 0x0004:
return -EOPNOTSUPP;
+ case 0x000b:
+ return -EBUSY;
+ case 0x0100:
+ case 0x0102:
+ return -ENOMEM;
default:
return -EIO;
}
@@ -393,6 +398,20 @@ static void chsc_process_sei_chp_config(struct chsc_sei_area *sei_area)
}
}
+static void chsc_process_sei_scm_change(struct chsc_sei_area *sei_area)
+{
+ int ret;
+
+ CIO_CRW_EVENT(4, "chsc: scm change notification\n");
+ if (sei_area->rs != 7)
+ return;
+
+ ret = scm_update_information();
+ if (ret)
+ CIO_CRW_EVENT(0, "chsc: updating change notification"
+ " failed (rc=%d).\n", ret);
+}
+
static void chsc_process_sei(struct chsc_sei_area *sei_area)
{
/* Check if we might have lost some information. */
@@ -414,6 +433,9 @@ static void chsc_process_sei(struct chsc_sei_area *sei_area)
case 8: /* channel-path-configuration notification */
chsc_process_sei_chp_config(sei_area);
break;
+ case 12: /* scm change notification */
+ chsc_process_sei_scm_change(sei_area);
+ break;
default: /* other stuff */
CIO_CRW_EVENT(4, "chsc: unhandled sei content code %d\n",
sei_area->cc);
@@ -1047,3 +1069,33 @@ out:
return rc;
}
EXPORT_SYMBOL_GPL(chsc_siosl);
+
+/**
+ * chsc_scm_info() - store SCM information (SSI)
+ * @scm_area: request and response block for SSI
+ * @token: continuation token
+ *
+ * Returns 0 on success.
+ */
+int chsc_scm_info(struct chsc_scm_info *scm_area, u64 token)
+{
+ int ccode, ret;
+
+ memset(scm_area, 0, sizeof(*scm_area));
+ scm_area->request.length = 0x0020;
+ scm_area->request.code = 0x004C;
+ scm_area->reqtok = token;
+
+ ccode = chsc(scm_area);
+ if (ccode > 0) {
+ ret = (ccode == 3) ? -ENODEV : -EBUSY;
+ goto out;
+ }
+ ret = chsc_error_from_response(scm_area->response.code);
+ if (ret != 0)
+ CIO_MSG_EVENT(2, "chsc: scm info failed (rc=%04x)\n",
+ scm_area->response.code);
+out:
+ return ret;
+}
+EXPORT_SYMBOL_GPL(chsc_scm_info);