From: jason <jason77.wang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org
Cc: david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] spi/omap2_mcspi: disable and enable chan between each SPI transfer
Date: Tue, 13 Jul 2010 21:26:09 +0800 [thread overview]
Message-ID: <4C3C6971.5010004@gmail.com> (raw)
In-Reply-To: <E1C7579D1379824DAE67858071C810382DD859571A-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
Hi roman,
How about my test case, does it expose the real problem?
I know my original patch was a big change both for PIO mode and for
DMA mode, because there is no DMA mode device on my platform and
i can't validate whether DMA mode works fine with that patch, it is a bit
risky to apply that patch to upstream.
This time i limit my patch to PIO mode, In theory, it is safe for all
PIO transfers.
The side effect is to add a little bit overhead for a sequence of
TX_ONLY transfers.
But it really can solve my touch panel issue.
Is the following patch acceptable?
From 7b310e690fcccff400233a4c3340f42168016c92 Mon Sep 17 00:00:00 2001
From: Jason Wang <jason77.wang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Tue, 13 Jul 2010 18:05:59 +0800
Subject: [PATCH] spi/omap2_mcspi: disable channel after TX_ONLY transfer
in PIO mode
In TX_ONLY transfer, the spi controller will receive datas
simultaneously and hold them in the rx register, these datas will
affect the direct following RX_ONLY transfer. So add disable channel
to purge those rx datas.
Signed-off-by: Jason Wang <jason77.wang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/spi/omap2_mcspi.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index b3a94ca..43fab41 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -644,6 +644,12 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct
spi_transfer *xfer)
} else if (mcspi_wait_for_reg_bit(chstat_reg,
OMAP2_MCSPI_CHSTAT_EOT) < 0)
dev_err(&spi->dev, "EOT timed out\n");
+
+ /* disable chan to purge rx datas received in TX_ONLY transfer,
+ * otherwise these rx datas will affect the direct following
+ * RX_ONLY transfer.
+ */
+ omap2_mcspi_set_enable(spi, 0);
}
out:
omap2_mcspi_set_enable(spi, 1);
--
1.5.6.5
roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org wrote:
> Hi Jason,
>
> Your logs do not show what I wanted to see.
> But what I can see now at least is the case when TX is full and RX is full at the same time.
>
> 1. Put
> dev_dbg(&spi->dev, "status reg: %08x\n", __raw_readl(chstat_reg));
> after "do" and before "while (c)" in omap2_mcspi_txrx_pio function.
> I want to see how status is changed before and after TX or RX transaction.
> 2. Also try to make fake reading
> __raw_readl(tx_reg)
> after TX write in omap2_mcspi_txrx_pio.
> and
> __raw_readl(cs->base + OMAP2_MCSPI_TX0);
> in mcspi_work function.
> This should exclude the posted write effect if such present.
>
> If you put more logging info from other spi registers it might be also usefull in problem analyzing.
> And it is better to concentrate on your test case 1.
> So as it is the test which gives the bug with unknown yet nature.
>
>
>
> Regards
> Roman Tereshonkov
>
>
>> -----Original Message-----
>> From: ext jason [mailto:jason77.wang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
>> Sent: 01 July, 2010 14:59
>> To: Tereshonkov Roman (Nokia-MS/Helsinki)
>> Cc: grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org; david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org;
>> spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org;
>> linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
>> Subject: Re: [PATCH] spi/omap2_mcspi: disable and enable chan
>> between each SPI transfer
>>
>> roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org wrote:
>>
>>> Hi Jason,
>>>
>>> It is a little bit hard to analyze your logs.
>>> 1. You showed the bytes read in your own way but there is
>>>
>> the data reading in omap2_mcspi_txrx_pio function also.
>>
>>> 2. For your third test case. You try to read data after
>>>
>> TX_ONLY, before triggering RX_ONLY, and get the right word.
>>
>>> Looks like there is something wrong.
>>>
>>> Try to log MCSPI_CHxSTAT register to follow when RXS bit
>>>
>> (register RX is full) is set.
>>
>>> And do not use the RX register reading in you own way. If
>>>
>> you need RX logging do it from omap2_mcspi_txrx_pio function.
>>
>>>
<snip>
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
next prev parent reply other threads:[~2010-07-13 13:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-24 12:12 [PATCH] spi/omap2_mcspi: disable and enable chan between each SPI transfer Jason Wang
[not found] ` <1277381565-6305-1-git-send-email-jason77.wang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-06-24 14:32 ` roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w
[not found] ` <E1C7579D1379824DAE67858071C810382DD83846FB-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-06-25 12:05 ` jason
2010-06-27 6:08 ` Grant Likely
[not found] ` <AANLkTinO3kndb9bIAGlz4-h2TW64NGthHBRcVlE3gqun-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-27 13:12 ` jason
2010-06-24 15:12 ` Grant Likely
2010-06-25 12:30 ` jason
[not found] ` <4C24A182.4060009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-06-28 9:12 ` roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w
[not found] ` <E1C7579D1379824DAE67858071C810382DD8495B26-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-06-28 12:59 ` jason
2010-06-29 10:20 ` roman.tereshonkov
[not found] ` <E1C7579D1379824DAE67858071C810382DD84963BC-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-06-29 13:17 ` jason
2010-07-01 11:58 ` jason
[not found] ` <4C2C82E9.2010103-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-07-01 13:57 ` roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w
[not found] ` <E1C7579D1379824DAE67858071C810382DD859571A-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-07-01 23:35 ` jason
2010-07-03 11:21 ` jason
2010-07-13 13:26 ` jason [this message]
[not found] ` <4C3C6971.5010004-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-07-13 18:09 ` roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w
[not found] ` <E1C7579D1379824DAE67858071C810382DD8772AB3-xJW1crHCIS+8kqYwC468Frtp2NbXvJi8gfoxzgwHRXE@public.gmane.org>
2010-07-13 23:48 ` jason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C3C6971.5010004@gmail.com \
--to=jason77.wang-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=roman.tereshonkov-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).