Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'usb-4.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB and PHY fixes from Greg KH:
"Here are a number of small USB and PHY driver fixes for 4.7-rc6.

Nothing major here, all are described in the shortlog below. All have
been in linux-next with no reported issues"

* tag 'usb-4.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
USB: don't free bandwidth_mutex too early
USB: EHCI: declare hostpc register as zero-length array
phy-sun4i-usb: Fix irq free conditions to match request conditions
phy: bcm-ns-usb2: checking the wrong variable
phy-sun4i-usb: fix missing __iomem *
phy: phy-sun4i-usb: Fix optional gpios failing probe
phy: rockchip-dp: fix return value check in rockchip_dp_phy_probe()
phy: rcar-gen3-usb2: fix unexpected repeat interrupts of VBUS change
usb: common: otg-fsm: add license to usb-otg-fsm

+22 -35
+2 -2
drivers/phy/phy-bcm-ns-usb2.c
··· 109 109 } 110 110 111 111 usb2->phy = devm_phy_create(dev, NULL, &ops); 112 - if (IS_ERR(dev)) 113 - return PTR_ERR(dev); 112 + if (IS_ERR(usb2->phy)) 113 + return PTR_ERR(usb2->phy); 114 114 115 115 phy_set_drvdata(usb2->phy, usb2); 116 116 platform_set_drvdata(pdev, usb2);
+1 -13
drivers/phy/phy-rcar-gen3-usb2.c
··· 144 144 extcon_set_cable_state_(ch->extcon, EXTCON_USB, true); 145 145 } 146 146 147 - static bool rcar_gen3_check_vbus(struct rcar_gen3_chan *ch) 148 - { 149 - return !!(readl(ch->base + USB2_ADPCTRL) & 150 - USB2_ADPCTRL_OTGSESSVLD); 151 - } 152 - 153 147 static bool rcar_gen3_check_id(struct rcar_gen3_chan *ch) 154 148 { 155 149 return !!(readl(ch->base + USB2_ADPCTRL) & USB2_ADPCTRL_IDDIG); ··· 151 157 152 158 static void rcar_gen3_device_recognition(struct rcar_gen3_chan *ch) 153 159 { 154 - bool is_host = true; 155 - 156 - /* B-device? */ 157 - if (rcar_gen3_check_id(ch) && rcar_gen3_check_vbus(ch)) 158 - is_host = false; 159 - 160 - if (is_host) 160 + if (!rcar_gen3_check_id(ch)) 161 161 rcar_gen3_init_for_host(ch); 162 162 else 163 163 rcar_gen3_init_for_peri(ch);
+1 -1
drivers/phy/phy-rockchip-dp.c
··· 90 90 return -ENODEV; 91 91 92 92 dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL); 93 - if (IS_ERR(dp)) 93 + if (!dp) 94 94 return -ENOMEM; 95 95 96 96 dp->dev = dev;
+7 -7
drivers/phy/phy-sun4i-usb.c
··· 175 175 { 176 176 struct sun4i_usb_phy_data *phy_data = to_sun4i_usb_phy_data(phy); 177 177 u32 temp, usbc_bit = BIT(phy->index * 2); 178 - void *phyctl = phy_data->base + phy_data->cfg->phyctl_offset; 178 + void __iomem *phyctl = phy_data->base + phy_data->cfg->phyctl_offset; 179 179 int i; 180 180 181 181 mutex_lock(&phy_data->mutex); ··· 514 514 515 515 if (data->vbus_power_nb_registered) 516 516 power_supply_unreg_notifier(&data->vbus_power_nb); 517 - if (data->id_det_irq >= 0) 517 + if (data->id_det_irq > 0) 518 518 devm_free_irq(dev, data->id_det_irq, data); 519 - if (data->vbus_det_irq >= 0) 519 + if (data->vbus_det_irq > 0) 520 520 devm_free_irq(dev, data->vbus_det_irq, data); 521 521 522 522 cancel_delayed_work_sync(&data->detect); ··· 645 645 646 646 data->id_det_irq = gpiod_to_irq(data->id_det_gpio); 647 647 data->vbus_det_irq = gpiod_to_irq(data->vbus_det_gpio); 648 - if ((data->id_det_gpio && data->id_det_irq < 0) || 649 - (data->vbus_det_gpio && data->vbus_det_irq < 0)) 648 + if ((data->id_det_gpio && data->id_det_irq <= 0) || 649 + (data->vbus_det_gpio && data->vbus_det_irq <= 0)) 650 650 data->phy0_poll = true; 651 651 652 - if (data->id_det_irq >= 0) { 652 + if (data->id_det_irq > 0) { 653 653 ret = devm_request_irq(dev, data->id_det_irq, 654 654 sun4i_usb_phy0_id_vbus_det_irq, 655 655 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, ··· 660 660 } 661 661 } 662 662 663 - if (data->vbus_det_irq >= 0) { 663 + if (data->vbus_det_irq > 0) { 664 664 ret = devm_request_irq(dev, data->vbus_det_irq, 665 665 sun4i_usb_phy0_id_vbus_det_irq, 666 666 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+2
drivers/usb/common/usb-otg-fsm.c
··· 21 21 * 675 Mass Ave, Cambridge, MA 02139, USA. 22 22 */ 23 23 24 + #include <linux/module.h> 24 25 #include <linux/kernel.h> 25 26 #include <linux/types.h> 26 27 #include <linux/mutex.h> ··· 451 450 return fsm->state_changed; 452 451 } 453 452 EXPORT_SYMBOL_GPL(otg_statemachine); 453 + MODULE_LICENSE("GPL");
+7 -10
drivers/usb/core/hcd.c
··· 2598 2598 * Don't deallocate the bandwidth_mutex until the last shared usb_hcd is 2599 2599 * deallocated. 2600 2600 * 2601 - * Make sure to only deallocate the bandwidth_mutex when the primary HCD is 2602 - * freed. When hcd_release() is called for either hcd in a peer set 2603 - * invalidate the peer's ->shared_hcd and ->primary_hcd pointers to 2604 - * block new peering attempts 2601 + * Make sure to deallocate the bandwidth_mutex only when the last HCD is 2602 + * freed. When hcd_release() is called for either hcd in a peer set, 2603 + * invalidate the peer's ->shared_hcd and ->primary_hcd pointers. 2605 2604 */ 2606 2605 static void hcd_release(struct kref *kref) 2607 2606 { 2608 2607 struct usb_hcd *hcd = container_of (kref, struct usb_hcd, kref); 2609 2608 2610 2609 mutex_lock(&usb_port_peer_mutex); 2611 - if (usb_hcd_is_primary_hcd(hcd)) { 2612 - kfree(hcd->address0_mutex); 2613 - kfree(hcd->bandwidth_mutex); 2614 - } 2615 2610 if (hcd->shared_hcd) { 2616 2611 struct usb_hcd *peer = hcd->shared_hcd; 2617 2612 2618 2613 peer->shared_hcd = NULL; 2619 - if (peer->primary_hcd == hcd) 2620 - peer->primary_hcd = NULL; 2614 + peer->primary_hcd = NULL; 2615 + } else { 2616 + kfree(hcd->address0_mutex); 2617 + kfree(hcd->bandwidth_mutex); 2621 2618 } 2622 2619 mutex_unlock(&usb_port_peer_mutex); 2623 2620 kfree(hcd);
+2 -2
include/linux/usb/ehci_def.h
··· 180 180 * PORTSCx 181 181 */ 182 182 /* HOSTPC: offset 0x84 */ 183 - u32 hostpc[1]; /* HOSTPC extension */ 183 + u32 hostpc[0]; /* HOSTPC extension */ 184 184 #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ 185 185 #define HOSTPC_PSPD (3<<25) /* Port speed detection */ 186 186 187 - u32 reserved5[16]; 187 + u32 reserved5[17]; 188 188 189 189 /* USBMODE_EX: offset 0xc8 */ 190 190 u32 usbmode_ex; /* USB Device mode extension */