public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <jhovold@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "Johan Hovold" <jhovold@gmail.com>,
	"Tobias Winter" <tobias@linuxdingsda.de>,
	"Bjørn Mork" <bjorn@mork.no>, "Rob Landley" <rob@landley.net>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/3] USB: serial: make minor allocation dynamic
Date: Tue, 18 Jun 2013 12:23:25 +0200	[thread overview]
Message-ID: <20130618102325.GA2594@localhost> (raw)
In-Reply-To: <20130617201633.GA3903@kroah.com>

> > > @@ -123,8 +116,9 @@ static void return_serial(struct usb_ser
> > >  
> > >  	mutex_lock(&table_lock);
> > >  	for (i = 0; i < serial->num_ports; ++i)
> > > -		serial_table[serial->minor + i] = NULL;
> > > +		idr_remove(&serial_minors, serial->port[i]->minor);
> > >  	mutex_unlock(&table_lock);
> > > +	serial->minors_reserved = 0;
> > 
> > This isn't strictly needed as the serial struct release_serial is only
> > called once when the struct is about to be freed.
> 
> Really?  Why were we doing this type of thing before with the "not
> allocated" flag?  It seems that we were protecting some path that I
> can't remember at the moment.  So to be safe, I'll leave it for now...

It was and is only used when releasing the serial struct to check
whether minors had been allocated or not at probe and if return_serial
(release_minors) should be called. This in done in destroy_serial just
before freeing the struct, so clearing the flag is redundant, but
doesn't hurt anyone, I guess. ;)

Johan

  reply	other threads:[~2013-06-18 10:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 17:31 [PATCH v2 0/3] Increase the number of USB to serial devices we can support at once Greg KH
2013-06-06 17:31 ` [PATCH v2 2/3] USB: serial: make minor allocation dynamic Greg KH
2013-06-07  9:40   ` Johan Hovold
2013-06-07  9:50     ` Johan Hovold
2013-06-07 17:58     ` Greg KH
2013-06-07 10:00   ` Johan Hovold
2013-06-07 17:24     ` Greg KH
2013-06-07 18:04   ` [PATCH v3 " Greg KH
2013-06-08 10:03     ` Johan Hovold
2013-06-17 20:16       ` Greg KH
2013-06-18 10:23         ` Johan Hovold [this message]
2013-06-06 17:31 ` [PATCH v2 3/3] USB: serial: increase the number of devices we support Greg KH
2013-06-06 17:32 ` [PATCH v2 1/3] USB: serial: ports: add minor and port number Greg KH
2013-06-07  6:00 ` [PATCH v2 0/3] Increase the number of USB to serial devices we can support at once Tobias Winter
2013-06-07  9:55   ` Tobias Winter
2013-06-07 17:25     ` Greg KH
2013-06-08  9:14       ` Tobias Winter
2013-06-08 14:26         ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130618102325.GA2594@localhost \
    --to=jhovold@gmail.com \
    --cc=bjorn@mork.no \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=tobias@linuxdingsda.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox