[SPAM] Important Notice Regarding Your Website

2012-08-01 Thread Network Solution
Upon reviewing your account, we noticed that your website is not listed first 
on Google, Yahoo, Bing or any other search engine.
This may be costing you sales and website traffic, so we wanted to bring this 
to your attention.

Please give me a call at 1 (800) 455-8040 to discuss how we can get you first 
on many keywords related to your business.

Thank you for your prompt attention to this matter.

Shane Epperson
Network Traffic Coordinator
Best Page Rankings
1 (800) 455-8040
bestpager...@gmx.com




















Click This Link to Stop Future Messages 




--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Profitez de 50% de réduction* pour retrouver la ligne avec Weight Watchers

2012-08-01 Thread Weight Watchers par Duano
Pour voir le message, veuillez utiliser un lecteur de mail compatible HTML

Lien miroir : 
http://m10-fr.com/mc10_m/YT0xMyZiPTE3MjY1JmM9NDgzNjEyJmQ9MjAxMi0wOC0wMiAwMDozMDowMSZlPTEmaD0xNzI2NCZmPTE3MjY1Jmc9MTcyNjU=

Lien de désinscription : 
http://m10-fr.com/mc10_unsub/YT0xMyZiPTE3MjY1JmM9NDgzNjEyJmQ9MjAxMi0wOC0wMiAwMDozMDowMSZlPTEmaD0xNzI2NCZmPTE3MjY1Jmc9MTcyNjU=


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Soldes jusqu'à -60 pour cent sur la mode Femme

2012-08-01 Thread Lulu Castagnette par Duano
Pour voir le message, veuillez utiliser un lecteur de mail compatible HTML

Lien miroir : 
http://m10-fr.com/mc10_m/YT0xMyZiPTE3MjYxJmM9NDgzNjEyJmQ9MjAxMi0wOC0wMiAwMDozMDowMSZlPTEmaD0xNzI2MCZmPTE3MjYxJmc9MTcyNjE=

Lien de désinscription : 
http://m10-fr.com/mc10_unsub/YT0xMyZiPTE3MjYxJmM9NDgzNjEyJmQ9MjAxMi0wOC0wMiAwMDozMDowMSZlPTEmaD0xNzI2MCZmPTE3MjYxJmc9MTcyNjE=


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Fais des rencontres sans sortir ta carte bancaire

2012-08-01 Thread Service rencontre par Duano
Pour voir le message, veuillez utiliser un lecteur de mail compatible HTML

Lien miroir : 
http://m10-fr.com/mc10_m/YT0xMyZiPTE3MjYyJmM9NDgzNjEyJmQ9MjAxMi0wOC0wMiAwMDoyMDowMSZlPTEmaD0xNzI2MSZmPTE3MjYyJmc9MTcyNjI=

Lien de désinscription : 
http://m10-fr.com/mc10_unsub/YT0xMyZiPTE3MjYyJmM9NDgzNjEyJmQ9MjAxMi0wOC0wMiAwMDoyMDowMSZlPTEmaD0xNzI2MSZmPTE3MjYyJmc9MTcyNjI=


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 1/2] SPI: spi-gpio: store chipselect information in private structure

2012-08-01 Thread Daniel Mack
On 01.08.2012 22:51, Mark Brown wrote:
> On Wed, Aug 01, 2012 at 10:45:19PM +0200, Daniel Mack wrote:
> 
>> could you have another look at these patches maybe? They aren't urgent,
>> I just want to avoid the get lost.
> 
> Can you please resend them with me in the CCs?  My process for handling
> patches is very heavily based on my inbox.
> 

Sure. This time, I added you, Grant and Linus W to the patch using Cc:
lines. Let's see if that works better :)


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


[PATCH resend 2/2] SPI: spi-gpio: Add DT bindings

2012-08-01 Thread Daniel Mack
This patch adds DT bindings to the spi-gpio driver and some
documentation about how to use it.

