diff mbox

[2/2] SPI: SAMSUNG: Bug fix for SPI with different FIFO level

Message ID 1309437536-9315-2-git-send-email-padma.v@samsung.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Padmavathi Venna June 30, 2011, 12:38 p.m. UTC
Fixed the bug in transmission status check for 64 bytes FIFO
level.

Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
---
 drivers/spi/spi_s3c64xx.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

Comments

Jassi Brar June 30, 2011, 7:08 a.m. UTC | #1
On Thu, Jun 30, 2011 at 6:08 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
> Fixed the bug in transmission status check for 64 bytes FIFO
> level.
>
> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
> ---
>  drivers/spi/spi_s3c64xx.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c
> index 795828b..8945e20 100644
> --- a/drivers/spi/spi_s3c64xx.c
> +++ b/drivers/spi/spi_s3c64xx.c
> @@ -116,9 +116,7 @@
>                                        (((i)->fifo_lvl_mask + 1))) \
>                                        ? 1 : 0)
>
> -#define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) & \
> -                                       (((i)->fifo_lvl_mask + 1) << 1)) \
> -                                       ? 1 : 0)
> +#define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done)) ? 1 : 0)

IIRC the macro is already designed to deduct tx-done levels from other fields.
Could you please _explain_ with one example where it fails ? It is
difficult to see without
numbers.

Thanks,
-Jassi

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
padma venkat June 30, 2011, 9:05 a.m. UTC | #2
Hi,

On Thu, Jun 30, 2011 at 12:38 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Thu, Jun 30, 2011 at 6:08 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
>> Fixed the bug in transmission status check for 64 bytes FIFO
>> level.
>>
>> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
>> ---
>>  drivers/spi/spi_s3c64xx.c |    4 +---
>>  1 files changed, 1 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.hc
>> index 795828b..8945e20 100644
>> --- a/drivers/spi/spi_s3c64xx.c
>> +++ b/drivers/spi/spi_s3c64xx.c
>> @@ -116,9 +116,7 @@
>>                                        (((i)->fifo_lvl_mask + 1))) \
>>                                        ? 1 : 0)
>>
>> -#define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) & \
>> -                                       (((i)->fifo_lvl_mask + 1) << 1)) \
>> -                                       ? 1 : 0)
>> +#define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done)) ? 1 : 0)
>
> IIRC the macro is already designed to deduct tx-done levels from other fields.
> Could you please _explain_ with one example where it fails ? It is
> difficult to see without
> numbers.
The existing macro fails for following scenarios.
1) S5P64X0 channel 1
2) S5PV210 channel 1
3) S5PV310 channel 1 and channel 2

The FIFO data level supported in the above SoCs either 64 or 256
bytes depending on the channel. Because of this the TX_DONE
is the 25 bit in the status register.

The existing macro works for the following scenarios
1) S3C6410 all channels
2) S5PC100 all channels

The FIFO data level supported in the above SoCs 64 bytes
on all the channels. Because of this the TX_DONE is the 21 bit
in the status register.

So when we use the existing macro for the non-working SoCs
it is not anding with the TX_DONE bit but it is only anding the bits
earlier to TX_DONE bit.

>
> Thanks,
> -Jassi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Jassi Brar June 30, 2011, 9:52 a.m. UTC | #3
On Thu, Jun 30, 2011 at 2:35 PM, padma venkat <padma.kvr@gmail.com> wrote:
> Hi,
>
> On Thu, Jun 30, 2011 at 12:38 PM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>> On Thu, Jun 30, 2011 at 6:08 PM, Padmavathi Venna <padma.v@samsung.com> wrote:
>>> Fixed the bug in transmission status check for 64 bytes FIFO
>>> level.
>>>
>>> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
>>> ---
>>>  drivers/spi/spi_s3c64xx.c |    4 +---
>>>  1 files changed, 1 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.hc
>>> index 795828b..8945e20 100644
>>> --- a/drivers/spi/spi_s3c64xx.c
>>> +++ b/drivers/spi/spi_s3c64xx.c
>>> @@ -116,9 +116,7 @@
>>>                                        (((i)->fifo_lvl_mask + 1))) \
>>>                                        ? 1 : 0)
>>>
>>> -#define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) & \
>>> -                                       (((i)->fifo_lvl_mask + 1) << 1)) \
>>> -                                       ? 1 : 0)
>>> +#define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done)) ? 1 : 0)
>>
>> IIRC the macro is already designed to deduct tx-done levels from other fields.
>> Could you please _explain_ with one example where it fails ? It is
>> difficult to see without
>> numbers.
> The existing macro fails for following scenarios.
> 1) S5P64X0 channel 1
> 2) S5PV210 channel 1
> 3) S5PV310 channel 1 and channel 2
>
> The FIFO data level supported in the above SoCs either 64 or 256
> bytes depending on the channel. Because of this the TX_DONE
> is the 25 bit in the status register.
>
> The existing macro works for the following scenarios
> 1) S3C6410 all channels
> 2) S5PC100 all channels
>
> The FIFO data level supported in the above SoCs 64 bytes
> on all the channels. Because of this the TX_DONE is the 21 bit
> in the status register.
>
> So when we use the existing macro for the non-working SoCs
> it is not anding with the TX_DONE bit but it is only anding the bits
> earlier to TX_DONE bit.
>

