···8888 return ret;89899090disable_reg:9191- regulator_disable(ci->platdata->reg_vbus);9191+ if (ci->platdata->reg_vbus)9292+ regulator_disable(ci->platdata->reg_vbus);92939394put_hcd:9495 usb_put_hcd(hcd);
+46
drivers/usb/chipidea/usbmisc_imx.c
···2121#define MX25_USB_PHY_CTRL_OFFSET 0x082222#define MX25_BM_EXTERNAL_VBUS_DIVIDER BIT(23)23232424+#define MX27_H1_PM_BIT BIT(8)2525+#define MX27_H2_PM_BIT BIT(16)2626+#define MX27_OTG_PM_BIT BIT(24)2727+2428#define MX53_USB_OTG_PHY_CTRL_0_OFFSET 0x082529#define MX53_USB_UH2_CTRL_OFFSET 0x142630#define MX53_USB_UH3_CTRL_OFFSET 0x18···6864 spin_unlock_irqrestore(&usbmisc->lock, flags);6965 usleep_range(5000, 10000); /* needed to stabilize voltage */7066 }6767+6868+ return 0;6969+}7070+7171+static int usbmisc_imx27_init(struct imx_usbmisc_data *data)7272+{7373+ unsigned long flags;7474+ u32 val;7575+7676+ switch (data->index) {7777+ case 0:7878+ val = MX27_OTG_PM_BIT;7979+ break;8080+ case 1:8181+ val = MX27_H1_PM_BIT;8282+ break;8383+ case 2:8484+ val = MX27_H2_PM_BIT;8585+ break;8686+ default:8787+ return -EINVAL;8888+ };8989+9090+ spin_lock_irqsave(&usbmisc->lock, flags);9191+ if (data->disable_oc)9292+ val = readl(usbmisc->base) | val;9393+ else9494+ val = readl(usbmisc->base) & ~val;9595+ writel(val, usbmisc->base);9696+ spin_unlock_irqrestore(&usbmisc->lock, flags);71977298 return 0;7399}···162128 .post = usbmisc_imx25_post,163129};164130131131+static const struct usbmisc_ops imx27_usbmisc_ops = {132132+ .init = usbmisc_imx27_init,133133+};134134+165135static const struct usbmisc_ops imx53_usbmisc_ops = {166136 .init = usbmisc_imx53_init,167137};···198160 {199161 .compatible = "fsl,imx25-usbmisc",200162 .data = &imx25_usbmisc_ops,163163+ },164164+ {165165+ .compatible = "fsl,imx27-usbmisc",166166+ .data = &imx27_usbmisc_ops,167167+ },168168+ {169169+ .compatible = "fsl,imx51-usbmisc",170170+ .data = &imx53_usbmisc_ops,201171 },202172 {203173 .compatible = "fsl,imx53-usbmisc",
+104-12
drivers/usb/class/cdc-acm.c
···262262 struct usb_cdc_notification *dr = urb->transfer_buffer;263263 unsigned char *data;264264 int newctrl;265265+ int difference;265266 int retval;266267 int status = urb->status;267268···303302 tty_port_tty_hangup(&acm->port, false);304303 }305304305305+ difference = acm->ctrlin ^ newctrl;306306+ spin_lock(&acm->read_lock);306307 acm->ctrlin = newctrl;308308+ acm->oldcount = acm->iocount;307309308308- dev_dbg(&acm->control->dev,309309- "%s - input control lines: dcd%c dsr%c break%c "310310- "ring%c framing%c parity%c overrun%c\n",311311- __func__,312312- acm->ctrlin & ACM_CTRL_DCD ? '+' : '-',313313- acm->ctrlin & ACM_CTRL_DSR ? '+' : '-',314314- acm->ctrlin & ACM_CTRL_BRK ? '+' : '-',315315- acm->ctrlin & ACM_CTRL_RI ? '+' : '-',316316- acm->ctrlin & ACM_CTRL_FRAMING ? '+' : '-',317317- acm->ctrlin & ACM_CTRL_PARITY ? '+' : '-',318318- acm->ctrlin & ACM_CTRL_OVERRUN ? '+' : '-');319319- break;310310+ if (difference & ACM_CTRL_DSR)311311+ acm->iocount.dsr++;312312+ if (difference & ACM_CTRL_BRK)313313+ acm->iocount.brk++;314314+ if (difference & ACM_CTRL_RI)315315+ acm->iocount.rng++;316316+ if (difference & ACM_CTRL_DCD)317317+ acm->iocount.dcd++;318318+ if (difference & ACM_CTRL_FRAMING)319319+ acm->iocount.frame++;320320+ if (difference & ACM_CTRL_PARITY)321321+ acm->iocount.parity++;322322+ if (difference & ACM_CTRL_OVERRUN)323323+ acm->iocount.overrun++;324324+ spin_unlock(&acm->read_lock);325325+326326+ if (difference)327327+ wake_up_all(&acm->wioctl);328328+329329+ break;320330321331 default:322332 dev_dbg(&acm->control->dev,···808796 return retval;809797}810798799799+static int wait_serial_change(struct acm *acm, unsigned long arg)800800+{801801+ int rv = 0;802802+ DECLARE_WAITQUEUE(wait, current);803803+ struct async_icount old, new;804804+805805+ if (arg & (TIOCM_DSR | TIOCM_RI | TIOCM_CD ))806806+ return -EINVAL;807807+ do {808808+ spin_lock_irq(&acm->read_lock);809809+ old = acm->oldcount;810810+ new = acm->iocount;811811+ acm->oldcount = new;812812+ spin_unlock_irq(&acm->read_lock);813813+814814+ if ((arg & TIOCM_DSR) &&815815+ old.dsr != new.dsr)816816+ break;817817+ if ((arg & TIOCM_CD) &&818818+ old.dcd != new.dcd)819819+ break;820820+ if ((arg & TIOCM_RI) &&821821+ old.rng != new.rng)822822+ break;823823+824824+ add_wait_queue(&acm->wioctl, &wait);825825+ set_current_state(TASK_INTERRUPTIBLE);826826+ schedule();827827+ remove_wait_queue(&acm->wioctl, &wait);828828+ if (acm->disconnected) {829829+ if (arg & TIOCM_CD)830830+ break;831831+ else832832+ rv = -ENODEV;833833+ } else {834834+ if (signal_pending(current))835835+ rv = -ERESTARTSYS;836836+ }837837+ } while (!rv);838838+839839+840840+841841+ return rv;842842+}843843+844844+static int get_serial_usage(struct acm *acm,845845+ struct serial_icounter_struct __user *count)846846+{847847+ struct serial_icounter_struct icount;848848+ int rv = 0;849849+850850+ memset(&icount, 0, sizeof(icount));851851+ icount.dsr = acm->iocount.dsr;852852+ icount.rng = acm->iocount.rng;853853+ icount.dcd = acm->iocount.dcd;854854+ icount.frame = acm->iocount.frame;855855+ icount.overrun = acm->iocount.overrun;856856+ icount.parity = acm->iocount.parity;857857+ icount.brk = acm->iocount.brk;858858+859859+ if (copy_to_user(count, &icount, sizeof(icount)) > 0)860860+ rv = -EFAULT;861861+862862+ return rv;863863+}864864+811865static int acm_tty_ioctl(struct tty_struct *tty,812866 unsigned int cmd, unsigned long arg)813867{···886808 break;887809 case TIOCSSERIAL:888810 rv = set_serial_info(acm, (struct serial_struct __user *) arg);811811+ break;812812+ case TIOCMIWAIT:813813+ rv = usb_autopm_get_interface(acm->control);814814+ if (rv < 0) {815815+ rv = -EIO;816816+ break;817817+ }818818+ rv = wait_serial_change(acm, arg);819819+ usb_autopm_put_interface(acm->control);820820+ break;821821+ case TIOCGICOUNT:822822+ rv = get_serial_usage(acm, (struct serial_icounter_struct __user *) arg);889823 break;890824 }891825···12571167 acm->readsize = readsize;12581168 acm->rx_buflimit = num_rx_buf;12591169 INIT_WORK(&acm->work, acm_softint);11701170+ init_waitqueue_head(&acm->wioctl);12601171 spin_lock_init(&acm->write_lock);12611172 spin_lock_init(&acm->read_lock);12621173 mutex_init(&acm->mutex);···14741383 device_remove_file(&acm->control->dev,14751384 &dev_attr_iCountryCodeRelDate);14761385 }13861386+ wake_up_all(&acm->wioctl);14771387 device_remove_file(&acm->control->dev, &dev_attr_bmCapabilities);14781388 usb_set_intfdata(acm->control, NULL);14791389 usb_set_intfdata(acm->data, NULL);
+3
drivers/usb/class/cdc-acm.h
···106106 struct work_struct work; /* work queue entry for line discipline waking up */107107 unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */108108 unsigned int ctrlout; /* output control lines (DTR, RTS) */109109+ struct async_icount iocount; /* counters for control line changes */110110+ struct async_icount oldcount; /* for comparison of counter */111111+ wait_queue_head_t wioctl; /* for ioctl */109112 unsigned int writesize; /* max packet size for the output bulk endpoint */110113 unsigned int readsize,ctrlsize; /* buffer sizes for freeing */111114 unsigned int minor; /* acm minor number */
-7
drivers/usb/core/config.c
···651651 *652652 * hub-only!! ... and only in reset path, or usb_new_device()653653 * (used by real hubs and virtual root hubs)654654- *655655- * NOTE: if this is a WUSB device and is not authorized, we skip the656656- * whole thing. A non-authorized USB device has no657657- * configurations.658654 */659655int usb_get_configuration(struct usb_device *dev)660656{···662666 struct usb_config_descriptor *desc;663667664668 cfgno = 0;665665- if (dev->authorized == 0) /* Not really an error */666666- goto out_not_authorized;667669 result = -ENOMEM;668670 if (ncfg > USB_MAXCONFIG) {669671 dev_warn(ddev, "too many configurations: %d, "···745751746752err:747753 kfree(desc);748748-out_not_authorized:749754 dev->descriptor.bNumConfigurations = cfgno;750755err2:751756 if (result == -ENOMEM)
···282282283283 if (retval != 0)284284 goto unmap_registers;285285+ device_wakeup_enable(hcd->self.controller);285286286287 if (pci_dev_run_wake(dev))287288 pm_runtime_put_noidle(&dev->dev);
+31-7
drivers/usb/core/hcd.c
···44444545#include <linux/usb.h>4646#include <linux/usb/hcd.h>4747+#include <linux/usb/phy.h>47484849#include "usb.h"4950···25892588 int retval;25902589 struct usb_device *rhdev;2591259025912591+ if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->phy) {25922592+ struct usb_phy *phy = usb_get_phy_dev(hcd->self.controller, 0);25932593+25942594+ if (IS_ERR(phy)) {25952595+ retval = PTR_ERR(phy);25962596+ if (retval == -EPROBE_DEFER)25972597+ return retval;25982598+ } else {25992599+ retval = usb_phy_init(phy);26002600+ if (retval) {26012601+ usb_put_phy(phy);26022602+ return retval;26032603+ }26042604+ hcd->phy = phy;26052605+ hcd->remove_phy = 1;26062606+ }26072607+ }26082608+25922609 dev_info(hcd->self.controller, "%s\n", hcd->product_desc);2593261025942611 /* Keep old behaviour if authorized_default is not in [0, 1]. */···26222603 */26232604 if ((retval = hcd_buffer_create(hcd)) != 0) {26242605 dev_dbg(hcd->self.controller, "pool alloc failed\n");26252625- return retval;26062606+ goto err_remove_phy;26262607 }2627260826282609 if ((retval = usb_register_bus(&hcd->self)) < 0)···27122693 if (hcd->uses_new_polling && HCD_POLL_RH(hcd))27132694 usb_hcd_poll_rh_status(hcd);2714269527152715- /*27162716- * Host controllers don't generate their own wakeup requests;27172717- * they only forward requests from the root hub. Therefore27182718- * controllers should always be enabled for remote wakeup.27192719- */27202720- device_wakeup_enable(hcd->self.controller);27212696 return retval;2722269727232698error_create_attr_group:···27472734 usb_deregister_bus(&hcd->self);27482735err_register_bus:27492736 hcd_buffer_destroy(hcd);27372737+err_remove_phy:27382738+ if (hcd->remove_phy && hcd->phy) {27392739+ usb_phy_shutdown(hcd->phy);27402740+ usb_put_phy(hcd->phy);27412741+ hcd->phy = NULL;27422742+ }27502743 return retval;27512744}27522745EXPORT_SYMBOL_GPL(usb_add_hcd);···28252806 usb_put_dev(hcd->self.root_hub);28262807 usb_deregister_bus(&hcd->self);28272808 hcd_buffer_destroy(hcd);28092809+ if (hcd->remove_phy && hcd->phy) {28102810+ usb_phy_shutdown(hcd->phy);28112811+ usb_put_phy(hcd->phy);28122812+ hcd->phy = NULL;28132813+ }28282814}28292815EXPORT_SYMBOL_GPL(usb_remove_hcd);28302816
+50-35
drivers/usb/core/hub.c
···22352235 return err;22362236 }22372237 }22382238- if (udev->wusb == 1 && udev->authorized == 0) {22392239- udev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);22402240- udev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);22412241- udev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);22422242- } else {22432243- /* read the standard strings and cache them if present */22442244- udev->product = usb_cache_string(udev, udev->descriptor.iProduct);22452245- udev->manufacturer = usb_cache_string(udev,22462246- udev->descriptor.iManufacturer);22472247- udev->serial = usb_cache_string(udev, udev->descriptor.iSerialNumber);22482248- }22382238+22392239+ /* read the standard strings and cache them if present */22402240+ udev->product = usb_cache_string(udev, udev->descriptor.iProduct);22412241+ udev->manufacturer = usb_cache_string(udev,22422242+ udev->descriptor.iManufacturer);22432243+ udev->serial = usb_cache_string(udev, udev->descriptor.iSerialNumber);22442244+22492245 err = usb_enumerate_device_otg(udev);22502246 if (err < 0)22512247 return err;···24232427 usb_dev->authorized = 0;24242428 usb_set_configuration(usb_dev, -1);2425242924262426- kfree(usb_dev->product);24272427- usb_dev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);24282428- kfree(usb_dev->manufacturer);24292429- usb_dev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);24302430- kfree(usb_dev->serial);24312431- usb_dev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);24322432-24332433- usb_destroy_configuration(usb_dev);24342434- usb_dev->descriptor.bNumConfigurations = 0;24352435-24362430out_unauthorized:24372431 usb_unlock_device(usb_dev);24382432 return 0;···24502464 goto error_device_descriptor;24512465 }2452246624532453- kfree(usb_dev->product);24542454- usb_dev->product = NULL;24552455- kfree(usb_dev->manufacturer);24562456- usb_dev->manufacturer = NULL;24572457- kfree(usb_dev->serial);24582458- usb_dev->serial = NULL;24592459-24602467 usb_dev->authorized = 1;24612461- result = usb_enumerate_device(usb_dev);24622462- if (result < 0)24632463- goto error_enumerate;24642468 /* Choose and set the configuration. This registers the interfaces24652469 * with the driver core and lets interface drivers bind to them.24662470 */···24662490 }24672491 dev_info(&usb_dev->dev, "authorized to connect\n");2468249224692469-error_enumerate:24702493error_device_descriptor:24712494 usb_autosuspend_device(usb_dev);24722495error_autoresume:···24972522#define HUB_BH_RESET_TIME 5024982523#define HUB_LONG_RESET_TIME 20024992524#define HUB_RESET_TIMEOUT 80025252525+25262526+/*25272527+ * "New scheme" enumeration causes an extra state transition to be25282528+ * exposed to an xhci host and causes USB3 devices to receive control25292529+ * commands in the default state. This has been seen to cause25302530+ * enumeration failures, so disable this enumeration scheme for USB325312531+ * devices.25322532+ */25332533+static bool use_new_scheme(struct usb_device *udev, int retry)25342534+{25352535+ if (udev->speed == USB_SPEED_SUPER)25362536+ return false;25372537+25382538+ return USE_NEW_SCHEME(retry);25392539+}2500254025012541static int hub_port_reset(struct usb_hub *hub, int port1,25022542 struct usb_device *udev, unsigned int delay, bool warm);···39713981 }39723982}3973398339843984+static int hub_enable_device(struct usb_device *udev)39853985+{39863986+ struct usb_hcd *hcd = bus_to_hcd(udev->bus);39873987+39883988+ if (!hcd->driver->enable_device)39893989+ return 0;39903990+ if (udev->state == USB_STATE_ADDRESS)39913991+ return 0;39923992+ if (udev->state != USB_STATE_DEFAULT)39933993+ return -EINVAL;39943994+39953995+ return hcd->driver->enable_device(hcd, udev);39963996+}39973997+39743998/* Reset device, (re)assign address, get device descriptor.39753999 * Device connection must be stable, no more debouncing needed.39764000 * Returns device in USB_STATE_ADDRESS, except on error.···40974093 * this area, and this is how Linux has done it for ages.40984094 * Change it cautiously.40994095 *41004100- * NOTE: If USE_NEW_SCHEME() is true we will start by issuing40964096+ * NOTE: If use_new_scheme() is true we will start by issuing41014097 * a 64-byte GET_DESCRIPTOR request. This is what Windows does,41024098 * so it may help with some non-standards-compliant devices.41034099 * Otherwise we start with SET_ADDRESS and then try to read the···41054101 * value.41064102 */41074103 for (i = 0; i < GET_DESCRIPTOR_TRIES; (++i, msleep(100))) {41084108- if (USE_NEW_SCHEME(retry_counter) && !(hcd->driver->flags & HCD_USB3)) {41044104+ bool did_new_scheme = false;41054105+41064106+ if (use_new_scheme(udev, retry_counter)) {41094107 struct usb_device_descriptor *buf;41104108 int r = 0;41094109+41104110+ did_new_scheme = true;41114111+ retval = hub_enable_device(udev);41124112+ if (retval < 0)41134113+ goto fail;4111411441124115#define GET_DESCRIPTOR_BUFSIZE 6441134116 buf = kmalloc(GET_DESCRIPTOR_BUFSIZE, GFP_NOIO);···42044193 * - read ep0 maxpacket even for high and low speed,42054194 */42064195 msleep(10);42074207- if (USE_NEW_SCHEME(retry_counter) && !(hcd->driver->flags & HCD_USB3))41964196+ /* use_new_scheme() checks the speed which may have41974197+ * changed since the initial look so we cache the result41984198+ * in did_new_scheme41994199+ */42004200+ if (did_new_scheme)42084201 break;42094202 }42104203
···22# Makefile for USB Host Controller Drivers33#4455-ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG66-75# tell define_trace.h where to find the xhci trace header86CFLAGS_xhci-trace.o := -I$(src)97
···7171static const char hcd_name [] = "ehci_hcd";727273737474-#undef VERBOSE_DEBUG7574#undef EHCI_URB_TRACE76757776/* magic numbers that can affect system performance */···713714 cmd = ehci_readl(ehci, &ehci->regs->command);714715 bh = 0;715716716716-#ifdef VERBOSE_DEBUG717717- /* unrequested/ignored: Frame List Rollover */718718- dbg_status (ehci, "irq", status);719719-#endif720720-721721- /* INT, ERR, and IAA interrupt rates can be throttled */722722-723717 /* normal [4.15.1.2] or error [4.15.1.1] completion */724718 if (likely ((status & (STS_INT|STS_ERR)) != 0)) {725719 if (likely ((status & STS_ERR) == 0))···13121320 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),13131321 sizeof(struct ehci_itd), sizeof(struct ehci_sitd));1314132213151315-#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)13231323+#ifdef CONFIG_DYNAMIC_DEBUG13161324 ehci_debug_root = debugfs_create_dir("ehci", usb_debug_root);13171325 if (!ehci_debug_root) {13181326 retval = -ENOENT;···13611369 platform_driver_unregister(&PLATFORM_DRIVER);13621370clean0:13631371#endif13641364-#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)13721372+#ifdef CONFIG_DYNAMIC_DEBUG13651373 debugfs_remove(ehci_debug_root);13661374 ehci_debug_root = NULL;13671375err_debug:···13851393#ifdef PS3_SYSTEM_BUS_DRIVER13861394 ps3_ehci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);13871395#endif13881388-#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)13961396+#ifdef CONFIG_DYNAMIC_DEBUG13891397 debugfs_remove(ehci_debug_root);13901398#endif13911399 clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
+2-4
drivers/usb/host/ehci-hub.c
···11141114 if (test_bit(wIndex, &ehci->port_c_suspend))11151115 status |= USB_PORT_STAT_C_SUSPEND << 16;1116111611171117-#ifndef VERBOSE_DEBUG11181118- if (status & ~0xffff) /* only if wPortChange is interesting */11191119-#endif11201120- dbg_port (ehci, "GetStatus", wIndex + 1, temp);11171117+ if (status & ~0xffff) /* only if wPortChange is interesting */11181118+ dbg_port(ehci, "GetStatus", wIndex + 1, temp);11211119 put_unaligned_le32(status, buf);11221120 break;11231121 case SetHubFeature:
+2-1
drivers/usb/host/ehci-mv.c
···178178179179 ehci_mv->phy_regs = devm_ioremap(&pdev->dev, r->start,180180 resource_size(r));181181- if (ehci_mv->phy_regs == 0) {181181+ if (!ehci_mv->phy_regs) {182182 dev_err(&pdev->dev, "failed to map phy I/O memory\n");183183 retval = -EFAULT;184184 goto err_put_hcd;···257257 "failed to add hcd with err %d\n", retval);258258 goto err_set_vbus;259259 }260260+ device_wakeup_enable(hcd->self.controller);260261 }261262262263 if (pdata->private_init)
···158158 dev_dbg(&pdev->dev, "failed to add hcd with err %d\n", ret);159159 goto err3;160160 }161161+ device_wakeup_enable(hcd->self.controller);161162162163 platform_set_drvdata(pdev, hcd);163164
+1
drivers/usb/host/ehci-omap.c
···215215 dev_err(dev, "failed to add hcd with err %d\n", ret);216216 goto err_pm_runtime;217217 }218218+ device_wakeup_enable(hcd->self.controller);218219219220 /*220221 * Bring PHYs out of reset for non PHY modes.
···18181919/* this file is part of imx21-hcd.c */20202121+#ifdef CONFIG_DYNAMIC_DEBUG2222+#define DEBUG2323+#endif2424+2125#ifndef DEBUG22262327static inline void create_debug_files(struct imx21 *imx21) { }
···200200 at91_start_hc(pdev);201201202202 retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED);203203- if (retval == 0)203203+ if (retval == 0) {204204+ device_wakeup_enable(hcd->self.controller);204205 return retval;206206+ }205207206208 /* Error handling */207209 at91_stop_hc(pdev);···637635{638636 struct usb_hcd *hcd = platform_get_drvdata(pdev);639637 struct ohci_hcd *ohci = hcd_to_ohci(hcd);638638+ bool do_wakeup = device_may_wakeup(&pdev->dev);639639+ int ret;640640641641- if (device_may_wakeup(&pdev->dev))641641+ if (do_wakeup)642642 enable_irq_wake(hcd->irq);643643644644+ ret = ohci_suspend(hcd, do_wakeup);645645+ if (ret) {646646+ disable_irq_wake(hcd->irq);647647+ return ret;648648+ }644649 /*645650 * The integrated transceivers seem unable to notice disconnect,646651 * reconnect, or wakeup without the 48 MHz clock active. so for···666657 at91_stop_clock();667658 }668659669669- return 0;660660+ return ret;670661}671662672663static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)
+14-4
drivers/usb/host/ohci-da8xx.c
···348348 if (error)349349 goto err4;350350351351+ device_wakeup_enable(hcd->self.controller);352352+351353 if (hub->ocic_notify) {352354 error = hub->ocic_notify(ohci_da8xx_ocic_handler);353355 if (!error)···408406}409407410408#ifdef CONFIG_PM411411-static int ohci_da8xx_suspend(struct platform_device *dev, pm_message_t message)409409+static int ohci_da8xx_suspend(struct platform_device *pdev,410410+ pm_message_t message)412411{413413- struct usb_hcd *hcd = platform_get_drvdata(dev);412412+ struct usb_hcd *hcd = platform_get_drvdata(pdev);414413 struct ohci_hcd *ohci = hcd_to_ohci(hcd);414414+ bool do_wakeup = device_may_wakeup(&pdev->dev);415415+ int ret;416416+415417416418 if (time_before(jiffies, ohci->next_statechange))417419 msleep(5);418420 ohci->next_statechange = jiffies;419421422422+ ret = ohci_suspend(hcd, do_wakeup);423423+ if (ret)424424+ return ret;425425+420426 ohci_da8xx_clock(0);421427 hcd->state = HC_STATE_SUSPENDED;422422- dev->dev.power.power_state = PMSG_SUSPEND;423423- return 0;428428+429429+ return ret;424430}425431426432static int ohci_da8xx_resume(struct platform_device *dev)
-69
drivers/usb/host/ohci-dbg.c
···991010/*-------------------------------------------------------------------------*/11111212-#ifdef DEBUG1313-1412#define edstring(ed_type) ({ char *temp; \1513 switch (ed_type) { \1614 case PIPE_CONTROL: temp = "ctrl"; break; \···1820 } temp;})1921#define pipestring(pipe) edstring(usb_pipetype(pipe))20222121-/* debug| print the main components of an URB2222- * small: 0) header + data packets 1) just header2323- */2424-static void __maybe_unused2525-urb_print(struct urb * urb, char * str, int small, int status)2626-{2727- unsigned int pipe= urb->pipe;2828-2929- if (!urb->dev || !urb->dev->bus) {3030- printk(KERN_DEBUG "%s URB: no dev\n", str);3131- return;3232- }3333-3434-#ifndef OHCI_VERBOSE_DEBUG3535- if (status != 0)3636-#endif3737- printk(KERN_DEBUG "%s %p dev=%d ep=%d%s-%s flags=%x len=%d/%d stat=%d\n",3838- str,3939- urb,4040- usb_pipedevice (pipe),4141- usb_pipeendpoint (pipe),4242- usb_pipeout (pipe)? "out" : "in",4343- pipestring (pipe),4444- urb->transfer_flags,4545- urb->actual_length,4646- urb->transfer_buffer_length,4747- status);4848-4949-#ifdef OHCI_VERBOSE_DEBUG5050- if (!small) {5151- int i, len;5252-5353- if (usb_pipecontrol (pipe)) {5454- printk (KERN_DEBUG "%s: setup(8):", __FILE__);5555- for (i = 0; i < 8 ; i++)5656- printk (" %02x", ((__u8 *) urb->setup_packet) [i]);5757- printk ("\n");5858- }5959- if (urb->transfer_buffer_length > 0 && urb->transfer_buffer) {6060- printk (KERN_DEBUG "%s: data(%d/%d):", __FILE__,6161- urb->actual_length,6262- urb->transfer_buffer_length);6363- len = usb_pipeout (pipe)?6464- urb->transfer_buffer_length: urb->actual_length;6565- for (i = 0; i < 16 && i < len; i++)6666- printk (" %02x", ((__u8 *) urb->transfer_buffer) [i]);6767- printk ("%s stat:%d\n", i < len? "...": "", status);6868- }6969- }7070-#endif7171-}72237324#define ohci_dbg_sw(ohci, next, size, format, arg...) \7425 do { \···354407 }355408}356409357357-#else358358-static inline void ohci_dump (struct ohci_hcd *controller, int verbose) {}359359-360360-#undef OHCI_VERBOSE_DEBUG361361-362362-#endif /* DEBUG */363363-364410/*-------------------------------------------------------------------------*/365365-366366-#ifdef STUB_DEBUG_FILES367367-368368-static inline void create_debug_files (struct ohci_hcd *bus) { }369369-static inline void remove_debug_files (struct ohci_hcd *bus) { }370370-371371-#else372411373412static int debug_async_open(struct inode *, struct file *);374413static int debug_periodic_open(struct inode *, struct file *);···803870 debugfs_remove(ohci->debug_async);804871 debugfs_remove(ohci->debug_dir);805872}806806-807807-#endif808873809874/*-------------------------------------------------------------------------*/810875
+7-16
drivers/usb/host/ohci-exynos.c
···146146 dev_err(&pdev->dev, "Failed to add USB HCD\n");147147 goto fail_add_hcd;148148 }149149+ device_wakeup_enable(hcd->self.controller);149150 return 0;150151151152fail_add_hcd:···192191 struct exynos_ohci_hcd *exynos_ohci = to_exynos_ohci(hcd);193192 struct ohci_hcd *ohci = hcd_to_ohci(hcd);194193 struct platform_device *pdev = to_platform_device(dev);194194+ bool do_wakeup = device_may_wakeup(dev);195195 unsigned long flags;196196- int rc = 0;196196+ int rc = ohci_suspend(hcd, do_wakeup);197197198198- /*199199- * Root hub was already suspended. Disable irq emission and200200- * mark HW unaccessible, bail out if RH has been resumed. Use201201- * the spinlock to properly synchronize with possible pending202202- * RH suspend or resume activity.203203- */198198+ if (rc)199199+ return rc;200200+204201 spin_lock_irqsave(&ohci->lock, flags);205205- if (ohci->rh_state != OHCI_RH_SUSPENDED &&206206- ohci->rh_state != OHCI_RH_HALTED) {207207- rc = -EINVAL;208208- goto fail;209209- }210210-211211- clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);212202213203 if (exynos_ohci->otg)214204 exynos_ohci->otg->set_host(exynos_ohci->otg, &hcd->self);···208216209217 clk_disable_unprepare(exynos_ohci->clk);210218211211-fail:212219 spin_unlock_irqrestore(&ohci->lock, flags);213220214214- return rc;221221+ return 0;215222}216223217224static int exynos_ohci_resume(struct device *dev)
+10-19
drivers/usb/host/ohci-hcd.c
···51515252/*-------------------------------------------------------------------------*/53535454-#undef OHCI_VERBOSE_DEBUG /* not always helpful */5555-5654/* For initializing controller (mask in an HCFS mode too) */5755#define OHCI_CONTROL_INIT OHCI_CTRL_CBSR5856#define OHCI_INTR_INIT \···124126 int i, size = 0;125127 unsigned long flags;126128 int retval = 0;127127-128128-#ifdef OHCI_VERBOSE_DEBUG129129- urb_print(urb, "SUB", usb_pipein(pipe), -EINPROGRESS);130130-#endif131129132130 /* every endpoint has a ed, locate and maybe (re)initialize it */133131 if (! (ed = ed_get (ohci, urb->ep, urb->dev, pipe, urb->interval)))···277283 struct ohci_hcd *ohci = hcd_to_ohci (hcd);278284 unsigned long flags;279285 int rc;280280-281281-#ifdef OHCI_VERBOSE_DEBUG282282- urb_print(urb, "UNLINK", 1, status);283283-#endif284286285287 spin_lock_irqsave (&ohci->lock, flags);286288 rc = usb_hcd_check_unlink_urb(hcd, urb, status);···830840 }831841832842 if (ints & OHCI_INTR_RHSC) {833833- ohci_vdbg(ohci, "rhsc\n");843843+ ohci_dbg(ohci, "rhsc\n");834844 ohci->next_statechange = jiffies + STATECHANGE_DELAY;835845 ohci_writel(ohci, OHCI_INTR_RD | OHCI_INTR_RHSC,836846 ®s->intrstatus);···852862 * this might not happen.853863 */854864 else if (ints & OHCI_INTR_RD) {855855- ohci_vdbg(ohci, "resume detect\n");865865+ ohci_dbg(ohci, "resume detect\n");856866 ohci_writel(ohci, OHCI_INTR_RD, ®s->intrstatus);857867 set_bit(HCD_FLAG_POLL_RH, &hcd->flags);858868 if (ohci->autostop) {···10261036{10271037 struct ohci_hcd *ohci = hcd_to_ohci (hcd);10281038 unsigned long flags;10391039+ int rc = 0;1029104010301041 /* Disable irq emission and mark HW unaccessible. Use10311042 * the spinlock to properly synchronize with possible pending···10391048 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);10401049 spin_unlock_irqrestore (&ohci->lock, flags);1041105010421042- return 0;10511051+ synchronize_irq(hcd->irq);10521052+10531053+ if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) {10541054+ ohci_resume(hcd, false);10551055+ rc = -EBUSY;10561056+ }10571057+ return rc;10431058}10441059EXPORT_SYMBOL_GPL(ohci_suspend);10451060···12301233 sizeof (struct ed), sizeof (struct td));12311234 set_bit(USB_OHCI_LOADED, &usb_hcds_loaded);1232123512331233-#ifdef DEBUG12341236 ohci_debug_root = debugfs_create_dir("ohci", usb_debug_root);12351237 if (!ohci_debug_root) {12361238 retval = -ENOENT;12371239 goto error_debug;12381240 }12391239-#endif1240124112411242#ifdef PS3_SYSTEM_BUS_DRIVER12421243 retval = ps3_ohci_driver_register(&PS3_SYSTEM_BUS_DRIVER);···13091314 ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);13101315 error_ps3:13111316#endif13121312-#ifdef DEBUG13131317 debugfs_remove(ohci_debug_root);13141318 ohci_debug_root = NULL;13151319 error_debug:13161316-#endif1317132013181321 clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);13191322 return retval;···13411348#ifdef PS3_SYSTEM_BUS_DRIVER13421349 ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);13431350#endif13441344-#ifdef DEBUG13451351 debugfs_remove(ohci_debug_root);13461346-#endif13471352 clear_bit(USB_OHCI_LOADED, &usb_hcds_loaded);13481353}13491354module_exit(ohci_hcd_mod_exit);
+2-4
drivers/usb/host/ohci-hub.c
···725725 temp = roothub_portstatus (ohci, wIndex);726726 put_unaligned_le32(temp, buf);727727728728-#ifndef OHCI_VERBOSE_DEBUG729729- if (*(u16*)(buf+2)) /* only if wPortChange is interesting */730730-#endif731731- dbg_port (ohci, "GetStatus", wIndex, temp);728728+ if (*(u16*)(buf+2)) /* only if wPortChange is interesting */729729+ dbg_port(ohci, "GetStatus", wIndex, temp);732730 break;733731 case SetHubFeature:734732 switch (wValue) {
···6060 u32 result;61616262 do {6363- result = xhci_readl(xhci, ptr);6363+ result = readl(ptr);6464 if (result == ~(u32)0) /* card removed */6565 return -ENODEV;6666 result &= mask;···8282 u32 mask;83838484 mask = ~(XHCI_IRQS);8585- halted = xhci_readl(xhci, &xhci->op_regs->status) & STS_HALT;8585+ halted = readl(&xhci->op_regs->status) & STS_HALT;8686 if (!halted)8787 mask &= ~CMD_RUN;88888989- cmd = xhci_readl(xhci, &xhci->op_regs->command);8989+ cmd = readl(&xhci->op_regs->command);9090 cmd &= mask;9191- xhci_writel(xhci, cmd, &xhci->op_regs->command);9191+ writel(cmd, &xhci->op_regs->command);9292}93939494/*···124124 u32 temp;125125 int ret;126126127127- temp = xhci_readl(xhci, &xhci->op_regs->command);127127+ temp = readl(&xhci->op_regs->command);128128 temp |= (CMD_RUN);129129 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Turn on HC, cmd = 0x%x.",130130 temp);131131- xhci_writel(xhci, temp, &xhci->op_regs->command);131131+ writel(temp, &xhci->op_regs->command);132132133133 /*134134 * Wait for the HCHalted Status bit to be 0 to indicate the host is···158158 u32 state;159159 int ret, i;160160161161- state = xhci_readl(xhci, &xhci->op_regs->status);161161+ state = readl(&xhci->op_regs->status);162162 if ((state & STS_HALT) == 0) {163163 xhci_warn(xhci, "Host controller not halted, aborting reset.\n");164164 return 0;165165 }166166167167 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Reset the HC");168168- command = xhci_readl(xhci, &xhci->op_regs->command);168168+ command = readl(&xhci->op_regs->command);169169 command |= CMD_RESET;170170- xhci_writel(xhci, command, &xhci->op_regs->command);170170+ writel(command, &xhci->op_regs->command);171171172172 ret = xhci_handshake(xhci, &xhci->op_regs->command,173173 CMD_RESET, 0, 10 * 1000 * 1000);···422422 xhci = (struct xhci_hcd *)arg;423423424424 for (i = 0; i < xhci->num_usb3_ports; i++) {425425- temp = xhci_readl(xhci, xhci->usb3_ports[i]);425425+ temp = readl(xhci->usb3_ports[i]);426426 if ((temp & PORT_PLS_MASK) == USB_SS_PORT_LS_COMP_MOD) {427427 /*428428 * Compliance Mode Detected. Letting USB Core···604604 xhci_dbg(xhci, "Event ring:\n");605605 xhci_debug_ring(xhci, xhci->event_ring);606606 xhci_dbg_ring_ptrs(xhci, xhci->event_ring);607607- temp_64 = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);607607+ temp_64 = readq(&xhci->ir_set->erst_dequeue);608608 temp_64 &= ~ERST_PTR_MASK;609609 xhci_dbg_trace(xhci, trace_xhci_dbg_init,610610 "ERST deq = 64'h%0lx", (long unsigned int) temp_64);611611612612 xhci_dbg_trace(xhci, trace_xhci_dbg_init,613613 "// Set the interrupt modulation register");614614- temp = xhci_readl(xhci, &xhci->ir_set->irq_control);614614+ temp = readl(&xhci->ir_set->irq_control);615615 temp &= ~ER_IRQ_INTERVAL_MASK;616616 temp |= (u32) 160;617617- xhci_writel(xhci, temp, &xhci->ir_set->irq_control);617617+ writel(temp, &xhci->ir_set->irq_control);618618619619 /* Set the HCD state before we enable the irqs */620620- temp = xhci_readl(xhci, &xhci->op_regs->command);620620+ temp = readl(&xhci->op_regs->command);621621 temp |= (CMD_EIE);622622 xhci_dbg_trace(xhci, trace_xhci_dbg_init,623623 "// Enable interrupts, cmd = 0x%x.", temp);624624- xhci_writel(xhci, temp, &xhci->op_regs->command);624624+ writel(temp, &xhci->op_regs->command);625625626626- temp = xhci_readl(xhci, &xhci->ir_set->irq_pending);626626+ temp = readl(&xhci->ir_set->irq_pending);627627 xhci_dbg_trace(xhci, trace_xhci_dbg_init,628628 "// Enabling event ring interrupter %p by writing 0x%x to irq_pending",629629 xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp));630630- xhci_writel(xhci, ER_IRQ_ENABLE(temp),631631- &xhci->ir_set->irq_pending);630630+ writel(ER_IRQ_ENABLE(temp), &xhci->ir_set->irq_pending);632631 xhci_print_ir_set(xhci, 0);633632634633 if (xhci->quirks & XHCI_NEC_HOST)···697698698699 xhci_dbg_trace(xhci, trace_xhci_dbg_init,699700 "// Disabling event ring interrupts");700700- temp = xhci_readl(xhci, &xhci->op_regs->status);701701- xhci_writel(xhci, temp & ~STS_EINT, &xhci->op_regs->status);702702- temp = xhci_readl(xhci, &xhci->ir_set->irq_pending);703703- xhci_writel(xhci, ER_IRQ_DISABLE(temp),704704- &xhci->ir_set->irq_pending);701701+ temp = readl(&xhci->op_regs->status);702702+ writel(temp & ~STS_EINT, &xhci->op_regs->status);703703+ temp = readl(&xhci->ir_set->irq_pending);704704+ writel(ER_IRQ_DISABLE(temp), &xhci->ir_set->irq_pending);705705 xhci_print_ir_set(xhci, 0);706706707707 xhci_dbg_trace(xhci, trace_xhci_dbg_init, "cleaning up memory");708708 xhci_mem_cleanup(xhci);709709 xhci_dbg_trace(xhci, trace_xhci_dbg_init,710710 "xhci_stop completed - status = %x",711711- xhci_readl(xhci, &xhci->op_regs->status));711711+ readl(&xhci->op_regs->status));712712}713713714714/*···737739738740 xhci_dbg_trace(xhci, trace_xhci_dbg_init,739741 "xhci_shutdown completed - status = %x",740740- xhci_readl(xhci, &xhci->op_regs->status));742742+ readl(&xhci->op_regs->status));741743742744 /* Yet another workaround for spurious wakeups at shutdown with HSW */743745 if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)···747749#ifdef CONFIG_PM748750static void xhci_save_registers(struct xhci_hcd *xhci)749751{750750- xhci->s3.command = xhci_readl(xhci, &xhci->op_regs->command);751751- xhci->s3.dev_nt = xhci_readl(xhci, &xhci->op_regs->dev_notification);752752- xhci->s3.dcbaa_ptr = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);753753- xhci->s3.config_reg = xhci_readl(xhci, &xhci->op_regs->config_reg);754754- xhci->s3.erst_size = xhci_readl(xhci, &xhci->ir_set->erst_size);755755- xhci->s3.erst_base = xhci_read_64(xhci, &xhci->ir_set->erst_base);756756- xhci->s3.erst_dequeue = xhci_read_64(xhci, &xhci->ir_set->erst_dequeue);757757- xhci->s3.irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);758758- xhci->s3.irq_control = xhci_readl(xhci, &xhci->ir_set->irq_control);752752+ xhci->s3.command = readl(&xhci->op_regs->command);753753+ xhci->s3.dev_nt = readl(&xhci->op_regs->dev_notification);754754+ xhci->s3.dcbaa_ptr = readq(&xhci->op_regs->dcbaa_ptr);755755+ xhci->s3.config_reg = readl(&xhci->op_regs->config_reg);756756+ xhci->s3.erst_size = readl(&xhci->ir_set->erst_size);757757+ xhci->s3.erst_base = readq(&xhci->ir_set->erst_base);758758+ xhci->s3.erst_dequeue = readq(&xhci->ir_set->erst_dequeue);759759+ xhci->s3.irq_pending = readl(&xhci->ir_set->irq_pending);760760+ xhci->s3.irq_control = readl(&xhci->ir_set->irq_control);759761}760762761763static void xhci_restore_registers(struct xhci_hcd *xhci)762764{763763- xhci_writel(xhci, xhci->s3.command, &xhci->op_regs->command);764764- xhci_writel(xhci, xhci->s3.dev_nt, &xhci->op_regs->dev_notification);765765- xhci_write_64(xhci, xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr);766766- xhci_writel(xhci, xhci->s3.config_reg, &xhci->op_regs->config_reg);767767- xhci_writel(xhci, xhci->s3.erst_size, &xhci->ir_set->erst_size);768768- xhci_write_64(xhci, xhci->s3.erst_base, &xhci->ir_set->erst_base);769769- xhci_write_64(xhci, xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue);770770- xhci_writel(xhci, xhci->s3.irq_pending, &xhci->ir_set->irq_pending);771771- xhci_writel(xhci, xhci->s3.irq_control, &xhci->ir_set->irq_control);765765+ writel(xhci->s3.command, &xhci->op_regs->command);766766+ writel(xhci->s3.dev_nt, &xhci->op_regs->dev_notification);767767+ writeq(xhci->s3.dcbaa_ptr, &xhci->op_regs->dcbaa_ptr);768768+ writel(xhci->s3.config_reg, &xhci->op_regs->config_reg);769769+ writel(xhci->s3.erst_size, &xhci->ir_set->erst_size);770770+ writeq(xhci->s3.erst_base, &xhci->ir_set->erst_base);771771+ writeq(xhci->s3.erst_dequeue, &xhci->ir_set->erst_dequeue);772772+ writel(xhci->s3.irq_pending, &xhci->ir_set->irq_pending);773773+ writel(xhci->s3.irq_control, &xhci->ir_set->irq_control);772774}773775774776static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci)···776778 u64 val_64;777779778780 /* step 2: initialize command ring buffer */779779- val_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);781781+ val_64 = readq(&xhci->op_regs->cmd_ring);780782 val_64 = (val_64 & (u64) CMD_RING_RSVD_BITS) |781783 (xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg,782784 xhci->cmd_ring->dequeue) &···785787 xhci_dbg_trace(xhci, trace_xhci_dbg_init,786788 "// Setting command ring address to 0x%llx",787789 (long unsigned long) val_64);788788- xhci_write_64(xhci, val_64, &xhci->op_regs->cmd_ring);790790+ writeq(val_64, &xhci->op_regs->cmd_ring);789791}790792791793/*···864866 /* skipped assuming that port suspend has done */865867866868 /* step 2: clear Run/Stop bit */867867- command = xhci_readl(xhci, &xhci->op_regs->command);869869+ command = readl(&xhci->op_regs->command);868870 command &= ~CMD_RUN;869869- xhci_writel(xhci, command, &xhci->op_regs->command);871871+ writel(command, &xhci->op_regs->command);870872871873 /* Some chips from Fresco Logic need an extraordinary delay */872874 delay *= (xhci->quirks & XHCI_SLOW_SUSPEND) ? 10 : 1;···883885 xhci_save_registers(xhci);884886885887 /* step 4: set CSS flag */886886- command = xhci_readl(xhci, &xhci->op_regs->command);888888+ command = readl(&xhci->op_regs->command);887889 command |= CMD_CSS;888888- xhci_writel(xhci, command, &xhci->op_regs->command);890890+ writel(command, &xhci->op_regs->command);889891 if (xhci_handshake(xhci, &xhci->op_regs->status,890892 STS_SAVE, 0, 10 * 1000)) {891893 xhci_warn(xhci, "WARN: xHC save state timeout\n");···949951 xhci_set_cmd_ring_deq(xhci);950952 /* step 3: restore state and start state*/951953 /* step 3: set CRS flag */952952- command = xhci_readl(xhci, &xhci->op_regs->command);954954+ command = readl(&xhci->op_regs->command);953955 command |= CMD_CRS;954954- xhci_writel(xhci, command, &xhci->op_regs->command);956956+ writel(command, &xhci->op_regs->command);955957 if (xhci_handshake(xhci, &xhci->op_regs->status,956958 STS_RESTORE, 0, 10 * 1000)) {957959 xhci_warn(xhci, "WARN: xHC restore state timeout\n");958960 spin_unlock_irq(&xhci->lock);959961 return -ETIMEDOUT;960962 }961961- temp = xhci_readl(xhci, &xhci->op_regs->status);963963+ temp = readl(&xhci->op_regs->status);962964 }963965964966 /* If restore operation fails, re-initialize the HC during resume */···982984 xhci_cleanup_msix(xhci);983985984986 xhci_dbg(xhci, "// Disabling event ring interrupts\n");985985- temp = xhci_readl(xhci, &xhci->op_regs->status);986986- xhci_writel(xhci, temp & ~STS_EINT, &xhci->op_regs->status);987987- temp = xhci_readl(xhci, &xhci->ir_set->irq_pending);988988- xhci_writel(xhci, ER_IRQ_DISABLE(temp),989989- &xhci->ir_set->irq_pending);987987+ temp = readl(&xhci->op_regs->status);988988+ writel(temp & ~STS_EINT, &xhci->op_regs->status);989989+ temp = readl(&xhci->ir_set->irq_pending);990990+ writel(ER_IRQ_DISABLE(temp), &xhci->ir_set->irq_pending);990991 xhci_print_ir_set(xhci, 0);991992992993 xhci_dbg(xhci, "cleaning up memory\n");993994 xhci_mem_cleanup(xhci);994995 xhci_dbg(xhci, "xhci_stop completed - status = %x\n",995995- xhci_readl(xhci, &xhci->op_regs->status));996996+ readl(&xhci->op_regs->status));996997997998 /* USB core calls the PCI reinit and start functions twice:998999 * first with the primary HCD, and then with the secondary HCD.···10201023 }1021102410221025 /* step 4: set Run/Stop bit */10231023- command = xhci_readl(xhci, &xhci->op_regs->command);10261026+ command = readl(&xhci->op_regs->command);10241027 command |= CMD_RUN;10251025- xhci_writel(xhci, command, &xhci->op_regs->command);10281028+ writel(command, &xhci->op_regs->command);10261029 xhci_handshake(xhci, &xhci->op_regs->status, STS_HALT,10271030 0, 250 * 1000);10281031···14611464 ret = usb_hcd_check_unlink_urb(hcd, urb, status);14621465 if (ret || !urb->hcpriv)14631466 goto done;14641464- temp = xhci_readl(xhci, &xhci->op_regs->status);14671467+ temp = readl(&xhci->op_regs->status);14651468 if (temp == 0xffffffff || (xhci->xhc_state & XHCI_STATE_HALTED)) {14661469 xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,14671470 "HW died, freeing TD.");···18891892 * (bit 1). The default control endpoint is added during the Address18901893 * Device command and is never removed until the slot is disabled.18911894 */18921892- valid_add_flags = ctrl_ctx->add_flags >> 2;18931893- valid_drop_flags = ctrl_ctx->drop_flags >> 2;18951895+ valid_add_flags = le32_to_cpu(ctrl_ctx->add_flags) >> 2;18961896+ valid_drop_flags = le32_to_cpu(ctrl_ctx->drop_flags) >> 2;1894189718951898 /* Use hweight32 to count the number of ones in the add flags, or18961899 * number of endpoints added. Don't count endpoints that are changed···19061909 u32 valid_add_flags;19071910 u32 valid_drop_flags;1908191119091909- valid_add_flags = ctrl_ctx->add_flags >> 2;19101910- valid_drop_flags = ctrl_ctx->drop_flags >> 2;19121912+ valid_add_flags = le32_to_cpu(ctrl_ctx->add_flags) >> 2;19131913+ valid_drop_flags = le32_to_cpu(ctrl_ctx->drop_flags) >> 2;1911191419121915 return hweight32(valid_drop_flags) -19131916 hweight32(valid_add_flags & valid_drop_flags);···3582358535833586 spin_lock_irqsave(&xhci->lock, flags);35843587 /* Don't disable the slot if the host controller is dead. */35853585- state = xhci_readl(xhci, &xhci->op_regs->status);35883588+ state = readl(&xhci->op_regs->status);35863589 if (state == 0xffffffff || (xhci->xhc_state & XHCI_STATE_DYING) ||35873590 (xhci->xhc_state & XHCI_STATE_HALTED)) {35883591 xhci_free_virt_device(xhci, udev->slot_id);···37093712}3710371337113714/*37123712- * Issue an Address Device command (which will issue a SetAddress request to37133713- * the device).37153715+ * Issue an Address Device command and optionally send a corresponding37163716+ * SetAddress request to the device.37143717 * We should be protected by the usb_address0_mutex in khubd's hub_port_init, so37153718 * we should only issue and wait on one address command at the same time.37163719 */37173717-int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)37203720+static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev,37213721+ enum xhci_setup_dev setup)37183722{37233723+ const char *act = setup == SETUP_CONTEXT_ONLY ? "context" : "address";37193724 unsigned long flags;37203725 int timeleft;37213726 struct xhci_virt_device *virt_dev;···37703771 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);37713772 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);37723773 trace_xhci_address_ctx(xhci, virt_dev->in_ctx,37733773- slot_ctx->dev_info >> 27);37743774+ le32_to_cpu(slot_ctx->dev_info) >> 27);3774377537753776 spin_lock_irqsave(&xhci->lock, flags);37763777 cmd_trb = xhci_find_next_enqueue(xhci->cmd_ring);37773778 ret = xhci_queue_address_device(xhci, virt_dev->in_ctx->dma,37783778- udev->slot_id);37793779+ udev->slot_id, setup);37793780 if (ret) {37803781 spin_unlock_irqrestore(&xhci->lock, flags);37813782 xhci_dbg_trace(xhci, trace_xhci_dbg_address,···37933794 * command on a timeout.37943795 */37953796 if (timeleft <= 0) {37963796- xhci_warn(xhci, "%s while waiting for address device command\n",37973797- timeleft == 0 ? "Timeout" : "Signal");37973797+ xhci_warn(xhci, "%s while waiting for setup %s command\n",37983798+ timeleft == 0 ? "Timeout" : "Signal", act);37983799 /* cancel the address device command */37993800 ret = xhci_cancel_cmd(xhci, NULL, cmd_trb);38003801 if (ret < 0)···38053806 switch (virt_dev->cmd_status) {38063807 case COMP_CTX_STATE:38073808 case COMP_EBADSLT:38083808- xhci_err(xhci, "Setup ERROR: address device command for slot %d.\n",38093809- udev->slot_id);38093809+ xhci_err(xhci, "Setup ERROR: setup %s command for slot %d.\n",38103810+ act, udev->slot_id);38103811 ret = -EINVAL;38113812 break;38123813 case COMP_TX_ERR:38133813- dev_warn(&udev->dev, "Device not responding to set address.\n");38143814+ dev_warn(&udev->dev, "Device not responding to setup %s.\n", act);38143815 ret = -EPROTO;38153816 break;38163817 case COMP_DEV_ERR:38173817- dev_warn(&udev->dev, "ERROR: Incompatible device for address "38183818- "device command.\n");38183818+ dev_warn(&udev->dev,38193819+ "ERROR: Incompatible device for setup %s command\n", act);38193820 ret = -ENODEV;38203821 break;38213822 case COMP_SUCCESS:38223823 xhci_dbg_trace(xhci, trace_xhci_dbg_address,38233823- "Successful Address Device command");38243824+ "Successful setup %s command", act);38243825 break;38253826 default:38263826- xhci_err(xhci, "ERROR: unexpected command completion "38273827- "code 0x%x.\n", virt_dev->cmd_status);38273827+ xhci_err(xhci,38283828+ "ERROR: unexpected setup %s command completion code 0x%x.\n",38293829+ act, virt_dev->cmd_status);38283830 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);38293831 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);38303832 trace_xhci_address_ctx(xhci, virt_dev->out_ctx, 1);···38353835 if (ret) {38363836 return ret;38373837 }38383838- temp_64 = xhci_read_64(xhci, &xhci->op_regs->dcbaa_ptr);38383838+ temp_64 = readq(&xhci->op_regs->dcbaa_ptr);38393839 xhci_dbg_trace(xhci, trace_xhci_dbg_address,38403840 "Op regs DCBAA ptr = %#016llx", temp_64);38413841 xhci_dbg_trace(xhci, trace_xhci_dbg_address,···38503850 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);38513851 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);38523852 trace_xhci_address_ctx(xhci, virt_dev->in_ctx,38533853- slot_ctx->dev_info >> 27);38533853+ le32_to_cpu(slot_ctx->dev_info) >> 27);38543854 xhci_dbg(xhci, "Slot ID %d Output Context:\n", udev->slot_id);38553855 xhci_dbg_ctx(xhci, virt_dev->out_ctx, 2);38563856 /*···38593859 */38603860 slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx);38613861 trace_xhci_address_ctx(xhci, virt_dev->out_ctx,38623862- slot_ctx->dev_info >> 27);38623862+ le32_to_cpu(slot_ctx->dev_info) >> 27);38633863 /* Zero the input context control for later use */38643864 ctrl_ctx->add_flags = 0;38653865 ctrl_ctx->drop_flags = 0;···38693869 le32_to_cpu(slot_ctx->dev_state) & DEV_ADDR_MASK);3870387038713871 return 0;38723872+}38733873+38743874+int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)38753875+{38763876+ return xhci_setup_device(hcd, udev, SETUP_CONTEXT_ADDRESS);38773877+}38783878+38793879+int xhci_enable_device(struct usb_hcd *hcd, struct usb_device *udev)38803880+{38813881+ return xhci_setup_device(hcd, udev, SETUP_CONTEXT_ONLY);38723882}3873388338743884/*···40524042 port_array = xhci->usb2_ports;40534043 port_num = udev->portnum - 1;40544044 pm_addr = port_array[port_num] + PORTPMSC;40554055- pm_val = xhci_readl(xhci, pm_addr);40454045+ pm_val = readl(pm_addr);40564046 hlpm_addr = port_array[port_num] + PORTHLPMC;40574047 field = le32_to_cpu(udev->bos->ext_cap->bmAttributes);40584048···40924082 spin_lock_irqsave(&xhci->lock, flags);4093408340944084 hlpm_val = xhci_calculate_usb2_hw_lpm_params(udev);40954095- xhci_writel(xhci, hlpm_val, hlpm_addr);40854085+ writel(hlpm_val, hlpm_addr);40964086 /* flush write */40974097- xhci_readl(xhci, hlpm_addr);40874087+ readl(hlpm_addr);40984088 } else {40994089 hird = xhci_calculate_hird_besl(xhci, udev);41004090 }4101409141024092 pm_val &= ~PORT_HIRD_MASK;41034093 pm_val |= PORT_HIRD(hird) | PORT_RWE | PORT_L1DS(udev->slot_id);41044104- xhci_writel(xhci, pm_val, pm_addr);41054105- pm_val = xhci_readl(xhci, pm_addr);40944094+ writel(pm_val, pm_addr);40954095+ pm_val = readl(pm_addr);41064096 pm_val |= PORT_HLE;41074107- xhci_writel(xhci, pm_val, pm_addr);40974097+ writel(pm_val, pm_addr);41084098 /* flush write */41094109- xhci_readl(xhci, pm_addr);40994099+ readl(pm_addr);41104100 } else {41114101 pm_val &= ~(PORT_HLE | PORT_RWE | PORT_HIRD_MASK | PORT_L1DS_MASK);41124112- xhci_writel(xhci, pm_val, pm_addr);41024102+ writel(pm_val, pm_addr);41134103 /* flush write */41144114- xhci_readl(xhci, pm_addr);41044104+ readl(pm_addr);41154105 if (udev->usb2_hw_lpm_besl_capable) {41164106 spin_unlock_irqrestore(&xhci->lock, flags);41174107 mutex_lock(hcd->bandwidth_mutex);···44654455 if (!config)44664456 return timeout;4467445744684468- for (i = 0; i < USB_MAXINTERFACES; i++) {44584458+ for (i = 0; i < config->desc.bNumInterfaces; i++) {44694459 struct usb_driver *driver;44704460 struct usb_interface *intf = config->interface[i];44714461···47144704{47154705 struct xhci_hcd *xhci = hcd_to_xhci(hcd);47164706 /* EHCI mods by the periodic size. Why? */47174717- return xhci_readl(xhci, &xhci->run_regs->microframe_index) >> 3;47074707+ return readl(&xhci->run_regs->microframe_index) >> 3;47184708}4719470947204710int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)···4758474847594749 xhci->cap_regs = hcd->regs;47604750 xhci->op_regs = hcd->regs +47614761- HC_LENGTH(xhci_readl(xhci, &xhci->cap_regs->hc_capbase));47514751+ HC_LENGTH(readl(&xhci->cap_regs->hc_capbase));47624752 xhci->run_regs = hcd->regs +47634763- (xhci_readl(xhci, &xhci->cap_regs->run_regs_off) & RTSOFF_MASK);47534753+ (readl(&xhci->cap_regs->run_regs_off) & RTSOFF_MASK);47644754 /* Cache read-only capability registers */47654765- xhci->hcs_params1 = xhci_readl(xhci, &xhci->cap_regs->hcs_params1);47664766- xhci->hcs_params2 = xhci_readl(xhci, &xhci->cap_regs->hcs_params2);47674767- xhci->hcs_params3 = xhci_readl(xhci, &xhci->cap_regs->hcs_params3);47684768- xhci->hcc_params = xhci_readl(xhci, &xhci->cap_regs->hc_capbase);47554755+ xhci->hcs_params1 = readl(&xhci->cap_regs->hcs_params1);47564756+ xhci->hcs_params2 = readl(&xhci->cap_regs->hcs_params2);47574757+ xhci->hcs_params3 = readl(&xhci->cap_regs->hcs_params3);47584758+ xhci->hcc_params = readl(&xhci->cap_regs->hc_capbase);47694759 xhci->hci_version = HC_VERSION(xhci->hcc_params);47704770- xhci->hcc_params = xhci_readl(xhci, &xhci->cap_regs->hcc_params);47604760+ xhci->hcc_params = readl(&xhci->cap_regs->hcc_params);47714761 xhci_print_registers(xhci);4772476247734763 get_quirks(dev, xhci);
+22-43
drivers/usb/host/xhci.h
···2828#include <linux/kernel.h>2929#include <linux/usb/hcd.h>30303131+/*3232+ * Registers should always be accessed with double word or quad word accesses.3333+ *3434+ * Some xHCI implementations may support 64-bit address pointers. Registers3535+ * with 64-bit address pointers should be written to with dword accesses by3636+ * writing the low dword first (ptr[0]), then the high dword (ptr[1]) second.3737+ * xHCI implementations that do not support 64-bit address pointers will ignore3838+ * the high dword, and write order is irrelevant.3939+ */4040+#include <asm-generic/io-64-nonatomic-lo-hi.h>4141+3142/* Code sharing between pci-quirks and xhci hcd */3243#include "xhci-ext-caps.h"3344#include "pci-quirks.h"···763752};764753765754/* Stream Context Types (section 6.4.1) - bits 3:1 of stream ctx deq ptr */766766-#define SCT_FOR_CTX(p) (((p) << 1) & 0x7)755755+#define SCT_FOR_CTX(p) (((p) & 0x7) << 1)767756/* Secondary stream array type, dequeue pointer is to a transfer ring */768757#define SCT_SEC_TR 0769758/* Primary stream array type, dequeue pointer is to a transfer ring */···11081097};1109109811101099/* flags bitmasks */11001100+11011101+/* Address device - disable SetAddress */11021102+#define TRB_BSR (1<<9)11031103+enum xhci_setup_dev {11041104+ SETUP_CONTEXT_ONLY,11051105+ SETUP_CONTEXT_ADDRESS,11061106+};11071107+11111108/* bits 16:23 are the virtual function ID */11121109/* bits 24:31 are the slot ID */11131110#define TRB_TO_SLOT_ID(p) (((p) & (0xff<<24)) >> 24)···16141595#define xhci_warn_ratelimited(xhci, fmt, args...) \16151596 dev_warn_ratelimited(xhci_to_hcd(xhci)->self.controller , fmt , ## args)1616159716171617-/* TODO: copied from ehci.h - can be refactored? */16181618-/* xHCI spec says all registers are little endian */16191619-static inline unsigned int xhci_readl(const struct xhci_hcd *xhci,16201620- __le32 __iomem *regs)16211621-{16221622- return readl(regs);16231623-}16241624-static inline void xhci_writel(struct xhci_hcd *xhci,16251625- const unsigned int val, __le32 __iomem *regs)16261626-{16271627- writel(val, regs);16281628-}16291629-16301630-/*16311631- * Registers should always be accessed with double word or quad word accesses.16321632- *16331633- * Some xHCI implementations may support 64-bit address pointers. Registers16341634- * with 64-bit address pointers should be written to with dword accesses by16351635- * writing the low dword first (ptr[0]), then the high dword (ptr[1]) second.16361636- * xHCI implementations that do not support 64-bit address pointers will ignore16371637- * the high dword, and write order is irrelevant.16381638- */16391639-static inline u64 xhci_read_64(const struct xhci_hcd *xhci,16401640- __le64 __iomem *regs)16411641-{16421642- __u32 __iomem *ptr = (__u32 __iomem *) regs;16431643- u64 val_lo = readl(ptr);16441644- u64 val_hi = readl(ptr + 1);16451645- return val_lo + (val_hi << 32);16461646-}16471647-static inline void xhci_write_64(struct xhci_hcd *xhci,16481648- const u64 val, __le64 __iomem *regs)16491649-{16501650- __u32 __iomem *ptr = (__u32 __iomem *) regs;16511651- u32 val_lo = lower_32_bits(val);16521652- u32 val_hi = upper_32_bits(val);16531653-16541654- writel(val_lo, ptr);16551655- writel(val_hi, ptr + 1);16561656-}16571657-16581598static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci)16591599{16601600 return xhci->quirks & XHCI_LINK_TRB_QUIRK;···17681790 struct usb_host_endpoint **eps, unsigned int num_eps,17691791 gfp_t mem_flags);17701792int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev);17931793+int xhci_enable_device(struct usb_hcd *hcd, struct usb_device *udev);17711794int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev);17721795int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,17731796 struct usb_device *udev, int enable);···17921813void xhci_ring_cmd_db(struct xhci_hcd *xhci);17931814int xhci_queue_slot_control(struct xhci_hcd *xhci, u32 trb_type, u32 slot_id);17941815int xhci_queue_address_device(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,17951795- u32 slot_id);18161816+ u32 slot_id, enum xhci_setup_dev);17961817int xhci_queue_vendor_command(struct xhci_hcd *xhci,17971818 u32 field1, u32 field2, u32 field3, u32 field4);17981819int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id,
+13-4
drivers/usb/misc/usbtest.c
···619619 }620620621621 attr = le32_to_cpu(ext->bmAttributes);622622- /* bits[1:4] is used and others are reserved */623623- if (attr & ~0x1e) { /* reserved == 0 */622622+ /* bits[1:15] is used and others are reserved */623623+ if (attr & ~0xfffe) { /* reserved == 0 */624624 ERROR(tdev, "reserved bits set\n");625625 return 0;626626 }···763763 * there's always [9.4.3] a bos device descriptor [9.6.2] in USB764764 * 3.0 spec765765 */766766- if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0300) {766766+ if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0210) {767767 struct usb_bos_descriptor *bos = NULL;768768 struct usb_dev_cap_header *header = NULL;769769 unsigned total, num, length;···944944 int last;945945};946946947947-#define NUM_SUBCASES 15 /* how many test subcases here? */947947+#define NUM_SUBCASES 16 /* how many test subcases here? */948948949949struct subcase {950950 struct usb_ctrlrequest setup;···12171217 break;12181218 }12191219 expected = -EREMOTEIO;12201220+ break;12211221+ case 15:12221222+ req.wValue = cpu_to_le16(USB_DT_BOS << 8);12231223+ if (udev->bos)12241224+ len = le16_to_cpu(udev->bos->desc->wTotalLength);12251225+ else12261226+ len = sizeof(struct usb_bos_descriptor);12271227+ if (udev->speed != USB_SPEED_SUPER)12281228+ expected = -EPIPE;12201229 break;12211230 default:12221231 ERROR(dev, "bogus number of ctrl queue testcases!\n");
···135135 unsigned int buflen, struct scsi_cmnd *srb, struct scatterlist **sgptr,136136 unsigned int *offset, enum xfer_buf_dir dir)137137{138138- unsigned int cnt;138138+ unsigned int cnt = 0;139139 struct scatterlist *sg = *sgptr;140140+ struct sg_mapping_iter miter;141141+ unsigned int nents = scsi_sg_count(srb);140142141141- /* We have to go through the list one entry142142- * at a time. Each s-g entry contains some number of pages, and143143- * each page has to be kmap()'ed separately. If the page is already144144- * in kernel-addressable memory then kmap() will return its address.145145- * If the page is not directly accessible -- such as a user buffer146146- * located in high memory -- then kmap() will map it to a temporary147147- * position in the kernel's virtual address space.148148- */149149-150150- if (!sg)143143+ if (sg)144144+ nents = sg_nents(sg);145145+ else151146 sg = scsi_sglist(srb);152147153153- /* This loop handles a single s-g list entry, which may154154- * include multiple pages. Find the initial page structure155155- * and the starting offset within the page, and update156156- * the *offset and **sgptr values for the next loop.157157- */158158- cnt = 0;159159- while (cnt < buflen && sg) {160160- struct page *page = sg_page(sg) +161161- ((sg->offset + *offset) >> PAGE_SHIFT);162162- unsigned int poff = (sg->offset + *offset) & (PAGE_SIZE-1);163163- unsigned int sglen = sg->length - *offset;148148+ sg_miter_start(&miter, sg, nents, dir == FROM_XFER_BUF ?149149+ SG_MITER_FROM_SG: SG_MITER_TO_SG);164150165165- if (sglen > buflen - cnt) {151151+ if (!sg_miter_skip(&miter, *offset))152152+ return cnt;166153167167- /* Transfer ends within this s-g entry */168168- sglen = buflen - cnt;169169- *offset += sglen;154154+ while (sg_miter_next(&miter) && cnt < buflen) {155155+ unsigned int len = min_t(unsigned int, miter.length,156156+ buflen - cnt);157157+158158+ if (dir == FROM_XFER_BUF)159159+ memcpy(buffer + cnt, miter.addr, len);160160+ else161161+ memcpy(miter.addr, buffer + cnt, len);162162+163163+ if (*offset + len < miter.piter.sg->length) {164164+ *offset += len;165165+ *sgptr = miter.piter.sg;170166 } else {171171-172172- /* Transfer continues to next s-g entry */173167 *offset = 0;174174- sg = sg_next(sg);168168+ *sgptr = sg_next(miter.piter.sg);175169 }176176-177177- /* Transfer the data for all the pages in this178178- * s-g entry. For each page: call kmap(), do the179179- * transfer, and call kunmap() immediately after. */180180- while (sglen > 0) {181181- unsigned int plen = min(sglen, (unsigned int)182182- PAGE_SIZE - poff);183183- unsigned char *ptr = kmap(page);184184-185185- if (dir == TO_XFER_BUF)186186- memcpy(ptr + poff, buffer + cnt, plen);187187- else188188- memcpy(buffer + cnt, ptr + poff, plen);189189- kunmap(page);190190-191191- /* Start at the beginning of the next page */192192- poff = 0;193193- ++page;194194- cnt += plen;195195- sglen -= plen;196196- }170170+ cnt += len;197171 }198198- *sgptr = sg;172172+ sg_miter_stop(&miter);199173200200- /* Return the amount actually transferred */201174 return cnt;202175}203176EXPORT_SYMBOL_GPL(usb_stor_access_xfer_buf);
···134134 unsigned rh_registered:1;/* is root hub registered? */135135 unsigned rh_pollable:1; /* may we poll the root hub? */136136 unsigned msix_enabled:1; /* driver has MSI-X enabled? */137137+ unsigned remove_phy:1; /* auto-remove USB phy */137138138139 /* The next flag is a stopgap, to be removed when all the HCDs139140 * support the new root-hub polling mechanism. */···353352 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);354353 /* Returns the hardware-chosen device address */355354 int (*address_device)(struct usb_hcd *, struct usb_device *udev);355355+ /* prepares the hardware to send commands to the device */356356+ int (*enable_device)(struct usb_hcd *, struct usb_device *udev);356357 /* Notifies the HCD after a hub descriptor is fetched.357358 * Will block.358359 */
···495495 * true if @miter contains the valid mapping. false if end of sg496496 * list is reached.497497 */498498-static bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset)498498+bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset)499499{500500 sg_miter_stop(miter);501501···513513514514 return true;515515}516516+EXPORT_SYMBOL(sg_miter_skip);516517517518/**518519 * sg_miter_next - proceed mapping iterator to the next mapping