<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/memstick/host, branch v4.9.60</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>memstick: rtsx_usb_ms: Manage runtime PM when accessing the device</title>
<updated>2016-10-17T13:43:05+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulf.hansson@linaro.org</email>
</author>
<published>2016-09-28T18:33:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9158cb29e7c2f10dd325eb1589f0fe745a271257'/>
<id>9158cb29e7c2f10dd325eb1589f0fe745a271257</id>
<content type='text'>
Accesses to the rtsx usb device, which is the parent of the rtsx memstick
device, must not be done unless it's runtime resumed. This is currently not
the case and it could trigger various errors.

Fix this by properly deal with runtime PM in this regards. This means
making sure the device is runtime resumed, when serving requests via the
-&gt;request() callback or changing settings via the -&gt;set_param() callbacks.

Cc: &lt;stable@vger.kernel.org&gt;
Cc: Ritesh Raj Sarraf &lt;rrs@researchut.com&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Accesses to the rtsx usb device, which is the parent of the rtsx memstick
device, must not be done unless it's runtime resumed. This is currently not
the case and it could trigger various errors.

Fix this by properly deal with runtime PM in this regards. This means
making sure the device is runtime resumed, when serving requests via the
-&gt;request() callback or changing settings via the -&gt;set_param() callbacks.

Cc: &lt;stable@vger.kernel.org&gt;
Cc: Ritesh Raj Sarraf &lt;rrs@researchut.com&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>memstick: rtsx_usb_ms: Runtime resume the device when polling for cards</title>
<updated>2016-10-17T13:43:04+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2016-09-26T22:45:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=796aa46adf1d90eab36ae06a42e6d3f10b28a75c'/>
<id>796aa46adf1d90eab36ae06a42e6d3f10b28a75c</id>
<content type='text'>
Accesses to the rtsx usb device, which is the parent of the rtsx memstick
device, must not be done unless it's runtime resumed.

Therefore when the rtsx_usb_ms driver polls for inserted memstick cards,
let's add pm_runtime_get|put*() to make sure accesses is done when the
rtsx usb device is runtime resumed.

Reported-by: Ritesh Raj Sarraf &lt;rrs@researchut.com&gt;
Tested-by: Ritesh Raj Sarraf &lt;rrs@researchut.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Accesses to the rtsx usb device, which is the parent of the rtsx memstick
device, must not be done unless it's runtime resumed.

Therefore when the rtsx_usb_ms driver polls for inserted memstick cards,
let's add pm_runtime_get|put*() to make sure accesses is done when the
rtsx usb device is runtime resumed.

Reported-by: Ritesh Raj Sarraf &lt;rrs@researchut.com&gt;
Tested-by: Ritesh Raj Sarraf &lt;rrs@researchut.com&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtsx_usb_ms: use schedule_timeout_idle() in polling loop</title>
<updated>2016-05-24T00:04:14+00:00</updated>
<author>
<name>Oleksandr Natalenko</name>
<email>oleksandr@natalenko.name</email>
</author>
<published>2016-05-23T23:24:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a831979f855f1a19db1b3b194c5fab5e04ad26ff'/>
<id>a831979f855f1a19db1b3b194c5fab5e04ad26ff</id>
<content type='text'>
First version of this patch has already been posted to LKML by Ben
Hutchings ~6 months ago, but no further action were performed.

Ben's original message:

: rtsx_usb_ms creates a task that mostly sleeps, but tasks in
: uninterruptible sleep still contribute to the load average (for
: bug-compatibility with Unix).  A load average of ~1 on a system that
: should be idle is somewhat alarming.
:
: Change the sleep to be interruptible, but still ignore signals.

References: https://bugs.debian.org/765717
Link: http://lkml.kernel.org/r/b49f95ae83057efa5d96f532803cba47@natalenko.name
Signed-off-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Lee Jones &lt;lee.jones@linaro.org&gt;
Cc: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: Roger Tseng &lt;rogerable@realtek.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
First version of this patch has already been posted to LKML by Ben
Hutchings ~6 months ago, but no further action were performed.

Ben's original message:

: rtsx_usb_ms creates a task that mostly sleeps, but tasks in
: uninterruptible sleep still contribute to the load average (for
: bug-compatibility with Unix).  A load average of ~1 on a system that
: should be idle is somewhat alarming.
:
: Change the sleep to be interruptible, but still ignore signals.