I see.
I don't have access to post s3c64xx datasheets. Please confirm if TX_DONE
bit at same offset for all channels of an SoC. If so, I am OK with
these 2 patches.

Thanks,
Jassi

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Tony Nadackal June 30, 2011, 11 a.m. UTC | #4
Hi Padma,
With regards to your patch, even though one can check the tx done status
using the TX_DONE bit, the present macro itself would work perfectly fine if
the 'fifo_lvl_mask' is set properly.
For example in 6450 channel 1, the fifo_lvl_mask should be 0x1ff (for 9bits,
15:23), while even in your patch, it is wrongly set as 0x7f(only 7bits).

Thus, if this fifo_lvl_mask was defined correctly, the existing macro would
itself have worked.

Thanks,
Tony

On Thu, Jun 30, 2011 at 3:22 PM, Jassi Brar <jassisinghbrar@gmail.com>wrote:

> On Thu, Jun 30, 2011 at 2:35 PM, padma venkat <padma.kvr@gmail.com> wrote:
> > Hi,
> >
> > On Thu, Jun 30, 2011 at 12:38 PM, Jassi Brar <jassisinghbrar@gmail.com>
> wrote:
> >> On Thu, Jun 30, 2011 at 6:08 PM, Padmavathi Venna <padma.v@samsung.com>
> wrote:
> >>> Fixed the bug in transmission status check for 64 bytes FIFO
> >>> level.
> >>>
> >>> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
> >>> ---
> >>>  drivers/spi/spi_s3c64xx.c |    4 +---
> >>>  1 files changed, 1 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.hc
> >>> index 795828b..8945e20 100644
> >>> --- a/drivers/spi/spi_s3c64xx.c
> >>> +++ b/drivers/spi/spi_s3c64xx.c
> >>> @@ -116,9 +116,7 @@
> >>>                                        (((i)->fifo_lvl_mask + 1))) \
> >>>                                        ? 1 : 0)
> >>>
> >>> -#define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) & \
> >>> -                                       (((i)->fifo_lvl_mask + 1) <<
> 1)) \
> >>> -                                       ? 1 : 0)
> >>> +#define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done)) ?
> 1 : 0)
> >>
> >> IIRC the macro is already designed to deduct tx-done levels from other
> fields.
> >> Could you please _explain_ with one example where it fails ? It is
> >> difficult to see without
> >> numbers.
> > The existing macro fails for following scenarios.
> > 1) S5P64X0 channel 1
> > 2) S5PV210 channel 1
> > 3) S5PV310 channel 1 and channel 2
> >
> > The FIFO data level supported in the above SoCs either 64 or 256
> > bytes depending on the channel. Because of this the TX_DONE
> > is the 25 bit in the status register.
> >
> > The existing macro works for the following scenarios
> > 1) S3C6410 all channels
> > 2) S5PC100 all channels
> >
> > The FIFO data level supported in the above SoCs 64 bytes
> > on all the channels. Because of this the TX_DONE is the 21 bit
> > in the status register.
> >
> > So when we use the existing macro for the non-working SoCs
> > it is not anding with the TX_DONE bit but it is only anding the bits
> > earlier to TX_DONE bit.
> >
>
> I see.
> I don't have access to post s3c64xx datasheets. Please confirm if TX_DONE
> bit at same offset for all channels of an SoC. If so, I am OK with
> these 2 patches.
>
> Thanks,
> Jassi
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
padma venkat July 1, 2011, 5:46 a.m. UTC | #5
Hi Tony,

On Thu, Jun 30, 2011 at 4:30 PM, Tony Nadackal <tonykn@gmail.com> wrote:
> Hi Padma,
> With regards to your patch, even though one can check the tx done status
> using the TX_DONE bit, the present macro itself would work perfectly fine if
> the 'fifo_lvl_mask' is set properly.
> For example in 6450 channel 1, the fifo_lvl_mask should be 0x1ff (for 9bits,
> 15:23), while even in your patch, it is wrongly set as 0x7f(only 7bits).
>
> Thus, if this fifo_lvl_mask was defined correctly, the existing macro would
> itself have worked.
Thanks for your comment.
I considered changing to the fifo_lvl_mask to 1ff as you mentioned.
But I  think that the fifo_lvl_mask reflects the actual FIFO capacity
in the SPI driver.
For the failing channels the FIFO trigger level is 64 bytes and so i
retained that value.
In the driver it polls till the FIFO capacity level otherwise it goes
for DMA.So if we keep
the FIFO level as 1ff when the actual capacity is 7f then it fails.

Jassi what do you think about this?

Thanks&Regards
Padma

> Thanks,
> Tony
>
> On Thu, Jun 30, 2011 at 3:22 PM, Jassi Brar <jassisinghbrar@gmail.com>
> wrote:
>>
>> On Thu, Jun 30, 2011 at 2:35 PM, padma venkat <padma.kvr@gmail.com> wrote:
>> > Hi,
>> >
>> > On Thu, Jun 30, 2011 at 12:38 PM, Jassi Brar <jassisinghbrar@gmail.com>
>> > wrote:
>> >> On Thu, Jun 30, 2011 at 6:08 PM, Padmavathi Venna <padma.v@samsung.com>
>> >> wrote:
>> >>> Fixed the bug in transmission status check for 64 bytes FIFO
>> >>> level.
>> >>>
>> >>> Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
>> >>> ---
>> >>>  drivers/spi/spi_s3c64xx.c |    4 +---
>> >>>  1 files changed, 1 insertions(+), 3 deletions(-)
>> >>>
>> >>> diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.hc
>> >>> index 795828b..8945e20 100644
>> >>> --- a/drivers/spi/spi_s3c64xx.c
>> >>> +++ b/drivers/spi/spi_s3c64xx.c
>> >>> @@ -116,9 +116,7 @@
>> >>>                                        (((i)->fifo_lvl_mask + 1))) \
>> >>>                                        ? 1 : 0)
>> >>>
>> >>> -#define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) &
>> >>> \
>> >>> -                                       (((i)->fifo_lvl_mask + 1) <<
>> >>> 1)) \
>> >>> -                                       ? 1 : 0)
>> >>> +#define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done))
>> >>> ? 1 : 0)
>> >>
>> >> IIRC the macro is already designed to deduct tx-done levels from other
>> >> fields.
>> >> Could you please _explain_ with one example where it fails ? It is
>> >> difficult to see without
>> >> numbers.
>> > The existing macro fails for following scenarios.
>> > 1) S5P64X0 channel 1
>> > 2) S5PV210 channel 1
>> > 3) S5PV310 channel 1 and channel 2
>> >
>> > The FIFO data level supported in the above SoCs either 64 or 256
>> > bytes depending on the channel. Because of this the TX_DONE
>> > is the 25 bit in the status register.
>> >
>> > The existing macro works for the following scenarios
>> > 1) S3C6410 all channels
>> > 2) S5PC100 all channels
>> >
>> > The FIFO data level supported in the above SoCs 64 bytes
>> > on all the channels. Because of this the TX_DONE is the 21 bit
>> > in the status register.
>> >
>> > So when we use the existing macro for the non-working SoCs
>> > it is not anding with the TX_DONE bit but it is only anding the bits
>> > earlier to TX_DONE bit.
>> >
>>
>> I see.
>> I don't have access to post s3c64xx datasheets. Please confirm if TX_DONE
>> bit at same offset for all channels of an SoC. If so, I am OK with
>> these 2 patches.
>>
>> Thanks,
>> Jassi
>> --
>> To unsubscribe from this list: send the line "unsubscribe
>> linux-samsung-soc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Jassi Brar July 1, 2011, 5:52 a.m. UTC | #6
On Fri, Jul 1, 2011 at 11:16 AM, padma venkat <padma.kvr@gmail.com> wrote:
> Hi Tony,
>
> On Thu, Jun 30, 2011 at 4:30 PM, Tony Nadackal <tonykn@gmail.com> wrote:
>> Hi Padma,
>> With regards to your patch, even though one can check the tx done status
>> using the TX_DONE bit, the present macro itself would work perfectly fine if
>> the 'fifo_lvl_mask' is set properly.
>> For example in 6450 channel 1, the fifo_lvl_mask should be 0x1ff (for 9bits,
>> 15:23), while even in your patch, it is wrongly set as 0x7f(only 7bits).
>>
>> Thus, if this fifo_lvl_mask was defined correctly, the existing macro would
>> itself have worked.
> Thanks for your comment.
> I considered changing to the fifo_lvl_mask to 1ff as you mentioned.
> But I  think that the fifo_lvl_mask reflects the actual FIFO capacity
> in the SPI driver.
> For the failing channels the FIFO trigger level is 64 bytes and so i
> retained that value.
> In the driver it polls till the FIFO capacity level otherwise it goes
> for DMA.So if we keep
> the FIFO level as 1ff when the actual capacity is 7f then it fails.
>
> Jassi what do you think about this?
>