Signed-off-by: Daniel Mack 
Cc: Mark Brown 
Cc: Grant Likely 
Cc: Linus Walleij 
---
 Documentation/devicetree/bindings/spi/spi-gpio.txt | 29 +++
 drivers/spi/spi-gpio.c | 99 +-
 2 files changed, 125 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-gpio.txt

diff --git a/Documentation/devicetree/bindings/spi/spi-gpio.txt 
b/Documentation/devicetree/bindings/spi/spi-gpio.txt
new file mode 100644
index 000..8a824be
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-gpio.txt
@@ -0,0 +1,29 @@
+SPI-GPIO devicetree bindings
+
+Required properties:
+
+ - compatible: should be set to "spi-gpio"
+ - #address-cells: should be set to <0x1>
+ - ranges
+ - gpio-sck: GPIO spec for the SCK line to use
+ - gpio-miso: GPIO spec for the MISO line to use
+ - gpio-mosi: GPIO spec for the MOSI line to use
+ - cs-gpios: GPIOs to use for chipselect lines
+ - num-chipselects: number of chipselect lines
+
+Example:
+
+   spi {
+   compatible = "spi-gpio";
+   #address-cells = <0x1>;
+   ranges;
+
+   gpio-sck = <&gpio 95 0>;
+   gpio-miso = <&gpio 98 0>;
+   gpio-mosi = <&gpio 97 0>;
+   cs-gpios = <&gpio 125 0>;
+   num-chipselects = <1>;
+
+   /* clients */
+   };
+
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index ff7263c..aed1615 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -22,6 +22,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -232,13 +234,27 @@ static void spi_gpio_chipselect(struct spi_device *spi, 
int is_active)
 
 static int spi_gpio_setup(struct spi_device *spi)
 {
-   unsigned intcs = (unsigned int) spi->controller_data;
+   unsigned intcs;
int status = 0;
struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi);
+   struct device_node  *np = spi->master->dev.of_node;
 
if (spi->bits_per_word > 32)
return -EINVAL;
 
