> > +void ls7a_mm_wreg_locked(struct loongson_device *ldev, u32 offset, 
u32 val)
> > +{
> > +       unsigned long flags;
> > +
> > +       spin_lock_irqsave(&ldev->mmio_lock, flags);
> > +       writel(val, ldev->mmio + offset);
> > +       spin_unlock_irqrestore(&ldev->mmio_lock, flags);
> > +}
> Why lock and disable irq? To workaround the hw issue from the first
> revision of LS7A? If so, I suggest to remove the workaround. Because:
> 1, mmio r/w will be used in irq context; 2, newer revision of LS7A
> doesn't need workaround.
Yes,the lock is to workaround the hw issue,I have decided to remove the lock.
> 
> > +
> > +       /* DC IO */
> > +       ldev->io = (void *)TO_UNCAC(LS7A_CHIPCFG_REG_BASE);
> TO_UNCAC() is a MIPS-specific macro, I think ioremap() is better.
OK.I have switched to ioremap, and the test passed.
> 
> > +#define LS7A_CHIPCFG_REG_BASE (0x10010000)
> > +#define PCI_DEVICE_ID_LOONGSON_DC 0x7a06
> > +#define PCI_DEVICE_ID_LOONGSON_GPU 0x7a15
> They are already defined in include/linux/pci_ids.h.
In include/linux/pci_ids.h only defined PCI_VENDOR_ID_LOONGSON.

------------------------------
Loongson LiChenyang

Reply via email to