aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/css.c
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2010-10-25 10:10:29 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-10-25 10:10:18 -0400
commit34196f82b16749e119db5572271944c4add0a9aa (patch)
tree94db487608b30d8c123419c19c12544686189c10 /drivers/s390/cio/css.c
parent34aec07c170b972a29c954b37047184bd0f9f294 (diff)
[S390] chsc: consolidate memory allocations
Most wrappers around the channel subsystem call have their own logic to allocate memory (with proper alignment) or use preallocated or static memory. This patch converts most users of the channel subsystem call to use the same preallocated page (proteced by a spinlock). Note: The sei_page which is used in our crw handler to call "store event information" has to coexist, since a) in crw context, while accessing the sei_page, sleeping is allowed (which will conflict with the spinlock protection of the chsc_page) b) in crw context, while accessing the sei_page, channel subsystem calls are allowed (which itself would require the page). Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r--drivers/s390/cio/css.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index fa1ad3aab66f..5e1235c6aba0 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -790,7 +790,6 @@ static struct notifier_block css_reboot_notifier = {
790static int css_power_event(struct notifier_block *this, unsigned long event, 790static int css_power_event(struct notifier_block *this, unsigned long event,
791 void *ptr) 791 void *ptr)
792{ 792{
793 void *secm_area;
794 int ret, i; 793 int ret, i;
795 794
796 switch (event) { 795 switch (event) {
@@ -806,15 +805,8 @@ static int css_power_event(struct notifier_block *this, unsigned long event,
806 mutex_unlock(&css->mutex); 805 mutex_unlock(&css->mutex);
807 continue; 806 continue;
808 } 807 }
809 secm_area = (void *)get_zeroed_page(GFP_KERNEL | 808 if (__chsc_do_secm(css, 0))
810 GFP_DMA);
811 if (secm_area) {
812 if (__chsc_do_secm(css, 0, secm_area))
813 ret = NOTIFY_BAD;
814 free_page((unsigned long)secm_area);
815 } else
816 ret = NOTIFY_BAD; 809 ret = NOTIFY_BAD;
817
818 mutex_unlock(&css->mutex); 810 mutex_unlock(&css->mutex);
819 } 811 }
820 break; 812 break;
@@ -830,15 +822,8 @@ static int css_power_event(struct notifier_block *this, unsigned long event,
830 mutex_unlock(&css->mutex); 822 mutex_unlock(&css->mutex);
831 continue; 823 continue;
832 } 824 }
833 secm_area = (void *)get_zeroed_page(GFP_KERNEL | 825 if (__chsc_do_secm(css, 1))
834 GFP_DMA);
835 if (secm_area) {
836 if (__chsc_do_secm(css, 1, secm_area))
837 ret = NOTIFY_BAD;
838 free_page((unsigned long)secm_area);
839 } else
840 ret = NOTIFY_BAD; 826 ret = NOTIFY_BAD;
841
842 mutex_unlock(&css->mutex); 827 mutex_unlock(&css->mutex);
843 } 828 }
844 /* search for subchannels, which appeared during hibernation */ 829 /* search for subchannels, which appeared during hibernation */
@@ -867,10 +852,7 @@ static int __init css_bus_init(void)
867 if (ret) 852 if (ret)
868 return ret; 853 return ret;
869 854
870 ret = chsc_determine_css_characteristics(); 855 chsc_determine_css_characteristics();
871 if (ret == -ENOMEM)
872 goto out;
873
874 /* Try to enable MSS. */ 856 /* Try to enable MSS. */
875 ret = chsc_enable_facility(CHSC_SDA_OC_MSS); 857 ret = chsc_enable_facility(CHSC_SDA_OC_MSS);
876 if (ret) 858 if (ret)