aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto/ap_bus.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-07-26atomic: use <linux/atomic.h>Arun Sharma1-1/+1
This allows us to move duplicated code in <asm/atomic.h> (atomic_inc_not_zero() for now) to <linux/atomic.h> Signed-off-by: Arun Sharma <asharma@fb.com> Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: David Miller <davem@davemloft.net> Cc: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-24[S390] ap: toleration support for ap device type 10Holger Dengler1-26/+70
Add toleration support for ap devices with device type 10. Signed-off-by: Holger Dengler <hd@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2011-05-23[S390] ap: skip device registration on type probe failureHolger Dengler1-2/+6
The registration of an ap device will be skipped, if the device type probing fails. Add names of current crypto adapters to the Kconfig help. Signed-off-by: Holger Dengler <hd@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2011-01-05[S390] zcrypt: Introduce check for 4096 bit support.Felix Beck1-0/+63
Implemented an asm in the ap bus and made it accessible for the card specific parts of the zcrypt driver. Thus when a cex3a is recognized a check can be performed to dermine whether the card supports 4096 bit RSA keys. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2011-01-05[S390] ap bus: add support for irq statisticsHolger Dengler1-0/+2
Add support for AP Bus I/O interrupt statistics in /proc/interrupts. Signed-off-by: Holger Dengler <hd@linux.vnet.ibm.com> Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2011-01-05[S390] zcrypt: Fix check to look for facility bits 2 & 65Felix Beck1-1/+1
Fix the check for ap interupts to look for facility bits 2 and 65. Make sure that we only register interrupts for aps, if the machine has ap interrupt support. This patch is relevant only for the 2.6.37 stable series. Cc: stable@kernel.org Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2010-10-25[S390] cleanup facility list handlingMartin Schwidefsky1-8/+1
Store the facility list once at system startup with stfl/stfle and reuse the result for all facility tests. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo1-0/+1
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2009-12-07[S390] zcrypt: Do not simultaneously schedule hrtimerFelix Beck1-3/+8
Protect the hrtimer ap_poll_timer from being scheduled at the same time from several processes. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] zcrypt: special command support for cex3 exploitationFelix Beck1-5/+15
Support for special command is implemented in the AP Bus in the NQAP function __ap_send. This is extended for a further parameter special. When set, the special bit, in GR0 will be set. Therefor the ap_message struct is extended for a further bit. Thus calling functions of __ap_send can use the special parameter in ap_message to give to __ap_send. Affected is in the first place ap_queue_message, which is called by the actual card driver. The second part of this support is that the card driver for the CEX3C needs to set this special bit, when an according CPRB is sent to the driver. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-22[S390] zcrypt: Do not add/remove devices in s/r callbacksFelix Beck1-11/+29
Devices are no longer removed or added in the suspend and resume callbacks. Instead they are marked unregistered in suspend. In the resume callback the ap_scan_bus method is scheduled. The bus scan function will remove the old device and add new ones. This way all the device handling will be done in only one function. Additionaly the case where the domain might change during suspend/resume is caught. In that case the devices qid needs to re-calculated in order of having it found by the scan method. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11[S390] zcrypt: Free ap_device if dev_set_name fails.Felix Beck1-2/+5
If dev_set_name fails during scanning the AP bus, the reserved memory has to be freed. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11[S390] zcrypt: Use spin_lock_bh in suspend callbackFelix Beck1-2/+6
Fix lock dependency warning. inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. bash/1442 [HC0[0]:SC0[0]:HE1:SE1] takes: (&ap_dev->lock){+.?...}, at: [<000003e001280404>] __ap_poll_device+0x40/0x3e8 [ap] {IN-SOFTIRQ-W} state was registered at: [<000000000017f094>] __lock_acquire+0xb78/0x182c [<000000000017fe8e>] lock_acquire+0x146/0x178 [<0000000000549cf2>] _spin_lock+0x5a/0x98 [<000003e001280404>] __ap_poll_device+0x40/0x3e8 [ap] [<000003e001280afe>] ap_poll_all+0xaa/0x1a4 [ap] [<000000000014fa82>] tasklet_action+0xfe/0x1f4 [<0000000000150a56>] __do_softirq+0x116/0x284 [<0000000000111058>] do_softirq+0xe4/0xe8 [<00000000001504ba>] irq_exit+0xba/0xd8 [<00000000003dd04a>] do_IRQ+0x176/0x1fc [<000000000011823c>] io_return+0x0/0x8 [<0000004bfbfd2c0e>] 0x4bfbfd2c0e Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-09-11[S390] proper use of device registerSebastian Ott1-1/+1
Don't use kfree directly after device registration started. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-07-24[S390] zcrypt: fix scheduling of hrtimer ap_poll_timerFelix Beck1-2/+7
Every time a request is enqueued or there is some work outstanding from the ap_tasklet, the ap_poll_timer is scheduled again. Unfortunately it was permanently called. It looked as if it was started in the past and thus imediately expired. This has been changed. First it is checked if the hrtimer is already expired. Then the expiring time is forwarded and the timer restarted. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-06-22[S390] ap/zcrypt: Suspend/Resume ap bus and zcryptFelix Beck1-2/+83
Add Suspend/Resume support to ap bus and zcrypt. All enhancements are done in the ap bus. No changes in the crypto card specific part are necessary. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-01-06s390: remove s390_root_dev_*()Mark McLoughlin1-4/+3
Replace s390_root_dev_register() with root_device_register() etc. [Includes fix from Cornelia Huck] Signed-off-by: Mark McLoughlin <markmc@redhat.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-12-25[S390] convert ap_bus printks to pr_xxx macros.Martin Schwidefsky1-3/+7
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25[S390] ap: Minor code beautification.Christian Maaser1-14/+14
Changed some symbol names for a better and clearer code. Signed-off-by: Christian Maaser <cmaaser@de.ibm.com> Signed-off-by: Felix Beck <beckf@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-12-25[S390] zcrypt: Use of Thin InterruptsFelix Beck1-3/+171
When the machine supports AP adapter interrupts polling will be switched off at module initialization and the driver will work in interrupt mode. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-10-17Merge commit 'linus/master' into merge-linusArjan van de Ven1-2/+2
Conflicts: arch/x86/kvm/i8254.c
2008-10-10[S390] bus_id -> dev_set_name() changesCornelia Huck1-2/+2
Convert most s390 users setting bus_id to dev_set_name(). css and ccw busses are deferred since they need some special treatment. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-09-05hrtimer: convert s390 to the new hrtimer apisArjan van de Ven1-3/+3
In order to be able to do range hrtimers we need to use accessor functions to the "expire" member of the hrtimer struct. This patch converts s390 to these accessors. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
2008-07-14[S390] ap: Use high-resolution timer for pollingFelix Beck1-10/+53
The ap poll mechanism is converted to use a high-resolution timer for polling. This allows more specific polling. With this a new sysfs attribute is introduced to specify the polling rate in nanoseconds. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-04-17[S390] zcrypt: Comments and kernel-doc cleanupFelix Beck1-69/+120
Comments, which suggested to be kernel-doc but were not in the right formatting, have been corrected. Additionally some minor cleanup in the comments has been done. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2008-03-05[S390] zcrypt: fix ap_device_list handlingRalph Wuerthner1-5/+7
In ap_device_probe() we can add the new ap device to the internal device list only if the device probe function successfully returns. Otherwise we might end up with an invalid device in the internal ap device list. Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-02-09[S390] zcrypt: Do not start ap poll thread per defaultFelix Beck1-2/+2
Do not start ap poll thread per default to increase perfomance with z/VM. Signed-off-by: Felix Beck <felix.beck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-10-12Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6Linus Torvalds1-10/+4
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (75 commits) PM: merge device power-management source files sysfs: add copyrights kobject: update the copyrights kset: add some kerneldoc to help describe what these strange things are Driver core: rename ktype_edd and ktype_efivar Driver core: rename ktype_driver Driver core: rename ktype_device Driver core: rename ktype_class driver core: remove subsystem_init() sysfs: move sysfs file poll implementation to sysfs_open_dirent sysfs: implement sysfs_open_dirent sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir sysfs: make sysfs_root a regular directory dirent sysfs: open code sysfs_attach_dentry() sysfs: make s_elem an anonymous union sysfs: make bin attr open get active reference of parent too sysfs: kill unnecessary NULL pointer check in sysfs_release() sysfs: kill unnecessary sysfs_get() in open paths sysfs: reposition sysfs_dirent->s_mode. sysfs: kill sysfs_update_file() ...
2007-10-12Driver core: change add_uevent_var to use a structKay Sievers1-10/+4
This changes the uevent buffer functions to use a struct instead of a long list of parameters. It does no longer require the caller to do the proper buffer termination and size accounting, which is currently wrong in some places. It fixes a known bug where parts of the uevent environment are overwritten because of wrong index calculations. Many thanks to Mathieu Desnoyers for finding bugs and improving the error handling. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-12[S390] zcrypt: fix ap_reset_domain()Ralph Wuerthner1-2/+3
Resetting of a all queues within a domain requires that a domain must be selected first. Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-07-10[S390] zcrypt: fix request timeout handlingRalph Wuerthner1-9/+89
Under very high load zcrypt requests may timeout while waiting on the request queue. Modify zcrypt that timeouts are based on crypto adapter responses. A timeout occurs only if a crypto adapter does not respond within a given time frame to sumitted requests. Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-04-27uevent: use add_uevent_var() instead of open coding itEric Rannaud1-15/+13
Make use of add_uevent_var() instead of (often incorrectly) open coding it. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Eric Rannaud <eric.rannaud@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-03-26[S390] zcrypt: Fix ap_poll_requests counter in lost requests error path.Ralph Wuerthner1-0/+4
In the unlikely event that an AP device lost requests, don't forget to update the ap_poll_requests counter too. Same must happen in case an AP device is removed while there are still outstanding requests. Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2007-03-26[S390] zcrypt: Fix possible dead lock in AP bus module.Ralph Wuerthner1-13/+13
If a AP device is unconfigured __ap_poll_all() will call device_unregister() in software interrupt context which can cause dead locks. To fix this the device will be only marked as unconfigured and the device_unregister() call will be done later by either ap_scan_bus() or ap_queue_message() in process context. Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2007-03-19[S390] zcrypt: fix possible dead lock in AP bus moduleRalph Wuerthner1-7/+23
AP bus module uses bus_for_each_dev() in software interrupt context to poll for completed requests which might cause dead locks. Solution: use private AP device list for polling in software interrupt context. Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-02-05[S390] Avoid excessive inlining.Heiko Carstens1-4/+4
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2006-12-15[S390] zcrypt: module unload fixes.Ralph Wuerthner1-2/+12
Add code to reset all queues for a domain and add missing tasklet_kill call to ap bus module exit code. Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2006-12-08[S390] add reset call handler to the ap bus.Ralph Wuerthner1-0/+17
Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2006-12-06[PATCH] More work_struct induced breakage (s390)Al Viro1-3/+3
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-04[S390] Add MODALIAS= to the uevent for the ap bus.Cornelia Huck1-1/+9
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2006-10-27[S390] Improve AP bus device removal.Ralph Wuerthner1-1/+6
Added a call to device_unregister() in ap_scan_bus() to actively remove unavailable AP bus devices with every bus scan. Previously devices were only removed in ap_queue_message() or __ap_poll_all(). Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2006-10-06[S390] ap bus poll thread priority.Christian Borntraeger1-1/+1
The ap bus is supposed to have a low priority. We must use 19 instead of -20, which is just the opposite. Signed-off-by: Christian Borntraeger <cborntra@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2006-10-04[S390] zcrypt device registration/unregistration race.Ralph Wuerthner1-11/+12
Fix a race condition during AP device registration and unregistration. Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2006-09-20[S390] zcrypt adjunct processor bus.Martin Schwidefsky1-0/+1221
Add a bus for the adjunct processor interface. Up to 64 devices can be connect to the ap bus interface, each device with 16 domains. That makes 1024 message queues. The interface is asynchronous, the answer to a message sent to a queue needs to be received at some later point in time. Unfortunately the interface does not provide interrupts when a message reply is pending. So the ap bus needs to implement some fancy polling, each active queue is polled once per 1/HZ second or continuously if an idle cpus exsists and the poll thread is activ (see poll_thread parameter). The ap bus uses the sysfs path /sys/bus/ap and has two bus attributes, ap_domain and config_time. The ap_domain selects one of the 16 domains to be used for this system. This limits the maximum number of ap devices to 64. The config_time attribute contains the number of seconds between two ap bus scans to find new devices. The ap bus uses the modalias entries of the form "ap:tN" to autoload the ap driver for hardware type N. Currently known types are: 3 - PCICC, 4 - PCICA, 5 - PCIXCC, 6 - CEX2A and 7 - CEX2C. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Ralph Wuerthner <rwuerthn@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>