All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] FSL SPI read fix.
@ 2012-09-26 21:07 Dale Smith
  2013-06-12 19:02 ` [U-Boot] " Jagan Teki
  0 siblings, 1 reply; 9+ messages in thread
From: Dale Smith @ 2012-09-26 21:07 UTC (permalink / raw)
  To: u-boot

The fsl spi engine is non functional when reading from a device.  This
patch fixes it.

Note that none of the other spi interfaces parse through the
datastream looking for 0x0b bytes.

-Dale

diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
index a1ebd33..737719b 100644
--- a/drivers/spi/fsl_espi.c
+++ b/drivers/spi/fsl_espi.c
@@ -291,17 +291,10 @@ int spi_xfer(struct spi_slave *slave, unsigned
int bitlen, const void *data_out,
 				debug("***spi_xfer:...%08x readed\n", tmpdin);
 			}
 		}
-		if (data_in) {
-			memcpy(data_in, buffer + 2 * cmd_len, tran_len);
-			if (*buffer == 0x0b) {
-				data_in += tran_len;
-				data_len -= tran_len;
-				*(int *)buffer += tran_len;
-			}
-		}
 		spi_cs_deactivate(slave);
 	}
-
+	if (data_in)
+		memcpy(data_in, buffer + rx_offset, len);
 	free(buffer);
 	return 0;
 }

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

* [U-Boot] FSL SPI read fix.
  2012-09-26 21:07 [U-Boot] [PATCH] FSL SPI read fix Dale Smith
@ 2013-06-12 19:02 ` Jagan Teki
  2013-06-12 21:54   ` [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified Dale P. Smith
  0 siblings, 1 reply; 9+ messages in thread
From: Jagan Teki @ 2013-06-12 19:02 UTC (permalink / raw)
  To: u-boot

Hi,

Can you please update the commit header and logic of the code
w.r.t current master tree.

also please use proper commit body.

--
Thanks,
Jagan.

On 27-09-2012 02:37, Dale Smith wrote:
> The fsl spi engine is non functional when reading from a device.  This
> patch fixes it.
>
> Note that none of the other spi interfaces parse through the
> datastream looking for 0x0b bytes.
>
> -Dale
>
>   }
>
>
> diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
> index a1ebd33..737719b 100644
> --- a/drivers/spi/fsl_espi.c
> +++ b/drivers/spi/fsl_espi.c
> @@ -291,17 +291,10 @@ int spi_xfer(struct spi_slave *slave, unsigned
> int bitlen, const void *data_out,
>   				debug("***spi_xfer:...%08x readed\n", tmpdin);
>   			}
>   		}
> -		if (data_in) {
> -			memcpy(data_in, buffer + 2 * cmd_len, tran_len);
> -			if (*buffer == 0x0b) {
> -				data_in += tran_len;
> -				data_len -= tran_len;
> -				*(int *)buffer += tran_len;
> -			}
> -		}
>   		spi_cs_deactivate(slave);
>   	}
> -
> +	if (data_in)
> +		memcpy(data_in, buffer + rx_offset, len);
>   	free(buffer);
>   	return 0;
>

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

* [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified.
  2013-06-12 19:02 ` [U-Boot] " Jagan Teki
