RE: [PATCH 3/3] usb: chipidea: use hrtimer for otg fsm timers
Why you use unsigned, but not unsigned int or unsigned long? unsigned is equal to unsigned int, currently only 13 timers are defined, so unsigned is okay, for possible future extension, I will change it to be unsigned long Since I see you use unsigned long below, I have this question, it is ok you do not change it. @@ -579,8 +579,15 @@ int ci_otg_fsm_work(struct ci_hdrc *ci) * a_idle to a_wait_vrise when power up */ if ((ci-fsm.id) || (ci-id_event) || - (ci-fsm.power_up)) + (ci-fsm.power_up)) { ci_otg_queue_work(ci); + } else { + /* Enable data pulse irq */ + hw_write(ci, OP_PORTSC, PORTSC_W1C_BITS | + PORTSC_PP, 0); + hw_write_otgsc(ci, OTGSC_DPIS, OTGSC_DPIS); + hw_write_otgsc(ci, OTGSC_DPIE, OTGSC_DPIE); + } Can we enable data pulse enable at initialization routine? This irq should be enabled only for A-device when there is no session (host role, no vbus, so in A_IDLE state), and disable it after receive its irq(SRP). But from the code, I don't know the state is at A_IDLE, mind to change? Peter -- 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 3/3] usb: chipidea: use hrtimer for otg fsm timers
On Sat, Feb 28, 2015 at 09:43:30AM +0800, Chen Peter-B29397 wrote: Why you use unsigned, but not unsigned int or unsigned long? unsigned is equal to unsigned int, currently only 13 timers are defined, so unsigned is okay, for possible future extension, I will change it to be unsigned long Since I see you use unsigned long below, I have this question, it is ok you do not change it. @@ -579,8 +579,15 @@ int ci_otg_fsm_work(struct ci_hdrc *ci) * a_idle to a_wait_vrise when power up */ if ((ci-fsm.id) || (ci-id_event) || - (ci-fsm.power_up)) + (ci-fsm.power_up)) { ci_otg_queue_work(ci); + } else { + /* Enable data pulse irq */ + hw_write(ci, OP_PORTSC, PORTSC_W1C_BITS | + PORTSC_PP, 0); + hw_write_otgsc(ci, OTGSC_DPIS, OTGSC_DPIS); + hw_write_otgsc(ci, OTGSC_DPIE, OTGSC_DPIE); + } Can we enable data pulse enable at initialization routine? This irq should be enabled only for A-device when there is no session (host role, no vbus, so in A_IDLE state), and disable it after receive its irq(SRP). But from the code, I don't know the state is at A_IDLE, mind to change? It's already under condition of A_IDLE as below: if (ci-fsm.otg-state == OTG_STATE_A_IDLE) { ... ... if () { ... ... } else { /* Enable data pulse irq */ ... } } That's a change to avoid to do it in timer out(VFALL) handler, so put it here (after otg fsm transit to A_IDLE and will no further state transitions). Li Jun Peter -- 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: Control message failures kill entire XHCI stack
Hi Mathias Devin, On Thu, Feb 19, 2015 at 3:18 PM, Mathias Nyman mathias.ny...@linux.intel.com wrote: Got one more patch added to the for-usb-next-branch. It makes sure we allocate enough scratchpad memory for xhci. It's one possible cause. Patch will anyway go to 3.20, but you can try it out first to see if it helps My apologies for my slow response, I've been in hospital for almost two weeks having my gallbladder removed. I tried recording with the Hauppauge USB Live2 using the following kernel: * 3.19.0 with the following patches: * xhci: Allocate correct amount of scratchpad buffers * xhci: Don't touch TRBs memory if those are no longer on the endpoint ring * xhci: fix invalid pointer in reset device debugging * xhci: add debugging for reset device and stop endpoint commands * xhci: add command ring stop and restart debug messages Unfortunately it still fails with the xHCI host controller dying. I've included an extract from syslog which will hopefully show you the main activity. The entire syslog (boot, test, shutdown) is available from: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1412121/+attachment/4330313/+files/syslog Feb 27 11:59:03 alistair-XPS13 kernel: [ 154.081591] xhci_hcd :00:14.0: Cached old ring, 26 rings cached Feb 27 11:59:03 alistair-XPS13 kernel: [ 154.081644] xhci_hcd :00:14.0: Endpoint 0x83 ep reset callback called Feb 27 11:59:03 alistair-XPS13 rtkit-daemon[2137]: Successfully made thread 4191 of process 3296 (n/a) owned by '1000' RT at priority 5. Feb 27 11:59:03 alistair-XPS13 rtkit-daemon[2137]: Supervising 5 threads of 1 processes of 1 users. Feb 27 11:59:03 alistair-XPS13 kernel: [ 154.087381] xhci_hcd :00:14.0: ERROR no room on ep ring, try ring expansion Feb 27 11:59:03 alistair-XPS13 kernel: [ 154.087393] xhci_hcd :00:14.0: ring expansion succeed, now has 4 segments Feb 27 11:59:03 alistair-XPS13 kernel: [ 154.087411] xhci_hcd :00:14.0: ERROR no room on ep ring, try ring expansion Feb 27 11:59:03 alistair-XPS13 kernel: [ 154.087415] xhci_hcd :00:14.0: ring expansion succeed, now has 8 segments Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090518] xhci_hcd :00:14.0: Cancel URB 8801f949f000, dev 2, ep 0x83, starting at offset 0x1ff9d03b0 Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090531] xhci_hcd :00:14.0: Starting stop cmd watchdog timer for slot 4 ep index 6. Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090544] xhci_hcd :00:14.0: cmdring ctrl reg before ringing 0x8 Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090547] xhci_hcd :00:14.0: // Ding dong! Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090554] xhci_hcd :00:14.0: cmdring ctrl reg after ringing 0x8 Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090590] xhci_hcd :00:14.0: Stopped on Transfer TRB Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090602] xhci_hcd :00:14.0: Removing canceled TD starting at 0x1ff9d0690 (dma). Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090607] xhci_hcd :00:14.0: Finding endpoint context Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090612] xhci_hcd :00:14.0: Cycle state = 0x0 Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090616] xhci_hcd :00:14.0: New dequeue segment = 880214e25940 (virtual) Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090620] xhci_hcd :00:14.0: New dequeue pointer = 0x1ff9d06a0 (DMA) Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090624] xhci_hcd :00:14.0: Removing canceled TD starting at 0x1ff9d06a0 (dma). Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090628] xhci_hcd :00:14.0: TRB to noop at offset 0x1ff9d06a0 Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090631] xhci_hcd :00:14.0: Removing canceled TD starting at 0x1ff9d06b0 (dma). Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090635] xhci_hcd :00:14.0: TRB to noop at offset 0x1ff9d06b0 ... Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090828] xhci_hcd :00:14.0: event_trb is a no-op TRB. Skip it Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090833] xhci_hcd :00:14.0: xhci_drop_endpoint called for udev 880208e61000 Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090835] xhci_hcd :00:14.0: Removing canceled TD starting at 0x1ff9d07b0 (dma). Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090838] xhci_hcd :00:14.0: TRB to noop at offset 0x1ff9d07b0 Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090842] xhci_hcd :00:14.0: Removing canceled TD starting at 0x1ff9d07c0 (dma). Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.090845] xhci_hcd :00:14.0: TRB to noop at offset 0x1ff9d07c0 ... Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.094764] xhci_hcd :00:14.0: Cached old ring, 27 rings cached Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.094789] xhci_hcd :00:14.0: Cancel URB 8801f949e000, dev 2, ep 0x83, starting at offset 0x1ff9cf3d0 Feb 27 11:59:08 alistair-XPS13 kernel: [ 159.094794] xhci_hcd :00:14.0: Cancel URB NOT on current ring Feb 27 11:59:08
Re: [PATCH] usb: gadget: f_mass_storage: use defined constant instead of numeric value
On Thu, Feb 26 2015, Tal Shorer tal.sho...@gmail.com wrote: Signed-off-by: Tal Shorer tal.sho...@gmail.com Acked-by: Michal Nazarewicz min...@mina86.com --- drivers/usb/gadget/function/f_mass_storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index 811929c..6d5ca2b 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -1085,7 +1085,7 @@ static int do_inquiry(struct fsg_common *common, struct fsg_buffhd *bh) if (!curlun) { /* Unsupported LUNs are okay */ common-bad_lun_okay = 1; memset(buf, 0, 36); - buf[0] = 0x7f; /* Unsupported, no device-type */ + buf[0] = TYPE_NO_LUN; /* Unsupported, no device-type */ buf[4] = 31;/* Additional length */ return 36; } -- 2.2.2 -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michał “mina86” Nazarewicz(o o) ooo +--m...@google.com--xmpp:min...@jabber.org--ooO--(_)--Ooo-- -- 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 4/8] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS
* Sergei Shtylyov sergei.shtyl...@cogentembedded.com [150227 06:27]: Hello. On 2/27/2015 5:17 PM, Robert Abel wrote: Documentation/kernel-doc-nano-HOWTO.txt requires colons after the parameter names, doesn't it? Jesus Christ, you guys are killing me... I've already spent way more time on this patch series than I intended to anyway... That's what you get when pushing your stuff upstream. You're not alone here. :-) And thanks for the effort. Best to fix up things for good, that will save headaches later on for everybody. Hmm did you file all the forms for a change request in the kernel? Just kidding :) Tony -- 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 4/8] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS
Hello. On 2/27/2015 5:17 PM, Robert Abel wrote: Documentation/kernel-doc-nano-HOWTO.txt requires colons after the parameter names, doesn't it? Jesus Christ, you guys are killing me... I've already spent way more time on this patch series than I intended to anyway... That's what you get when pushing your stuff upstream. You're not alone here. :-) + mask = (1 nr_bits) - 1; BIT(nr_bits) - 1, perhaps? Not happening... BIT macro obscures what's actually going on. I did search for a macro that does ((1 n) - 1) but didn't found it, unfortunately... Regards, Robert WBR, Sergei -- 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 4/8] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS
On Thu, Feb 26, 2015 at 4:06 PM, Sergei Shtylyov sergei.shtyl...@cogentembedded.com wrote: Documentation/kernel-doc-nano-HOWTO.txt requires colons after the parameter names, doesn't it? Jesus Christ, you guys are killing me... I've already spent way more time on this patch series than I intended to anyway... + mask = (1 nr_bits) - 1; BIT(nr_bits) - 1, perhaps? Not happening... BIT macro obscures what's actually going on. Regards, Robert -- 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/isp1760: set IRQ flags properly
The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc (genirq: Run irq handlers with interrupts disabled) running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active. This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED. Signed-off-by: Valentin Rothberg valentin.rothb...@lip6.fr --- drivers/usb/isp1760/isp1760-core.c | 5 ++--- drivers/usb/isp1760/isp1760-udc.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/usb/isp1760/isp1760-core.c b/drivers/usb/isp1760/isp1760-core.c index b982755..9f4a0de 100644 --- a/drivers/usb/isp1760/isp1760-core.c +++ b/drivers/usb/isp1760/isp1760-core.c @@ -145,14 +145,13 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags, if (IS_ENABLED(CONFIG_USB_ISP1760_HCD) !usb_disabled()) { ret = isp1760_hcd_register(isp-hcd, isp-regs, mem, irq, - irqflags | IRQF_SHARED, dev); + irqflags, dev); if (ret 0) return ret; } if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) !udc_disabled) { - ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED | - IRQF_DISABLED); + ret = isp1760_udc_register(isp, irq, irqflags); if (ret 0) { isp1760_hcd_unregister(isp-hcd); return ret; diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c index 9612d79..0b46ff0 100644 --- a/drivers/usb/isp1760/isp1760-udc.c +++ b/drivers/usb/isp1760/isp1760-udc.c @@ -1451,8 +1451,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq, sprintf(udc-irqname, %s (udc), devname); - ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | IRQF_DISABLED | - irqflags, udc-irqname, udc); + ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags, + udc-irqname, udc); if (ret 0) goto error; -- 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 4/8] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS
Hi Roger, On Fri, Feb 27, 2015 at 11:43 AM, Roger Quadros rog...@ti.com wrote: time_ns_min = gpmc_ticks_to_ns(l ? l - 1 : 0); should be time_ns_min = l ? gpmc_ticks_to_ns(l - 1) + 1 : 0; That's a micro-optimization. + 1ns since we don't want to fall into the previous tick bracket. for l == 0 we have t_min as 0. no need to pass it through gpmc_ticks_to_ns() or add 1 ns. That's why the invervals are half-open. I can make them closed, no problem. Regards, Robert -- 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
[PATCHv2 3/6] usb: gadget: printer: convert to new interface of f_printer
The goal is to remove the old function interface, so its (only) user must be converted to the new interface. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/Kconfig | 1 + drivers/usb/gadget/legacy/printer.c | 50 ++--- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/drivers/usb/gadget/legacy/Kconfig b/drivers/usb/gadget/legacy/Kconfig index 113c87e..d5a7102 100644 --- a/drivers/usb/gadget/legacy/Kconfig +++ b/drivers/usb/gadget/legacy/Kconfig @@ -301,6 +301,7 @@ config USB_MIDI_GADGET config USB_G_PRINTER tristate Printer Gadget select USB_LIBCOMPOSITE + select USB_F_PRINTER help The Printer Gadget channels data between the USB host and a userspace program driving the print engine. The user space diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c index 770b504..a8050f8 100644 --- a/drivers/usb/gadget/legacy/printer.c +++ b/drivers/usb/gadget/legacy/printer.c @@ -29,12 +29,7 @@ USB_GADGET_COMPOSITE_OPTIONS(); static const char shortname [] = printer; static const char driver_desc [] = DRIVER_DESC; -/* - * This will be changed when f_printer is converted - * to the new function interface. - */ -#define USBF_PRINTER_INCLUDED -#include f_printer.c +#include u_printer.h /*-*/ @@ -65,6 +60,9 @@ module_param(qlen, uint, S_IRUGO|S_IWUSR); #define QLEN qlen +static struct usb_function_instance *fi_printer; +static struct usb_function *f_printer; + /*-*/ /* @@ -131,6 +129,7 @@ static struct usb_configuration printer_cfg_driver = { static int __init printer_do_config(struct usb_configuration *c) { struct usb_gadget *gadget = c-cdev-gadget; + int status = 0; usb_ep_autoconfig_reset(gadget); @@ -142,20 +141,41 @@ static int __init printer_do_config(struct usb_configuration *c) printer_cfg_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP; } - return f_printer_bind_config(c, iPNPstring, pnp_string, QLEN, 0); + f_printer = usb_get_function(fi_printer); + if (IS_ERR(f_printer)) + return PTR_ERR(f_printer); + + status = usb_add_function(c, f_printer); + if (status 0) + usb_put_function(f_printer); + + return status; } static int __init printer_bind(struct usb_composite_dev *cdev) { - int ret; + struct f_printer_opts *opts; + int ret, len; - ret = gprinter_setup(PRINTER_MINORS); - if (ret) - return ret; + fi_printer = usb_get_function_instance(printer); + if (IS_ERR(fi_printer)) + return PTR_ERR(fi_printer); + + if (iPNPstring) + strlcpy(pnp_string[2], iPNPstring, PNP_STRING_LEN - 2); + + len = strlen(pnp_string); + pnp_string[0] = (len 8) 0xFF; + pnp_string[1] = len 0xFF; + + opts = container_of(fi_printer, struct f_printer_opts, func_inst); + opts-minor = 0; + memcpy(opts-pnp_string, pnp_string, PNP_STRING_LEN); + opts-q_len = QLEN; ret = usb_string_ids_tab(cdev, strings); if (ret 0) { - gprinter_cleanup(); + usb_put_function_instance(fi_printer); return ret; } device_desc.iManufacturer = strings[USB_GADGET_MANUFACTURER_IDX].id; @@ -164,7 +184,7 @@ static int __init printer_bind(struct usb_composite_dev *cdev) ret = usb_add_config(cdev, printer_cfg_driver, printer_do_config); if (ret) { - gprinter_cleanup(); + usb_put_function_instance(fi_printer); return ret; } usb_composite_overwrite_options(cdev, coverwrite); @@ -173,7 +193,9 @@ static int __init printer_bind(struct usb_composite_dev *cdev) static int __exit printer_unbind(struct usb_composite_dev *cdev) { - gprinter_cleanup(); + usb_put_function(f_printer); + usb_put_function_instance(fi_printer); + return 0; } -- 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
[PATCHv2 5/6] usb: gadget: printer: use module_usb_composite_driver helper macro
Substitute some boilerplate code with a dedicated macro. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/legacy/printer.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c index a8050f8..d5b6ee7 100644 --- a/drivers/usb/gadget/legacy/printer.c +++ b/drivers/usb/gadget/legacy/printer.c @@ -208,19 +208,7 @@ static __refdata struct usb_composite_driver printer_driver = { .unbind = printer_unbind, }; -static int __init -init(void) -{ - return usb_composite_probe(printer_driver); -} -module_init(init); - -static void __exit -cleanup(void) -{ - usb_composite_unregister(printer_driver); -} -module_exit(cleanup); +module_usb_composite_driver(printer_driver); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR(Craig Nadler); -- 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
[PATCHv2 0/6] Configfs support for printer gadget
This is a follow-up to this thread: http://www.spinics.net/lists/linux-usb/msg121791.html after patches 01..24 have been applied by Felipe. This series contains the remainig patches rebased onto Felipe's testing/next. Andrzej Pietrasiewicz (6): usb: gadget: f_printer: eliminate legacy comment usb: gadget: f_printer: convert to new function interface with backward compatibility usb: gadget: printer: convert to new interface of f_printer usb: gadget: f_printer: remove compatibility layer usb: gadget: printer: use module_usb_composite_driver helper macro usb: gadget: printer: add configfs support .../ABI/testing/configfs-usb-gadget-printer| 9 + Documentation/usb/gadget-testing.txt | 47 drivers/usb/gadget/Kconfig | 16 ++ drivers/usb/gadget/function/Makefile | 2 + drivers/usb/gadget/function/f_printer.c| 307 + drivers/usb/gadget/function/u_printer.h| 37 +++ drivers/usb/gadget/legacy/Kconfig | 1 + drivers/usb/gadget/legacy/printer.c| 63 +++-- 8 files changed, 400 insertions(+), 82 deletions(-) create mode 100644 Documentation/ABI/testing/configfs-usb-gadget-printer create mode 100644 drivers/usb/gadget/function/u_printer.h -- 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
[PATCHv2 2/6] usb: gadget: f_printer: convert to new function interface with backward compatibility
In order to add configfs support, a usb function must be converted to use the new interface. This patch converts the function to the new interface and provides backward compatiblity layer, which can be removed after all its users are converted to use the new interface. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/Kconfig | 3 + drivers/usb/gadget/function/Makefile| 2 + drivers/usb/gadget/function/f_printer.c | 185 +++- drivers/usb/gadget/function/u_printer.h | 30 ++ drivers/usb/gadget/legacy/printer.c | 1 + 5 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 drivers/usb/gadget/function/u_printer.h diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index b454d05..9d507cf 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -196,6 +196,9 @@ config USB_F_MIDI config USB_F_HID tristate +config USB_F_PRINTER + tristate + choice tristate USB Gadget Drivers default USB_ETH diff --git a/drivers/usb/gadget/function/Makefile b/drivers/usb/gadget/function/Makefile index f71b1aa..bd7def5 100644 --- a/drivers/usb/gadget/function/Makefile +++ b/drivers/usb/gadget/function/Makefile @@ -42,3 +42,5 @@ usb_f_midi-y := f_midi.o obj-$(CONFIG_USB_F_MIDI) += usb_f_midi.o usb_f_hid-y:= f_hid.o obj-$(CONFIG_USB_F_HID)+= usb_f_hid.o +usb_f_printer-y:= f_printer.o +obj-$(CONFIG_USB_F_PRINTER)+= usb_f_printer.o diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index 0847972..93f4d4e 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -24,6 +24,7 @@ #include linux/mutex.h #include linux/errno.h #include linux/init.h +#include linux/idr.h #include linux/timer.h #include linux/list.h #include linux/interrupt.h @@ -46,6 +47,8 @@ #include linux/usb/gadget.h #include linux/usb/g_printer.h +#include u_printer.h + #define PNP_STRING_LEN 1024 #define PRINTER_MINORS 4 #define GET_DEVICE_ID 0 @@ -54,6 +57,10 @@ static int major, minors; static struct class *usb_gadget_class; +#ifndef USBF_PRINTER_INCLUDED +static DEFINE_IDA(printer_ida); +static DEFINE_MUTEX(printer_ida_lock); /* protects access do printer_ida */ +#endif /*-*/ @@ -999,7 +1006,7 @@ unknown: return value; } -static int __init printer_func_bind(struct usb_configuration *c, +static int printer_func_bind(struct usb_configuration *c, struct usb_function *f) { struct usb_gadget *gadget = c-cdev-gadget; @@ -,6 +1118,7 @@ fail_tx_reqs: } +#ifdef USBF_PRINTER_INCLUDED static void printer_func_unbind(struct usb_configuration *c, struct usb_function *f) { @@ -1155,6 +1163,7 @@ static void printer_func_unbind(struct usb_configuration *c, usb_free_all_descriptors(f); kfree(dev); } +#endif static int printer_func_set_alt(struct usb_function *f, unsigned intf, unsigned alt) @@ -1180,6 +1189,7 @@ static void printer_func_disable(struct usb_function *f) spin_unlock_irqrestore(dev-lock, flags); } +#ifdef USBF_PRINTER_INCLUDED static int f_printer_bind_config(struct usb_configuration *c, char *pnp_str, char *pnp_string, unsigned q_len, int minor) { @@ -1240,6 +1250,179 @@ static int f_printer_bind_config(struct usb_configuration *c, char *pnp_str, INFO(dev, %s, version: DRIVER_VERSION \n, driver_desc); return 0; } +#else +static inline int gprinter_get_minor(void) +{ + return ida_simple_get(printer_ida, 0, 0, GFP_KERNEL); +} + +static inline void gprinter_put_minor(int minor) +{ + ida_simple_remove(printer_ida, minor); +} + +static int gprinter_setup(int); +static void gprinter_cleanup(void); + +static void gprinter_free_inst(struct usb_function_instance *f) +{ + struct f_printer_opts *opts; + + opts = container_of(f, struct f_printer_opts, func_inst); + + mutex_lock(printer_ida_lock); + + gprinter_put_minor(opts-minor); + if (idr_is_empty(printer_ida.idr)) + gprinter_cleanup(); + + mutex_unlock(printer_ida_lock); + + kfree(opts); +} + +static struct usb_function_instance *gprinter_alloc_inst(void) +{ + struct f_printer_opts *opts; + struct usb_function_instance *ret; + int status = 0; + + opts = kzalloc(sizeof(*opts), GFP_KERNEL); + if (!opts) + return ERR_PTR(-ENOMEM); + + opts-func_inst.free_func_inst = gprinter_free_inst; + ret = opts-func_inst; + + mutex_lock(printer_ida_lock); + + if (idr_is_empty(printer_ida.idr)) { + status = gprinter_setup(PRINTER_MINORS); + if (status)
[PATCHv2 4/6] usb: gadget: f_printer: remove compatibility layer
There are no old interface users left, so it can be removed. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/f_printer.c | 113 1 file changed, 113 deletions(-) diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index 93f4d4e..7afe17d 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -57,10 +57,8 @@ static int major, minors; static struct class *usb_gadget_class; -#ifndef USBF_PRINTER_INCLUDED static DEFINE_IDA(printer_ida); static DEFINE_MUTEX(printer_ida_lock); /* protects access do printer_ida */ -#endif /*-*/ @@ -1118,53 +1116,6 @@ fail_tx_reqs: } -#ifdef USBF_PRINTER_INCLUDED -static void printer_func_unbind(struct usb_configuration *c, - struct usb_function *f) -{ - struct printer_dev *dev; - struct usb_request *req; - - dev = func_to_printer(f); - - device_destroy(usb_gadget_class, MKDEV(major, dev-minor)); - - /* Remove Character Device */ - cdev_del(dev-printer_cdev); - - /* we must already have been disconnected ... no i/o may be active */ - WARN_ON(!list_empty(dev-tx_reqs_active)); - WARN_ON(!list_empty(dev-rx_reqs_active)); - - /* Free all memory for this driver. */ - while (!list_empty(dev-tx_reqs)) { - req = container_of(dev-tx_reqs.next, struct usb_request, - list); - list_del(req-list); - printer_req_free(dev-in_ep, req); - } - - if (dev-current_rx_req != NULL) - printer_req_free(dev-out_ep, dev-current_rx_req); - - while (!list_empty(dev-rx_reqs)) { - req = container_of(dev-rx_reqs.next, - struct usb_request, list); - list_del(req-list); - printer_req_free(dev-out_ep, req); - } - - while (!list_empty(dev-rx_buffers)) { - req = container_of(dev-rx_buffers.next, - struct usb_request, list); - list_del(req-list); - printer_req_free(dev-out_ep, req); - } - usb_free_all_descriptors(f); - kfree(dev); -} -#endif - static int printer_func_set_alt(struct usb_function *f, unsigned intf, unsigned alt) { @@ -1189,68 +1140,6 @@ static void printer_func_disable(struct usb_function *f) spin_unlock_irqrestore(dev-lock, flags); } -#ifdef USBF_PRINTER_INCLUDED -static int f_printer_bind_config(struct usb_configuration *c, char *pnp_str, -char *pnp_string, unsigned q_len, int minor) -{ - struct printer_dev *dev; - int status = -ENOMEM; - size_t len; - - if (minor = minors) - return -ENOENT; - - dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (!dev) - return -ENOMEM; - - dev-pnp_string = pnp_string; - dev-minor = minor; - - dev-function.name = shortname; - dev-function.bind = printer_func_bind; - dev-function.setup = printer_func_setup; - dev-function.unbind = printer_func_unbind; - dev-function.set_alt = printer_func_set_alt; - dev-function.disable = printer_func_disable; - dev-function.req_match = gprinter_req_match; - INIT_LIST_HEAD(dev-tx_reqs); - INIT_LIST_HEAD(dev-rx_reqs); - INIT_LIST_HEAD(dev-rx_buffers); - - if (pnp_str) - strlcpy(dev-pnp_string[2], pnp_str, PNP_STRING_LEN - 2); - - len = strlen(pnp_string); - pnp_string[0] = (len 8) 0xFF; - pnp_string[1] = len 0xFF; - - spin_lock_init(dev-lock); - mutex_init(dev-lock_printer_io); - INIT_LIST_HEAD(dev-tx_reqs_active); - INIT_LIST_HEAD(dev-rx_reqs_active); - init_waitqueue_head(dev-rx_wait); - init_waitqueue_head(dev-tx_wait); - init_waitqueue_head(dev-tx_flush_wait); - - dev-interface = -1; - dev-printer_cdev_open = 0; - dev-printer_status = PRINTER_NOT_ERROR; - dev-current_rx_req = NULL; - dev-current_rx_bytes = 0; - dev-current_rx_buf = NULL; - dev-q_len = q_len; - - status = usb_add_function(c, dev-function); - if (status) { - kfree(dev); - return status; - } - - INFO(dev, %s, version: DRIVER_VERSION \n, driver_desc); - return 0; -} -#else static inline int gprinter_get_minor(void) { return ida_simple_get(printer_ida, 0, 0, GFP_KERNEL); @@ -1422,8 +1311,6 @@ DECLARE_USB_FUNCTION_INIT(printer, gprinter_alloc_inst, gprinter_alloc); MODULE_LICENSE(GPL); MODULE_AUTHOR(Craig Nadler); -#endif - static int gprinter_setup(int count) { int status; -- 1.9.1 -- To unsubscribe from this list: send
[PATCHv2 1/6] usb: gadget: f_printer: eliminate legacy comment
With multiple (and dynamically allocated and removed) instances of the printer function it does not make sense to depend on a component of a particular struct printer_dev in order to clean up after _all_ printer instances. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- drivers/usb/gadget/function/f_printer.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index 170f9b1..0847972 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -1268,7 +1268,6 @@ static int gprinter_setup(int count) return status; } -/* must be called with struct printer_dev's lock_printer_io held */ static void gprinter_cleanup(void) { if (major) { -- 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
[PATCHv2 6/6] usb: gadget: printer: add configfs support
Add support for configfs interface so that f_printer can be used as a component of usb gadgets composed with it. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com --- .../ABI/testing/configfs-usb-gadget-printer| 9 ++ Documentation/usb/gadget-testing.txt | 47 drivers/usb/gadget/Kconfig | 13 +++ drivers/usb/gadget/function/f_printer.c| 130 - drivers/usb/gadget/function/u_printer.h| 7 ++ 5 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 Documentation/ABI/testing/configfs-usb-gadget-printer diff --git a/Documentation/ABI/testing/configfs-usb-gadget-printer b/Documentation/ABI/testing/configfs-usb-gadget-printer new file mode 100644 index 000..6b0714e --- /dev/null +++ b/Documentation/ABI/testing/configfs-usb-gadget-printer @@ -0,0 +1,9 @@ +What: /config/usb-gadget/gadget/functions/printer.name +Date: Apr 2015 +KernelVersion: 4.1 +Description: + The attributes: + + pnp_string - Data to be passed to the host in pnp string + q_len - Number of requests per endpoint + diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb/gadget-testing.txt index 076ac7b..f45b2bf 100644 --- a/Documentation/usb/gadget-testing.txt +++ b/Documentation/usb/gadget-testing.txt @@ -19,6 +19,7 @@ provided by gadgets. 16. UAC1 function 17. UAC2 function 18. UVC function +19. PRINTER function 1. ACM function @@ -726,3 +727,49 @@ with these patches: http://www.spinics.net/lists/linux-usb/msg99220.html host: luvcview -f yuv + +19. PRINTER function + + +The function is provided by usb_f_printer.ko module. + +Function-specific configfs interface + + +The function name to use when creating the function directory is printer. +The printer function provides these attributes in its function directory: + + pnp_string - Data to be passed to the host in pnp string + q_len - Number of requests per endpoint + +Testing the PRINTER function + + +The most basic testing: + +device: run the gadget +# ls -l /devices/virtual/usb_printer_gadget/ + +should show g_printernumber. + +If udev is active, then /dev/g_printernumber should appear automatically. + +host: + +If udev is active, then e.g. /dev/usb/lp0 should appear. + +host-device transmission: + +device: +# cat /dev/g_printernumber +host: +# cat /dev/usb/lp0 + +device-host transmission: + +# cat /dev/g_printernumber +host: +# cat /dev/usb/lp0 + +More advanced testing can be done with the prn_example +described in Documentation/usb/gadget-printer.txt. diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 9d507cf..3bb0e67 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -437,6 +437,19 @@ config USB_CONFIGFS_F_UVC device. It provides a userspace API to process UVC control requests and stream video data to the host. +config USB_CONFIGFS_F_PRINTER + bool Printer function + select USB_F_PRINTER + help + The Printer function channels data between the USB host and a + userspace program driving the print engine. The user space + program reads and writes the device file /dev/g_printerX to + receive or send printer data. It can use ioctl calls to + the device file to get or set printer status. + + For more information, see Documentation/usb/gadget_printer.txt + which includes sample code for accessing the device file. + source drivers/usb/gadget/legacy/Kconfig endchoice diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index 7afe17d..757fcf0 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c @@ -1140,6 +1140,117 @@ static void printer_func_disable(struct usb_function *f) spin_unlock_irqrestore(dev-lock, flags); } +static inline struct f_printer_opts +*to_f_printer_opts(struct config_item *item) +{ + return container_of(to_config_group(item), struct f_printer_opts, + func_inst.group); +} + +CONFIGFS_ATTR_STRUCT(f_printer_opts); +CONFIGFS_ATTR_OPS(f_printer_opts); + +static void printer_attr_release(struct config_item *item) +{ + struct f_printer_opts *opts = to_f_printer_opts(item); + + usb_put_function_instance(opts-func_inst); +} + +static struct configfs_item_operations printer_item_ops = { + .release= printer_attr_release, + .show_attribute = f_printer_opts_attr_show, + .store_attribute = f_printer_opts_attr_store, +}; + +static ssize_t f_printer_opts_pnp_string_show(struct f_printer_opts *opts, + char *page) +{ + int result; + + mutex_lock(opts-lock); + result = strlcpy(page,
[PATCH] hso: add missing spinlock grab when iterating the serial table
Access to the 'serial_table' array needs to be protected by the spinlock. Signed-off-by: Aleksander Morgado aleksan...@aleksander.es --- drivers/net/usb/hso.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 3c8dfe5..4f6deff 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -607,19 +607,24 @@ static struct hso_serial *get_serial_by_shared_int_and_type( struct hso_shared_int *shared_int, int mux) { + struct hso_serial *serial = NULL; int i, port; + unsigned long flags; port = hso_mux_to_port(mux); + spin_lock_irqsave(serial_table_lock, flags); for (i = 0; i HSO_SERIAL_TTY_MINORS; i++) { if (serial_table[i] (dev2ser(serial_table[i])-shared_int == shared_int) ((serial_table[i]-port_spec HSO_PORT_MASK) == port)) { - return dev2ser(serial_table[i]); + serial = dev2ser(serial_table[i]); + break; } } + spin_unlock_irqrestore(serial_table_lock, flags); - return NULL; + return serial; } static struct hso_serial *get_serial_by_index(unsigned index) -- 2.3.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: [RFC PATCH] xhci: fix reporting of 0-sized URBs in control endpoints
On Thu, Feb 26, 2015 at 5:12 PM, Mathias Nyman mathias.ny...@linux.intel.com wrote: When a control transfer has a short data stage, the xHCI controller generates two transfer events: a COMP_SHORT_TX event that specifies the untransferred amount, and a COMP_SUCCESS event. But when the data stage is not short, only the COMP_SUCCESS event occurs. Therefore, xhci-hcd sets urb-actual_length to urb-transfer_buffer_length while processing the COMP_SUCCESS event, unless urb-actual_length was set already by a previous COMP_SHORT_TX event. The driver checks this by seeing whether urb-actual_length == 0, but this alone is the wrong test, as it is entirely possible for a short transfer to have an urb-actual_length = 0. This patch changes the xhci driver to set the urb-actual_length in advance to the expected value of a successful control transfer. The urb-actual_length is then only adjusted in case of short transfers or other special events, but not on COMP_SUCCESS events. This fixes a bug which affected the HSO plugin, which relies on URBs with urb-actual_length == 0 to halt re-submitting the RX URB in the control endpoint. Signed-off-by: Mathias Nyman mathias.ny...@linux.intel.com Tested this patch (with the extra else if suggested in the follow up commit) and it seems to work correctly with the HSO plugin. Not sure if it'll end up being the last version or not, but anyway: Tested-by: Aleksander Morgado aleksan...@aleksander.es Let me know if you want me to test anything else. --- drivers/usb/host/xhci-ring.c | 73 ++-- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index b46b5b9..0e02e79 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -732,7 +732,11 @@ remove_finished_td: /* Clean up the cancelled URB */ /* Doesn't matter what we pass for status, since the core will * just overwrite it (because the URB has been unlinked). +* Control urbs have the urb-actual_length pre-set, clear it +* as well */ + if (usb_endpoint_xfer_control(cur_td-urb-ep-desc)) + cur_td-urb-actual_length = 0; xhci_giveback_urb_in_irq(xhci, cur_td, 0); /* Stop processing the cancelled list if the watchdog timer is @@ -755,6 +759,7 @@ static void xhci_kill_ring_urbs(struct xhci_hcd *xhci, struct xhci_ring *ring) list_del_init(cur_td-td_list); if (!list_empty(cur_td-cancelled_td_list)) list_del_init(cur_td-cancelled_td_list); + cur_td-urb-actual_length = 0; xhci_giveback_urb_in_irq(xhci, cur_td, -ESHUTDOWN); } } @@ -792,6 +797,7 @@ static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci, cur_td = list_first_entry(ep-cancelled_td_list, struct xhci_td, cancelled_td_list); list_del_init(cur_td-cancelled_td_list); + cur_td-urb-actual_length = 0; xhci_giveback_urb_in_irq(xhci, cur_td, -ESHUTDOWN); } } @@ -1888,6 +1894,7 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, int ep_index; struct xhci_ep_ctx *ep_ctx; u32 trb_comp_code; + bool force_finish_td = false; slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event-flags)); xdev = xhci-devs[slot_id]; @@ -1906,7 +1913,8 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, xhci_warn(xhci, WARN: Success on ctrl data TRB without IOC set??\n); *status = -ESHUTDOWN; - } else { + } else if (*status == -EINPROGRESS) { + /* only set to 0 if no previous event set it earlier */ *status = 0; } break; @@ -1918,6 +1926,8 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, break; case COMP_STOP_INVAL: case COMP_STOP: + /* we don't continue stopped TDs, so length can be set to 0 */ + td-urb-actual_length = 0; return finish_td(xhci, td, event_trb, event, ep, status, false); default: if (!xhci_requires_manual_halt_cleanup(xhci, @@ -1928,44 +1938,26 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, trb_comp_code, ep_index); /* else fall through */ case COMP_STALL: - /* Did we transfer part of the data (middle) phase? */ - if (event_trb != ep_ring-dequeue - event_trb != td-last_trb) -
Re: [PATCH 3/5] usb: phy: ab8500-usb: Rename regulator_set_optimum_mode
On Wed, Feb 11, 2015 at 07:35:29PM -0800, Bjorn Andersson wrote: The function regulator_set_optimum_mode() is changing name to regulator_set_load(), so update the code accordingly. Signed-off-by: Bjorn Andersson bjorn.anders...@sonymobile.com since this depends on the rest of the series: Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/phy/phy-ab8500-usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 0b1bd23..f5b3b92 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c @@ -277,7 +277,7 @@ static void ab8500_usb_regulator_enable(struct ab8500_usb *ab) dev_err(ab-dev, Failed to set the Vintcore to 1.3V, ret=%d\n, ret); - ret = regulator_set_optimum_mode(ab-v_ulpi, 28000); + ret = regulator_set_load(ab-v_ulpi, 28000); if (ret 0) dev_err(ab-dev, Failed to set optimum mode (ret=%d)\n, ret); @@ -317,7 +317,7 @@ static void ab8500_usb_regulator_disable(struct ab8500_usb *ab) ab-saved_v_ulpi, ret); } - ret = regulator_set_optimum_mode(ab-v_ulpi, 0); + ret = regulator_set_load(ab-v_ulpi, 0); if (ret 0) dev_err(ab-dev, Failed to set optimum mode (ret=%d)\n, ret); -- 1.8.2.2 -- balbi signature.asc Description: Digital signature
Re: [PATCH 4/5] usb: phy: phy-msm-usb: Rename regulator_set_optimum_mode
On Wed, Feb 11, 2015 at 07:35:30PM -0800, Bjorn Andersson wrote: The function regulator_set_optimum_mode() is changing name to regulator_set_load(), so update the code accordingly. Signed-off-by: Bjorn Andersson bjorn.anders...@sonymobile.com since this depends on the rest of the series: Acked-by: Felipe Balbi ba...@ti.com --- drivers/usb/phy/phy-msm-usb.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index 000fd89..6ed67ea 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -142,27 +142,22 @@ static int msm_hsusb_ldo_set_mode(struct msm_otg *motg, int on) int ret = 0; if (on) { - ret = regulator_set_optimum_mode(motg-v1p8, - USB_PHY_1P8_HPM_LOAD); + ret = regulator_set_load(motg-v1p8, USB_PHY_1P8_HPM_LOAD); if (ret 0) { pr_err(Could not set HPM for v1p8\n); return ret; } - ret = regulator_set_optimum_mode(motg-v3p3, - USB_PHY_3P3_HPM_LOAD); + ret = regulator_set_load(motg-v3p3, USB_PHY_3P3_HPM_LOAD); if (ret 0) { pr_err(Could not set HPM for v3p3\n); - regulator_set_optimum_mode(motg-v1p8, - USB_PHY_1P8_LPM_LOAD); + regulator_set_load(motg-v1p8, USB_PHY_1P8_LPM_LOAD); return ret; } } else { - ret = regulator_set_optimum_mode(motg-v1p8, - USB_PHY_1P8_LPM_LOAD); + ret = regulator_set_load(motg-v1p8, USB_PHY_1P8_LPM_LOAD); if (ret 0) pr_err(Could not set LPM for v1p8\n); - ret = regulator_set_optimum_mode(motg-v3p3, - USB_PHY_3P3_LPM_LOAD); + ret = regulator_set_load(motg-v3p3, USB_PHY_3P3_LPM_LOAD); if (ret 0) pr_err(Could not set LPM for v3p3\n); } -- 1.8.2.2 -- balbi signature.asc Description: Digital signature
Re: keyboard/trackpad combo unusable on MacBookPro4,1 with bcm5974.ko
On Fri, 27 Feb 2015, Christian Böhme wrote: Hello all, this is a response to https://bugzilla.kernel.org/show_bug.cgi?id=14987#c6 whose main thread more or less merely rehashes what was already said in other (bug) reports before it elsewhere. I'd like for this to be a reminder that the issue never really was resolved but left lingering beginning with kernel version 2.6.28 (yes, that long ago). Specifically, HID_QUIRK_IGNORE_MOUSE existed in 2.6.27 and was dealt with in drivers/hid/usbhid/hid-core.c:730, thereby somehow fixing things. But those lines (and the symbol) disappeared after 2.6.27. Why were they removed? They weren't removed. The symbol was changed to APPLE_IGNORE_MOUSE and the implementation was moved to drivers/hid/hid-apple.c. To get the benefit, you have to enable CONFIG_HID_APPLE. Is there any chance for this problem to be fixed or am I really expected to downgrade that far just to have a working keyboard and trackpad? It should have been working all along if your kernel configuration was correct. 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: [PATCH] usb/isp1760: set IRQ flags properly
On Fri, Feb 27, 2015 at 04:48:39PM +0100, Valentin Rothberg wrote: On Fri, Feb 27, 2015 at 4:24 PM, Felipe Balbi ba...@ti.com wrote: On Fri, Feb 27, 2015 at 02:29:40PM +0100, Valentin Rothberg wrote: The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc (genirq: Run irq handlers with interrupts disabled) running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active. This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED. why is it redundant ? It's redundant in the call of isp1760_udc_register() as this function sets the flag by requesting the IRQ. I mistakenly removed it also in the call of isp1760_hcd_register() which does not alter the passed irqflags. I will fix this in a second version of this patch. I am sorry for this mistake. no problem, s**t happens ;) -- balbi signature.asc Description: Digital signature
[PATCH] usb: gadget: net2280: silence sparse warning
Silence the following warning: drivers/usb/gadget/udc/net2280.c:3176:33: warning: context imbalance in 'handle_stat1_irqs' - unexpected unlock Signed-off-by: Felipe Balbi ba...@ti.com --- drivers/usb/gadget/udc/net2280.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index 5041e218a302..9871b90195ad 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -3128,6 +3128,8 @@ next_endpoints: BIT(PCI_RETRY_ABORT_INTERRUPT)) static void handle_stat1_irqs(struct net2280 *dev, u32 stat) +__releases(dev-lock) +__acquires(dev-lock) { struct net2280_ep *ep; u32 tmp, num, mask, scratch; -- 2.3.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/isp1760: set IRQ flags properly
On Fri, Feb 27, 2015 at 02:29:40PM +0100, Valentin Rothberg wrote: The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc (genirq: Run irq handlers with interrupts disabled) running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active. This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED. why is it redundant ? -- balbi signature.asc Description: Digital signature
Re: [PATCH 3/4] usb: gadget: net2280: print error in ep_ops error paths
Hi, On Mon, Feb 02, 2015 at 10:55:25AM +0100, Mian Yousaf Kaukab wrote: @@ -465,13 +484,18 @@ static struct usb_request struct net2280_ep *ep; struct net2280_request *req; - if (!_ep) + if (!_ep) { + pr_err(%s: Invalid ep\n, __func__); return NULL; + } ep = container_of(_ep, struct net2280_ep, ep); req = kzalloc(sizeof(*req), gfp_flags); - if (!req) + if (!req) { + dev_err(ep-dev-pdev-dev, + %s: Unable to allocate memory for req\n, __func__); we don't really need this message. I'll drop it myself. -- balbi signature.asc Description: Digital signature
[PATCH 1/8 v4] ARM OMAP2+ GPMC: don't undef DEBUG
OMAP2+ GPMC driver undefines DEBUG, which makes it unnecessarily hard to turn DEBUG on. Remove the offending lines. Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 24696f5..5cabac8 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -12,8 +12,6 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#undef DEBUG - #include linux/irq.h #include linux/kernel.h #include linux/init.h -- 2.3.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 2/8] ARM OMAP2+ GPMC: add bus children
Hi Roger, On Fri, Feb 27, 2015 at 11:24 AM, Roger Quadros rog...@ti.com wrote: + /* is child a common bus? */ + if (of_match_node(of_default_bus_match_table, child)) + /* create children and other common bus children */ + if (of_platform_populate(child, of_default_bus_match_table, NULL, pdev-dev)) + goto err_child_fail; this would print failed to create gpmc child but we have already created the gpmc child in the first of_platform_device_create() call. A more appropriate message would be failed to populate all children of child-name Also do you want to return failure? it will result in of_node_put() of the child and another print message about probing gpmc child %s failed in gpmc_probe_dt(). IMO if the GPMC node's child was created fine then we shouldn't return error. As of_platform_populate _always_ return 0 no matter what, the only way to reach that message is if probing the child failed. As I cannot see into the future when of_platform_populate might actually be changed to return meaningful codes, we shouldn't try to foresee what the actual problem might be today either. This is a battle for another day. Regards, Robert -- 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/isp1760: set IRQ flags properly
On Fri, Feb 27, 2015 at 4:24 PM, Felipe Balbi ba...@ti.com wrote: On Fri, Feb 27, 2015 at 02:29:40PM +0100, Valentin Rothberg wrote: The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc (genirq: Run irq handlers with interrupts disabled) running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active. This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED. why is it redundant ? It's redundant in the call of isp1760_udc_register() as this function sets the flag by requesting the IRQ. I mistakenly removed it also in the call of isp1760_hcd_register() which does not alter the passed irqflags. I will fix this in a second version of this patch. I am sorry for this mistake. Valentin -- 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 0/8 v4] ARM OMAP2+ GPMC: fixes and bus children
These are the changes I proposed in these patch series: [1], [2], [3], [4] rebased to 3.19 as well as new changes for little bugs I noticed while preparing this patch series as well as changes introduced via comments. 1. DEBUG was undefined in source code -- remove offending lines 2. add capability to have busses as children of the GPMC and multiple devices on a bus. See [2] for an example DTS syntax. 3. debug output was unaligned -- align it 4. output for copy-pasting to DTS had erroneous timing outputs and made it hard to copy-paste -- correct timing values, add comments as DTS comments. 5. WAITMONITORINGTIME is expressed as GPMC_CLK cycles for all accesses. GPMCFCLKDIVIDER is used as a divider, so it must always be programmed. 6. GPMCFCLKDIVIDER is calculated according to WAITMONITORINGTIME for asynchronous accesses inside the driver -- asynchronous accesses now completely decoupled from gpmc,sync-clk-ps. 7. WAITMONITORINGTIME was being programmed/shown in GPMC_FCLK cycles instead of GPMC_CLK cycles -- add clock domain information where necessary. 8. Calculated values for WAITMONITORINGTIME and CLKACTIVATIONTIME that were outside the defined range would not raise an error. DEVICESIZE, ATTACHEDDEVICEPAGELENGTH, WAITMONITORINGTIME and CLKACTIVATIONTIME would not be marked as incorrect on DTS output. -- Fix all of these. [1]: https://lkml.org/lkml/2015/2/12/495 [2]: https://lkml.org/lkml/2015/2/16/337 [3]: https://lkml.org/lkml/2015/2/24/609 [4]: https://lkml.org/lkml/2015/2/26/387 Robert ABEL (9): ARM OMAP2+ GPMC: don't undef DEBUG ARM OMAP2+ GPMC: add bus children ARM OMAP2+ GPMC: fix debug output alignment ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS ARM OMAP2+ GPMC: always program GPMCFCLKDIVIDER ARM OMAP2+ GPMC: calculate GPMCFCLKDIVIDER based on WAITMONITORINGTIME ARM OMAP2+ GPMC: fix WAITMONITORINGTIME divider bug ARM OMAP2+ GPMC: fix programming/showing reserved timing parameters arch/arm/mach-omap2/gpmc-nand.c| 17 +- arch/arm/mach-omap2/gpmc-onenand.c | 4 +- arch/arm/mach-omap2/usb-tusb6010.c | 4 +- drivers/memory/Makefile| 2 + drivers/memory/omap-gpmc.c | 313 + include/linux/omap-gpmc.h | 2 +- 6 files changed, 265 insertions(+), 77 deletions(-) -- 2.3.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: USB driver support for high current charging
On Fri, Feb 27, 2015 at 08:48:40AM +, Schmid, Carsten wrote: I have had a look into the spec (USB PD), but it does not explicitly explain whether the negotiation is done in hardware (by dedicated charger chips) or driver software (which then assigns higher allowed current to the ports). We are planning for new devices to be designed, where we want to support charging smartphones etc. and we want to know if there has to be done something for this in the USB drivers, and from which kernel on the PD will be supported. Actually it seems that the negotiation is a job for the charger chips and they signal their state via GPIOs to CPU/SoC. How are the GPIOs defined? How is the CPU supposed to know where they are? Through ACPI? However, I think that the USB team should have an eye on the USB PD spec. and keep it in mind. The USB-IF has been actively hostile toward Linux and the Linux community, going out of their way to make things difficult for us, so keeping track of their new specifications is very low on my priority list. 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
[PATCH 2/8 v4] ARM OMAP2+ GPMC: add bus children
This patch adds support for spawning buses as children of the GPMC. Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 5cabac8..74a8c52 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -27,6 +27,7 @@ #include linux/of_address.h #include linux/of_mtd.h #include linux/of_device.h +#include linux/of_platform.h #include linux/omap-gpmc.h #include linux/mtd/nand.h #include linux/pm_runtime.h @@ -1800,8 +1801,20 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, gpmc_cs_enable_mem(cs); no_timings: - if (of_platform_device_create(child, NULL, pdev-dev)) - return 0; + + /* create platform device, NULL on error or when disabled */ + if (!of_platform_device_create(child, NULL, pdev-dev)) + goto err_child_fail; + + /* is child a common bus? */ + if (of_match_node(of_default_bus_match_table, child)) + /* create children and other common bus children */ + if (of_platform_populate(child, of_default_bus_match_table, NULL, pdev-dev)) + goto err_child_fail; + + return 0; + +err_child_fail: dev_err(pdev-dev, failed to create gpmc child %s\n, child-name); ret = -ENODEV; -- 2.3.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 8/8 v4] ARM OMAP2+ GPMC: fix programming/showing reserved timing parameters
GPMC_CONFIG1_i parameters CLKACTIVATIONTIME and WAITMONITORINGTIME have reserved values. Raise an error if calculated timings try to program reserved values. GPMC_CONFIG1_i ATTACHEDDEVICEPAGELENGTH and DEVICESIZE were already checked when parsing the DT. Explicitly comment invalid values on gpmc_cs_show_timings for -CLKACTIVATIONTIME -WAITMONITORINGTIME -DEVICESIZE -ATTACHEDDEVICEPAGELENGTH Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 68 ++ 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index d091065..750c655 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -135,7 +135,11 @@ #define GPMC_CONFIG1_WRITETYPE_ASYNC(0 27) #define GPMC_CONFIG1_WRITETYPE_SYNC (1 27) #define GPMC_CONFIG1_CLKACTIVATIONTIME(val) ((val 3) 25) +/** CLKACTIVATIONTIME Max Ticks */ +#define GPMC_CONFIG1_CLKACTIVATIONTIME_MAX 2 #define GPMC_CONFIG1_PAGE_LEN(val) ((val 3) 23) +/** ATTACHEDDEVICEPAGELENGTH Max Value */ +#define GPMC_CONFIG1_ATTACHEDDEVICEPAGELENGTH_MAX 2 #define GPMC_CONFIG1_WAIT_READ_MON (1 22) #define GPMC_CONFIG1_WAIT_WRITE_MON (1 21) #define GPMC_CONFIG1_WAIT_MON_TIME(val) ((val 3) 18) @@ -144,6 +148,8 @@ #define GPMC_CONFIG1_WAIT_PIN_SEL(val) ((val 3) 16) #define GPMC_CONFIG1_DEVICESIZE(val)((val 3) 12) #define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1) +/** DEVICESIZE Max Value */ +#define GPMC_CONFIG1_DEVICESIZE_MAX 1 #define GPMC_CONFIG1_DEVICETYPE(val)((val 3) 10) #define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0) #define GPMC_CONFIG1_MUXTYPE(val) ((val 3) 8) @@ -393,6 +399,8 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p) * @reg: GPMC_CS_CONFIGn register offset. * @st_bit: Start Bit * @end_bit: End Bit. Must be = @st_bit. + * @ma:x Maximum parameter value (before optional @shift). + * If 0, maximum is as high as @st_bit and @end_bit allow. * @name:DTS node name, w/o gpmc, * @cd: Clock Domain of timing parameter. * @shift: Parameter value left shifts @shift, which is then printed instead of value. @@ -400,13 +408,14 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p) * raw format: gpmc,name = value * tick format: gpmc,name = value /zwj;* x ns -- y ns; x ticks *zwj;/ * Where x ns -- y ns result in the same tick value. + * When @max is exceeded, invalid is printed inside comment. * @noval: Parameter values equal to 0 are not printed. * @return: Specified timing parameter (after optional @shift). * */ static int get_gpmc_timing_reg( /* timing specifiers */ - int cs, int reg, int st_bit, int end_bit, + int cs, int reg, int st_bit, int end_bit, int max, const char *name, const enum gpmc_clk_domain cd, /* value transform */ int shift, @@ -416,11 +425,15 @@ static int get_gpmc_timing_reg( u32 l; int nr_bits; int mask; + bool invalid; l = gpmc_cs_read_reg(cs, reg); nr_bits = end_bit - st_bit + 1; mask = (1 nr_bits) - 1; l = (l st_bit) mask; + if (!max) + max = mask; + invalid = l max; if (shift) l = (shift l); if (noval (l == 0)) @@ -433,11 +446,11 @@ static int get_gpmc_timing_reg( if (l) time_ns_min = gpmc_clk_ticks_to_ns(l - 1, cs, cd) + 1; time_ns = gpmc_clk_ticks_to_ns(l, cs, cd); - pr_info(gpmc,%s = %u /* %u ns - %u ns; %i ticks */\n, - name, time_ns, time_ns_min, time_ns, l); + pr_info(gpmc,%s = %u /* %u ns - %u ns; %i ticks%s*/\n, + name, time_ns, time_ns_min, time_ns, l, invalid ? ; invalid : ); } else { /* raw format */ - pr_info(gpmc,%s = %u\n, name, l); + pr_info(gpmc,%s = %u%s\n, name, l, invalid ? /* invalid */ : ); } return l; @@ -447,15 +460,19 @@ static int get_gpmc_timing_reg( pr_info(cs%i %s: 0x%08x\n, cs, #config, \ gpmc_cs_read_reg(cs, config)) #define GPMC_GET_RAW(reg, st, end, field) \ - get_gpmc_timing_reg(cs, (reg), (st), (end), field, GPMC_CD_FCLK, 0, 1, 0) + get_gpmc_timing_reg(cs, (reg), (st), (end), 0, field, GPMC_CD_FCLK, 0, 1, 0) +#define GPMC_GET_RAW_MAX(reg, st, end, max, field) \ + get_gpmc_timing_reg(cs, (reg), (st), (end), (max), field, GPMC_CD_FCLK, 0, 1, 0) #define GPMC_GET_RAW_BOOL(reg, st, end, field) \ - get_gpmc_timing_reg(cs, (reg), (st), (end), field, GPMC_CD_FCLK, 0, 1, 1) -#define GPMC_GET_RAW_SHIFT(reg, st, end, shift, field) \ - get_gpmc_timing_reg(cs, (reg), (st), (end), field, GPMC_CD_FCLK,
[PATCH 4/8 v4] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS
DTS output was formatted to require additional work when copy-pasting into DTS. Nano-second timings were replaced with interval of values that produce the same number of clock ticks. Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 38 -- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index dbb6753..432e638 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -337,32 +337,50 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p) } #ifdef DEBUG +/** + * get_gpmc_timing_reg - read a timing parameter and print DTS settings for it. + * @cs: Chip Select Region + * @reg: GPMC_CS_CONFIGn register offset. + * @st_bit: Start Bit + * @end_bit: End Bit. Must be = @st_bit. + * @name:DTS node name, w/o gpmc, + * @raw: Raw Format Option. + * raw format: gpmc,name = value + * tick format: gpmc,name = value /zwj;* x ns -- y ns; x ticks *zwj;/ + * Where x ns -- y ns result in the same tick value. + * @noval: Parameter values equal to 0 are not printed. + * @shift: Parameter value left shifts @shift, which is then printed instead of value. + * @return: Specified timing parameter (after optional @shift). + * + */ static int get_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, bool raw, bool noval, int shift, const char *name) { u32 l; - int nr_bits, max_value, mask; + int nr_bits; + int mask; l = gpmc_cs_read_reg(cs, reg); nr_bits = end_bit - st_bit + 1; - max_value = (1 nr_bits) - 1; - mask = max_value st_bit; - l = (l mask) st_bit; + mask = (1 nr_bits) - 1; + l = (l st_bit) mask; if (shift) l = (shift l); if (noval (l == 0)) return 0; if (!raw) { - unsigned int time_ns_min, time_ns, time_ns_max; + /* DTS tick format for timings in ns */ + unsigned int time_ns; + unsigned int time_ns_min = 0; - time_ns_min = gpmc_ticks_to_ns(l ? l - 1 : 0); + if (l) + time_ns_min = gpmc_ticks_to_ns(l - 1) + 1; time_ns = gpmc_ticks_to_ns(l); - time_ns_max = gpmc_ticks_to_ns(l + 1 max_value ? - max_value : l + 1); - pr_info(gpmc,%s = %u (%u - %u ns, %i ticks)\n, - name, time_ns, time_ns_min, time_ns_max, l); + pr_info(gpmc,%s = %u /* %u ns - %u ns; %i ticks */\n, + name, time_ns, time_ns_min, time_ns, l); } else { + /* raw format */ pr_info(gpmc,%s = %u\n, name, l); } -- 2.3.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 5/8 v4] ARM OMAP2+ GPMC: always program GPMCFCLKDIVIDER
The WAITMONITORINGTIME is expressed as a number of GPMC_CLK clock cycles, even though the access is defined as asynchronous, and no GPMC_CLK clock is provided to the external device. Still, GPMCFCLKDIVIDER is used as a divider for the GPMC clock, so it must be programmed to define the correct WAITMONITORINGTIME delay. Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 432e638..02e5228 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -499,7 +499,7 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, l = gpmc_cs_read_reg(cs, reg); #ifdef DEBUG - printk(KERN_INFO + pr_info( GPMC CS%d: %-17s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n, cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000, (l st_bit) mask, time); @@ -571,19 +571,14 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t) if (gpmc_capability GPMC_HAS_WR_ACCESS) GPMC_SET_ONE(GPMC_CS_CONFIG6, 24, 28, wr_access); - /* caller is expected to have initialized CONFIG1 to cover -* at least sync vs async -*/ l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); - if (l (GPMC_CONFIG1_READTYPE_SYNC | GPMC_CONFIG1_WRITETYPE_SYNC)) { #ifdef DEBUG - printk(KERN_INFO GPMC CS%d CLK period is %lu ns (div %d)\n, - cs, (div * gpmc_get_fclk_period()) / 1000, div); + pr_info(GPMC CS%d CLK period is %lu ns (div %d)\n, + cs, (div * gpmc_get_fclk_period()) / 1000, div); #endif - l = ~0x03; - l |= (div - 1); - gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, l); - } + l = ~0x03; + l |= (div - 1); + gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, l); gpmc_cs_bool_timings(cs, t-bool_timings); gpmc_cs_show_timings(cs, after gpmc_cs_set_timings); -- 2.3.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 6/8 v4] ARM OMAP2+ GPMC: calculate GPMCFCLKDIVIDER based on WAITMONITORINGTIME
The WAITMONITORINGTIME is expressed as a number of GPMC_CLK clock cycles, even though the access is defined as asynchronous, and no GPMC_CLK clock is provided to the external device. Still, GPMCFCLKDIVIDER is used as a divider for the GPMC clock, so it must be programmed to define the correct WAITMONITORINGTIME delay. Calculate GPMCFCLKDIVIDER independent of gpmc,sync-clk-ps in DT for pure asynchronous accesses, i.e. both read and write asynchronous. Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- arch/arm/mach-omap2/gpmc-nand.c| 17 arch/arm/mach-omap2/gpmc-onenand.c | 4 +- arch/arm/mach-omap2/usb-tusb6010.c | 4 +- drivers/memory/omap-gpmc.c | 85 ++ include/linux/omap-gpmc.h | 2 +- 5 files changed, 92 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index d5951b1..e863a59 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c @@ -96,14 +96,6 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, gpmc_nand_res[1].start = gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE); gpmc_nand_res[2].start = gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT); - if (gpmc_t) { - err = gpmc_cs_set_timings(gpmc_nand_data-cs, gpmc_t); - if (err 0) { - pr_err(omap2-gpmc: Unable to set gpmc timings: %d\n, err); - return err; - } - } - memset(s, 0, sizeof(struct gpmc_settings)); if (gpmc_nand_data-of_node) gpmc_read_settings_dt(gpmc_nand_data-of_node, s); @@ -111,6 +103,15 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data, gpmc_set_legacy(gpmc_nand_data, s); s.device_nand = true; + + if (gpmc_t) { + err = gpmc_cs_set_timings(gpmc_nand_data-cs, gpmc_t, s); + if (err 0) { + pr_err(omap2-gpmc: Unable to set gpmc timings: %d\n, err); + return err; + } + } + err = gpmc_cs_program_settings(gpmc_nand_data-cs, s); if (err 0) goto out_free_cs; diff --git a/arch/arm/mach-omap2/gpmc-onenand.c b/arch/arm/mach-omap2/gpmc-onenand.c index 53d197e..f899e77 100644 --- a/arch/arm/mach-omap2/gpmc-onenand.c +++ b/arch/arm/mach-omap2/gpmc-onenand.c @@ -293,7 +293,7 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base) if (ret 0) return ret; - ret = gpmc_cs_set_timings(gpmc_onenand_data-cs, t); + ret = gpmc_cs_set_timings(gpmc_onenand_data-cs, t, onenand_async); if (ret 0) return ret; @@ -331,7 +331,7 @@ static int omap2_onenand_setup_sync(void __iomem *onenand_base, int *freq_ptr) if (ret 0) return ret; - ret = gpmc_cs_set_timings(gpmc_onenand_data-cs, t); + ret = gpmc_cs_set_timings(gpmc_onenand_data-cs, t, onenand_sync); if (ret 0) return ret; diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c index 8333400..e554d9e 100644 --- a/arch/arm/mach-omap2/usb-tusb6010.c +++ b/arch/arm/mach-omap2/usb-tusb6010.c @@ -71,7 +71,7 @@ static int tusb_set_async_mode(unsigned sysclk_ps) gpmc_calc_timings(t, tusb_async, dev_t); - return gpmc_cs_set_timings(async_cs, t); + return gpmc_cs_set_timings(async_cs, t, tusb_async); } static int tusb_set_sync_mode(unsigned sysclk_ps) @@ -98,7 +98,7 @@ static int tusb_set_sync_mode(unsigned sysclk_ps) gpmc_calc_timings(t, tusb_sync, dev_t); - return gpmc_cs_set_timings(sync_cs, t); + return gpmc_cs_set_timings(sync_cs, t, tusb_sync); } /* tusb driver calls this when it changes the chip's clocking */ diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 02e5228..8ee335d 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -138,7 +138,9 @@ #define GPMC_CONFIG1_PAGE_LEN(val) ((val 3) 23) #define GPMC_CONFIG1_WAIT_READ_MON (1 22) #define GPMC_CONFIG1_WAIT_WRITE_MON (1 21) -#define GPMC_CONFIG1_WAIT_MON_IIME(val) ((val 3) 18) +#define GPMC_CONFIG1_WAIT_MON_TIME(val) ((val 3) 18) +/** WAITMONITORINGTIME Max Ticks */ +#define GPMC_CONFIG1_WAITMONITORINGTIME_MAX 2 #define GPMC_CONFIG1_WAIT_PIN_SEL(val) ((val 3) 16) #define GPMC_CONFIG1_DEVICESIZE(val)((val 3) 12) #define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1) @@ -516,13 +518,48 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, t-field, #field) 0) \ return -1 +/** + * gpmc_calc_waitmonitoring_divider - calculate proper GPMCFCLKDIVIDER based on WAITMONITORINGTIME + * WAITMONITORINGTIME will be _at least_ as long as desired, i.e. + * read -- don't sample bus
[PATCH 7/8 v4] ARM OMAP2+ GPMC: fix WAITMONITORINGTIME divider bug
The WAITMONITORINGTIME is expressed as a number of GPMC_CLK clock cycles, even though the access is defined as asynchronous, and no GPMC_CLK clock is provided to the external device. Still, GPMCFCLKDIVIDER is used as a divider for the GPMC clock, so it must be programmed to define the correct WAITMONITORINGTIME delay. This patch correctly computes WAITMONITORINGTIME in GPMC_CLK cycles instead of GPMC_FCLK cycles, both during programming (gpmc_cs_set_timings) and during retrieval (gpmc_cs_show_timings). Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 128 +++-- 1 file changed, 101 insertions(+), 27 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 8ee335d..d091065 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -170,6 +170,11 @@ */ #defineGPMC_NR_IRQ 2 +enum gpmc_clk_domain { + GPMC_CD_FCLK, + GPMC_CD_CLK +}; + struct gpmc_cs_data { const char *name; @@ -268,16 +273,54 @@ static unsigned long gpmc_get_fclk_period(void) return rate; } -static unsigned int gpmc_ns_to_ticks(unsigned int time_ns) +/** + * gpmc_get_clk_period - get period of selected clock domain in ps + * @cs Chip Select Region. + * @cd Clock Domain. + * + * GPMC_CS_CONFIG1 GPMCFCLKDIVIDER for cs has to be setup + * prior to calling this function with GPMC_CD_CLK. + */ +static unsigned long gpmc_get_clk_period(int cs, enum gpmc_clk_domain cd) +{ + + unsigned long tick_ps = gpmc_get_fclk_period(); + u32 l; + int div; + + switch (cd) { + case GPMC_CD_CLK: + /* get current clk divider */ + l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); + div = (l 0x03) + 1; + /* get GPMC_CLK period */ + tick_ps *= div; + break; + case GPMC_CD_FCLK: + /* FALL-THROUGH */ + default: + break; + } + + return tick_ps; + +} + +static unsigned int gpmc_ns_to_clk_ticks(unsigned int time_ns, int cs, enum gpmc_clk_domain cd) { unsigned long tick_ps; /* Calculate in picosecs to yield more exact results */ - tick_ps = gpmc_get_fclk_period(); + tick_ps = gpmc_get_clk_period(cs, cd); return (time_ns * 1000 + tick_ps - 1) / tick_ps; } +static unsigned int gpmc_ns_to_ticks(unsigned int time_ns) +{ + return gpmc_ns_to_clk_ticks(time_ns, /* any CS */ 0, GPMC_CD_FCLK); +} + static unsigned int gpmc_ps_to_ticks(unsigned int time_ps) { unsigned long tick_ps; @@ -288,9 +331,14 @@ static unsigned int gpmc_ps_to_ticks(unsigned int time_ps) return (time_ps + tick_ps - 1) / tick_ps; } +unsigned int gpmc_clk_ticks_to_ns(unsigned ticks, int cs, enum gpmc_clk_domain cd) +{ + return ticks * gpmc_get_clk_period(cs, cd) / 1000; +} + unsigned int gpmc_ticks_to_ns(unsigned int ticks) { - return ticks * gpmc_get_fclk_period() / 1000; + return gpmc_clk_ticks_to_ns(ticks, /* any CS */ 0, GPMC_CD_FCLK); } static unsigned int gpmc_ticks_to_ps(unsigned int ticks) @@ -346,18 +394,24 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p) * @st_bit: Start Bit * @end_bit: End Bit. Must be = @st_bit. * @name:DTS node name, w/o gpmc, + * @cd: Clock Domain of timing parameter. + * @shift: Parameter value left shifts @shift, which is then printed instead of value. * @raw: Raw Format Option. * raw format: gpmc,name = value * tick format: gpmc,name = value /zwj;* x ns -- y ns; x ticks *zwj;/ * Where x ns -- y ns result in the same tick value. * @noval: Parameter values equal to 0 are not printed. - * @shift: Parameter value left shifts @shift, which is then printed instead of value. * @return: Specified timing parameter (after optional @shift). * */ -static int get_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, - bool raw, bool noval, int shift, - const char *name) +static int get_gpmc_timing_reg( + /* timing specifiers */ + int cs, int reg, int st_bit, int end_bit, + const char *name, const enum gpmc_clk_domain cd, + /* value transform */ + int shift, + /* format specifiers */ + bool raw, bool noval) { u32 l; int nr_bits; @@ -377,8 +431,8 @@ static int get_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, unsigned int time_ns_min = 0; if (l) - time_ns_min = gpmc_ticks_to_ns(l - 1) + 1; - time_ns = gpmc_ticks_to_ns(l); + time_ns_min = gpmc_clk_ticks_to_ns(l - 1, cs, cd) + 1; + time_ns = gpmc_clk_ticks_to_ns(l, cs, cd); pr_info(gpmc,%s = %u /* %u ns - %u ns; %i ticks */\n,
[PATCH 3/8 v4] ARM OMAP2+ GPMC: fix debug output alignment
GPMC debug output is aligned to 10 characters for field names. However, some fields have bigger names, screwing up the alignment. Consequently, alignment was changed to longest field name (17 chars) for now. Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 74a8c52..dbb6753 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -482,7 +482,7 @@ static int set_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, l = gpmc_cs_read_reg(cs, reg); #ifdef DEBUG printk(KERN_INFO - GPMC CS%d: %-10s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n, + GPMC CS%d: %-17s: %3d ticks, %3lu ns (was %3i ticks) %3d ns\n, cs, name, ticks, gpmc_get_fclk_period() * ticks / 1000, (l st_bit) mask, time); #endif -- 2.3.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] hso: add missing spinlock grab when iterating the serial table
On Fri, Feb 27, 2015 at 7:44 PM, Aleksander Morgado aleksan...@aleksander.es wrote: Access to the 'serial_table' array needs to be protected by the spinlock. Signed-off-by: Aleksander Morgado aleksan...@aleksander.es --- drivers/net/usb/hso.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 3c8dfe5..4f6deff 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -607,19 +607,24 @@ static struct hso_serial *get_serial_by_shared_int_and_type( struct hso_shared_int *shared_int, int mux) { + struct hso_serial *serial = NULL; int i, port; + unsigned long flags; port = hso_mux_to_port(mux); + spin_lock_irqsave(serial_table_lock, flags); for (i = 0; i HSO_SERIAL_TTY_MINORS; i++) { if (serial_table[i] (dev2ser(serial_table[i])-shared_int == shared_int) ((serial_table[i]-port_spec HSO_PORT_MASK) == port)) { - return dev2ser(serial_table[i]); + serial = dev2ser(serial_table[i]); + break; } } + spin_unlock_irqrestore(serial_table_lock, flags); - return NULL; + return serial; } static struct hso_serial *get_serial_by_index(unsigned index) -- 2.3.1 Seems there are actually more places where this has to be done; I'll send an updated version of the patch. -- Aleksander https://aleksander.es -- 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 20/29] usb: gadget: composite: add req_match method to usb_function
Hi, On Fri, Feb 27, 2015 at 02:55:25PM -0600, Felipe Balbi wrote: On Mon, Feb 23, 2015 at 04:02:09PM +0100, Andrzej Pietrasiewicz wrote: Non-standard requests can encode the actual interface number in a non-standard way. For example composite_setup() assumes that it is w_index 0xFF, but the printer function encodes the interface number in a context-dependet way (either w_index or w_index 8). This can lead to such requests being directed to wrong functions. This patch adds req_match() method to usb_function. Its purpose is to verify that a given request can be handled by a given function. If any function within a configuration provides the method and it returns true, then it is assumed that the right function is found. If a function uses req_match(), it should try as hard as possible to determine if the request is meant for it. If no functions in a configuration provide req_match or none of them returns true, then fall back to the usual approach. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com this regresses testusb at least on am335x: test 14: control writes [ 32.968145] usbtest 2-1:3.0: TEST 14: 15000 ep0out, 1..256 vary 1 [ 32.974659] Unable to handle kernel paging request at virtual address 00400402 [ 32.982199] pgd = dd3fc000 [ 32.985021] [00400402] *pgd= [ 32.988765] Internal error: Oops: 8005 [#1] SMP ARM [ 32.994217] Modules linked in: usbtest usb_f_ss_lb g_zero libcomposite configfs musb_dsps musb_hdrc udc_core usbcore usb_common omap_rng rng_core musb_am335x rtc_omap omap_wdt leds_gpio led_class ipv6 autofs4 [ 33.013652] CPU: 0 PID: 219 Comm: testusb Tainted: GW 4.0.0-rc1-00069-g00b54e1bab53 #350 [ 33.023364] Hardware name: Generic AM33XX (Flattened Device Tree) [ 33.029722] task: dd27c680 ti: dd2c2000 task.ti: dd2c2000 [ 33.035358] PC is at 0x400402 [ 33.038499] LR is at composite_setup+0x29c/0x16f0 [libcomposite] [ 33.044767] pc : [00400402]lr : [bf166f34]psr: 200301b3 [ 33.044767] sp : dd2c3ad8 ip : bf179668 fp : 0040 [ 33.056747] r10: r9 : dd2c3b48 r8 : [ 33.062197] r7 : r6 : bf179690 r5 : bf17963c r4 : dd26f280 [ 33.069008] r3 : 00400403 r2 : bf179690 r1 : dd2c3b48 r0 : bf17963c [ 33.075821] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA Thumb Segment user [ 33.083538] Control: 10c5387d Table: 9d3fc019 DAC: 0015 [ 33.089533] Process testusb (pid: 219, stack limit = 0xdd2c2218) [ 33.095800] Stack: (0xdd2c3ad8 to 0xdd2c4000) [ 33.100346] 3ac0: 1f205000 [ 33.108883] 3ae0: c083c880 dfa41880 0100 dd2c3d6c 0003 [ 33.117419] 3b00: 0001 0001 c0064714 c08c3afb dd2c3b4e e1a26410 dd237010 bf12b014 [ 33.125956] 3b20: e1a26400 bf12b010 dd236304 dd236010 0001 bf125244 e1a26410 [ 33.134492] 3b40: 5b40 0100 39363831 dd2362f0 dd236010 bf12b008 [ 33.143029] 3b60: dd237010 dd2362ec 0099 bf120908 dd26eb80 de524010 [ 33.151565] 3b80: 0001 bf122dc8 0001 dd26eb80 0841 c08c3afb c070b44e dd236010 [ 33.160102] 3ba0: bf14f148 dd287650 dd2362f0 60030193 e1a28000 c08bd83c bf14e6bc [ 33.168639] 3bc0: bf14e5dc dd3e8600 dd284b20 00af c08bd828 [ 33.177175] 3be0: c08bd83c c0084c1c de111610 0004 dd284ac0 0010 dd284ac0 [ 33.185712] 3c00: dd284b20 c0841594 0001 de013000 01f4 c0084df8 [ 33.194248] 3c20: dd284ac0 00af c0841594 c0087a30 00af c0084304 c083ad30 c00845ac [ 33.202785] 3c40: dd2c3c78 c088db80 dd2c3c78 c08fffc0 0012 c0840100 c0008690 [ 33.211322] 3c60: c0574a80 c0308db8 40030013 dd2c3cac c0575cc0 dd2c3cf8 ffd0 [ 33.219858] 3c80: 99a4 c0572e28 dd2c3cc4 0002 c0840100 [ 33.228395] 3ca0: 01f4 dd2c3cc0 c0574a80 c0308db8 40030013 [ 33.236931] 3cc0: c073fa98 dd2c3dc4 c08d4c40 000e dd2c3d08 [ 33.245468] 3ce0: dd2c3d54 dd2c2000 [ 33.254004] 3d00: dd2c3d58 0002 c0572e28 73753d4d 0001 dd27c680 c0064714 [ 33.262541] 3d20: dd2c3d5c dd2c3d5c dd270030 dd26eb80 dd2c3d54 dd2c3d8c 1388 [ 33.271077] 3d40: 005b 0040 bf0a218c 00010001 dd2c3d20 [ 33.279614] 3d60: dd2c3d20 de497000 dd37c9c0 0100 de497000 bf0a22a0 [ 33.288150] 3d80: 8200 dd3811b0 dd2c3df0 0006 dd26e680 0100 de453800 [ 33.296687] 3da0: 0100 de497068 de497000 bf189434 [ 33.305223] 3dc0: de453800 0100 1388 dd2c3df0 0100 3a98 0001 dd26e680 [
Re: [PATCH 20/29] usb: gadget: composite: add req_match method to usb_function
On Mon, Feb 23, 2015 at 04:02:09PM +0100, Andrzej Pietrasiewicz wrote: Non-standard requests can encode the actual interface number in a non-standard way. For example composite_setup() assumes that it is w_index 0xFF, but the printer function encodes the interface number in a context-dependet way (either w_index or w_index 8). This can lead to such requests being directed to wrong functions. This patch adds req_match() method to usb_function. Its purpose is to verify that a given request can be handled by a given function. If any function within a configuration provides the method and it returns true, then it is assumed that the right function is found. If a function uses req_match(), it should try as hard as possible to determine if the request is meant for it. If no functions in a configuration provide req_match or none of them returns true, then fall back to the usual approach. Signed-off-by: Andrzej Pietrasiewicz andrze...@samsung.com this regresses testusb at least on am335x: test 14: control writes [ 32.968145] usbtest 2-1:3.0: TEST 14: 15000 ep0out, 1..256 vary 1 [ 32.974659] Unable to handle kernel paging request at virtual address 00400402 [ 32.982199] pgd = dd3fc000 [ 32.985021] [00400402] *pgd= [ 32.988765] Internal error: Oops: 8005 [#1] SMP ARM [ 32.994217] Modules linked in: usbtest usb_f_ss_lb g_zero libcomposite configfs musb_dsps musb_hdrc udc_core usbcore usb_common omap_rng rng_core musb_am335x rtc_omap omap_wdt leds_gpio led_class ipv6 autofs4 [ 33.013652] CPU: 0 PID: 219 Comm: testusb Tainted: GW 4.0.0-rc1-00069-g00b54e1bab53 #350 [ 33.023364] Hardware name: Generic AM33XX (Flattened Device Tree) [ 33.029722] task: dd27c680 ti: dd2c2000 task.ti: dd2c2000 [ 33.035358] PC is at 0x400402 [ 33.038499] LR is at composite_setup+0x29c/0x16f0 [libcomposite] [ 33.044767] pc : [00400402]lr : [bf166f34]psr: 200301b3 [ 33.044767] sp : dd2c3ad8 ip : bf179668 fp : 0040 [ 33.056747] r10: r9 : dd2c3b48 r8 : [ 33.062197] r7 : r6 : bf179690 r5 : bf17963c r4 : dd26f280 [ 33.069008] r3 : 00400403 r2 : bf179690 r1 : dd2c3b48 r0 : bf17963c [ 33.075821] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA Thumb Segment user [ 33.083538] Control: 10c5387d Table: 9d3fc019 DAC: 0015 [ 33.089533] Process testusb (pid: 219, stack limit = 0xdd2c2218) [ 33.095800] Stack: (0xdd2c3ad8 to 0xdd2c4000) [ 33.100346] 3ac0: 1f205000 [ 33.108883] 3ae0: c083c880 dfa41880 0100 dd2c3d6c 0003 [ 33.117419] 3b00: 0001 0001 c0064714 c08c3afb dd2c3b4e e1a26410 dd237010 bf12b014 [ 33.125956] 3b20: e1a26400 bf12b010 dd236304 dd236010 0001 bf125244 e1a26410 [ 33.134492] 3b40: 5b40 0100 39363831 dd2362f0 dd236010 bf12b008 [ 33.143029] 3b60: dd237010 dd2362ec 0099 bf120908 dd26eb80 de524010 [ 33.151565] 3b80: 0001 bf122dc8 0001 dd26eb80 0841 c08c3afb c070b44e dd236010 [ 33.160102] 3ba0: bf14f148 dd287650 dd2362f0 60030193 e1a28000 c08bd83c bf14e6bc [ 33.168639] 3bc0: bf14e5dc dd3e8600 dd284b20 00af c08bd828 [ 33.177175] 3be0: c08bd83c c0084c1c de111610 0004 dd284ac0 0010 dd284ac0 [ 33.185712] 3c00: dd284b20 c0841594 0001 de013000 01f4 c0084df8 [ 33.194248] 3c20: dd284ac0 00af c0841594 c0087a30 00af c0084304 c083ad30 c00845ac [ 33.202785] 3c40: dd2c3c78 c088db80 dd2c3c78 c08fffc0 0012 c0840100 c0008690 [ 33.211322] 3c60: c0574a80 c0308db8 40030013 dd2c3cac c0575cc0 dd2c3cf8 ffd0 [ 33.219858] 3c80: 99a4 c0572e28 dd2c3cc4 0002 c0840100 [ 33.228395] 3ca0: 01f4 dd2c3cc0 c0574a80 c0308db8 40030013 [ 33.236931] 3cc0: c073fa98 dd2c3dc4 c08d4c40 000e dd2c3d08 [ 33.245468] 3ce0: dd2c3d54 dd2c2000 [ 33.254004] 3d00: dd2c3d58 0002 c0572e28 73753d4d 0001 dd27c680 c0064714 [ 33.262541] 3d20: dd2c3d5c dd2c3d5c dd270030 dd26eb80 dd2c3d54 dd2c3d8c 1388 [ 33.271077] 3d40: 005b 0040 bf0a218c 00010001 dd2c3d20 [ 33.279614] 3d60: dd2c3d20 de497000 dd37c9c0 0100 de497000 bf0a22a0 [ 33.288150] 3d80: 8200 dd3811b0 dd2c3df0 0006 dd26e680 0100 de453800 [ 33.296687] 3da0: 0100 de497068 de497000 bf189434 [ 33.305223] 3dc0: de453800 0100 1388 dd2c3df0 0100 3a98 0001 dd26e680 [ 33.313760] 3de0: dd26e680 dd26e680 de497000 dd31d200 dd37c940 dd37c940 bf18e4b0 [ 33.322296] 3e00: de497068 bf18bde0 0001 de445ad0 ddb7bd48
Re: keyboard/trackpad combo unusable on MacBookPro4,1 with bcm5974.ko
Alan Stern stern@... writes: Specifically, HID_QUIRK_IGNORE_MOUSE existed in 2.6.27 and was dealt with in drivers/hid/usbhid/hid-core.c:730, thereby somehow fixing things. But those lines (and the symbol) disappeared after 2.6.27. Why were they removed? They weren't removed. The symbol was changed to APPLE_IGNORE_MOUSE and the implementation was moved to drivers/hid/hid-apple.c. To get the benefit, you have to enable CONFIG_HID_APPLE. … It should have been working all along if your kernel configuration was correct. $ uname -r 3.16.0-4-amd64 $ grep CONFIG_HID_APPLE /boot/config-3.16.0-4-amd64 CONFIG_HID_APPLE=m CONFIG_HID_APPLEIR=m $ lsmod | grep hid_apple hid_appleir12724 0 hid_apple 12596 0 hid 102264 4 hid_generic,usbhid,hid_appleir,hid_apple $ lsusb -d 05ac:0231 Bus 005 Device 020: ID 05ac:0231 Apple, Inc. Internal Keyboard/Trackpad \ (MacBook Pro 4,1) (ISO) Now, APPLE_IGNORE_MOUSE only appears in drivers/hid/hid-apple.c:28, where it is #define'd but never referenced, making it hard for me to see the connection. However, while looking for uses of USB_DEVICE_ID_APPLE_WELLSPRING2_ISO, I found hid_mouse_ignore_list defined in drivers/hid/hid-core.c:2358 and referenced after the switch statement in drivers/hid/hid-core.c:2482 as an argument to hid_match_id(), which is executed only if the device's type in question is of HID_TYPE_USBMOUSE. If I had to venture a guess here I'd say that that is never the case. Cheers, Christian
[PATCH 3/4] usb: musb: cppi41: exit early when tx fifo is empty
as soon as we find out tx fifo is empty, there's no need to break out of the loop just to have another branch to complete the transfer. We can just complete transfer and exit early. Signed-off-by: Felipe Balbi ba...@ti.com --- drivers/usb/musb/musb_cppi41.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index 73ac9835485d..4407f30d0b86 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -280,19 +280,15 @@ static void cppi41_dma_callback(void *private_data) do { empty = musb_is_tx_fifo_empty(hw_ep); - if (empty) - break; + if (empty) { + cppi41_trans_done(cppi41_channel); + goto out; + } wait--; if (!wait) break; udelay(1); } while (1); - - empty = musb_is_tx_fifo_empty(hw_ep); - if (empty) { - cppi41_trans_done(cppi41_channel); - goto out; - } } list_add_tail(cppi41_channel-tx_check, controller-early_tx_list); -- 2.3.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
commit ef11982dd7a657512c362242508bb4021e0d67b6 breaks musb
Hi Amit, commit ef11982dd7a657512c362242508bb4021e0d67b6 (Add support for interrupt EP) actually broke testusb for MUSB when MUSB is the gadget. The reason is that we're requesting an endpoint with a 64-byte FIFO, but later deciding to use the same endpoint with wMaxPacketSize set to 1024 and MUSB errors out because the endpoint was selected for 64-byte only. This only happens when trying to set alternate setting 2 and it's pretty easy to trigger. I'll be away next week, but I plan on continue to track this down after that, unless you beat me to it. cheers -- balbi signature.asc Description: Digital signature
Re: [PATCH] usb: plusb: Add support for National Instruments host-to-host cable
On 02/20, David Miller wrote: From: Ben Shelton ben.shel...@ni.com Date: Mon, 16 Feb 2015 13:47:06 -0600 The National Instruments USB Host-to-Host Cable is based on the Prolific PL-25A1 chipset. Add its VID/PID so the plusb driver will recognize it. Signed-off-by: Ben Shelton ben.shel...@ni.com Applied, thanks. Hi David, Is this something you think would go into stable as well? Thanks, Ben -- 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 2/4] usb: musb: cppi41: decrease indentation level
no functional changes, clean up only. Signed-off-by: Felipe Balbi ba...@ti.com --- drivers/usb/musb/musb_cppi41.c | 88 +- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index be84562d021b..73ac9835485d 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -225,10 +225,12 @@ static void cppi41_dma_callback(void *private_data) struct dma_channel *channel = private_data; struct cppi41_dma_channel *cppi41_channel = channel-private_data; struct musb_hw_ep *hw_ep = cppi41_channel-hw_ep; + struct cppi41_dma_controller *controller; struct musb *musb = hw_ep-musb; unsigned long flags; struct dma_tx_state txstate; u32 transferred; + int is_hs = 0; bool empty; spin_lock_irqsave(musb-lock, flags); @@ -251,58 +253,58 @@ static void cppi41_dma_callback(void *private_data) empty = musb_is_tx_fifo_empty(hw_ep); if (empty) { cppi41_trans_done(cppi41_channel); - } else { - struct cppi41_dma_controller *controller; - int is_hs = 0; - /* -* On AM335x it has been observed that the TX interrupt fires -* too early that means the TXFIFO is not yet empty but the DMA -* engine says that it is done with the transfer. We don't -* receive a FIFO empty interrupt so the only thing we can do is -* to poll for the bit. On HS it usually takes 2us, on FS around -* 110us - 150us depending on the transfer size. -* We spin on HS (no longer than than 25us and setup a timer on -* FS to check for the bit and complete the transfer. -*/ - controller = cppi41_channel-controller; + goto out; + } - if (is_host_active(musb)) { - if (musb-port1_status USB_PORT_STAT_HIGH_SPEED) - is_hs = 1; - } else { - if (musb-g.speed == USB_SPEED_HIGH) - is_hs = 1; - } - if (is_hs) { - unsigned wait = 25; - - do { - empty = musb_is_tx_fifo_empty(hw_ep); - if (empty) - break; - wait--; - if (!wait) - break; - udelay(1); - } while (1); + /* +* On AM335x it has been observed that the TX interrupt fires +* too early that means the TXFIFO is not yet empty but the DMA +* engine says that it is done with the transfer. We don't +* receive a FIFO empty interrupt so the only thing we can do is +* to poll for the bit. On HS it usually takes 2us, on FS around +* 110us - 150us depending on the transfer size. +* We spin on HS (no longer than than 25us and setup a timer on +* FS to check for the bit and complete the transfer. +*/ + controller = cppi41_channel-controller; + + if (is_host_active(musb)) { + if (musb-port1_status USB_PORT_STAT_HIGH_SPEED) + is_hs = 1; + } else { + if (musb-g.speed == USB_SPEED_HIGH) + is_hs = 1; + } + if (is_hs) { + unsigned wait = 25; + do { empty = musb_is_tx_fifo_empty(hw_ep); - if (empty) { - cppi41_trans_done(cppi41_channel); - goto out; - } + if (empty) + break; + wait--; + if (!wait) + break; + udelay(1); + } while (1); + + empty = musb_is_tx_fifo_empty(hw_ep); + if (empty) { + cppi41_trans_done(cppi41_channel); + goto out; } - list_add_tail(cppi41_channel-tx_check, - controller-early_tx_list); - if (!hrtimer_is_queued(controller-early_tx)) { - unsigned long usecs = cppi41_channel-total_len / 10; + } + list_add_tail(cppi41_channel-tx_check, + controller-early_tx_list); + if (!hrtimer_is_queued(controller-early_tx)) { + unsigned long usecs = cppi41_channel-total_len / 10; - hrtimer_start_range_ns(controller-early_tx, + hrtimer_start_range_ns(controller-early_tx,
[PATCH 1/4] usb: gadget: net2280: silence sparse warning
Silence the following warning: drivers/usb/gadget/udc/net2280.c:3176:33: warning: context imbalance in 'handle_stat1_irqs' - unexpected unlock Signed-off-by: Felipe Balbi ba...@ti.com --- drivers/usb/gadget/udc/net2280.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index 5041e218a302..9871b90195ad 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -3128,6 +3128,8 @@ next_endpoints: BIT(PCI_RETRY_ABORT_INTERRUPT)) static void handle_stat1_irqs(struct net2280 *dev, u32 stat) +__releases(dev-lock) +__acquires(dev-lock) { struct net2280_ep *ep; u32 tmp, num, mask, scratch; -- 2.3.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 4/4] usb: musb: cppi41: do not call udelay()
according to comment in code, HS completion will happen pretty fast, instead of using udelay(), let's just busy loop and drop a cpu_relax() where udelay() was. Signed-off-by: Felipe Balbi ba...@ti.com --- drivers/usb/musb/musb_cppi41.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index 4407f30d0b86..9dc45a4a9fa8 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -287,7 +287,7 @@ static void cppi41_dma_callback(void *private_data) wait--; if (!wait) break; - udelay(1); + cpu_relax(); } while (1); } list_add_tail(cppi41_channel-tx_check, -- 2.3.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] net: asix: add support for the Sitecom LN-028 USB adapter
From: Luca Ceresoli l...@lucaceresoli.net Date: Thu, 26 Feb 2015 00:58:12 +0100 Just another AX88178-based 10/100/1000 USB-to-Ethernet dongle. This one shows up in lsusb as: Sitecom Europe B.V. LN-028 Network USB 2.0 Adapter. Signed-off-by: Luca Ceresoli l...@lucaceresoli.net Applied, thanks. -- 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 00/22] usb: musb: the big MUSB patch bomb
Felipe, On Thu, Feb 26, 2015 at 2:53 PM, Felipe Balbi ba...@ti.com wrote: Hi folks, this is v3 of my patchset which has been in discussion with Bin Liu (hey, thanks). Thanks for clean this up. Dropping reset from the babble handling has been on my TODO for a long time, but never got a chance to do it. patches have been tested with AM335x BBB using g_zero and g_mass_storage. My BBB, for whatever reason, always causes babble when I connect the peripheral port to the host port on the same board. So that was a great platform for testing this patchset. I can see that after babble recovery runs, we drop the session, tell usbcore about it and restart the session, which causes g_zero to enumerate. If, after that, I drop g_zero and plug a mass storage pendrive or load g_mass_storage on the peripheral port, everything works fine. I tested it on AM335x GP EVM, babble recovery seems working fine. Please feel free to add me to 'Tested-by', or 'Reviewed-by', or 'Signed-off-by', or whatever on patch #16, 17, 19, and 22. I really don't know the meaning among them in kernel anyway... Thanks, -Bin. cheers Felipe Balbi (22): usb: musb: core: remove unnecessary logical comparison usb: musb: core: add missing curly braces usb: musb: core: fix highspeed check usb: musb: dsps: return error code if reset fails usb: musb: core: move babble recovery inside babble check usb: musb: core: break long line usb: musb: core: remove unnecessary reg access from resume IRQ usb: musb: core: there is no connect interrupt in peripheral mode usb: musb: dsps: remove babble check from dsps irq handler usb: musb: dsps: check for the single bit usb: musb: core: controller drops session automatically usb: musb: dsps: add dsps_ prefix to sw_babble_control usb: musb: core: refactor IRQ enable/disable to separate functions usb: musb: don't touch devctl from babble recovery usb: musb: core: decrease delayed_work time usb: musb: dsps: do not reset musb on babble usb: musb: core: simplify musb_recover_work() usb: musb: rename -reset() to -recover() usb: musb: core: drop recover_work usb: musb: core: remove unnecessary forward declaration usb: musb: core: disable irqs inside babble recovery usb: musb: core: always try to recover from babble drivers/usb/musb/musb_core.c | 132 +-- drivers/usb/musb/musb_core.h | 14 ++--- drivers/usb/musb/musb_dsps.c | 49 +++- 3 files changed, 78 insertions(+), 117 deletions(-) -- 2.3.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 -- 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 00/22] usb: musb: the big MUSB patch bomb
On Fri, Feb 27, 2015 at 03:22:11PM -0600, Bin Liu wrote: Felipe, On Thu, Feb 26, 2015 at 2:53 PM, Felipe Balbi ba...@ti.com wrote: Hi folks, this is v3 of my patchset which has been in discussion with Bin Liu (hey, thanks). Thanks for clean this up. Dropping reset from the babble handling has been on my TODO for a long time, but never got a chance to do it. patches have been tested with AM335x BBB using g_zero and g_mass_storage. My BBB, for whatever reason, always causes babble when I connect the peripheral port to the host port on the same board. So that was a great platform for testing this patchset. I can see that after babble recovery runs, we drop the session, tell usbcore about it and restart the session, which causes g_zero to enumerate. If, after that, I drop g_zero and plug a mass storage pendrive or load g_mass_storage on the peripheral port, everything works fine. I tested it on AM335x GP EVM, babble recovery seems working fine. Please feel free to add me to 'Tested-by', or 'Reviewed-by', or 'Signed-off-by', or whatever on patch #16, 17, 19, and 22. I really don't know the meaning among them in kernel anyway... well, since you tested the whole series, I'll add Tested-by to the entire series, thanks. -- balbi signature.asc Description: Digital signature
Re: [RFC][PATCH] usbnet: Fix tx_bytes statistic running backward in cdc_ncm
Ben Hutchings ben.hutchi...@codethink.co.uk writes: cdc_ncm disagrees with usbnet about how much framing overhead should be counted in the tx_bytes statistics, and tries 'fix' this by decrementing tx_bytes on the transmit path. But statistics must never be decremented except due to roll-over; this will thoroughly confuse user-space. Also, tx_bytes is only incremented by usbnet in the completion path. Fix this by requiring drivers that set FLAG_MULTI_FRAME to set a tx_bytes delta along with the tx_packets count. Signed-off-by: Ben Hutchings ben.hutchi...@codethink.co.uk --- I noticed this bug while trying to fix the tx_packets statistic in asix. It depends on the patch I just sent for that. I don't have any hardware to test this with, or any need to make it work. If you want this fix, please test and re-submit it yoursef. I tested this on an MBIM device, and it worked perfectly as-is. Please submit it without the RFC prefix. This fixes a real and reported problem with the cdc_ncm driver, so I'd claim it's net material along with a stable Cc and Fixes: beeecd42c3b4 (net: cdc_ncm/cdc_mbim: adding NCM protocol statistics) But you and David decide that, of course... Fixing this was actually on my TODO-list after a recent report showing one of the problems with the previous hack: The decremented tx_bytes counter was never corrected if the URB transmission failed, possibly ending up with a negative (i.e. very large since it is unsigned) tx_bytes counter. Thanks a lot. I didn't know how to do this without introducing a new callback or something. Your solutions is very nice, and so obvious when I see it. Just brilliant :-) Tested-by: Bjørn Mork bj...@mork.no And you might also want (if this is OK for Sami): Reported-by: Sami Farin hvtaifwkbgefb...@gmail.com Sami wrote: I have this USB ID 12d1:157d, Sonera Opengate LTE. It says all is okay but no packets are moving. .. ifconfig wwp3s0u1c2: flags=4291UP,BROADCAST,RUNNING,NOARP,MULTICAST mtu 1500 inet 46.132.188.224 netmask 255.255.255.192 broadcast 46.132.188.255 inet6 fe80:: prefixlen 64 scopeid 0x20link ether 32:35:3a:64:2e:25 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 17764 dropped 0 overruns 0 frame 0 TX packets 6714 bytes 18446744073709268911 (1638.3 PiB) TX errors 1427 dropped 0 overruns 0 carrier 0 collisions 0 Bjørn -- 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: [RFC][PATCH] usbnet: Fix tx_bytes statistic running backward in cdc_ncm
On Fri, 2015-02-27 at 10:12 +0100, Bjørn Mork wrote: Ben Hutchings ben.hutchi...@codethink.co.uk writes: cdc_ncm disagrees with usbnet about how much framing overhead should be counted in the tx_bytes statistics, and tries 'fix' this by decrementing tx_bytes on the transmit path. But statistics must never be decremented except due to roll-over; this will thoroughly confuse user-space. Also, tx_bytes is only incremented by usbnet in the completion path. Fix this by requiring drivers that set FLAG_MULTI_FRAME to set a tx_bytes delta along with the tx_packets count. Signed-off-by: Ben Hutchings ben.hutchi...@codethink.co.uk --- I noticed this bug while trying to fix the tx_packets statistic in asix. It depends on the patch I just sent for that. I don't have any hardware to test this with, or any need to make it work. If you want this fix, please test and re-submit it yoursef. I tested this on an MBIM device, and it worked perfectly as-is. Please submit it without the RFC prefix. This fixes a real and reported problem with the cdc_ncm driver, so I'd claim it's net material along with a stable Cc and Fixes: beeecd42c3b4 (net: cdc_ncm/cdc_mbim: adding NCM protocol statistics) But you and David decide that, of course... Fixing this was actually on my TODO-list after a recent report showing one of the problems with the previous hack: The decremented tx_bytes counter was never corrected if the URB transmission failed, possibly ending up with a negative (i.e. very large since it is unsigned) tx_bytes counter. Thanks a lot. I didn't know how to do this without introducing a new callback or something. Your solutions is very nice, and so obvious when I see it. Just brilliant :-) Tested-by: Bjørn Mork bj...@mork.no And you might also want (if this is OK for Sami): Reported-by: Sami Farin hvtaifwkbgefb...@gmail.com Acked-by: Oliver Neukum oli...@neukum.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: USB driver support for high current charging
I have had a look into the spec (USB PD), but it does not explicitly explain whether the negotiation is done in hardware (by dedicated charger chips) or driver software (which then assigns higher allowed current to the ports). We are planning for new devices to be designed, where we want to support charging smartphones etc. and we want to know if there has to be done something for this in the USB drivers, and from which kernel on the PD will be supported. Actually it seems that the negotiation is a job for the charger chips and they signal their state via GPIOs to CPU/SoC. However, I think that the USB team should have an eye on the USB PD spec. and keep it in mind. Thanks, Carsten XS Embedded GmbH Peterzeller Straße 8 D-78048 Villingen - Schwenningen Telefon +49 (7721) 4060 - 442 Fax +49 (7721) 4060 - 499 www.xse.de carsten_sch...@mentor.com :: based.on.visions :: XS Embedded GmbH Geschäftsführung: Dean Freed, Walter Vermijs, Shannon Wetzel Handelsregister: Amtsgericht Freiburg i.Br., HRB 705237 Sitz der Gesellschaft: Peterzeller Straße 8, 78048 Villingen-Schwenningen USt-Id Nummer: DE268786819 Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -Original Message- From: Greg KH [mailto:gre...@linuxfoundation.org] Sent: Mittwoch, 25. Februar 2015 16:45 To: Schmid, Carsten Cc: linux-usb@vger.kernel.org Subject: Re: USB driver support for high current charging On Wed, Feb 25, 2015 at 08:39:49AM +, Schmid, Carsten wrote: Hello, there is a spec from USB regarding high current charging (on top of USB3.0). Do you know if there is any driver support required, and if so, when will this be available with Linux? I think the spec will answer the is any driver support required question, right? Have you looked at it? Do you have hardware with this feature that needs Linux support? 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 net-next] usbnet: Fix tx_packets stat for FLAG_MULTI_FRAME drivers
Ben Hutchings ben.hutchi...@codethink.co.uk writes: Currently the usbnet core does not update the tx_packets statistic for drivers with FLAG_MULTI_PACKET and there is no hook in the TX completion path where they could do this. cdc_ncm and dependent drivers are bumping tx_packets stat on the transmit path while asix and sr9800 aren't updating it at all. Add a packet count in struct skb_data so these drivers can fill it in, initialise it to 1 for other drivers, and add the packet count to the tx_packets statistic on completion. Signed-off-by: Ben Hutchings ben.hutchi...@codethink.co.uk --- I have only tested the asix driver after this change; I think cdc_ncm and one of the non-multi-packet drivers should also be tested before it's applied. Looks very good to me. I did a quick test with an MBIM device (the cdc_mbim driver uses the parts of cdc_ncm you modify here), and it worked as expected. Thanks for doing this. My only complaint was a wishlist for a similar byte fixup, but then I noticed that you already did that :-) Tested-by: Bjørn Mork bj...@mork.no Bjørn -- 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, RESEND] usb: musb: fix Kconfig regression
Hi, On Sat, Feb 28, 2015 at 12:19:41AM +0100, Arnd Bergmann wrote: A recent bug fix I did that was marked for stable backports introduced a slightly wrong dependency on CONFIG_OMAP_CONTROL_PHY. I was missing the fact that the PHY driver already stubs out the omap_control_usb_set_mode, and we only need to add a dependency to prevent the musb-omap2430 driver from being built-in when the phy driver is a loadable module, but we should not prevent it from being built altogether when the phy driver is disabled. Signed-off-by: Arnd Bergmann a...@arndb.de Fixes: ca784be36cc725 (usb: start using the control module driver) Acked-by: Acked-by: Pavel Machek pa...@ucw.cz Cc: sta...@vger.kernel.org # v3.9+ This patch allows me to disable redundant CONFIG_OMAP_CONTROL_PHY from 4.0-rc1 .config and still get a working USB on Nokia N9. So: Tested-by: Aaro Koskinen aaro.koski...@iki.fi Thanks, A. -- 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, RESEND] usb: musb: fix Kconfig regression
A recent bug fix I did that was marked for stable backports introduced a slightly wrong dependency on CONFIG_OMAP_CONTROL_PHY. I was missing the fact that the PHY driver already stubs out the omap_control_usb_set_mode, and we only need to add a dependency to prevent the musb-omap2430 driver from being built-in when the phy driver is a loadable module, but we should not prevent it from being built altogether when the phy driver is disabled. Signed-off-by: Arnd Bergmann a...@arndb.de Fixes: ca784be36cc725 (usb: start using the control module driver) Acked-by: Acked-by: Pavel Machek pa...@ucw.cz Cc: sta...@vger.kernel.org # v3.9+ --- Same patch as first time, now with correct recipient and with Pavel's Ack added. diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index 14e1628483d9..39db8b603627 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig @@ -79,7 +79,8 @@ config USB_MUSB_TUSB6010 config USB_MUSB_OMAP2PLUS tristate OMAP2430 and onwards - depends on ARCH_OMAP2PLUS USB OMAP_CONTROL_PHY + depends on ARCH_OMAP2PLUS USB + depends on OMAP_CONTROL_PHY || !OMAP_CONTROL_PHY select GENERIC_PHY config USB_MUSB_AM35X -- 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 4/8] ARM OMAP2+ GPMC: change get_gpmc_timing_reg output for DTS
Robert, On 26/02/15 16:45, Robert ABEL wrote: DTS output was formatted to require additional work when copy-pasting into DTS. Nano-second timings were replaced with interval of values that produce the same number of clock ticks. Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index dbb6753..9340e7a 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -337,32 +337,49 @@ static void gpmc_cs_bool_timings(int cs, const struct gpmc_bool_timings *p) } #ifdef DEBUG +/** + * get_gpmc_timing_reg - read a timing parameter and print DTS settings for it. + * @cs Chip Select Region + * @reg GPMC_CS_CONFIGn register offset. + * @st_bit Start Bit + * @end_bit End Bit. Must be = @st_bit. + * @nameDTS node name, w/o gpmc, + * @raw Raw Format Option. + * raw format: gpmc,name = value + * tick format: gpmc,name = value /zwj;*(x ns -- y ns]; x ticks *zwj;/ + * Where (x ns -- y ns] is the half-open interval from x ns to y ns that + * result in the same tick value. + * @noval Parameter values equal to 0 are not printed. + * @shift Parameter value left shifts @shift, which is then printed instead of value. + * + */ static int get_gpmc_timing_reg(int cs, int reg, int st_bit, int end_bit, bool raw, bool noval, int shift, const char *name) { u32 l; - int nr_bits, max_value, mask; + int nr_bits; + int mask; l = gpmc_cs_read_reg(cs, reg); nr_bits = end_bit - st_bit + 1; - max_value = (1 nr_bits) - 1; - mask = max_value st_bit; - l = (l mask) st_bit; + mask = (1 nr_bits) - 1; + l = (l st_bit) mask; if (shift) l = (shift l); if (noval (l == 0)) return 0; if (!raw) { - unsigned int time_ns_min, time_ns, time_ns_max; + /* DTS tick format for timings in ns */ + unsigned int time_ns; + unsigned int time_ns_min; time_ns_min = gpmc_ticks_to_ns(l ? l - 1 : 0); should be time_ns_min = l ? gpmc_ticks_to_ns(l - 1) + 1 : 0; + 1ns since we don't want to fall into the previous tick bracket. for l == 0 we have t_min as 0. no need to pass it through gpmc_ticks_to_ns() or add 1 ns. time_ns = gpmc_ticks_to_ns(l); - time_ns_max = gpmc_ticks_to_ns(l + 1 max_value ? -max_value : l + 1); - pr_info(gpmc,%s = %u (%u - %u ns, %i ticks)\n, - name, time_ns, time_ns_min, time_ns_max, l); + pr_info(gpmc,%s = %u /* (%u ns - %u ns]; %i ticks */\n, + name, time_ns, time_ns_min, time_ns, l); } else { + /* raw format */ pr_info(gpmc,%s = %u\n, name, l); } cheers, -roger -- 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/8] ARM OMAP2+ GPMC: add bus children
Hi Robert, On 26/02/15 16:45, Robert ABEL wrote: This patch adds support for spawning buses as children of the GPMC. Signed-off-by: Robert ABEL ra...@cit-ec.uni-bielefeld.de --- drivers/memory/omap-gpmc.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 5cabac8..74a8c52 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -27,6 +27,7 @@ #include linux/of_address.h #include linux/of_mtd.h #include linux/of_device.h +#include linux/of_platform.h #include linux/omap-gpmc.h #include linux/mtd/nand.h #include linux/pm_runtime.h @@ -1800,8 +1801,20 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, gpmc_cs_enable_mem(cs); no_timings: - if (of_platform_device_create(child, NULL, pdev-dev)) - return 0; + + /* create platform device, NULL on error or when disabled */ + if (!of_platform_device_create(child, NULL, pdev-dev)) + goto err_child_fail; + + /* is child a common bus? */ + if (of_match_node(of_default_bus_match_table, child)) + /* create children and other common bus children */ + if (of_platform_populate(child, of_default_bus_match_table, NULL, pdev-dev)) + goto err_child_fail; this would print failed to create gpmc child but we have already created the gpmc child in the first of_platform_device_create() call. A more appropriate message would be failed to populate all children of child-name Also do you want to return failure? it will result in of_node_put() of the child and another print message about probing gpmc child %s failed in gpmc_probe_dt(). IMO if the GPMC node's child was created fine then we shouldn't return error. + + return 0; + +err_child_fail: dev_err(pdev-dev, failed to create gpmc child %s\n, child-name); ret = -ENODEV; cheers, -roger -- 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: plusb: Add support for National Instruments host-to-host cable
From: Ben Shelton ben.shel...@ni.com Date: Fri, 27 Feb 2015 15:26:32 -0600 On 02/20, David Miller wrote: From: Ben Shelton ben.shel...@ni.com Date: Mon, 16 Feb 2015 13:47:06 -0600 The National Instruments USB Host-to-Host Cable is based on the Prolific PL-25A1 chipset. Add its VID/PID so the plusb driver will recognize it. Signed-off-by: Ben Shelton ben.shel...@ni.com Applied, thanks. Hi David, Is this something you think would go into stable as well? I'm ambivalent. -- 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