Project

General

Profile

Actions

Feature #3316

open

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

Added by Marina Makienko over 11 years ago. Updated about 10 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Start date:
08/01/2012
Due date:
08/10/2012 (over 11 years late)
% Done:

70%

Estimated time:
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

Actions #1

Updated by Marina Makienko over 11 years ago

  • Status changed from New to Open
  • % Done changed from 0 to 10
Actions #2

Updated by Marina Makienko over 11 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.

Actions #3

Updated by Marina Makienko over 11 years ago

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

Updated by Evgeny Novikov over 11 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.

Actions #5

Updated by Alexey Khoroshilov about 10 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.

Actions

Also available in: Atom PDF