+   if (np) {
+   /*
+* In DT environments, the CS GPIOs have already been
+* initialized from the "cs-gpios" property of the node.
+*/
+   cs = spi_gpio->cs_gpios[spi->chip_select];
+   } else {
+   /*
+* ... otherwise, take it from spi->controller_data
+*/
+   cs = (unsigned int) spi->controller_data;
+   }
+
if (!spi->controller_state) {
if (cs != SPI_GPIO_NO_CHIPSELECT) {
status = gpio_request(cs, dev_name(&spi->dev));
@@ -250,6 +266,7 @@ static int spi_gpio_setup(struct spi_device *spi)
}
if (!status) {
status = spi_bitbang_setup(spi);
+   /* in case it was initialized from static board data */
spi_gpio->cs_gpios[spi->chip_select] = cs;
}
 
@@ -326,6 +343,55 @@ done:
return value;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id spi_gpio_dt_ids[] = {
+   { .compatible = "spi-gpio" },
+   {}
+};
+MODULE_DEVICE_TABLE(of, spi_gpio_dt_ids);
+
+static int spi_gpio_probe_dt(struct platform_device *pdev)
+{
+   int ret;
+   u32 tmp;
+   struct spi_gpio_platform_data   *pdata;
+   struct device_node *np = pdev->dev.of_node;
+   const struct of_device_id *of_id =
+   of_match_device(spi_gpio_dt_ids, &pdev->dev);
+
+   if (!of_id)
+   return 0;
+
+   pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   return -ENOMEM;
+
+   pdata->sck = of_get_named_gpio(np, "gpio-sck", 0);
+   pdata->miso = of_get_named_gpio(np, "gpio-miso", 0);
+   pdata->mosi = of_get_named_gpio(np, "gpio-mosi", 0);
+
+   ret = of_property_read_u32(np, "num-chipselects", &tmp);
+   if (ret < 0) {
+   dev_err(&pdev->dev, "num-chipselects property not found\n");
+   goto error_free;
+   }
+
+   pdata->num_chipselect = tmp;
+   pdev->dev.platform_data = pdata;
+
+   return 1;
+
+error_free:
+   devm_kfree(&pdev->dev, pdata);
+   return ret;
+}
+#else
+static inline int spi_probe_dt(struct platform_device *)
+{
+   return 0;
+}
+#endif
+
 static int __devinit spi_gpio_probe(struct platform_device *pdev)
 {
int status;
@@ -333,6 +399,13 @@ static int __devinit spi_gpio_probe(struct platform_device 
*pdev)
struct spi_gpio *spi_gpio;
struct spi_gpio_platform_data   *pdata;
u16 master_flags = 0;
+   bool use_of = 0;
+
+   status = spi_gpio_probe_dt(pdev);
+   if (status < 0)
+   return status;
+   if (status > 0

[PATCH resend 1/2] SPI: spi-gpio: store chipselect information in private structure

2012-08-01 Thread Daniel Mack
The spi-gpio driver currently assumes the chipselect gpio number is
stored in ->controller_data of the device's static board information.

In devicetree environments, this information is unavailable and has to
be derived from the DT node.

This patch moves the gpio storage to the controller's private data so
the DT bindings can easily build upon the driver.

Signed-off-by: Daniel Mack 
Cc: Mark Brown 
Cc: Grant Likely 
Cc: Linus Walleij 
---
 drivers/spi/spi-gpio.c | 34 --
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index 0b56cfc..ff7263c 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -46,6 +46,7 @@ struct spi_gpio {
struct spi_bitbang  bitbang;
struct spi_gpio_platform_data   pdata;
struct platform_device  *pdev;
+   int cs_gpios[0];
 };
 
 /*--*/
@@ -89,15 +90,21 @@ struct spi_gpio {
 
 /*--*/
 
-static inline const struct spi_gpio_platform_data * __pure
-spi_to_pdata(const struct spi_device *spi)
+static inline struct spi_gpio * __pure
+spi_to_spi_gpio(const struct spi_device *spi)
 {
const struct spi_bitbang*bang;
-   const struct spi_gpio   *spi_gpio;
+   struct spi_gpio *spi_gpio;
 
bang = spi_master_get_devdata(spi->master);
spi_gpio = container_of(bang, struct spi_gpio, bitbang);
-   return &spi_gpio->pdata;
+   return spi_gpio;
+}
+
+static inline struct spi_gpio_platform_data * __pure
+spi_to_pdata(const struct spi_device *spi)
+{
+   return &spi_to_spi_gpio(spi)->pdata;
 }
 
 /* this is #defined to avoid unused-variable warnings when inlining */
@@ -210,7 +217,8 @@ static u32 spi_gpio_spec_txrx_word_mode3(struct spi_device 
*spi,
 
 static void spi_gpio_chipselect(struct spi_device *spi, int is_active)
 {
-   unsigned long cs = (unsigned long) spi->controller_data;
+   struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi);
+   unsigned int cs = spi_gpio->cs_gpios[spi->chip_select];
 
/* set initial clock polarity */
if (is_active)
@@ -224,8 +232,9 @@ static void spi_gpio_chipselect(struct spi_device *spi, int 
is_active)
 
 static int spi_gpio_setup(struct spi_device *spi)
 {
-   unsigned long   cs = (unsigned long) spi->controller_data;
-   int status = 0;
+   unsigned intcs = (unsigned int) spi->controller_data;
+   int status = 0;
+   struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi);
 
if (spi->bits_per_word > 32)
return -EINVAL;
@@ -239,8 +248,11 @@ static int spi_gpio_setup(struct spi_device *spi)
!(spi->mode & SPI_CS_HIGH));
}
}
-   if (!status)
+   if (!status) {
status = spi_bitbang_setup(spi);
+   spi_gpio->cs_gpios[spi->chip_select] = cs;
+   }
+
if (status) {
if (!spi->controller_state && cs != SPI_GPIO_NO_CHIPSELECT)
gpio_free(cs);
@@ -250,7 +262,8 @@ static int spi_gpio_setup(struct spi_device *spi)
 
 static void spi_gpio_cleanup(struct spi_device *spi)
 {
-   unsigned long   cs = (unsigned long) spi->controller_data;
+   struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi);
+   unsigned int cs = spi_gpio->cs_gpios[spi->chip_select];
 
if (cs != SPI_GPIO_NO_CHIPSELECT)
gpio_free(cs);
@@ -331,7 +344,8 @@ static int __devinit spi_gpio_probe(struct platform_device 
*pdev)
if (status < 0)
return status;
 
-   master = spi_alloc_master(&pdev->dev, sizeof *spi_gpio);
+   master = spi_alloc_master(&pdev->dev, sizeof(*spi_gpio) +
+   (sizeof(int) * SPI_N_CHIPSEL));
if (!master) {
status = -ENOMEM;
goto gpio_free;
-- 
1.7.11.2


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 1/2] SPI: spi-gpio: store chipselect information in private structure

2012-08-01 Thread Mark Brown
On Wed, Aug 01, 2012 at 10:45:19PM +0200, Daniel Mack wrote:

> could you have another look at these patches maybe? They aren't urgent,
> I just want to avoid the get lost.

Can you please resend them with me in the CCs?  My process for handling
patches is very heavily based on my inbox.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 1/2] SPI: spi-gpio: store chipselect information in private structure

2012-08-01 Thread Daniel Mack
Mark,

could you have another look at these patches maybe? They aren't urgent,
I just want to avoid the get lost.

Thanks for your time,
Daniel


On 25.07.2012 13:44, Daniel Mack wrote:
> The spi-gpio driver currently assumes the chipselect gpio number is
> stored in ->controller_data of the device's static board information.
> 
> In devicetree environments, this information is unavailable and has to
> be derived from the DT node.
> 
> This patch moves the gpio storage to the controller's private data so
> the DT bindings can easily build upon the driver.
> 
> Signed-off-by: Daniel Mack 
> ---
>  drivers/spi/spi-gpio.c |   34 --
>  1 file changed, 24 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
> index 0094c64..e79e311 100644
> --- a/drivers/spi/spi-gpio.c
> +++ b/drivers/spi/spi-gpio.c
> @@ -46,6 +46,7 @@ struct spi_gpio {
>   struct spi_bitbang  bitbang;
>   struct spi_gpio_platform_data   pdata;
>   struct platform_device  *pdev;
> + int cs_gpios[0];
>  };
>  
>  /*--*/
> @@ -89,15 +90,21 @@ struct spi_gpio {
>  
>  /*--*/
>  
> -static inline const struct spi_gpio_platform_data * __pure
> -spi_to_pdata(const struct spi_device *spi)
> +static inline struct spi_gpio * __pure
> +spi_to_spi_gpio(const struct spi_device *spi)
>  {
>   const struct spi_bitbang*bang;
> - const struct spi_gpio   *spi_gpio;
> + struct spi_gpio *spi_gpio;
>  
>   bang = spi_master_get_devdata(spi->master);
>   spi_gpio = container_of(bang, struct spi_gpio, bitbang);
> - return &spi_gpio->pdata;
> + return spi_gpio;
> +}
> +
> +static inline struct spi_gpio_platform_data * __pure
> +spi_to_pdata(const struct spi_device *spi)
> +{
> + return &spi_to_spi_gpio(spi)->pdata;
>  }
>  
>  /* this is #defined to avoid unused-variable warnings when inlining */
> @@ -210,7 +217,8 @@ static u32 spi_gpio_spec_txrx_word_mode3(struct 
> spi_device *spi,
>  
>  static void spi_gpio_chipselect(struct spi_device *spi, int is_active)
>  {
> - unsigned long cs = (unsigned long) spi->controller_data;
> + struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi);
> + unsigned int cs = spi_gpio->cs_gpios[spi->chip_select];
>  
>   /* set initial clock polarity */
>   if (is_active)
> @@ -224,8 +232,9 @@ static void spi_gpio_chipselect(struct spi_device *spi, 
> int is_active)
>  
>  static int spi_gpio_setup(struct spi_device *spi)
>  {
> - unsigned long   cs = (unsigned long) spi->controller_data;
> - int status = 0;
> + unsigned intcs = (unsigned int) spi->controller_data;
> + int status = 0;
> + struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi);
>  
>   if (spi->bits_per_word > 32)
>   return -EINVAL;
> @@ -238,8 +247,11 @@ static int spi_gpio_setup(struct spi_device *spi)
>   status = gpio_direction_output(cs, spi->mode & 
> SPI_CS_HIGH);
>   }
>   }
> - if (!status)
> + if (!status) {
>   status = spi_bitbang_setup(spi);
> + spi_gpio->cs_gpios[spi->chip_select] = cs;
> + }
> +
>   if (status) {
>   if (!spi->controller_state && cs != SPI_GPIO_NO_CHIPSELECT)
>   gpio_free(cs);
> @@ -249,7 +261,8 @@ static int spi_gpio_setup(struct spi_device *spi)
>  
>  static void spi_gpio_cleanup(struct spi_device *spi)
>  {
> - unsigned long   cs = (unsigned long) spi->controller_data;
> + struct spi_gpio *spi_gpio = spi_to_spi_gpio(spi);
> + unsigned int cs = spi_gpio->cs_gpios[spi->chip_select];
>  
>   if (cs != SPI_GPIO_NO_CHIPSELECT)
>   gpio_free(cs);
> @@ -330,7 +343,8 @@ static int __devinit spi_gpio_probe(struct 
> platform_device *pdev)
>   if (status < 0)
>   return status;
>  
> - master = spi_alloc_master(&pdev->dev, sizeof *spi_gpio);
> + master = spi_alloc_master(&pdev->dev, sizeof(*spi_gpio) +
> + (sizeof(int) * SPI_N_CHIPSEL));
>   if (!master) {
>   status = -ENOMEM;
>   goto gpio_free;
> 


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 08/10 RESEND] spi: Add DMA support into SPI driver

2012-08-01 Thread Mark Brown
On Mon, Jul 23, 2012 at 10:40:50PM +0200, Marek Vasut wrote:

> + /*
> +  * Small blocks can be transfered via PIO.
> +  * Measured by empiric means:
> +  *
> +  * dd if=/dev/mtdblock0 of=/dev/null bs=1024k count=1
> +  *
> +  * DMA only: 2.164808 seconds, 473.0KB/s
> +  * Combined: 1.676276 seconds, 610.9KB/s
> +  */

I've seen other devices end up using the FIFO length as the decision
point here which makes intuitive sense to me unless the FIFO is
extremely deep.

Not reviewed this properly yet but it looks OK from a first read
through.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH 06/10 V2] spi: Add SPI driver for mx233/mx28

2012-08-01 Thread Mark Brown
On Mon, Jul 23, 2012 at 10:40:48PM +0200, Marek Vasut wrote:

> This is slightly reworked version of the SPI driver.
> Support for DT has been added and it's been converted
> to queued API.

Looks reasonable overall.

> + bits_per_word = dev->bits_per_word;
> + if (t && t->bits_per_word)
> + bits_per_word = t->bits_per_word;
> +
> + if (bits_per_word != 8) {
> + dev_err(&dev->dev, "%s, unsupported bits_per_word=%d\n",
> + __func__, bits_per_word);
> + return -EINVAL;
> + }

> + if (dev->max_speed_hz)
> + hz = dev->max_speed_hz;
> + if (t && t->speed_hz)
> + hz = t->speed_hz;
> + if (hz == 0) {
> + dev_err(&dev->dev, "Cannot continue with zero clock\n");
> + return -EINVAL;
> + }

These two blocks use a different style (the first does the first assign
unconditionally, the second uses initialisation with declaration).  I
prefer the first style but YMMV and it doesn't matter.

For the missing clock rate might it make sense to just use whatever the
clock happens to come out as?

> +static void mxs_spi_cleanup(struct spi_device *dev)
> +{
> + return;
> +}

Empty functions are generally a warning sign...  why do we need this
one?

> +static int __devexit mxs_spi_remove(struct platform_device *pdev)
> +{

> + clk_disable_unprepare(ssp->clk);

It'd be nice to only keep the clocks enabled while doing transfers but
again totally non-essential.

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [PATCH] spi: omap2-mcspi: Fix the error handling in probe

2012-08-01 Thread Guenter Roeck
On Wed, Aug 01, 2012 at 03:06:28PM +0530, Shubhrajyoti D wrote:
> The kfree() is taken care of by the spi core (spi_master_release() function)
> that is called once the last reference to the underlying struct device has
> been released. So the driver need not call kfree.
> 
> Also the put was missed in some of the error handling fix the same.
> There by fixing the missing device_put in some of the error paths.
> 
> Cc: Guenter Roeck 

Reported-by: may be better here.

> Signed-off-by: Shubhrajyoti D 

Acked-by: Guenter Roeck 

I suspect that "spi_master_put(master);" may also be missing in
omap2_mcspi_remove(), but we'll need someone to confirm that.

Thanks,
Guenter

> ---
>  drivers/spi/spi-omap2-mcspi.c |6 ++
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
> index 7d46b15..b5035e2 100644
> --- a/drivers/spi/spi-omap2-mcspi.c
> +++ b/drivers/spi/spi-omap2-mcspi.c
> @@ -1203,18 +1203,16 @@ static int __devinit omap2_mcspi_probe(struct 
> platform_device *pdev)
>  
>   status = spi_register_master(master);
>   if (status < 0)
> - goto err_spi_register;
> + goto disable_pm;
>  
>   return status;
>  
> -err_spi_register:
> - spi_master_put(master);
>  disable_pm:
>   pm_runtime_disable(&pdev->dev);
>  dma_chnl_free:
>   kfree(mcspi->dma_channels);
>  free_master:
> - kfree(master);
> + spi_master_put(master);
>   platform_set_drvdata(pdev, NULL);
>   return status;
>  }
> -- 
> 1.7.5.4
> 
> 

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-08-01 Thread Guenter Roeck
On Wed, Aug 01, 2012 at 03:50:12PM +0800, Shawn Guo wrote:
> On Tue, Jul 31, 2012 at 11:56:50PM -0700, Guenter Roeck wrote:
> > Guess we are in violent agreement. The sequence would then either be
> > master = spi_alloc_device();
> 
> The discussion is around spi_alloc_master rather than spi_alloc_device,
> isn't it?
> 
Yes, sorry. Too late at night, too tired :(.

Guenter

> Regards,
> Shawn
> 
> > ...
> > spi_master_put(master);
> > or
> > master = spi_alloc_device();
> > ...
> > kfree(master);
> > 
> > which makes sense to me. Question still is why most drivers neither call 
> > kfree()
> > nor spi_master_put() in the remove function.
> 
> 

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


[PATCH] spi: omap2-mcspi: Fix the error handling in probe

2012-08-01 Thread Shubhrajyoti D
The kfree() is taken care of by the spi core (spi_master_release() function)
that is called once the last reference to the underlying struct device has
been released. So the driver need not call kfree.

Also the put was missed in some of the error handling fix the same.
There by fixing the missing device_put in some of the error paths.

Cc: Guenter Roeck 
Signed-off-by: Shubhrajyoti D 
---
 drivers/spi/spi-omap2-mcspi.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 7d46b15..b5035e2 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1203,18 +1203,16 @@ static int __devinit omap2_mcspi_probe(struct 
platform_device *pdev)
 
status = spi_register_master(master);
if (status < 0)
-   goto err_spi_register;
+   goto disable_pm;
 
return status;
 
-err_spi_register:
-   spi_master_put(master);
 disable_pm:
pm_runtime_disable(&pdev->dev);
 dma_chnl_free:
kfree(mcspi->dma_channels);
 free_master:
-   kfree(master);
+   spi_master_put(master);
platform_set_drvdata(pdev, NULL);
return status;
 }
-- 
1.7.5.4


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-08-01 Thread Shawn Guo
On Wed, Aug 01, 2012 at 09:38:07AM +0200, Lothar Waßmann wrote:
> Shawn Guo writes:
> > On Wed, Aug 01, 2012 at 08:45:19AM +0200, Marek Vasut wrote:
> > > > I must be missing something.  Why do almost all spi drivers call it in 
> > > > the
> > > > error path, even if there is no call to spi_master_get ?
> > > 
> > > To push the refcounting to 0, to deallocate the device, I'd say ...
> > > 
> > It's not going to work if spi_master_put is called without
> > spi_master_get being called before that.
> > 
> spi_alloc_master() calls device_initialize() which resuires a
> device_put() (called from spi_master_put()) to free the device.
> 
Ah, indeed.  I missed that kref_init() will initialize the refcount
to 1.

Thanks,
Shawn


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-08-01 Thread Lothar Waßmann
Shawn Guo writes:
> On Wed, Aug 01, 2012 at 08:45:19AM +0200, Marek Vasut wrote:
> > > I must be missing something.  Why do almost all spi drivers call it in the
> > > error path, even if there is no call to spi_master_get ?
> > 
> > To push the refcounting to 0, to deallocate the device, I'd say ...
> > 
> It's not going to work if spi_master_put is called without
> spi_master_get being called before that.
> 
spi_alloc_master() calls device_initialize() which resuires a
device_put() (called from spi_master_put()) to free the device.

Thus each call of either spi_alloc_master() or spi_master_get() must
be paired with an spi_master_put() call to free the resources.

The kfree() is taken care of by the spi_master_release() function that
is called once the last reference to the underlying struct device has
been released. Thus kfree() must not be called after
spi_alloc_master().


Lothar Waßmann
-- 
___

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | i...@karo-electronics.de
___

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-08-01 Thread Shawn Guo
On Tue, Jul 31, 2012 at 11:56:50PM -0700, Guenter Roeck wrote:
> Guess we are in violent agreement. The sequence would then either be
>   master = spi_alloc_device();

The discussion is around spi_alloc_master rather than spi_alloc_device,
isn't it?

Regards,
Shawn

>   ...
>   spi_master_put(master);
> or
>   master = spi_alloc_device();
>   ...
>   kfree(master);
> 
> which makes sense to me. Question still is why most drivers neither call 
> kfree()
> nor spi_master_put() in the remove function.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-08-01 Thread Shawn Guo
On Wed, Aug 01, 2012 at 03:40:53PM +0800, Shawn Guo wrote:
> On Wed, Aug 01, 2012 at 08:45:19AM +0200, Marek Vasut wrote:
> > > I must be missing something.  Why do almost all spi drivers call it in the
> > > error path, even if there is no call to spi_master_get ?
> > 
> > To push the refcounting to 0, to deallocate the device, I'd say ...
> > 
> It's not going to work if spi_master_put is called without
> spi_master_get being called before that.
> 
I'm saying that kref_put on a kref that is never called on by kref_get
will not trigger the release.

Regards,
Shawn


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general


Re: [06/10,V2] spi: Add SPI driver for mx233/mx28

2012-08-01 Thread Shawn Guo
On Wed, Aug 01, 2012 at 08:45:19AM +0200, Marek Vasut wrote:
> > I must be missing something.  Why do almost all spi drivers call it in the
> > error path, even if there is no call to spi_master_get ?
> 
> To push the refcounting to 0, to deallocate the device, I'd say ...
> 
It's not going to work if spi_master_put is called without
spi_master_get being called before that.

Regards,
Shawn


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general