<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/misc/cardreader, branch v5.19</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=v5.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-07-02T14:20:56Z</updated>
<entry>
<title>misc: rtsx_usb: set return value in rsp_buf alloc err path</title>
<updated>2022-07-02T14:20:56Z</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2022-07-01T16:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2cd37c2e72449a7add6da1183d20a6247d6db111'/>
<id>urn:sha1:2cd37c2e72449a7add6da1183d20a6247d6db111</id>
<content type='text'>
Set return value in rsp_buf alloc error path before going to
error handling.

drivers/misc/cardreader/rtsx_usb.c:639:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!ucr-&gt;rsp_buf)
               ^~~~~~~~~~~~~
   drivers/misc/cardreader/rtsx_usb.c:678:9: note: uninitialized use occurs here
           return ret;
                  ^~~
   drivers/misc/cardreader/rtsx_usb.c:639:2: note: remove the 'if' if its condition is always false
           if (!ucr-&gt;rsp_buf)
           ^~~~~~~~~~~~~~~~~~
   drivers/misc/cardreader/rtsx_usb.c:622:9: note: initialize the variable 'ret' to silence this warning
           int ret;
                  ^
                   = 0

Fixes: 3776c7855985 ("misc: rtsx_usb: use separate command and response buffers")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20220701165352.15687-1-skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: rtsx_usb: use separate command and response buffers</title>
<updated>2022-07-01T06:53:26Z</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2022-07-01T02:32:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3776c78559853fd151be7c41e369fd076fb679d5'/>
<id>urn:sha1:3776c78559853fd151be7c41e369fd076fb679d5</id>
<content type='text'>
rtsx_usb uses same buffer for command and response. There could
be a potential conflict using the same buffer for both especially
if retries and timeouts are involved.

Use separate command and response buffers to avoid conflicts.

Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/r/07e3721804ff07aaab9ef5b39a5691d0718b9ade.1656642167.git.skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: rtsx_usb: fix use of dma mapped buffer for usb bulk transfer</title>
<updated>2022-07-01T06:53:23Z</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2022-07-01T02:32:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eb7f8e28420372787933eec079735c35034bda7d'/>
<id>urn:sha1:eb7f8e28420372787933eec079735c35034bda7d</id>
<content type='text'>
rtsx_usb driver allocates coherent dma buffer for urb transfers.
This buffer is passed to usb_bulk_msg() and usb core tries to
map already mapped buffer running into a dma mapping error.

xhci_hcd 0000:01:00.0: rejecting DMA map of vmalloc memory
WARNING: CPU: 1 PID: 279 at include/linux/dma-mapping.h:326 usb_ hcd_map_urb_for_dma+0x7d6/0x820

...

xhci_map_urb_for_dma+0x291/0x4e0
usb_hcd_submit_urb+0x199/0x12b0
...
usb_submit_urb+0x3b8/0x9e0
usb_start_wait_urb+0xe3/0x2d0
usb_bulk_msg+0x115/0x240
rtsx_usb_transfer_data+0x185/0x1a8 [rtsx_usb]
rtsx_usb_send_cmd+0xbb/0x123 [rtsx_usb]
rtsx_usb_write_register+0x12c/0x143 [rtsx_usb]
rtsx_usb_probe+0x226/0x4b2 [rtsx_usb]

