All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Alvaro Gamez Machado <alvaro.gamez@hazent.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.17 06/70] net: phy: dp83822: use BMCR_ANENABLE instead of BMSR_ANEGCAPABLE for DP83620
Date: Sun, 24 Jun 2018 23:21:58 +0800	[thread overview]
Message-ID: <20180624142740.872536245@linuxfoundation.org> (raw)
In-Reply-To: <20180624142740.481662434@linuxfoundation.org>

4.17-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alvaro Gamez Machado <alvaro.gamez@hazent.com>

[ Upstream commit b718e8c8f4f5920aaddc2e52d5e32f494c91129c ]

DP83620 register set is compatible with the DP83848, but it also supports
100base-FX. When the hardware is configured such as that fiber mode is
enabled, autonegotiation is not possible.

The chip, however, doesn't expose this information via BMSR_ANEGCAPABLE.
Instead, this bit is always set high, even if the particular hardware
configuration makes it so that auto negotiation is not possible [1]. Under
these circumstances, the phy subsystem keeps trying for autonegotiation to
happen, without success.

Hereby, we inspect BMCR_ANENABLE bit after genphy_config_init, which on
reset is set to 0 when auto negotiation is disabled, and so we use this
value instead of BMSR_ANEGCAPABLE.

[1] https://e2e.ti.com/support/interface/ethernet/f/903/p/697165/2571170

Signed-off-by: Alvaro Gamez Machado <alvaro.gamez@hazent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/phy/dp83848.c |   35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

--- a/drivers/net/phy/dp83848.c
+++ b/drivers/net/phy/dp83848.c
@@ -74,6 +74,25 @@ static int dp83848_config_intr(struct ph
 	return phy_write(phydev, DP83848_MICR, control);
 }
 
+static int dp83848_config_init(struct phy_device *phydev)
+{
+	int err;
+	int val;
+
+	err = genphy_config_init(phydev);
+	if (err < 0)
+		return err;
+
+	/* DP83620 always reports Auto Negotiation Ability on BMSR. Instead,
+	 * we check initial value of BMCR Auto negotiation enable bit
+	 */
+	val = phy_read(phydev, MII_BMCR);
+	if (!(val & BMCR_ANENABLE))
+		phydev->autoneg = AUTONEG_DISABLE;
+
+	return 0;
+}
+
 static struct mdio_device_id __maybe_unused dp83848_tbl[] = {
 	{ TI_DP83848C_PHY_ID, 0xfffffff0 },
 	{ NS_DP83848C_PHY_ID, 0xfffffff0 },
@@ -83,7 +102,7 @@ static struct mdio_device_id __maybe_unu
 };
 MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
 