References: https://bugs.debian.org/765717
Link: http://lkml.kernel.org/r/b49f95ae83057efa5d96f532803cba47@natalenko.name
Signed-off-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Cc: Lee Jones &lt;lee.jones@linaro.org&gt;
Cc: Wolfram Sang &lt;wsa@the-dreams.de&gt;
Cc: Roger Tseng &lt;rogerable@realtek.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/memstick/host/r592.c: avoid gcc-6 warning</title>
<updated>2016-03-25T23:37:42+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-03-25T21:21:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f419a08fb329e235df0cb8e329cff770e02d171a'/>
<id>f419a08fb329e235df0cb8e329cff770e02d171a</id>
<content type='text'>
The r592 driver relies on behavior of the DMA mapping API that is
normally observed but not guaranteed by the API.  Instead it uses a
runtime check to fail transfers if the API ever behaves

When CONFIG_NEED_SG_DMA_LENGTH is not set, one of the checks turns into a
comparison of a variable with itself, which gcc-6.0 now warns about:

drivers/memstick/host/r592.c: In function 'r592_transfer_fifo_dma':
drivers/memstick/host/r592.c:302:31: error: self-comparison always evaluates to false [-Werror=tautological-compare]
    (sg_dma_len(&amp;dev-&gt;req-&gt;sg) &lt; dev-&gt;req-&gt;sg.length)) {
                               ^

The check itself is not a problem, so this patch just rephrases the
condition in a way that gcc does not consider an indication of a mistake.
We already know that dev-&gt;req-&gt;sg.length was initially R592_LFIFO_SIZE, so
we can compare it to that constant again.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Quentin Lambert &lt;lambert.quentin@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The r592 driver relies on behavior of the DMA mapping API that is
normally observed but not guaranteed by the API.  Instead it uses a
runtime check to fail transfers if the API ever behaves

When CONFIG_NEED_SG_DMA_LENGTH is not set, one of the checks turns into a
comparison of a variable with itself, which gcc-6.0 now warns about:

drivers/memstick/host/r592.c: In function 'r592_transfer_fifo_dma':
drivers/memstick/host/r592.c:302:31: error: self-comparison always evaluates to false [-Werror=tautological-compare]
    (sg_dma_len(&amp;dev-&gt;req-&gt;sg) &lt; dev-&gt;req-&gt;sg.length)) {
                               ^

The check itself is not a problem, so this patch just rephrases the
condition in a way that gcc does not consider an indication of a mistake.
We already know that dev-&gt;req-&gt;sg.length was initially R592_LFIFO_SIZE, so
we can compare it to that constant again.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Quentin Lambert &lt;lambert.quentin@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>memstick: remove deprecated use of pci api</title>
<updated>2015-07-01T02:44:57+00:00</updated>
<author>
<name>Quentin Lambert</name>
<email>lambert.quentin@gmail.com</email>
</author>
<published>2015-06-30T21:58:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=43abdbcecea0673fa7f2f04422b57765935b2d5b'/>
<id>43abdbcecea0673fa7f2f04422b57765935b2d5b</id>
<content type='text'>
Replace occurences of the pci api by appropriate call to the dma api.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@deprecated@
idexpression id;
position p;
@@

(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@bad1@
idexpression id;
position deprecated.p;
@@
...when != &amp;id-&gt;dev
   when != pci_get_drvdata ( id )
   when != pci_enable_device ( id )
(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@depends on !bad1@
idexpression id;
expression direction;
position deprecated.p;
@@

(
- pci_dma_supported@p ( id,
+ dma_supported ( &amp;id-&gt;dev,
...
+ , GFP_ATOMIC
  )
|
- pci_alloc_consistent@p ( id,
+ dma_alloc_coherent ( &amp;id-&gt;dev,
...
+ , GFP_ATOMIC
  )
)

Signed-off-by: Quentin Lambert &lt;lambert.quentin@gmail.com&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace occurences of the pci api by appropriate call to the dma api.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@deprecated@
idexpression id;
position p;
@@

(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@bad1@
idexpression id;
position deprecated.p;
@@
...when != &amp;id-&gt;dev
   when != pci_get_drvdata ( id )
   when != pci_enable_device ( id )
(
  pci_dma_supported@p ( id, ...)
|
  pci_alloc_consistent@p ( id, ...)
)

@depends on !bad1@
idexpression id;
expression direction;
position deprecated.p;
@@

(
- pci_dma_supported@p ( id,
+ dma_supported ( &amp;id-&gt;dev,
...
+ , GFP_ATOMIC
  )
|
- pci_alloc_consistent@p ( id,
+ dma_alloc_coherent ( &amp;id-&gt;dev,
...
+ , GFP_ATOMIC
  )
)

Signed-off-by: Quentin Lambert &lt;lambert.quentin@gmail.com&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>memstick: host: drop owner assignment from platform_drivers</title>
<updated>2014-10-20T14:20:53+00:00</updated>
<author>
<name>Wolfram Sang</name>
<email>wsa@the-dreams.de</email>
</author>
<published>2014-10-20T14:20:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1a22cd17483e4e574b7c1d624be48b47404aea2d'/>
<id>1a22cd17483e4e574b7c1d624be48b47404aea2d</id>
<content type='text'>
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang &lt;wsa@the-dreams.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>memstick: r592: fix build warnings for !PM_SLEEP</title>
<updated>2014-10-14T00:18:22+00:00</updated>
<author>
<name>Thierry Reding</name>
<email>treding@nvidia.com</email>
</author>
<published>2014-10-13T22:53:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5ef9819234e285abe6b616864e7b1b4607d39b58'/>
<id>5ef9819234e285abe6b616864e7b1b4607d39b58</id>
<content type='text'>
When PM_SLEEP is not enabled, the r592_clear_interrupts() function is
never used.  If so, don't build it to prevent a compiler warning.

Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When PM_SLEEP is not enabled, the r592_clear_interrupts() function is
never used.  If so, don't build it to prevent a compiler warning.

Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/memstick/host/rtsx_pci_ms.c: add cancel_work when remove driver</title>
<updated>2014-06-23T23:47:44+00:00</updated>
<author>
<name>Micky Ching</name>
<email>micky_ching@realsil.com.cn</email>
</author>
<published>2014-06-23T20:22:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b6226b45c66196e14ef628d3aead2139700db1ad'/>
<id>b6226b45c66196e14ef628d3aead2139700db1ad</id>
<content type='text'>
Add cancel_work_sync() in rtsx_pci_ms_drv_remove() to cancel pending
request work when removing the driver.

Signed-off-by: Micky Ching &lt;micky_ching@realsil.com.cn&gt;
Cc: Samuel Ortiz &lt;sameo@linux.intel.com&gt; says:
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Alex Dubov &lt;oakad@yahoo.com&gt;
Cc: Roger Tseng &lt;rogerable@realtek.com&gt;
Cc: Wei WANG &lt;wei_wang@realsil.com.cn&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add cancel_work_sync() in rtsx_pci_ms_drv_remove() to cancel pending
request work when removing the driver.

Signed-off-by: Micky Ching &lt;micky_ching@realsil.com.cn&gt;
Cc: Samuel Ortiz &lt;sameo@linux.intel.com&gt; says:
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Alex Dubov &lt;oakad@yahoo.com&gt;
Cc: Roger Tseng &lt;rogerable@realtek.com&gt;
Cc: Wei WANG &lt;wei_wang@realsil.com.cn&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>memstick: Add realtek USB memstick host driver</title>
<updated>2014-04-28T10:02:46+00:00</updated>
<author>
<name>Roger Tseng</name>
<email>rogerable@realtek.com</email>
</author>
<published>2014-04-11T06:53:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=99451dceeb5fdd789f0a2eeb3ee029e80d2ccc40'/>
<id>99451dceeb5fdd789f0a2eeb3ee029e80d2ccc40</id>
<content type='text'>
Realtek USB memstick host driver provides memstick host support based on the
Realtek USB card reader MFD driver.

Signed-off-by: Roger Tseng &lt;rogerable@realtek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Realtek USB memstick host driver provides memstick host support based on the
Realtek USB card reader MFD driver.

Signed-off-by: Roger Tseng &lt;rogerable@realtek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/memstick/host/rtsx_pci_ms.c: fix ms card data transfer bug</title>
<updated>2014-01-24T00:37:04+00:00</updated>
<author>
<name>Micky Ching</name>
<email>micky_ching@realsil.com.cn</email>
</author>
<published>2014-01-23T23:56:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=63509beaf7ed7a9dc8c574be61189fce791489f0'/>
<id>63509beaf7ed7a9dc8c574be61189fce791489f0</id>
<content type='text'>
This patch is used to add support for ms card. The main difference
between ms card and mspro card is long data transfer mode. mspro card
can use auto mode DMA for long data transfer, but ms can not use this
mode, it should use normal mode DMA.

The memstick core added support for ms card, but the original driver will
make ms card fail at initialization, because it uses auto mode DMA.  This
patch makes the ms card work properly.

Signed-off-by: Micky Ching &lt;micky_ching@realsil.com.cn&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
Cc: Alex Dubov &lt;oakad@yahoo.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch is used to add support for ms card. The main difference
between ms card and mspro card is long data transfer mode. mspro card
can use auto mode DMA for long data transfer, but ms can not use this
mode, it should use normal mode DMA.

The memstick core added support for ms card, but the original driver will
make ms card fail at initialization, because it uses auto mode DMA.  This
patch makes the ms card work properly.

Signed-off-by: Micky Ching &lt;micky_ching@realsil.com.cn&gt;
Cc: Maxim Levitsky &lt;maximlevitsky@gmail.com&gt;
Cc: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
Cc: Alex Dubov &lt;oakad@yahoo.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
