The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net-next v2 7/9] net: ethernet: oa_tc6: fix for minor issues
@ 2026-05-11 18:19 Selvamani Rajagopal
  2026-05-11 19:55 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Selvamani Rajagopal @ 2026-05-11 18:19 UTC (permalink / raw)
  To: Piergiorgio Beruto, parthiban.veerasooran@microchip.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org

- Replaced int with appropriate u32
 - Replaced bool with appropriate int
 - Added check for netif running. Without the check,
   issue was seen, particularly when system is coming up.

Signed-off-by: Selvamani Rajagopal <Selvamani.Rajagopal@onsemi.com>
---
 drivers/net/ethernet/oa_tc6.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/oa_tc6.c b/drivers/net/ethernet/oa_tc6.c
index 48bd75f42..195abdfb0 100644
--- a/drivers/net/ethernet/oa_tc6.c
+++ b/drivers/net/ethernet/oa_tc6.c
@@ -211,7 +211,7 @@ static int oa_tc6_spi_transfer(struct oa_tc6 *tc6,
 	return spi_sync(tc6->spi, &msg);
 }
 
-static int oa_tc6_get_parity(u32 p)
+static u32 oa_tc6_get_parity(u32 p)
 {
 	/* Public domain code snippet, lifted from
 	 * http://www-graphics.stanford.edu/~seander/bithacks.html
@@ -459,9 +459,7 @@ EXPORT_SYMBOL_GPL(oa_tc6_hwtstamp_ioctl);
 /**
  * Add vendor specific MDIO_MMD to OA TC6 MMS mapper value.
  * @tc6: oa_tc6 struct.
- * @mms: vendor defined MMS value.
- *
- * Return: 0 on success otherwise failed.
+ * @mms: vendor defined MMS value for VEND1 mdio device.
  */
 void oa_tc6_set_vend1_mms(struct oa_tc6 *tc6, int mms)
 {
@@ -701,7 +699,7 @@ static int oa_tc6_mdiobus_read(struct mii_bus *bus, int addr, int regnum)
 {
 	struct oa_tc6 *tc6 = bus->priv;
 	u32 regval;
-	bool ret;
+	int ret;
 
 	ret = oa_tc6_read_register(tc6, OA_TC6_PHY_STD_REG_ADDR_BASE |
 				   (regnum & OA_TC6_PHY_STD_REG_ADDR_MASK),
@@ -864,7 +862,7 @@ static void oa_tc6_phy_exit(struct oa_tc6 *tc6)
 	oa_tc6_mdiobus_unregister(tc6);
 }
 
-static int oa_tc6_read_status0(struct oa_tc6 *tc6)
+static u32 oa_tc6_read_status0(struct oa_tc6 *tc6)
 {
 	u32 regval;
 	int ret;
@@ -1377,7 +1375,11 @@ static int oa_tc6_try_spi_transfer(struct oa_tc6 *tc6)
 
 		if (tc6->int_flag) {
 			tc6->int_flag = false;
-			if (spi_len == 0) {
+
+			/* If nothing to transmit and interface isn't up,
+			 * avoid sending empty chunks.
+			 */
+			if (spi_len == 0 && netif_running(tc6->netdev)) {
 				oa_tc6_add_empty_chunks_to_spi_buf(tc6, 1);
 				spi_len = OA_TC6_CHUNK_SIZE;
 			}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-11 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 18:19 [PATCH net-next v2 7/9] net: ethernet: oa_tc6: fix for minor issues Selvamani Rajagopal
2026-05-11 19:55 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox