linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi-topcliff-pch: Fix count calculation issue
@ 2011-11-17  6:37 Tomoya MORINAGA
  2011-12-07 20:43 ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Tomoya MORINAGA @ 2011-11-17  6:37 UTC (permalink / raw)
  To: Grant Likely, spi-devel-general, linux-kernel
  Cc: qi.wang, yong.y.wang, joel.clark, kok.howg.ewe, Tomoya MORINAGA

Currently, count value is not correct more than len=8193 like below.

len	Current-cnt	New-cnt		Anticipated-cnt
4095	1		1		1
4096	1		1		1
4097	2		2		2

8191	2		2		2
8192	2		2		2
8193	2(NG)		3		3

12287	3		3		3
12288	3		3		3
12289	3(NG)		4		4

This patch fixes the issue.

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
---
 drivers/spi/spi-topcliff-pch.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 9fb0541..08b5f31 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1247,7 +1247,9 @@ static void pch_spi_process_messages(struct work_struct *pwork)
 		}
 		spin_unlock(&data->lock);
 
-		cnt = data->cur_trans->len / (PCH_BUF_SIZE + 1) + 1;
+		if (!data->cur_trans->len)
+			goto out;
+		cnt = (data->cur_trans->len - 1) / PCH_BUF_SIZE + 1;
 		data->save_total_len = data->cur_trans->len;
 		if (data->use_dma) {
 			int i;
-- 
1.7.4.4

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

* Re: [PATCH] spi-topcliff-pch: Fix count calculation issue
  2011-11-17  6:37 [PATCH] spi-topcliff-pch: Fix count calculation issue Tomoya MORINAGA
@ 2011-12-07 20:43 ` Wolfram Sang
       [not found]   ` <20111207204344.GC3744-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2011-12-07 20:43 UTC (permalink / raw)
  To: Tomoya MORINAGA
  Cc: Grant Likely, spi-devel-general, linux-kernel, kok.howg.ewe,
	qi.wang, joel.clark, yong.y.wang

[-- Attachment #1: Type: text/plain, Size: 678 bytes --]

Hi,

On Thu, Nov 17, 2011 at 03:37:21PM +0900, Tomoya MORINAGA wrote:
> Currently, count value is not correct more than len=8193 like below.
> 
> len	Current-cnt	New-cnt		Anticipated-cnt
> 4095	1		1		1
> 4096	1		1		1
> 4097	2		2		2
> 
> 8191	2		2		2
> 8192	2		2		2
> 8193	2(NG)		3		3
> 
> 12287	3		3		3
> 12288	3		3		3
> 12289	3(NG)		4		4
> 
> This patch fixes the issue.
> 
> Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>

Which branch is this patch based on?

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] spi-topcliff-pch: Fix count calculation issue
       [not found]   ` <20111207204344.GC3744-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2011-12-08  9:00     ` Tomoya MORINAGA
  0 siblings, 0 replies; 3+ messages in thread
From: Tomoya MORINAGA @ 2011-12-08  9:00 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: qi.wang-ral2JQCrhuEAvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
	kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	joel.clark-ral2JQCrhuEAvxtiuMwx3w

2011/12/8, Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>:
>>
>> Signed-off-by: Tomoya MORINAGA <tomoya.rohm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> Which branch is this patch based on?

This patch was created for linux-3.2.
However, other patches which have dependency are not sent to upstream yet.
So, I'll send the patch series again.
Sorry, for inconvenience.

thanks,
tomoya

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/

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

end of thread, other threads:[~2011-12-08  9:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17  6:37 [PATCH] spi-topcliff-pch: Fix count calculation issue Tomoya MORINAGA
2011-12-07 20:43 ` Wolfram Sang
     [not found]   ` <20111207204344.GC3744-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-12-08  9:00     ` Tomoya MORINAGA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).