'fifo_lvl_mask' is h/w specific and can't be set for convenience.

I don't have access to post-s3c64xx datasheets.
Please check and reply if TX_DONE bit is at same offset for all
channels of an SoC, because
I suspect it's otherwise.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
padma venkat July 1, 2011, 5:59 a.m. UTC | #7
Hi Jassi,

On Fri, Jul 1, 2011 at 11:22 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Fri, Jul 1, 2011 at 11:16 AM, padma venkat <padma.kvr@gmail.com> wrote:
>> Hi Tony,
>>
>> On Thu, Jun 30, 2011 at 4:30 PM, Tony Nadackal <tonykn@gmail.com> wrote:
>>> Hi Padma,
>>> With regards to your patch, even though one can check the tx done status
>>> using the TX_DONE bit, the present macro itself would work perfectly fine if
>>> the 'fifo_lvl_mask' is set properly.
>>> For example in 6450 channel 1, the fifo_lvl_mask should be 0x1ff (for 9bits,
>>> 15:23), while even in your patch, it is wrongly set as 0x7f(only 7bits).
>>>
>>> Thus, if this fifo_lvl_mask was defined correctly, the existing macro would
>>> itself have worked.
>> Thanks for your comment.
>> I considered changing to the fifo_lvl_mask to 1ff as you mentioned.
>> But I  think that the fifo_lvl_mask reflects the actual FIFO capacity
>> in the SPI driver.
>> For the failing channels the FIFO trigger level is 64 bytes and so i
>> retained that value.
>> In the driver it polls till the FIFO capacity level otherwise it goes
>> for DMA.So if we keep
>> the FIFO level as 1ff when the actual capacity is 7f then it fails.
>>
>> Jassi what do you think about this?
>>
>
> 'fifo_lvl_mask' is h/w specific and can't be set for convenience.
>
> I don't have access to post-s3c64xx datasheets.
> Please check and reply if TX_DONE bit is at same offset for all
> channels of an SoC, because
> I suspect it's otherwise.
>
Yes. The TX_DONE bit is at the same offset for all the channels of an SoC.
in S5P64X0,S5PV210 and S5PV310 it is at offset 25.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Jassi Brar July 1, 2011, 6:13 a.m. UTC | #8
On Fri, Jul 1, 2011 at 11:29 AM, padma venkat <padma.kvr@gmail.com> wrote:
> Hi Jassi,
>
> On Fri, Jul 1, 2011 at 11:22 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>> On Fri, Jul 1, 2011 at 11:16 AM, padma venkat <padma.kvr@gmail.com> wrote:
>>> Hi Tony,
>>>
>>> On Thu, Jun 30, 2011 at 4:30 PM, Tony Nadackal <tonykn@gmail.com> wrote:
>>>> Hi Padma,
>>>> With regards to your patch, even though one can check the tx done status
>>>> using the TX_DONE bit, the present macro itself would work perfectly fine if
>>>> the 'fifo_lvl_mask' is set properly.
>>>> For example in 6450 channel 1, the fifo_lvl_mask should be 0x1ff (for 9bits,
>>>> 15:23), while even in your patch, it is wrongly set as 0x7f(only 7bits).
>>>>
>>>> Thus, if this fifo_lvl_mask was defined correctly, the existing macro would
>>>> itself have worked.
>>> Thanks for your comment.
>>> I considered changing to the fifo_lvl_mask to 1ff as you mentioned.
>>> But I  think that the fifo_lvl_mask reflects the actual FIFO capacity
>>> in the SPI driver.
>>> For the failing channels the FIFO trigger level is 64 bytes and so i
>>> retained that value.
>>> In the driver it polls till the FIFO capacity level otherwise it goes
>>> for DMA.So if we keep
>>> the FIFO level as 1ff when the actual capacity is 7f then it fails.
>>>
>>> Jassi what do you think about this?
>>>
>>
>> 'fifo_lvl_mask' is h/w specific and can't be set for convenience.
>>
>> I don't have access to post-s3c64xx datasheets.
>> Please check and reply if TX_DONE bit is at same offset for all
>> channels of an SoC, because
>> I suspect it's otherwise.
>>
> Yes. The TX_DONE bit is at the same offset for all the channels of an SoC.
> in S5P64X0,S5PV210 and S5PV310 it is at offset 25.
>