@ 2013-06-12 21:54   ` Dale P. Smith
  2013-06-13  2:39     ` Jagan Teki
  2015-12-12  2:19     ` [U-Boot] [PATCH v3] spi: fsl_espi: " Dale P. Smith
  0 siblings, 2 replies; 9+ messages in thread
From: Dale P. Smith @ 2013-06-12 21:54 UTC (permalink / raw)
  To: u-boot


Signed-off-by: Dale P. Smith <dsmith@vtiinstruments.com>
---
 drivers/spi/fsl_espi.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
index 28609ee..bd9dc64 100644
--- a/drivers/spi/fsl_espi.c
+++ b/drivers/spi/fsl_espi.c
@@ -287,17 +287,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
 				debug("***spi_xfer:...%08x readed\n", tmpdin);
 			}
 		}
-		if (data_in) {
-			memcpy(data_in, buffer + 2 * cmd_len, tran_len);
-			if (*buffer == 0x0b) {
-				data_in += tran_len;
-				data_len -= tran_len;
-				*(int *)buffer += tran_len;
-			}
-		}
 		spi_cs_deactivate(slave);
 	}
 
+	if (data_in)
+		memcpy(data_in, buffer + rx_offset, len);
 	free(buffer);
 	return 0;
 }
-- 
1.7.2.5

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

* [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified.
  2013-06-12 21:54   ` [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified Dale P. Smith
@ 2013-06-13  2:39     ` Jagan Teki
  2013-06-13  9:09       ` Albert ARIBAUD
  2015-12-12  2:19     ` [U-Boot] [PATCH v3] spi: fsl_espi: " Dale P. Smith
  1 sibling, 1 reply; 9+ messages in thread
From: Jagan Teki @ 2013-06-13  2:39 UTC (permalink / raw)
  To: u-boot

Hi,

Thanks for sending this.

Few comments.
1. Please use subject prefix with version number this case it should
be "PATH v3"
2. Commit header should be stand' one as all follows.
    " spi: fsl_espi:   "

On Thu, Jun 13, 2013 at 3:24 AM, Dale P. Smith
<dsmith@vtiinstruments.com> wrote:
>
> Signed-off-by: Dale P. Smith <dsmith@vtiinstruments.com>
> ---
>  drivers/spi/fsl_espi.c |   10 ++--------
>  1 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
> index 28609ee..bd9dc64 100644
> --- a/drivers/spi/fsl_espi.c
> +++ b/drivers/spi/fsl_espi.c
> @@ -287,17 +287,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
>                                 debug("***spi_xfer:...%08x readed\n", tmpdin);
>                         }
>                 }
> -               if (data_in) {
> -                       memcpy(data_in, buffer + 2 * cmd_len, tran_len);
> -                       if (*buffer == 0x0b) {
> -                               data_in += tran_len;
> -                               data_len -= tran_len;
> -                               *(int *)buffer += tran_len;
> -                       }
> -               }
>                 spi_cs_deactivate(slave);
>         }
>
> +       if (data_in)
> +               memcpy(data_in, buffer + rx_offset, len);
>         free(buffer);
>         return 0;

Have tested this recently?

Thanks,
Jagan.

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

* [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified.
  2013-06-13  2:39     ` Jagan Teki
@ 2013-06-13  9:09       ` Albert ARIBAUD
  2013-06-13  9:22         ` Jagan Teki
  0 siblings, 1 reply; 9+ messages in thread
From: Albert ARIBAUD @ 2013-06-13  9:09 UTC (permalink / raw)
  To: u-boot

Hi Jagan, Dale,

On Thu, 13 Jun 2013 08:09:04 +0530, Jagan Teki
<jagannadh.teki@gmail.com> wrote:

> Hi,
> 
> Thanks for sending this.
> 
> Few comments.
> 1. Please use subject prefix with version number this case it should
> be "PATH v3"

Plus if it is v3, then it should have patch history too.

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified.
  2013-06-13  9:09       ` Albert ARIBAUD
@ 2013-06-13  9:22         ` Jagan Teki
  0 siblings, 0 replies; 9+ messages in thread
From: Jagan Teki @ 2013-06-13  9:22 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 13, 2013 at 2:39 PM, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:
> Hi Jagan, Dale,
>
> On Thu, 13 Jun 2013 08:09:04 +0530, Jagan Teki
> <jagannadh.teki@gmail.com> wrote:
>
>> Hi,
>>
>> Thanks for sending this.
>>
>> Few comments.
>> 1. Please use subject prefix with version number this case it should
>> be "PATH v3"
>
> Plus if it is v3, then it should have patch history too.
>

Thanks Amicalement,

Hi Dale,

Please refer these 3 points for sending your v3.
I am just pointing to a link for sending version patches ignore this
if you know it already
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

--
Thanks,
Jagan.

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

* [U-Boot] [PATCH v3] spi: fsl_espi: Return all data read from device unmodified
  2013-06-12 21:54   ` [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified Dale P. Smith
  2013-06-13  2:39     ` Jagan Teki
@ 2015-12-12  2:19     ` Dale P. Smith
  2015-12-12 17:10       ` Joakim Tjernlund
  1 sibling, 1 reply; 9+ messages in thread
From: Dale P. Smith @ 2015-12-12  2:19 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Dale P. Smith <dsmith@vtiinstruments.com>
---
Changes for v2:
   - First attempt at using git format-patch
Changes for v3:
   - Fix subject.
   - Add changelog

 drivers/spi/fsl_espi.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
index b1586d1..c84a7ea 100644
--- a/drivers/spi/fsl_espi.c
+++ b/drivers/spi/fsl_espi.c
@@ -345,17 +345,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
 				}
 			}
 		}
