diff options
author | David S. Miller <davem@davemloft.net> | 2018-03-23 11:24:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-23 11:31:58 -0400 |
commit | 03fe2debbb2771fb90881e4ce8109b09cf772a5c (patch) | |
tree | fbaf8738296b2e9dcba81c6daef2d515b6c4948c /drivers/net/phy | |
parent | 6686c459e1449a3ee5f3fd313b0a559ace7a700e (diff) | |
parent | f36b7534b83357cf52e747905de6d65b4f7c2512 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Fun set of conflict resolutions here...
For the mac80211 stuff, these were fortunately just parallel
adds. Trivially resolved.
In drivers/net/phy/phy.c we had a bug fix in 'net' that moved the
function phy_disable_interrupts() earlier in the file, whilst in
'net-next' the phy_error() call from this function was removed.
In net/ipv4/xfrm4_policy.c, David Ahern's changes to remove the
'rt_table_id' member of rtable collided with a bug fix in 'net' that
added a new struct member "rt_mtu_locked" which needs to be copied
over here.
The mlxsw driver conflict consisted of net-next separating
the span code and definitions into separate files, whilst
a 'net' bug fix made some changes to that moved code.
The mlx5 infiniband conflict resolution was quite non-trivial,
the RDMA tree's merge commit was used as a guide here, and
here are their notes:
====================
Due to bug fixes found by the syzkaller bot and taken into the for-rc
branch after development for the 4.17 merge window had already started
being taken into the for-next branch, there were fairly non-trivial
merge issues that would need to be resolved between the for-rc branch
and the for-next branch. This merge resolves those conflicts and
provides a unified base upon which ongoing development for 4.17 can
be based.
Conflicts:
drivers/infiniband/hw/mlx5/main.c - Commit 42cea83f9524
(IB/mlx5: Fix cleanup order on unload) added to for-rc and
commit b5ca15ad7e61 (IB/mlx5: Add proper representors support)
add as part of the devel cycle both needed to modify the
init/de-init functions used by mlx5. To support the new
representors, the new functions added by the cleanup patch
needed to be made non-static, and the init/de-init list
added by the representors patch needed to be modified to
match the init/de-init list changes made by the cleanup
patch.
Updates:
drivers/infiniband/hw/mlx5/mlx5_ib.h - Update function
prototypes added by representors patch to reflect new function
names as changed by cleanup patch
drivers/infiniband/hw/mlx5/ib_rep.c - Update init/de-init
stage list to match new order from cleanup patch
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r-- | drivers/net/phy/bcm-phy-lib.c | 4 | ||||
-rw-r--r-- | drivers/net/phy/marvell.c | 4 | ||||
-rw-r--r-- | drivers/net/phy/micrel.c | 27 | ||||
-rw-r--r-- | drivers/net/phy/phy.c | 127 | ||||
-rw-r--r-- | drivers/net/phy/phy_device.c | 32 | ||||
-rw-r--r-- | drivers/net/phy/realtek.c | 2 |
6 files changed, 101 insertions, 95 deletions
diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c index 171010eb4d9c..5ad130c3da43 100644 --- a/drivers/net/phy/bcm-phy-lib.c +++ b/drivers/net/phy/bcm-phy-lib.c | |||
@@ -341,8 +341,8 @@ void bcm_phy_get_strings(struct phy_device *phydev, u8 *data) | |||
341 | unsigned int i; | 341 | unsigned int i; |
342 | 342 | ||
343 | for (i = 0; i < ARRAY_SIZE(bcm_phy_hw_stats); i++) | 343 | for (i = 0; i < ARRAY_SIZE(bcm_phy_hw_stats); i++) |
344 | memcpy(data + i * ETH_GSTRING_LEN, | 344 | strlcpy(data + i * ETH_GSTRING_LEN, |
345 | bcm_phy_hw_stats[i].string, ETH_GSTRING_LEN); | 345 | bcm_phy_hw_stats[i].string, ETH_GSTRING_LEN); |
346 | } | 346 | } |
347 | EXPORT_SYMBOL_GPL(bcm_phy_get_strings); | 347 | EXPORT_SYMBOL_GPL(bcm_phy_get_strings); |
348 | 348 | ||
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 98fd6b7ceeec..a75c511950c3 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
@@ -1452,8 +1452,8 @@ static void marvell_get_strings(struct phy_device *phydev, u8 *data) | |||
1452 | int i; | 1452 | int i; |
1453 | 1453 | ||
1454 | for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++) { | 1454 | for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++) { |
1455 | memcpy(data + i * ETH_GSTRING_LEN, | 1455 | strlcpy(data + i * ETH_GSTRING_LEN, |
1456 | marvell_hw_stats[i].string, ETH_GSTRING_LEN); | 1456 | marvell_hw_stats[i].string, ETH_GSTRING_LEN); |
1457 | } | 1457 | } |
1458 | } | 1458 | } |
1459 | 1459 | ||
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 0f45310300f6..f41b224a9cdb 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c | |||
@@ -635,25 +635,6 @@ static int ksz8873mll_config_aneg(struct phy_device *phydev) | |||
635 | return 0; | 635 | return 0; |
636 | } | 636 | } |
637 | 637 | ||
638 | /* This routine returns -1 as an indication to the caller that the | ||
639 | * Micrel ksz9021 10/100/1000 PHY does not support standard IEEE | ||
640 | * MMD extended PHY registers. | ||
641 | */ | ||
642 | static int | ||
643 | ksz9021_rd_mmd_phyreg(struct phy_device *phydev, int devad, u16 regnum) | ||
644 | { | ||
645 | return -1; | ||
646 | } | ||
647 | |||
648 | /* This routine does nothing since the Micrel ksz9021 does not support | ||
649 | * standard IEEE MMD extended PHY registers. | ||
650 | */ | ||
651 | static int | ||
652 | ksz9021_wr_mmd_phyreg(struct phy_device *phydev, int devad, u16 regnum, u16 val) | ||
653 | { | ||
654 | return -1; | ||
655 | } | ||
656 | |||
657 | static int kszphy_get_sset_count(struct phy_device *phydev) | 638 | static int kszphy_get_sset_count(struct phy_device *phydev) |
658 | { | 639 | { |
659 | return ARRAY_SIZE(kszphy_hw_stats); | 640 | return ARRAY_SIZE(kszphy_hw_stats); |
@@ -664,8 +645,8 @@ static void kszphy_get_strings(struct phy_device *phydev, u8 *data) | |||
664 | int i; | 645 | int i; |
665 | 646 | ||
666 | for (i = 0; i < ARRAY_SIZE(kszphy_hw_stats); i++) { | 647 | for (i = 0; i < ARRAY_SIZE(kszphy_hw_stats); i++) { |
667 | memcpy(data + i * ETH_GSTRING_LEN, | 648 | strlcpy(data + i * ETH_GSTRING_LEN, |
668 | kszphy_hw_stats[i].string, ETH_GSTRING_LEN); | 649 | kszphy_hw_stats[i].string, ETH_GSTRING_LEN); |
669 | } | 650 | } |
670 | } | 651 | } |
671 | 652 | ||
@@ -946,8 +927,8 @@ static struct phy_driver ksphy_driver[] = { | |||
946 | .get_stats = kszphy_get_stats, | 927 | .get_stats = kszphy_get_stats, |
947 | .suspend = genphy_suspend, | 928 | .suspend = genphy_suspend, |
948 | .resume = genphy_resume, | 929 | .resume = genphy_resume, |
949 | .read_mmd = ksz9021_rd_mmd_phyreg, | 930 | .read_mmd = genphy_read_mmd_unsupported, |
950 | .write_mmd = ksz9021_wr_mmd_phyreg, | 931 | .write_mmd = genphy_write_mmd_unsupported, |
951 | }, { | 932 | }, { |
952 | .phy_id = PHY_ID_KSZ9031, | 933 | .phy_id = PHY_ID_KSZ9031, |
953 | .phy_id_mask = MICREL_PHY_ID_MASK, | 934 | .phy_id_mask = MICREL_PHY_ID_MASK, |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index c2d9027be863..05c1e8ef15e6 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -618,6 +618,68 @@ static void phy_error(struct phy_device *phydev) | |||
618 | } | 618 | } |
619 | 619 | ||
620 | /** | 620 | /** |
621 | * phy_disable_interrupts - Disable the PHY interrupts from the PHY side | ||
622 | * @phydev: target phy_device struct | ||
623 | */ | ||
624 | static int phy_disable_interrupts(struct phy_device *phydev) | ||
625 | { | ||
626 | int err; | ||
627 | |||
628 | /* Disable PHY interrupts */ | ||
629 | err = phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED); | ||
630 | if (err) | ||
631 | return err; | ||
632 | |||
633 | /* Clear the interrupt */ | ||
634 | return phy_clear_interrupt(phydev); | ||
635 | } | ||
636 | |||
637 | /** | ||
638 | * phy_change - Called by the phy_interrupt to handle PHY changes | ||
639 | * @phydev: phy_device struct that interrupted | ||
640 | */ | ||
641 | static irqreturn_t phy_change(struct phy_device *phydev) | ||
642 | { | ||
643 | if (phy_interrupt_is_valid(phydev)) { | ||
644 | if (phydev->drv->did_interrupt && | ||
645 | !phydev->drv->did_interrupt(phydev)) | ||
646 | return IRQ_NONE; | ||
647 | |||
648 | if (phydev->state == PHY_HALTED) | ||
649 | if (phy_disable_interrupts(phydev)) | ||
650 | goto phy_err; | ||
651 | } | ||
652 | |||
653 | mutex_lock(&phydev->lock); | ||
654 | if ((PHY_RUNNING == phydev->state) || (PHY_NOLINK == phydev->state)) | ||
655 | phydev->state = PHY_CHANGELINK; | ||
656 | mutex_unlock(&phydev->lock); | ||
657 | |||
658 | /* reschedule state queue work to run as soon as possible */ | ||
659 | phy_trigger_machine(phydev, true); | ||
660 | |||
661 | if (phy_interrupt_is_valid(phydev) && phy_clear_interrupt(phydev)) | ||
662 | goto phy_err; | ||
663 | return IRQ_HANDLED; | ||
664 | |||
665 | phy_err: | ||
666 | phy_error(phydev); | ||
667 | return IRQ_NONE; | ||
668 | } | ||
669 | |||
670 | /** | ||
671 | * phy_change_work - Scheduled by the phy_mac_interrupt to handle PHY changes | ||
672 | * @work: work_struct that describes the work to be done | ||
673 | */ | ||
674 | void phy_change_work(struct work_struct *work) | ||
675 | { | ||
676 | struct phy_device *phydev = | ||
677 | container_of(work, struct phy_device, phy_queue); | ||
678 | |||
679 | phy_change(phydev); | ||
680 | } | ||
681 | |||
682 | /** | ||
621 | * phy_interrupt - PHY interrupt handler | 683 | * phy_interrupt - PHY interrupt handler |
622 | * @irq: interrupt line | 684 | * @irq: interrupt line |
623 | * @phy_dat: phy_device pointer | 685 | * @phy_dat: phy_device pointer |
@@ -632,9 +694,7 @@ static irqreturn_t phy_interrupt(int irq, void *phy_dat) | |||
632 | if (PHY_HALTED == phydev->state) | 694 | if (PHY_HALTED == phydev->state) |
633 | return IRQ_NONE; /* It can't be ours. */ | 695 | return IRQ_NONE; /* It can't be ours. */ |
634 | 696 | ||
635 | phy_change(phydev); | 697 | return phy_change(phydev); |
636 | |||
637 | return IRQ_HANDLED; | ||
638 | } | 698 | } |
639 | 699 | ||
640 | /** | 700 | /** |
@@ -652,23 +712,6 @@ static int phy_enable_interrupts(struct phy_device *phydev) | |||
652 | } | 712 | } |
653 | 713 | ||
654 | /** | 714 | /** |
655 | * phy_disable_interrupts - Disable the PHY interrupts from the PHY side | ||
656 | * @phydev: target phy_device struct | ||
657 | */ | ||
658 | static int phy_disable_interrupts(struct phy_device *phydev) | ||
659 | { | ||
660 | int err; | ||
661 | |||
662 | /* Disable PHY interrupts */ | ||
663 | err = phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED); | ||
664 | if (err) | ||
665 | return err; | ||
666 | |||
667 | /* Clear the interrupt */ | ||
668 | return phy_clear_interrupt(phydev); | ||
669 | } | ||
670 | |||
671 | /** | ||
672 | * phy_start_interrupts - request and enable interrupts for a PHY device | 715 | * phy_start_interrupts - request and enable interrupts for a PHY device |
673 | * @phydev: target phy_device struct | 716 | * @phydev: target phy_device struct |
674 | * | 717 | * |
@@ -711,50 +754,6 @@ int phy_stop_interrupts(struct phy_device *phydev) | |||
711 | EXPORT_SYMBOL(phy_stop_interrupts); | 754 | EXPORT_SYMBOL(phy_stop_interrupts); |
712 | 755 | ||
713 | /** | 756 | /** |
714 | * phy_change - Called by the phy_interrupt to handle PHY changes | ||
715 | * @phydev: phy_device struct that interrupted | ||
716 | */ | ||
717 | void phy_change(struct phy_device *phydev) | ||
718 | { | ||
719 | if (phy_interrupt_is_valid(phydev)) { | ||
720 | if (phydev->drv->did_interrupt && | ||
721 | !phydev->drv->did_interrupt(phydev)) | ||
722 | return; | ||
723 | |||
724 | if (phydev->state == PHY_HALTED) | ||
725 | if (phy_disable_interrupts(phydev)) | ||
726 | goto phy_err; | ||
727 | } | ||
728 | |||
729 | mutex_lock(&phydev->lock); | ||
730 | if ((PHY_RUNNING == phydev->state) || (PHY_NOLINK == phydev->state)) | ||
731 | phydev->state = PHY_CHANGELINK; | ||
732 | mutex_unlock(&phydev->lock); | ||
733 | |||
734 | /* reschedule state queue work to run as soon as possible */ | ||
735 | phy_trigger_machine(phydev, true); | ||
736 | |||
737 | if (phy_interrupt_is_valid(phydev) && phy_clear_interrupt(phydev)) | ||
738 | goto phy_err; | ||
739 | return; | ||
740 | |||
741 | phy_err: | ||
742 | phy_error(phydev); | ||
743 | } | ||
744 | |||
745 | /** | ||
746 | * phy_change_work - Scheduled by the phy_mac_interrupt to handle PHY changes | ||
747 | * @work: work_struct that describes the work to be done | ||
748 | */ | ||
749 | void phy_change_work(struct work_struct *work) | ||
750 | { | ||
751 | struct phy_device *phydev = | ||
752 | container_of(work, struct phy_device, phy_queue); | ||
753 | |||
754 | phy_change(phydev); | ||
755 | } | ||
756 | |||
757 | /** | ||
758 | * phy_stop - Bring down the PHY link, and stop checking the status | 757 | * phy_stop - Bring down the PHY link, and stop checking the status |
759 | * @phydev: target phy_device struct | 758 | * @phydev: target phy_device struct |
760 | */ | 759 | */ |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index b285323327c4..ac23322a32e1 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -1012,10 +1012,17 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
1012 | err = sysfs_create_link(&phydev->mdio.dev.kobj, &dev->dev.kobj, | 1012 | err = sysfs_create_link(&phydev->mdio.dev.kobj, &dev->dev.kobj, |
1013 | "attached_dev"); | 1013 | "attached_dev"); |
1014 | if (!err) { | 1014 | if (!err) { |
1015 | err = sysfs_create_link(&dev->dev.kobj, &phydev->mdio.dev.kobj, | 1015 | err = sysfs_create_link_nowarn(&dev->dev.kobj, |
1016 | "phydev"); | 1016 | &phydev->mdio.dev.kobj, |
1017 | if (err) | 1017 | "phydev"); |
1018 | goto error; | 1018 | if (err) { |
1019 | dev_err(&dev->dev, "could not add device link to %s err %d\n", | ||
1020 | kobject_name(&phydev->mdio.dev.kobj), | ||
1021 | err); | ||
1022 | /* non-fatal - some net drivers can use one netdevice | ||
1023 | * with more then one phy | ||
1024 | */ | ||
1025 | } | ||
1019 | 1026 | ||
1020 | phydev->sysfs_links = true; | 1027 | phydev->sysfs_links = true; |
1021 | } | 1028 | } |
@@ -1666,6 +1673,23 @@ int genphy_config_init(struct phy_device *phydev) | |||
1666 | } | 1673 | } |
1667 | EXPORT_SYMBOL(genphy_config_init); | 1674 | EXPORT_SYMBOL(genphy_config_init); |
1668 | 1675 | ||
1676 | /* This is used for the phy device which doesn't support the MMD extended | ||
1677 | * register access, but it does have side effect when we are trying to access | ||
1678 | * the MMD register via indirect method. | ||
1679 | */ | ||
1680 | int genphy_read_mmd_unsupported(struct phy_device *phdev, int devad, u16 regnum) | ||
1681 | { | ||
1682 | return -EOPNOTSUPP; | ||
1683 | } | ||
1684 | EXPORT_SYMBOL(genphy_read_mmd_unsupported); | ||
1685 | |||
1686 | int genphy_write_mmd_unsupported(struct phy_device *phdev, int devnum, | ||
1687 | u16 regnum, u16 val) | ||
1688 | { | ||
1689 | return -EOPNOTSUPP; | ||
1690 | } | ||
1691 | EXPORT_SYMBOL(genphy_write_mmd_unsupported); | ||
1692 | |||
1669 | int genphy_suspend(struct phy_device *phydev) | 1693 | int genphy_suspend(struct phy_device *phydev) |
1670 | { | 1694 | { |
1671 | return phy_set_bits(phydev, MII_BMCR, BMCR_PDOWN); | 1695 | return phy_set_bits(phydev, MII_BMCR, BMCR_PDOWN); |
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index ee3ca4a2f12b..9f48ecf9c627 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c | |||
@@ -172,6 +172,8 @@ static struct phy_driver realtek_drvs[] = { | |||
172 | .flags = PHY_HAS_INTERRUPT, | 172 | .flags = PHY_HAS_INTERRUPT, |
173 | .ack_interrupt = &rtl821x_ack_interrupt, | 173 | .ack_interrupt = &rtl821x_ack_interrupt, |
174 | .config_intr = &rtl8211b_config_intr, | 174 | .config_intr = &rtl8211b_config_intr, |
175 | .read_mmd = &genphy_read_mmd_unsupported, | ||
176 | .write_mmd = &genphy_write_mmd_unsupported, | ||
175 | }, { | 177 | }, { |
176 | .phy_id = 0x001cc914, | 178 | .phy_id = 0x001cc914, |
177 | .name = "RTL8211DN Gigabit Ethernet", | 179 | .name = "RTL8211DN Gigabit Ethernet", |