lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250214164422.1bb58a89@fedora.home>
Date: Fri, 14 Feb 2025 16:44:22 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: parvathi <parvathi@...thit.com>
Cc: danishanwar@...com, rogerq@...nel.org, andrew+netdev@...n.ch,
 davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
 pabeni@...hat.com, robh@...nel.org, krzk+dt@...nel.org,
 conor+dt@...nel.org, nm@...com, ssantosh@...nel.org,
 richardcochran@...il.com, basharath@...thit.com, schnelle@...ux.ibm.com,
 diogo.ivo@...mens.com, m-karicheri2@...com, horms@...nel.org,
 jacob.e.keller@...el.com, m-malladi@...com, javier.carrasco.cruz@...il.com,
 afd@...com, s-anna@...com, linux-arm-kernel@...ts.infradead.org,
 netdev@...r.kernel.org, devicetree@...r.kernel.org,
 linux-kernel@...r.kernel.org, pratheesh@...com, prajith@...com,
 vigneshr@...com, praneeth@...com, srk@...com, rogerq@...com,
 krishna@...thit.com, pmohan@...thit.com, mohan@...thit.com
Subject: Re: [PATCH net-next v3 04/10] net: ti: prueth: Adds link detection,
 RX and TX support.

Hello,

On Fri, 14 Feb 2025 13:07:51 +0530
parvathi <parvathi@...thit.com> wrote:

> From: Roger Quadros <rogerq@...com>
> 
> Changes corresponding to link configuration such as speed and duplexity.
> IRQ and handler initializations are performed for packet reception.Firmware
> receives the packet from the wire and stores it into OCMC queue. Next, it
> notifies the CPU via interrupt. Upon receiving the interrupt CPU will
> service the IRQ and packet will be processed by pushing the newly allocated
> SKB to upper layers.
> 
> When the user application want to transmit a packet, it will invoke
> sys_send() which will inturn invoke the PRUETH driver, then it will write
> the packet into OCMC queues. PRU firmware will pick up the packet and
> transmit it on to the wire.
> 
> Signed-off-by: Roger Quadros <rogerq@...com>
> Signed-off-by: Andrew F. Davis <afd@...com>
> Signed-off-by: Basharath Hussain Khaja <basharath@...thit.com>
> Signed-off-by: Parvathi Pudi <parvathi@...thit.com>


> +/* update phy/port status information for firmware */
> +static void icssm_emac_update_phystatus(struct prueth_emac *emac)
> +{
> +	struct prueth *prueth = emac->prueth;
> +	u32 phy_speed, port_status = 0;
> +	enum prueth_mem region;
> +	u32 delay;
> +
> +	region = emac->dram;
> +	phy_speed = emac->speed;
> +	icssm_prueth_write_reg(prueth, region, PHY_SPEED_OFFSET, phy_speed);
> +
> +	delay = TX_CLK_DELAY_100M;
> +
> +	delay = delay << PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_SHIFT;
> +
> +	if (emac->port_id) {
> +		regmap_update_bits(prueth->mii_rt,
> +				   PRUSS_MII_RT_TXCFG1,
> +				   PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_MASK,
> +				   delay);
> +	} else {
> +		regmap_update_bits(prueth->mii_rt,
> +				   PRUSS_MII_RT_TXCFG0,
> +				   PRUSS_MII_RT_TXCFG_TX_CLK_DELAY_MASK,
> +				   delay);
> +	}
> +
> +	if (emac->link)
> +		port_status |= PORT_LINK_MASK;
> +
> +	writeb(port_status, prueth->mem[region].va + PORT_STATUS_OFFSET);
> +}
> +
>  /* called back by PHY layer if there is change in link state of hw port*/
>  static void icssm_emac_adjust_link(struct net_device *ndev)
>  {
> @@ -369,6 +426,8 @@ static void icssm_emac_adjust_link(struct net_device *ndev)
>  		emac->link = 0;
>  	}
>  
> +	icssm_emac_update_phystatus(emac);
> +

It looks to me like emac->link, emac->speed and emac->duplex are only
used in icssm_emac_update_phystatus(). If you consider either passing
these as parameters to the above function, or simply merge
icssm_emac_update_phystatus() into your adjust_link callback, you can get
rid of these 3 attributes entirely. It even looks like emac->duplex is
simply unused.

Thanks,

Maxime

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