aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-15 15:34:35 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-15 15:34:35 -0500
commit793e039ea07191946b5ec136db00f8b03ee4a13e (patch)
tree8338b7d19af9a8f4d83b9bb509104ed06232b896
parentaa2797b30c322531981f24833b082446072d3c79 (diff)
parent97f9c5f211d1f063b1745370e6b4fd64d6adaeff (diff)
Merge tag 'usb-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are a few small USB driver fixes for 4.10-rc4 to resolve some reported issues. The "largest" here is a number of bugs being fixed in the ch341 usb-serial driver, to hopefully resolve the mess of different devices floating around that use this driver that have been having problems with the 4.10-rc1 release. There's also a tiny musb fix that I missed in the last pull request, as well as the traditional xhci fix rounding out the batch. All have been in linux-next with no reported issues" * tag 'usb-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: xhci: fix deadlock at host remove by running watchdog correctly USB: serial: ch341: fix control-message error handling usb: musb: fix runtime PM in debugfs wusbcore: Fix one more crypto-on-the-stack bug USB: serial: kl5kusb105: fix line-state error handling USB: serial: ch341: fix baud rate and line-control handling USB: serial: ch341: fix line settings after reset-resume USB: serial: ch341: fix resume after reset USB: serial: ch341: fix open error handling USB: serial: ch341: fix modem-control and B0 handling USB: serial: ch341: fix open and resume after B0 USB: serial: ch341: fix initial modem-control state
-rw-r--r--drivers/usb/host/xhci-ring.c11
-rw-r--r--drivers/usb/host/xhci.c13
-rw-r--r--drivers/usb/musb/musb_debugfs.c20
-rw-r--r--drivers/usb/serial/ch341.c108
-rw-r--r--drivers/usb/serial/kl5kusb105.c9
-rw-r--r--drivers/usb/wusbcore/crypto.c3
6 files changed, 98 insertions, 66 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 25f522b09dd9..e32029a31ca4 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -913,17 +913,6 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
913 spin_lock_irqsave(&xhci->lock, flags); 913 spin_lock_irqsave(&xhci->lock, flags);
914 914
915 ep->stop_cmds_pending--; 915 ep->stop_cmds_pending--;
916 if (xhci->xhc_state & XHCI_STATE_REMOVING) {
917 spin_unlock_irqrestore(&xhci->lock, flags);
918 return;
919 }
920 if (xhci->xhc_state & XHCI_STATE_DYING) {
921 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
922 "Stop EP timer ran, but another timer marked "
923 "xHCI as DYING, exiting.");
924 spin_unlock_irqrestore(&xhci->lock, flags);
925 return;
926 }
927 if (!(ep->stop_cmds_pending == 0 && (ep->ep_state & EP_HALT_PENDING))) { 916 if (!(ep->stop_cmds_pending == 0 && (ep->ep_state & EP_HALT_PENDING))) {
928 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb, 917 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
929 "Stop EP timer ran, but no command pending, " 918 "Stop EP timer ran, but no command pending, "
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 0c8deb9ed42d..9a0ec116654a 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1534,19 +1534,6 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
1534 xhci_urb_free_priv(urb_priv); 1534 xhci_urb_free_priv(urb_priv);
1535 return ret; 1535 return ret;
1536 } 1536 }
1537 if ((xhci->xhc_state & XHCI_STATE_DYING) ||
1538 (xhci->xhc_state & XHCI_STATE_HALTED)) {
1539 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
1540 "Ep 0x%x: URB %p to be canceled on "
1541 "non-responsive xHCI host.",
1542 urb->ep->desc.bEndpointAddress, urb);
1543 /* Let the stop endpoint command watchdog timer (which set this
1544 * state) finish cleaning up the endpoint TD lists. We must
1545 * have caught it in the middle of dropping a lock and giving
1546 * back an URB.
1547 */
1548 goto done;
1549 }
1550 1537
1551 ep_index = xhci_get_endpoint_index(&urb->ep->desc); 1538 ep_index = xhci_get_endpoint_index(&urb->ep->desc);
1552 ep = &xhci->devs[urb->dev->slot_id]->eps[ep_index]; 1539 ep = &xhci->devs[urb->dev->slot_id]->eps[ep_index];
diff --git a/drivers/usb/musb/musb_debugfs.c b/drivers/usb/musb/musb_debugfs.c
index 4fef50e5c8c1..dd70c88419d2 100644
--- a/drivers/usb/musb/musb_debugfs.c
+++ b/drivers/usb/musb/musb_debugfs.c
@@ -114,6 +114,7 @@ static int musb_regdump_show(struct seq_file *s, void *unused)
114 unsigned i; 114 unsigned i;
115 115
116 seq_printf(s, "MUSB (M)HDRC Register Dump\n"); 116 seq_printf(s, "MUSB (M)HDRC Register Dump\n");
117 pm_runtime_get_sync(musb->controller);
117 118
118 for (i = 0; i < ARRAY_SIZE(musb_regmap); i++) { 119 for (i = 0; i < ARRAY_SIZE(musb_regmap); i++) {
119 switch (musb_regmap[i].size) { 120 switch (musb_regmap[i].size) {
@@ -132,6 +133,8 @@ static int musb_regdump_show(struct seq_file *s, void *unused)
132 } 133 }
133 } 134 }
134 135
136 pm_runtime_mark_last_busy(musb->controller);
137 pm_runtime_put_autosuspend(musb->controller);
135 return 0; 138 return 0;
136} 139}
137 140
@@ -145,7 +148,10 @@ static int musb_test_mode_show(struct seq_file *s, void *unused)
145 struct musb *musb = s->private; 148 struct musb *musb = s->private;
146 unsigned test; 149 unsigned test;
147 150
151 pm_runtime_get_sync(musb->controller);
148 test = musb_readb(musb->mregs, MUSB_TESTMODE); 152 test = musb_readb(musb->mregs, MUSB_TESTMODE);
153 pm_runtime_mark_last_busy(musb->controller);
154 pm_runtime_put_autosuspend(musb->controller);
149 155
150 if (test & MUSB_TEST_FORCE_HOST) 156 if (test & MUSB_TEST_FORCE_HOST)
151 seq_printf(s, "force host\n"); 157 seq_printf(s, "force host\n");
@@ -194,11 +200,12 @@ static ssize_t musb_test_mode_write(struct file *file,
194 u8 test; 200 u8 test;
195 char buf[18]; 201 char buf[18];
196 202
203 pm_runtime_get_sync(musb->controller);
197 test = musb_readb(musb->mregs, MUSB_TESTMODE); 204 test = musb_readb(musb->mregs, MUSB_TESTMODE);
198 if (test) { 205 if (test) {
199 dev_err(musb->controller, "Error: test mode is already set. " 206 dev_err(musb->controller, "Error: test mode is already set. "
200 "Please do USB Bus Reset to start a new test.\n"); 207 "Please do USB Bus Reset to start a new test.\n");
201 return count; 208 goto ret;
202 } 209 }
203 210
204 memset(buf, 0x00, sizeof(buf)); 211 memset(buf, 0x00, sizeof(buf));
@@ -234,6 +241,9 @@ static ssize_t musb_test_mode_write(struct file *file,
234 241
235 musb_writeb(musb->mregs, MUSB_TESTMODE, test); 242 musb_writeb(musb->mregs, MUSB_TESTMODE, test);
236 243
244ret:
245 pm_runtime_mark_last_busy(musb->controller);
246 pm_runtime_put_autosuspend(musb->controller);
237 return count; 247 return count;
238} 248}
239 249
@@ -254,8 +264,13 @@ static int musb_softconnect_show(struct seq_file *s, void *unused)
254 switch (musb->xceiv->otg->state) { 264 switch (musb->xceiv->otg->state) {
255 case OTG_STATE_A_HOST: 265 case OTG_STATE_A_HOST:
256 case OTG_STATE_A_WAIT_BCON: 266 case OTG_STATE_A_WAIT_BCON:
267 pm_runtime_get_sync(musb->controller);
268
257 reg = musb_readb(musb->mregs, MUSB_DEVCTL); 269 reg = musb_readb(musb->mregs, MUSB_DEVCTL);
258 connect = reg & MUSB_DEVCTL_SESSION ? 1 : 0; 270 connect = reg & MUSB_DEVCTL_SESSION ? 1 : 0;
271
272 pm_runtime_mark_last_busy(musb->controller);
273 pm_runtime_put_autosuspend(musb->controller);
259 break; 274 break;
260 default: 275 default:
261 connect = -1; 276 connect = -1;
@@ -284,6 +299,7 @@ static ssize_t musb_softconnect_write(struct file *file,
284 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) 299 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
285 return -EFAULT; 300 return -EFAULT;
286 301
302 pm_runtime_get_sync(musb->controller);
287 if (!strncmp(buf, "0", 1)) { 303 if (!strncmp(buf, "0", 1)) {
288 switch (musb->xceiv->otg->state) { 304 switch (musb->xceiv->otg->state) {
289 case OTG_STATE_A_HOST: 305 case OTG_STATE_A_HOST:
@@ -314,6 +330,8 @@ static ssize_t musb_softconnect_write(struct file *file,
314 } 330 }
315 } 331 }
316 332
333 pm_runtime_mark_last_busy(musb->controller);
334 pm_runtime_put_autosuspend(musb->controller);
317 return count; 335 return count;
318} 336}
319 337
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 2597b83a8ae2..95aa5233726c 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -95,6 +95,7 @@ struct ch341_private {
95 unsigned baud_rate; /* set baud rate */ 95 unsigned baud_rate; /* set baud rate */
96 u8 line_control; /* set line control value RTS/DTR */ 96 u8 line_control; /* set line control value RTS/DTR */
97 u8 line_status; /* active status of modem control inputs */ 97 u8 line_status; /* active status of modem control inputs */
98 u8 lcr;
98}; 99};
99 100
100static void ch341_set_termios(struct tty_struct *tty, 101static void ch341_set_termios(struct tty_struct *tty,
@@ -112,6 +113,8 @@ static int ch341_control_out(struct usb_device *dev, u8 request,
112 r = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), request, 113 r = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), request,
113 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, 114 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
114 value, index, NULL, 0, DEFAULT_TIMEOUT); 115 value, index, NULL, 0, DEFAULT_TIMEOUT);
116 if (r < 0)
117 dev_err(&dev->dev, "failed to send control message: %d\n", r);
115 118
116 return r; 119 return r;
117} 120}
@@ -129,11 +132,24 @@ static int ch341_control_in(struct usb_device *dev,
129 r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request, 132 r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request,
130 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 133 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
131 value, index, buf, bufsize, DEFAULT_TIMEOUT); 134 value, index, buf, bufsize, DEFAULT_TIMEOUT);
132 return r; 135 if (r < bufsize) {
136 if (r >= 0) {
137 dev_err(&dev->dev,
138 "short control message received (%d < %u)\n",
139 r, bufsize);
140 r = -EIO;
141 }
142
143 dev_err(&dev->dev, "failed to receive control message: %d\n",
144 r);
145 return r;
146 }
147
148 return 0;
133} 149}
134 150
135static int ch341_init_set_baudrate(struct usb_device *dev, 151static int ch341_set_baudrate_lcr(struct usb_device *dev,
136 struct ch341_private *priv, unsigned ctrl) 152 struct ch341_private *priv, u8 lcr)
137{ 153{
138 short a; 154 short a;
139 int r; 155 int r;
@@ -156,9 +172,19 @@ static int ch341_init_set_baudrate(struct usb_device *dev,
156 factor = 0x10000 - factor; 172 factor = 0x10000 - factor;
157 a = (factor & 0xff00) | divisor; 173 a = (factor & 0xff00) | divisor;
158 174
159 /* 0x9c is "enable SFR_UART Control register and timer" */ 175 /*
160 r = ch341_control_out(dev, CH341_REQ_SERIAL_INIT, 176 * CH341A buffers data until a full endpoint-size packet (32 bytes)
161 0x9c | (ctrl << 8), a | 0x80); 177 * has been received unless bit 7 is set.
178 */
179 a |= BIT(7);
180
181 r = ch341_control_out(dev, CH341_REQ_WRITE_REG, 0x1312, a);
182 if (r)
183 return r;
184
185 r = ch341_control_out(dev, CH341_REQ_WRITE_REG, 0x2518, lcr);
186 if (r)
187 return r;
162 188
163 return r; 189 return r;
164} 190}
@@ -170,9 +196,9 @@ static int ch341_set_handshake(struct usb_device *dev, u8 control)
170 196
171static int ch341_get_status(struct usb_device *dev, struct ch341_private *priv) 197static int ch341_get_status(struct usb_device *dev, struct ch341_private *priv)
172{ 198{
199 const unsigned int size = 2;
173 char *buffer; 200 char *buffer;
174 int r; 201 int r;
175 const unsigned size = 8;
176 unsigned long flags; 202 unsigned long flags;
177 203
178 buffer = kmalloc(size, GFP_KERNEL); 204 buffer = kmalloc(size, GFP_KERNEL);
@@ -183,14 +209,9 @@ static int ch341_get_status(struct usb_device *dev, struct ch341_private *priv)
183 if (r < 0) 209 if (r < 0)
184 goto out; 210 goto out;
185 211
186 /* setup the private status if available */ 212 spin_lock_irqsave(&priv->lock, flags);
187 if (r == 2) { 213 priv->line_status = (~(*buffer)) & CH341_BITS_MODEM_STAT;
188 r = 0; 214 spin_unlock_irqrestore(&priv->lock, flags);
189 spin_lock_irqsave(&priv->lock, flags);
190 priv->line_status = (~(*buffer)) & CH341_BITS_MODEM_STAT;
191 spin_unlock_irqrestore(&priv->lock, flags);
192 } else
193 r = -EPROTO;
194 215
195out: kfree(buffer); 216out: kfree(buffer);
196 return r; 217 return r;
@@ -200,9 +221,9 @@ out: kfree(buffer);
200 221
201static int ch341_configure(struct usb_device *dev, struct ch341_private *priv) 222static int ch341_configure(struct usb_device *dev, struct ch341_private *priv)
202{ 223{
224 const unsigned int size = 2;
203 char *buffer; 225 char *buffer;
204 int r; 226 int r;
205 const unsigned size = 8;
206 227
207 buffer = kmalloc(size, GFP_KERNEL); 228 buffer = kmalloc(size, GFP_KERNEL);
208 if (!buffer) 229 if (!buffer)
@@ -232,7 +253,7 @@ static int ch341_configure(struct usb_device *dev, struct ch341_private *priv)
232 if (r < 0) 253 if (r < 0)
233 goto out; 254 goto out;
234 255
235 r = ch341_init_set_baudrate(dev, priv, 0); 256 r = ch341_set_baudrate_lcr(dev, priv, priv->lcr);
236 if (r < 0) 257 if (r < 0)
237 goto out; 258 goto out;
238 259
@@ -258,7 +279,6 @@ static int ch341_port_probe(struct usb_serial_port *port)
258 279
259 spin_lock_init(&priv->lock); 280 spin_lock_init(&priv->lock);
260 priv->baud_rate = DEFAULT_BAUD_RATE; 281 priv->baud_rate = DEFAULT_BAUD_RATE;
261 priv->line_control = CH341_BIT_RTS | CH341_BIT_DTR;
262 282
263 r = ch341_configure(port->serial->dev, priv); 283 r = ch341_configure(port->serial->dev, priv);
264 if (r < 0) 284 if (r < 0)
@@ -320,7 +340,7 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port)
320 340
321 r = ch341_configure(serial->dev, priv); 341 r = ch341_configure(serial->dev, priv);
322 if (r) 342 if (r)
323 goto out; 343 return r;
324 344
325 if (tty) 345 if (tty)
326 ch341_set_termios(tty, port, NULL); 346 ch341_set_termios(tty, port, NULL);
@@ -330,12 +350,19 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port)
330 if (r) { 350 if (r) {
331 dev_err(&port->dev, "%s - failed to submit interrupt urb: %d\n", 351 dev_err(&port->dev, "%s - failed to submit interrupt urb: %d\n",
332 __func__, r); 352 __func__, r);
333 goto out; 353 return r;
334 } 354 }
335 355
336 r = usb_serial_generic_open(tty, port); 356 r = usb_serial_generic_open(tty, port);
357 if (r)
358 goto err_kill_interrupt_urb;
359
360 return 0;
361
362err_kill_interrupt_urb:
363 usb_kill_urb(port->interrupt_in_urb);
337 364
338out: return r; 365 return r;
339} 366}
340 367
341/* Old_termios contains the original termios settings and 368/* Old_termios contains the original termios settings and
@@ -356,7 +383,6 @@ static void ch341_set_termios(struct tty_struct *tty,
356 383
357 baud_rate = tty_get_baud_rate(tty); 384 baud_rate = tty_get_baud_rate(tty);
358 385
359 priv->baud_rate = baud_rate;
360 ctrl = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX; 386 ctrl = CH341_LCR_ENABLE_RX | CH341_LCR_ENABLE_TX;
361 387
362 switch (C_CSIZE(tty)) { 388 switch (C_CSIZE(tty)) {
@@ -386,22 +412,25 @@ static void ch341_set_termios(struct tty_struct *tty,
386 ctrl |= CH341_LCR_STOP_BITS_2; 412 ctrl |= CH341_LCR_STOP_BITS_2;
387 413
388 if (baud_rate) { 414 if (baud_rate) {
389 spin_lock_irqsave(&priv->lock, flags); 415 priv->baud_rate = baud_rate;
390 priv->line_control |= (CH341_BIT_DTR | CH341_BIT_RTS); 416
391 spin_unlock_irqrestore(&priv->lock, flags); 417 r = ch341_set_baudrate_lcr(port->serial->dev, priv, ctrl);
392 r = ch341_init_set_baudrate(port->serial->dev, priv, ctrl);
393 if (r < 0 && old_termios) { 418 if (r < 0 && old_termios) {
394 priv->baud_rate = tty_termios_baud_rate(old_termios); 419 priv->baud_rate = tty_termios_baud_rate(old_termios);
395 tty_termios_copy_hw(&tty->termios, old_termios); 420 tty_termios_copy_hw(&tty->termios, old_termios);
421 } else if (r == 0) {
422 priv->lcr = ctrl;
396 } 423 }
397 } else {
398 spin_lock_irqsave(&priv->lock, flags);
399 priv->line_control &= ~(CH341_BIT_DTR | CH341_BIT_RTS);
400 spin_unlock_irqrestore(&priv->lock, flags);
401 } 424 }
402 425
403 ch341_set_handshake(port->serial->dev, priv->line_control); 426 spin_lock_irqsave(&priv->lock, flags);
427 if (C_BAUD(tty) == B0)
428 priv->line_control &= ~(CH341_BIT_DTR | CH341_BIT_RTS);
429 else if (old_termios && (old_termios->c_cflag & CBAUD) == B0)
430 priv->line_control |= (CH341_BIT_DTR | CH341_BIT_RTS);
431 spin_unlock_irqrestore(&priv->lock, flags);
404 432
433 ch341_set_handshake(port->serial->dev, priv->line_control);
405} 434}
406 435
407static void ch341_break_ctl(struct tty_struct *tty, int break_state) 436static void ch341_break_ctl(struct tty_struct *tty, int break_state)
@@ -576,14 +605,23 @@ static int ch341_tiocmget(struct tty_struct *tty)
576 605
577static int ch341_reset_resume(struct usb_serial *serial) 606static int ch341_reset_resume(struct usb_serial *serial)
578{ 607{
579 struct ch341_private *priv; 608 struct usb_serial_port *port = serial->port[0];
580 609 struct ch341_private *priv = usb_get_serial_port_data(port);
581 priv = usb_get_serial_port_data(serial->port[0]); 610 int ret;
582 611
583 /* reconfigure ch341 serial port after bus-reset */ 612 /* reconfigure ch341 serial port after bus-reset */
584 ch341_configure(serial->dev, priv); 613 ch341_configure(serial->dev, priv);
585 614
586 return 0; 615 if (tty_port_initialized(&port->port)) {
616 ret = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
617 if (ret) {
618 dev_err(&port->dev, "failed to submit interrupt urb: %d\n",
619 ret);
620 return ret;
621 }
622 }
623
624 return usb_serial_generic_resume(serial);
587} 625}
588 626
589static struct usb_serial_driver ch341_device = { 627static struct usb_serial_driver ch341_device = {
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 0ee190fc1bf8..6cb45757818f 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -192,10 +192,11 @@ static int klsi_105_get_line_state(struct usb_serial_port *port,
192 status_buf, KLSI_STATUSBUF_LEN, 192 status_buf, KLSI_STATUSBUF_LEN,
193 10000 193 10000
194 ); 194 );
195 if (rc < 0) 195 if (rc != KLSI_STATUSBUF_LEN) {
196 dev_err(&port->dev, "Reading line status failed (error = %d)\n", 196 dev_err(&port->dev, "reading line status failed: %d\n", rc);
197 rc); 197 if (rc >= 0)
198 else { 198 rc = -EIO;
199 } else {
199 status = get_unaligned_le16(status_buf); 200 status = get_unaligned_le16(status_buf);
200 201
201 dev_info(&port->serial->dev->dev, "read status %x %x\n", 202 dev_info(&port->serial->dev->dev, "read status %x %x\n",
diff --git a/drivers/usb/wusbcore/crypto.c b/drivers/usb/wusbcore/crypto.c
index 79451f7ef1b7..062c205f0046 100644
--- a/drivers/usb/wusbcore/crypto.c
+++ b/drivers/usb/wusbcore/crypto.c
@@ -216,7 +216,6 @@ static int wusb_ccm_mac(struct crypto_skcipher *tfm_cbc,
216 struct scatterlist sg[4], sg_dst; 216 struct scatterlist sg[4], sg_dst;
217 void *dst_buf; 217 void *dst_buf;
218 size_t dst_size; 218 size_t dst_size;
219 const u8 bzero[16] = { 0 };
220 u8 iv[crypto_skcipher_ivsize(tfm_cbc)]; 219 u8 iv[crypto_skcipher_ivsize(tfm_cbc)];
221 size_t zero_padding; 220 size_t zero_padding;
222 221
@@ -261,7 +260,7 @@ static int wusb_ccm_mac(struct crypto_skcipher *tfm_cbc,
261 sg_set_buf(&sg[1], &scratch->b1, sizeof(scratch->b1)); 260 sg_set_buf(&sg[1], &scratch->b1, sizeof(scratch->b1));
262 sg_set_buf(&sg[2], b, blen); 261 sg_set_buf(&sg[2], b, blen);
263 /* 0 if well behaved :) */ 262 /* 0 if well behaved :) */
264 sg_set_buf(&sg[3], bzero, zero_padding); 263 sg_set_page(&sg[3], ZERO_PAGE(0), zero_padding, 0);
265 sg_init_one(&sg_dst, dst_buf, dst_size); 264 sg_init_one(&sg_dst, dst_buf, dst_size);
266 265
267 skcipher_request_set_tfm(req, tfm_cbc); 266 skcipher_request_set_tfm(req, tfm_cbc);