Cyril Wallois wrote: > Hi all and thanks Jan for your help, > > I send a new version of the kernel Oops which correspond to the driver > version, and it should be more readable in a file than in the message's > content.
You should enabled debug symbols for you kernel to get all those
addresses resolved.
> static void
> dm9000_hash_table(struct rtnet_device *dev)
> {
> board_info_t *db = dev->priv;//netdev_priv(dev);
> struct dev_mc_list *mcptr = dev->mc_list;
> int mc_cnt = dev->mc_count;
> int i, oft;
> u32 hash_val;
> u16 hash_table[4];
> u8 rcr = RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN;
> // unsigned long flags;
>
> rtdm_printk("hash table...");
> // spin_lock_irqsave(&db->lock, flags);
>
> rtdm_irq_disable(&db->irq_handle);
Don't fiddle with the IRQ line, it might be shared with some other
device. Even if not, this may be a heavy-weighted service. Just use
rtdm_lock_get_irqsave.
> rtdm_lock_get(&db->lock);
>
> for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
> iow(db, oft, dev->dev_addr[i]);
>
> /* Clear Hash Table */
> for (i = 0; i < 4; i++)
> hash_table[i] = 0x0;
>
> /* broadcast address */
> hash_table[3] = 0x8000;
>
> if (dev->flags & IFF_PROMISC)
> rcr |= RCR_PRMSC;
>
> if (dev->flags & IFF_ALLMULTI)
> rcr |= RCR_ALL;
>
> /* the multicast address in Hash Table : 64 bits */
> for (i = 0; i < mc_cnt; i++, mcptr = mcptr->next) {
> hash_val = ether_crc_le(6, mcptr->dmi_addr) & 0x3f;
> hash_table[hash_val / 16] |= (u16) 1 << (hash_val % 16);
> }
>
> /* Write the hash table to MAC MD table */
> for (i = 0, oft = DM9000_MAR; i < 4; i++) {
> iow(db, oft++, hash_table[i]);
> iow(db, oft++, hash_table[i] >> 8);
> }
>
> iow(db, DM9000_RCR, rcr);
>
> rtdm_lock_put(&db->lock);
> rtdm_irq_enable(&db->irq_handle);
> // spin_unlock_irqrestore(&db->lock, flags);
> rtdm_printk(" ok");
> }
...
> static int dm9000_interrupt(rtdm_irq_t *irq_handle)//int irq, void *dev_id)
> {
>
> nanosecs_abs_t time_stamp = rtdm_clock_read();
> struct rtnet_device *dev = rtdm_irq_get_arg(irq_handle, struct
> rtnet_device);
>
> board_info_t *db = dev->priv;
> int int_status;
> unsigned int old_packet_cnt = db->stats.rx_packets;
> u8 reg_save;
> rtdm_printk("interrupt...");
>
> /* A real interrupt coming */
>
> /* holders of db->lock must always block IRQs */
> rtdm_lock_get(&db->lock);
>
> /* Save previous register address */
> reg_save = readb(db->io_addr);
>
> /* Disable all interrupts */
> iow(db, DM9000_IMR, IMR_PAR);
>
> /* Got DM9000 interrupt status */
> int_status = ior(db, DM9000_ISR); /* Got ISR */
> iow(db, DM9000_ISR, int_status); /* Clear ISR status */
>
> // if (netif_msg_intr(db))
> // dev_dbg(db->dev, "interrupt status %02x\n", int_status);
>
> /* Received the coming packet */
> if (int_status & ISR_PRS){
> dm9000_rx(dev,&time_stamp);
> }
> /* Transmit Interrupt check */
> if (int_status & ISR_PTS){
> dm9000_tx_done(dev, db);
> }
>
> if (db->type != TYPE_DM9000E) {
> if (int_status & ISR_LNKCHNG) {
> /* fire a link-change request */
> schedule_delayed_work(&db->phy_poll, 1);
This may explain the oops (definitely if this code is executed and you
have CONFIG_IPIPE_DEBUG_CONTEXT on): This is a Linux service with Linux
locking included called over an RT interrupt.
> }
> }
>
> /* Re-enable interrupt mask */
> iow(db, DM9000_IMR, db->imr_all);
>
> /* Restore previous register address */
> writeb(reg_save, db->io_addr);
>
> rtdm_lock_put(&db->lock);
> if (old_packet_cnt != db->stats.rx_packets)
> rt_mark_stack_mgr(dev);
> // rtdm_irq_enable(&db->irq_handle);
> rtdm_printk(" ok\n");
> return RTDM_IRQ_HANDLED;
> }
>
The rest looks good on first glance.
Jan
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ RTnet-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rtnet-users

