Subject: Re: [RFC/Patch] ppc4xx_pm.c

From: Todd Poynor <[email-masked]>
Date: Fri, 26 Jul 2002 17:04:24 -0700

> +++ b/drivers/net/ibm_ocp/ibm_ocp_enet.c
 >
>  	for (curr_emac = 0; curr_emac < emac_max; curr_emac++) {
> +		if(ocp_get_pm(EMAC, curr_emac)){
> +			mtdcr(DCRN_CPMFR,
> +			      mfdcr(DCRN_CPMFR) & ~IBM_CPM_EMAC(ocp_get_pm(EMAC, curr_emac)));
> +		}
>  		ocp_enet_probe(curr_emac);
>  	}
>
> @@ -1193,6 +1199,17 @@
>  static void __exit
>  exit_ppc405_enet(void)
>  {
> +	int i;
> +	struct ocp_dev *emac_dev;
> +
> +	for (i = 0; i < ocp_get_max(EMAC); i++) {
> +		emac_dev = ocp_get_dev(EMAC, i);
> +		if(ocp_get_pm(EMAC, i)){
> +			mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) | IBM_CPM_EMAC(ocp_get_pm(EMAC, i)));
> +			ocp_unregister(emac_dev);
> +		}
> +	}
> +

(1) Also do CPM on/off at open/close hooks, so that closed EMACs are
powered down and powered back up when re-opened?

(2) Move ocp_unregister() call outside "if(ocp_get_pm()" test.

--
Todd

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/