<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/mfd/rtsx_usb.c, branch v4.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.2</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-03-12T09:27:41Z</updated>
<entry>
<title>mfd: rtsx_usb: Prevent DMA from stack</title>
<updated>2015-03-12T09:27:41Z</updated>
<author>
<name>Roger Tseng</name>
<email>rogerable@realtek.com</email>
</author>
<published>2015-03-06T03:36:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3a43477fa36eee2997313380cb52f486e2bff316'/>
<id>urn:sha1:3a43477fa36eee2997313380cb52f486e2bff316</id>
<content type='text'>
Functions rtsx_usb_ep0_read_register() and rtsx_usb_get_card_status()
both use arbitrary buffer addresses from arguments directly for DMA and
the buffers could be located in stack. This was caught by DMA-API debug
check.

Fixes this by using double-buffers via kzalloc in both functions to
guarantee the validity of DMA buffer.

WARNING: CPU: 1 PID: 25 at lib/dma-debug.c:1166 check_for_stack+0x96/0xe0()
ehci-pci 0000:00:1a.0: DMA-API: device driver maps memory from stack
[addr=ffff8801199e3cef]
Modules linked in: rtsx_usb_ms arc4 memstick intel_rapl iosf_mbi
rtl8192ce snd_hda_codec_hdmi snd_hda_codec_realtek
snd_hda_codec_generic snd_hda_intel rtl_pci rtl8192c_common
snd_hda_controller x86_pkg_temp_thermal snd_hda_codec rtlwifi mac80211
coretemp kvm_intel kvm iTCO_wdt snd_hwdep snd_seq snd_seq_device
crct10dif_pclmul iTCO_vendor_support sparse_keymap cfg80211
crc32_pclmul snd_pcm crc32c_intel ghash_clmulni_intel rfkill i2c_i801
snd_timer shpchp snd serio_raw mei_me lpc_ich soundcore mei tpm_tis
tpm wmi nfsd auth_rpcgss nfs_acl lockd grace sunrpc i915
rtsx_usb_sdmmc mmc_core 8021q uas garp stp i2c_algo_bit llc mrp
drm_kms_helper usb_storage drm rtsx_usb mfd_core r8169 mii video
CPU: 1 PID: 25 Comm: kworker/1:2 Not tainted 3.20.0-0.rc0.git7.3.fc22.x86_64 #1
Hardware name: WB WB-B06211/WB-B0621, BIOS EB062IWB V1.0 12/12/2013
Workqueue: events rtsx_usb_ms_handle_req [rtsx_usb_ms]
 0000000000000000 000000003d188e66 ffff8801199e3808 ffffffff8187642b
 0000000000000000 ffff8801199e3860 ffff8801199e3848 ffffffff810ab39a
 ffff8801199e3864 ffff8801199e3cef ffff880119b57098 ffff880119b37320
Call Trace:
 [&lt;ffffffff8187642b&gt;] dump_stack+0x4c/0x65
 [&lt;ffffffff810ab39a&gt;] warn_slowpath_common+0x8a/0xc0
 [&lt;ffffffff810ab425&gt;] warn_slowpath_fmt+0x55/0x70
 [&lt;ffffffff8187efe6&gt;] ? _raw_spin_unlock_irqrestore+0x36/0x70
 [&lt;ffffffff81453156&gt;] check_for_stack+0x96/0xe0
 [&lt;ffffffff81453934&gt;] debug_dma_map_page+0x104/0x150
 [&lt;ffffffff81613b86&gt;] usb_hcd_map_urb_for_dma+0x646/0x790
 [&lt;ffffffff81614165&gt;] usb_hcd_submit_urb+0x1d5/0xa90
 [&lt;ffffffff81106f8f&gt;] ? mark_held_locks+0x7f/0xc0
 [&lt;ffffffff81106f8f&gt;] ? mark_held_locks+0x7f/0xc0
 [&lt;ffffffff81103a15&gt;] ? lockdep_init_map+0x65/0x5d0
 [&lt;ffffffff81615d7e&gt;] usb_submit_urb+0x42e/0x5f0
 [&lt;ffffffff81616787&gt;] usb_start_wait_urb+0x77/0x190
 [&lt;ffffffff8124f035&gt;] ? __kmalloc+0x205/0x2d0
 [&lt;ffffffff8161697c&gt;] usb_control_msg+0xdc/0x130
 [&lt;ffffffffa0031669&gt;] rtsx_usb_ep0_read_register+0x59/0x70 [rtsx_usb]
 [&lt;ffffffffa00310c1&gt;] ? rtsx_usb_get_rsp+0x41/0x50 [rtsx_usb]
 [&lt;ffffffffa071da4e&gt;] rtsx_usb_ms_handle_req+0x7ce/0x9c5 [rtsx_usb_ms]

Reported-by: Josh Boyer &lt;jwboyer@fedoraproject.org&gt;
Signed-off-by: Roger Tseng &lt;rogerable@realtek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: rtsx_usb: Defer autosuspend while card exists</title>
<updated>2015-01-22T16:08:02Z</updated>
<author>
<name>Roger Tseng</name>
<email>rogerable@realtek.com</email>
</author>
<published>2015-01-21T10:09:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bb400d2120bd253d73661c452b18485d2d5b42dd'/>
<id>urn:sha1:bb400d2120bd253d73661c452b18485d2d5b42dd</id>
<content type='text'>
A card insertion happens after the lastest polling before reader is
suspended may never have a chance to be detected. Under current 1-HZ
polling interval setting in mmc_core, the worst case of such
undetectablility is about 1 second.

To further reduce the undetectability, detect card slot again in suspend
method and defer the autosuspend if the slot is loaded. The default 2
second autosuspend delay of USB subsystem should let the next polling
detects the card.