Then, Patches-1,2

Acked-by: Jassi Brar <jassisinghbrar@gmail.com>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Grant Likely July 4, 2011, 6:55 a.m. UTC | #9
On Fri, Jul 01, 2011 at 11:43:08AM +0530, Jassi Brar wrote:
> On Fri, Jul 1, 2011 at 11:29 AM, padma venkat <padma.kvr@gmail.com> wrote:
> > Hi Jassi,
> >
> > On Fri, Jul 1, 2011 at 11:22 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> >> On Fri, Jul 1, 2011 at 11:16 AM, padma venkat <padma.kvr@gmail.com> wrote:
> >>> Hi Tony,
> >>>
> >>> On Thu, Jun 30, 2011 at 4:30 PM, Tony Nadackal <tonykn@gmail.com> wrote:
> >>>> Hi Padma,
> >>>> With regards to your patch, even though one can check the tx done status
> >>>> using the TX_DONE bit, the present macro itself would work perfectly fine if
> >>>> the 'fifo_lvl_mask' is set properly.
> >>>> For example in 6450 channel 1, the fifo_lvl_mask should be 0x1ff (for 9bits,
> >>>> 15:23), while even in your patch, it is wrongly set as 0x7f(only 7bits).
> >>>>
> >>>> Thus, if this fifo_lvl_mask was defined correctly, the existing macro would
> >>>> itself have worked.
> >>> Thanks for your comment.
> >>> I considered changing to the fifo_lvl_mask to 1ff as you mentioned.
> >>> But I  think that the fifo_lvl_mask reflects the actual FIFO capacity
> >>> in the SPI driver.
> >>> For the failing channels the FIFO trigger level is 64 bytes and so i
> >>> retained that value.
> >>> In the driver it polls till the FIFO capacity level otherwise it goes
> >>> for DMA.So if we keep
> >>> the FIFO level as 1ff when the actual capacity is 7f then it fails.
> >>>
> >>> Jassi what do you think about this?
> >>>
> >>
> >> 'fifo_lvl_mask' is h/w specific and can't be set for convenience.
> >>
> >> I don't have access to post-s3c64xx datasheets.
> >> Please check and reply if TX_DONE bit is at same offset for all
> >> channels of an SoC, because
> >> I suspect it's otherwise.
> >>
> > Yes. The TX_DONE bit is at the same offset for all the channels of an SoC.
> > in S5P64X0,S5PV210 and S5PV310 it is at offset 25.
> >
> 
> Then, Patches-1,2
> 
> Acked-by: Jassi Brar <jassisinghbrar@gmail.com>

Are these bug fixes that should be in v3.0, or do I queue them up for v3.1?

