[PATCH] usb: dwc3: pci: add support for BayTrail
Add PCI id for Intel BayTrail. Signed-off-by: Heikki Krogerus heikki.kroge...@linux.intel.com --- drivers/usb/dwc3/dwc3-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 9b13812..997ebe4 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -28,6 +28,7 @@ /* FIXME define these in linux/pci_ids.h */ #define PCI_VENDOR_ID_SYNOPSYS 0x16c3 #define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB30xabcd +#define PCI_DEVICE_ID_INTEL_BYT0x0f37 struct dwc3_pci { struct device *dev; @@ -187,6 +188,7 @@ static DEFINE_PCI_DEVICE_TABLE(dwc3_pci_id_table) = { PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3), }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), }, { }/* Terminating Entry */ }; MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table); -- 1.8.4.rc3 -- 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] USBNET: fix handling padding packet
Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG if the usb host controller is capable of building packet from discontinuous buffers, but missed handling padding packet when building DMA SG. This patch attachs the pre-allocated padding packet at the end of the sg list, so padding packet can be sent to device if drivers require that. Reported-by: David Laight david.lai...@aculab.com Cc: Oliver Neukum oli...@neukum.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/usbnet.c | 27 +-- include/linux/usb/usbnet.h |1 + 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 7b331e6..4a9bed3 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1241,7 +1241,9 @@ static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) if (num_sgs == 1) return 0; - urb-sg = kmalloc(num_sgs * sizeof(struct scatterlist), GFP_ATOMIC); + /* reserve one for zero packet */ + urb-sg = kmalloc((num_sgs + 1) * sizeof(struct scatterlist), + GFP_ATOMIC); if (!urb-sg) return -ENOMEM; @@ -1305,7 +1307,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, if (build_dma_sg(skb, urb) 0) goto drop; } - entry-length = length = urb-transfer_buffer_length; + length = urb-transfer_buffer_length; /* don't assume the hardware handles USB_ZERO_PACKET * NOTE: strictly conforming cdc-ether devices should expect @@ -1317,15 +1319,18 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, if (length % dev-maxpacket == 0) { if (!(info-flags FLAG_SEND_ZLP)) { if (!(info-flags FLAG_MULTI_PACKET)) { - urb-transfer_buffer_length++; - if (skb_tailroom(skb)) { + length++; + if (skb_tailroom(skb) !dev-can_dma_sg) { skb-data[skb-len] = 0; __skb_put(skb, 1); - } + } else if (dev-can_dma_sg) + sg_set_buf(urb-sg[urb-num_sgs++], + dev-padding_pkt, 1); } } else urb-transfer_flags |= URB_ZERO_PACKET; } + entry-length = urb-transfer_buffer_length = length; spin_lock_irqsave(dev-txq.lock, flags); retval = usb_autopm_get_interface_async(dev-intf); @@ -1509,6 +1514,7 @@ void usbnet_disconnect (struct usb_interface *intf) usb_kill_urb(dev-interrupt); usb_free_urb(dev-interrupt); + kfree(dev-padding_pkt); free_netdev(net); } @@ -1679,9 +1685,16 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) /* initialize max rx_qlen and tx_qlen */ usbnet_update_max_qlen(dev); + if (dev-can_dma_sg !(info-flags FLAG_SEND_ZLP) + !(info-flags FLAG_MULTI_PACKET)) { + dev-padding_pkt = kzalloc(1, GFP_KERNEL); + if (!dev-padding_pkt) + goto out4; + } + status = register_netdev (net); if (status) - goto out4; + goto out5; netif_info(dev, probe, dev-net, register '%s' at usb-%s-%s, %s, %pM\n, udev-dev.driver-name, @@ -1699,6 +1712,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) return 0; +out5: + kfree(dev-padding_pkt); out4: usb_free_urb(dev-interrupt); out3: diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 9cb2fe8..e303eef 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h @@ -42,6 +42,7 @@ struct usbnet { struct usb_host_endpoint *status; unsignedmaxpacket; struct timer_list delay; + const char *padding_pkt; /* protocol/interface state */ struct net_device *net; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v1 1/1] usb: gadget: f_fs: Add support for SuperSpeed Mode
On 9/17/2013 6:15 AM, Jack Pham wrote: Hi Manu, An intern working with us here (thanks Peter!) found a bug. On Mon, Sep 16, 2013 at 03:10:14PM +0530, Manu Gautam wrote: @@ -1569,7 +1573,20 @@ static int ffs_func_eps_enable(struct ffs_function *func) spin_lock_irqsave(func-ffs-eps_lock, flags); do { struct usb_endpoint_descriptor *ds; - ds = ep-descs[ep-descs[1] ? 1 : 0]; + int desc_idx; + + if (ffs-gadget-speed == USB_SPEED_SUPER) + desc_idx = 2; + if (ffs-gadget-speed == USB_SPEED_HIGH) This should be else if, otherwise if the gadget is superspeed, it will fall through to the full speed case below and desc_idx will be set to 0, resulting in FS descriptors being used instead. Thanks. I will fix this in my next patch. + desc_idx = 1; + else + desc_idx = 0; + + ds = ep-descs[desc_idx] -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed
On Tuesday 17 September 2013 17:48:59 you wrote: On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: More power supply drivers depends on vbus events and without it they not working. Power supply drivers using usb_register_notifier, so to deliver events it is needed to call atomic_notifier_call_chain. So without atomic notifier power supply driver isp1704 not retrieving vbus status and reporting bogus values to userspace and also to board platform data functions. Without proper data charger drivers trying to charge battery also when charger is disconnected or do not start charging when wallcharger connects. Atomic notifier in musb driver was used before v3.5 and was replaced with omap mailbox. This patch adding atomic_notifier_call_chain call from function omap_musb_set_mailbox. Signed-off-by: Pali Rohár pali.ro...@gmail.com --- drivers/usb/musb/omap2430.c |3 +++ drivers/usb/phy/phy-twl4030-usb.c |2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index f44e8b5..5c40252 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -305,6 +305,9 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) default: dev_dbg(dev, ID float\n); } + + atomic_notifier_call_chain(musb-xceiv-notifier, + musb-xceiv-last_event, NULL); let's add a wrapper for this: static inline int usb_phy_notify(struct usb phy *x, unsigned val, void *v) { return atomic_notifier_call_chain(x-notifier, val, v); } Where to add this wrapper? To omap2430.c? or some include file? On Tuesday 17 September 2013 17:49:17 Felipe Balbi wrote: On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 8f78d2d..efe6155 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c @@ -705,6 +705,8 @@ static int twl4030_usb_probe(struct platform_device *pdev) if (device_create_file(pdev-dev, dev_attr_vbus)) dev_warn(pdev-dev, could not create sysfs file\n); + ATOMIC_INIT_NOTIFIER_HEAD(twl-phy.notifier); BTW, this is a bugfix, send separately. What to send separately? This full patch 1/4 is bugfix. And I did not understand what you want. Maybe it could be easier for you to apply this small 3+2 lines patch how you need. -- Pali Rohár pali.ro...@gmail.com signature.asc Description: This is a digitally signed message part.
Re: [PATCH 6/6] USB: gadget: s3c-hsotg: fix clear feature ENDPOINT_HALT
On Thu, Sep 12, 2013 at 04:18:52PM +0200, Robert Baldyga wrote: This patch adds two fixes: - Property halted of s3c_hsotg_ep structure is actually changed when halt is set/cleared. - All requests for endpoint are completed when it was halted, and the halt was cleared by CLEAR_FEATURE, but not when new state is same as previous. each fix in its own patch -- balbi signature.asc Description: Digital signature
Re: [PATCH 1/7] usb: dwc3: get usb_phy only if the platform indicates the presence of PHY
Hi, On Thu, Sep 12, 2013 at 04:17:08PM +0530, Vivek Gautam wrote: On Thu, Sep 12, 2013 at 4:06 PM, Roger Quadros rog...@ti.com wrote: Hi Kishon, On 09/02/2013 06:43 PM, Kishon Vijay Abraham I wrote: There can be systems which does not have a external usb_phy, so get usb_phy only if usb-phy property is added in the case of dt boot or if platform_data indicates the presence of PHY. Also remove checking if return value is -ENXIO since it's now changed to always enable usb_phy layer. Signed-off-by: Kishon Vijay Abraham I kis...@ti.com --- drivers/usb/dwc3/Kconfig |1 + drivers/usb/dwc3/core.c | 60 +- drivers/usb/dwc3/platform_data.h |1 + 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig index f969ea2..cfc16dd 100644 --- a/drivers/usb/dwc3/Kconfig +++ b/drivers/usb/dwc3/Kconfig @@ -2,6 +2,7 @@ config USB_DWC3 tristate DesignWare USB3 DRD Core Support depends on (USB || USB_GADGET) GENERIC_HARDIRQS HAS_DMA depends on EXTCON + select USB_PHY select USB_XHCI_PLATFORM if USB_SUPPORT USB_XHCI_HCD help Say Y or M here if your system has a Dual Role SuperSpeed diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 474162e..428c29e 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -387,16 +387,38 @@ static int dwc3_probe(struct platform_device *pdev) if (node) { dwc-maximum_speed = of_usb_get_maximum_speed(node); - dwc-usb2_phy = devm_usb_get_phy_by_phandle(dev, usb-phy, 0); - dwc-usb3_phy = devm_usb_get_phy_by_phandle(dev, usb-phy, 1); + if (of_property_read_bool(node, usb-phy)) { + dwc-usb2_phy = devm_usb_get_phy_by_phandle(dev, + usb-phy, 0); + if (IS_ERR(dwc-usb2_phy)) + return PTR_ERR(dwc-usb2_phy); + dwc-usb3_phy = devm_usb_get_phy_by_phandle(dev, + usb-phy, 1); + if (IS_ERR(dwc-usb3_phy)) + return PTR_ERR(dwc-usb3_phy); Some DWC3 instances use only usb2_phy. e.g. on DRA7 the 2nd dwc3 instance doesn't use usb3_phy. This needs to be a valid case and driver shouldn't error out. So, i think adding flexibility to DWC3 to have either usb2-phy/usb3-phy or both of them seems to be valid point. Any suggestions ? I've gone through that. There's no easy way to make USB3 PHY optional. For platforms which actually have the USB3 side of things, not initializing the PHY kills dwc3. I've been trying to understand what it is that the USB3 PHY generates and gets backfed into dwc3, but so far no luck. I even have a patch for that, which I have dropped when I found out about this problem. -- balbi signature.asc Description: Digital signature
Re: [PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed
On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 8f78d2d..efe6155 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c @@ -705,6 +705,8 @@ static int twl4030_usb_probe(struct platform_device *pdev) if (device_create_file(pdev-dev, dev_attr_vbus)) dev_warn(pdev-dev, could not create sysfs file\n); + ATOMIC_INIT_NOTIFIER_HEAD(twl-phy.notifier); BTW, this is a bugfix, send separately. -- balbi signature.asc Description: Digital signature
Re: [PATCH 4/6] USB: gadget: s3c-hsotg: fix protocol stall handling
On Thu, Sep 12, 2013 at 04:18:50PM +0200, Robert Baldyga wrote: After normal handling of SetupDone interrupt, XferCompl interrupt occurs, and then we enqueue new setup request. But when ep0 is stalled, there is no XferCompl, so we have to enqueue setup request immediately after stalling ep. Otherwise incoming control requests won't be processed correctly. Signed-off-by: Robert Baldyga r.bald...@samsung.com Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- drivers/usb/gadget/s3c-hsotg.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index dd5524c..c581cd7 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -1146,6 +1146,8 @@ static int s3c_hsotg_process_req_feature(struct s3c_hsotg *hsotg, return 1; } +static void s3c_hsotg_enqueue_setup(struct s3c_hsotg *hsotg); + /** * s3c_hsotg_process_control - process a control request * @hsotg: The device state @@ -1245,11 +1247,12 @@ static void s3c_hsotg_process_control(struct s3c_hsotg *hsotg, * don't believe we need to anything more to get the EP * to reply with a STALL packet */ + + /* complete won't by called, so we enqueue setup request here */ s/by/be -- balbi signature.asc Description: Digital signature
Re: [PATCH 1/3 v5] usb: phy-samsung-usb: Simplify PMU register handling
On Tue, Sep 17, 2013 at 05:53:31PM +0200, Tomasz Figa wrote: Hi Felipe, On Tuesday 17 of September 2013 10:36:16 Felipe Balbi wrote: Hi, On Tue, Aug 27, 2013 at 01:27:48PM -0700, Julius Werner wrote: *Ping!* Are there still unanswered concerns left with this patch? I hope my prior mails could clear up why I think that the PMU register description in the device tree for a specific PHY is represents the hardware more accurately after my patch, and my analysis of the Exynos4 situation currently not being implemented (and therefore not needing to be addressed by this patch) was correct. Please let me know if you have further objections... and if not, could we agree to have this picked up somewhere? I need acks for DTS part... This patch breaks Exynos 4, so it's a NAK from me. Anyway, a new, completely redesigned PHY driver supporting most of the PHY features (as opposed to only the basic subset currently) developed by Kamil Debski should show up soon, so I don't think there is any reason to apply any patches to this old driver. awesome, then I espect to see a patch deleting the old driver shortly :-) cheers -- balbi signature.asc Description: Digital signature
Re: [PATCH] usb: dwc3: pci: add support for BayTrail
On Tue, Sep 17, 2013 at 10:38:13AM +0300, Heikki Krogerus wrote: Add PCI id for Intel BayTrail. Signed-off-by: Heikki Krogerus heikki.kroge...@linux.intel.com --- drivers/usb/dwc3/dwc3-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 9b13812..997ebe4 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -28,6 +28,7 @@ /* FIXME define these in linux/pci_ids.h */ #define PCI_VENDOR_ID_SYNOPSYS 0x16c3 #define PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 0xabcd +#define PCI_DEVICE_ID_INTEL_BYT 0x0f37 struct dwc3_pci { struct device *dev; @@ -187,6 +188,7 @@ static DEFINE_PCI_DEVICE_TABLE(dwc3_pci_id_table) = { PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3), }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT), }, finally something which isn't rumor :-) -- balbi signature.asc Description: Digital signature
Re: [PATCH 1/3 v5] usb: phy-samsung-usb: Simplify PMU register handling
Hi, On Tue, Aug 27, 2013 at 01:27:48PM -0700, Julius Werner wrote: *Ping!* Are there still unanswered concerns left with this patch? I hope my prior mails could clear up why I think that the PMU register description in the device tree for a specific PHY is represents the hardware more accurately after my patch, and my analysis of the Exynos4 situation currently not being implemented (and therefore not needing to be addressed by this patch) was correct. Please let me know if you have further objections... and if not, could we agree to have this picked up somewhere? I need acks for DTS part... -- balbi signature.asc Description: Digital signature
Re: [PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed
On Tue, Sep 17, 2013 at 06:05:15PM +0200, Pali Rohár wrote: On Tuesday 17 September 2013 17:48:59 you wrote: On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: More power supply drivers depends on vbus events and without it they not working. Power supply drivers using usb_register_notifier, so to deliver events it is needed to call atomic_notifier_call_chain. So without atomic notifier power supply driver isp1704 not retrieving vbus status and reporting bogus values to userspace and also to board platform data functions. Without proper data charger drivers trying to charge battery also when charger is disconnected or do not start charging when wallcharger connects. Atomic notifier in musb driver was used before v3.5 and was replaced with omap mailbox. This patch adding atomic_notifier_call_chain call from function omap_musb_set_mailbox. Signed-off-by: Pali Rohár pali.ro...@gmail.com --- drivers/usb/musb/omap2430.c |3 +++ drivers/usb/phy/phy-twl4030-usb.c |2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index f44e8b5..5c40252 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -305,6 +305,9 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) default: dev_dbg(dev, ID float\n); } + + atomic_notifier_call_chain(musb-xceiv-notifier, + musb-xceiv-last_event, NULL); let's add a wrapper for this: static inline int usb_phy_notify(struct usb phy *x, unsigned val, void *v) { return atomic_notifier_call_chain(x-notifier, val, v); } Where to add this wrapper? To omap2430.c? or some include file? linux/usb/phy.h On Tuesday 17 September 2013 17:49:17 Felipe Balbi wrote: On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 8f78d2d..efe6155 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c @@ -705,6 +705,8 @@ static int twl4030_usb_probe(struct platform_device *pdev) if (device_create_file(pdev-dev, dev_attr_vbus)) dev_warn(pdev-dev, could not create sysfs file\n); + ATOMIC_INIT_NOTIFIER_HEAD(twl-phy.notifier); BTW, this is a bugfix, send separately. What to send separately? This full patch 1/4 is bugfix. And I did not understand what you want. Maybe it could be easier for you to apply this small 3+2 lines patch how you need. This hunk here (initializaing notifier head) is a separate bug fix and needs its own patch. -- balbi signature.asc Description: Digital signature
Re: [PATCH 1/3 v5] usb: phy-samsung-usb: Simplify PMU register handling
Hi Felipe, On Tuesday 17 of September 2013 10:36:16 Felipe Balbi wrote: Hi, On Tue, Aug 27, 2013 at 01:27:48PM -0700, Julius Werner wrote: *Ping!* Are there still unanswered concerns left with this patch? I hope my prior mails could clear up why I think that the PMU register description in the device tree for a specific PHY is represents the hardware more accurately after my patch, and my analysis of the Exynos4 situation currently not being implemented (and therefore not needing to be addressed by this patch) was correct. Please let me know if you have further objections... and if not, could we agree to have this picked up somewhere? I need acks for DTS part... This patch breaks Exynos 4, so it's a NAK from me. Anyway, a new, completely redesigned PHY driver supporting most of the PHY features (as opposed to only the basic subset currently) developed by Kamil Debski should show up soon, so I don't think there is any reason to apply any patches to this old driver. Best regards, Tomasz -- 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 v11 0/8] PHY framework
On Wed, Sep 04, 2013 at 02:27:06PM +0530, Kishon Vijay Abraham I wrote: On Tuesday 03 September 2013 09:20 PM, Greg KH wrote: On Tue, Sep 03, 2013 at 08:55:23PM +0530, Kishon Vijay Abraham I wrote: Hi Greg, On Wednesday 28 August 2013 12:50 AM, Felipe Balbi wrote: Hi, On Mon, Aug 26, 2013 at 01:44:49PM +0530, Kishon Vijay Abraham I wrote: On Wednesday 21 August 2013 11:16 AM, Kishon Vijay Abraham I wrote: Added a generic PHY framework that provides a set of APIs for the PHY drivers to create/destroy a PHY and APIs for the PHY users to obtain a reference to the PHY with or without using phandle. This framework will be of use only to devices that uses external PHY (PHY functionality is not embedded within the controller). The intention of creating this framework is to bring the phy drivers spread all over the Linux kernel to drivers/phy to increase code re-use and to increase code maintainability. Comments to make PHY as bus wasn't done because PHY devices can be part of other bus and making a same device attached to multiple bus leads to bad design. If the PHY driver has to send notification on connect/disconnect, the PHY driver should make use of the extcon framework. Using this susbsystem to use extcon framwork will have to be analysed. You can find this patch series @ git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git testing Looks like there are not further comments on this series. Can you take this in your misc tree? Do you want me to queue these for you ? There are quite a few users for this framework already and I know of at least 2 others which will show up for v3.13. Can you queue this patch series? There are quite a few users already for this framework. It will have to wait for 3.13 as the merge window for new features has been closed for a week or so. Sorry, I'll queue this up after 3.12-rc1 is out. Alright, thanks. Just a gentle ping on this one... cheers -- balbi signature.asc Description: Digital signature
Re: Fix style in s3c-hsotg.c
Hi, On Mon, Sep 02, 2013 at 03:58:32PM +0200, Pavel Machek wrote: Hi! checkpatch.pl has some valid complaints about style in s3c-hsotg.c : macro with if should be really enclosed in do {} while, and puts is going to be slightly faster. Here's suggested patch. I don't have the hardware, so it is completely untested. Signed-off-by: Pavel Machek, pa...@denx.de this is not how you send a patch, please read Documentation/SubmittingPatches -- balbi signature.asc Description: Digital signature
Re: [PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed
On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: More power supply drivers depends on vbus events and without it they not working. Power supply drivers using usb_register_notifier, so to deliver events it is needed to call atomic_notifier_call_chain. So without atomic notifier power supply driver isp1704 not retrieving vbus status and reporting bogus values to userspace and also to board platform data functions. Without proper data charger drivers trying to charge battery also when charger is disconnected or do not start charging when wallcharger connects. Atomic notifier in musb driver was used before v3.5 and was replaced with omap mailbox. This patch adding atomic_notifier_call_chain call from function omap_musb_set_mailbox. Signed-off-by: Pali Rohár pali.ro...@gmail.com --- drivers/usb/musb/omap2430.c |3 +++ drivers/usb/phy/phy-twl4030-usb.c |2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index f44e8b5..5c40252 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -305,6 +305,9 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) default: dev_dbg(dev, ID float\n); } + + atomic_notifier_call_chain(musb-xceiv-notifier, + musb-xceiv-last_event, NULL); let's add a wrapper for this: static inline int usb_phy_notify(struct usb phy *x, unsigned val, void *v) { return atomic_notifier_call_chain(x-notifier, val, v); } -- balbi signature.asc Description: Digital signature
Re: [PATCH] usb: gadget: use usb_composite_dev for usb_function_{de}activate
Hi Felipe, On Wed, Sep 11, 2013 at 09:01:39AM +0200, Michael Grzeschik wrote: Hi Felipe, On Tue, Sep 10, 2013 at 04:19:40PM +0200, Michael Grzeschik wrote: usb_function_{de}activate makes it possible to have several gadget functions, inside one composite device, to be able to prevent the gadget to enumerate until an prepared condition has triggered (i.e. userspace daemon has started) This patch simplifies and renames the functions to its actual meaning usb_cdev_{de}activate and fixes all its users. As the code is counting the deactivations in the current cdev. I was working on this also to be used in udc-core for udc_bind_to_driver. Because the current implementation will call usb_gadget_connect without checking for delaying functions. But for that the whole mechanism needs to be ported to gadget level. What do you think about usb_gadget_deactivate/usb_gadget_activate ? Just a short ping on that mails. You probably mist them, as I replied to myself in the first place! ;-) Thanks, Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | -- 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
[GIT PULL] USB fixes for v3.12-rc
Hi Greg, Here's my first set of fixes. Please consider merging. cheers The following changes since commit 272b98c6455f00884f0350f775c5342358ebb73f: Linux 3.12-rc1 (2013-09-16 16:17:51 -0400) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git tags/fixes-for-v3.12-rc2 for you to fetch changes up to d3675e3a481d3320e214984a10577fe06518c5bf: usb: s3c-hsotg: do not disconnect gadget when receiving ErlySusp intr (2013-09-17 11:08:46 -0500) usb: fixes for v3.12-rc2 Here's first set of fixes for v3.12-rc series, patches have been soaking in linux-usb for a while now. We have the usual sparse and build warnings, a Kconfig fix to a mismerge on dwc3 Kconfig, fix for a possible memory leak in dwc3, s3c-hsotg won't disconnect when bus goes idle, locking fix in mv_u3d_core, endpoint disable fix in f_mass_storage. We also have one device ID added to dwc3's PCI glue layer in order to support Intel's BayTrail devices. Signed-of-by: Felipe Balbi ba...@ti.com Alan Stern (1): usb: gadget: fix a bug and a WARN_ON in dummy-hcd Alexey Khoroshilov (1): usb: gadget: mv_u3d_core: fix violation of locking discipline in mv_u3d_ep_disable() Andrzej Pietrasiewicz (1): usb: gadget: cdc2: fix conversion to new interface of f_ecm Chanho Park (1): usb: s3c-hsotg: do not disconnect gadget when receiving ErlySusp intr Chen Gang (1): usb: gadget: add '__ref' for rndis_config_register() and cdc_config_register() David Cohen (1): usb: dwc3: gadget: avoid memory leak when failing to allocate all eps Heikki Krogerus (2): usb: dwc3: pci: add support for BayTrail usb: dwc3: remove extcon dependency Marek Szyprowski (1): usb: s3c-hsotg: fix unregistration function Peter Oh (1): usb: gadget: f_mass_storage: reset endpoint driver data when disabled Sachin Kamat (4): usb: phy: omap-usb3: Fix return value usb: gadget: f_ecm: Staticize ecm_alloc usb: gadget: f_eem: Staticize eem_alloc usb: host: fsl-mph-dr-of: Staticize local symbols drivers/usb/dwc3/Kconfig| 1 - drivers/usb/dwc3/dwc3-pci.c | 2 ++ drivers/usb/dwc3/gadget.c | 6 ++ drivers/usb/gadget/cdc2.c | 19 +-- drivers/usb/gadget/dummy_hcd.c | 7 --- drivers/usb/gadget/f_ecm.c | 2 +- drivers/usb/gadget/f_eem.c | 2 +- drivers/usb/gadget/f_mass_storage.c | 2 ++ drivers/usb/gadget/multi.c | 8 drivers/usb/gadget/mv_u3d_core.c| 3 +++ drivers/usb/gadget/s3c-hsotg.c | 13 - drivers/usb/host/fsl-mph-dr-of.c| 6 +++--- drivers/usb/phy/phy-omap-usb3.c | 2 +- 13 files changed, 28 insertions(+), 45 deletions(-) -- 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: musb: fix otg default state
Right after the musb_hdrc driver is loaded, the otg default state is a_idle, and Mode=Host, which are set by musb_host_setup(). This causes the following kernel message during musb gadget enumeration. CAUTION: musb: Babble Interrupt Occurred This patch sets the otg default state to b_idle, and its Mode to Peripheral. It has been validated on TI AM335x GP EVM USB0 port with g_zero. Signed-off-by: Bin Liu b-...@ti.com --- drivers/usb/musb/musb_gadget.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 9a08679..58c029f 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1790,6 +1790,10 @@ int musb_gadget_setup(struct musb *musb) musb-g.max_speed = USB_SPEED_HIGH; musb-g.speed = USB_SPEED_UNKNOWN; + MUSB_DEV_MODE(musb); + musb-xceiv-otg-default_a = 0; + musb-xceiv-state = OTG_STATE_B_IDLE; + /* this gadget abstracts/virtualizes the controller */ musb-g.name = musb_driver_name; musb-g.is_otg = 1; -- 1.7.0.4 -- 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: gadget: use usb_composite_dev for usb_function_{de}activate
Hi, On Tue, Sep 17, 2013 at 07:08:12PM +0200, Michael Grzeschik wrote: On Wed, Sep 11, 2013 at 09:01:39AM +0200, Michael Grzeschik wrote: On Tue, Sep 10, 2013 at 04:19:40PM +0200, Michael Grzeschik wrote: usb_function_{de}activate makes it possible to have several gadget functions, inside one composite device, to be able to prevent the gadget to enumerate until an prepared condition has triggered (i.e. userspace daemon has started) This patch simplifies and renames the functions to its actual meaning usb_cdev_{de}activate and fixes all its users. As the code is counting the deactivations in the current cdev. I was working on this also to be used in udc-core for udc_bind_to_driver. Because the current implementation will call usb_gadget_connect without checking for delaying functions. But for that the whole mechanism needs to be ported to gadget level. What do you think about usb_gadget_deactivate/usb_gadget_activate ? Just a short ping on that mails. You probably mist them, as I replied to myself in the first place! ;-) We could certainly add usb_gadget_activate/deactivate functions, but I'm not sure what's best to implement: a) entirely new functions b) add refcounting to usb_gadget_connect/disconnect Also, we can't simply force all functions to be deactivated and forget about everything else. Not all functions are using usb_function_activate/deactivate as of today. We could, rather easily, just add those calls to such functions and force the conversion. what do you think ? -- balbi signature.asc Description: Digital signature
Re: [Bug] 0ac8:0321 Vimicro generic vc0321 Camera is not working and causes crashes since 3.2
On 09/09/2013 02:09 PM, Hans de Goede wrote: Thanks for the bug report, looking at the bug reports, they all report an error of -71 which is EPROTO, which typically means something is wrong at the USB level. And nothing has changed for the driver in question between 3.1 and 3.2 , so I believe this regression is caused by changes to the usb sub-system, likely changes to the EHCI driver. I have tested the new 3.12.0-rc1 kernel and the regression is still present. It causes that Cheese crashes with a segmentation fault and I get the following errors [ 139.868628] gspca_main: ISOC data error: [21] len=0, status=-71 [ 139.904620] gspca_main: ISOC data error: [12] len=0, status=-71 [ 139.936595] gspca_main: ISOC data error: [9] len=0, status=-71 [ 139.968576] gspca_main: ISOC data error: [17] len=0, status=-71 [ 140.036571] gspca_main: ISOC data error: [16] len=0, status=-71 [ 140.037364] video_source:sr[2570]: segfault at 8 ip 7f0430d6868c sp 7f0406c02900 error 4 in libgstreamer-0.10.so.0.30.0[7f0430d15000+de000] [ 140.068533] gspca_main: ISOC data error: [24] len=0, status=-71 [ 140.104519] gspca_main: ISOC data error: [15] len=0, status=-71 [ 140.168474] gspca_main: ISOC data error: [20] len=0, status=-71 [ 140.200461] gspca_main: ISOC data error: [28] len=0, status=-71 Frank -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed
On Tuesday 17 September 2013 18:08:35 Felipe Balbi wrote: On Tue, Sep 17, 2013 at 06:05:15PM +0200, Pali Rohár wrote: On Tuesday 17 September 2013 17:48:59 you wrote: On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: More power supply drivers depends on vbus events and without it they not working. Power supply drivers using usb_register_notifier, so to deliver events it is needed to call atomic_notifier_call_chain. So without atomic notifier power supply driver isp1704 not retrieving vbus status and reporting bogus values to userspace and also to board platform data functions. Without proper data charger drivers trying to charge battery also when charger is disconnected or do not start charging when wallcharger connects. Atomic notifier in musb driver was used before v3.5 and was replaced with omap mailbox. This patch adding atomic_notifier_call_chain call from function omap_musb_set_mailbox. Signed-off-by: Pali Rohár pali.ro...@gmail.com --- drivers/usb/musb/omap2430.c |3 +++ drivers/usb/phy/phy-twl4030-usb.c |2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index f44e8b5..5c40252 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -305,6 +305,9 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) default: dev_dbg(dev, ID float\n); } + + atomic_notifier_call_chain(musb-xceiv-notifier, + musb-xceiv-last_event, NULL); let's add a wrapper for this: static inline int usb_phy_notify(struct usb phy *x, unsigned val, void *v) { return atomic_notifier_call_chain(x-notifier, val, v); } Where to add this wrapper? To omap2430.c? or some include file? linux/usb/phy.h On Tuesday 17 September 2013 17:49:17 Felipe Balbi wrote: On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 8f78d2d..efe6155 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c @@ -705,6 +705,8 @@ static int twl4030_usb_probe(struct platform_device *pdev) if (device_create_file(pdev-dev, dev_attr_vbus)) dev_warn(pdev-dev, could not create sysfs file\n); + ATOMIC_INIT_NOTIFIER_HEAD(twl-phy.notifier); BTW, this is a bugfix, send separately. What to send separately? This full patch 1/4 is bugfix. And I did not understand what you want. Maybe it could be easier for you to apply this small 3+2 lines patch how you need. This hunk here (initializaing notifier head) is a separate bug fix and needs its own patch. So will you do that? Or it is needed to resend this one line hunk again in new email again? -- Pali Rohár pali.ro...@gmail.com signature.asc Description: This is a digitally signed message part.
Re: [GIT PULL] USB fixes for v3.12-rc
On Tue, Sep 17, 2013 at 12:37:03PM -0500, Felipe Balbi wrote: Hi Greg, Here's my first set of fixes. Please consider merging. cheers The following changes since commit 272b98c6455f00884f0350f775c5342358ebb73f: Linux 3.12-rc1 (2013-09-16 16:17:51 -0400) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git tags/fixes-for-v3.12-rc2 Pulled and pushed out, thanks. greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 3/6] uas: make work list per-device
On Fri, Sep 13, 2013 at 01:27:12PM +0200, Gerd Hoffmann wrote: Simplifies locking, we'll protect the list with the device spin lock. Also plugs races which can happen when two devices operate on the global list. While being at it rename the list head from list to work, preparing for the addition of a second list. Why do you even the list? What would a ordered per-device workqueue not provide? -- 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: musb: gadget: fix otg active status flag
In gadget mode, musb-is_active should be set only when connected to the host. musb_g_reset() already takes care of it. Signed-off-by: Bin Liu b-...@ti.com --- drivers/usb/musb/musb_gadget.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 58c029f..b19ed21 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1853,7 +1853,6 @@ static int musb_gadget_start(struct usb_gadget *g, musb-gadget_driver = driver; spin_lock_irqsave(musb-lock, flags); - musb-is_active = 1; otg_set_peripheral(otg, musb-g); musb-xceiv-state = OTG_STATE_B_IDLE; -- 1.7.0.4 -- 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: Fix style in s3c-hsotg.c
On Tue 2013-09-17 10:42:30, Felipe Balbi wrote: Hi, On Mon, Sep 02, 2013 at 03:58:32PM +0200, Pavel Machek wrote: Hi! checkpatch.pl has some valid complaints about style in s3c-hsotg.c : macro with if should be really enclosed in do {} while, and puts is going to be slightly faster. Here's suggested patch. I don't have the hardware, so it is completely untested. Signed-off-by: Pavel Machek, pa...@denx.de this is not how you send a patch, please read Documentation/SubmittingPatches Have you considered possibility that this is how you nudge maintainer into fix their coding style? Thanks, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.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] USBNET: fix handling padding packet
From: Ming Lei ming@canonical.com Date: Tue, 17 Sep 2013 17:10:02 +0800 Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG if the usb host controller is capable of building packet from discontinuous buffers, but missed handling padding packet when building DMA SG. This patch attachs the pre-allocated padding packet at the end of the sg list, so padding packet can be sent to device if drivers require that. Reported-by: David Laight david.lai...@aculab.com Cc: Oliver Neukum oli...@neukum.org Signed-off-by: Ming Lei ming@canonical.com Some reviews and ACKs would be appreciated on this one, 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] usb: gadget: Add UDC driver for Aeroflex Gaisler GRUSBDC
Hi, On Mon, Sep 09, 2013 at 08:24:24AM -0700, Greg Kroah-Hartman wrote: On Mon, Sep 09, 2013 at 07:33:31AM +0200, Andreas Larsson wrote: On 2013-08-28 11:02, Andreas Larsson wrote: On 2013-08-12 16:05, Andreas Larsson wrote: This adds an UDC driver for GRUSBDC USB Device Controller cores available in the GRLIB VHDL IP core library. The driver only supports DMA mode. Any comments? It would be great to get feedback soon in case some things need to be changed for this driver to be accepted. Thanks! Anyone? Is there anything holding it back from being accepted into mainline? This is the middle of the merge window, nothing can be accepted at the moment, please wait until 3.12-rc1 comes out and our trees open up again to expect a response. I'll review this one tomorrow or day after. -- balbi signature.asc Description: Digital signature
Re: [PATCH 1/4] usb: musb: Call atomic_notifier_call_chain when status is changed
On Tue, Sep 17, 2013 at 09:28:42PM +0200, Pali Rohár wrote: On Tuesday 17 September 2013 18:08:35 Felipe Balbi wrote: On Tue, Sep 17, 2013 at 06:05:15PM +0200, Pali Rohár wrote: On Tuesday 17 September 2013 17:48:59 you wrote: On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: More power supply drivers depends on vbus events and without it they not working. Power supply drivers using usb_register_notifier, so to deliver events it is needed to call atomic_notifier_call_chain. So without atomic notifier power supply driver isp1704 not retrieving vbus status and reporting bogus values to userspace and also to board platform data functions. Without proper data charger drivers trying to charge battery also when charger is disconnected or do not start charging when wallcharger connects. Atomic notifier in musb driver was used before v3.5 and was replaced with omap mailbox. This patch adding atomic_notifier_call_chain call from function omap_musb_set_mailbox. Signed-off-by: Pali Rohár pali.ro...@gmail.com --- drivers/usb/musb/omap2430.c |3 +++ drivers/usb/phy/phy-twl4030-usb.c |2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index f44e8b5..5c40252 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -305,6 +305,9 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) default: dev_dbg(dev, ID float\n); } + + atomic_notifier_call_chain(musb-xceiv-notifier, + musb-xceiv-last_event, NULL); let's add a wrapper for this: static inline int usb_phy_notify(struct usb phy *x, unsigned val, void *v) { return atomic_notifier_call_chain(x-notifier, val, v); } Where to add this wrapper? To omap2430.c? or some include file? linux/usb/phy.h On Tuesday 17 September 2013 17:49:17 Felipe Balbi wrote: On Sun, Sep 08, 2013 at 10:50:36AM +0200, Pali Rohár wrote: diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 8f78d2d..efe6155 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c @@ -705,6 +705,8 @@ static int twl4030_usb_probe(struct platform_device *pdev) if (device_create_file(pdev-dev, dev_attr_vbus)) dev_warn(pdev-dev, could not create sysfs file\n); + ATOMIC_INIT_NOTIFIER_HEAD(twl-phy.notifier); BTW, this is a bugfix, send separately. What to send separately? This full patch 1/4 is bugfix. And I did not understand what you want. Maybe it could be easier for you to apply this small 3+2 lines patch how you need. This hunk here (initializaing notifier head) is a separate bug fix and needs its own patch. So will you do that? Or it is needed to resend this one line hunk again in new email again? new patch, new email -- balbi signature.asc Description: Digital signature