All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] pds_core: fix irq index bug and compiler warnings
@ 2023-11-10 20:07 Shannon Nelson
  2023-11-10 20:07 ` [PATCH net 1/2] pds_core: use correct index to mask irq Shannon Nelson
  2023-11-10 20:07 ` [PATCH net 2/2] pds_core: fix up some format-truncation complaints Shannon Nelson
  0 siblings, 2 replies; 4+ messages in thread
From: Shannon Nelson @ 2023-11-10 20:07 UTC (permalink / raw
  To: netdev, brett.creeley, davem, edumazet, kuba, pabeni
  Cc: drivers, joao.m.martins, Shannon Nelson

The first patch fixes a bug in our interrupt masking where we used the
wrong index.  The second patch addresses a couple of kernel test robot
string truncation warnings.

Shannon Nelson (2):
  pds_core: use correct index to mask irq
  pds_core: fix up some format-truncation complaints

 drivers/net/ethernet/amd/pds_core/adminq.c  | 2 +-
 drivers/net/ethernet/amd/pds_core/core.h    | 2 +-
 drivers/net/ethernet/amd/pds_core/dev.c     | 8 ++++++--
 drivers/net/ethernet/amd/pds_core/devlink.c | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] pds_core: use correct index to mask irq
  2023-11-10 20:07 [PATCH net 0/2] pds_core: fix irq index bug and compiler warnings Shannon Nelson
@ 2023-11-10 20:07 ` Shannon Nelson
  2023-11-11  0:16   ` Jakub Kicinski
  2023-11-10 20:07 ` [PATCH net 2/2] pds_core: fix up some format-truncation complaints Shannon Nelson
  1 sibling, 1 reply; 4+ messages in thread
From: Shannon Nelson @ 2023-11-10 20:07 UTC (permalink / raw
  To: netdev, brett.creeley, davem, edumazet, kuba, pabeni
  Cc: drivers, joao.m.martins, Shannon Nelson

Use the qcq's interrupt index, not the irq number, to mask
the interrupt.

Reported-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 drivers/net/ethernet/amd/pds_core/adminq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amd/pds_core/adminq.c b/drivers/net/ethernet/amd/pds_core/adminq.c
index 045fe133f6ee..5beadabc2136 100644
--- a/drivers/net/ethernet/amd/pds_core/adminq.c
+++ b/drivers/net/ethernet/amd/pds_core/adminq.c
@@ -146,7 +146,7 @@ irqreturn_t pdsc_adminq_isr(int irq, void *data)
 	}
 
 	queue_work(pdsc->wq, &qcq->work);
-	pds_core_intr_mask(&pdsc->intr_ctrl[irq], PDS_CORE_INTR_MASK_CLEAR);
+	pds_core_intr_mask(&pdsc->intr_ctrl[qcq->intx], PDS_CORE_INTR_MASK_CLEAR);
 
 	return IRQ_HANDLED;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] pds_core: fix up some format-truncation complaints
  2023-11-10 20:07 [PATCH net 0/2] pds_core: fix irq index bug and compiler warnings Shannon Nelson
  2023-11-10 20:07 ` [PATCH net 1/2] pds_core: use correct index to mask irq Shannon Nelson