g.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Grant Likely July 4, 2011, 6:58 a.m. UTC | #10
On Mon, Jul 4, 2011 at 12:55 AM, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Fri, Jul 01, 2011 at 11:43:08AM +0530, Jassi Brar wrote:
>> On Fri, Jul 1, 2011 at 11:29 AM, padma venkat <padma.kvr@gmail.com> wrote:
>> > Hi Jassi,
>> >
>> > On Fri, Jul 1, 2011 at 11:22 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>> >> On Fri, Jul 1, 2011 at 11:16 AM, padma venkat <padma.kvr@gmail.com> wrote:
>> >>> Hi Tony,
>> >>>
>> >>> On Thu, Jun 30, 2011 at 4:30 PM, Tony Nadackal <tonykn@gmail.com> wrote:
>> >>>> Hi Padma,
>> >>>> With regards to your patch, even though one can check the tx done status
>> >>>> using the TX_DONE bit, the present macro itself would work perfectly fine if
>> >>>> the 'fifo_lvl_mask' is set properly.
>> >>>> For example in 6450 channel 1, the fifo_lvl_mask should be 0x1ff (for 9bits,
>> >>>> 15:23), while even in your patch, it is wrongly set as 0x7f(only 7bits).
>> >>>>
>> >>>> Thus, if this fifo_lvl_mask was defined correctly, the existing macro would
>> >>>> itself have worked.
>> >>> Thanks for your comment.
>> >>> I considered changing to the fifo_lvl_mask to 1ff as you mentioned.
>> >>> But I  think that the fifo_lvl_mask reflects the actual FIFO capacity
>> >>> in the SPI driver.
>> >>> For the failing channels the FIFO trigger level is 64 bytes and so i
>> >>> retained that value.
>> >>> In the driver it polls till the FIFO capacity level otherwise it goes
>> >>> for DMA.So if we keep
>> >>> the FIFO level as 1ff when the actual capacity is 7f then it fails.
>> >>>
>> >>> Jassi what do you think about this?
>> >>>
>> >>
>> >> 'fifo_lvl_mask' is h/w specific and can't be set for convenience.
>> >>
>> >> I don't have access to post-s3c64xx datasheets.
>> >> Please check and reply if TX_DONE bit is at same offset for all
>> >> channels of an SoC, because
>> >> I suspect it's otherwise.
>> >>
>> > Yes. The TX_DONE bit is at the same offset for all the channels of an SoC.
>> > in S5P64X0,S5PV210 and S5PV310 it is at offset 25.
>> >
>>
>> Then, Patches-1,2
>>
>> Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
>
> Are these bug fixes that should be in v3.0, or do I queue them up for v3.1?

Regardless, this one touches a lot of arch/arm files, so I'd rather
see both patches go through the samsung tree:

Acked-by: Grant Likely <grant.likely@secretlab.ca>

>
> g.
>
>
Kim Kukjin July 4, 2011, 9:54 a.m. UTC | #11
Grant Likely wrote:
> 
> On Mon, Jul 4, 2011 at 12:55 AM, Grant Likely <grant.likely@secretlab.ca>
wrote:
> > On Fri, Jul 01, 2011 at 11:43:08AM +0530, Jassi Brar wrote:
> >> On Fri, Jul 1, 2011 at 11:29 AM, padma venkat <padma.kvr@gmail.com>
wrote:
> >> > Hi Jassi,
> >> >
> >> > On Fri, Jul 1, 2011 at 11:22 AM, Jassi Brar
<jassisinghbrar@gmail.com> wrote:
> >> >> On Fri, Jul 1, 2011 at 11:16 AM, padma venkat <padma.kvr@gmail.com>
> wrote:
> >> >>> Hi Tony,
> >> >>>
> >> >>> On Thu, Jun 30, 2011 at 4:30 PM, Tony Nadackal <tonykn@gmail.com>
> wrote:
> >> >>>> Hi Padma,
> >> >>>> With regards to your patch, even though one can check the tx done
> status
> >> >>>> using the TX_DONE bit, the present macro itself would work
perfectly
> fine if
> >> >>>> the 'fifo_lvl_mask' is set properly.
> >> >>>> For example in 6450 channel 1, the fifo_lvl_mask should be 0x1ff
(for
> 9bits,
> >> >>>> 15:23), while even in your patch, it is wrongly set as 0x7f(only
7bits).
> >> >>>>
> >> >>>> Thus, if this fifo_lvl_mask was defined correctly, the existing
macro
> would
> >> >>>> itself have worked.
> >> >>> Thanks for your comment.
> >> >>> I considered changing to the fifo_lvl_mask to 1ff as you mentioned.
> >> >>> But I  think that the fifo_lvl_mask reflects the actual FIFO
capacity
> >> >>> in the SPI driver.
> >> >>> For the failing channels the FIFO trigger level is 64 bytes and so
i
> >> >>> retained that value.
> >> >>> In the driver it polls till the FIFO capacity level otherwise it
goes
> >> >>> for DMA.So if we keep
> >> >>> the FIFO level as 1ff when the actual capacity is 7f then it fails.
> >> >>>
> >> >>> Jassi what do you think about this?
> >> >>>
> >> >>
> >> >> 'fifo_lvl_mask' is h/w specific and can't be set for convenience.
> >> >>
> >> >> I don't have access to post-s3c64xx datasheets.
> >> >> Please check and reply if TX_DONE bit is at same offset for all
> >> >> channels of an SoC, because
> >> >> I suspect it's otherwise.
> >> >>
> >> > Yes. The TX_DONE bit is at the same offset for all the channels of an
SoC.
> >> > in S5P64X0,S5PV210 and S5PV310 it is at offset 25.
> >> >
> >>
> >> Then, Patches-1,2
> >>
> >> Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
> >
> > Are these bug fixes that should be in v3.0, or do I queue them up for
v3.1?
> 
> Regardless, this one touches a lot of arch/arm files, so I'd rather
> see both patches go through the samsung tree:
> 
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> 