-#define DP83848_PHY_DRIVER(_id, _name)				\
+#define DP83848_PHY_DRIVER(_id, _name, _config_init)		\
 	{							\
 		.phy_id		= _id,				\
 		.phy_id_mask	= 0xfffffff0,			\
@@ -92,7 +111,7 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
 		.flags		= PHY_HAS_INTERRUPT,		\
 								\
 		.soft_reset	= genphy_soft_reset,		\
-		.config_init	= genphy_config_init,		\
+		.config_init	= _config_init,			\
 		.suspend	= genphy_suspend,		\
 		.resume		= genphy_resume,		\
 								\
@@ -102,10 +121,14 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
 	}
 
 static struct phy_driver dp83848_driver[] = {
-	DP83848_PHY_DRIVER(TI_DP83848C_PHY_ID, "TI DP83848C 10/100 Mbps PHY"),
-	DP83848_PHY_DRIVER(NS_DP83848C_PHY_ID, "NS DP83848C 10/100 Mbps PHY"),
-	DP83848_PHY_DRIVER(TI_DP83620_PHY_ID, "TI DP83620 10/100 Mbps PHY"),
-	DP83848_PHY_DRIVER(TLK10X_PHY_ID, "TI TLK10X 10/100 Mbps PHY"),
+	DP83848_PHY_DRIVER(TI_DP83848C_PHY_ID, "TI DP83848C 10/100 Mbps PHY",
+			   genphy_config_init),
+	DP83848_PHY_DRIVER(NS_DP83848C_PHY_ID, "NS DP83848C 10/100 Mbps PHY",
+			   genphy_config_init),
+	DP83848_PHY_DRIVER(TI_DP83620_PHY_ID, "TI DP83620 10/100 Mbps PHY",
+			   dp83848_config_init),
+	DP83848_PHY_DRIVER(TLK10X_PHY_ID, "TI TLK10X 10/100 Mbps PHY",
+			   genphy_config_init),
 };
 module_phy_driver(dp83848_driver);
 



  parent reply	other threads:[~2018-06-24 15:40 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-24 15:21 [PATCH 4.17 00/70] 4.17.3-stable review Greg Kroah-Hartman
2018-06-24 15:21 ` [PATCH 4.17 02/70] bonding: re-evaluate force_primary when the primary slave name changes Greg Kroah-Hartman
2018-06-24 15:21 ` [PATCH 4.17 04/70] ipv6: allow PMTU exceptions to local routes Greg Kroah-Hartman
2018-06-24 15:21 ` [PATCH 4.17 05/70] net: dsa: add error handling for pskb_trim_rcsum Greg Kroah-Hartman
2018-06-24 15:21 ` Greg Kroah-Hartman [this message]
2018-06-24 15:21 ` [PATCH 4.17 07/70] net/sched: act_simple: fix parsing of TCA_DEF_DATA Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 08/70] tcp: verify the checksum of the first data segment in a new connection Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 09/70] tls: fix use-after-free in tls_push_record Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 10/70] tls: fix waitall behavior in tls_sw_recvmsg Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 11/70] socket: close race condition between sock_close() and sockfs_setattr() Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 12/70] udp: fix rx queue len reported by diag and proc interface Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 13/70] net: in virtio_net_hdr only add VLAN_HLEN to csum_start if payload holds vlan Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 14/70] hv_netvsc: Fix a network regression after ifdown/ifup Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 15/70] ACPICA: AML parser: attempt to continue loading table after error Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 16/70] ext4: fix hole length detection in ext4_ind_map_blocks() Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 17/70] ext4: update mtime in ext4_punch_hole even if no blocks are released Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 18/70] ext4: do not allow external inodes for inline data Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 19/70] ext4: bubble errors from ext4_find_inline_data_nolock() up to ext4_iget() Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 20/70] ext4: correctly handle a zero-length xattr with a non-zero e_value_offs Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 21/70] ext4: fix fencepost error in check for inode count overflow during resize Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 22/70] driver core: Dont ignore class_dir_create_and_add() failure Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 23/70] Btrfs: allow empty subvol= again Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 24/70] Btrfs: fix clone vs chattr NODATASUM race Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 25/70] Btrfs: fix memory and mount leak in btrfs_ioctl_rm_dev_v2() Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 26/70] btrfs: return error value if create_io_em failed in cow_file_range Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 27/70] btrfs: scrub: Dont use inode pages for device replace Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 28/70] ALSA: usb-audio: Disable the quirk for Nura headset Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 29/70] ALSA: hda/realtek - Enable mic-mute hotkey for several Lenovo AIOs Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 30/70] ALSA: hda/conexant - Add fixup for HP Z2 G4 workstation Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 31/70] ALSA: hda - Handle kzalloc() failure in snd_hda_attach_pcm_stream() Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 32/70] ALSA: hda: add dock and led support for HP EliteBook 830 G5 Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 33/70] ALSA: hda: add dock and led support for HP ProBook 640 G4 Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 34/70] x86/MCE: Fix stack out-of-bounds write in mce-inject.c: Flags_read() Greg Kroah-Hartman
2018-06-24 15:22   ` [4.17,34/70] " Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 35/70] smb3: fix various xid leaks Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 36/70] smb3: on reconnect set PreviousSessionId field Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 37/70] CIFS: 511c54a2f69195b28afb9dd119f03787b1625bb4 adds a check for session expiry Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 38/70] cifs: For SMB2 security informaion query, check for minimum sized security descriptor instead of sizeof FileAllInformation class Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 39/70] nbd: fix nbd device deletion Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 40/70] nbd: update size when connected Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 41/70] nbd: use bd_set_size when updating disk size Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 42/70] blk-mq: reinit q->tag_set_list entry only after grace period Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 43/70] bdi: Move cgroup bdi_writeback to a dedicated low concurrency workqueue Greg Kroah-Hartman
2018-06-24 15:22   ` Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 44/70] cpufreq: Fix new policy initialization during limits updates via sysfs Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 45/70] cpufreq: ti-cpufreq: Fix an incorrect error return value Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 46/70] cpufreq: governors: Fix long idle detection logic in load calculation Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 47/70] libata: zpodd: small read overflow in eject_tray() Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 48/70] libata: Drop SanDisk SD7UB3Q*G1001 NOLPM quirk Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 49/70] nvme/pci: Sync controller reset for AER slot_reset Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 50/70] w1: mxc_w1: Enable clock before calling clk_get_rate() on it Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 51/70] x86/vector: Fix the args of vector_alloc tracepoint Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 52/70] x86/apic/vector: Prevent hlist corruption and leaks Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 53/70] x86/apic: Provide apic_ack_irq() Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 54/70] x86/ioapic: Use apic_ack_irq() Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 55/70] x86/platform/uv: " Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 56/70] irq_remapping: " Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 57/70] genirq/generic_pending: Do not lose pending affinity update Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 58/70] genirq/affinity: Defer affinity setting if irq chip is busy Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 59/70] genirq/migration: Avoid out of line call if pending is not set Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 60/70] x86/intel_rdt: Enable CMT and MBM on new Skylake stepping Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 61/70] media: uvcvideo: Prevent setting unavailable flags Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 62/70] media: rc: ensure input/lirc device can be opened after register Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 63/70] iwlwifi: fw: harden page loading code Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 64/70] orangefs: set i_size on new symlink Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 65/70] orangefs: report attributes_mask and attributes for statx Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 66/70] HID: intel_ish-hid: ipc: register more pm callbacks to support hibernation Greg Kroah-Hartman
2018-06-24 15:22 ` [PATCH 4.17 67/70] HID: wacom: Correct logical maximum Y for 2nd-gen Intuos Pro large Greg Kroah-Hartman
2018-06-24 15:23 ` [PATCH 4.17 68/70] vhost: fix info leak due to uninitialized memory Greg Kroah-Hartman
2018-06-24 15:23 ` [PATCH 4.17 69/70] fs/binfmt_misc.c: do not allow offset overflow Greg Kroah-Hartman
2018-06-24 15:23 ` [PATCH 4.17 70/70] mm, page_alloc: do not break __GFP_THISNODE by zonelist reset Greg Kroah-Hartman
2018-06-25  6:40 ` [PATCH 4.17 00/70] 4.17.3-stable review Naresh Kamboju
2018-06-25  6:55   ` Greg Kroah-Hartman
2018-06-25  7:17     ` Naresh Kamboju
2018-06-25  7:57       ` Naresh Kamboju
2018-06-25 17:20 ` Guenter Roeck
2018-06-25 23:48   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180624142740.872536245@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alvaro.gamez@hazent.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.