Thread (4 messages) flat view 4 messages, 3 authors, 2018-08-13

Re: [PATCH] ocxl: Fix access to the AFU Descriptor Data

From: Andrew Donnellan <hidden>
Date: 2018-08-13 09:48:42

On 13/08/18 19:01, Christophe Lombard wrote:
From: Christophe Lombard <redacted>
Your git committer email should probably match your sign-off email.
The AFU Information DVSEC capability is a means to extract common,
general information about all of the AFUs associated with a Function
independent of the specific functionality that each AFU provides.

This patch fixes the access to the AFU Descriptor Data indexed by the
AFU Info Index field.

Fixes: 5ef3166e8a32 ("ocxl: Driver code for 'generic' opencapi devices")

Signed-off-by: Christophe Lombard <redacted>
This looks like it should go to stable? I assume the reason we haven't 
noticed this previously is because we have not been testing with 
multi-AFU cards.
quoted hunk ↗ jump to hunk
---
  drivers/misc/ocxl/config.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/ocxl/config.c
index 2e30de9..de01623 100644
--- a/drivers/misc/ocxl/config.c
+++ b/drivers/misc/ocxl/config.c
@@ -280,7 +280,9 @@ int ocxl_config_check_afu_index(struct pci_dev *dev,
  	u32 val;
  	int rc, templ_major, templ_minor, len;
  
-	pci_write_config_word(dev, fn->dvsec_afu_info_pos, afu_idx);
+	pci_write_config_word(dev,
+			      fn->dvsec_afu_info_pos + OCXL_DVSEC_AFU_INFO_AFU_IDX,
+			      afu_idx);
pci_write_config_byte() would be more appropriate here (see 
ocxl_config_read_afu() at line 454)
  	rc = read_afu_info(dev, fn, OCXL_DVSEC_TEMPL_VERSION, &val);
  	if (rc)
  		return rc;
-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help