Thanks Grant, Jassi and all,

I will apply these 1 and 2 in my -fix tree for 3.0 with your acks.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Kim Kukjin July 5, 2011, 5:51 a.m. UTC | #12
Grant Likely wrote:
> 
> On Mon, Jul 04, 2011 at 07:08:55PM +0900, Kukjin Kim wrote:
> > Kukjin Kim wrote:
> > >
> > > Thanks Grant, Jassi and all,
> > >
> > > I will apply these 1 and 2 in my -fix tree for 3.0 with your acks.
> > >
> > Oops, this needs previous 'cleanup spi platform specific code' so can't
> > apply -fix tree now.
> 
> There may also be conflicts with the heavy rework in the spi tree.
> Kgene, when you pick up this series, can you put it into a separate
> topic branch and merge that into your main tree?  That way if there
> are difficult conflicts, then I can also merge that same topic branch
> into spi/next to resolve them.
> 
Hi Grant,

Sure, no problem. I'm waiting for Padmavathi's new patch which is based on
old code not new SPI code. When I merge topic branch for this into my tree,
let you know immediately. Then if any problems, let's talk again :)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Kim Kukjin July 6, 2011, 6:22 a.m. UTC | #13
Kukjin Kim wrote:
> 
> Grant Likely wrote:
> >
> > On Mon, Jul 04, 2011 at 07:08:55PM +0900, Kukjin Kim wrote:
> > > Kukjin Kim wrote:
> > > >
> > > > Thanks Grant, Jassi and all,
> > > >
> > > > I will apply these 1 and 2 in my -fix tree for 3.0 with your acks.
> > > >
> > > Oops, this needs previous 'cleanup spi platform specific code' so
can't
> > > apply -fix tree now.
> >
> > There may also be conflicts with the heavy rework in the spi tree.
> > Kgene, when you pick up this series, can you put it into a separate
> > topic branch and merge that into your main tree?  That way if there
> > are difficult conflicts, then I can also merge that same topic branch
> > into spi/next to resolve them.
> >
> Hi Grant,
> 
> Sure, no problem. I'm waiting for Padmavathi's new patch which is based on
old
> code not new SPI code. When I merge topic branch for this into my tree,
let you
> know immediately. Then if any problems, let's talk again :)

Hi,

I made topic branch for this based on 3.0-rc6.
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
#for-spi

If any problems, please let me know :)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Grant Likely July 6, 2011, 6:30 a.m. UTC | #14
On Wed, Jul 06, 2011 at 03:22:08PM +0900, Kukjin Kim wrote:
> Kukjin Kim wrote:
> > 
> > Grant Likely wrote:
> > >
> > > On Mon, Jul 04, 2011 at 07:08:55PM +0900, Kukjin Kim wrote:
> > > > Kukjin Kim wrote:
> > > > >
> > > > > Thanks Grant, Jassi and all,
> > > > >
> > > > > I will apply these 1 and 2 in my -fix tree for 3.0 with your acks.
> > > > >
> > > > Oops, this needs previous 'cleanup spi platform specific code' so
> can't
> > > > apply -fix tree now.
> > >
> > > There may also be conflicts with the heavy rework in the spi tree.
> > > Kgene, when you pick up this series, can you put it into a separate
> > > topic branch and merge that into your main tree?  That way if there
> > > are difficult conflicts, then I can also merge that same topic branch
> > > into spi/next to resolve them.
> > >
> > Hi Grant,
> > 
> > Sure, no problem. I'm waiting for Padmavathi's new patch which is based on
> old
> > code not new SPI code. When I merge topic branch for this into my tree,
> let you
> > know immediately. Then if any problems, let's talk again :)
> 
> Hi,
> 
> I made topic branch for this based on 3.0-rc6.
> git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> #for-spi

Okay.  If there are problems, then I'll merge it.  Thanks.

