diff mbox series

[v4,net-next,11/19] net: mvpp2: add spinlock for FW FCA configuration path

Message ID 1611747815-1934-12-git-send-email-stefanc@marvell.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: mvpp2: Add TX Flow Control support | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count fail Series longer than 15 patches
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Stefan Chulski Jan. 27, 2021, 11:43 a.m. UTC
From: Stefan Chulski <stefanc@marvell.com>

Spinlock added to MSS shared memory configuration space.

Signed-off-by: Stefan Chulski <stefanc@marvell.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h      | 5 +++++
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 3 +++
 2 files changed, 8 insertions(+)

Comments

Willem de Bruijn Jan. 27, 2021, 5:39 p.m. UTC | #1
On Wed, Jan 27, 2021 at 7:19 AM <stefanc@marvell.com> wrote:
>
> From: Stefan Chulski <stefanc@marvell.com>
>
> Spinlock added to MSS shared memory configuration space.
>
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> ---
>  drivers/net/ethernet/marvell/mvpp2/mvpp2.h      | 5 +++++
>  drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 3 +++
>  2 files changed, 8 insertions(+)
>
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
> index 9d8993f..f34e260 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
> @@ -1021,6 +1021,11 @@ struct mvpp2 {
>
>         /* CM3 SRAM pool */
>         struct gen_pool *sram_pool;
> +
> +       bool custom_dma_mask;
> +
> +       /* Spinlocks for CM3 shared memory configuration */
> +       spinlock_t mss_spinlock;

Does this need to be a stand-alone patch? This introduces a spinlock,
but does not use it.

Also, is the introduction of custom_dma_mask in this commit on purpose?
Stefan Chulski Jan. 27, 2021, 6:27 p.m. UTC | #2
> > index 9d8993f..f34e260 100644
> > --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
> > +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
> > @@ -1021,6 +1021,11 @@ struct mvpp2 {
> >
> >         /* CM3 SRAM pool */
> >         struct gen_pool *sram_pool;
> > +
> > +       bool custom_dma_mask;
> > +
> > +       /* Spinlocks for CM3 shared memory configuration */
> > +       spinlock_t mss_spinlock;
> 
> Does this need to be a stand-alone patch? This introduces a spinlock, but
> does not use it.
> 
> Also, is the introduction of custom_dma_mask in this commit on purpose?

I would add this change to another patch. custom_dma_mask should be removed.

Thanks,
Stefan.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
index 9d8993f..f34e260 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
@@ -1021,6 +1021,11 @@  struct mvpp2 {
 
 	/* CM3 SRAM pool */
 	struct gen_pool *sram_pool;
+
+	bool custom_dma_mask;
+
+	/* Spinlocks for CM3 shared memory configuration */
+	spinlock_t mss_spinlock;
 };
 
 struct mvpp2_pcpu_stats {
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index a4933c4..64534f0 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -7163,6 +7163,9 @@  static int mvpp2_probe(struct platform_device *pdev)
 			priv->hw_version = MVPP23;
 	}
 
+	/* Init mss lock */
+	spin_lock_init(&priv->mss_spinlock);
+
 	/* Initialize network controller */
 	err = mvpp2_init(pdev, priv);
 	if (err < 0) {