-		if (data_in) {
-			memcpy(data_in, buffer + 2 * cmd_len, tran_len);
-			if (*buffer == 0x0b) {
-				data_in += tran_len;
-				data_len -= tran_len;
-				*(int *)buffer += tran_len;
-			}
-		}
 		spi_cs_deactivate(slave);
 	}
 
+	if (data_in)
+		memcpy(data_in, buffer + rx_offset, len);
 	free(buffer);
 	return 0;
 }
-- 
2.1.4

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

* [U-Boot] [PATCH v3] spi: fsl_espi: Return all data read from device unmodified
  2015-12-12  2:19     ` [U-Boot] [PATCH v3] spi: fsl_espi: " Dale P. Smith
@ 2015-12-12 17:10       ` Joakim Tjernlund
  2015-12-14  7:01         ` Jagan Teki
  0 siblings, 1 reply; 9+ messages in thread
From: Joakim Tjernlund @ 2015-12-12 17:10 UTC (permalink / raw)
  To: u-boot

On Fri, 2015-12-11 at 21:19 -0500, Dale P. Smith wrote:
> Signed-off-by: Dale P. Smith <dsmith@vtiinstruments.com>
> ---
> Changes for v2:
> ???- First attempt at using git format-patch
> Changes for v3:
> ???- Fix subject.
> ???- Add changelog

While this is a step in the right direction, this driver needs a rewrite.
- The malloc/memcpy crap need to go.
- TXing 4 bytes a time while while word size is still one byte makes Not full/Not empty
? HW flags useless.
There is no real maintainer of this driver though so I am afraid nobody will do make this happen.

> 
> ?drivers/spi/fsl_espi.c | 10 ++--------
> ?1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
> index b1586d1..c84a7ea 100644
> --- a/drivers/spi/fsl_espi.c
> +++ b/drivers/spi/fsl_espi.c
> @@ -345,17 +345,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
> ?				}
> ?			}
> ?		}
> -		if (data_in) {
> -			memcpy(data_in, buffer + 2 * cmd_len, tran_len);
> -			if (*buffer == 0x0b) {
> -				data_in += tran_len;
> -				data_len -= tran_len;
> -				*(int *)buffer += tran_len;
> -			}
> -		}
> ?		spi_cs_deactivate(slave);
> ?	}
> ?
> +	if (data_in)
> +		memcpy(data_in, buffer + rx_offset, len);
> ?	free(buffer);
> ?	return 0;
> ?}

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

* [U-Boot] [PATCH v3] spi: fsl_espi: Return all data read from device unmodified
  2015-12-12 17:10       ` Joakim Tjernlund
@ 2015-12-14  7:01         ` Jagan Teki
  0 siblings, 0 replies; 9+ messages in thread
From: Jagan Teki @ 2015-12-14  7:01 UTC (permalink / raw)
  To: u-boot

On 12 December 2015 at 22:40, Joakim Tjernlund
<Joakim.Tjernlund@infinera.com> wrote:
> On Fri, 2015-12-11 at 21:19 -0500, Dale P. Smith wrote:
>> Signed-off-by: Dale P. Smith <dsmith@vtiinstruments.com>
>> ---
>> Changes for v2:
>>    - First attempt at using git format-patch
>> Changes for v3:
>>    - Fix subject.
>>    - Add changelog
>
> While this is a step in the right direction, this driver needs a rewrite.
> - The malloc/memcpy crap need to go.
> - TXing 4 bytes a time while while word size is still one byte makes Not full/Not empty
>   HW flags useless.
> There is no real maintainer of this driver though so I am afraid nobody will do make this happen.

Please try to write it in driver model format, let me know for any help.

thanks!
-- 
Jagan.

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

end of thread, other threads:[~2015-12-14  7:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-26 21:07 [U-Boot] [PATCH] FSL SPI read fix Dale Smith
2013-06-12 19:02 ` [U-Boot] " Jagan Teki
2013-06-12 21:54   ` [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified Dale P. Smith
2013-06-13  2:39     ` Jagan Teki
2013-06-13  9:09       ` Albert ARIBAUD
2013-06-13  9:22         ` Jagan Teki
2015-12-12  2:19     ` [U-Boot] [PATCH v3] spi: fsl_espi: " Dale P. Smith
2015-12-12 17:10       ` Joakim Tjernlund
2015-12-14  7:01         ` Jagan Teki

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.