@ 2023-11-10 20:07 ` Shannon Nelson
  1 sibling, 0 replies; 4+ messages in thread
From: Shannon Nelson @ 2023-11-10 20:07 UTC (permalink / raw
  To: netdev, brett.creeley, davem, edumazet, kuba, pabeni
  Cc: drivers, joao.m.martins, Shannon Nelson

Our friendly kernel test robot pointed out a couple of potential
string truncation issues.  None of which were we worried about,
but can be relatively easily fixed to quiet the complaints.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202310211736.66syyDpp-lkp@intel.com/
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 drivers/net/ethernet/amd/pds_core/core.h    | 2 +-
 drivers/net/ethernet/amd/pds_core/dev.c     | 8 ++++++--
 drivers/net/ethernet/amd/pds_core/devlink.c | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
index f3a7deda9972..e35d3e7006bf 100644
--- a/drivers/net/ethernet/amd/pds_core/core.h
+++ b/drivers/net/ethernet/amd/pds_core/core.h
@@ -15,7 +15,7 @@
 #define PDSC_DRV_DESCRIPTION	"AMD/Pensando Core Driver"
 
 #define PDSC_WATCHDOG_SECS	5
-#define PDSC_QUEUE_NAME_MAX_SZ  32
+#define PDSC_QUEUE_NAME_MAX_SZ  16
 #define PDSC_ADMINQ_MIN_LENGTH	16	/* must be a power of two */
 #define PDSC_NOTIFYQ_LENGTH	64	/* must be a power of two */
 #define PDSC_TEARDOWN_RECOVERY	false
diff --git a/drivers/net/ethernet/amd/pds_core/dev.c b/drivers/net/ethernet/amd/pds_core/dev.c
index 7c1b965d61a9..31940b857e0e 100644
--- a/drivers/net/ethernet/amd/pds_core/dev.c
+++ b/drivers/net/ethernet/amd/pds_core/dev.c
@@ -261,10 +261,14 @@ static int pdsc_identify(struct pdsc *pdsc)
 	struct pds_core_drv_identity drv = {};
 	size_t sz;
 	int err;
+	int n;
 
 	drv.drv_type = cpu_to_le32(PDS_DRIVER_LINUX);
-	snprintf(drv.driver_ver_str, sizeof(drv.driver_ver_str),
-		 "%s %s", PDS_CORE_DRV_NAME, utsname()->release);
+	/* Catching the return quiets a Wformat-truncation complaint */
+	n = snprintf(drv.driver_ver_str, sizeof(drv.driver_ver_str),
+		     "%s %s", PDS_CORE_DRV_NAME, utsname()->release);
+	if (n > sizeof(drv.driver_ver_str))
+		dev_dbg(pdsc->dev, "release name truncated, don't care\n");
 
 	/* Next let's get some info about the device
 	 * We use the devcmd_lock at this level in order to
diff --git a/drivers/net/ethernet/amd/pds_core/devlink.c b/drivers/net/ethernet/amd/pds_core/devlink.c
index 57f88c8b37de..e9948ea5bbcd 100644
--- a/drivers/net/ethernet/amd/pds_core/devlink.c
+++ b/drivers/net/ethernet/amd/pds_core/devlink.c
@@ -104,7 +104,7 @@ int pdsc_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
 	struct pds_core_fw_list_info fw_list;
 	struct pdsc *pdsc = devlink_priv(dl);
 	union pds_core_dev_comp comp;
-	char buf[16];
+	char buf[32];
 	int listlen;
 	int err;
 	int i;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 1/2] pds_core: use correct index to mask irq
  2023-11-10 20:07 ` [PATCH net 1/2] pds_core: use correct index to mask irq Shannon Nelson
@ 2023-11-11  0:16   ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2023-11-11  0:16 UTC (permalink / raw
  To: Shannon Nelson
  Cc: netdev, brett.creeley, davem, edumazet, pabeni, drivers,
	joao.m.martins

On Fri, 10 Nov 2023 12:07:58 -0800 Shannon Nelson wrote:
> Use the qcq's interrupt index, not the irq number, to mask
> the interrupt.

Patch 2 is whatever, but this one really should say what practical
impact the change has (i.e. is it causing any user visible issues).
Has impact == should include a Fixes tag; no impact == net-next.
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-11  0:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-10 20:07 [PATCH net 0/2] pds_core: fix irq index bug and compiler warnings Shannon Nelson
2023-11-10 20:07 ` [PATCH net 1/2] pds_core: use correct index to mask irq Shannon Nelson
2023-11-11  0:16   ` Jakub Kicinski
2023-11-10 20:07 ` [PATCH net 2/2] pds_core: fix up some format-truncation complaints Shannon Nelson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.