<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/net/wireless/rt2x00, branch linux-3.16.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>rt2x00: do not increment sequence number while re-transmitting</title>
<updated>2019-08-13T11:39:06+00:00</updated>
<author>
<name>Vijayakumar Durai</name>
<email>vijayakumar.durai1@vivint.com</email>
</author>
<published>2019-03-27T10:03:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8fe41e807bec8adf1a218c9f8113e23af2acb4c4'/>
<id>8fe41e807bec8adf1a218c9f8113e23af2acb4c4</id>
<content type='text'>
commit 746ba11f170603bf1eaade817553a6c2e9135bbe upstream.

Currently rt2x00 devices retransmit the management frames with
incremented sequence number if hardware is assigning the sequence.

This is HW bug fixed already for non-QOS data frames, but it should
be fixed for management frames except beacon.

Without fix retransmitted frames have wrong SN:

 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1648, FN=0, Flags=........C Frame is not being retransmitted 1648 1
 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1649, FN=0, Flags=....R...C Frame is being retransmitted 1649 1
 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1650, FN=0, Flags=....R...C Frame is being retransmitted 1650 1

With the fix SN stays correctly the same:

 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=........C
 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=....R...C
 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=....R...C

Signed-off-by: Vijayakumar Durai &lt;vijayakumar.durai1@vivint.com&gt;
[sgruszka: simplify code, change comments and changelog]
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
[bwh: Backported to 3.16: adjust filenames, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 746ba11f170603bf1eaade817553a6c2e9135bbe upstream.

Currently rt2x00 devices retransmit the management frames with
incremented sequence number if hardware is assigning the sequence.

This is HW bug fixed already for non-QOS data frames, but it should
be fixed for management frames except beacon.

Without fix retransmitted frames have wrong SN:

 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1648, FN=0, Flags=........C Frame is not being retransmitted 1648 1
 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1649, FN=0, Flags=....R...C Frame is being retransmitted 1649 1
 AlphaNet_e8:fb:36 Vivotek_52:31:51 Authentication, SN=1650, FN=0, Flags=....R...C Frame is being retransmitted 1650 1

With the fix SN stays correctly the same:

 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=........C
 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=....R...C
 88:6a:e3:e8:f9:a2 8c:f5:a3:88:76:87 Authentication, SN=1450, FN=0, Flags=....R...C

Signed-off-by: Vijayakumar Durai &lt;vijayakumar.durai1@vivint.com&gt;
[sgruszka: simplify code, change comments and changelog]
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
[bwh: Backported to 3.16: adjust filenames, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00usb: mark device removed when get ENOENT usb error</title>
<updated>2018-02-13T18:42:20+00:00</updated>
<author>
<name>Stanislaw Gruszka</name>
<email>sgruszka@redhat.com</email>
</author>
<published>2017-11-09T10:59:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=41554a1da2fdb039577cbfa6e4e7ae977da56f3f'/>
<id>41554a1da2fdb039577cbfa6e4e7ae977da56f3f</id>
<content type='text'>
commit bfa62a52cad93686bb8d8171ea5288813248a7c6 upstream.

ENOENT usb error mean "specified interface or endpoint does not exist or
is not enabled". Mark device not present when we encounter this error
similar like we do with ENODEV error.

Otherwise we can have infinite loop in rt2x00usb_work_rxdone(), because
we remove and put again RX entries to the queue infinitely.

We can have similar situation when submit urb will fail all the time
with other error, so we need consider to limit number of entries
processed by rxdone work. But for now, since the patch fixes
reproducible soft lockup issue on single processor systems
and taken ENOENT error meaning, let apply this fix.

Patch adds additional ENOENT check not only in rx kick routine, but
also on other places where we check for ENODEV error.

Reported-by: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Debugged-by: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Tested-by: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
[bwh: Backported to 3.16: adjust filename, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit bfa62a52cad93686bb8d8171ea5288813248a7c6 upstream.

ENOENT usb error mean "specified interface or endpoint does not exist or
is not enabled". Mark device not present when we encounter this error
similar like we do with ENODEV error.

Otherwise we can have infinite loop in rt2x00usb_work_rxdone(), because
we remove and put again RX entries to the queue infinitely.

We can have similar situation when submit urb will fail all the time
with other error, so we need consider to limit number of entries
processed by rxdone work. But for now, since the patch fixes
reproducible soft lockup issue on single processor systems
and taken ENOENT error meaning, let apply this fix.

Patch adds additional ENOENT check not only in rx kick routine, but
also on other places where we check for ENODEV error.

Reported-by: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Debugged-by: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Tested-by: Richard Genoud &lt;richard.genoud@gmail.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
[bwh: Backported to 3.16: adjust filename, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: add new rt2800usb device Buffalo WLI-UC-G450</title>
<updated>2016-04-30T22:05:54+00:00</updated>
<author>
<name>Anthony Wong</name>
<email>anthony.wong@ubuntu.com</email>
</author>
<published>2016-02-23T15:09:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=70628301514b53d6a2c2da6cb61b5135ef20a2b2'/>
<id>70628301514b53d6a2c2da6cb61b5135ef20a2b2</id>
<content type='text'>
commit f36f299068794ffc5026f25b6a1b3ed615ea832d upstream.

Add USB ID 0411:01fd for Buffalo WLI-UC-G450 wireless adapter,
RT chipset 3593

Signed-off-by: Anthony Wong &lt;anthony.wong@ubuntu.com&gt;
Acked-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f36f299068794ffc5026f25b6a1b3ed615ea832d upstream.

Add USB ID 0411:01fd for Buffalo WLI-UC-G450 wireless adapter,
RT chipset 3593

Signed-off-by: Anthony Wong &lt;anthony.wong@ubuntu.com&gt;
Acked-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: add new rt2800usb device DWA 130</title>
<updated>2015-06-03T13:30:10+00:00</updated>
<author>
<name>Scott Branden</name>
<email>sbranden@broadcom.com</email>
</author>
<published>2015-03-16T17:59:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=15acbf5042c73d4954b370dd9294e71c41131e6a'/>
<id>15acbf5042c73d4954b370dd9294e71c41131e6a</id>
<content type='text'>
commit ea345c145ff23197eab34d0c4d0c8a93d7bea8c6 upstream.

Add the USB Id to link the D-Link DWA 130 USB Wifi adapter
to the rt2830 driver.

Signed-off-by: Scott Branden &lt;sbranden@broadcom.com&gt;
Signed-off-by: Pieter Truter &lt;ptruter@broadcom.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Cc: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ea345c145ff23197eab34d0c4d0c8a93d7bea8c6 upstream.

Add the USB Id to link the D-Link DWA 130 USB Wifi adapter
to the rt2830 driver.

Signed-off-by: Scott Branden &lt;sbranden@broadcom.com&gt;
Signed-off-by: Pieter Truter &lt;ptruter@broadcom.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Cc: Larry Finger &lt;Larry.Finger@lwfinger.net&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: do not align payload on modern H/W</title>
<updated>2014-12-01T10:02:13+00:00</updated>
<author>
<name>Stanislaw Gruszka</name>
<email>sgruszka@redhat.com</email>
</author>
<published>2014-11-11T13:28:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c9e9de3e679de905f9ae90be1db4263a76f95cea'/>
<id>c9e9de3e679de905f9ae90be1db4263a76f95cea</id>
<content type='text'>
commit cfd9167af14eb4ec21517a32911d460083ee3d59 upstream.

RT2800 and newer hardware require padding between header and payload if
header length is not multiple of 4.

For historical reasons we also align payload to to 4 bytes boundary, but
such alignment is not needed on modern H/W.

Patch fixes skb_under_panic problems reported from time to time:

https://bugzilla.kernel.org/show_bug.cgi?id=84911
https://bugzilla.kernel.org/show_bug.cgi?id=72471
http://marc.info/?l=linux-wireless&amp;m=139108549530402&amp;w=2
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1087591

Panic happened because we eat 4 bytes of skb headroom on each
(re)transmission when sending frame without the payload and the header
length not being multiple of 4 (i.e. QoS header has 26 bytes). On such
case because paylad_aling=2 is bigger than header_align=0 we increase
header_align by 4 bytes. To prevent that we could change the check to:

	if (payload_length &amp;&amp; payload_align &gt; header_align)
		header_align += 4;

but not aligning payload at all is more effective and alignment is not
really needed by H/W (that has been tested on OpenWrt project for few
years now).

Reported-and-tested-by: Antti S. Lankila &lt;alankila@bel.fi&gt;
Debugged-by: Antti S. Lankila &lt;alankila@bel.fi&gt;
Reported-by: Henrik Asp &lt;solenskiner@gmail.com&gt;
Originally-From: Helmut Schaa &lt;helmut.schaa@googlemail.com&gt;
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit cfd9167af14eb4ec21517a32911d460083ee3d59 upstream.

RT2800 and newer hardware require padding between header and payload if
header length is not multiple of 4.

For historical reasons we also align payload to to 4 bytes boundary, but
such alignment is not needed on modern H/W.

Patch fixes skb_under_panic problems reported from time to time:

https://bugzilla.kernel.org/show_bug.cgi?id=84911
https://bugzilla.kernel.org/show_bug.cgi?id=72471
http://marc.info/?l=linux-wireless&amp;m=139108549530402&amp;w=2
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1087591

Panic happened because we eat 4 bytes of skb headroom on each
(re)transmission when sending frame without the payload and the header
length not being multiple of 4 (i.e. QoS header has 26 bytes). On such
case because paylad_aling=2 is bigger than header_align=0 we increase
header_align by 4 bytes. To prevent that we could change the check to:

	if (payload_length &amp;&amp; payload_align &gt; header_align)
		header_align += 4;

but not aligning payload at all is more effective and alignment is not
really needed by H/W (that has been tested on OpenWrt project for few
years now).

Reported-and-tested-by: Antti S. Lankila &lt;alankila@bel.fi&gt;
Debugged-by: Antti S. Lankila &lt;alankila@bel.fi&gt;
Reported-by: Henrik Asp &lt;solenskiner@gmail.com&gt;
Originally-From: Helmut Schaa &lt;helmut.schaa@googlemail.com&gt;
Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>wireless: rt2x00: add new rt2800usb device</title>
<updated>2014-11-13T11:49:01+00:00</updated>
<author>
<name>Cyril Brulebois</name>
<email>kibi@debian.org</email>
</author>
<published>2014-10-28T15:42:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8f32bd289feb3f4d8efd2df0a2899413693a30d7'/>
<id>8f32bd289feb3f4d8efd2df0a2899413693a30d7</id>
<content type='text'>
commit 664d6a792785cc677c2091038ce10322c8d04ae1 upstream.

0x1b75 0xa200 AirLive WN-200USB wireless 11b/g/n dongle

References: https://bugs.debian.org/766802
Reported-by: Martin Mokrejs &lt;mmokrejs@fold.natur.cuni.cz&gt;
Signed-off-by: Cyril Brulebois &lt;kibi@debian.org&gt;
Acked-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 664d6a792785cc677c2091038ce10322c8d04ae1 upstream.

0x1b75 0xa200 AirLive WN-200USB wireless 11b/g/n dongle

References: https://bugs.debian.org/766802
Reported-by: Martin Mokrejs &lt;mmokrejs@fold.natur.cuni.cz&gt;
Signed-off-by: Cyril Brulebois &lt;kibi@debian.org&gt;
Acked-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>wireless: rt2x00: add new rt2800usb devices</title>
<updated>2014-11-03T11:03:52+00:00</updated>
<author>
<name>Xose Vazquez Perez</name>
<email>xose.vazquez@gmail.com</email>
</author>
<published>2014-07-11T19:46:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7ad1b700adf44cf6765359529058726f4b34a996'/>
<id>7ad1b700adf44cf6765359529058726f4b34a996</id>
<content type='text'>
commit 6a06e554daef86c4e8d290284927b081fedb249e upstream.

0x0b05 0x17e8 RT5372 USB 2.0  bgn 2x2 ASUS USB-N14
0x0411 0x0253 RT5572 USB 2.0 abgn 2x2 BUFFALO WLP-U2-300D
0x0df6 0x0078 RT???? Sitecom N300

Cc: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Cc: Helmut Schaa &lt;helmut.schaa@googlemail.com&gt;
Cc: John W. Linville &lt;linville@tuxdriver.com&gt;
Cc: users@rt2x00.serialmonkey.com
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Xose Vazquez Perez &lt;xose.vazquez@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Cc: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6a06e554daef86c4e8d290284927b081fedb249e upstream.

0x0b05 0x17e8 RT5372 USB 2.0  bgn 2x2 ASUS USB-N14
0x0411 0x0253 RT5572 USB 2.0 abgn 2x2 BUFFALO WLP-U2-300D
0x0df6 0x0078 RT???? Sitecom N300

Cc: Ivo van Doorn &lt;IvDoorn@gmail.com&gt;
Cc: Helmut Schaa &lt;helmut.schaa@googlemail.com&gt;
Cc: John W. Linville &lt;linville@tuxdriver.com&gt;
Cc: users@rt2x00.serialmonkey.com
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Xose Vazquez Perez &lt;xose.vazquez@gmail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Cc: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2x00: support Ralink 5362.</title>
<updated>2014-11-03T11:02:27+00:00</updated>
<author>
<name>Canek Peláez Valdés</name>
<email>canek@ciencias.unam.mx</email>
</author>
<published>2014-08-25T00:06:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a80fceec9cb29108e98f561f20767618f32dc52c'/>
<id>a80fceec9cb29108e98f561f20767618f32dc52c</id>
<content type='text'>
commit ac0372abf8524a7572a9cdaac6495eb2eba20457 upstream.

Signed-off-by: Canek Peláez Valdés &lt;canek@ciencias.unam.mx&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Cc: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Cc: Xose Vazquez Perez &lt;xose.vazquez@gmail.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ac0372abf8524a7572a9cdaac6495eb2eba20457 upstream.

Signed-off-by: Canek Peláez Valdés &lt;canek@ciencias.unam.mx&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Cc: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Cc: Xose Vazquez Perez &lt;xose.vazquez@gmail.com&gt;
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt2800: correct BBP1_TX_POWER_CTRL mask</title>
<updated>2014-10-30T16:40:15+00:00</updated>
<author>
<name>Stanislaw Gruszka</name>
<email>sgruszka@redhat.com</email>
</author>
<published>2014-09-24T09:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5cfa5b01b7be5b83ce9f0d5f335b143c46f5b530'/>
<id>5cfa5b01b7be5b83ce9f0d5f335b143c46f5b530</id>
<content type='text'>
commit 01f7feeaf4528bec83798316b3c811701bac5d3e upstream.

Two bits control TX power on BBP_R1 register. Correct the mask,
otherwise we clear additional bit on BBP_R1 register, what can have
unknown, possible negative effect.

Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 01f7feeaf4528bec83798316b3c811701bac5d3e upstream.

Two bits control TX power on BBP_R1 register. Correct the mask,
otherwise we clear additional bit on BBP_R1 register, what can have
unknown, possible negative effect.

Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>rt2800usb: Don't perform DMA from stack</title>
<updated>2014-07-07T19:04:34+00:00</updated>
<author>
<name>Andrea Merello</name>
<email>andrea.merello@gmail.com</email>
</author>
<published>2014-07-05T19:07:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2c4db12ec469b9fcdad9f6bfd6fa20e65a563ac5'/>
<id>2c4db12ec469b9fcdad9f6bfd6fa20e65a563ac5</id>
<content type='text'>
Function rt2800usb_autorun_detect() passes the address of a variable
allocated onto the stack to be used for DMA by the USB layer. This has
been caught by my debugging-enabled kernel.

This patch change things in order to allocate that variable via
kmalloc, and it adjusts things to handle the kmalloc failure case,
propagating the error.

[ 7363.238852] ------------[ cut here ]------------
[ 7363.243529] WARNING: CPU: 1 PID: 5235 at lib/dma-debug.c:1153 check_for_stack+0xa4/0xf0()
[ 7363.251759] ehci-pci 0000:00:04.1: DMA-API: device driver maps memory fromstack [addr=ffff88006b81bad4]
[ 7363.261210] Modules linked in: rt2800usb(O+) rt2800lib(O) rt2x00usb(O) rt2x00lib(O) rtl818x_pci(O) rtl8187 led_class eeprom_93cx6 mac80211 cfg80211 [last unloaded: rt2x00lib]
[ 7363.277143] CPU: 1 PID: 5235 Comm: systemd-udevd Tainted: G           O  3.16.0-rc3-wl+ #31
[ 7363.285546] Hardware name: System manufacturer System Product Name/M3N78 PRO, BIOS ASUS M3N78 PRO ACPI BIOS Revision 1402 12/04/2009
[ 7363.297511]  0000000000000009 ffff88006b81b710 ffffffff8175dcad ffff88006b81b758
[ 7363.305062]  ffff88006b81b748 ffffffff8106d372 ffff88006cf10098 ffff88006cead6a0
[ 7363.312622]  ffff88006b81bad4 ffffffff81c1e7c0 ffff88006cf10098 ffff88006b81b7a8
[ 7363.320161] Call Trace:
[ 7363.322661]  [&lt;ffffffff8175dcad&gt;] dump_stack+0x4d/0x6f
[ 7363.327847]  [&lt;ffffffff8106d372&gt;] warn_slowpath_common+0x82/0xb0
[ 7363.333893]  [&lt;ffffffff8106d3e7&gt;] warn_slowpath_fmt+0x47/0x50
[ 7363.339686]  [&lt;ffffffff813a93b4&gt;] check_for_stack+0xa4/0xf0
[ 7363.345298]  [&lt;ffffffff813a995c&gt;] debug_dma_map_page+0x10c/0x150
[ 7363.351367]  [&lt;ffffffff81521bd9&gt;] usb_hcd_map_urb_for_dma+0x229/0x720
[ 7363.357890]  [&lt;ffffffff8152256d&gt;] usb_hcd_submit_urb+0x2fd/0x930
[ 7363.363929]  [&lt;ffffffff810eac31&gt;] ? irq_work_queue+0x71/0xd0
[ 7363.369617]  [&lt;ffffffff810ab5a7&gt;] ? wake_up_klogd+0x37/0x50
[ 7363.375219]  [&lt;ffffffff810ab7a5&gt;] ? console_unlock+0x1e5/0x420
[ 7363.381081]  [&lt;ffffffff810abc25&gt;] ? vprintk_emit+0x245/0x530
[ 7363.386773]  [&lt;ffffffff81523d3c&gt;] usb_submit_urb+0x30c/0x580
[ 7363.392462]  [&lt;ffffffff81524295&gt;] usb_start_wait_urb+0x65/0xf0
[ 7363.398325]  [&lt;ffffffff815243ed&gt;] usb_control_msg+0xcd/0x110
[ 7363.404014]  [&lt;ffffffffa005514d&gt;] rt2x00usb_vendor_request+0xbd/0x170 [rt2x00usb]
[ 7363.411544]  [&lt;ffffffffa0074292&gt;] rt2800usb_autorun_detect+0x32/0x50 [rt2800usb]
[ 7363.418986]  [&lt;ffffffffa0074aa1&gt;] rt2800usb_read_eeprom+0x11/0x70 [rt2800usb]
[ 7363.426168]  [&lt;ffffffffa0063ffd&gt;] rt2800_probe_hw+0x11d/0xf90 [rt2800lib]
[ 7363.432989]  [&lt;ffffffffa0074b7d&gt;] rt2800usb_probe_hw+0xd/0x50 [rt2800usb]
[ 7363.439808]  [&lt;ffffffffa00453d8&gt;] rt2x00lib_probe_dev+0x238/0x7c0 [rt2x00lib]
[ 7363.446992]  [&lt;ffffffffa00bfa48&gt;] ? ieee80211_led_names+0xb8/0x100 [mac80211]
[ 7363.454156]  [&lt;ffffffffa0056116&gt;] rt2x00usb_probe+0x156/0x1f0 [rt2x00usb]
[ 7363.460971]  [&lt;ffffffffa0074250&gt;] rt2800usb_probe+0x10/0x20 [rt2800usb]
[ 7363.467616]  [&lt;ffffffff8152799e&gt;] usb_probe_interface+0xce/0x1c0
[ 7363.473651]  [&lt;ffffffff81480c20&gt;] really_probe+0x70/0x240
[ 7363.479079]  [&lt;ffffffff81480f01&gt;] __driver_attach+0xa1/0xb0
[ 7363.484682]  [&lt;ffffffff81480e60&gt;] ? __device_attach+0x70/0x70
[ 7363.490461]  [&lt;ffffffff8147eef3&gt;] bus_for_each_dev+0x63/0xa0
[ 7363.496146]  [&lt;ffffffff814807c9&gt;] driver_attach+0x19/0x20
[ 7363.501570]  [&lt;ffffffff81480468&gt;] bus_add_driver+0x178/0x220
[ 7363.507270]  [&lt;ffffffff8148151b&gt;] driver_register+0x5b/0xe0
[ 7363.512874]  [&lt;ffffffff815271b0&gt;] usb_register_driver+0xa0/0x170
[ 7363.518905]  [&lt;ffffffffa007a000&gt;] ? 0xffffffffa0079fff
[ 7363.524074]  [&lt;ffffffffa007a01e&gt;] rt2800usb_driver_init+0x1e/0x20 [rt2800usb]
[ 7363.531247]  [&lt;ffffffff810002d4&gt;] do_one_initcall+0x84/0x1b0
[ 7363.536932]  [&lt;ffffffff8113aa60&gt;] ? kfree+0xd0/0x110
[ 7363.541931]  [&lt;ffffffff8112730a&gt;] ? __vunmap+0xaa/0xf0
[ 7363.547538]  [&lt;ffffffff810ca07e&gt;] load_module+0x1aee/0x2040
[ 7363.553141]  [&lt;ffffffff810c6f10&gt;] ? store_uevent+0x50/0x50
[ 7363.558676]  [&lt;ffffffff810ca66e&gt;] SyS_init_module+0x9e/0xc0
[ 7363.564285]  [&lt;ffffffff81764012&gt;] system_call_fastpath+0x16/0x1b
[ 7363.570338] ---[ end trace 01ef5f822bea9882 ]---

Signed-off-by: Andrea Merello &lt;andrea.merello@gmail.com&gt;
Acked-by: Helmut Schaa &lt;helmut.schaa@googlemail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Function rt2800usb_autorun_detect() passes the address of a variable
allocated onto the stack to be used for DMA by the USB layer. This has
been caught by my debugging-enabled kernel.

This patch change things in order to allocate that variable via
kmalloc, and it adjusts things to handle the kmalloc failure case,
propagating the error.

[ 7363.238852] ------------[ cut here ]------------
[ 7363.243529] WARNING: CPU: 1 PID: 5235 at lib/dma-debug.c:1153 check_for_stack+0xa4/0xf0()
[ 7363.251759] ehci-pci 0000:00:04.1: DMA-API: device driver maps memory fromstack [addr=ffff88006b81bad4]
[ 7363.261210] Modules linked in: rt2800usb(O+) rt2800lib(O) rt2x00usb(O) rt2x00lib(O) rtl818x_pci(O) rtl8187 led_class eeprom_93cx6 mac80211 cfg80211 [last unloaded: rt2x00lib]
[ 7363.277143] CPU: 1 PID: 5235 Comm: systemd-udevd Tainted: G           O  3.16.0-rc3-wl+ #31
[ 7363.285546] Hardware name: System manufacturer System Product Name/M3N78 PRO, BIOS ASUS M3N78 PRO ACPI BIOS Revision 1402 12/04/2009
[ 7363.297511]  0000000000000009 ffff88006b81b710 ffffffff8175dcad ffff88006b81b758
[ 7363.305062]  ffff88006b81b748 ffffffff8106d372 ffff88006cf10098 ffff88006cead6a0
[ 7363.312622]  ffff88006b81bad4 ffffffff81c1e7c0 ffff88006cf10098 ffff88006b81b7a8
[ 7363.320161] Call Trace:
[ 7363.322661]  [&lt;ffffffff8175dcad&gt;] dump_stack+0x4d/0x6f
[ 7363.327847]  [&lt;ffffffff8106d372&gt;] warn_slowpath_common+0x82/0xb0
[ 7363.333893]  [&lt;ffffffff8106d3e7&gt;] warn_slowpath_fmt+0x47/0x50
[ 7363.339686]  [&lt;ffffffff813a93b4&gt;] check_for_stack+0xa4/0xf0
[ 7363.345298]  [&lt;ffffffff813a995c&gt;] debug_dma_map_page+0x10c/0x150
[ 7363.351367]  [&lt;ffffffff81521bd9&gt;] usb_hcd_map_urb_for_dma+0x229/0x720
[ 7363.357890]  [&lt;ffffffff8152256d&gt;] usb_hcd_submit_urb+0x2fd/0x930
[ 7363.363929]  [&lt;ffffffff810eac31&gt;] ? irq_work_queue+0x71/0xd0
[ 7363.369617]  [&lt;ffffffff810ab5a7&gt;] ? wake_up_klogd+0x37/0x50
[ 7363.375219]  [&lt;ffffffff810ab7a5&gt;] ? console_unlock+0x1e5/0x420
[ 7363.381081]  [&lt;ffffffff810abc25&gt;] ? vprintk_emit+0x245/0x530
[ 7363.386773]  [&lt;ffffffff81523d3c&gt;] usb_submit_urb+0x30c/0x580
[ 7363.392462]  [&lt;ffffffff81524295&gt;] usb_start_wait_urb+0x65/0xf0
[ 7363.398325]  [&lt;ffffffff815243ed&gt;] usb_control_msg+0xcd/0x110
[ 7363.404014]  [&lt;ffffffffa005514d&gt;] rt2x00usb_vendor_request+0xbd/0x170 [rt2x00usb]
[ 7363.411544]  [&lt;ffffffffa0074292&gt;] rt2800usb_autorun_detect+0x32/0x50 [rt2800usb]
[ 7363.418986]  [&lt;ffffffffa0074aa1&gt;] rt2800usb_read_eeprom+0x11/0x70 [rt2800usb]
[ 7363.426168]  [&lt;ffffffffa0063ffd&gt;] rt2800_probe_hw+0x11d/0xf90 [rt2800lib]
[ 7363.432989]  [&lt;ffffffffa0074b7d&gt;] rt2800usb_probe_hw+0xd/0x50 [rt2800usb]
[ 7363.439808]  [&lt;ffffffffa00453d8&gt;] rt2x00lib_probe_dev+0x238/0x7c0 [rt2x00lib]
[ 7363.446992]  [&lt;ffffffffa00bfa48&gt;] ? ieee80211_led_names+0xb8/0x100 [mac80211]
[ 7363.454156]  [&lt;ffffffffa0056116&gt;] rt2x00usb_probe+0x156/0x1f0 [rt2x00usb]
[ 7363.460971]  [&lt;ffffffffa0074250&gt;] rt2800usb_probe+0x10/0x20 [rt2800usb]
[ 7363.467616]  [&lt;ffffffff8152799e&gt;] usb_probe_interface+0xce/0x1c0
[ 7363.473651]  [&lt;ffffffff81480c20&gt;] really_probe+0x70/0x240
[ 7363.479079]  [&lt;ffffffff81480f01&gt;] __driver_attach+0xa1/0xb0
[ 7363.484682]  [&lt;ffffffff81480e60&gt;] ? __device_attach+0x70/0x70
[ 7363.490461]  [&lt;ffffffff8147eef3&gt;] bus_for_each_dev+0x63/0xa0
[ 7363.496146]  [&lt;ffffffff814807c9&gt;] driver_attach+0x19/0x20
[ 7363.501570]  [&lt;ffffffff81480468&gt;] bus_add_driver+0x178/0x220
[ 7363.507270]  [&lt;ffffffff8148151b&gt;] driver_register+0x5b/0xe0
[ 7363.512874]  [&lt;ffffffff815271b0&gt;] usb_register_driver+0xa0/0x170
[ 7363.518905]  [&lt;ffffffffa007a000&gt;] ? 0xffffffffa0079fff
[ 7363.524074]  [&lt;ffffffffa007a01e&gt;] rt2800usb_driver_init+0x1e/0x20 [rt2800usb]
[ 7363.531247]  [&lt;ffffffff810002d4&gt;] do_one_initcall+0x84/0x1b0
[ 7363.536932]  [&lt;ffffffff8113aa60&gt;] ? kfree+0xd0/0x110
[ 7363.541931]  [&lt;ffffffff8112730a&gt;] ? __vunmap+0xaa/0xf0
[ 7363.547538]  [&lt;ffffffff810ca07e&gt;] load_module+0x1aee/0x2040
[ 7363.553141]  [&lt;ffffffff810c6f10&gt;] ? store_uevent+0x50/0x50
[ 7363.558676]  [&lt;ffffffff810ca66e&gt;] SyS_init_module+0x9e/0xc0
[ 7363.564285]  [&lt;ffffffff81764012&gt;] system_call_fastpath+0x16/0x1b
[ 7363.570338] ---[ end trace 01ef5f822bea9882 ]---

Signed-off-by: Andrea Merello &lt;andrea.merello@gmail.com&gt;
Acked-by: Helmut Schaa &lt;helmut.schaa@googlemail.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