g.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Kim Kukjin July 6, 2011, 7:17 a.m. UTC | #15
Grant Likely wrote:
> 
> On Wed, Jul 06, 2011 at 03:22:08PM +0900, Kukjin Kim wrote:
> > Kukjin Kim wrote:
> > >
> > > Grant Likely wrote:
> > > >
> > > > On Mon, Jul 04, 2011 at 07:08:55PM +0900, Kukjin Kim wrote:
> > > > > Kukjin Kim wrote:
> > > > > >
> > > > > > Thanks Grant, Jassi and all,
> > > > > >
> > > > > > I will apply these 1 and 2 in my -fix tree for 3.0 with your
acks.
> > > > > >
> > > > > Oops, this needs previous 'cleanup spi platform specific code' so
> > can't
> > > > > apply -fix tree now.
> > > >
> > > > There may also be conflicts with the heavy rework in the spi tree.
> > > > Kgene, when you pick up this series, can you put it into a separate
> > > > topic branch and merge that into your main tree?  That way if there
> > > > are difficult conflicts, then I can also merge that same topic
branch
> > > > into spi/next to resolve them.
> > > >
> > > Hi Grant,
> > >
> > > Sure, no problem. I'm waiting for Padmavathi's new patch which is
based on
> > old
> > > code not new SPI code. When I merge topic branch for this into my
tree,
> > let you
> > > know immediately. Then if any problems, let's talk again :)
> >
> > Hi,
> >
> > I made topic branch for this based on 3.0-rc6.
> > git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> > #for-spi
> 
> Okay.  If there are problems, then I'll merge it.  Thanks.
> 

Maybe 'If there are not problems'?

Anyway, where do you want to merge this -next or -fix? I think, this is
required for 3.0.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Grant Likely July 6, 2011, 5:30 p.m. UTC | #16
On Wed, Jul 06, 2011 at 04:17:05PM +0900, Kukjin Kim wrote:
> Grant Likely wrote:
> > 
> > On Wed, Jul 06, 2011 at 03:22:08PM +0900, Kukjin Kim wrote:
> > > Kukjin Kim wrote:
> > > >
> > > > Grant Likely wrote:
> > > > >
> > > > > On Mon, Jul 04, 2011 at 07:08:55PM +0900, Kukjin Kim wrote:
> > > > > > Kukjin Kim wrote:
> > > > > > >
> > > > > > > Thanks Grant, Jassi and all,
> > > > > > >
> > > > > > > I will apply these 1 and 2 in my -fix tree for 3.0 with your
> acks.
> > > > > > >
> > > > > > Oops, this needs previous 'cleanup spi platform specific code' so
> > > can't
> > > > > > apply -fix tree now.
> > > > >
> > > > > There may also be conflicts with the heavy rework in the spi tree.
> > > > > Kgene, when you pick up this series, can you put it into a separate
> > > > > topic branch and merge that into your main tree?  That way if there
> > > > > are difficult conflicts, then I can also merge that same topic
> branch
> > > > > into spi/next to resolve them.
> > > > >
> > > > Hi Grant,
> > > >
> > > > Sure, no problem. I'm waiting for Padmavathi's new patch which is
> based on
> > > old
> > > > code not new SPI code. When I merge topic branch for this into my
> tree,
> > > let you
> > > > know immediately. Then if any problems, let's talk again :)
> > >
> > > Hi,
> > >
> > > I made topic branch for this based on 3.0-rc6.
> > > git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
> > > #for-spi
> > 
> > Okay.  If there are problems, then I'll merge it.  Thanks.
> > 
> 
> Maybe 'If there are not problems'?

If there are no problems, then I don't need to merge the topic branch.
It is only if merge conflicts show up in linux-next that I'll need to
merge the topic branch.  (regardless, I'm expecting you to merge the
topic branch into one of your trees to actually get it into mainline
or linux-next).

g.


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
diff mbox

Patch

diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c
index 795828b..8945e20 100644
--- a/drivers/spi/spi_s3c64xx.c
+++ b/drivers/spi/spi_s3c64xx.c
@@ -116,9 +116,7 @@ 
 					(((i)->fifo_lvl_mask + 1))) \
 					? 1 : 0)
 
-#define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) & \
-					(((i)->fifo_lvl_mask + 1) << 1)) \
-					? 1 : 0)
+#define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done)) ? 1 : 0)
 #define TX_FIFO_LVL(v, i) (((v) >> 6) & (i)->fifo_lvl_mask)
 #define RX_FIFO_LVL(v, i) (((v) >> (i)->rx_lvl_offset) & (i)->fifo_lvl_mask)