All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-06 11:56 ` Wei Yongjun
  0 siblings, 0 replies; 12+ messages in thread
From: Wei Yongjun @ 2019-11-06 11:56 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin, Yabin Cui
  Cc: Wei Yongjun, linux-arm-kernel, linux-kernel, kernel-janitors

The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/hwtracing/coresight/coresight-replicator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
index 43304196a1a6..e7dc1c31d20d 100644
--- a/drivers/hwtracing/coresight/coresight-replicator.c
+++ b/drivers/hwtracing/coresight/coresight-replicator.c
@@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
 	}
 	dev->platform_data = pdata;
 
+	spin_lock_init(&drvdata->spinlock);
 	desc.type = CORESIGHT_DEV_TYPE_LINK;
 	desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
 	desc.ops = &replicator_cs_ops;




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

* [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-06 11:56 ` Wei Yongjun
  0 siblings, 0 replies; 12+ messages in thread
From: Wei Yongjun @ 2019-11-06 11:56 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin, Yabin Cui
  Cc: kernel-janitors, Wei Yongjun, linux-kernel, linux-arm-kernel

The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/hwtracing/coresight/coresight-replicator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
index 43304196a1a6..e7dc1c31d20d 100644
--- a/drivers/hwtracing/coresight/coresight-replicator.c
+++ b/drivers/hwtracing/coresight/coresight-replicator.c
@@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
 	}
 	dev->platform_data = pdata;
 
+	spin_lock_init(&drvdata->spinlock);
 	desc.type = CORESIGHT_DEV_TYPE_LINK;
 	desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
 	desc.ops = &replicator_cs_ops;

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

* [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-06 11:56 ` Wei Yongjun
  0 siblings, 0 replies; 12+ messages in thread
From: Wei Yongjun @ 2019-11-06 11:56 UTC (permalink / raw)
  To: Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin, Yabin Cui
  Cc: kernel-janitors, Wei Yongjun, linux-kernel, linux-arm-kernel

The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.

This is detected by Coccinelle semantic patch.

Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/hwtracing/coresight/coresight-replicator.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
index 43304196a1a6..e7dc1c31d20d 100644
--- a/drivers/hwtracing/coresight/coresight-replicator.c
+++ b/drivers/hwtracing/coresight/coresight-replicator.c
@@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
 	}
 	dev->platform_data = pdata;
 
+	spin_lock_init(&drvdata->spinlock);
 	desc.type = CORESIGHT_DEV_TYPE_LINK;
 	desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
 	desc.ops = &replicator_cs_ops;




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
  2019-11-06 11:56 ` Wei Yongjun
  (?)
@ 2019-11-06 18:49   ` Yabin Cui
  -1 siblings, 0 replies; 12+ messages in thread
From: Yabin Cui @ 2019-11-06 18:49 UTC (permalink / raw)
  To: Wei Yongjun, Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
  Cc: linux-arm-kernel, linux-kernel, kernel-janitors, Yabin Cui

Thanks for the fix! I should have tested with CONFIG_DEBUG_SPINLOCK.

Tested-by: Yabin Cui <yabinc@google.com>

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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-06 18:49   ` Yabin Cui
  0 siblings, 0 replies; 12+ messages in thread
From: Yabin Cui @ 2019-11-06 18:49 UTC (permalink / raw)
  To: Wei Yongjun, Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
  Cc: Yabin Cui, kernel-janitors, linux-kernel, linux-arm-kernel

Thanks for the fix! I should have tested with CONFIG_DEBUG_SPINLOCK.

Tested-by: Yabin Cui <yabinc@google.com>

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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-06 18:49   ` Yabin Cui
  0 siblings, 0 replies; 12+ messages in thread
From: Yabin Cui @ 2019-11-06 18:49 UTC (permalink / raw)
  To: Wei Yongjun, Mathieu Poirier, Suzuki K Poulose, Alexander Shishkin
  Cc: Yabin Cui, kernel-janitors, linux-kernel, linux-arm-kernel

Thanks for the fix! I should have tested with CONFIG_DEBUG_SPINLOCK.

Tested-by: Yabin Cui <yabinc@google.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
  2019-11-06 11:56 ` Wei Yongjun
  (?)
@ 2019-11-07 18:47   ` Mathieu Poirier
  -1 siblings, 0 replies; 12+ messages in thread
From: Mathieu Poirier @ 2019-11-07 18:47 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Suzuki K Poulose, Alexander Shishkin, Yabin Cui,
	linux-arm-kernel, Linux Kernel Mailing List, kernel-janitors

On Wed, 6 Nov 2019 at 04:57, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> The driver allocates the spinlock but not initialize it.
> Use spin_lock_init() on it to initialize it correctly.
>
> This is detected by Coccinelle semantic patch.
>
> Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/hwtracing/coresight/coresight-replicator.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
> index 43304196a1a6..e7dc1c31d20d 100644
> --- a/drivers/hwtracing/coresight/coresight-replicator.c
> +++ b/drivers/hwtracing/coresight/coresight-replicator.c
> @@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
>         }
>         dev->platform_data = pdata;
>
> +       spin_lock_init(&drvdata->spinlock);

I have applied both patches but removed the "Fixes" line since the
commit is only visible in my local coresight next tree.

Thanks,
Mathieu

>         desc.type = CORESIGHT_DEV_TYPE_LINK;
>         desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
>         desc.ops = &replicator_cs_ops;
>
>
>

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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-07 18:47   ` Mathieu Poirier
  0 siblings, 0 replies; 12+ messages in thread
From: Mathieu Poirier @ 2019-11-07 18:47 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Suzuki K Poulose, Alexander Shishkin, Yabin Cui, kernel-janitors,
	Linux Kernel Mailing List, linux-arm-kernel

On Wed, 6 Nov 2019 at 04:57, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> The driver allocates the spinlock but not initialize it.
> Use spin_lock_init() on it to initialize it correctly.
>
> This is detected by Coccinelle semantic patch.
>
> Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/hwtracing/coresight/coresight-replicator.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
> index 43304196a1a6..e7dc1c31d20d 100644
> --- a/drivers/hwtracing/coresight/coresight-replicator.c
> +++ b/drivers/hwtracing/coresight/coresight-replicator.c
> @@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
>         }
>         dev->platform_data = pdata;
>
> +       spin_lock_init(&drvdata->spinlock);

I have applied both patches but removed the "Fixes" line since the
commit is only visible in my local coresight next tree.

Thanks,
Mathieu

>         desc.type = CORESIGHT_DEV_TYPE_LINK;
>         desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
>         desc.ops = &replicator_cs_ops;
>
>
>

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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-07 18:47   ` Mathieu Poirier
  0 siblings, 0 replies; 12+ messages in thread
From: Mathieu Poirier @ 2019-11-07 18:47 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Suzuki K Poulose, Alexander Shishkin, Yabin Cui, kernel-janitors,
	Linux Kernel Mailing List, linux-arm-kernel

On Wed, 6 Nov 2019 at 04:57, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> The driver allocates the spinlock but not initialize it.
> Use spin_lock_init() on it to initialize it correctly.
>
> This is detected by Coccinelle semantic patch.
>
> Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/hwtracing/coresight/coresight-replicator.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
> index 43304196a1a6..e7dc1c31d20d 100644
> --- a/drivers/hwtracing/coresight/coresight-replicator.c
> +++ b/drivers/hwtracing/coresight/coresight-replicator.c
> @@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
>         }
>         dev->platform_data = pdata;
>
> +       spin_lock_init(&drvdata->spinlock);

I have applied both patches but removed the "Fixes" line since the
commit is only visible in my local coresight next tree.

Thanks,
Mathieu

>         desc.type = CORESIGHT_DEV_TYPE_LINK;
>         desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_SPLIT;
>         desc.ops = &replicator_cs_ops;
>
>
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
  2019-11-07 18:47   ` Mathieu Poirier
  (?)
@ 2019-11-08 10:05     ` Dan Carpenter
  -1 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2019-11-08 10:05 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: Wei Yongjun, Suzuki K Poulose, Alexander Shishkin, Yabin Cui,
	linux-arm-kernel, Linux Kernel Mailing List, kernel-janitors

On Thu, Nov 07, 2019 at 11:47:11AM -0700, Mathieu Poirier wrote:
> On Wed, 6 Nov 2019 at 04:57, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> >
> > The driver allocates the spinlock but not initialize it.
> > Use spin_lock_init() on it to initialize it correctly.
> >
> > This is detected by Coccinelle semantic patch.
> >
> > Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> > ---
> >  drivers/hwtracing/coresight/coresight-replicator.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
> > index 43304196a1a6..e7dc1c31d20d 100644
> > --- a/drivers/hwtracing/coresight/coresight-replicator.c
> > +++ b/drivers/hwtracing/coresight/coresight-replicator.c
> > @@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
> >         }
> >         dev->platform_data = pdata;
> >
> > +       spin_lock_init(&drvdata->spinlock);
> 
> I have applied both patches but removed the "Fixes" line since the
> commit is only visible in my local coresight next tree.
> 

Unless you rebase the tree, then the Fixes tag will still be valid.
(Probably local implies you rebase it I guess).

regards,
dan carpenter


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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-08 10:05     ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2019-11-08 10:05 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: Suzuki K Poulose, Alexander Shishkin, Yabin Cui, kernel-janitors,
	Linux Kernel Mailing List, Wei Yongjun, linux-arm-kernel

On Thu, Nov 07, 2019 at 11:47:11AM -0700, Mathieu Poirier wrote:
> On Wed, 6 Nov 2019 at 04:57, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> >
> > The driver allocates the spinlock but not initialize it.
> > Use spin_lock_init() on it to initialize it correctly.
> >
> > This is detected by Coccinelle semantic patch.
> >
> > Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> > ---
> >  drivers/hwtracing/coresight/coresight-replicator.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
> > index 43304196a1a6..e7dc1c31d20d 100644
> > --- a/drivers/hwtracing/coresight/coresight-replicator.c
> > +++ b/drivers/hwtracing/coresight/coresight-replicator.c
> > @@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
> >         }
> >         dev->platform_data = pdata;
> >
> > +       spin_lock_init(&drvdata->spinlock);
> 
> I have applied both patches but removed the "Fixes" line since the
> commit is only visible in my local coresight next tree.
> 

Unless you rebase the tree, then the Fixes tag will still be valid.
(Probably local implies you rebase it I guess).

regards,
dan carpenter

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

* Re: [PATCH -next] coresight: replicator: Fix missing spin_lock_init()
@ 2019-11-08 10:05     ` Dan Carpenter
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Carpenter @ 2019-11-08 10:05 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: Suzuki K Poulose, Alexander Shishkin, Yabin Cui, kernel-janitors,
	Linux Kernel Mailing List, Wei Yongjun, linux-arm-kernel

On Thu, Nov 07, 2019 at 11:47:11AM -0700, Mathieu Poirier wrote:
> On Wed, 6 Nov 2019 at 04:57, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> >
> > The driver allocates the spinlock but not initialize it.
> > Use spin_lock_init() on it to initialize it correctly.
> >
> > This is detected by Coccinelle semantic patch.
> >
> > Fixes: 0093875ad129 ("coresight: Serialize enabling/disabling a link device.")
> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> > ---
> >  drivers/hwtracing/coresight/coresight-replicator.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c
> > index 43304196a1a6..e7dc1c31d20d 100644
> > --- a/drivers/hwtracing/coresight/coresight-replicator.c
> > +++ b/drivers/hwtracing/coresight/coresight-replicator.c
> > @@ -248,6 +248,7 @@ static int replicator_probe(struct device *dev, struct resource *res)
> >         }
> >         dev->platform_data = pdata;
> >
> > +       spin_lock_init(&drvdata->spinlock);
> 
> I have applied both patches but removed the "Fixes" line since the
> commit is only visible in my local coresight next tree.
> 

Unless you rebase the tree, then the Fixes tag will still be valid.
(Probably local implies you rebase it I guess).

regards,
dan carpenter


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-11-08 10:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 11:56 [PATCH -next] coresight: replicator: Fix missing spin_lock_init() Wei Yongjun
2019-11-06 11:56 ` Wei Yongjun
2019-11-06 11:56 ` Wei Yongjun
2019-11-06 18:49 ` Yabin Cui
2019-11-06 18:49   ` Yabin Cui
2019-11-06 18:49   ` Yabin Cui
2019-11-07 18:47 ` Mathieu Poirier
2019-11-07 18:47   ` Mathieu Poirier
2019-11-07 18:47   ` Mathieu Poirier
2019-11-08 10:05   ` Dan Carpenter
2019-11-08 10:05     ` Dan Carpenter
2019-11-08 10:05     ` Dan Carpenter

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.