From: khollan <khollan@daktronics.com>
To: linuxppc-embedded@ozlabs.org
Subject: Xilin Temac Timer ?
Date: Wed, 26 Mar 2008 10:02:42 -0700 (PDT) [thread overview]
Message-ID: <16306218.post@talk.nabble.com> (raw)
Hi
What is the purpose of stopping the timer in the ioctl call to read a PHY
register? This is the code:
case SIOCGMIIREG: /* Read GMII PHY register. */
case SIOCDEVPRIVATE + 1: /* for binary compat, remove in 2.5 */
if (data->phy_id > 31 || data->reg_num > 31)
return -ENXIO;
/* Stop the PHY timer to prevent reentrancy. */
spin_lock_irqsave(&XTE_spinlock, flags);
del_timer_sync(&lp->phy_timer);
ret = XTemac_PhyRead(&lp->Emac, data->phy_id,
data->reg_num, &data->val_out);
/* Start the PHY timer up again. */
lp->phy_timer.expires = jiffies + 2 * HZ;
add_timer(&lp->phy_timer);
spin_unlock_irqrestore(&XTE_spinlock, flags);
if (ret != XST_SUCCESS) {
printk(KERN_ERR
"%s: XTemac: could not read from PHY, error=%d.\n",
dev->name, ret);
return -EBUSY;
}
return 0;
I ask because I have an application that needs to read a Phy register before
the timer has started to see if a link is present. This causes a kernel bug
when trying to run the del_timer_sync function because there is not a
running timer. I would like to know if it is safe to remove the timer del
and add but keep the spin lock.
Thanks for your help
Kevin
--
View this message in context: http://www.nabble.com/Xilin-Temac-Timer---tp16306218p16306218.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
next reply other threads:[~2008-03-26 17:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 17:02 khollan [this message]
2008-03-26 19:48 ` Xilinx Temac Timer ? John Linn
2008-03-27 19:31 ` khollan
2008-03-31 14:33 ` JFFS2 root-fs Georg Schardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16306218.post@talk.nabble.com \
--to=khollan@daktronics.com \
--cc=linuxppc-embedded@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.