Fix it to use kmalloc() to get DMA-able memory region instead.

Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Link: https://lore.kernel.org/r/667d627d502e1ba9ff4f9b94966df3299d2d3c0d.1656642167.git.skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: rtsx: Fix clang -Wsometimes-uninitialized in rts5261_init_from_hw()</title>
<updated>2022-06-10T13:29:17Z</updated>
<author>
<name>Nathan Chancellor</name>
<email>nathan@kernel.org</email>
</author>
<published>2022-05-23T15:05:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bd476c1306ea989d6d9eb65295572e98d93edeb6'/>
<id>urn:sha1:bd476c1306ea989d6d9eb65295572e98d93edeb6</id>
<content type='text'>
Clang warns:

  drivers/misc/cardreader/rts5261.c:406:13: error: variable 'setting_reg2' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
          } else if (efuse_valid == 0) {
                     ^~~~~~~~~~~~~~~~
  drivers/misc/cardreader/rts5261.c:412:30: note: uninitialized use occurs here
          pci_read_config_dword(pdev, setting_reg2, &amp;lval2);
                                      ^~~~~~~~~~~~

efuse_valid == 1 is not a valid value so just return early from the
function to avoid using setting_reg2 uninitialized.

Fixes: b1c5f3085149 ("misc: rtsx: add rts5261 efuse function")
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Tom Rix &lt;trix@redhat.com&gt;
Suggested-by: Ricky WU &lt;ricky_wu@realtek.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt;
Link: https://lore.kernel.org/r/20220523150521.2947108-1-nathan@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: alcor_pci: set NULL intfdata and clear pci master</title>
<updated>2022-05-19T16:57:17Z</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2022-05-17T20:36:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e04a7afce3d796c0c25219e30e16543e3fde2d2'/>
<id>urn:sha1:8e04a7afce3d796c0c25219e30e16543e3fde2d2</id>
<content type='text'>
alcor_pci doesn't set driver data to NULL and clear pci master when
probe fails. Doesn't clear pci master from remove interface. Clearing
pci master is necessary to disable bus mastering and prevent DMAs after
driver removal.

Fix alcor_pci_probe() to set driver data to NULL and clear pci master
from its error path. Fix alcor_pci_remove() to clear pci master.

Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20220517203630.45232-1-skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: rtsx: set NULL intfdata when probe fails</title>
<updated>2022-05-09T13:40:15Z</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2022-04-29T21:09:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f861d36e021e1ac4a0a2a1f6411d623809975d63'/>
<id>urn:sha1:f861d36e021e1ac4a0a2a1f6411d623809975d63</id>
<content type='text'>
rtsx_usb_probe() doesn't call usb_set_intfdata() to null out the
interface pointer when probe fails. This leaves a stale pointer.
Noticed the missing usb_set_intfdata() while debugging an unrelated
invalid DMA mapping problem.

Fix it with a call to usb_set_intfdata(..., NULL).

Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Link: https://lore.kernel.org/r/20220429210913.46804-1-skhan@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: rtsx: add rts5261 efuse function</title>
<updated>2022-05-09T13:37:36Z</updated>
<author>
<name>Ricky WU</name>
<email>ricky_wu@realtek.com</email>
</author>
<published>2022-03-21T11:18:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b1c5f3085149e9643b125eb10aae0e74644d7dcc'/>
<id>urn:sha1:b1c5f3085149e9643b125eb10aae0e74644d7dcc</id>
<content type='text'>
move rts5261_fetch_vendor_settings() to rts5261_init_from_hw()
make sure it be called from S3 or D3

add more register setting when efuse is set
read efuse setting to register on init flow

Signed-off-by: Ricky Wu &lt;Ricky_wu@realtek.com&gt;
Link: https://lore.kernel.org/r/18101ecb0f0749ccb9f564eda171ba40@realtek.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: rtsx: clean up one inconsistent indenting</title>
<updated>2022-03-18T12:52:30Z</updated>
<author>
<name>Yang Li</name>
<email>yang.lee@linux.alibaba.com</email>
</author>
<published>2022-03-03T02:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f1bc423f56306b24fb15bc4a1612ef6c6ee24603'/>
<id>urn:sha1:f1bc423f56306b24fb15bc4a1612ef6c6ee24603</id>
<content type='text'>
Eliminate the follow smatch warning:
drivers/misc/cardreader/rts5228.c:494 rts5228_extra_init_hw() warn:
inconsistent indenting

Reported-by: Abaci Robot &lt;abaci@linux.alibaba.com&gt;
Signed-off-by: Yang Li &lt;yang.lee@linux.alibaba.com&gt;
Link: https://lore.kernel.org/r/20220303020206.98911-1-yang.lee@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: rtsx: rts522a rts5228 rts5261 support Runtime PM</title>
<updated>2022-02-25T11:11:16Z</updated>
<author>
<name>Ricky WU</name>
<email>ricky_wu@realtek.com</email>
</author>
<published>2022-02-21T11:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=86f4c65fd5003c894dd3082d53e26307fbc211cc'/>
<id>urn:sha1:86f4c65fd5003c894dd3082d53e26307fbc211cc</id>
<content type='text'>
rts522a, rts5228, rts5261
add extra init flow for rtd3
add more power_down setting for avoid being woken up
by plugging or unplugging card when system in S3

Tested-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Ricky Wu &lt;ricky_wu@realtek.com&gt;
Link: https://lore.kernel.org/r/dace32f573a445908fec0a10482c394c@realtek.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: rtsx: conditionally build rtsx_pm_power_saving()</title>
<updated>2022-02-25T11:10:45Z</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2022-02-13T17:19:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c9ae453543c9a3c08840cc4a51a054ebc4e75bf'/>
<id>urn:sha1:2c9ae453543c9a3c08840cc4a51a054ebc4e75bf</id>
<content type='text'>
On s390 allyesconfig, there is this build error
rtsx_pcr.c:1084:13: error: 'rtsx_pm_power_saving'
  defined but not used
 1084 | static void rtsx_pm_power_saving(struct rtsx_pcr *pcr)
      |             ^~~~~~~~~~~~~~~~~~~~

rtsx_pm_power_saving() is only used by rtsx_pci_runtime_idle()
which is conditional on CONFIG_PM.  So conditionally build
rtsx_pm_power_saving() and the similar
rtsx_comm_pm_power_saving() and rtsx_enable_aspm().

Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Link: https://lore.kernel.org/r/20220213171907.2786442-1-trix@redhat.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
