Skip to content

Commit 4631f3c

Browse files
niklas88hcahca
authored andcommitted
s390/pci: clarify comment in s390_mmio_read/write
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 <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 4111558 commit 4631f3c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

arch/s390/pci/pci_mmio.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ SYSCALL_DEFINE3(s390_pci_mmio_write, unsigned long, mmio_addr,
155155
return -EINVAL;
156156

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

284286
/*
285-
* Only support write access to MIO capable devices on a MIO enabled
286-
* system. Otherwise we would have to check for every address if it is
287-
* a special ZPCI_ADDR and we would have to do a get_pfn() which we
288-
* don't need for MIO capable devices.
287+
* We only support read access to MIO capable devices if we are on
288+
* a MIO enabled system. Otherwise we would have to check for every
289+
* address if it is a special ZPCI_ADDR and would have to do
290+
* a get_pfn() which we don't need for MIO capable devices. Currently
291+
* ISM devices are the only devices without MIO support and there is no
292+
* known need for accessing these from userspace.
289293
*/
290294
if (static_branch_likely(&have_mio)) {
291295
ret = __memcpy_fromio_inuser(

0 commit comments

Comments
 (0)