Re: [PATCH] USB: simple: add Google simple serial SubClass support
On Thu, Oct 30, 2014 at 09:54:54PM -0700, Anton Staaf wrote: On Thu, Oct 30, 2014 at 7:33 AM, Greg Kroah-Hartman gre...@linuxfoundation.org wrote: On Wed, Oct 29, 2014 at 02:21:56PM -0700, Anton Staaf wrote: Add support for Google devices that export simple serial interfaces using the vendor specific SubClass/Protocol pair 0x50/0x01. Signed-off-by: Anton Staaf robot...@chromium.org --- drivers/usb/serial/usb-serial-simple.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c index fb79775..85bb973 100644 --- a/drivers/usb/serial/usb-serial-simple.c +++ b/drivers/usb/serial/usb-serial-simple.c @@ -8,6 +8,7 @@ * Copyright (C) 2010 Zilogic Systems c...@zilogic.com * Copyright (C) 2013 Wei Shuai cpuw...@gmail.com * Copyright (C) 2013 Linux Foundation + * Copyright (C) 2014 Google, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version Based on advice from my lawyer, a change this size does not warrent a copyright notice at the top of a file. If your lawyers feel otherwise, please let me know and I will be glad to discuss it with them. So, care to resend this without this change to the file? thanks, greg k-h Sigh, sorry for the top posted HTML junk previously, turns out the gmail app for android doesn't do the right thing... But yes, I'm happy to send along a version without copyright, I don't see any problem with that. Looks like it will have to wait until Monday as I don't have things set up at home to send the patch as robot...@chromium.org. :) Please also make sure to generate the patch against v3.18-rc (the one you sent would not apply). Thanks, Johan -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: PATCH : add support for HuiJia USB Gamepad connector (0e8f:1006 and 0e8f:3010)
On Sat, 1 Nov 2014, Prédhomme Philippe wrote: Create each gamepad as a separate joystick. Both device (1006 is for Sega Saturn controllers, 3010 is for Sony Playstation 1/2 controllers) work the same as 0e8f:3013 (which is for Nintendo 64 controllers), so i used this device as reference to make my patch. Work with kernel 3.14, 3.15, 3.16, 3.17. I hope i was finally able do disable line-wrapping... Unfortunately it's still broken. Please consult Documentation/email-clients.txt for help, and resend. Thanks, -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: yurex: fixed sparse warning of incorrect type
On Fri, Oct 10, 2014 at 06:19:45PM +0530, Sudip Mukherjee wrote: fixed sparse warning of 1) incorrect type (different address spaces) 2) incorrect type in initializer Signed-off-by: Sudip Mukherjee su...@vectorindia.org --- drivers/usb/misc/yurex.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index c3a45da..343fa6f 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -410,7 +410,8 @@ static int yurex_release(struct inode *inode, struct file *file) return 0; } -static ssize_t yurex_read(struct file *file, char *buffer, size_t count, loff_t *ppos) +static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count, + loff_t *ppos) { struct usb_yurex *dev; int retval = 0; @@ -444,7 +445,8 @@ exit: return retval; } -static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t count, loff_t *ppos) +static ssize_t yurex_write(struct file *file, const char __user *user_buffer, +size_t count, loff_t *ppos) { struct usb_yurex *dev; int i, set = 0, retval = 0; -- 1.8.1.2 gentle ping thanks sudip -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Potential USB PHY error handling fix for stable
On Wed, Oct 29, 2014 at 10:10:12PM +, Mark Brown wrote: Hi, One of the Linaro stable kernel users has suggested 2c4e3dbf63b39d (usb: phy: return -ENODEV on failure of try_module_get) as a fix for the stable kernel. While it's error handling that's being fixed this does seem like a reasonable candidate, it's a very simple fix and the behaviour without the change is to return a NULL pointer rather than an error pointer which callers will interpret as success which isn't good. Does this seem reasonable? Thanks, Mark Thank you, I'll queue this fix for the 3.16 extended stable. Cheers, -- Luís -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
Hi Greg, On Tuesday 07 October 2014 04:32 PM, Oussama Ghorbel wrote: The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commit eb82a3d846fa (phy: omap-usb2: Balance pm_runtime_enable() on probe failure and remove). This because the call to pm_runtime_enable() function is moved after the call to devm_phy_create() function, which has side effect since later in the subsequent calls of devm_phy_create() there is a check with pm_runtime_enabled() to configure few things. This is the only fix for this -rc cycle in the PHY susbsystem. So can you take this directly? Or else I can prepare a pull request. Let me know. Acked-by: Kishon Vijay Abraham I kis...@ti.com Thanks Kishon Signed-off-by: Oussama Ghorbel ghor...@pivasoftware.com --- drivers/phy/phy-omap-usb2.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 93d7835..acc13f8 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c @@ -262,14 +262,16 @@ static int omap_usb2_probe(struct platform_device *pdev) otg-phy= phy-phy; platform_set_drvdata(pdev, phy); + pm_runtime_enable(phy-dev); generic_phy = devm_phy_create(phy-dev, NULL, ops, NULL); - if (IS_ERR(generic_phy)) + if (IS_ERR(generic_phy)) { + pm_runtime_disable(phy-dev); return PTR_ERR(generic_phy); + } phy_set_drvdata(generic_phy, phy); - pm_runtime_enable(phy-dev); phy_provider = devm_of_phy_provider_register(phy-dev, of_phy_simple_xlate); if (IS_ERR(phy_provider)) { -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/2] Equivalent of g_webcam with configfs
Hi Laurent, Hi Felipe, W dniu 14.10.2014 o 17:02, Laurent Pinchart pisze: On Tuesday 14 October 2014 09:32:33 Felipe Balbi wrote: Hi, On Wed, Sep 24, 2014 at 03:26:41PM +0200, Andrzej Pietrasiewicz wrote: This series aims at integrating configfs into uvc, the way it has been done for acm, ncm, ecm, eem, ecm subset, rndis, obex, phonet, mass_storage, FunctionFS, loopback, sourcesink, uac1 and uac2. The preparation series is already on Felipe's next, so this series in fact consists of a small preparation patch and the configfs support proper. Rebased onto Felipe's next. @Felipe: I know you asked for not sending patches until 3.18-rc1 is out. I'm sending this short series anyway, so that e.g. Laurent can have a look at it. @Laurent: Can you have a look at this series? Laurent ? Since I can't run g_webcam without making it crash, can you look at this ? I will after ELC-E/LPC. My bandwidth is full this week :-/ Have you got any comments about the series? AP -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 0/7] Equivalent of g_midi with configfs
W dniu 16.10.2014 o 13:33, Andrzej Pietrasiewicz pisze: This series aims at integrating configfs into midi, the way it has been done for acm, ncm, ecm, eem, ecm subset, rndis, obex, phonet, mass_storage, FunctionFS, loopback, sourcesink, uac1, uac2, uvc and hid. It concludes converting functions explicitly available as f_xyz.c files to configfs. Have you got any comments about the series? AP -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 0/8] Equivalent of g_hid with configfs
Hi Felipe, W dniu 10.10.2014 o 20:07, Andrzej Pietrasiewicz pisze: This series aims at integrating configfs into hid, the way it has been done for acm, ncm, ecm, eem, ecm subset, rndis, obex, phonet, mass_storage, FunctionFS, loopback, sourcesink, uac1, uac2 and uvc. Have you got any comments about the series? AP -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH net-next v2 2/3] r8152: clear theflagofSCHEDULE_TASKLETin tasklet
Francois Romieu [mailto:rom...@fr.zoreil.com] [...] test_and_clear_bit (dense) or clear_bit would be more idiomatic. Excuse me. If I use clear_bit without test_bit or test_and_clear_bit, they alwayes call the spin lock. However, for my original flow, the spin lock is only called when the clear_bit is necessary. Is that better? Best Regards, Hayes -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] HID: usbhid: enable always-poll quirk for Elan Touchscreen 0103
On Fri, 31 Oct 2014, Adel Gadllah wrote: Yet another device that needs this quirk. Reported-by: Tanguy de Baritault tdebarita...@gmail.com Signed-off-by: Adel Gadllah adel.gadl...@gmail.com Applied, thanks. --- drivers/hid/hid-ids.h | 1 + drivers/hid/usbhid/hid-quirks.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index e23ab8b..7c86373 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -299,6 +299,7 @@ #define USB_VENDOR_ID_ELAN 0x04f3 #define USB_DEVICE_ID_ELAN_TOUCHSCREEN 0x0089 #define USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B 0x009b +#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_0103 0x0103 #define USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F 0x016f #define USB_VENDOR_ID_ELECOM 0x056e diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 5014bb5..552671e 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c @@ -72,6 +72,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN, HID_QUIRK_ALWAYS_POLL }, { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B, HID_QUIRK_ALWAYS_POLL }, + { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_0103, HID_QUIRK_ALWAYS_POLL }, { USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F, HID_QUIRK_ALWAYS_POLL }, { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, -- 1.9.3 -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] [usb] make xhci platform driver use 64 bit or 32 bit DMA
On Thu, 2014-10-30 at 22:05 +0100, Arnd Bergmann wrote: You should definitely make sure that this also works with DT, as I don't think it's possible to support X-Gene with ACPI. I know that Al Stone has experimented with it in the past, but he never came back with any results, so I assume the experiment failed. Note that the discussions about merging ACPI support on ARM64 are based on the assumption that we'd only ever support SBSA-like platforms, not something like X-Gene that looks more like an embedded SoC. Your XHCI patches still obviously make sense for other platforms, so that's not a show-stopper. But for some misconfiguration, the arm64 kernels in fedora arm koji would boot using ACPI on Mustang, the Foundation model, and AMD Seattle platforms. All very much a work in progress, but the tree from which the fedora patches are taken is the devel branch of: git.fedorahosted.org/git/kernel-arm64.git The configuration will be fixed this week and then you can just grab an arm64 fedora kernel and boot with acpi=force. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Question r/e zero byte bulk transfer on musb gadget (causes kernel panic)
On 01/11/2014 15:05, Alan Stern wrote: On Sat, 1 Nov 2014, Breton M. Saunders wrote: This is required behavior, for example, during the data phase of a bulk-only mass-storage transfer. The specification states that under certain circumstances, the device _must_ send a zero-length packet on its bulk-IN endpoint. Hi Alan - thanks for that. Can I ask: have you got a reference for that? It will help when I arrive back in the office on Monday. I've briefly skimmed the usb mass storage bulk only document (from 1999) and am looking at usb-msc-0.2.pdf now; but am not finding details on zero-length transfers on bulk. So on careful investigation, it turns out I misspoke. In the 1.0 revision of the Bulk-Only Transport specification (the filename is probably something like usbmassbulk_10.pdf), the discussion of case 4 in section 6.7.2 says: If the device actually transfers less data than the host indicated, then: The device may end the transfer with a short packet. The device shall STALL the Bulk-In pipe. Thus, if the device chooses to end the transfer with a short packet, the packet may need to have length 0 (for case 4). But the device isn't required to do this, whereas it _is_ required to STALL the bulk-IN pipe. Ironically, many devices in the real world _do_ send a short packet and _don't_ send a STALL. Regardless, the principle is clear: Devices _should_ be able to send 0-length packets on bulk endpoints. See the discussion of short packets in sections 5.3.2 and 5.8.3 of the USB-2.0 spec. Hi Alan, Thanks again for your help. I think my understanding of the bulk transfer protocol was incorrectly confused with my previous work on control transfers. It looks like there is no concept of transfer vs transaction in bulk like there is in control. In bulk, the state machine consists of a single token-data-handshake transition - the only way a write system call is terminated is by writing a short packet. Therefore, a short packet being 0 bytes is perfectly legitimate - and therefore, performing a write from userland of zero bytes should also be permitted. I reckon its off I go debugging MUSB. (Note: I'm stuck using 2.6.37; so the bug I've encountered may not be occurring on newer kernels). Cheers, -Brett -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/2] usb: gadget dbgp: Fix endpoint config after USB disconnect
SET_FEATURE request with DEBUG_MODE only worked the first time after module initialisation. Per the USB 2.0 debug device specification, said request is to be treated as if it were a SET_CONFIGURATION request, i.e. endpoint must be re-configured. As configure_endpoints() may now get called multiple times, move it outside __init and move serial_alloc_tty() call into __init. Code has assumption that endpoint mapping remains unchanged with consecutive calls of configure_endpoints(). Signed-off-by: Kyösti Mälkki kyosti.mal...@gmail.com --- drivers/usb/gadget/legacy/dbgp.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/legacy/dbgp.c b/drivers/usb/gadget/legacy/dbgp.c index 1b07513..633683a 100644 --- a/drivers/usb/gadget/legacy/dbgp.c +++ b/drivers/usb/gadget/legacy/dbgp.c @@ -237,7 +237,7 @@ static void dbgp_unbind(struct usb_gadget *gadget) static unsigned char tty_line; #endif -static int __init dbgp_configure_endpoints(struct usb_gadget *gadget) +static int dbgp_configure_endpoints(struct usb_gadget *gadget) { int stp; @@ -273,19 +273,10 @@ static int __init dbgp_configure_endpoints(struct usb_gadget *gadget) dbgp.serial-in-desc = i_desc; dbgp.serial-out-desc = o_desc; - - if (gserial_alloc_line(tty_line)) { - stp = 3; - goto fail_3; - } +#endif return 0; -fail_3: - dbgp.o_ep-driver_data = NULL; -#else - return 0; -#endif fail_2: dbgp.i_ep-driver_data = NULL; fail_1: @@ -324,10 +315,17 @@ static int __init dbgp_bind(struct usb_gadget *gadget, err = -ENOMEM; goto fail; } + + if (gserial_alloc_line(tty_line)) { + stp = 4; + err = -ENODEV; + goto fail; + } #endif + err = dbgp_configure_endpoints(gadget); if (err 0) { - stp = 4; + stp = 5; goto fail; } @@ -383,6 +381,10 @@ static int dbgp_setup(struct usb_gadget *gadget, #ifdef CONFIG_USB_G_DBGP_PRINTK err = dbgp_enable_ep(); #else + err = dbgp_configure_endpoints(gadget); + if (err 0) { + goto fail; + } err = gserial_connect(dbgp.serial, tty_line); #endif if (err 0) -- 1.8.1.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv6 6/8] usb: dwc2: gadget: Do not fail probe if there isn't a clock node
Hi, On Fri, Oct 31, 2014 at 02:31:31PM -0500, Dinh Nguyen wrote: On 10/31/2014 12:42 PM, Felipe Balbi wrote: Hi, On Fri, Oct 31, 2014 at 10:20:06AM -0500, Dinh Nguyen wrote: @@ -339,7 +339,8 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) } /* Change to L0 state */ hsotg-lx_state = DWC2_L0; -call_gadget(hsotg, resume); +if (!IS_ERR(hsotg-clk)) +call_gadget(hsotg, resume); instead of exposing the clock detail to the entire driver, add IS_ERR() checks to resume and suspend instead. In fact, NULL is a valid clock, so you might as well: clk = clk_get(foo, bar); if (IS_ERR(clk)) dwc-clk = NULL; else dwc-clk = clk; Then you don't need any IS_ERR() checks sprinkled around the driver. But we would still need to check for the clock before accessing gadget functionality right? if (dwc2-clk) call_gadget(); Read my comment again. NULL is a valid clock. Look at what clk_enable() does when a NULL pointer is passed: static int __clk_enable(struct clk *clk) { int ret = 0; if (!clk) return 0; if (WARN_ON(clk-prepare_count == 0)) return -ESHUTDOWN; if (clk-enable_count == 0) { ret = __clk_enable(clk-parent); if (ret) return ret; if (clk-ops-enable) { ret = clk-ops-enable(clk-hw); if (ret) { __clk_disable(clk-parent); return ret; } } } clk-enable_count++; return 0; } int clk_enable(struct clk *clk) { unsigned long flags; int ret; flags = clk_enable_lock(); ret = __clk_enable(clk); clk_enable_unlock(flags); return ret; } EXPORT_SYMBOL_GPL(clk_enable); Ah yes, thanks for the explanation. So if clk=NULL, it just return 0. But what I'm saying is that if the driver is configured for dual-role mode, and no clock is specified, then the driver should not be accessing any gadget functionality. why ? Why only for gadget and why can't it work on platforms without clk? What if Paul wants to run the gadget side on his HAPS-5x platform configured as a PCIe card ? You haven't explained why gadget has this hard-dependency on clk and why *only* gadget has it. This sounds really, really wrong. Why can host side run without clk but gadget can't ? Moreover, if you really want to prevent people from using gadget without clock, fail dwc2_gadget_init() and have the core fallback to host-only, then print a warning message. So as the patch series stands right now, if I swap out an A connector to a B-connector, then I get a connect_id_status change interrupt. The status would show a device and I would initialize the gadget portion of the driver. that's fine, but why the hard-dependency on clk ? diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 44c609f..96810f7 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -1371,7 +1371,8 @@ static void dwc2_conn_id_status_change(struct work_struct *work) hsotg-op_state = OTG_STATE_B_PERIPHERAL; dwc2_core_init(hsotg, false, -1); dwc2_enable_global_interrupts(hsotg); - s3c_hsotg_core_init(hsotg); + if (hsotg-clk) + s3c_hsotg_core_init(hsotg); So if I don't have a valid clock, I'll be accessing the peripheral portion of the IP. so what ? But I guess not having the check for the valid clock here should be fine as I don't see a case where there can be 2 different clocks for host and peripheral? probably the same thing. @@ -400,7 +401,8 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg) DSTS.Suspend Status=%d HWCFG4.Power Optimize=%d\n, !!(dsts DSTS_SUSPSTS), hsotg-hw_params.power_optimized); -call_gadget(hsotg, suspend); +if (!IS_ERR(hsotg-clk)) +call_gadget(hsotg, suspend); } else { if (hsotg-op_state == OTG_STATE_A_PERIPHERAL) { dev_dbg(hsotg-dev, a_peripheral-a_host\n); @@ -477,7 +479,8 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev) spin_lock(hsotg-lock); if (dwc2_is_device_mode(hsotg)) -retval = s3c_hsotg_irq(irq, dev); +if (!IS_ERR(hsotg-clk)) +retval = s3c_hsotg_irq(irq, dev); wait a minute, if there is no clock we don't call the gadget interrupt handler ? Why ? Who will disable the IRQ line ? This portion is no static
Re: [PATCH v2 2/2] usb: gadget serial: Honour termios CLOCAL on disconnect
Hi Kyösti, On 11/03/2014 10:18 AM, Kyösti Mälkki wrote: There are applications where it is desirable to not hangup ttyGS* when USB disconnect is detected. USB host side of communication may power-cycle periodically or there may be the actual need to physically disconnect and reconnect USB cable temporarily. USB disconnects on serial gadget are comparable to loss of Carrier Detect of conventional UARTs. With the change, if ttyGS* has termios CLOCAL flag set, disconnect on USB does not hangup the TTY. Signed-off-by: Kyösti Mälkki kyosti.mal...@gmail.com --- drivers/usb/gadget/function/u_serial.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 491082a..dabc165 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1253,9 +1253,16 @@ void gserial_disconnect(struct gserial *gser) port-port_usb = NULL; gser-ioport = NULL; if (port-port.count 0 || port-openclose) { + struct tty_struct *tty; + wake_up_interruptible(port-drain_wait); - if (port-port.tty) - tty_hangup(port-port.tty); + tty = port-port.tty; + if (tty) { + if (tty-termios.c_cflag CLOCAL) + stop_tty(tty); + else + tty_hangup(tty); It seems you missed my earlier email: what happens if you leave out the stop_tty() call here? I ask because the tty is still restartable from userspace after you stop_tty() here. So if your goal is to prevent write() from happening, this won't work. Regards, Peter Hurley + } } spin_unlock_irqrestore(port-port_lock, flags); -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: gadgetfs: fops change not preserved on return from dev_config()
On Wed, Oct 29, 2014 at 09:39:20AM +1100, Andre Wolokita wrote: Hi Felipe, On 28/10/14 01:26, Felipe Balbi wrote: Hi, On Mon, Oct 27, 2014 at 10:31:42AM +1100, Andre Wolokita wrote: I'm noticing some strange behaviour in the gadgetfs driver when running gadgetfs-test; the program fails with the error ep0 read after poll: Invalid argument. As far as I understand, an inode is created upon an open() call in gadgetfs-test and an initial fops is assigned to the struct file that doesn't contain a .read member. The .write member of this first fops points to dev_config() in usb/gadget/legacy/inode.c. When user-space write is called for the first time, dev_config() performs a bunch of configuration stuff before doing fd-f_op = ep0_io_operations;. This new file_operations struct does contain a .read member, which points to ep0_read(). I'm confused as to why when an error occurs when a subsequent read() is called in gadgetfs-test. I thought that changes to an fops pointer is preserved upon returning to the user-space caller. How can it be that fd-f_op = ep0_io_operations; clearly changes the fops pointer, yet these changes aren't reflected when returning to user-space? probably a regression caused by another commit ? Can you try bisecting to pin-point what broke it ? Do you remember which was the last kernel where this worked ? I'm working on the ADI trunk of the buildroot distro and it looks like gadgetfs (inode.c) was added during our last merge. I'll need to do some testing on 3.17 mainline to see if this problem exists there too or if it's restricted to our tree. I'll let you know how it goes. oh, so you never tested mainline ? Why are you reporting bugs then ? Didn't you get the memo that this support channel is *only* for latest mainline tree ? cheers -- balbi signature.asc Description: Digital signature
Re: Question r/e zero byte bulk transfer on musb gadget (causes kernel panic)
On Mon, 3 Nov 2014, Breton M. Saunders wrote: Hi Alan, Thanks again for your help. I think my understanding of the bulk transfer protocol was incorrectly confused with my previous work on control transfers. It looks like there is no concept of transfer vs transaction in bulk like there is in control. There _is_ a concept of bulk transfers, but it exists only at a higher level of abstraction, whereas control transfers are represented directly within the USB bus protocol. In bulk, the state machine consists of a single token-data-handshake transition - the only way a write system call is terminated is by writing a short packet. I'm not entirely sure what you mean here, but you seem to have the right basic idea. A host and a device agree (somehow) on how long a bulk transfer ought to be, and if the transfer needs to be shorter than the agreed-on length then it must be terminated by a short packet. Which will have to be a zero-length packet in the case where the actual length is a multiple of the maxpacket size. Therefore, a short packet being 0 bytes is perfectly legitimate - and therefore, performing a write from userland of zero bytes should also be permitted. Yes. I reckon its off I go debugging MUSB. (Note: I'm stuck using 2.6.37; so the bug I've encountered may not be occurring on newer kernels). Good luck. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
bugreport: huawei_cdc_ncm kernel driver and control device unbinds after 121 AT commands sent
Problem: The huawei_cdc_ncm driver (for the 4G LTE dongle Huawei E3276) gets unregistered and the control device /dev/cdc-wdmN disappears after sending exactly 121 AT commands to the device. After a few seconds, the driver is re-registered and the control device reappears. Test program causing the error included at the end of this message. Keywords: huawei_cdc_ncm, LTE, AT commands, cdc-wdm Detailed problem description: The behavior has been verified on kernel 3.16.0 and on kernel 3.17.1, on a 64-bit Core i5 x86 machine and on a a smaller embedded 32-bit x86 machine. Exact command does not matter, used 'ATI' and 'AT^HCSQ?' with same result. Distros used are Kubuntu 14.04.1 LTS on the i5 and Debian Wheezy on the embedded machine. Kernel modules: huawei_cdc_ncm, cdc_ncm The test program contains some rudimentary C++ but should be readable even to die-hard C guys ;) The program is crude but hopefully useful for debugging. If more info is needed, let me know and I will provide it. Best regards, /Erik Alapää // // Program that causes temporary loss of cdc-wdmN device and huawei_cdc_ncm // driver reload after 121 AT commands sent. // // No makefile, just compile with 'g++ -g wdm_err.cpp -o wdm_err'. // // Usage, see 'Usage: ' message in the code below. // #include cstdio #include cstdlib #include cerrno #include cstring #include sys/time.h #include sys/types.h #include fcntl.h #include unistd.h #include stdexcept #include string #include iostream #include fstream using std::string; using std::cout; using std::runtime_error; using std::endl; using std::fstream; int main(int argc, char* argv[]) { fd_set rfds; fd_set wfds; struct timeval tv; struct timeval tv2; int retval; int n; const int SZ = 512; char errbuf[SZ]; char ctrlin_buf[SZ]; //string command(AT^HCSQ?\n); string command(ATI\n); string response; string resp_line; fstream at_file; int sleep_us = 0; int sendcount = 0; char CTRL_DEVICE[SZ]; // Get file descriptor for select() if (argc == 3) { cout Setting AT ctrl device to \' argv[1] \'\n; strcpy(CTRL_DEVICE, argv[1]); cout Sleep interval sleep_us us\n; } else { cout Usage: rw2 at-ctrl-device sleeptime in us (ctrl is typically /dev/cdc-wdmN)\n\n; throw std::runtime_error(Too few args, no ctrl device specified!); } int ctrl = open(CTRL_DEVICE, O_RDWR); if (ctrl == -1) { throw std::runtime_error(strerror_r(errno, errbuf, SZ)); } sleep_us = atoi(argv[2]); // Get fstream for C++-style reading and writing at_file.open(CTRL_DEVICE, std::fstream::in | std::fstream::out | std::fstream::app); if (!at_file) { throw runtime_error(Could not open wdm device file!\n); } for (;;) { tv.tv_sec = 10; tv.tv_usec = 0; FD_ZERO(rfds); FD_SET(ctrl, rfds); FD_ZERO(wfds); FD_SET(ctrl, wfds); if (at_file.bad()) { throw runtime_error(wdm device file gone bad!); } tv2.tv_sec = 0; tv2.tv_usec = sleep_us; retval = select(0, NULL, NULL, NULL, tv2); // sleep if (retval == -1) { throw std::runtime_error(strerror_r(errno, errbuf, SZ)); } retval = select(ctrl+1, rfds, wfds, NULL, tv); if (retval == -1) { throw std::runtime_error(strerror_r(errno, errbuf, SZ)); } if (at_file.bad()) { throw runtime_error(wdm device file gone bad!); } if (FD_ISSET(ctrl, wfds)) { cout Writing command \' command \' to ctrl device\n; command += \r; at_file command endl; cout sendcount++; } if (FD_ISSET(ctrl, rfds)) { n = read(ctrl, ctrlin_buf, SZ); // ifstrem::read fails for some reason if (n == -1) { throw std::runtime_error(strerror_r(errno, errbuf, SZ)); } response = std::string(ctrlin_buf, n); cout response endl; } } return 0; } -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH usb v3 17/29] host: ehci-orion: remove duplicate check on resource
Hi Varka, On 31/10/2014 02:14, Varka Bhadram wrote: From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Reviewed-by: Gregory CLEMENT gregory.clem...@free-electrons.com Thanks, Gregory Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-orion.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index 22e15ca..36b4657 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c @@ -175,15 +175,6 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) goto err; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pdev-dev, - Found HC with no register addr. Check %s setup!\n, - dev_name(pdev-dev)); - err = -ENODEV; - goto err; - } - /* * Right now device-tree probed devices don't get dma_mask * set. Since shared usb code relies on it, set it here for @@ -193,6 +184,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) if (err) goto err; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(regs)) { err = PTR_ERR(regs); -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH usb v3 22/29] host: xhci-plat: remove duplicate check on resource
Hi Varka, On 31/10/2014 02:14, Varka Bhadram wrote: From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Reviewed-by: Gregory CLEMENT gregory.clem...@free-electrons.com Thanks, Gregory Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/xhci-plat.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 3d78b0c..e68b4ec 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -83,9 +83,6 @@ static int xhci_plat_probe(struct platform_device *pdev) if (irq 0) return -ENODEV; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; if (of_device_is_compatible(pdev-dev.of_node, marvell,armada-375-xhci) || @@ -109,15 +106,16 @@ static int xhci_plat_probe(struct platform_device *pdev) if (!hcd) return -ENOMEM; - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto put_hcd; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); + /* * Not all platforms have a clk so it is not an error if the * clock does not exists. -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH usb v3 22/29] host: xhci-plat: remove duplicate check on resource
On Fri, Oct 31, 2014 at 06:44:37AM +0530, Varka Bhadram wrote: From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/host/xhci-plat.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 3d78b0c..e68b4ec 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -83,9 +83,6 @@ static int xhci_plat_probe(struct platform_device *pdev) if (irq 0) return -ENODEV; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; if (of_device_is_compatible(pdev-dev.of_node, marvell,armada-375-xhci) || @@ -109,15 +106,16 @@ static int xhci_plat_probe(struct platform_device *pdev) if (!hcd) return -ENOMEM; - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto put_hcd; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); + /* * Not all platforms have a clk so it is not an error if the * clock does not exists. -- 1.7.9.5 -- balbi signature.asc Description: Digital signature
Re: [PATCH] usb: musb: replace hard coded registers with defines
On Mon, Oct 27, 2014 at 09:48:39PM +0100, Roman Byshko wrote: musb registers can be dumped using the file regdump which is created in debugfs. Up to now hard coded register addresses are used for that. Different glue layers however have different register addresses. The patch addresses this issue by substituting bare register addresses with defines. missing Signed-off-by, can't accept. Sorry. -- balbi signature.asc Description: Digital signature
Re: [PATCH 0/2] Equivalent of g_webcam with configfs
On Mon, Nov 03, 2014 at 12:56:32PM +0100, Andrzej Pietrasiewicz wrote: Hi Laurent, Hi Felipe, W dniu 14.10.2014 o 17:02, Laurent Pinchart pisze: On Tuesday 14 October 2014 09:32:33 Felipe Balbi wrote: Hi, On Wed, Sep 24, 2014 at 03:26:41PM +0200, Andrzej Pietrasiewicz wrote: This series aims at integrating configfs into uvc, the way it has been done for acm, ncm, ecm, eem, ecm subset, rndis, obex, phonet, mass_storage, FunctionFS, loopback, sourcesink, uac1 and uac2. The preparation series is already on Felipe's next, so this series in fact consists of a small preparation patch and the configfs support proper. Rebased onto Felipe's next. @Felipe: I know you asked for not sending patches until 3.18-rc1 is out. I'm sending this short series anyway, so that e.g. Laurent can have a look at it. @Laurent: Can you have a look at this series? Laurent ? Since I can't run g_webcam without making it crash, can you look at this ? I will after ELC-E/LPC. My bandwidth is full this week :-/ Have you got any comments about the series? Laurent ? -- balbi signature.asc Description: Digital signature
Re: [PATCH v4] usb: gadget: f_fs: add no_disconnect mode
Hi, On Thu, Oct 09, 2014 at 03:21:51PM +0200, Robert Baldyga wrote: Since we can compose gadgets from many functions, there is the problem related to gadget breakage while FunctionFS daemon being closed. FFS function is userspace code so there is no way to know when it will close files (it doesn't matter what is the reason of this situation, it can be daemon logic, program breakage, process kill or any other). So when we have another function in gadget which, for example, sends some amount of data, does some software update or implements some real-time functionality, we may want to keep the gadget connected despite FFS function is no longer functional. We can't just remove one of functions from gadget since it has been enumerated, so the only way to keep entire gadget working is to make broken FFS function deactivated but still visible to host. For this purpose this patch introduces no_disconnect mode. It can be enabled by setting mount option no_disconnect=1, and results with defering function disconnect to the moment of reopen ep0 file or filesystem unmount. After closing all endpoint files, FunctionFS is set to state FFS_DEACTIVATED. When ffs-state == FFS_DEACTIVATED: - function is still bound and visible to host, - setup requests are automatically stalled, - transfers on other endpoints are refused, - epfiles, except ep0, are deleted from the filesystem, - opening ep0 causes the function to be closes, and then FunctionFS is ready for descriptors and string write, - unmounting of the FunctionFS instance causes the function to be closed. Signed-off-by: Robert Baldyga r.bald...@samsung.com David, you have been messing with ffs lately, can I get a Tested-by from you on this patch ? --- Changelog: v4: - use ffs_data_reset() instead of ffs_data_clear() to reset ffs data properly after ffs-ref refcount reach 0 (or under in no_disconnect mode) in ffs_data_put() function v3: https://lkml.org/lkml/2014/10/9/170 - change option name to more descriptive and less scary, - fix cleaning up on unmount (call ffs_data_closed() in ffs_fs_kill_sb(), and ffs_data_clear() in ffs_data_closed() if ffs-opened is negative). v2: https://lkml.org/lkml/2014/10/7/109 - delete epfiles, excepting ep0, when FFS is in zombie mode, - add description of FFS_ZOMBIE state, - minor cleanups. v1: https://lkml.org/lkml/2014/10/6/128 drivers/usb/gadget/function/f_fs.c | 42 +++--- drivers/usb/gadget/function/u_fs.h | 22 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 12dbdaf..2d47d4a 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -606,6 +606,8 @@ static unsigned int ffs_ep0_poll(struct file *file, poll_table *wait) } case FFS_CLOSING: break; + case FFS_DEACTIVATED: + break; } mutex_unlock(ffs-mutex); @@ -1152,6 +1154,7 @@ struct ffs_sb_fill_data { struct ffs_file_perms perms; umode_t root_mode; const char *dev_name; + bool no_disconnect; struct ffs_data *ffs_data; }; @@ -1222,6 +1225,12 @@ static int ffs_fs_parse_opts(struct ffs_sb_fill_data *data, char *opts) /* Interpret option */ switch (eq - opts) { + case 13: + if (!memcmp(opts, no_disconnect, 13)) + data-no_disconnect = !!value; + else + goto invalid; + break; case 5: if (!memcmp(opts, rmode, 5)) data-root_mode = (value 0555) | S_IFDIR; @@ -1286,6 +1295,7 @@ ffs_fs_mount(struct file_system_type *t, int flags, .gid = GLOBAL_ROOT_GID, }, .root_mode = S_IFDIR | 0500, + .no_disconnect = false, }; struct dentry *rv; int ret; @@ -1302,6 +1312,7 @@ ffs_fs_mount(struct file_system_type *t, int flags, if (unlikely(!ffs)) return ERR_PTR(-ENOMEM); ffs-file_perms = data.perms; + ffs-no_disconnect = data.no_disconnect; ffs-dev_name = kstrdup(dev_name, GFP_KERNEL); if (unlikely(!ffs-dev_name)) { @@ -1333,6 +1344,7 @@ ffs_fs_kill_sb(struct super_block *sb) kill_litter_super(sb); if (sb-s_fs_info) { ffs_release_dev(sb-s_fs_info); + ffs_data_closed(sb-s_fs_info); ffs_data_put(sb-s_fs_info); } } @@ -1389,7 +1401,9 @@ static void ffs_data_opened(struct ffs_data *ffs) ENTER(); atomic_inc(ffs-ref); - atomic_inc(ffs-opened); + if (atomic_add_return(1, ffs-opened) == 1) + if (ffs-state == FFS_DEACTIVATED) +
Re: [RFC v4] usb: phy: Hold wakeupsource when USB is enumerated in peripheral mode
Hi, On Fri, Oct 31, 2014 at 09:27:43AM +0530, Kiran Raparthy wrote: Thank you very much for taking time in reviewing the patch. I will try to improve the patch as per your suggestions. however,i have few queries which i wanted to understand from you. sure thing. On 7 October 2014 19:55, Felipe Balbi ba...@ti.com wrote: +static int otg_wakeupsource_init(void) +{ + int ret_usb2; + int ret_usb3; + char wsource_name_usb2[40]; + char wsource_name_usb3[40]; + static struct usb_phy *otgws_xceiv_usb2; + static struct usb_phy *otgws_xceiv_usb3; + + otgws_xceiv_usb2 = usb_get_phy(USB_PHY_TYPE_USB2); + otgws_xceiv_usb3 = usb_get_phy(USB_PHY_TYPE_USB3); + + if (IS_ERR(otgws_xceiv_usb2) IS_ERR(otgws_xceiv_usb3)) { + pr_err(%s: No OTG transceiver found\n, __func__); + return PTR_ERR(otgws_xceiv_usb2); + } + + spin_lock_init(otgws_xceiv_usb2-otgws_slock); + spin_lock_init(otgws_xceiv_usb3-otgws_slock); + + snprintf(wsource_name_usb2, sizeof(wsource_name_usb2), vbus-%s, + dev_name(otgws_xceiv_usb2-dev)); + wakeup_source_init(otgws_xceiv_usb2-wsource, wsource_name_usb2); + + snprintf(wsource_name_usb3, sizeof(wsource_name_usb3), vbus-%s, + dev_name(otgws_xceiv_usb3-dev)); + wakeup_source_init(otgws_xceiv_usb3-wsource, wsource_name_usb3); + + otgws_xceiv_usb2-otgws_nb.notifier_call = otgws_otg_usb2_notifications; + ret_usb2 = usb_register_notifier(otgws_xceiv_usb2, + otgws_xceiv_usb2-otgws_nb); + + otgws_xceiv_usb3-otgws_nb.notifier_call = otgws_otg_usb3_notifications; + ret_usb3 = usb_register_notifier(otgws_xceiv_usb3, + otgws_xceiv_usb3-otgws_nb); + + if (ret_usb2 ret_usb3) { + pr_err(%s: usb_register_notifier on transceiver failed\n, + __func__); + wakeup_source_trash(otgws_xceiv_usb2-wsource); + wakeup_source_trash(otgws_xceiv_usb3-wsource); + otgws_xceiv_usb2 = NULL; + otgws_xceiv_usb3 = NULL; + return ret_usb2 | ret_usb3; + } + + return 0; +} + +late_initcall(otg_wakeupsource_init); you guys are really not getting what I mean. I asked for this to be built into the core itself. This means that you shouldn't need to use notifications nor should you need to call usb_get_phy(). You're part of the PHY framework. All this late_initcall() nonsense should go. This code won't even work if we have more than one phy of the same type (AM437x SoC, for example, has up to 4 instances of dwc3, so that's 4 USB2 PHYs), because you can't grab the PHY you want. Apologies,I am new to usb sub system,so i missed this point before i posted my patch,Thanks for the information. np. What you need is to: 1) make PHY notifiers generic (move all of that phy-core.c) From the above points,you mentioned that if we built it into core,we shouldn't need to use notifications and your first point here says that make phy notifiers generic in phy-core.c can you help me understanding it better so that there wont be any understanding gap. yeah, notifiers should go but if you really must use them, then at least make all of that generic ;-) 2) introduce usb_phy_set_event(phy, event) (which just sets the even to a phy-event member for now) 3) make all PHY drivers use usb_phy_set_event() 4) add the following to usb_phy_set_event() switch (event) { case USB_EVENT_ENUMERATED: pm_stay_awake(otgws_xceiv-wsource); break; case USB_EVENT_NONE: case USB_EVENT_VBUS: case USB_EVENT_ID: case USB_EVENT_CHARGER: pm_wakeup_event(otgws_xceiv-wsource, msecs_to_jiffies(TEMPORARY_HOLD_TIME)); break; default: break; } Once the phy drivers receives per-PHY event notification(if we use notifier,else for any event) we can call usb_phy_set_event from phy driver to hold the wakeup source. Please correct me if my understanding is incorrect. yeah. In fact, you can call usb_phy_set_event() directly from PHY's IRQ handler. I have gone through some phy drivers in drivers/phy,since the each driver implementation is different from others, i didn't get the best place in PHY driver where we can trigger(use phy-core functionality) per-PHY notifier registration. any pointers here? registration ? probe(), they all have probe() functions. Now to figure out where to call usb_phy_set_event(). That's something completely different, and that's where the core of
Re: btusb_intr_complete returns -EPIPE
On Mon, 3 Nov 2014, Naveen Kumar Parna wrote: On Sat, Nov 1, 2014 at 2:21 AM, Alan Stern st...@rowland.harvard.edu wrote: On Wed, 29 Oct 2014, Naveen Kumar Parna wrote: Split packet transactions are hidden. I could see them by clicking on the (Show/Hide Split transactions) button. For INT IN, I could see only Start Split packet. I attached([2014-10-28 session 144012] Trace0003.rar) complete log for this scenario. How come the log doesn't contain any SOF packets? To avoid recording a huge quantity of data , I enabled the Drop Start of Frames filter in the recording options. Can you do it again, but this time keep the SOF packets? You don't have to post the entire analyzer log. Just extract 3 or 4 ms from the middle, where it shows the SSPLITS but no CSPLITS for the interrupt endpoints, and post only that portion. I see what you mean -- the log doesn't contain any CSPLIT transactions for the interrupt endpoints. Only SSPLIT. I'll need to see the scheduling information for these endpoints. You'll have to run a 3.13 or later kernel; then the important files will be under /sys/kernel/debug/usb/ehci/X/, where X is the PCI address of the EHCI controller you are using. Copy the files in that directory while the test is running. I attached all the files. Please let me know if I miss anything? All the information in the files looks correct, as far as I can see. I have no idea why the CSPLIT packets are missing. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] USB: simple: add Google simple serial SubClass support
Add support for Google devices that export simple serial interfaces using the vendor specific SubClass/Protocol pair 0x50/0x01. Signed-off-by: Anton Staaf robot...@chromium.org --- drivers/usb/serial/usb-serial-simple.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c index 8bfc47c..a3572b7 100644 --- a/drivers/usb/serial/usb-serial-simple.c +++ b/drivers/usb/serial/usb-serial-simple.c @@ -91,6 +91,14 @@ DEVICE(suunto, SUUNTO_IDS); { USB_DEVICE(0x908, 0x0004) } DEVICE(siemens_mpi, SIEMENS_IDS); +/* Google Serial USB SubClass */ +#define GOOGLE_IDS() \ + { USB_VENDOR_AND_INTERFACE_INFO(0x18d1,\ + USB_CLASS_VENDOR_SPEC, \ + 0x50, \ + 0x01) } +DEVICE(google, GOOGLE_IDS); + /* All of the above structures mushed into two lists */ static struct usb_serial_driver * const serial_drivers[] = { carelink_device, @@ -103,6 +111,7 @@ static struct usb_serial_driver * const serial_drivers[] = { hp4x_device, suunto_device, siemens_mpi_device, + google_device, NULL }; @@ -117,6 +126,7 @@ static const struct usb_device_id id_table[] = { HP4X_IDS(), SUUNTO_IDS(), SIEMENS_IDS(), + GOOGLE_IDS(), { }, }; MODULE_DEVICE_TABLE(usb, id_table); -- 2.1.0.rc2.206.gedb03e5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2] [usb] make xhci platform driver use 64 bit or 32 bit DMA
On Mon, 2014-11-03 at 18:14 +0100, Arnd Bergmann wrote: On Monday 03 November 2014 09:15:51 Mark Salter wrote: On Thu, 2014-10-30 at 22:05 +0100, Arnd Bergmann wrote: You should definitely make sure that this also works with DT, as I don't think it's possible to support X-Gene with ACPI. I know that Al Stone has experimented with it in the past, but he never came back with any results, so I assume the experiment failed. Note that the discussions about merging ACPI support on ARM64 are based on the assumption that we'd only ever support SBSA-like platforms, not something like X-Gene that looks more like an embedded SoC. Your XHCI patches still obviously make sense for other platforms, so that's not a show-stopper. But for some misconfiguration, the arm64 kernels in fedora arm koji would boot using ACPI on Mustang, the Foundation model, and AMD Seattle platforms. All very much a work in progress, but the tree from which the fedora patches are taken is the devel branch of: git.fedorahosted.org/git/kernel-arm64.git The configuration will be fixed this week and then you can just grab an arm64 fedora kernel and boot with acpi=force. It's not as bad as I had feared, but it still does a lot of the things that in previous discussions were said that ACPI would avoid doing, and that were used as arguments against just using DT on all arm64 servers: As I said, this is very much a work in progress. The point of the fedorahosted tree is to have *something* that will boot with ACPI and have working disk and network as a minimum for the few existing early platforms. It is certainly not an example of what an ACPI/SBSA server should look like. At least not yet. And it isn't a big secret. Linaro, Arm, and other folk are aware of that fedorahosted tree. I wouldn't read too much into any given patch in that tree as it stands right now. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] USB: simple: add Google simple serial SubClass support
On Mon, Nov 3, 2014 at 8:43 AM, Anton Staaf robot...@chromium.org wrote: Add support for Google devices that export simple serial interfaces using the vendor specific SubClass/Protocol pair 0x50/0x01. Signed-off-by: Anton Staaf robot...@chromium.org Reviewed-by: Benson Leung ble...@chromium.org -- Benson Leung Software Engineer, Chrom* OS ble...@chromium.org -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
bugreport: huawei_cdc_ncm control device freezes for 3-5 minutes on connect with E3276 LTE modem
Correction: Unfortunately, there was a bug in my test program, an '\r' was added to the AT command at each lap of the loop... So the driver reboots when 120 superfluous '\r' are included in the AT message. May still be a bug, but a less obvious one. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: bugreport: huawei_cdc_ncm control device freezes for 3-5 minutes on connect with E3276 LTE modem
On Mon, Nov 03, 2014 at 09:18:10PM +0100, Erik Alapää wrote: Correction: Unfortunately, there was a bug in my test program, an '\r' was added to the AT command at each lap of the loop... So the driver reboots when 120 superfluous '\r' are included in the AT message. May still be a bug, but a less obvious one. This really sounds like a bug in the device itself, not in the kernel driver, as there's nothing we can do about this. Have you tried reporting it to the hardware company? greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: bugreport: huawei_cdc_ncm control device freezes for 3-5 minutes on connect with E3276 LTE modem
Will try reporting to the hw company, maybe there is a firmware upgrade on the horizon. /Erik Alapää On Mon, Nov 3, 2014 at 9:32 PM, Greg KH gre...@linuxfoundation.org wrote: On Mon, Nov 03, 2014 at 09:18:10PM +0100, Erik Alapää wrote: Correction: Unfortunately, there was a bug in my test program, an '\r' was added to the AT command at each lap of the loop... So the driver reboots when 120 superfluous '\r' are included in the AT message. May still be a bug, but a less obvious one. This really sounds like a bug in the device itself, not in the kernel driver, as there's nothing we can do about this. Have you tried reporting it to the hardware company? greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Large disk drives
Was there any resolution as to how large disk drives would be handled if their interface did not support the capacity request that would tell how large they were? Or as an alternative, is there any way to avoid buying USB-SCSI interfaces that do not support the large-capacity request? Unfortunately, such devices work OK with Windows (since Windows trusts what the partition table says), you can't just say to the salesperson It has to work on drives over 3 TB. Dale -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv4 3/6] arm: omap3: twl: use the new lookup method with usb phy
* Heikki Krogerus heikki.kroge...@linux.intel.com [141017 07:43]: Provide complete association for the phy and it's user (musb) with the new phy lookup method. Signed-off-by: Heikki Krogerus heikki.kroge...@linux.intel.com Kishon, this looks OK for you to queue with other PHY patches: Acked-by: Tony Lindgren t...@atomide.com --- arch/arm/mach-omap2/twl-common.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index b0d54da..0e4f3e3 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c @@ -91,18 +91,11 @@ void __init omap_pmic_late_init(void) } #if defined(CONFIG_ARCH_OMAP3) -struct phy_consumer consumers[] = { - PHY_CONSUMER(musb-hdrc.0, usb), -}; - -struct phy_init_data init_data = { - .consumers = consumers, - .num_consumers = ARRAY_SIZE(consumers), -}; +static struct phy_lookup twl4030_usb_lookup = PHY_LOOKUP(twl4030_usb, + musb-hdrc.0, usb); static struct twl4030_usb_data omap3_usb_pdata = { - .usb_mode = T2_USB_MODE_ULPI, - .init_data = init_data, + .usb_mode = T2_USB_MODE_ULPI, }; static int omap3_batt_table[] = { @@ -225,8 +218,10 @@ void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, } /* Common platform data configurations */ - if (pdata_flags TWL_COMMON_PDATA_USB !pmic_data-usb) + if (pdata_flags TWL_COMMON_PDATA_USB !pmic_data-usb) { + phy_register_lookup(twl4030_usb_lookup); pmic_data-usb = omap3_usb_pdata; + } if (pdata_flags TWL_COMMON_PDATA_BCI !pmic_data-bci) pmic_data-bci = omap3_bci_pdata; -- 2.1.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: usbserial / ftdi_sio (+ others) bug?
On Wed, 29 Oct 2014 09:51:28 +0100 Johan Hovold jo...@kernel.org wrote: Having the driver not reporting overrun (and other) errors will obviously not fix the underlying issue with your device, which is generating all these errors in the first place. Ok, I did take a closer look at this (mostly with usbmon) and it seems to be caused by the hardware. When the application does open the device and the driver submits the first bulk reads, there's basically three possibilities what happens next: 1. The chip responds with correct data and everything works fine from there until the device is closed. 2. The chip responds with single correct character followed by a few hundred or so replies containing only the overrun status (no data) which are then converted to a bunch of binary zeroes by the ldisc because of the bug I mentioned earlier. After that the chip starts responding with proper data again and works until closed. 3. The chip hangs forever without ever responding anything on the bulk endpoint. As a rough estimate I'd say that something like at least one out of ten opens currently exhibits either behavior 2 or 3. Also it doesn't seem to have anything to do with any real buffering inside the chip i.e. if I close a working connection and immediately open it again, it may hang the chip. After some poking around, it seems that the chip really doesn't like the latency timer value of 1 when it is reset. After it gets the data going it doesn't seem to mind it i.e. I have not seen the chip to hang or report superfluous overruns during normal operation even with latency timer value of 1. With timer value 2 I did get something like 300 opens before hitting the issue and with value 3 I have not seen the device misbehave (yet) in like a thousand or so opens. I do think that more testing is still needed before saying anything definite, but larger timer at least seems to mitigate the issue significantly. BTW, in case nobody else is ever experiencing this issue, please note that I cannot guarantee in any way that the FT232RL in my device is actually authentic. If it is counterfeit, it is a different one than the one that was having the issue with the Windows driver lately. My device doesn't seem to have that bug, but that is no guarantee that it is the real deal. And obviously, real or not, it *does* have some bug that causes it to now misbehave during open(). So, tentatively seems that in order to get rid of the issue with at least this FT232 variant (whatever it may happen to be), either the minimum latency timer value should be increased or possibly alternatively the chip could be reset with higher value and the actual value set later when the chip has started properly. Although I don't yet know for sure which latency value would work 100% of the time or if the alternative idea would actually work at all (I just thought about trying something like that). -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: dwc2: allow dwc2 to get built when USB_GADGET=m
Hi Felipe, On 10/22/2014 01:29 PM, Paul Zimmerman wrote: From: dingu...@opensource.altera.com [mailto:dingu...@opensource.altera.com] Sent: Tuesday, October 21, 2014 1:32 PM From: Dinh Nguyen dingu...@opensource.altera.com This patch allows the gadget portion of the DWC2 driver to get built when (!USB USB_GADGET) condition is encountered. Signed-off-by: Dinh Nguyen dingu...@opensource.altera.com --- drivers/usb/dwc2/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index f93807b..4d02718 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig @@ -1,6 +1,6 @@ config USB_DWC2 bool DesignWare USB2 DRD Core Support -depends on USB +depends on USB || USB_GADGET help Say Y here if your system has a Dual Role Hi-Speed USB controller based on the DesignWare HSOTG IP Core. Acked-by: Paul Zimmerman pa...@synopsys.com Can you please apply this patch to your -next tree? Thanks, Dinh -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb: dwc2: allow dwc2 to get built when USB_GADGET=m
On Mon, Nov 03, 2014 at 04:25:06PM -0600, Dinh Nguyen wrote: Hi Felipe, On 10/22/2014 01:29 PM, Paul Zimmerman wrote: From: dingu...@opensource.altera.com [mailto:dingu...@opensource.altera.com] Sent: Tuesday, October 21, 2014 1:32 PM From: Dinh Nguyen dingu...@opensource.altera.com This patch allows the gadget portion of the DWC2 driver to get built when (!USB USB_GADGET) condition is encountered. Signed-off-by: Dinh Nguyen dingu...@opensource.altera.com --- drivers/usb/dwc2/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index f93807b..4d02718 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig @@ -1,6 +1,6 @@ config USB_DWC2 bool DesignWare USB2 DRD Core Support - depends on USB + depends on USB || USB_GADGET help Say Y here if your system has a Dual Role Hi-Speed USB controller based on the DesignWare HSOTG IP Core. Acked-by: Paul Zimmerman pa...@synopsys.com Can you please apply this patch to your -next tree? You're not paying me to do anything, so you don't get a saying, sorry. Once it's in my next branch, you'll receive an automated email. v3.18-rc3 was just tagged and I want to retest everything on top of that before moving testing/next to immutable next. cheers -- balbi signature.asc Description: Digital signature
Re: [PATCH] usb: dwc2: allow dwc2 to get built when USB_GADGET=m
On Mon, Nov 03, 2014 at 04:34:06PM -0600, Felipe Balbi wrote: On Mon, Nov 03, 2014 at 04:25:06PM -0600, Dinh Nguyen wrote: Hi Felipe, On 10/22/2014 01:29 PM, Paul Zimmerman wrote: From: dingu...@opensource.altera.com [mailto:dingu...@opensource.altera.com] Sent: Tuesday, October 21, 2014 1:32 PM From: Dinh Nguyen dingu...@opensource.altera.com This patch allows the gadget portion of the DWC2 driver to get built when (!USB USB_GADGET) condition is encountered. Signed-off-by: Dinh Nguyen dingu...@opensource.altera.com --- drivers/usb/dwc2/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig index f93807b..4d02718 100644 --- a/drivers/usb/dwc2/Kconfig +++ b/drivers/usb/dwc2/Kconfig @@ -1,6 +1,6 @@ config USB_DWC2 bool DesignWare USB2 DRD Core Support -depends on USB +depends on USB || USB_GADGET help Say Y here if your system has a Dual Role Hi-Speed USB controller based on the DesignWare HSOTG IP Core. Acked-by: Paul Zimmerman pa...@synopsys.com Can you please apply this patch to your -next tree? You're not paying me to do anything, so you don't get a saying, sorry. Once it's in my next branch, you'll receive an automated email. v3.18-rc3 was just tagged and I want to retest everything on top of that before moving testing/next to immutable next. to make it all the more clear: TI doesn't get a saying either. It goes into my 'next' when *I* am happy with the patch. Sorry -- balbi signature.asc Description: Digital signature
Re: [RFC RESEND 00/10] Create separate header for ehci-dbgp driver
On Sun, Nov 02, 2014 at 09:07:47PM -0600, Chris Rorvick wrote: One more attempt at getting some feedback. Original: The FUSBH200 and FOTG210 are not EHCI-compatible and require standalone drivers. See discussion at: http://comments.gmane.org/gmane.linux.usb.general/84169 But these controllers do implement an EHCI-compatible debug port and therefore leverage the ehci-dbgp driver. Rather than pulling in the necessary declarations from linux/usb/ehci_def.h, each driver copies this code into their own header. The goal of this series is to pull the ehci-dbgp related code into its own header to remove the need for this redundancy. I have done only minimal testing on this, and I don't use either of these controller so my ability to test the changes is limited. But I thought I'd push it out for comment to see if there was interest. The only actual change should be when CONFIG_EARLY_PRINTK_DBGP is disabled and CONFIG_XEN_DOM0 is enabled. Currently each of these does not notify Xen of reset events under this configuration. Since these events are propagated when CONFIG_EARLY_PRINTK_DBGP and CONFIG_XEN_DOM0 are both enabled, though, it seems that is not a problem (and maybe not sending them in the former case is a bug?) Regardless, the motivation for this change is for consistancy as a step towrads consolidation. As I said above, I am not able to actually test these changes on either controller. First time submission, so I look forward to any feedback. If this is of any interest I will work on testing the various configations and boot parameters. Regards, Chris Rorvick Chris Rorvick (10): usb: Create separate header for ehci-dbgp fusbh200: Make Xen notificaiton consistent with EHCI fusbh200: Remove superfluous macro definitions fusbh200: Remove duplicate ehci-dbgp declarations fusbh200: Use ehci_dbg_port struct fotg210: Make Xen notificaiton consistent with EHCI fotg210: Remove superfluous macro definitions fotg210: Remove duplicate ehci-dbgp declarations fotg210: Use ehci_dbg_port struct usb: Remove __init from early_dbgp_init() prototype drivers/usb/host/fotg210.h| 62 ++-- drivers/usb/host/fusbh200.h | 62 ++-- include/linux/usb/ehci-dbgp.h | 83 +++ include/linux/usb/ehci_def.h | 65 ++--- 4 files changed, 91 insertions(+), 181 deletions(-) create mode 100644 include/linux/usb/ehci-dbgp.h It deletes lines of code overall, which looks good to me. Feel free to resend without the RFC and I will queue it up. thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] serial: Fix Entrega company name spelling
On Sat, Oct 04, 2014 at 12:19:59PM +0100, Mark Knibbs wrote: Hi, Patch v2 change: Fix spelling in usb-serial.txt too. Entrega is misspelled as Entregra or Entrgra, so fix that. Signed-off-by: Mark Knibbs ma...@clara.co.uk I see a bunch of patches from you in my queue, but I'm confused as to which ones I should apply, and which I should ignore. Can you resend what I should apply please? Also, should I have reverted a previous patch I applied? If so, what is the git commit id of it? thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] usb: Remove references to non-existent PLAT_S5P symbol
On Tue, Oct 07, 2014 at 11:12:07AM +0200, Sylwester Nawrocki wrote: The PLAT_S5P Kconfig symbol was removed in commit d78c16ccde96 (ARM: SAMSUNG: Remove remaining legacy code). There are still some references left, fix that by replacing them with ARCH_S5PV210. Fixes: d78c16ccde96 (ARM: SAMSUNG: Remove remaining legacy code) Reported-by: Paul Bolle pebo...@tiscali.nl Acked-by: Jingoo Han jg1@samsung.com Cc: sta...@vger.kernel.org [3.17+] This isn't a stable issue... -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/1] usb: core: notify disconnection when core detects disconnect
On Wed, Oct 08, 2014 at 01:58:17PM +0800, Peter Chen wrote: It is safe to call notify disconnect when the usb core thinks the device is disconnected. This commit also fixes one bug found at below situation: we have not enabled usb wakeup, we do system suspend when there is an usb device at the port, after suspend, we plug out the usb device, then plug in device again. At that time, the nofity disconnect was not called at current code, as the controller doesn't know the usb device was disconnected during the suspend, but USB core knows the port has changed during that periods. So to fix this problem, and let the usb core call notify disconnect. Cc: sta...@vger.kernel.org Signed-off-by: Peter Chen peter.c...@freescale.com --- drivers/usb/core/hub.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d481c99..f3d1671 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4617,8 +4617,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, /* Disconnect any existing devices under this port */ if (udev) { - if (hcd-phy !hdev-parent - !(portstatus USB_PORT_STAT_CONNECTION)) + if (hcd-phy !hdev-parent) usb_phy_notify_disconnect(hcd-phy, udev-speed); usb_disconnect(port_dev-child); } Doesn't apply :( -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2] phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly
On Mon, Nov 03, 2014 at 04:51:41PM +0530, Kishon Vijay Abraham I wrote: Hi Greg, On Tuesday 07 October 2014 04:32 PM, Oussama Ghorbel wrote: The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commit eb82a3d846fa (phy: omap-usb2: Balance pm_runtime_enable() on probe failure and remove). This because the call to pm_runtime_enable() function is moved after the call to devm_phy_create() function, which has side effect since later in the subsequent calls of devm_phy_create() there is a check with pm_runtime_enabled() to configure few things. This is the only fix for this -rc cycle in the PHY susbsystem. So can you take this directly? Or else I can prepare a pull request. Let me know. Acked-by: Kishon Vijay Abraham I kis...@ti.com I don't have this in my archives anymore, please resend so that I can apply it from an email. thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH usb v3 00/29] cleanup and fixes on resource check
On Fri, Oct 31, 2014 at 05:31:41PM +0300, Sergei Shtylyov wrote: Hello. On 10/31/2014 4:14 AM, Varka Bhadram wrote: This series removes the duplication of sanity check for platform_get_resource() return resource. It will be checked with devm_ioremap_resource() This entire series rebased on testing/fixes of [1]. [1]: http://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git changes since v1: - removed broken patches - added Ack of Alan Stern for all the ehci, ohci, and uhci changes. changes since v2: - addressed Sergei Shtylyov comments Varka Bhadram (29): host: ehci-atmel: remove duplicate check on resource host: ohci-da8xx: remove duplicate check on resource host: ehci-tegra: remove duplicate check on resource host: ehci-w90x900: remove duplicate check on resource host: ohci-at91: remove duplicate check on resource host: ohci-exynos: remove duplicate check on resource host: ohci-jz4740: remove duplicate check on resource host: ohci-octeon: remove duplicate check on resource host: ohci-platform: remove duplicate check on resource host: ohci-pxa27x: remove duplicate check on resource host: ehci-sh: remove duplicate check on resource host: ohci-spear: remove duplicate check on resource host: ehci-msm: remove duplicate check on resource host: ehci-mv: remove duplicate check on resource host: ehci-mxc: remove duplicate check on resource host: ehci-octeon: remove duplicate check on resource host: ehci-orion: remove duplicate check on resource host: ehci-platform: remove duplicate check on resource host: ehci-sead3: fix NULL pointer dereference on resource Mixing fixes and cleanups in one series is not a good idea, generally speaking. I agree. Send me the fixes first in a series, so that I can get them into this kernel release, and older ones. Then send the cleanups in a separate series based on your first one, if needed, and all should be good. thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] printk: Add and use LOGLEVEL_level defines for KERN_LEVEL equivalents
On Sun, Nov 02, 2014 at 01:42:34PM -0800, Joe Perches wrote: Use #defines instead of magic values. Signed-off-by: Joe Perches j...@perches.com Acked-by: Greg Kroah-Hartman gre...@linuxfoundation.org -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/2] usb: gadget serial: Honour termios CLOCAL on disconnect
On 11/03/2014 05:33 PM, Peter Hurley wrote: Hi Kyösti, On 11/03/2014 10:18 AM, Kyösti Mälkki wrote: There are applications where it is desirable to not hangup ttyGS* when USB disconnect is detected. USB host side of communication may power-cycle periodically or there may be the actual need to physically disconnect and reconnect USB cable temporarily. USB disconnects on serial gadget are comparable to loss of Carrier Detect of conventional UARTs. With the change, if ttyGS* has termios CLOCAL flag set, disconnect on USB does not hangup the TTY. Signed-off-by: Kyösti Mälkki kyosti.mal...@gmail.com --- drivers/usb/gadget/function/u_serial.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 491082a..dabc165 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1253,9 +1253,16 @@ void gserial_disconnect(struct gserial *gser) port-port_usb = NULL; gser-ioport = NULL; if (port-port.count 0 || port-openclose) { + struct tty_struct *tty; + wake_up_interruptible(port-drain_wait); - if (port-port.tty) - tty_hangup(port-port.tty); + tty = port-port.tty; + if (tty) { + if (tty-termios.c_cflag CLOCAL) + stop_tty(tty); + else + tty_hangup(tty); It seems you missed my earlier email: what happens if you leave out the stop_tty() call here? Hi Peter I did not miss it. My intro to the patch series says I am not familiar with tty infra, so I did not realize the question was directed to me. Also my setup with serial gadget runs kernel 3.12.6 so I cannot really tell or test if tty changes since that would make my patch invalid or unnecessary. In the previous change for gserial_disconnect(), where the tty_hangup() call was added, commit message described it fixes an endless loop on tty device read and select. Would we be back at that situation without call to stop_tty()? I ask because the tty is still restartable from userspace after you stop_tty() here. So if your goal is to prevent write() from happening, this won't work. There was no goal to prevent write() on the tty device, should there be? Or should it silently just drop any characters while in the disconnected state instead of buffering (some of) them? Thanks, KM Regards, Peter Hurley + } } spin_unlock_irqrestore(port-port_lock, flags); -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Caught up on pending USB patch queue
Hi all, I've caught up on the pending USB patch queue, so if you have sent a USB patch that I should be applying, and you didn't get an email saying it was applied, or rejected, please resend. Note, this doesn't apply to USB patches picked up by other maintainers (xhci, usb-serial, gadget, phy, musb, etc.) as those patches will come to me from those maintainers, I don't apply them directly. thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/2] ARM: shmobile: lager: enable USB3.0
On Fri, Oct 31, 2014 at 01:22:22PM +, yoshihiro shimoda wrote: Hi Simon-san, On Fri, Oct 31, 2014 at 02:06:14AM +, yoshihiro shimoda wrote: Hi Simon-san, On Wed, Oct 29, 2014 at 08:19:30PM +0900, Yoshihiro Shimoda wrote: Hi Magnus-san, (2014/10/29 15:53), Magnus Damm wrote: snip Hi Shimoda-san, Thanks for your patch. I'm fine with this patch as a first step, but I'm wondering what the reason is to prioritize USB 2.0 over USB 3.0? I investigated this reason today, and I found the reason is request_firmware(). I checked the following environments: Case 1: xHCI and EHCI and OHCI are enabled =y Case 2: xHCI and EHCI and OHCI are loadable modules =m Case 3: xHCI and EHCI and OHCI are enabled =y, and CONFIG_EXTRA_FIRMWARE is enabled The results are: - In Case 1, EHCI and OHCI are probed first because xHCI didn't find the firmware. - In Case 2 and Case 3, xHCI is probed first. Is the current order just based on device init order? In my mind the expected behavior would be to always use USB 3.0 if it happens to be available in the hardware, specified in the DTS, enabled by the kernel configuration and firmware is loadable. Or does some case exist where it is better to use USB 2.0? I suspect no. I agree with you. So I wonder if you have any plans how to make USB 3.0 enabled by default on Lager? It depends on a kernel config. I'm not sure of the shmobile_defconfig strategy. But, in my opinion, one of a solution is kernel modules (this means the Case 2.) It sounds like we should enable CONFIG_EXTRA_FIRMWARE in shmobile_defconfig. I wonder what if any fallout we can foresee occurring if we do that. According to the firmware/README.AddingFirmware, we are unable to add a new firmware image to the firmware directory now. So, if we enable CONFIG_EXTRA_FIRMWARE with the xHCI firmware, we will not build kernel because the xHCI firmware doesn't exist in the linux.git. === from firmware/README.AddingFirmware = This directory is _NOT_ for adding arbitrary new firmware images. The place to add those is the separate linux-firmware repository: git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware. git == Thanks. It seems that EXTRA_FIRMWARE is not an option from a mainline point of view after all. Is the problem in case 1 that the firmware can't be found because userspace does exist yet and thus can't be loaded from there? That's correct. If EXTRA_FIRMWARE is not set, the following error happens: xhci-hcd ee00.usb: Direct firmware load for r8a779x_usb3_v1.dlmem failed with error -2 xhci-hcd ee00.usb: can't setup: -2 xhci-hcd ee00.usb: USB bus 1 deregistered xhci-hcd: probe of ee00.usb failed with error -2 At the risk of adding noise to this discussion: It seems like case 2 with a fallback to case 3 is the way to go. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v5 1/4] usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable()
On Fri, Oct 31, 2014 at 01:20:08PM +0900, Yoshihiro Shimoda wrote: From: Kazuya Mizuguchi kazuya.mizuguchi...@renesas.com This patch fixes an issue that the NULL pointer dereference happens when we uses g_audio driver. Since the g_audio driver will call usb_ep_disable() in afunc_set_alt() before it calls usb_ep_enable(), the uep-pipe of renesas usbhs driver will be NULL. So, this patch adds a condition to avoid the oops. Signed-off-by: Kazuya Mizuguchi kazuya.mizuguchi...@renesas.com Signed-off-by: Takeshi Kihara takeshi.kihara...@renesas.com Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com Fixes: 132fcb4608 (usb: gadget: Add Audio Class 2.0 Driver) since this change is not patching the audio class driver, you can be fixing that commit. Looking at the history of that file, it seems like this was always broken since day one of this driver (commit 2f98382dc) and if that's the case, this should become: Fixes: 2f98382dc (usb: renesas_usbhs: Add Renesas USBHS Gadget) Cc: sta...@vger.kernel.org # v3.0+ Thank you very much for the point. I will fix it. Best regards, Yoshihiro Shimoda Cc: sta...@vger.kernel.org # v3.3+ --- drivers/usb/renesas_usbhs/mod_gadget.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 2d17c10..294d43c 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -602,6 +602,9 @@ static int usbhsg_ep_disable(struct usb_ep *ep) struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); + if (!pipe) + return -EINVAL; + usbhsg_pipe_disable(uep); usbhs_pipe_free(pipe); -- 1.7.9.5 -- balbi -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 0/4] usb: renesas_usbhs: fixes this driver in gadget mode (part2)
If we tested this driver as gadget, some issues below happened: - Oops happened if g_audio. - A usb enumeration may fail if we do insmod during connected the usb cable. - A transaction will not finish if g_zero. - A usb enumeration may fail after we re-connected the usb cable. This patch serias fixes them. This patch serias is based on Felipe's usb.git / testing/fixes branch. (commit id: 9f2104db129512fd2ee086c8a616d296d1afbb75) Changes from v5: - Fix Fixes: and version info for Cc: sta...@vger.kernel.org in patch 1. Changes from v4: - Add Fixes: and version info for Cc: sta...@vger.kernel.org in patch 1. Changes from v3: - Change redundant condtion in patch 1. Changes from v2: - Use USBHSG_STATUS_ instead of a new variable in patch 2. Changes from v1: - Rebase this patch serias for the latest testing/fixes branch. - Add From: in patch 1 and 2. - Add Cc: sta...@vger.kernel.org in patch 1. Yoshihiro Shimoda (4): usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable() usb: renesas_usbhs: gadget: fix the behavior of pullup usb: renesas_usbhs: fix the timing of dcp_control_transfer_done usb: renesas_usbhs: fix usbhs_pipe_clear() for DCP PIPE drivers/usb/renesas_usbhs/common.c |6 +++-- drivers/usb/renesas_usbhs/fifo.c | 34 ++-- drivers/usb/renesas_usbhs/fifo.h |1 + drivers/usb/renesas_usbhs/mod_gadget.c | 38 ++-- drivers/usb/renesas_usbhs/mod_host.c |2 +- drivers/usb/renesas_usbhs/pipe.c |8 +-- 6 files changed, 66 insertions(+), 23 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 1/4] usb: renesas_usbhs: gadget: fix NULL pointer dereference in ep_disable()
From: Kazuya Mizuguchi kazuya.mizuguchi...@renesas.com This patch fixes an issue that the NULL pointer dereference happens when we uses g_audio driver. Since the g_audio driver will call usb_ep_disable() in afunc_set_alt() before it calls usb_ep_enable(), the uep-pipe of renesas usbhs driver will be NULL. So, this patch adds a condition to avoid the oops. Signed-off-by: Kazuya Mizuguchi kazuya.mizuguchi...@renesas.com Signed-off-by: Takeshi Kihara takeshi.kihara...@renesas.com Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com Fixes: 2f98382dc (usb: renesas_usbhs: Add Renesas USBHS Gadget) Cc: sta...@vger.kernel.org # v3.0+ --- drivers/usb/renesas_usbhs/mod_gadget.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 2d17c10..294d43c 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -602,6 +602,9 @@ static int usbhsg_ep_disable(struct usb_ep *ep) struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); + if (!pipe) + return -EINVAL; + usbhsg_pipe_disable(uep); usbhs_pipe_free(pipe); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 2/4] usb: renesas_usbhs: gadget: fix the behavior of pullup
From: Takeshi Kihara takeshi.kihara...@renesas.com This patch fixes an issue that this driver always enable the D+ pullup after it detected the VBUS connection even though this usb controller can control the D+ pullup timing by software. So, this driver should enable the D+ pullup after a gadget driver called usb_gadget_connect(). Signed-off-by: Takeshi Kihara takeshi.kihara...@renesas.com Signed-off-by: Kazuya Mizuguchi kazuya.mizuguchi...@renesas.com Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com --- drivers/usb/renesas_usbhs/common.c |6 -- drivers/usb/renesas_usbhs/mod_gadget.c | 30 +- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index b3b6813..7099f17 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -126,13 +126,15 @@ void usbhs_sys_host_ctrl(struct usbhs_priv *priv, int enable) void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable) { u16 mask = DCFM | DRPD | DPRPU | HSE | USBE; - u16 val = DPRPU | HSE | USBE; + u16 val = HSE | USBE; /* * if enable * * - select Function mode -* - D+ Line Pull-up +* - D+ Line Pull-up is disabled +* When D+ Line Pull-up is enabled, +* calling usbhs_sys_function_pullup(,1) */ usbhs_bset(priv, SYSCFG, mask, enable ? val : 0); } diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index 294d43c..b27b2bc 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -56,6 +56,7 @@ struct usbhsg_gpriv { #define USBHSG_STATUS_REGISTERD(1 1) #define USBHSG_STATUS_WEDGE(1 2) #define USBHSG_STATUS_SELF_POWERED (1 3) +#define USBHSG_STATUS_SOFT_CONNECT (1 4) }; struct usbhsg_recip_handle { @@ -726,6 +727,25 @@ static struct usb_ep_ops usbhsg_ep_ops = { }; /* + * pullup control + */ +static int usbhsg_can_pullup(struct usbhs_priv *priv) +{ + struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); + + return gpriv-driver + usbhsg_status_has(gpriv, USBHSG_STATUS_SOFT_CONNECT); +} + +static void usbhsg_update_pullup(struct usbhs_priv *priv) +{ + if (usbhsg_can_pullup(priv)) + usbhs_sys_function_pullup(priv, 1); + else + usbhs_sys_function_pullup(priv, 0); +} + +/* * usb module start/end */ static int usbhsg_try_start(struct usbhs_priv *priv, u32 status) @@ -775,6 +795,7 @@ static int usbhsg_try_start(struct usbhs_priv *priv, u32 status) * - usb module */ usbhs_sys_function_ctrl(priv, 1); + usbhsg_update_pullup(priv); /* * enable irq callback @@ -881,8 +902,15 @@ static int usbhsg_pullup(struct usb_gadget *gadget, int is_on) { struct usbhsg_gpriv *gpriv = usbhsg_gadget_to_gpriv(gadget); struct usbhs_priv *priv = usbhsg_gpriv_to_priv(gpriv); + unsigned long flags; - usbhs_sys_function_pullup(priv, is_on); + usbhs_lock(priv, flags); + if (is_on) + usbhsg_status_set(gpriv, USBHSG_STATUS_SOFT_CONNECT); + else + usbhsg_status_clr(gpriv, USBHSG_STATUS_SOFT_CONNECT); + usbhsg_update_pullup(priv); + usbhs_unlock(priv, flags); return 0; } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v6 3/4] usb: renesas_usbhs: fix the timing of dcp_control_transfer_done
According to the datasheet, this driver should clear the INTSTS0.CTRT bit before this controller detects the next stage transition. Otherwise, the driver may not be able to clear the bit after the controller went to the next stage transition. After that, the driver will not be able to clear the INTSTS0.VALID, and a usb control transfer will not finish finally. If we use the testusb tool, it is easy to reproduce this issue: # testusb -a -t 10 Since the previous code handled a data stage and a status stage in the usbhsf_pio_try_push(), it may not clear the INTSTS0.CTRT at the right timing. So, this patch change the timing of usbhs_dcp_control_transfer_done() to the usbhsg_irq_ctrl_stage(). Signed-off-by: Yoshihiro Shimoda yoshihiro.shimoda...@renesas.com --- drivers/usb/renesas_usbhs/fifo.c | 16 drivers/usb/renesas_usbhs/mod_gadget.c |3 +++ 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index b0c97a3..0e07925 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c @@ -577,14 +577,6 @@ static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done) usbhs_pipe_number(pipe), pkt-length, pkt-actual, *is_done, pkt-zero); - /* -* Transmission end -*/ - if (*is_done) { - if (usbhs_pipe_is_dcp(pipe)) - usbhs_dcp_control_transfer_done(pipe); - } - usbhsf_fifo_unselect(pipe, fifo); return 0; @@ -722,14 +714,6 @@ usbhs_fifo_read_end: usbhs_pipe_number(pipe), pkt-length, pkt-actual, *is_done, pkt-zero); - /* -* Transmission end -*/ - if (*is_done) { - if (usbhs_pipe_is_dcp(pipe)) - usbhs_dcp_control_transfer_done(pipe); - } - usbhs_fifo_read_busy: usbhsf_fifo_unselect(pipe, fifo); diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c index b27b2bc..9cf07c0 100644 --- a/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/drivers/usb/renesas_usbhs/mod_gadget.c @@ -485,6 +485,9 @@ static int usbhsg_irq_ctrl_stage(struct usbhs_priv *priv, case NODATA_STATUS_STAGE: pipe-handler = usbhs_ctrl_stage_end_handler; break; + case READ_STATUS_STAGE: + case WRITE_STATUS_STAGE: + usbhs_dcp_control_transfer_done(pipe); default: return ret; } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH usb v3 00/29] cleanup and fixes on resource check
Hi greg k-h, On Tuesday 04 November 2014 05:16 AM, Greg KH wrote: On Fri, Oct 31, 2014 at 05:31:41PM +0300, Sergei Shtylyov wrote: Hello. On 10/31/2014 4:14 AM, Varka Bhadram wrote: This series removes the duplication of sanity check for platform_get_resource() return resource. It will be checked with devm_ioremap_resource() This entire series rebased on testing/fixes of [1]. [1]: http://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git changes since v1: - removed broken patches - added Ack of Alan Stern for all the ehci, ohci, and uhci changes. changes since v2: - addressed Sergei Shtylyov comments Varka Bhadram (29): host: ehci-atmel: remove duplicate check on resource host: ohci-da8xx: remove duplicate check on resource host: ehci-tegra: remove duplicate check on resource host: ehci-w90x900: remove duplicate check on resource host: ohci-at91: remove duplicate check on resource host: ohci-exynos: remove duplicate check on resource host: ohci-jz4740: remove duplicate check on resource host: ohci-octeon: remove duplicate check on resource host: ohci-platform: remove duplicate check on resource host: ohci-pxa27x: remove duplicate check on resource host: ehci-sh: remove duplicate check on resource host: ohci-spear: remove duplicate check on resource host: ehci-msm: remove duplicate check on resource host: ehci-mv: remove duplicate check on resource host: ehci-mxc: remove duplicate check on resource host: ehci-octeon: remove duplicate check on resource host: ehci-orion: remove duplicate check on resource host: ehci-platform: remove duplicate check on resource host: ehci-sead3: fix NULL pointer dereference on resource Mixing fixes and cleanups in one series is not a good idea, generally speaking. I agree. Send me the fixes first in a series, so that I can get them into this kernel release, and older ones. Then send the cleanups in a separate series based on your first one, if needed, and all should be good. I will send the fixes based on [1] usb-next branch first, then cleanup as a separate series. But balbi told that these series should go through his [2] kernel tree. Can i send this entire series based on [1] usb-next branch..? Thanks for the review. [1]:http://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/ [2]:https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/ -- Thanks and Regards, Varka Bhadram. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: dwc3: ep0: remove unnecessary break after return
Fix the following checkpatch warning. WARNING: break is not useful after a goto or return Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc3/ep0.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 711b230..1d91c93 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -441,7 +441,6 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc, case USB_DEVICE_LTM_ENABLE: return -EINVAL; - break; case USB_DEVICE_TEST_MODE: if ((wIndex 0xff) != 0) @@ -550,7 +549,6 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) switch (state) { case USB_STATE_DEFAULT: return -EINVAL; - break; case USB_STATE_ADDRESS: ret = dwc3_ep0_delegate_req(dwc, ctrl); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 0/2] fixes on resource check
From: Varka Bhadram var...@cdac.in This series fixes for NULL pointer dereference on resource. Series based on usb-next of [1] changes: Up to v3, combined series for fixes and cleanups for resource check. For v4 seperated as two series on for fixes another for cleanups. [1]: https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git Varka Bhadram (2): host: uhci-platform: fix NULL pointer dereference on resource host: ehci-sead3: fix NULL pointer dereference on resource drivers/usb/host/ehci-sead3.c|5 ++--- drivers/usb/host/uhci-platform.c |6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 1/2] host: uhci-platform: fix NULL pointer dereference on resource
From: Varka Bhadram varkabhad...@gmail.com Fix in accessing NULL if resource didn't get. Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/uhci-platform.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c index b987f1d..cf8f460 100644 --- a/drivers/usb/host/uhci-platform.c +++ b/drivers/usb/host/uhci-platform.c @@ -86,14 +86,14 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto err_rmr; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); + uhci = hcd_to_uhci(hcd); uhci-regs = hcd-regs; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 2/2] host: ehci-sead3: fix NULL pointer dereference on resource
From: Varka Bhadram varkabhad...@gmail.com Fix on accessing NULL pointer dereference on get resource failed. Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-sead3.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ehci-sead3.c b/drivers/usb/host/ehci-sead3.c index cf12676..9b6e8d0 100644 --- a/drivers/usb/host/ehci-sead3.c +++ b/drivers/usb/host/ehci-sead3.c @@ -110,14 +110,13 @@ static int ehci_hcd_sead3_drv_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto err1; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); /* Root hub has integrated TT. */ hcd-has_tt = 1; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: dwc3: exynos: remove non-DT support for Exynos Specific Glue layer
DWC3 Exynos Specific Glue layer can be used only for Exynos SoCs. In addition, non-DT for EXYNOS SoCs is not supported from v3.11; thus, there is no need to support non-DT for DWC3 Exynos Specific Glue layer. The 'linux/platform_data/dwc3-exynos.h' file has been used for non-DT support. Thus, the 'dwc3-exynos.h' file is removed, because it is not used anymore. Signed-off-by: Jingoo Han jg1@samsung.com --- drivers/usb/dwc3/Kconfig |2 +- drivers/usb/dwc3/dwc3-exynos.c|5 + include/linux/platform_data/dwc3-exynos.h | 24 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 include/linux/platform_data/dwc3-exynos.h diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index f4e5cc6..58b5b2c 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -55,7 +55,7 @@ config USB_DWC3_OMAP config USB_DWC3_EXYNOS tristate Samsung Exynos Platform - depends on ARCH_EXYNOS || COMPILE_TEST + depends on ARCH_EXYNOS OF || COMPILE_TEST default USB_DWC3 help Recent Exynos5 SoCs ship with one DesignWare Core USB3 IP inside, diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 3951a65..4369c66 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -20,7 +20,6 @@ #include linux/kernel.h #include linux/slab.h #include linux/platform_device.h -#include linux/platform_data/dwc3-exynos.h #include linux/dma-mapping.h #include linux/clk.h #include linux/usb/otg.h @@ -205,13 +204,11 @@ static int dwc3_exynos_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_OF static const struct of_device_id exynos_dwc3_match[] = { { .compatible = samsung,exynos5250-dwusb3 }, {}, }; MODULE_DEVICE_TABLE(of, exynos_dwc3_match); -#endif #ifdef CONFIG_PM_SLEEP static int dwc3_exynos_suspend(struct device *dev) @@ -266,7 +263,7 @@ static struct platform_driver dwc3_exynos_driver = { .remove = dwc3_exynos_remove, .driver = { .name = exynos-dwc3, - .of_match_table = of_match_ptr(exynos_dwc3_match), + .of_match_table = exynos_dwc3_match, .pm = DEV_PM_OPS, }, }; diff --git a/include/linux/platform_data/dwc3-exynos.h b/include/linux/platform_data/dwc3-exynos.h deleted file mode 100644 index 5eb7da9..000 --- a/include/linux/platform_data/dwc3-exynos.h +++ /dev/null @@ -1,24 +0,0 @@ -/** - * dwc3-exynos.h - Samsung EXYNOS DWC3 Specific Glue layer, header. - * - * Copyright (c) 2012 Samsung Electronics Co., Ltd. - * http://www.samsung.com - * - * Author: Anton Tikhomirov av.tikhomi...@samsung.com - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#ifndef _DWC3_EXYNOS_H_ -#define _DWC3_EXYNOS_H_ - -struct dwc3_exynos_data { - int phy_type; - int (*phy_init)(struct platform_device *pdev, int type); - int (*phy_exit)(struct platform_device *pdev, int type); -}; - -#endif /* _DWC3_EXYNOS_H_ */ -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb:host:xhci-plat: 64-bit dma addressing support
Use dma_addr_t to support 64-bit plaforms, which access beyond 32 bit address range. Signed-off-by: Bao Truong btru...@apm.com Signed-off-by: Feng Kan f...@apm.com --- drivers/usb/host/xhci-plat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 01d1862..8cf83f0 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -97,13 +97,14 @@ static int xhci_plat_probe(struct platform_device *pdev) } /* Initialize dma_mask and coherent_dma_mask to 32-bits */ - ret = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(32)); + ret = dma_set_coherent_mask(pdev-dev, + DMA_BIT_MASK(sizeof(dma_addr_t)*8)); if (ret) return ret; if (!pdev-dev.dma_mask) pdev-dev.dma_mask = pdev-dev.coherent_dma_mask; else - dma_set_mask(pdev-dev, DMA_BIT_MASK(32)); + dma_set_mask(pdev-dev, DMA_BIT_MASK(sizeof(dma_addr_t)*8)); hcd = usb_create_hcd(driver, pdev-dev, dev_name(pdev-dev)); if (!hcd) -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] usb:host:xhci-plat: 64-bit dma addressing support
On Mon, Nov 03, 2014 at 05:59:28PM -0800, Feng Kan wrote: Use dma_addr_t to support 64-bit plaforms, which access beyond 32 bit address range. Signed-off-by: Bao Truong btru...@apm.com Signed-off-by: Feng Kan f...@apm.com --- drivers/usb/host/xhci-plat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 01d1862..8cf83f0 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -97,13 +97,14 @@ static int xhci_plat_probe(struct platform_device *pdev) } /* Initialize dma_mask and coherent_dma_mask to 32-bits */ - ret = dma_set_coherent_mask(pdev-dev, DMA_BIT_MASK(32)); + ret = dma_set_coherent_mask(pdev-dev, + DMA_BIT_MASK(sizeof(dma_addr_t)*8)); Is the comment still correct now? -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 01/27] host: ehci-atmel: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-atmel.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index ec9f7b7..56a8850 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -107,22 +107,15 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev) } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pdev-dev, - Found HC with no register addr. Check %s setup!\n, - dev_name(pdev-dev)); - retval = -ENODEV; - goto fail_request_resource; - } - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { retval = PTR_ERR(hcd-regs); goto fail_request_resource; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); + iclk = devm_clk_get(pdev-dev, ehci_clk); if (IS_ERR(iclk)) { dev_err(pdev-dev, Error getting interface clock\n); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 22/27] musb: musb_dsps: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in --- drivers/usb/musb/musb_dsps.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 48bc09e..965c552 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -447,9 +447,6 @@ static int dsps_musb_init(struct musb *musb) int ret; r = platform_get_resource_byname(parent, IORESOURCE_MEM, control); - if (!r) - return -EINVAL; - reg_base = devm_ioremap_resource(dev, r); if (IS_ERR(reg_base)) return PTR_ERR(reg_base); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 24/27] dwc3: dwc3-keystone: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in --- drivers/usb/dwc3/dwc3-keystone.c |5 - 1 file changed, 5 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c index 7ec8495..dd8d2df 100644 --- a/drivers/usb/dwc3/dwc3-keystone.c +++ b/drivers/usb/dwc3/dwc3-keystone.c @@ -104,11 +104,6 @@ static int kdwc3_probe(struct platform_device *pdev) kdwc-dev = dev; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(dev, missing usbss resource\n); - return -EINVAL; - } - kdwc-usbss = devm_ioremap_resource(dev, res); if (IS_ERR(kdwc-usbss)) return PTR_ERR(kdwc-usbss); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 04/27] host: ehci-w90x900: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-w90x900.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c index a9303af..4717bf2 100644 --- a/drivers/usb/host/ehci-w90x900.c +++ b/drivers/usb/host/ehci-w90x900.c @@ -42,27 +42,20 @@ static int usb_w90x900_probe(const struct hc_driver *driver, int retval = 0, irq; unsigned long val; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - retval = -ENXIO; - goto err1; - } - hcd = usb_create_hcd(driver, pdev-dev, w90x900 EHCI); if (!hcd) { retval = -ENOMEM; goto err1; } - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { retval = PTR_ERR(hcd-regs); goto err2; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); ehci = hcd_to_ehci(hcd); ehci-caps = hcd-regs; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 21/27] musb: musb_core: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in --- drivers/usb/musb/musb_core.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index b841ee0..55ebd4b 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2080,10 +2080,10 @@ static int musb_probe(struct platform_device *pdev) struct resource *iomem; void __iomem*base; - iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!iomem || irq = 0) + if (irq = 0) return -ENODEV; + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_ioremap_resource(dev, iomem); if (IS_ERR(base)) return PTR_ERR(base); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 05/27] host: ohci-at91: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-at91.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 6181549..3940660 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -133,12 +133,6 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, struct resource *res; int irq; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_dbg(dev, hcd probe: missing memory resource\n); - return -ENXIO; - } - irq = platform_get_irq(pdev, 0); if (irq 0) { dev_dbg(dev, hcd probe: missing irq resource\n); @@ -148,14 +142,15 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, hcd = usb_create_hcd(driver, dev, at91); if (!hcd) return -ENOMEM; - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd-regs = devm_ioremap_resource(dev, res); if (IS_ERR(hcd-regs)) { retval = PTR_ERR(hcd-regs); goto err; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); iclk = devm_clk_get(dev, ohci_clk); if (IS_ERR(iclk)) { -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 07/27] host: ohci-jz4740: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-jz4740.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/ohci-jz4740.c b/drivers/usb/host/ohci-jz4740.c index c2c221a..8ddd8f5 100644 --- a/drivers/usb/host/ohci-jz4740.c +++ b/drivers/usb/host/ohci-jz4740.c @@ -153,13 +153,6 @@ static int jz4740_ohci_probe(struct platform_device *pdev) struct resource *res; int irq; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - - if (!res) { - dev_err(pdev-dev, Failed to get platform resource\n); - return -ENOENT; - } - irq = platform_get_irq(pdev, 0); if (irq 0) { dev_err(pdev-dev, Failed to get platform irq\n); @@ -174,14 +167,14 @@ static int jz4740_ohci_probe(struct platform_device *pdev) jz4740_ohci = hcd_to_jz4740_hcd(hcd); - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto err_free; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); jz4740_ohci-clk = devm_clk_get(pdev-dev, uhc); if (IS_ERR(jz4740_ohci-clk)) { -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 12/27] host: ohci-spear: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-spear.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 8d58766..4a54f9d 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -74,20 +74,15 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - retval = -ENODEV; - goto err_put_hcd; - } - - hcd-rsrc_start = pdev-resource[0].start; - hcd-rsrc_len = resource_size(res); - hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { retval = PTR_ERR(hcd-regs); goto err_put_hcd; } + hcd-rsrc_start = pdev-resource[0].start; + hcd-rsrc_len = resource_size(res); + sohci_p = to_spear_ohci(hcd); sohci_p-clk = usbh_clk; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 19/27] host: ehci-spear: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-spear.c |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index 1355ff0..34e1474 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c @@ -99,18 +99,13 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - retval = -ENODEV; - goto err_put_hcd; - } - - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { retval = PTR_ERR(hcd-regs); goto err_put_hcd; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); sehci = to_spear_ehci(hcd); sehci-clk = usbh_clk; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 23/27] phy: phy-rcar-usb: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in --- drivers/usb/phy/phy-rcar-usb.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-rcar-usb.c b/drivers/usb/phy/phy-rcar-usb.c index 33265a5..e9f3a93 100644 --- a/drivers/usb/phy/phy-rcar-usb.c +++ b/drivers/usb/phy/phy-rcar-usb.c @@ -195,11 +195,9 @@ static int rcar_usb_phy_probe(struct platform_device *pdev) return PTR_ERR(reg0); res1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); - if (res1) { - reg1 = devm_ioremap_resource(dev, res1); - if (IS_ERR(reg1)) - return PTR_ERR(reg1); - } + reg1 = devm_ioremap_resource(dev, res1); + if (IS_ERR(reg1)) + return PTR_ERR(reg1); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) { -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 20/27] host: xhci-plat: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu Acked-by: Felipe Balbi ba...@ti.com Reviewed-by: Gregory CLEMENT gregory.clem...@free-electrons.com --- drivers/usb/host/xhci-plat.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 3d78b0c..e68b4ec 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -83,9 +83,6 @@ static int xhci_plat_probe(struct platform_device *pdev) if (irq 0) return -ENODEV; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; if (of_device_is_compatible(pdev-dev.of_node, marvell,armada-375-xhci) || @@ -109,15 +106,16 @@ static int xhci_plat_probe(struct platform_device *pdev) if (!hcd) return -ENOMEM; - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto put_hcd; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); + /* * Not all platforms have a clk so it is not an error if the * clock does not exists. -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 10/27] host: ohci-pxa27x: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-pxa27x.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index e68f3d0..1339981 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -447,20 +447,13 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device return -ENOMEM; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!r) { - pr_err(no resource of IORESOURCE_MEM); - retval = -ENXIO; - goto err; - } - - hcd-rsrc_start = r-start; - hcd-rsrc_len = resource_size(r); - hcd-regs = devm_ioremap_resource(pdev-dev, r); if (IS_ERR(hcd-regs)) { retval = PTR_ERR(hcd-regs); goto err; } + hcd-rsrc_start = r-start; + hcd-rsrc_len = resource_size(r); /* initialize struct pxa27x_ohci */ pxa_ohci = to_pxa27x_ohci(hcd); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 27/27] renesas_usbhs: common: remove duplicate check on resource
From: Varka Bhadram var...@cdac.in Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in --- drivers/usb/renesas_usbhs/common.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 6dae115..169307b 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -496,9 +496,8 @@ static int usbhs_probe(struct platform_device *pdev) } /* platform data */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!res || !irq_res) { + if (!irq_res) { dev_err(pdev-dev, Not enough Renesas USB platform resources.\n); return -ENODEV; } @@ -508,6 +507,7 @@ static int usbhs_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv-base = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(priv-base)) return PTR_ERR(priv-base); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 06/27] host: ohci-exynos: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-exynos.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 39f366b..035a8a8 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -155,19 +155,13 @@ skip_phy: goto fail_clk; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pdev-dev, Failed to get I/O memory\n); - err = -ENXIO; - goto fail_io; - } - - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { err = PTR_ERR(hcd-regs); goto fail_io; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); irq = platform_get_irq(pdev, 0); if (!irq) { -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 25/27] host: ehci-fsl: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-fsl.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c index 2d2ae8d..fb7bd0c 100644 --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -93,21 +93,15 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver, } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pdev-dev, - Found HC with no register addr. Check %s setup!\n, - dev_name(pdev-dev)); - retval = -ENODEV; - goto err2; - } - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { retval = PTR_ERR(hcd-regs); goto err2; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); + pdata-regs = hcd-regs; if (pdata-power_budget) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 08/27] host: ohci-octeon: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-octeon.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/ohci-octeon.c b/drivers/usb/host/ohci-octeon.c index 15af895..20d861b 100644 --- a/drivers/usb/host/ohci-octeon.c +++ b/drivers/usb/host/ohci-octeon.c @@ -120,12 +120,6 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev) return -ENODEV; } - res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res_mem == NULL) { - dev_err(pdev-dev, No register space assigned\n); - return -ENODEV; - } - /* Ohci is a 32-bit device. */ ret = dma_coerce_mask_and_coherent(pdev-dev, DMA_BIT_MASK(32)); if (ret) @@ -135,14 +129,14 @@ static int ohci_octeon_drv_probe(struct platform_device *pdev) if (!hcd) return -ENOMEM; - hcd-rsrc_start = res_mem-start; - hcd-rsrc_len = resource_size(res_mem); - + res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); reg_base = devm_ioremap_resource(pdev-dev, res_mem); if (IS_ERR(reg_base)) { ret = PTR_ERR(reg_base); goto err1; } + hcd-rsrc_start = res_mem-start; + hcd-rsrc_len = resource_size(res_mem); ohci_octeon_hw_start(); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 14/27] host: ehci-mv: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-mv.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index b1855c1..849806a 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -169,12 +169,6 @@ static int mv_ehci_probe(struct platform_device *pdev) } r = platform_get_resource_byname(pdev, IORESOURCE_MEM, phyregs); - if (r == NULL) { - dev_err(pdev-dev, no phy I/O memory resource defined\n); - retval = -ENODEV; - goto err_put_hcd; - } - ehci_mv-phy_regs = devm_ioremap_resource(pdev-dev, r); if (IS_ERR(ehci_mv-phy_regs)) { retval = PTR_ERR(ehci_mv-phy_regs); @@ -182,12 +176,6 @@ static int mv_ehci_probe(struct platform_device *pdev) } r = platform_get_resource_byname(pdev, IORESOURCE_MEM, capregs); - if (!r) { - dev_err(pdev-dev, no I/O memory resource defined\n); - retval = -ENODEV; - goto err_put_hcd; - } - ehci_mv-cap_regs = devm_ioremap_resource(pdev-dev, r); if (IS_ERR(ehci_mv-cap_regs)) { retval = PTR_ERR(ehci_mv-cap_regs); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 17/27] host: ehci-orion: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu Reviewed-by: Gregory CLEMENT gregory.clem...@free-electrons.com --- drivers/usb/host/ehci-orion.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c index 22e15ca..36b4657 100644 --- a/drivers/usb/host/ehci-orion.c +++ b/drivers/usb/host/ehci-orion.c @@ -175,15 +175,6 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) goto err; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pdev-dev, - Found HC with no register addr. Check %s setup!\n, - dev_name(pdev-dev)); - err = -ENODEV; - goto err; - } - /* * Right now device-tree probed devices don't get dma_mask * set. Since shared usb code relies on it, set it here for @@ -193,6 +184,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev) if (err) goto err; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(regs)) { err = PTR_ERR(regs); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 00/27] cleanup on resource check
From: Varka Bhadram var...@cdac.in This series removes the duplication of sanity check for platform_get_resource() return resource. It will be checked with devm_ioremap_resource(). This entire series rebased on usb-next of [1]. changes since v1: - removed broken patches - added Ack of Alan Stern for all the ehci, ohci, and uhci changes. changes since v2: - addressed Sergei Shtylyov comments changes since v3: - separated as two serieses, one for fixes another for cleanup - added Acked-by of Felipe balbi - added Reviewed-by of Gregory CLEMENT [1]: https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git Varka Bhadram (27): host: ehci-atmel: remove duplicate check on resource host: ohci-da8xx: remove duplicate check on resource host: ehci-tegra: remove duplicate check on resource host: ehci-w90x900: remove duplicate check on resource host: ohci-at91: remove duplicate check on resource host: ohci-exynos: remove duplicate check on resource host: ohci-jz4740: remove duplicate check on resource host: ohci-octeon: remove duplicate check on resource host: ohci-platform: remove duplicate check on resource host: ohci-pxa27x: remove duplicate check on resource host: ehci-sh: remove duplicate check on resource host: ohci-spear: remove duplicate check on resource host: ehci-msm: remove duplicate check on resource host: ehci-mv: remove duplicate check on resource host: ehci-mxc: remove duplicate check on resource host: ehci-octeon: remove duplicate check on resource host: ehci-orion: remove duplicate check on resource host: ehci-platform: remove duplicate check on resource host: ehci-spear: remove duplicate check on resource host: xhci-plat: remove duplicate check on resource musb: musb_core: remove duplicate check on resource musb: musb_dsps: remove duplicate check on resource phy: phy-rcar-usb: remove duplicate check on resource dwc3: dwc3-keystone: remove duplicate check on resource host: ehci-fsl: remove duplicate check on resource host: ehci-exynos: remove duplicate check on resource renesas_usbhs: common: remove duplicate check on resource drivers/usb/dwc3/dwc3-keystone.c |5 - drivers/usb/host/ehci-atmel.c | 13 +++-- drivers/usb/host/ehci-exynos.c | 11 +++ drivers/usb/host/ehci-fsl.c| 12 +++- drivers/usb/host/ehci-msm.c| 10 ++ drivers/usb/host/ehci-mv.c | 12 drivers/usb/host/ehci-mxc.c| 11 ++- drivers/usb/host/ehci-octeon.c | 12 +++- drivers/usb/host/ehci-orion.c | 10 +- drivers/usb/host/ehci-platform.c | 12 drivers/usb/host/ehci-sh.c | 15 +++ drivers/usb/host/ehci-spear.c |9 ++--- drivers/usb/host/ehci-tegra.c | 10 +++--- drivers/usb/host/ehci-w90x900.c| 13 +++-- drivers/usb/host/ohci-at91.c | 11 +++ drivers/usb/host/ohci-da8xx.c |7 ++- drivers/usb/host/ohci-exynos.c | 10 ++ drivers/usb/host/ohci-jz4740.c | 13 +++-- drivers/usb/host/ohci-octeon.c | 12 +++- drivers/usb/host/ohci-platform.c | 13 - drivers/usb/host/ohci-pxa27x.c | 11 ++- drivers/usb/host/ohci-spear.c | 11 +++ drivers/usb/host/xhci-plat.c | 10 -- drivers/usb/musb/musb_core.c |4 ++-- drivers/usb/musb/musb_dsps.c |3 --- drivers/usb/phy/phy-rcar-usb.c |8 +++- drivers/usb/renesas_usbhs/common.c |4 ++-- 27 files changed, 65 insertions(+), 207 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 03/27] host: ehci-tegra: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-tegra.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 3e6f685..19a9af1 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -460,18 +460,14 @@ static int tegra_ehci_probe(struct platform_device *pdev) nvidia,needs-double-reset); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pdev-dev, Failed to get I/O memory\n); - err = -ENXIO; - goto cleanup_clk_en; - } - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { err = PTR_ERR(hcd-regs); goto cleanup_clk_en; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); + ehci-caps = hcd-regs + 0x100; ehci-has_hostpc = soc_config-has_hostpc; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 15/27] host: ehci-mxc: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-mxc.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index dbe5e4e..c7a9b31 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c @@ -69,20 +69,13 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(dev, Found HC with no register addr. Check setup!\n); - ret = -ENODEV; - goto err_alloc; - } - - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); - hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto err_alloc; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); hcd-has_tt = 1; ehci = hcd_to_ehci(hcd); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 16/27] host: ehci-octeon: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-octeon.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/ehci-octeon.c b/drivers/usb/host/ehci-octeon.c index 9051439..2d0c4bc 100644 --- a/drivers/usb/host/ehci-octeon.c +++ b/drivers/usb/host/ehci-octeon.c @@ -106,12 +106,6 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev) return -ENODEV; } - res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res_mem == NULL) { - dev_err(pdev-dev, No register space assigned\n); - return -ENODEV; - } - /* * We can DMA from anywhere. But the descriptors must be in * the lower 4GB. @@ -125,14 +119,14 @@ static int ehci_octeon_drv_probe(struct platform_device *pdev) if (!hcd) return -ENOMEM; - hcd-rsrc_start = res_mem-start; - hcd-rsrc_len = resource_size(res_mem); - + res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); hcd-regs = devm_ioremap_resource(pdev-dev, res_mem); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto err1; } + hcd-rsrc_start = res_mem-start; + hcd-rsrc_len = resource_size(res_mem); ehci_octeon_start(); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 18/27] host: ehci-platform: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-platform.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index da056fe..35a9aed 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -164,11 +164,6 @@ static int ehci_platform_probe(struct platform_device *dev) dev_err(dev-dev, no irq provided); return irq; } - res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0); - if (!res_mem) { - dev_err(dev-dev, no memory resource provided); - return -ENXIO; - } hcd = usb_create_hcd(ehci_platform_hc_driver, dev-dev, dev_name(dev-dev)); @@ -250,14 +245,15 @@ static int ehci_platform_probe(struct platform_device *dev) goto err_reset; } - hcd-rsrc_start = res_mem-start; - hcd-rsrc_len = resource_size(res_mem); - + res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0); hcd-regs = devm_ioremap_resource(dev-dev, res_mem); if (IS_ERR(hcd-regs)) { err = PTR_ERR(hcd-regs); goto err_power; } + hcd-rsrc_start = res_mem-start; + hcd-rsrc_len = resource_size(res_mem); + err = usb_add_hcd(hcd, irq, IRQF_SHARED); if (err) goto err_power; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/1] x86: Surface Pro 3 Type Cover 3
Surface Pro 3 Type Cover that works with Ubuntu (and possibly Arch) from this thread. Both trackpad and keyboard work after compiling my own kernel. http://ubuntuforums.org/showthread.php?t=2231207page=2s=44910e0c56047e4f93dfd9fea58121ef Also includes Jarrad Whitaker's message which sources http://winaero.com/blog/how-to-install-linux-on-surface-pro-3/ which he says is sourced from a Russian site Signed-off-by: Alan Wu alan.c...@gmail.com --- drivers/hid/hid-core.c | 6 ++ drivers/hid/hid-ids.h | 1 + drivers/hid/hid-microsoft.c | 2 ++ drivers/hid/usbhid/hid-quirks.c | 1 + 4 files changed, 10 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 73bd9e2..e94afcc 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -702,6 +702,11 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type) if (((parser-global.usage_page 16) == HID_UP_SENSOR) type == HID_COLLECTION_PHYSICAL) hid-group = HID_GROUP_SENSOR_HUB; + + if (hid-vendor == USB_VENDOR_ID_MICROSOFT + hid-product == USB_DEVICE_ID_MS_TYPE_COVER_3 + hid-group == HID_GROUP_MULTITOUCH) + hid-group = HID_GROUP_GENERIC; } static int hid_scan_main(struct hid_parser *parser, struct hid_item *item) @@ -1861,6 +1866,7 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K) }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_OFFICE_KB) }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3) }, { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, { HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) }, { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) }, diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index e23ab8b..15f32c2 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -648,6 +648,7 @@ #define USB_DEVICE_ID_MS_SURFACE_PRO_2 0x0799 #define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7 #define USB_DEVICE_ID_MS_TYPE_COVER_20x07a9 +#define USB_DEVICE_ID_MS_TYPE_COVER_30x07dc #define USB_VENDOR_ID_MOJO 0x8282 #define USB_DEVICE_ID_RETRO_ADAPTER0x3201 diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c index 8ba17a9..cacda43 100644 --- a/drivers/hid/hid-microsoft.c +++ b/drivers/hid/hid-microsoft.c @@ -274,6 +274,8 @@ static const struct hid_device_id ms_devices[] = { .driver_data = MS_NOGET }, { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500), .driver_data = MS_DUPLICATE_USAGES }, + { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3), + .driver_data = MS_HIDINPUT }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT), .driver_data = MS_PRESENTER }, diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 5014bb5..cebfaf2 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c @@ -77,6 +77,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, + { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_NEXIO, USB_DEVICE_ID_NEXIO_MULTITOUCH_PTI0750, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS }, -- 2.1.0 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 02/27] host: ohci-da8xx: remove duplicate check on resource
From: Varka Bhadram var...@cdac.in Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ohci-da8xx.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index df06be6..1c76999 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -313,16 +313,13 @@ static int usb_hcd_da8xx_probe(const struct hc_driver *driver, return -ENOMEM; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem) - return -ENODEV; - hcd-rsrc_start = mem-start; - hcd-rsrc_len = resource_size(mem); - hcd-regs = devm_ioremap_resource(pdev-dev, mem); if (IS_ERR(hcd-regs)) { error = PTR_ERR(hcd-regs); goto err; } + hcd-rsrc_start = mem-start; + hcd-rsrc_len = resource_size(mem); ohci_hcd_init(hcd_to_ohci(hcd)); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH usb v4 13/27] host: ehci-msm: remove duplicate check on resource
From: Varka Bhadram varkabhad...@gmail.com Sanity check on resource happening with devm_ioremap_resource(). Signed-off-by: Varka Bhadram var...@cdac.in Acked-by: Alan Stern st...@rowland.harvard.edu --- drivers/usb/host/ehci-msm.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c index 9dc2118..9db74ca 100644 --- a/drivers/usb/host/ehci-msm.c +++ b/drivers/usb/host/ehci-msm.c @@ -88,19 +88,13 @@ static int ehci_msm_probe(struct platform_device *pdev) } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pdev-dev, Unable to get memory resource\n); - ret = -ENODEV; - goto put_hcd; - } - - hcd-rsrc_start = res-start; - hcd-rsrc_len = resource_size(res); hcd-regs = devm_ioremap_resource(pdev-dev, res); if (IS_ERR(hcd-regs)) { ret = PTR_ERR(hcd-regs); goto put_hcd; } + hcd-rsrc_start = res-start; + hcd-rsrc_len = resource_size(res); /* * OTG driver takes care of PHY initialization, clock management, -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/1] usb: core: notify disconnection when core detects disconnect
On Tue, Nov 04, 2014 at 10:46:11AM +0800, Peter Chen wrote: It is safe to call notify disconnect when the usb core thinks the device is disconnected. This commit also fixes one bug found at below situation: we have not enabled usb wakeup, we do system suspend when there is an usb device at the port, after suspend, we plug out the usb device, then plug in device again. At that time, the nofity disconnect was not called at current code, as the controller doesn't know the usb device was disconnected during the suspend, but USB core knows the port has changed during that periods. So to fix this problem, and let the usb core call notify disconnect. Cc: 3.17+ sta...@vger.kernel.org Signed-off-by: Peter Chen peter.c...@freescale.com --- Changes for v2: - Rebase on the newest usb-linus, and change hcd-phy to hcd-usb_phy. drivers/usb/core/hub.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 65a8e50..00912a5 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4624,9 +4624,8 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, /* Disconnect any existing devices under this port */ if (udev) { - if (hcd-usb_phy !hdev-parent - !(portstatus USB_PORT_STAT_CONNECTION)) - usb_phy_notify_disconnect(hcd-usb_phy, udev-speed); + if (hcd-phy !hdev-parent) Why is this now hcd-phy and not hcd-usb_phy? Did you test this? And why does it need to go to stable? Who has reported problems with this? thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH usb v3 00/29] cleanup and fixes on resource check
On Tuesday 04 November 2014 06:46 AM, Varka Bhadram wrote: Hi greg k-h, On Tuesday 04 November 2014 05:16 AM, Greg KH wrote: On Fri, Oct 31, 2014 at 05:31:41PM +0300, Sergei Shtylyov wrote: Hello. On 10/31/2014 4:14 AM, Varka Bhadram wrote: This series removes the duplication of sanity check for platform_get_resource() return resource. It will be checked with devm_ioremap_resource() This entire series rebased on testing/fixes of [1]. [1]: http://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git changes since v1: - removed broken patches - added Ack of Alan Stern for all the ehci, ohci, and uhci changes. changes since v2: - addressed Sergei Shtylyov comments Varka Bhadram (29): host: ehci-atmel: remove duplicate check on resource host: ohci-da8xx: remove duplicate check on resource host: ehci-tegra: remove duplicate check on resource host: ehci-w90x900: remove duplicate check on resource host: ohci-at91: remove duplicate check on resource host: ohci-exynos: remove duplicate check on resource host: ohci-jz4740: remove duplicate check on resource host: ohci-octeon: remove duplicate check on resource host: ohci-platform: remove duplicate check on resource host: ohci-pxa27x: remove duplicate check on resource host: ehci-sh: remove duplicate check on resource host: ohci-spear: remove duplicate check on resource host: ehci-msm: remove duplicate check on resource host: ehci-mv: remove duplicate check on resource host: ehci-mxc: remove duplicate check on resource host: ehci-octeon: remove duplicate check on resource host: ehci-orion: remove duplicate check on resource host: ehci-platform: remove duplicate check on resource host: ehci-sead3: fix NULL pointer dereference on resource Mixing fixes and cleanups in one series is not a good idea, generally speaking. I agree. Send me the fixes first in a series, so that I can get them into this kernel release, and older ones. Then send the cleanups in a separate series based on your first one, if needed, and all should be good. I will send the fixes based on [1] usb-next branch first, then cleanup as a separate series. But balbi told that these series should go through his [2] kernel tree. Can i send this entire series based on [1] usb-next branch..? Thanks for the review. [1]:http://git.kernel.org/cgit/linux/kernel/git/balbi/usb.git/ [2]:https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/ I divided the entire series into two series's, one for fixes and another for cleanup with version4. I rebased the series on usb-next branch of [1] and send it. Please review it. [1]:https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/ -- Thanks and Regards, Varka Bhadram. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Fix Penguin Penalty 17th October2014 ( mail-archive.com )
Dear Sir Did your website get hit by Google Penguin update on October 17th 2014? What basically is Google Penguin Update? It is actually a code name for Google algorithm which aims at decreasing your websites search engine rankings that violate Googles guidelines by using black hat SEO techniques to rank your webpage by giving number of spammy links to the page. We are one of those few SEO companies that can help you avoid penalties from Google Updates like Penguin and Panda. Our clients have survived all the previous and present updates with ease. They have never been hit because we use 100% white hat SEO techniques to rank Webpages. Simple thing that we do to keep websites away from any Penguin or Panda penalties is follow Google guidelines and we give Google users the best answers to their queries. If you are looking to increase the quality of your websites and to get more targeted traffic or save your websites from these Google penalties email us back with your interest. We will be glad to serve you and help you grow your business. Regards Vince G SEO Manager ( TOB ) B7 Green Avenue, Amritsar 143001 Punjab NO CLICK in the subject to STOP EMAILS -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
asix: Don't reset PHY on if_up for ASIX 88772 breaks net on arndale platform
Hi, With 3.18-rc3, asix on arndale (samsung exynos 5250 based board), fails to work. Interface is initialized but network traffic seem not to pass through. With kernel IP config the result looks like: [3.323275] usb 3-3.2.4: new high-speed USB device number 4 using exynos-ehci [3.419151] usb 3-3.2.4: New USB device found, idVendor=0b95, idProduct=772a [3.424735] usb 3-3.2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [3.432196] usb 3-3.2.4: Product: AX88772 [3.436279] usb 3-3.2.4: Manufacturer: ASIX Elec. Corp. [3.441486] usb 3-3.2.4: SerialNumber: 01 [3.447530] asix 3-3.2.4:1.0 (unnamed net_device) (uninitialized): invalid hw address, using random [3.764352] asix 3-3.2.4:1.0 eth0: register 'asix' at usb-1211.usb-3.2.4, ASIX AX88772 USB 2.0 Ethernet, de:a2:66:bf:ca:4f [4.488773] asix 3-3.2.4:1.0 eth0: link down [5.690025] asix 3-3.2.4:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1 [5.712947] Sending DHCP requests .. timed out! [ 83.165303] IP-Config: Retrying forever (NFS root)... [ 83.170397] asix 3-3.2.4:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1 [ 83.192944] Sending DHCP requests . Similar results also with dhclient. Git bisect identified the breaking commit as: commit 3cc81d85ee01e5a0b7ea2f4190e2ed1165f53c31 Author: Michel Stam m.s...@fugro.nl Date: Thu Oct 2 10:22:02 2014 +0200 asix: Don't reset PHY on if_up for ASIX 88772 Taking 3.18-rc3 and that commit reverted, network works again: [3.303500] usb 3-3.2.4: new high-speed USB device number 4 using exynos-ehci [3.399375] usb 3-3.2.4: New USB device found, idVendor=0b95, idProduct=772a [3.404963] usb 3-3.2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [3.412424] usb 3-3.2.4: Product: AX88772 [3.416508] usb 3-3.2.4: Manufacturer: ASIX Elec. Corp. [3.421715] usb 3-3.2.4: SerialNumber: 01 [3.427755] asix 3-3.2.4:1.0 (unnamed net_device) (uninitialized): invalid hw address, using random [3.744837] asix 3-3.2.4:1.0 eth0: register 'asix' at usb-1211.usb-3.2.4, ASIX AX88772 USB 2.0 Ethernet, 12:59:f1:a8:43:90 [7.098998] asix 3-3.2.4:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1 [7.118258] Sending DHCP requests ., OK [9.753259] IP-Config: Got DHCP answer from 192.168.1.1, my address is 192.168.1.111 There might something wrong on the samsung platform code (I understand the USB on arndale is funny), but this is still an regression from 3.17. Riku -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] usb: xhci: This reworks ff8cbf250b448aac35589f6075082c3fcad8a8fe
On 10/31/2014 10:28 PM, Alan Stern wrote: On Fri, 31 Oct 2014, Lu Baolu wrote: xhci: clear root port wake on bits if controller isn't wake-up capable When xHCI PCI host is suspended, if do_wakeup is false in xhci_pci_suspend, xhci_pci_suspend needs to clear all root port wake on bits. Otherwise some Intel platforms may get a spurious wakeup, even if PCI PME# is disabled. Signed-off-by: Lu Baolu baolu...@linux.intel.com --- drivers/usb/host/xhci-pci.c | 42 ++ drivers/usb/host/xhci.h | 6 ++ 2 files changed, 48 insertions(+) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 280dde9..3e7441a 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -27,6 +27,8 @@ #include xhci.h #include xhci-trace.h +#define PORT_WAKE_BITS (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E) + /* Device for a quirk */ #define PCI_VENDOR_ID_FRESCO_LOGIC0x1b73 #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK0x1000 @@ -126,6 +128,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) */ xhci-quirks |= XHCI_SPURIOUS_REBOOT; xhci-quirks |= XHCI_AVOID_BEI; + xhci-quirks |= XHCI_DISABLE_PORT_WOB; } if (pdev-vendor == PCI_VENDOR_ID_INTEL (pdev-device == PCI_DEVICE_ID_INTEL_LYNXPOINT_XHCI || @@ -279,6 +282,42 @@ static void xhci_pci_remove(struct pci_dev *dev) } #ifdef CONFIG_PM +static void xhci_disable_port_wake_bits(struct xhci_hcd *xhci) +{ + int port_index; + __le32 __iomem **port_array; + unsigned long flags; + u32 t1, t2; + + spin_lock_irqsave(xhci-lock, flags); + + /* disble usb3 ports Wake bits*/ + port_index = xhci-num_usb3_ports; + port_array = xhci-usb3_ports; + while (port_index--) { + t1 = readl(port_array[port_index]); + t2 = xhci_port_state_to_neutral(t1); + t2 = ~PORT_WAKE_BITS; + t1 = xhci_port_state_to_neutral(t1); + if (t1 != t2) + writel(t2, port_array[port_index]); + } + + /* disble usb2 ports Wake bits*/ + port_index = xhci-num_usb2_ports; + port_array = xhci-usb2_ports; + while (port_index--) { + t1 = readl(port_array[port_index]); + t2 = xhci_port_state_to_neutral(t1); + t2 = ~PORT_WAKE_BITS; + t1 = xhci_port_state_to_neutral(t1); + if (t1 != t2) + writel(t2, port_array[port_index]); + } + + spin_unlock_irqrestore(xhci-lock, flags); +} + static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) { struct xhci_hcd *xhci = hcd_to_xhci(hcd); @@ -291,6 +330,9 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) if (xhci-quirks XHCI_COMP_MODE_QUIRK) pdev-no_d3cold = true; + if (xhci-quirks XHCI_DISABLE_PORT_WOB !do_wakeup) + xhci_disable_port_wake_bits(xhci); + return xhci_suspend(xhci); } There are two things wrong here. First, this should not be a quirk. The Wake-On bits should be disabled whenever they aren't needed, on every controller. Second, this code (or something like it) belongs in xhci.c or xhci-hub.c, not xhci-pci.c. This is because it should apply to all xHCI controllers, not just the PCI-based ones. Hi Alan, I agree with you. I will resubmit my patches. BR, baolu (In fact, instead of disabling the Wake-On bits when the controller is suspended and do_wakeup is 0, it probably would be better to leave them disabled normally and then _enable_ them if do_wakeup is 1.) Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Large disk drives
On Mon, 2014-11-03 at 16:06 -0500, Dale R. Worley wrote: Was there any resolution as to how large disk drives would be handled if their interface did not support the capacity request that would tell how large they were? Realistically no ... unless someone comes up with a reliable heuristic to give us the size. Or as an alternative, is there any way to avoid buying USB-SCSI interfaces that do not support the large-capacity request? Unfortunately, such devices work OK with Windows (since Windows trusts what the partition table says), you can't just say to the salesperson It has to work on drives over 3 TB. This is a stopgap: your 3TB drive can be guessed as the 16 bit capacity plus 2TB, but the same won't happen for a 5TB device. Believing the partition table gives us a chicken and egg problem because something still has to get the partition table on to the device. I don't think don't buy something that doesn't work is a hugely unreasonable response to this. James Dale -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html