Hi Andrew,
> > +static int ksz_port_mdb_del(struct dsa_switch *ds, int port,
> > +                       const struct switchdev_obj_port_mdb *mdb)
> > +{
> > +   struct ksz_device *dev = ds->priv;
> > +   u32 static_table[4];
> > +   u32 data;
> > +   int index;
> > +   int ret = 0;
> > +   u32 mac_hi, mac_lo;
> > +
> > +   mac_hi = ((mdb->addr[0] << 8) | mdb->addr[1]);
> > +   mac_lo = ((mdb->addr[2] << 24) | (mdb->addr[3] << 16));
> > +   mac_lo |= ((mdb->addr[4] << 8) | mdb->addr[5]);
> > +
> > +   mutex_lock(&dev->alu_mutex);
> > +
> > +   for (index = 0; index < dev->num_statics; index++) {
> > +           /* find empty slot first */
> > +           data = (index << ALU_STAT_INDEX_S) |
> > +                   ALU_STAT_READ | ALU_STAT_START;
> > +           ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data);
> > +
> > +           /* wait to be finished */
> > +           ret = wait_alu_sta_ready(dev, ALU_STAT_START, 1000);
> > +           if (ret < 0) {
> > +                   dev_dbg(dev->dev, "Failed to read ALU STATIC\n");
> > +                   goto exit;
> > +           }
> > +
> > +           /* read ALU static table */
> > +           read_table(ds, static_table);
> > +
> > +           mutex_unlock(&dev->alu_mutex);
> 
> Is this mutex unlock here correct? It looks like we will unlock it
> again when we eventually get to exit: below.
> 
Thanks for catching this. Will submit new patch soon.

- Woojung

Reply via email to