Skip to contentSkip to conversation

scsi: cxlflash: Change return type for fault handler

PATCH In review Souptick Joarder 4 participants 7 messages Jun 11, 2018 – Jun 20, 2018 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: cxlflash: Change return type for fault handler

Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type.

Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")

---
 drivers/scsi/cxlflash/superpipe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/cxlflash/superpipe.c +3 -3
index 2fe79df..a4e4c50 100644
@@ -1087,7 +1087,7 @@ static struct page *get_err_page(struct cxlflash_cfg *cfg)
  *
  * Return: 0 on success, VM_FAULT_SIGBUS on failure
  */
-static int cxlflash_mmap_fault(struct vm_fault *vmf)
+static vm_fault_t cxlflash_mmap_fault(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
 	struct file *file = vma->vm_file;
@@ -1098,7 +1098,7 @@ static int cxlflash_mmap_fault(struct vm_fault *vmf)
 	struct ctx_info *ctxi = NULL;
 	struct page *err_page = NULL;
 	enum ctx_ctrl ctrl = CTX_CTRL_ERR_FALLBACK | CTX_CTRL_FILE;
-	int rc = 0;
+	vm_fault_t rc = 0;
 	int ctxid;
 
 	ctxid = cfg->ops->process_element(ctx);
@@ -1138,7 +1138,7 @@ static int cxlflash_mmap_fault(struct vm_fault *vmf)
 out:
 	if (likely(ctxi))
 		put_context(ctxi);
-	dev_dbg(dev, "%s: returning rc=%d\n", __func__, rc);
+	dev_dbg(dev, "%s: returning rc=%x\n", __func__, rc);
 	return rc;
 
 err:
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Souptick Joarder

Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type.

Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")

This looks fine to me.

FYI that there is another handler for this driver in a series destined for 4.18 and currently in next/master.

#2 lore raw
Quoted 8 lines · Matthew R. Ochs
Quoted 7 lines · Souptick Joarder

Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type.

Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")

Quoted 9 lines
Quoted 1 line

This looks fine to me.

FYI that there is another handler for this driver in a series destined for 4.18 and currently in next/master.

Matthew, is this patch queued for 4.19 ?

#3 lore raw
Quoted 18 lines · Souptick Joarder
Quoted 12 lines · Matthew R. Ochs
Quoted 8 lines · Souptick Joarder

Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type.

Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")

This looks fine to me.

Quoted 8 lines
Quoted 5 lines

FYI that there is another handler for this driver in a series destined for 4.18 and currently in next/master.

Matthew, is this patch queued for 4.19 ?

Below is the commit that added fault handler in ocxl. It is in 4.18 rc1 (upstream/master tree)

commit 93b8f8df552c5a30bfddb75a632f1b2a436c2cae
scsi: cxlflash: Support adapter context mmap and release

#4 lore raw
Quoted 24 lines · Uma Krishnan
Quoted 24 lines · Souptick Joarder
Quoted 17 lines · Matthew R. Ochs
Quoted 8 lines · Souptick Joarder

Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type.

Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")

This looks fine to me.

FYI that there is another handler for this driver in a series destined for 4.18 and currently in next/master.

Quoted 6 lines
Quoted 2 lines

Matthew, is this patch queued for 4.19 ?

Below is the commit that added fault handler in ocxl. It is in 4.18 rc1 (upstream/master tree)

commit 93b8f8df552c5a30bfddb75a632f1b2a436c2cae
scsi: cxlflash: Support adapter context mmap and release

No, that's a different patch with commit 93b8f8df552c5a30bfddb75a632f1b2a436c2cae.
Not the patch under discussion in this mail thread :)

Anyway the other patch with commit 93b8f8df552c5a30b also has to be modified to use new return type vm_fault_t for fault handler ocxlflash_mmap_fault().

Shall I modify and submit the same ?

#5 lore raw
Quoted 34 lines · Souptick Joarder
Quoted 24 lines · Uma Krishnan
Quoted 24 lines · Souptick Joarder
Quoted 17 lines · Matthew R. Ochs
Quoted 8 lines · Souptick Joarder

Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type.

Ref-> commit 1c8f422059ae ("mm: change return type to vm_fault_t")

This looks fine to me.

FYI that there is another handler for this driver in a series destined for 4.18 and currently in next/master.

Quoted 6 lines
Quoted 2 lines

Matthew, is this patch queued for 4.19 ?

Below is the commit that added fault handler in ocxl. It is in 4.18 rc1 (upstream/master tree)

commit 93b8f8df552c5a30bfddb75a632f1b2a436c2cae
scsi: cxlflash: Support adapter context mmap and release

Quoted 9 lines

No, that's a different patch with commit 93b8f8df552c5a30bfddb75a632f1b2a436c2cae.
Not the patch under discussion in this mail thread :)

Anyway the other patch with commit 93b8f8df552c5a30b also has to be modified to use new return type vm_fault_t for fault handler ocxlflash_mmap_fault().

Shall I modify and submit the same ?

Since this has not yet been queued for 4.19, please submit a v2 with the modifications to also update the return type for ocxlflash_mmap_fault().

-matt

#6 lore raw

Matthew,

Quoted 3 lines

Since this has not yet been queued for 4.19, please submit a v2 with the modifications to also update the return type for ocxlflash_mmap_fault().

Yes, please. I have been waiting for an amended patch.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering