All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] modify the number of masters
@ 2015-12-11 10:47 Chunyan Zhang
  2015-12-11 10:47 ` [PATCH v2 1/2] stm: the number of masters should be (sw_end - sw_start + 1) Chunyan Zhang
  2015-12-11 10:48 ` [PATCH v2 2/2] intel_th: " Chunyan Zhang
  0 siblings, 2 replies; 7+ messages in thread
From: Chunyan Zhang @ 2015-12-11 10:47 UTC (permalink / raw)
  To: alexander.shishkin; +Cc: linux-kernel

sw_end represents the last software master, sw_start is index of the
first master, so the number of software masters should be
sw_end - sw_start + 1.

This patchset simply modified the similar issue in two modules.

Changes since V1:
* Split the only one patch of V1 into two separated patches according
  to Alex's comments

Chunyan Zhang (2):
  stm: the number of masters should be (sw_end - sw_start + 1)
  intel_th: the number of masters should be (sw_end - sw_start + 1)

 drivers/hwtracing/intel_th/sth.c | 2 +-
 drivers/hwtracing/stm/core.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
1.9.1


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

* [PATCH v2 1/2] stm: the number of masters should be (sw_end - sw_start + 1)
  2015-12-11 10:47 [PATCH v2 0/2] modify the number of masters Chunyan Zhang
@ 2015-12-11 10:47 ` Chunyan Zhang
  2015-12-11 10:48 ` [PATCH v2 2/2] intel_th: " Chunyan Zhang
  1 sibling, 0 replies; 7+ messages in thread
From: Chunyan Zhang @ 2015-12-11 10:47 UTC (permalink / raw)
  To: alexander.shishkin; +Cc: linux-kernel

sw_end represents the last software master, sw_start is index of the
first master, so the number of software masters should be
sw_end - sw_start + 1.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
 drivers/hwtracing/stm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index 7f7bdb3..cb676f2 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -632,7 +632,7 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
 	if (!stm_data->packet || !stm_data->sw_nchannels)
 		return -EINVAL;
 
-	nmasters = stm_data->sw_end - stm_data->sw_start;
+	nmasters = stm_data->sw_end - stm_data->sw_start + 1;
 	stm = kzalloc(sizeof(*stm) + nmasters * sizeof(void *), GFP_KERNEL);
 	if (!stm)
 		return -ENOMEM;
-- 
1.9.1


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

* [PATCH v2 2/2] intel_th: the number of masters should be (sw_end - sw_start + 1)
  2015-12-11 10:47 [PATCH v2 0/2] modify the number of masters Chunyan Zhang
  2015-12-11 10:47 ` [PATCH v2 1/2] stm: the number of masters should be (sw_end - sw_start + 1) Chunyan Zhang
@ 2015-12-11 10:48 ` Chunyan Zhang
  2016-01-28  3:41   ` Chunyan Zhang
  2016-01-29  4:24   ` [PATCH] intel_th: Show a correct number of masters in debug message Chunyan Zhang
  1 sibling, 2 replies; 7+ messages in thread
From: Chunyan Zhang @ 2015-12-11 10:48 UTC (permalink / raw)
  To: alexander.shishkin; +Cc: linux-kernel

sw_end represents the last software master, sw_start is index of the
first master, so the number of software masters should be
sw_end - sw_start + 1.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
 drivers/hwtracing/intel_th/sth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c
index 56101c3..28917d7 100644
--- a/drivers/hwtracing/intel_th/sth.c
+++ b/drivers/hwtracing/intel_th/sth.c
@@ -173,7 +173,7 @@ static int intel_th_sw_init(struct sth_device *sth)
 	sth->stm.sw_start = reg & 0xffff;
 	sth->stm.sw_end = reg >> 16;
 
-	sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start;
+	sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start + 1;
 	dev_dbg(sth->dev, "sw_start: %x sw_end: %x masters: %x nchannels: %x\n",
 		sth->stm.sw_start, sth->stm.sw_end, sth->sw_nmasters,
 		sth->stm.sw_nchannels);
-- 
1.9.1


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

* Re: [PATCH v2 2/2] intel_th: the number of masters should be (sw_end - sw_start + 1)
  2015-12-11 10:48 ` [PATCH v2 2/2] intel_th: " Chunyan Zhang
@ 2016-01-28  3:41   ` Chunyan Zhang
  2016-01-28 10:16     ` Alexander Shishkin
  2016-01-29  4:24   ` [PATCH] intel_th: Show a correct number of masters in debug message Chunyan Zhang
  1 sibling, 1 reply; 7+ messages in thread
From: Chunyan Zhang @ 2016-01-28  3:41 UTC (permalink / raw)
  To: Alexander Shishkin; +Cc: linux-kernel

Hi Alex,

Is there any problem on this patch, I noticed that you lost this patch
when you sent a patchset to Greg for 4.4 merge.

Thanks,
Chunyan

On Fri, Dec 11, 2015 at 6:48 PM, Chunyan Zhang <zhang.chunyan@linaro.org> wrote:
> sw_end represents the last software master, sw_start is index of the
> first master, so the number of software masters should be
> sw_end - sw_start + 1.
>
> Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
> ---
>  drivers/hwtracing/intel_th/sth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c
> index 56101c3..28917d7 100644
> --- a/drivers/hwtracing/intel_th/sth.c
> +++ b/drivers/hwtracing/intel_th/sth.c
> @@ -173,7 +173,7 @@ static int intel_th_sw_init(struct sth_device *sth)
>         sth->stm.sw_start = reg & 0xffff;
>         sth->stm.sw_end = reg >> 16;
>
> -       sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start;
> +       sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start + 1;
>         dev_dbg(sth->dev, "sw_start: %x sw_end: %x masters: %x nchannels: %x\n",
>                 sth->stm.sw_start, sth->stm.sw_end, sth->sw_nmasters,
>                 sth->stm.sw_nchannels);
> --
> 1.9.1
>

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

* Re: [PATCH v2 2/2] intel_th: the number of masters should be (sw_end - sw_start + 1)
  2016-01-28  3:41   ` Chunyan Zhang
@ 2016-01-28 10:16     ` Alexander Shishkin
  2016-01-28 10:55       ` Chunyan Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Shishkin @ 2016-01-28 10:16 UTC (permalink / raw)
  To: Chunyan Zhang; +Cc: linux-kernel

Chunyan Zhang <zhang.chunyan@linaro.org> writes:

> Hi Alex,

Hi chunyan,

> Is there any problem on this patch, I noticed that you lost this patch
> when you sent a patchset to Greg for 4.4 merge.

No, there isn't, it just doesn't fix anything important to be sent
outside of merge window, but the other one does. I'll queue this one up
for the next merge window.

Well, actually, one thing, since you brought it up: can you fix the
commit message to be more in line with commit message guidelines? There
are many articles/blog posts on the internet that explain what and why
should be mentioned in a commit message.

Thanks,
--
Alex

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

* Re: [PATCH v2 2/2] intel_th: the number of masters should be (sw_end - sw_start + 1)
  2016-01-28 10:16     ` Alexander Shishkin
@ 2016-01-28 10:55       ` Chunyan Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Chunyan Zhang @ 2016-01-28 10:55 UTC (permalink / raw)
  To: Alexander Shishkin; +Cc: linux-kernel

On Thu, Jan 28, 2016 at 6:16 PM, Alexander Shishkin
<alexander.shishkin@linux.intel.com> wrote:
> Chunyan Zhang <zhang.chunyan@linaro.org> writes:
>
>> Hi Alex,
>
> Hi chunyan,
>
>> Is there any problem on this patch, I noticed that you lost this patch
>> when you sent a patchset to Greg for 4.4 merge.
>
> No, there isn't, it just doesn't fix anything important to be sent
> outside of merge window, but the other one does. I'll queue this one up
> for the next merge window.
>
> Well, actually, one thing, since you brought it up: can you fix the
> commit message to be more in line with commit message guidelines? There

Sure, I'll do.

Thanks,
Chunyan

> are many articles/blog posts on the internet that explain what and why
> should be mentioned in a commit message.
>
> Thanks,
> --
> Alex

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

* [PATCH] intel_th: Show a correct number of masters in debug message
  2015-12-11 10:48 ` [PATCH v2 2/2] intel_th: " Chunyan Zhang
  2016-01-28  3:41   ` Chunyan Zhang
@ 2016-01-29  4:24   ` Chunyan Zhang
  1 sibling, 0 replies; 7+ messages in thread
From: Chunyan Zhang @ 2016-01-29  4:24 UTC (permalink / raw)
  To: alexander.shishkin; +Cc: linux-kernel, zhang.chunyan

Since both sw_start and sw_end are master indices, the number of
software masters should be sw_end - sw_start + 1, which the current
code gets wrong, calculating one less than the actual value.

With this patch, the correct number of masters would be showed in the
debug message.

Signed-off-by: Chunyan Zhang <zhang.chunyan@linaro.org>
---
 drivers/hwtracing/intel_th/sth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c
index 56101c3..28917d7 100644
--- a/drivers/hwtracing/intel_th/sth.c
+++ b/drivers/hwtracing/intel_th/sth.c
@@ -173,7 +173,7 @@ static int intel_th_sw_init(struct sth_device *sth)
 	sth->stm.sw_start = reg & 0xffff;
 	sth->stm.sw_end = reg >> 16;
 
-	sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start;
+	sth->sw_nmasters = sth->stm.sw_end - sth->stm.sw_start + 1;
 	dev_dbg(sth->dev, "sw_start: %x sw_end: %x masters: %x nchannels: %x\n",
 		sth->stm.sw_start, sth->stm.sw_end, sth->sw_nmasters,
 		sth->stm.sw_nchannels);
-- 
1.9.1

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

end of thread, other threads:[~2016-01-29  4:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-11 10:47 [PATCH v2 0/2] modify the number of masters Chunyan Zhang
2015-12-11 10:47 ` [PATCH v2 1/2] stm: the number of masters should be (sw_end - sw_start + 1) Chunyan Zhang
2015-12-11 10:48 ` [PATCH v2 2/2] intel_th: " Chunyan Zhang
2016-01-28  3:41   ` Chunyan Zhang
2016-01-28 10:16     ` Alexander Shishkin
2016-01-28 10:55       ` Chunyan Zhang
2016-01-29  4:24   ` [PATCH] intel_th: Show a correct number of masters in debug message Chunyan Zhang

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.