<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote cite="mid:47C40548.4080608@ru.mvista.com" type="cite">
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">
+static inline void emac_rx_clk_default(struct emac_instance *dev)
+{
+        if (emac_has_feature(dev, EMAC_FTR_440EP_PHY_CLK_FIX)) {
+                unsigned long flags;
+
+                local_irq_save(flags);
+                mtdcri(SDR0, SDR0_MFR, mfdcri(SDR0, SDR0_MFR) &amp;
+                                        ~(SDR0_MFR_ECS &gt;&gt; dev-&gt;cell_index));
+                local_irq_restore(flags);
+        }
+}
      </pre>
    </blockquote>
    <pre wrap="">Why did you do local_irq_save in these two functions?  mtdcri already
does spin_lock_irqsave...

josh
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Oops, this got copy-pasted from the older ibm_emac.
Thanks,
Valentine.
_______________________________________________</pre>
</blockquote>
<tt>When I saw Josh's question, I thought the irq save/restore was
there to make the read-modify-write atomic; i.e. read SDR0_MFR, "AND"
out some bits, then write it back without the possibility of anything
else touching </tt><tt>SDR0_MFR.&nbsp; I'm just starting to get familiar
with the kernel, so if you have a chance, please help educate me.&nbsp; Does
the irq lock in mtdcri protect the read-modify-write? Or maybe this
R-M-W doesn't need protecting?<br>
<br>
&nbsp;&nbsp;&nbsp; Steve<br>
<br>
</tt>
</body>
</html>