From: Dilip Kota <eswara.kota@linux.intel.com>
To: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>,
broonie@kernel.org, robh@kernel.org, linux-spi@vger.kernel.org,
devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hauke@hauke-m.de,
andriy.shevchenko@intel.com, cheol.yong.kim@intel.com,
chuanhua.lei@linux.intel.com, qi-ming.wu@intel.com
Subject: Re: [PATCH 1/4] spi: lantiq: Synchronize interrupt handlers and transfers
Date: Wed, 29 Apr 2020 16:20:53 +0800 [thread overview]
Message-ID: <46f31699-e781-ae33-3ee5-d51e6940ee43@linux.intel.com> (raw)
In-Reply-To: <310ca761-e7ae-1192-99fd-a1960697806b@gmail.com>
On 4/28/2020 7:10 PM, Daniel Schwierzeck wrote:
>
> Am 24.04.20 um 12:42 schrieb Dilip Kota:
>> Synchronize tx, rx and error interrupts by registering to the
>> same interrupt handler. Interrupt handler will recognize and process
>> the appropriate interrupt on the basis of interrupt status register.
>> Also, establish synchronization between the interrupt handler and
>> transfer operation by taking the locks and registering the interrupt
>> handler as thread IRQ which avoids the bottom half.
> actually there is no real bottom half. Reading or writing the FIFOs is
> fast and is therefore be done in hard IRQ context. But as the comment
Doing FIFO r/w in threaded irqs shouldn't cause any impact on maximum
transfer rate i think.
Also the ISR should be quick enough, doing FIFO r/w in ISR adds up more
latency to ISR.
Handling the FIFOs r/w in threaded irq will be a better way.
> for lantiq_ssc_bussy_work() state, the driver needs some busy-waiting
> after the last interrupt. I don't think it's worth to replace this with
> threaded interrupts which add more runtime overhead and likely decrease
> the maximum transfer speed.
Workqueue has a higher chances of causing SPI transfers timedout.
>
>> Fixes the wrongly populated interrupt register offsets too.
>>
>> Fixes: 17f84b793c01 ("spi: lantiq-ssc: add support for Lantiq SSC SPI controller")
>> Fixes: ad2fca0721d1 ("spi: lantiq-ssc: add LTQ_ prefix to defines")
>> Signed-off-by: Dilip Kota <eswara.kota@linux.intel.com>
>> ---
>> drivers/spi/spi-lantiq-ssc.c | 89 ++++++++++++++++++++++----------------------
>> 1 file changed, 45 insertions(+), 44 deletions(-)
>>
>> diff --git a/drivers/spi/spi-lantiq-ssc.c b/drivers/spi/spi-lantiq-ssc.c
>> index 1fd7ee53d451..b67f5925bcb0 100644
>> --- a/drivers/spi/spi-lantiq-ssc.c
>> +++ b/drivers/spi/spi-lantiq-ssc.c
>> @@ -6,6 +6,7 @@
>>
>> #include <linux/kernel.h>
>> #include <linux/module.h>
>> +#include <linux/mutex.h>
>> #include <linux/of_device.h>
>> #include <linux/clk.h>
>> #include <linux/io.h>
>> @@ -13,7 +14,6 @@
>> #include <linux/interrupt.h>
>> #include <linux/sched.h>
>> #include <linux/completion.h>
>> -#include <linux/spinlock.h>
>> #include <linux/err.h>
>> #include <linux/gpio.h>
>> #include <linux/pm_runtime.h>
>> @@ -50,8 +50,8 @@
>> #define LTQ_SPI_RXCNT 0x84
>> #define LTQ_SPI_DMACON 0xec
>> #define LTQ_SPI_IRNEN 0xf4
>> -#define LTQ_SPI_IRNICR 0xf8
>> -#define LTQ_SPI_IRNCR 0xfc
>> +#define LTQ_SPI_IRNCR 0xf8
>> +#define LTQ_SPI_IRNICR 0xfc
> the values are matching the datasheets for Danube and VRX200 family.
> AFAICS the registers have been swapped for some newer SoCs like GRX330
> or GRX550. It didn't matter until now because those registers were
> unused by the driver. So if you want to use those registers, you have to
> deal somehow with the register offset swap in struct lantiq_ssc_hwcfg.
In the initial phase of the patch, i have written the code considering
the interrupt offsets in latest chipsets are different from the older
chipsets.
But, when i refered the Hauke's changes to add support for xrx500(which
he done internally), offsets are corrected . So i did the same.
I will define these offsets in the SoC data structure which i have done
initially.
Regards,
Dilip
>>
>>
next prev parent reply other threads:[~2020-04-29 8:21 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 10:42 [PATCH 0/4] spi: lantiq: Synchronize interrupts, transfers and add new features Dilip Kota
2020-04-24 10:42 ` [PATCH 1/4] spi: lantiq: Synchronize interrupt handlers and transfers Dilip Kota
2020-04-24 11:25 ` Mark Brown
2020-04-27 6:01 ` Dilip Kota
2020-04-27 13:45 ` Mark Brown
2020-04-28 5:39 ` Dilip Kota
2020-04-28 10:00 ` Mark Brown
2020-04-29 7:20 ` Dilip Kota
2020-04-29 12:27 ` Mark Brown
2020-04-27 21:52 ` Hauke Mehrtens
2020-04-28 6:03 ` Dilip Kota
2020-04-28 11:10 ` Daniel Schwierzeck
2020-04-28 11:30 ` Hauke Mehrtens
2020-04-29 8:22 ` Dilip Kota
2020-04-29 8:20 ` Dilip Kota [this message]
2020-04-29 12:13 ` Mark Brown
2020-05-04 10:15 ` Dilip Kota
2020-05-05 11:23 ` Mark Brown
2020-05-06 7:40 ` Dilip Kota
2020-07-16 9:36 ` Dilip Kota
2020-04-24 10:42 ` [PATCH 2/4] spi: lantiq: Dynamic configuration of interrupts and FIFO size Dilip Kota
2020-04-24 10:42 ` [PATCH 3/4] dt-bindings: spi: Add support to Lightning Mountain SoC Dilip Kota
2020-05-11 21:22 ` Rob Herring
2020-04-24 10:42 ` [PATCH 4/4] spi: lantiq: " Dilip Kota
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=46f31699-e781-ae33-3ee5-d51e6940ee43@linux.intel.com \
--to=eswara.kota@linux.intel.com \
--cc=andriy.shevchenko@intel.com \
--cc=broonie@kernel.org \
--cc=cheol.yong.kim@intel.com \
--cc=chuanhua.lei@linux.intel.com \
--cc=daniel.schwierzeck@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=hauke@hauke-m.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=qi-ming.wu@intel.com \
--cc=robh@kernel.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 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.