Skip to content

Commit

Permalink
s390/pci: clarify comment in s390_mmio_read/write
Browse files Browse the repository at this point in the history
The existing comment was talking about reading in the write part
and vice versa. While we are here make it more clear why restricting
the syscalls to MIO capable devices is okay.

Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
  • Loading branch information
Niklas Schnelle authored and Heiko Carstens committed Jul 27, 2020
1 parent 4111558 commit 4631f3c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions arch/s390/pci/pci_mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ SYSCALL_DEFINE3(s390_pci_mmio_write, unsigned long, mmio_addr,
return -EINVAL;

/*
* Only support read access to MIO capable devices on a MIO enabled
* system. Otherwise we would have to check for every address if it is
* a special ZPCI_ADDR and we would have to do a get_pfn() which we
* don't need for MIO capable devices.
* We only support write access to MIO capable devices if we are on
* a MIO enabled system. Otherwise we would have to check for every
* address if it is a special ZPCI_ADDR and would have to do
* a get_pfn() which we don't need for MIO capable devices. Currently
* ISM devices are the only devices without MIO support and there is no
* known need for accessing these from userspace.
*/
if (static_branch_likely(&have_mio)) {
ret = __memcpy_toio_inuser((void __iomem *) mmio_addr,
Expand Down Expand Up @@ -282,10 +284,12 @@ SYSCALL_DEFINE3(s390_pci_mmio_read, unsigned long, mmio_addr,
return -EINVAL;

/*
* Only support write access to MIO capable devices on a MIO enabled
* system. Otherwise we would have to check for every address if it is
* a special ZPCI_ADDR and we would have to do a get_pfn() which we
* don't need for MIO capable devices.
* We only support read access to MIO capable devices if we are on
* a MIO enabled system. Otherwise we would have to check for every
* address if it is a special ZPCI_ADDR and would have to do
* a get_pfn() which we don't need for MIO capable devices. Currently
* ISM devices are the only devices without MIO support and there is no
* known need for accessing these from userspace.
*/
if (static_branch_likely(&have_mio)) {
ret = __memcpy_fromio_inuser(
Expand Down

0 comments on commit 4631f3c

Please sign in to comment.