Feature #3316

136: usb_deregister() should be called before usb_serial_deregister() when the device is plugged in

Added by Marina Makienko about 5 years ago. Updated over 3 years ago.

Status:OpenStart date:08/01/2012
Priority:NormalDue date:08/10/2012
Assignee:-% Done:

70%

Category:-
Target version:-
Published in build:

Description

If usb_deregister() is called after usb_serial_deregister() when the device is plugged in, the following Oops occurs.

Commit: 5742d35

History

#1 Updated by Marina Makienko about 5 years ago

  • Status changed from New to Open
  • % Done changed from 0 to 10

#2 Updated by Marina Makienko about 5 years ago

The error in the Linux kernel was detected in testing this model on the core. It is in the "include/linux/usb/serial.h"

#ifndef __LINUX_USB_SERIAL_H
#define __LINUX_USB_SERIAL_H

#include <linux/kref.h>
#include <linux/mutex.h>
#include <linux/sysrq.h>
#include <linux/kfifo.h>

#define SERIAL_TTY_MAJOR    188    /* Nice legal number now */
#define SERIAL_TTY_MINORS    254    /* loads of devices :) */
#define SERIAL_TTY_NO_MINOR    255    /* No minor was assigned */

struct usb_serial_port {
    struct usb_serial    *serial;
    struct tty_port        port;
        ...
}

The struct tty_port is used in this file but not declared.

If you add
#include <linux/tty.h>
in this file, everything works.

#3 Updated by Marina Makienko about 5 years ago

  • Due date set to 08/10/2012
  • Status changed from Open to Resolved
  • % Done changed from 10 to 100

#4 Updated by Evgeny Novikov about 5 years ago

It looks that USB serial drivers don't object against including tty.h header file each time before including usb/serial.h. So most likely this isn't an error and may be treated as made by design. Although may be in future kernel developers will include tty.h inside usb/serial.h as a small optimization.

Marina Makienko wrote:

The error in the Linux kernel was detected in testing this model on the core. It is in the "include/linux/usb/serial.h"

[...]

The struct tty_port is used in this file but not declared.

If you add
#include <linux/tty.h>
in this file, everything works.

#5 Updated by Alexey Khoroshilov over 3 years ago

  • Status changed from Resolved to Open
  • Assignee deleted (Marina Makienko)
  • % Done changed from 100 to 70

Target commit (5742d35) is not found. Rerouter variant should be implemented and tested.

Also available in: Atom PDF