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] [day] [month] [year] [list]
Message-Id: <1204764470.7499.6.camel@concordia.ozlabs.ibm.com>
Date:	Thu, 06 Mar 2008 11:47:50 +1100
From:	Michael Ellerman <michael@...erman.id.au>
To:	Olof Johansson <olof@...om.net>
Cc:	netdev@...r.kernel.org, pasemi-linux@...abs.org, jgarzik@...ox.com,
	linuxppc-dev@...abs.org
Subject: Re: [Pasemi-linux] [patch 1/6] pasemi_mac: Move RX/TX section
	enablement to dma_lib

On Wed, 2008-03-05 at 12:21 -0600, Olof Johansson wrote:
> On Tue, Feb 26, 2008 at 08:14:20AM -0600, Olof Johansson wrote:
> > Hi,
> > 
> > On Tue, Feb 26, 2008 at 10:46:06PM +1100, Michael Ellerman wrote:
> > > On Wed, 2008-02-20 at 20:57 -0600, Olof Johansson wrote:
> > > > +	i = 1000;
> > > > +	pasemi_write_dma_reg(PAS_DMA_COM_RXCMD, 0);
> > > > +	while ((i > 0) && (pasemi_read_dma_reg(PAS_DMA_COM_RXSTA) & 1))
> > > > +		i--;
> > > > +	if (i < 0)
> > > > +		printk(KERN_INFO "Warning: Could not disable RX section\n");
> > > > +
> > > > +	i = 1000;
> > > > +	pasemi_write_dma_reg(PAS_DMA_COM_TXCMD, 0);
> > > > +	while ((i > 0) && (pasemi_read_dma_reg(PAS_DMA_COM_TXSTA) & 1))
> > > > +		i--;
> > > 
> > > This kind of caught my eye, is it still going to work when the next core
> > > is twice as fast?
> 
> FYI; I've commited in this change, rest of the patch is identical.
> 
> diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c
> index c529d8d..48cb7c9 100644
> --- a/arch/powerpc/platforms/pasemi/dma_lib.c
> +++ b/arch/powerpc/platforms/pasemi/dma_lib.c
> @@ -17,6 +17,7 @@
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
>   */
>  
> +#include <linux/kernel.h>
>  #include <linux/init.h>
>  #include <linux/module.h>
>  #include <linux/pci.h>
> @@ -410,6 +411,7 @@ int pasemi_dma_init(void)
>  	struct resource res;
>  	struct device_node *dn;
>  	int i, intf, err = 0;
> +	unsigned long timeout;
>  	u32 tmp;
>  
>  	if (!machine_is(pasemi))
> @@ -478,6 +480,34 @@ int pasemi_dma_init(void)
>  	for (i = 0; i < MAX_RXCH; i++)
>  		__set_bit(i, rxch_free);
>  
> +	timeout = jiffies + HZ;
> +	pasemi_write_dma_reg(PAS_DMA_COM_RXCMD, 0);
> +	while (pasemi_read_dma_reg(PAS_DMA_COM_RXSTA) & 1) {
> +		if (time_after(jiffies, timeout)) {
> +			pr_warning("Warning: Could not disable RX section\n");
> +			break;
> +		}
> +	}
> +
> +	timeout = jiffies + HZ;
> +	pasemi_write_dma_reg(PAS_DMA_COM_TXCMD, 0);
> +	while (pasemi_read_dma_reg(PAS_DMA_COM_TXSTA) & 1) {
> +		if (time_after(jiffies, timeout)) {
> +			pr_warning("Warning: Could not disable TX section\n");
> +			break;
> +		}
> +	}

I like that a lot better :)

Ooo, someone beat me to adding pr_warning() - nice.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

Download attachment "signature.asc" of type "application/pgp-signature" (190 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