Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3296c872
Commit
3296c872
authored
Dec 15, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge nuts.ninka.net:/disk1/davem/BK/sparcwork-2.5
into nuts.ninka.net:/disk1/davem/BK/sparc-2.5
parents
079af958
3f69168f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
89 additions
and
61 deletions
+89
-61
drivers/md/raid5.c
drivers/md/raid5.c
+25
-9
drivers/usb/core/devio.c
drivers/usb/core/devio.c
+1
-1
drivers/usb/core/hub.c
drivers/usb/core/hub.c
+7
-3
drivers/usb/core/usb.c
drivers/usb/core/usb.c
+1
-0
drivers/usb/image/Kconfig
drivers/usb/image/Kconfig
+3
-1
drivers/usb/misc/auerswald.c
drivers/usb/misc/auerswald.c
+2
-2
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.c
+14
-36
drivers/usb/storage/datafab.c
drivers/usb/storage/datafab.c
+1
-1
drivers/usb/storage/jumpshot.c
drivers/usb/storage/jumpshot.c
+1
-1
kernel/exit.c
kernel/exit.c
+20
-3
lib/kobject.c
lib/kobject.c
+7
-4
scripts/file2alias.c
scripts/file2alias.c
+7
-0
No files found.
drivers/md/raid5.c
View file @
3296c872
...
@@ -40,6 +40,16 @@
...
@@ -40,6 +40,16 @@
#define stripe_hash(conf, sect) ((conf)->stripe_hashtbl[((sect) >> STRIPE_SHIFT) & HASH_MASK])
#define stripe_hash(conf, sect) ((conf)->stripe_hashtbl[((sect) >> STRIPE_SHIFT) & HASH_MASK])
/* bio's attached to a stripe+device for I/O are linked together in bi_sector
* order without overlap. There may be several bio's per stripe+device, and
* a bio could span several devices.
* When walking this list for a particular stripe+device, we must never proceed
* beyond a bio that extends past this device, as the next bio might no longer
* be valid.
* This macro is used to determine the 'next' bio in the list, given the sector
* of the current stripe+device
*/
#define r5_next_bio(bio, sect) ( ( bio->bi_sector + (bio->bi_size>>9) < sect + STRIPE_SECTORS) ? bio->bi_next : NULL)
/*
/*
* The following can be used to debug the driver
* The following can be used to debug the driver
*/
*/
...
@@ -613,7 +623,7 @@ static void copy_data(int frombio, struct bio *bio,
...
@@ -613,7 +623,7 @@ static void copy_data(int frombio, struct bio *bio,
int
i
;
int
i
;
for
(;
bio
&&
bio
->
bi_sector
<
sector
+
STRIPE_SECTORS
;
for
(;
bio
&&
bio
->
bi_sector
<
sector
+
STRIPE_SECTORS
;
bio
=
bio
->
bi_next
)
{
bio
=
r5_next_bio
(
bio
,
sector
)
)
{
int
page_offset
;
int
page_offset
;
if
(
bio
->
bi_sector
>=
sector
)
if
(
bio
->
bi_sector
>=
sector
)
page_offset
=
(
signed
)(
bio
->
bi_sector
-
sector
)
*
512
;
page_offset
=
(
signed
)(
bio
->
bi_sector
-
sector
)
*
512
;
...
@@ -738,7 +748,11 @@ static void compute_parity(struct stripe_head *sh, int method)
...
@@ -738,7 +748,11 @@ static void compute_parity(struct stripe_head *sh, int method)
for
(
i
=
disks
;
i
--
;)
for
(
i
=
disks
;
i
--
;)
if
(
sh
->
dev
[
i
].
written
)
{
if
(
sh
->
dev
[
i
].
written
)
{
sector_t
sector
=
sh
->
dev
[
i
].
sector
;
sector_t
sector
=
sh
->
dev
[
i
].
sector
;
copy_data
(
1
,
sh
->
dev
[
i
].
written
,
sh
->
dev
[
i
].
page
,
sector
);
struct
bio
*
wbi
=
sh
->
dev
[
i
].
written
;
while
(
wbi
&&
wbi
->
bi_sector
<
sector
+
STRIPE_SECTORS
)
{
copy_data
(
1
,
wbi
,
sh
->
dev
[
i
].
page
,
sector
);
wbi
=
r5_next_bio
(
wbi
,
sector
);
}
set_bit
(
R5_LOCKED
,
&
sh
->
dev
[
i
].
flags
);
set_bit
(
R5_LOCKED
,
&
sh
->
dev
[
i
].
flags
);
set_bit
(
R5_UPTODATE
,
&
sh
->
dev
[
i
].
flags
);
set_bit
(
R5_UPTODATE
,
&
sh
->
dev
[
i
].
flags
);
...
@@ -791,8 +805,10 @@ static void add_stripe_bio (struct stripe_head *sh, struct bio *bi, int dd_idx,
...
@@ -791,8 +805,10 @@ static void add_stripe_bio (struct stripe_head *sh, struct bio *bi, int dd_idx,
bip
=
&
sh
->
dev
[
dd_idx
].
towrite
;
bip
=
&
sh
->
dev
[
dd_idx
].
towrite
;
else
else
bip
=
&
sh
->
dev
[
dd_idx
].
toread
;
bip
=
&
sh
->
dev
[
dd_idx
].
toread
;
while
(
*
bip
&&
(
*
bip
)
->
bi_sector
<
bi
->
bi_sector
)
while
(
*
bip
&&
(
*
bip
)
->
bi_sector
<
bi
->
bi_sector
)
{
BUG_ON
((
*
bip
)
->
bi_sector
+
((
*
bip
)
->
bi_size
>>
9
)
>
bi
->
bi_sector
);
bip
=
&
(
*
bip
)
->
bi_next
;
bip
=
&
(
*
bip
)
->
bi_next
;
}
/* FIXME do I need to worry about overlapping bion */
/* FIXME do I need to worry about overlapping bion */
if
(
*
bip
&&
bi
->
bi_next
&&
(
*
bip
)
!=
bi
->
bi_next
)
if
(
*
bip
&&
bi
->
bi_next
&&
(
*
bip
)
!=
bi
->
bi_next
)
BUG
();
BUG
();
...
@@ -813,7 +829,7 @@ static void add_stripe_bio (struct stripe_head *sh, struct bio *bi, int dd_idx,
...
@@ -813,7 +829,7 @@ static void add_stripe_bio (struct stripe_head *sh, struct bio *bi, int dd_idx,
for
(
bi
=
sh
->
dev
[
dd_idx
].
towrite
;
for
(
bi
=
sh
->
dev
[
dd_idx
].
towrite
;
sector
<
sh
->
dev
[
dd_idx
].
sector
+
STRIPE_SECTORS
&&
sector
<
sh
->
dev
[
dd_idx
].
sector
+
STRIPE_SECTORS
&&
bi
&&
bi
->
bi_sector
<=
sector
;
bi
&&
bi
->
bi_sector
<=
sector
;
bi
=
bi
->
bi_next
)
{
bi
=
r5_next_bio
(
bi
,
sh
->
dev
[
dd_idx
].
sector
)
)
{
if
(
bi
->
bi_sector
+
(
bi
->
bi_size
>>
9
)
>=
sector
)
if
(
bi
->
bi_sector
+
(
bi
->
bi_size
>>
9
)
>=
sector
)
sector
=
bi
->
bi_sector
+
(
bi
->
bi_size
>>
9
);
sector
=
bi
->
bi_sector
+
(
bi
->
bi_size
>>
9
);
}
}
...
@@ -883,7 +899,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -883,7 +899,7 @@ static void handle_stripe(struct stripe_head *sh)
spin_unlock_irq
(
&
conf
->
device_lock
);
spin_unlock_irq
(
&
conf
->
device_lock
);
while
(
rbi
&&
rbi
->
bi_sector
<
dev
->
sector
+
STRIPE_SECTORS
)
{
while
(
rbi
&&
rbi
->
bi_sector
<
dev
->
sector
+
STRIPE_SECTORS
)
{
copy_data
(
0
,
rbi
,
dev
->
page
,
dev
->
sector
);
copy_data
(
0
,
rbi
,
dev
->
page
,
dev
->
sector
);
rbi2
=
r
bi
->
bi_next
;
rbi2
=
r
5_next_bio
(
rbi
,
dev
->
sector
)
;
spin_lock_irq
(
&
conf
->
device_lock
);
spin_lock_irq
(
&
conf
->
device_lock
);
if
(
--
rbi
->
bi_phys_segments
==
0
)
{
if
(
--
rbi
->
bi_phys_segments
==
0
)
{
rbi
->
bi_next
=
return_bi
;
rbi
->
bi_next
=
return_bi
;
...
@@ -928,7 +944,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -928,7 +944,7 @@ static void handle_stripe(struct stripe_head *sh)
if
(
bi
)
to_write
--
;
if
(
bi
)
to_write
--
;
while
(
bi
&&
bi
->
bi_sector
<
sh
->
dev
[
i
].
sector
+
STRIPE_SECTORS
){
while
(
bi
&&
bi
->
bi_sector
<
sh
->
dev
[
i
].
sector
+
STRIPE_SECTORS
){
struct
bio
*
nextbi
=
bi
->
bi_next
;
struct
bio
*
nextbi
=
r5_next_bio
(
bi
,
sh
->
dev
[
i
].
sector
)
;
clear_bit
(
BIO_UPTODATE
,
&
bi
->
bi_flags
);
clear_bit
(
BIO_UPTODATE
,
&
bi
->
bi_flags
);
if
(
--
bi
->
bi_phys_segments
==
0
)
{
if
(
--
bi
->
bi_phys_segments
==
0
)
{
md_write_end
(
conf
->
mddev
);
md_write_end
(
conf
->
mddev
);
...
@@ -941,7 +957,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -941,7 +957,7 @@ static void handle_stripe(struct stripe_head *sh)
bi
=
sh
->
dev
[
i
].
written
;
bi
=
sh
->
dev
[
i
].
written
;
sh
->
dev
[
i
].
written
=
NULL
;
sh
->
dev
[
i
].
written
=
NULL
;
while
(
bi
&&
bi
->
bi_sector
<
sh
->
dev
[
i
].
sector
+
STRIPE_SECTORS
)
{
while
(
bi
&&
bi
->
bi_sector
<
sh
->
dev
[
i
].
sector
+
STRIPE_SECTORS
)
{
struct
bio
*
bi2
=
bi
->
bi_next
;
struct
bio
*
bi2
=
r5_next_bio
(
bi
,
sh
->
dev
[
i
].
sector
)
;
clear_bit
(
BIO_UPTODATE
,
&
bi
->
bi_flags
);
clear_bit
(
BIO_UPTODATE
,
&
bi
->
bi_flags
);
if
(
--
bi
->
bi_phys_segments
==
0
)
{
if
(
--
bi
->
bi_phys_segments
==
0
)
{
md_write_end
(
conf
->
mddev
);
md_write_end
(
conf
->
mddev
);
...
@@ -957,7 +973,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -957,7 +973,7 @@ static void handle_stripe(struct stripe_head *sh)
sh
->
dev
[
i
].
toread
=
NULL
;
sh
->
dev
[
i
].
toread
=
NULL
;
if
(
bi
)
to_read
--
;
if
(
bi
)
to_read
--
;
while
(
bi
&&
bi
->
bi_sector
<
sh
->
dev
[
i
].
sector
+
STRIPE_SECTORS
){
while
(
bi
&&
bi
->
bi_sector
<
sh
->
dev
[
i
].
sector
+
STRIPE_SECTORS
){
struct
bio
*
nextbi
=
bi
->
bi_next
;
struct
bio
*
nextbi
=
r5_next_bio
(
bi
,
sh
->
dev
[
i
].
sector
)
;
clear_bit
(
BIO_UPTODATE
,
&
bi
->
bi_flags
);
clear_bit
(
BIO_UPTODATE
,
&
bi
->
bi_flags
);
if
(
--
bi
->
bi_phys_segments
==
0
)
{
if
(
--
bi
->
bi_phys_segments
==
0
)
{
bi
->
bi_next
=
return_bi
;
bi
->
bi_next
=
return_bi
;
...
@@ -1000,7 +1016,7 @@ static void handle_stripe(struct stripe_head *sh)
...
@@ -1000,7 +1016,7 @@ static void handle_stripe(struct stripe_head *sh)
wbi
=
dev
->
written
;
wbi
=
dev
->
written
;
dev
->
written
=
NULL
;
dev
->
written
=
NULL
;
while
(
wbi
&&
wbi
->
bi_sector
<
dev
->
sector
+
STRIPE_SECTORS
)
{
while
(
wbi
&&
wbi
->
bi_sector
<
dev
->
sector
+
STRIPE_SECTORS
)
{
wbi2
=
wbi
->
bi_next
;
wbi2
=
r5_next_bio
(
wbi
,
dev
->
sector
)
;
if
(
--
wbi
->
bi_phys_segments
==
0
)
{
if
(
--
wbi
->
bi_phys_segments
==
0
)
{
md_write_end
(
conf
->
mddev
);
md_write_end
(
conf
->
mddev
);
wbi
->
bi_next
=
return_bi
;
wbi
->
bi_next
=
return_bi
;
...
...
drivers/usb/core/devio.c
View file @
3296c872
...
@@ -261,7 +261,6 @@ static void async_completed(struct urb *urb, struct pt_regs *regs)
...
@@ -261,7 +261,6 @@ static void async_completed(struct urb *urb, struct pt_regs *regs)
spin_lock
(
&
ps
->
lock
);
spin_lock
(
&
ps
->
lock
);
list_move_tail
(
&
as
->
asynclist
,
&
ps
->
async_completed
);
list_move_tail
(
&
as
->
asynclist
,
&
ps
->
async_completed
);
spin_unlock
(
&
ps
->
lock
);
spin_unlock
(
&
ps
->
lock
);
wake_up
(
&
ps
->
wait
);
if
(
as
->
signr
)
{
if
(
as
->
signr
)
{
sinfo
.
si_signo
=
as
->
signr
;
sinfo
.
si_signo
=
as
->
signr
;
sinfo
.
si_errno
=
as
->
urb
->
status
;
sinfo
.
si_errno
=
as
->
urb
->
status
;
...
@@ -269,6 +268,7 @@ static void async_completed(struct urb *urb, struct pt_regs *regs)
...
@@ -269,6 +268,7 @@ static void async_completed(struct urb *urb, struct pt_regs *regs)
sinfo
.
si_addr
=
(
void
*
)
as
->
userurb
;
sinfo
.
si_addr
=
(
void
*
)
as
->
userurb
;
send_sig_info
(
as
->
signr
,
&
sinfo
,
as
->
task
);
send_sig_info
(
as
->
signr
,
&
sinfo
,
as
->
task
);
}
}
wake_up
(
&
ps
->
wait
);
}
}
static
void
destroy_async
(
struct
dev_state
*
ps
,
struct
list_head
*
list
)
static
void
destroy_async
(
struct
dev_state
*
ps
,
struct
list_head
*
list
)
...
...
drivers/usb/core/hub.c
View file @
3296c872
...
@@ -692,6 +692,9 @@ static int hub_port_status(struct usb_device *dev, int port,
...
@@ -692,6 +692,9 @@ static int hub_port_status(struct usb_device *dev, int port,
struct
usb_hub
*
hub
=
usb_get_intfdata
(
dev
->
actconfig
->
interface
[
0
]);
struct
usb_hub
*
hub
=
usb_get_intfdata
(
dev
->
actconfig
->
interface
[
0
]);
int
ret
;
int
ret
;
if
(
!
hub
)
return
-
ENODEV
;
ret
=
get_port_status
(
dev
,
port
+
1
,
&
hub
->
status
->
port
);
ret
=
get_port_status
(
dev
,
port
+
1
,
&
hub
->
status
->
port
);
if
(
ret
<
0
)
if
(
ret
<
0
)
dev_err
(
hubdev
(
dev
),
dev_err
(
hubdev
(
dev
),
...
@@ -926,7 +929,6 @@ static void hub_port_connect_change(struct usb_hub *hubstate, int port,
...
@@ -926,7 +929,6 @@ static void hub_port_connect_change(struct usb_hub *hubstate, int port,
break
;
break
;
}
}
hub
->
children
[
port
]
=
dev
;
dev
->
state
=
USB_STATE_POWERED
;
dev
->
state
=
USB_STATE_POWERED
;
/* Reset the device, and detect its speed */
/* Reset the device, and detect its speed */
...
@@ -979,8 +981,10 @@ static void hub_port_connect_change(struct usb_hub *hubstate, int port,
...
@@ -979,8 +981,10 @@ static void hub_port_connect_change(struct usb_hub *hubstate, int port,
dev
->
dev
.
parent
=
dev
->
parent
->
dev
.
parent
->
parent
;
dev
->
dev
.
parent
=
dev
->
parent
->
dev
.
parent
->
parent
;
/* Run it through the hoops (find a driver, etc) */
/* Run it through the hoops (find a driver, etc) */
if
(
!
usb_new_device
(
dev
,
&
hub
->
dev
))
if
(
!
usb_new_device
(
dev
,
&
hub
->
dev
))
{
hub
->
children
[
port
]
=
dev
;
goto
done
;
goto
done
;
}
/* Free the configuration if there was an error */
/* Free the configuration if there was an error */
usb_put_dev
(
dev
);
usb_put_dev
(
dev
);
...
@@ -989,7 +993,6 @@ static void hub_port_connect_change(struct usb_hub *hubstate, int port,
...
@@ -989,7 +993,6 @@ static void hub_port_connect_change(struct usb_hub *hubstate, int port,
delay
=
HUB_LONG_RESET_TIME
;
delay
=
HUB_LONG_RESET_TIME
;
}
}
hub
->
children
[
port
]
=
NULL
;
hub_port_disable
(
hub
,
port
);
hub_port_disable
(
hub
,
port
);
done:
done:
up
(
&
usb_address0_sem
);
up
(
&
usb_address0_sem
);
...
@@ -1342,6 +1345,7 @@ int usb_physical_reset_device(struct usb_device *dev)
...
@@ -1342,6 +1345,7 @@ int usb_physical_reset_device(struct usb_device *dev)
dev
->
devpath
,
ret
);
dev
->
devpath
,
ret
);
return
ret
;
return
ret
;
}
}
dev
->
state
=
USB_STATE_CONFIGURED
;
for
(
i
=
0
;
i
<
dev
->
actconfig
->
desc
.
bNumInterfaces
;
i
++
)
{
for
(
i
=
0
;
i
<
dev
->
actconfig
->
desc
.
bNumInterfaces
;
i
++
)
{
struct
usb_interface
*
intf
=
dev
->
actconfig
->
interface
[
i
];
struct
usb_interface
*
intf
=
dev
->
actconfig
->
interface
[
i
];
...
...
drivers/usb/core/usb.c
View file @
3296c872
...
@@ -1120,6 +1120,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
...
@@ -1120,6 +1120,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
if
(
err
)
{
if
(
err
)
{
dev_err
(
&
dev
->
dev
,
"can't set config #%d, error %d
\n
"
,
dev_err
(
&
dev
->
dev
,
"can't set config #%d, error %d
\n
"
,
dev
->
config
[
0
].
desc
.
bConfigurationValue
,
err
);
dev
->
config
[
0
].
desc
.
bConfigurationValue
,
err
);
device_del
(
&
dev
->
dev
);
goto
fail
;
goto
fail
;
}
}
...
...
drivers/usb/image/Kconfig
View file @
3296c872
...
@@ -18,13 +18,15 @@ config USB_MDC800
...
@@ -18,13 +18,15 @@ config USB_MDC800
module will be called mdc800.
module will be called mdc800.
config USB_SCANNER
config USB_SCANNER
tristate "USB Scanner support"
tristate "USB Scanner support
(OBSOLETE)
"
depends on USB
depends on USB
help
help
Say Y here if you want to connect a USB scanner to your computer's
Say Y here if you want to connect a USB scanner to your computer's
USB port. Please read <file:Documentation/usb/scanner.txt> for more
USB port. Please read <file:Documentation/usb/scanner.txt> for more
information.
information.
This driver has been obsoleted by support via libusb.
To compile this driver as a module, choose M here: the
To compile this driver as a module, choose M here: the
module will be called scanner.
module will be called scanner.
...
...
drivers/usb/misc/auerswald.c
View file @
3296c872
...
@@ -324,7 +324,7 @@ static void auerchain_complete (struct urb * urb, struct pt_regs *regs)
...
@@ -324,7 +324,7 @@ static void auerchain_complete (struct urb * urb, struct pt_regs *regs)
urb
=
acep
->
urbp
;
urb
=
acep
->
urbp
;
dbg
(
"auerchain_complete: submitting next urb from chain"
);
dbg
(
"auerchain_complete: submitting next urb from chain"
);
urb
->
status
=
0
;
/* needed! */
urb
->
status
=
0
;
/* needed! */
result
=
usb_submit_urb
(
urb
,
GFP_
KERNEL
);
result
=
usb_submit_urb
(
urb
,
GFP_
ATOMIC
);
/* check for submit errors */
/* check for submit errors */
if
(
result
)
{
if
(
result
)
{
...
@@ -402,7 +402,7 @@ static int auerchain_submit_urb_list (pauerchain_t acp, struct urb * urb, int ea
...
@@ -402,7 +402,7 @@ static int auerchain_submit_urb_list (pauerchain_t acp, struct urb * urb, int ea
if
(
acep
)
{
if
(
acep
)
{
dbg
(
"submitting urb immediate"
);
dbg
(
"submitting urb immediate"
);
urb
->
status
=
0
;
/* needed! */
urb
->
status
=
0
;
/* needed! */
result
=
usb_submit_urb
(
urb
,
GFP_
KERNEL
);
result
=
usb_submit_urb
(
urb
,
GFP_
ATOMIC
);
/* check for submit errors */
/* check for submit errors */
if
(
result
)
{
if
(
result
)
{
urb
->
status
=
result
;
urb
->
status
=
result
;
...
...
drivers/usb/serial/usb-serial.c
View file @
3296c872
...
@@ -493,12 +493,15 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
...
@@ -493,12 +493,15 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
return
retval
;
return
retval
;
}
}
static
void
__serial_close
(
struct
usb_serial_port
*
port
,
struct
file
*
filp
)
static
void
serial_close
(
struct
tty_struct
*
tty
,
struct
file
*
filp
)
{
{
if
(
!
port
->
open_count
)
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
tty
->
driver_data
;
dbg
(
"%s - port not opened"
,
__FUNCTION__
);
struct
usb_serial
*
serial
=
get_usb_serial
(
port
,
__FUNCTION__
);
if
(
!
serial
)
return
;
return
;
}
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
--
port
->
open_count
;
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
if
(
port
->
open_count
<=
0
)
{
...
@@ -506,30 +509,18 @@ static void __serial_close(struct usb_serial_port *port, struct file *filp)
...
@@ -506,30 +509,18 @@ static void __serial_close(struct usb_serial_port *port, struct file *filp)
* port is being closed by the last owner */
* port is being closed by the last owner */
port
->
serial
->
type
->
close
(
port
,
filp
);
port
->
serial
->
type
->
close
(
port
,
filp
);
port
->
open_count
=
0
;
port
->
open_count
=
0
;
if
(
port
->
tty
)
{
if
(
port
->
tty
->
driver_data
)
port
->
tty
->
driver_data
=
NULL
;
port
->
tty
=
NULL
;
}
}
}
module_put
(
port
->
serial
->
type
->
owner
);
module_put
(
port
->
serial
->
type
->
owner
);
kobject_put
(
&
port
->
serial
->
kobj
);
kobject_put
(
&
port
->
serial
->
kobj
);
}
}
static
void
serial_close
(
struct
tty_struct
*
tty
,
struct
file
*
filp
)
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
tty
->
driver_data
;
struct
usb_serial
*
serial
=
get_usb_serial
(
port
,
__FUNCTION__
);
if
(
!
serial
)
return
;
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
/* if disconnect beat us to the punch here, there's nothing to do */
if
(
tty
&&
tty
->
driver_data
)
{
__serial_close
(
port
,
filp
);
tty
->
driver_data
=
NULL
;
}
port
->
tty
=
NULL
;
}
static
int
serial_write
(
struct
tty_struct
*
tty
,
int
from_user
,
const
unsigned
char
*
buf
,
int
count
)
static
int
serial_write
(
struct
tty_struct
*
tty
,
int
from_user
,
const
unsigned
char
*
buf
,
int
count
)
{
{
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
tty
->
driver_data
;
struct
usb_serial_port
*
port
=
(
struct
usb_serial_port
*
)
tty
->
driver_data
;
...
@@ -848,19 +839,6 @@ static void destroy_serial (struct kobject *kobj)
...
@@ -848,19 +839,6 @@ static void destroy_serial (struct kobject *kobj)
dbg
(
"%s - %s"
,
__FUNCTION__
,
kobj
->
name
);
dbg
(
"%s - %s"
,
__FUNCTION__
,
kobj
->
name
);
serial
=
to_usb_serial
(
kobj
);
serial
=
to_usb_serial
(
kobj
);
/* fail all future close/read/write/ioctl/etc calls */
for
(
i
=
0
;
i
<
serial
->
num_ports
;
++
i
)
{
port
=
serial
->
port
[
i
];
if
(
port
->
tty
!=
NULL
)
{
port
->
tty
->
driver_data
=
NULL
;
while
(
port
->
open_count
>
0
)
{
__serial_close
(
port
,
NULL
);
}
port
->
tty
=
NULL
;
}
}
serial_shutdown
(
serial
);
serial_shutdown
(
serial
);
/* return the minor range that this device had */
/* return the minor range that this device had */
...
@@ -1242,7 +1220,7 @@ int usb_serial_probe(struct usb_interface *interface,
...
@@ -1242,7 +1220,7 @@ int usb_serial_probe(struct usb_interface *interface,
/* register all of the individual ports with the driver core */
/* register all of the individual ports with the driver core */
for
(
i
=
0
;
i
<
num_ports
;
++
i
)
{
for
(
i
=
0
;
i
<
num_ports
;
++
i
)
{
port
=
serial
->
port
[
i
];
port
=
serial
->
port
[
i
];
port
->
dev
.
parent
=
&
serial
->
dev
->
dev
;
port
->
dev
.
parent
=
&
interface
->
dev
;
port
->
dev
.
driver
=
NULL
;
port
->
dev
.
driver
=
NULL
;
port
->
dev
.
bus
=
&
usb_serial_bus_type
;
port
->
dev
.
bus
=
&
usb_serial_bus_type
;
port
->
dev
.
release
=
&
port_release
;
port
->
dev
.
release
=
&
port_release
;
...
...
drivers/usb/storage/datafab.c
View file @
3296c872
...
@@ -387,7 +387,7 @@ static int datafab_id_device(struct us_data *us,
...
@@ -387,7 +387,7 @@ static int datafab_id_device(struct us_data *us,
// we'll go ahead and extract the media capacity while we're here...
// we'll go ahead and extract the media capacity while we're here...
//
//
rc
=
datafab_bulk_read
(
us
,
reply
,
sizeof
(
reply
)
);
rc
=
datafab_bulk_read
(
us
,
reply
,
512
);
if
(
rc
==
USB_STOR_XFER_GOOD
)
{
if
(
rc
==
USB_STOR_XFER_GOOD
)
{
// capacity is at word offset 57-58
// capacity is at word offset 57-58
//
//
...
...
drivers/usb/storage/jumpshot.c
View file @
3296c872
...
@@ -317,7 +317,7 @@ static int jumpshot_id_device(struct us_data *us,
...
@@ -317,7 +317,7 @@ static int jumpshot_id_device(struct us_data *us,
}
}
// read the reply
// read the reply
rc
=
jumpshot_bulk_read
(
us
,
reply
,
sizeof
(
reply
)
);
rc
=
jumpshot_bulk_read
(
us
,
reply
,
512
);
if
(
rc
!=
USB_STOR_XFER_GOOD
)
{
if
(
rc
!=
USB_STOR_XFER_GOOD
)
{
rc
=
USB_STOR_TRANSPORT_ERROR
;
rc
=
USB_STOR_TRANSPORT_ERROR
;
goto
leave
;
goto
leave
;
...
...
kernel/exit.c
View file @
3296c872
...
@@ -49,9 +49,11 @@ static void __unhash_process(struct task_struct *p)
...
@@ -49,9 +49,11 @@ static void __unhash_process(struct task_struct *p)
void
release_task
(
struct
task_struct
*
p
)
void
release_task
(
struct
task_struct
*
p
)
{
{
int
zap_leader
;
task_t
*
leader
;
task_t
*
leader
;
struct
dentry
*
proc_dentry
;
struct
dentry
*
proc_dentry
;
repeat:
BUG_ON
(
p
->
state
<
TASK_ZOMBIE
);
BUG_ON
(
p
->
state
<
TASK_ZOMBIE
);
atomic_dec
(
&
p
->
user
->
processes
);
atomic_dec
(
&
p
->
user
->
processes
);
...
@@ -70,10 +72,21 @@ void release_task(struct task_struct * p)
...
@@ -70,10 +72,21 @@ void release_task(struct task_struct * p)
* group, and the leader is zombie, then notify the
* group, and the leader is zombie, then notify the
* group leader's parent process. (if it wants notification.)
* group leader's parent process. (if it wants notification.)
*/
*/
zap_leader
=
0
;
leader
=
p
->
group_leader
;
leader
=
p
->
group_leader
;
if
(
leader
!=
p
&&
thread_group_empty
(
leader
)
&&
if
(
leader
!=
p
&&
thread_group_empty
(
leader
)
&&
leader
->
state
==
TASK_ZOMBIE
)
{
leader
->
state
==
TASK_ZOMBIE
&&
leader
->
exit_signal
!=
-
1
)
BUG_ON
(
leader
->
exit_signal
==
-
1
);
do_notify_parent
(
leader
,
leader
->
exit_signal
);
do_notify_parent
(
leader
,
leader
->
exit_signal
);
/*
* If we were the last child thread and the leader has
* exited already, and the leader's parent ignores SIGCHLD,
* then we are the one who should release the leader.
*
* do_notify_parent() will have marked it self-reaping in
* that case.
*/
zap_leader
=
(
leader
->
exit_signal
==
-
1
);
}
p
->
parent
->
cutime
+=
p
->
utime
+
p
->
cutime
;
p
->
parent
->
cutime
+=
p
->
utime
+
p
->
cutime
;
p
->
parent
->
cstime
+=
p
->
stime
+
p
->
cstime
;
p
->
parent
->
cstime
+=
p
->
stime
+
p
->
cstime
;
...
@@ -88,6 +101,10 @@ void release_task(struct task_struct * p)
...
@@ -88,6 +101,10 @@ void release_task(struct task_struct * p)
proc_pid_flush
(
proc_dentry
);
proc_pid_flush
(
proc_dentry
);
release_thread
(
p
);
release_thread
(
p
);
put_task_struct
(
p
);
put_task_struct
(
p
);
p
=
leader
;
if
(
unlikely
(
zap_leader
))
goto
repeat
;
}
}
/* we are using it only for SMP init */
/* we are using it only for SMP init */
...
...
lib/kobject.c
View file @
3296c872
...
@@ -236,8 +236,6 @@ static void unlink(struct kobject * kobj)
...
@@ -236,8 +236,6 @@ static void unlink(struct kobject * kobj)
list_del_init
(
&
kobj
->
entry
);
list_del_init
(
&
kobj
->
entry
);
up_write
(
&
kobj
->
kset
->
subsys
->
rwsem
);
up_write
(
&
kobj
->
kset
->
subsys
->
rwsem
);
}
}
if
(
kobj
->
parent
)
kobject_put
(
kobj
->
parent
);
kobject_put
(
kobj
);
kobject_put
(
kobj
);
}
}
...
@@ -274,9 +272,11 @@ int kobject_add(struct kobject * kobj)
...
@@ -274,9 +272,11 @@ int kobject_add(struct kobject * kobj)
kobj
->
parent
=
parent
;
kobj
->
parent
=
parent
;
error
=
create_dir
(
kobj
);
error
=
create_dir
(
kobj
);
if
(
error
)
if
(
error
)
{
unlink
(
kobj
);
unlink
(
kobj
);
else
{
if
(
parent
)
kobject_put
(
parent
);
}
else
{
/* If this kobj does not belong to a kset,
/* If this kobj does not belong to a kset,
try to find a parent that does. */
try to find a parent that does. */
top_kobj
=
kobj
;
top_kobj
=
kobj
;
...
@@ -452,6 +452,7 @@ void kobject_cleanup(struct kobject * kobj)
...
@@ -452,6 +452,7 @@ void kobject_cleanup(struct kobject * kobj)
{
{
struct
kobj_type
*
t
=
get_ktype
(
kobj
);
struct
kobj_type
*
t
=
get_ktype
(
kobj
);
struct
kset
*
s
=
kobj
->
kset
;
struct
kset
*
s
=
kobj
->
kset
;
struct
kobject
*
parent
=
kobj
->
parent
;
pr_debug
(
"kobject %s: cleaning up
\n
"
,
kobject_name
(
kobj
));
pr_debug
(
"kobject %s: cleaning up
\n
"
,
kobject_name
(
kobj
));
if
(
kobj
->
k_name
!=
kobj
->
name
)
if
(
kobj
->
k_name
!=
kobj
->
name
)
...
@@ -461,6 +462,8 @@ void kobject_cleanup(struct kobject * kobj)
...
@@ -461,6 +462,8 @@ void kobject_cleanup(struct kobject * kobj)
t
->
release
(
kobj
);
t
->
release
(
kobj
);
if
(
s
)
if
(
s
)
kset_put
(
s
);
kset_put
(
s
);
if
(
parent
)
kobject_put
(
parent
);
}
}
/**
/**
...
...
scripts/file2alias.c
View file @
3296c872
...
@@ -52,6 +52,13 @@ static int do_usb_entry(const char *filename,
...
@@ -52,6 +52,13 @@ static int do_usb_entry(const char *filename,
id
->
bcdDevice_lo
=
TO_NATIVE
(
id
->
bcdDevice_lo
);
id
->
bcdDevice_lo
=
TO_NATIVE
(
id
->
bcdDevice_lo
);
id
->
bcdDevice_hi
=
TO_NATIVE
(
id
->
bcdDevice_hi
);
id
->
bcdDevice_hi
=
TO_NATIVE
(
id
->
bcdDevice_hi
);
/*
* Some modules (visor) have empty slots as placeholder for
* run-time specification that results in catch-all alias
*/
if
(
!
(
id
->
idVendor
|
id
->
bDeviceClass
|
id
->
bInterfaceClass
))
return
1
;
strcpy
(
alias
,
"usb:"
);
strcpy
(
alias
,
"usb:"
);
ADD
(
alias
,
"v"
,
id
->
match_flags
&
USB_DEVICE_ID_MATCH_VENDOR
,
ADD
(
alias
,
"v"
,
id
->
match_flags
&
USB_DEVICE_ID_MATCH_VENDOR
,
id
->
idVendor
);
id
->
idVendor
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment