Skip to content

xerox_mfp: SCX-4521 hangs with sanei_usb_clear_halt

My (very old) Samsung SCX-4521F MFP hangs if ENDPOINT HALT CLEAR is performed on its out endpoint. This is what xerox_mfp does on usb_open and usb_close:

https://gitlab.com/sane-project/backends/-/blob/master/backend/xerox_mfp-usb.c?ref_type=heads#L60-75

SANE_Status
usb_dev_open(struct device *dev)
{
    SANE_Status status;

    DBG(3, "%s: open %p\n", __func__, (void *)dev);
    status = sanei_usb_open(dev->sane.name, &dev->dn);
    if (status != SANE_STATUS_GOOD) {
        DBG(1, "%s: sanei_usb_open(%s): %s\n", __func__,
            dev->sane.name, sane_strstatus(status));
        dev->dn = -1;
        return status;
    }
    sanei_usb_clear_halt(dev->dn);
    return SANE_STATUS_GOOD;
}

If I remove sanei_usb_clear_halt, it works fine and stable.

The device is: Bus 002 Device 036: ID 04e8:3419 Samsung Electronics Co., Ltd Composite Device

Edited by ValdikSS
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information