Signed-off-by: Roger Tseng &lt;rogerable@realtek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: rtsx_usb: Fix runtime PM deadlock</title>
<updated>2015-01-20T12:52:55Z</updated>
<author>
<name>Roger Tseng</name>
<email>rogerable@realtek.com</email>
</author>
<published>2015-01-15T07:14:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b166010f6afbadb896efa37ff85eb681a8f89392'/>
<id>urn:sha1:b166010f6afbadb896efa37ff85eb681a8f89392</id>
<content type='text'>
sd_set_power_mode() in derived module drivers/mmc/host/rtsx_usb_sdmmc.c
acquires dev_mutex and then calls pm_runtime_get_sync() to make sure the
device is awake while initializing a newly inserted card. Once it is
called during suspending state and explicitly before rtsx_usb_suspend()
acquires the same dev_mutex, both routine deadlock and further hang the
driver because pm_runtime_get_sync() waits the pending PM operations.

Fix this by using an empty suspend method. mmc_core always turns the
LED off after a request is done and thus it is ok to remove the only
rtsx_usb_turn_off_led() here.

Cc: &lt;stable@vger.kernel.org&gt; # v3.16+
Fixes: 730876be2566 ("mfd: Add realtek USB card reader driver")
Signed-off-by: Roger Tseng &lt;rogerable@realtek.com&gt;
[Lee: Removed newly unused variable]
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: Use mfd_add_hotplug_devices() helper</title>
<updated>2014-11-25T16:18:42Z</updated>
<author>
<name>Johan Hovold</name>
<email>johan@kernel.org</email>
</author>
<published>2014-09-26T10:55:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1ab589c72ef66f5f281d658ab606e02d661031d8'/>
<id>urn:sha1:1ab589c72ef66f5f281d658ab606e02d661031d8</id>
<content type='text'>
Use mfd_add_hotplug_devices helper to register the subdevices.

Signed-off-by: Johan Hovold &lt;johan@kernel.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: rtsx_usb: Fix decimal printf format specifiers prefixed with 0x</title>
<updated>2014-09-26T07:15:38Z</updated>
<author>
<name>Hans Wennborg</name>
<email>hans@hanshq.net</email>
</author>
<published>2014-08-06T04:42:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5e9bbf17b35f89f31e6b76b4810d8c772621c153'/>
<id>urn:sha1:5e9bbf17b35f89f31e6b76b4810d8c772621c153</id>
<content type='text'>
The prefix suggests the number should be printed in hex, so use
the %x specifier to do that.

Found by using regex suggested by Joe Perches.

Signed-off-by: Hans Wennborg &lt;hans@hanshq.net&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>drivers/mfd/rtsx_usb.c: export device table</title>
<updated>2014-08-14T16:56:15Z</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.com</email>
</author>
<published>2014-08-12T20:46:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1813908986e36119228c158aae1c6a0267c99e77'/>
<id>urn:sha1:1813908986e36119228c158aae1c6a0267c99e77</id>
<content type='text'>
The rtsx_usb driver contains the table for the devices it supports but
doesn't export it.  As a result, no alias is generated and it doesn't
get loaded automatically.

Via https://bugzilla.novell.com/show_bug.cgi?id=890096

Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Reported-by: Marcel Witte &lt;wittemar@googlemail.com&gt;
Cc: Roger Tseng &lt;rogerable@realtek.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>mfd: rtsx_usb: Make mfd_cell array const</title>
<updated>2014-06-03T07:11:39Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2014-05-13T10:58:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9031a939185b65f1d8eda2c8f7cd30472496dc9a'/>
<id>urn:sha1:9031a939185b65f1d8eda2c8f7cd30472496dc9a</id>
<content type='text'>
mfd_add_devices() expects array of struct mfd_cell to be const.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Acked-by: Roger Tseng &lt;rogerable@realtek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: rtsx_usb: Add comment in rtsx_usb_suspend</title>
<updated>2014-04-28T10:01:18Z</updated>
<author>
<name>Roger Tseng</name>
<email>rogerable@realtek.com</email>
</author>
<published>2014-04-11T06:53:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f0334205239bb5ae22ca89ad2af378062836498'/>
<id>urn:sha1:5f0334205239bb5ae22ca89ad2af378062836498</id>
<content type='text'>
Explain why there is no need to have a symmetric LED turn-on in resume handler
while calling rtsx_usb_turn_off_led() in suspend handler.

Signed-off-by: Roger Tseng &lt;rogerable@realtek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: rtsx_usb: Fix possible race condition</title>
<updated>2014-04-28T10:00:57Z</updated>
<author>
<name>Roger Tseng</name>
<email>rogerable@realtek.com</email>
</author>
<published>2014-04-11T06:53:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fea52b8910f6f5438790dbd2de45003ce08d01a5'/>
<id>urn:sha1:fea52b8910f6f5438790dbd2de45003ce08d01a5</id>
<content type='text'>
Fix two possible race condition generated by misuse of del_timer in
rtsx_usb_bulk_transfer_sglist() and uninitialized timers before mfd_add_devices
in rtsx_usb_probe().

Signed-off-by: Roger Tseng &lt;rogerable@realtek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: Add realtek USB card reader driver</title>
<updated>2014-03-19T08:58:18Z</updated>
<author>
<name>Roger Tseng</name>
<email>rogerable@realtek.com</email>
</author>
<published>2014-02-12T10:00:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=730876be256603b4ee7225a125467d97a7ce9060'/>
<id>urn:sha1:730876be256603b4ee7225a125467d97a7ce9060</id>
<content type='text'>
Realtek USB card reader provides a channel to transfer command or data to flash
memory cards. This driver exports host instances for mmc and memstick subsystems
and handles basic works.

Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Roger Tseng &lt;rogerable@realtek.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
</feed>
