mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
s390/cio: Restore GFP_DMA for CHSC allocation
Re-add GFP_DMA when allocating memory for CHSC control blocks.
On some supported machines, CHSC cannot access memory outside
the DMA zone, causing CHSC command failures.
Cc: stable@vger.kernel.org
Fixes: a3a64a4def ("s390/cio: remove unneeded DMA zone allocation")
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
This commit is contained in:
parent
99269799bf
commit
ea34567db0
|
|
@ -1142,8 +1142,8 @@ int __init chsc_init(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
sei_page = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
chsc_page = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
sei_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
chsc_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!sei_page || !chsc_page) {
|
||||
ret = -ENOMEM;
|
||||
goto out_err;
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ static int chsc_ioctl_start(void __user *user_area)
|
|||
if (!css_general_characteristics.dynio)
|
||||
/* It makes no sense to try. */
|
||||
return -EOPNOTSUPP;
|
||||
chsc_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
chsc_area = (void *)get_zeroed_page(GFP_DMA | GFP_KERNEL);
|
||||
if (!chsc_area)
|
||||
return -ENOMEM;
|
||||
request = kzalloc_obj(*request);
|
||||
|
|
@ -340,7 +340,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area)
|
|||
ret = -ENOMEM;
|
||||
goto out_unlock;
|
||||
}
|
||||
on_close_chsc_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
on_close_chsc_area = (void *)get_zeroed_page(GFP_DMA | GFP_KERNEL);
|
||||
if (!on_close_chsc_area) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free_request;
|
||||
|
|
@ -392,7 +392,7 @@ static int chsc_ioctl_start_sync(void __user *user_area)
|
|||
struct chsc_sync_area *chsc_area;
|
||||
int ret, ccode;
|
||||
|
||||
chsc_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
chsc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!chsc_area)
|
||||
return -ENOMEM;
|
||||
if (copy_from_user(chsc_area, user_area, PAGE_SIZE)) {
|
||||
|
|
@ -438,7 +438,7 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd)
|
|||
u8 data[PAGE_SIZE - 20];
|
||||
} __attribute__ ((packed)) *scpcd_area;
|
||||
|
||||
scpcd_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
scpcd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!scpcd_area)
|
||||
return -ENOMEM;
|
||||
cd = kzalloc_obj(*cd);
|
||||
|
|
@ -500,7 +500,7 @@ static int chsc_ioctl_info_cu(void __user *user_cd)
|
|||
u8 data[PAGE_SIZE - 20];
|
||||
} __attribute__ ((packed)) *scucd_area;
|
||||
|
||||
scucd_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
scucd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!scucd_area)
|
||||
return -ENOMEM;
|
||||
cd = kzalloc_obj(*cd);
|
||||
|
|
@ -563,7 +563,7 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud)
|
|||
u8 data[PAGE_SIZE - 20];
|
||||
} __attribute__ ((packed)) *sscud_area;
|
||||
|
||||
sscud_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
sscud_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!sscud_area)
|
||||
return -ENOMEM;
|
||||
cud = kzalloc_obj(*cud);
|
||||
|
|
@ -625,7 +625,7 @@ static int chsc_ioctl_conf_info(void __user *user_ci)
|
|||
u8 data[PAGE_SIZE - 20];
|
||||
} __attribute__ ((packed)) *sci_area;
|
||||
|
||||
sci_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
sci_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!sci_area)
|
||||
return -ENOMEM;
|
||||
ci = kzalloc_obj(*ci);
|
||||
|
|
@ -696,7 +696,7 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)
|
|||
u32 res;
|
||||
} __attribute__ ((packed)) *cssids_parm;
|
||||
|
||||
sccl_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
sccl_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!sccl_area)
|
||||
return -ENOMEM;
|
||||
ccl = kzalloc_obj(*ccl);
|
||||
|
|
@ -756,7 +756,7 @@ static int chsc_ioctl_chpd(void __user *user_chpd)
|
|||
int ret;
|
||||
|
||||
chpd = kzalloc_obj(*chpd);
|
||||
scpd_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
scpd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!scpd_area || !chpd) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free;
|
||||
|
|
@ -796,7 +796,7 @@ static int chsc_ioctl_dcal(void __user *user_dcal)
|
|||
u8 data[PAGE_SIZE - 36];
|
||||
} __attribute__ ((packed)) *sdcal_area;
|
||||
|
||||
sdcal_area = (void *)get_zeroed_page(GFP_KERNEL);
|
||||
sdcal_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!sdcal_area)
|
||||
return -ENOMEM;
|
||||
dcal = kzalloc_obj(*dcal);
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ int scm_update_information(void)
|
|||
size_t num;
|
||||
int ret;
|
||||
|
||||
scm_info = (void *)__get_free_page(GFP_KERNEL);
|
||||
scm_info = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
|
||||
if (!scm_info)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user