diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/processor_idle.c | 20 | ||||
-rw-r--r-- | drivers/media/video/saa7127.c | 6 | ||||
-rw-r--r-- | drivers/media/video/saa7134/Kconfig | 26 | ||||
-rw-r--r-- | drivers/media/video/saa7134/Makefile | 7 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-alsa.c | 16 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-oss.c | 18 | ||||
-rw-r--r-- | drivers/scsi/scsi_scan.c | 48 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_fc.c | 59 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 9 | ||||
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 4 |
10 files changed, 174 insertions, 39 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 5f51057518b0..807b0df308f1 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -274,8 +274,6 @@ static void acpi_processor_idle(void) | |||
274 | } | 274 | } |
275 | } | 275 | } |
276 | 276 | ||
277 | cx->usage++; | ||
278 | |||
279 | #ifdef CONFIG_HOTPLUG_CPU | 277 | #ifdef CONFIG_HOTPLUG_CPU |
280 | /* | 278 | /* |
281 | * Check for P_LVL2_UP flag before entering C2 and above on | 279 | * Check for P_LVL2_UP flag before entering C2 and above on |
@@ -283,9 +281,12 @@ static void acpi_processor_idle(void) | |||
283 | * detection phase, to work cleanly with logical CPU hotplug. | 281 | * detection phase, to work cleanly with logical CPU hotplug. |
284 | */ | 282 | */ |
285 | if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && | 283 | if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) && |
286 | !pr->flags.has_cst && acpi_fadt.plvl2_up) | 284 | !pr->flags.has_cst && !acpi_fadt.plvl2_up) |
287 | cx->type = ACPI_STATE_C1; | 285 | cx = &pr->power.states[ACPI_STATE_C1]; |
288 | #endif | 286 | #endif |
287 | |||
288 | cx->usage++; | ||
289 | |||
289 | /* | 290 | /* |
290 | * Sleep: | 291 | * Sleep: |
291 | * ------ | 292 | * ------ |
@@ -386,6 +387,15 @@ static void acpi_processor_idle(void) | |||
386 | 387 | ||
387 | next_state = pr->power.state; | 388 | next_state = pr->power.state; |
388 | 389 | ||
390 | #ifdef CONFIG_HOTPLUG_CPU | ||
391 | /* Don't do promotion/demotion */ | ||
392 | if ((cx->type == ACPI_STATE_C1) && (num_online_cpus() > 1) && | ||
393 | !pr->flags.has_cst && !acpi_fadt.plvl2_up) { | ||
394 | next_state = cx; | ||
395 | goto end; | ||
396 | } | ||
397 | #endif | ||
398 | |||
389 | /* | 399 | /* |
390 | * Promotion? | 400 | * Promotion? |
391 | * ---------- | 401 | * ---------- |
@@ -557,7 +567,7 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr) | |||
557 | * Check for P_LVL2_UP flag before entering C2 and above on | 567 | * Check for P_LVL2_UP flag before entering C2 and above on |
558 | * an SMP system. | 568 | * an SMP system. |
559 | */ | 569 | */ |
560 | if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up) | 570 | if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up) |
561 | return_VALUE(-ENODEV); | 571 | return_VALUE(-ENODEV); |
562 | #endif | 572 | #endif |
563 | 573 | ||
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 3428e1ed0032..c36f014f1fdf 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -389,7 +389,7 @@ static int saa7127_set_vps(struct i2c_client *client, struct v4l2_sliced_vbi_dat | |||
389 | static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) | 389 | static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data *data) |
390 | { | 390 | { |
391 | struct saa7127_state *state = i2c_get_clientdata(client); | 391 | struct saa7127_state *state = i2c_get_clientdata(client); |
392 | u16 cc = data->data[0] << 8 | data->data[1]; | 392 | u16 cc = data->data[1] << 8 | data->data[0]; |
393 | int enable = (data->line != 0); | 393 | int enable = (data->line != 0); |
394 | 394 | ||
395 | if (enable && (data->field != 0 || data->line != 21)) | 395 | if (enable && (data->field != 0 || data->line != 21)) |
@@ -397,7 +397,7 @@ static int saa7127_set_cc(struct i2c_client *client, struct v4l2_sliced_vbi_data | |||
397 | if (state->cc_enable != enable) { | 397 | if (state->cc_enable != enable) { |
398 | saa7127_dbg("Turn CC %s\n", enable ? "on" : "off"); | 398 | saa7127_dbg("Turn CC %s\n", enable ? "on" : "off"); |
399 | saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, | 399 | saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, |
400 | (enable << 6) | 0x11); | 400 | (state->xds_enable << 7) | (enable << 6) | 0x11); |
401 | state->cc_enable = enable; | 401 | state->cc_enable = enable; |
402 | } | 402 | } |
403 | if (!enable) | 403 | if (!enable) |
@@ -423,7 +423,7 @@ static int saa7127_set_xds(struct i2c_client *client, struct v4l2_sliced_vbi_dat | |||
423 | if (state->xds_enable != enable) { | 423 | if (state->xds_enable != enable) { |
424 | saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off"); | 424 | saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off"); |
425 | saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, | 425 | saa7127_write(client, SAA7127_REG_CLOSED_CAPTION, |
426 | (enable << 7) | 0x11); | 426 | (enable << 7) | (state->cc_enable << 6) | 0x11); |
427 | state->xds_enable = enable; | 427 | state->xds_enable = enable; |
428 | } | 428 | } |
429 | if (!enable) | 429 | if (!enable) |
diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig index c512c4411b38..c0f604a6fe42 100644 --- a/drivers/media/video/saa7134/Kconfig +++ b/drivers/media/video/saa7134/Kconfig | |||
@@ -1,11 +1,10 @@ | |||
1 | config VIDEO_SAA7134 | 1 | config VIDEO_SAA7134 |
2 | tristate "Philips SAA7134 support" | 2 | tristate "Philips SAA7134 support" |
3 | depends on VIDEO_DEV && PCI && I2C && SOUND && SND | 3 | depends on VIDEO_DEV && PCI && I2C |
4 | select VIDEO_BUF | 4 | select VIDEO_BUF |
5 | select VIDEO_IR | 5 | select VIDEO_IR |
6 | select VIDEO_TUNER | 6 | select VIDEO_TUNER |
7 | select CRC32 | 7 | select CRC32 |
8 | select SND_PCM_OSS | ||
9 | ---help--- | 8 | ---help--- |
10 | This is a video4linux driver for Philips SAA713x based | 9 | This is a video4linux driver for Philips SAA713x based |
11 | TV cards. | 10 | TV cards. |
@@ -13,6 +12,29 @@ config VIDEO_SAA7134 | |||
13 | To compile this driver as a module, choose M here: the | 12 | To compile this driver as a module, choose M here: the |
14 | module will be called saa7134. | 13 | module will be called saa7134. |
15 | 14 | ||
15 | config VIDEO_SAA7134_ALSA | ||
16 | tristate "Philips SAA7134 DMA audio support" | ||
17 | depends on VIDEO_SAA7134 && SOUND && SND && (!VIDEO_SAA7134_OSS || VIDEO_SAA7134_OSS = m) | ||
18 | select SND_PCM_OSS | ||
19 | ---help--- | ||
20 | This is a video4linux driver for direct (DMA) audio in | ||
21 | Philips SAA713x based TV cards using ALSA | ||
22 | |||
23 | To compile this driver as a module, choose M here: the | ||
24 | module will be called saa7134-alsa. | ||
25 | |||
26 | config VIDEO_SAA7134_OSS | ||
27 | tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)" | ||
28 | depends on VIDEO_SAA7134 && SOUND_PRIME && (!VIDEO_SAA7134_ALSA || VIDEO_SAA7134_ALSA = m) | ||
29 | ---help--- | ||
30 | This is a video4linux driver for direct (DMA) audio in | ||
31 | Philips SAA713x based TV cards using OSS | ||
32 | |||
33 | This is deprecated in favor of the ALSA module | ||
34 | |||
35 | To compile this driver as a module, choose M here: the | ||
36 | module will be called saa7134-oss. | ||
37 | |||
16 | config VIDEO_SAA7134_DVB | 38 | config VIDEO_SAA7134_DVB |
17 | tristate "DVB/ATSC Support for saa7134 based TV cards" | 39 | tristate "DVB/ATSC Support for saa7134 based TV cards" |
18 | depends on VIDEO_SAA7134 && DVB_CORE | 40 | depends on VIDEO_SAA7134 && DVB_CORE |
diff --git a/drivers/media/video/saa7134/Makefile b/drivers/media/video/saa7134/Makefile index 134f83a96218..1ba998424bbd 100644 --- a/drivers/media/video/saa7134/Makefile +++ b/drivers/media/video/saa7134/Makefile | |||
@@ -4,8 +4,11 @@ saa7134-objs := saa7134-cards.o saa7134-core.o saa7134-i2c.o \ | |||
4 | saa7134-video.o saa7134-input.o | 4 | saa7134-video.o saa7134-input.o |
5 | 5 | ||
6 | obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ | 6 | obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ |
7 | saa6752hs.o saa7134-alsa.o \ | 7 | saa6752hs.o |
8 | saa7134-oss.o | 8 | |
9 | obj-$(CONFIG_VIDEO_SAA7134_ALSA) += saa7134-alsa.o | ||
10 | obj-$(CONFIG_VIDEO_SAA7134_OSS) += saa7134-oss.o | ||
11 | |||
9 | obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o | 12 | obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o |
10 | 13 | ||
11 | EXTRA_CFLAGS += -I$(src)/.. | 14 | EXTRA_CFLAGS += -I$(src)/.. |
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index 953d5fec82d5..ade05f75fdb0 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c | |||
@@ -989,6 +989,14 @@ static int saa7134_alsa_init(void) | |||
989 | struct saa7134_dev *dev = NULL; | 989 | struct saa7134_dev *dev = NULL; |
990 | struct list_head *list; | 990 | struct list_head *list; |
991 | 991 | ||
992 | if (!dmasound_init && !dmasound_exit) { | ||
993 | dmasound_init = alsa_device_init; | ||
994 | dmasound_exit = alsa_device_exit; | ||
995 | } else { | ||
996 | printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); | ||
997 | return -EBUSY; | ||
998 | } | ||
999 | |||
992 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); | 1000 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); |
993 | 1001 | ||
994 | list_for_each(list,&saa7134_devlist) { | 1002 | list_for_each(list,&saa7134_devlist) { |
@@ -1001,9 +1009,6 @@ static int saa7134_alsa_init(void) | |||
1001 | } | 1009 | } |
1002 | } | 1010 | } |
1003 | 1011 | ||
1004 | dmasound_init = alsa_device_init; | ||
1005 | dmasound_exit = alsa_device_exit; | ||
1006 | |||
1007 | if (dev == NULL) | 1012 | if (dev == NULL) |
1008 | printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); | 1013 | printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); |
1009 | 1014 | ||
@@ -1023,12 +1028,15 @@ static void saa7134_alsa_exit(void) | |||
1023 | snd_card_free(snd_saa7134_cards[idx]); | 1028 | snd_card_free(snd_saa7134_cards[idx]); |
1024 | } | 1029 | } |
1025 | 1030 | ||
1031 | dmasound_init = NULL; | ||
1032 | dmasound_exit = NULL; | ||
1026 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); | 1033 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); |
1027 | 1034 | ||
1028 | return; | 1035 | return; |
1029 | } | 1036 | } |
1030 | 1037 | ||
1031 | module_init(saa7134_alsa_init); | 1038 | /* We initialize this late, to make sure the sound system is up and running */ |
1039 | late_initcall(saa7134_alsa_init); | ||
1032 | module_exit(saa7134_alsa_exit); | 1040 | module_exit(saa7134_alsa_exit); |
1033 | MODULE_LICENSE("GPL"); | 1041 | MODULE_LICENSE("GPL"); |
1034 | MODULE_AUTHOR("Ricardo Cerqueira"); | 1042 | MODULE_AUTHOR("Ricardo Cerqueira"); |
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c index 513a699a6df2..8badd2a9cb2f 100644 --- a/drivers/media/video/saa7134/saa7134-oss.c +++ b/drivers/media/video/saa7134/saa7134-oss.c | |||
@@ -959,8 +959,17 @@ static int saa7134_oss_init(void) | |||
959 | struct saa7134_dev *dev = NULL; | 959 | struct saa7134_dev *dev = NULL; |
960 | struct list_head *list; | 960 | struct list_head *list; |
961 | 961 | ||
962 | if (!dmasound_init && !dmasound_exit) { | ||
963 | dmasound_init = oss_device_init; | ||
964 | dmasound_exit = oss_device_exit; | ||
965 | } else { | ||
966 | printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n"); | ||
967 | return -EBUSY; | ||
968 | } | ||
969 | |||
962 | printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n"); | 970 | printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n"); |
963 | 971 | ||
972 | |||
964 | list_for_each(list,&saa7134_devlist) { | 973 | list_for_each(list,&saa7134_devlist) { |
965 | dev = list_entry(list, struct saa7134_dev, devlist); | 974 | dev = list_entry(list, struct saa7134_dev, devlist); |
966 | if (dev->dmasound.priv_data == NULL) { | 975 | if (dev->dmasound.priv_data == NULL) { |
@@ -974,9 +983,6 @@ static int saa7134_oss_init(void) | |||
974 | if (dev == NULL) | 983 | if (dev == NULL) |
975 | printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); | 984 | printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); |
976 | 985 | ||
977 | dmasound_init = oss_device_init; | ||
978 | dmasound_exit = oss_device_exit; | ||
979 | |||
980 | return 0; | 986 | return 0; |
981 | 987 | ||
982 | } | 988 | } |
@@ -997,12 +1003,16 @@ static void saa7134_oss_exit(void) | |||
997 | 1003 | ||
998 | } | 1004 | } |
999 | 1005 | ||
1006 | dmasound_init = NULL; | ||
1007 | dmasound_exit = NULL; | ||
1008 | |||
1000 | printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); | 1009 | printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); |
1001 | 1010 | ||
1002 | return; | 1011 | return; |
1003 | } | 1012 | } |
1004 | 1013 | ||
1005 | module_init(saa7134_oss_init); | 1014 | /* We initialize this late, to make sure the sound system is up and running */ |
1015 | late_initcall(saa7134_oss_init); | ||
1006 | module_exit(saa7134_oss_exit); | 1016 | module_exit(saa7134_oss_exit); |
1007 | MODULE_LICENSE("GPL"); | 1017 | MODULE_LICENSE("GPL"); |
1008 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | 1018 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 94e5167f260d..e36c21e06d31 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -400,6 +400,35 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, | |||
400 | return found_target; | 400 | return found_target; |
401 | } | 401 | } |
402 | 402 | ||
403 | struct work_queue_wrapper { | ||
404 | struct work_struct work; | ||
405 | struct scsi_target *starget; | ||
406 | }; | ||
407 | |||
408 | static void scsi_target_reap_work(void *data) { | ||
409 | struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data; | ||
410 | struct scsi_target *starget = wqw->starget; | ||
411 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | ||
412 | unsigned long flags; | ||
413 | |||
414 | kfree(wqw); | ||
415 | |||
416 | spin_lock_irqsave(shost->host_lock, flags); | ||
417 | |||
418 | if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { | ||
419 | list_del_init(&starget->siblings); | ||
420 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
421 | device_del(&starget->dev); | ||
422 | transport_unregister_device(&starget->dev); | ||
423 | put_device(&starget->dev); | ||
424 | return; | ||
425 | |||
426 | } | ||
427 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
428 | |||
429 | return; | ||
430 | } | ||
431 | |||
403 | /** | 432 | /** |
404 | * scsi_target_reap - check to see if target is in use and destroy if not | 433 | * scsi_target_reap - check to see if target is in use and destroy if not |
405 | * | 434 | * |
@@ -411,19 +440,18 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, | |||
411 | */ | 440 | */ |
412 | void scsi_target_reap(struct scsi_target *starget) | 441 | void scsi_target_reap(struct scsi_target *starget) |
413 | { | 442 | { |
414 | struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); | 443 | struct work_queue_wrapper *wqw = |
415 | unsigned long flags; | 444 | kzalloc(sizeof(struct work_queue_wrapper), GFP_ATOMIC); |
416 | spin_lock_irqsave(shost->host_lock, flags); | ||
417 | 445 | ||
418 | if (--starget->reap_ref == 0 && list_empty(&starget->devices)) { | 446 | if (!wqw) { |
419 | list_del_init(&starget->siblings); | 447 | starget_printk(KERN_ERR, starget, |
420 | spin_unlock_irqrestore(shost->host_lock, flags); | 448 | "Failed to allocate memory in scsi_reap_target()\n"); |
421 | device_del(&starget->dev); | ||
422 | transport_unregister_device(&starget->dev); | ||
423 | put_device(&starget->dev); | ||
424 | return; | 449 | return; |
425 | } | 450 | } |
426 | spin_unlock_irqrestore(shost->host_lock, flags); | 451 | |
452 | INIT_WORK(&wqw->work, scsi_target_reap_work, wqw); | ||
453 | wqw->starget = starget; | ||
454 | schedule_work(&wqw->work); | ||
427 | } | 455 | } |
428 | 456 | ||
429 | /** | 457 | /** |
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 6cd5931d9a54..2a1a99a2ef56 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -105,6 +105,7 @@ static struct { | |||
105 | { FC_PORTSTATE_LINKDOWN, "Linkdown" }, | 105 | { FC_PORTSTATE_LINKDOWN, "Linkdown" }, |
106 | { FC_PORTSTATE_ERROR, "Error" }, | 106 | { FC_PORTSTATE_ERROR, "Error" }, |
107 | { FC_PORTSTATE_LOOPBACK, "Loopback" }, | 107 | { FC_PORTSTATE_LOOPBACK, "Loopback" }, |
108 | { FC_PORTSTATE_DELETED, "Deleted" }, | ||
108 | }; | 109 | }; |
109 | fc_enum_name_search(port_state, fc_port_state, fc_port_state_names) | 110 | fc_enum_name_search(port_state, fc_port_state, fc_port_state_names) |
110 | #define FC_PORTSTATE_MAX_NAMELEN 20 | 111 | #define FC_PORTSTATE_MAX_NAMELEN 20 |
@@ -211,6 +212,7 @@ fc_bitfield_name_search(remote_port_roles, fc_remote_port_role_names) | |||
211 | #define FC_MGMTSRVR_PORTID 0x00000a | 212 | #define FC_MGMTSRVR_PORTID 0x00000a |
212 | 213 | ||
213 | 214 | ||
215 | static void fc_shost_remove_rports(void *data); | ||
214 | static void fc_timeout_deleted_rport(void *data); | 216 | static void fc_timeout_deleted_rport(void *data); |
215 | static void fc_scsi_scan_rport(void *data); | 217 | static void fc_scsi_scan_rport(void *data); |
216 | static void fc_rport_terminate(struct fc_rport *rport); | 218 | static void fc_rport_terminate(struct fc_rport *rport); |
@@ -318,6 +320,8 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev, | |||
318 | fc_host_next_rport_number(shost) = 0; | 320 | fc_host_next_rport_number(shost) = 0; |
319 | fc_host_next_target_id(shost) = 0; | 321 | fc_host_next_target_id(shost) = 0; |
320 | 322 | ||
323 | fc_host_flags(shost) = 0; | ||
324 | INIT_WORK(&fc_host_rport_del_work(shost), fc_shost_remove_rports, shost); | ||
321 | return 0; | 325 | return 0; |
322 | } | 326 | } |
323 | 327 | ||
@@ -387,6 +391,7 @@ show_fc_rport_##field (struct class_device *cdev, char *buf) \ | |||
387 | struct fc_internal *i = to_fc_internal(shost->transportt); \ | 391 | struct fc_internal *i = to_fc_internal(shost->transportt); \ |
388 | if ((i->f->get_rport_##field) && \ | 392 | if ((i->f->get_rport_##field) && \ |
389 | !((rport->port_state == FC_PORTSTATE_BLOCKED) || \ | 393 | !((rport->port_state == FC_PORTSTATE_BLOCKED) || \ |
394 | (rport->port_state == FC_PORTSTATE_DELETED) || \ | ||
390 | (rport->port_state == FC_PORTSTATE_NOTPRESENT))) \ | 395 | (rport->port_state == FC_PORTSTATE_NOTPRESENT))) \ |
391 | i->f->get_rport_##field(rport); \ | 396 | i->f->get_rport_##field(rport); \ |
392 | return snprintf(buf, sz, format_string, cast rport->field); \ | 397 | return snprintf(buf, sz, format_string, cast rport->field); \ |
@@ -402,6 +407,7 @@ store_fc_rport_##field(struct class_device *cdev, const char *buf, \ | |||
402 | struct Scsi_Host *shost = rport_to_shost(rport); \ | 407 | struct Scsi_Host *shost = rport_to_shost(rport); \ |
403 | struct fc_internal *i = to_fc_internal(shost->transportt); \ | 408 | struct fc_internal *i = to_fc_internal(shost->transportt); \ |
404 | if ((rport->port_state == FC_PORTSTATE_BLOCKED) || \ | 409 | if ((rport->port_state == FC_PORTSTATE_BLOCKED) || \ |
410 | (rport->port_state == FC_PORTSTATE_DELETED) || \ | ||
405 | (rport->port_state == FC_PORTSTATE_NOTPRESENT)) \ | 411 | (rport->port_state == FC_PORTSTATE_NOTPRESENT)) \ |
406 | return -EBUSY; \ | 412 | return -EBUSY; \ |
407 | val = simple_strtoul(buf, NULL, 0); \ | 413 | val = simple_strtoul(buf, NULL, 0); \ |
@@ -519,6 +525,7 @@ store_fc_rport_dev_loss_tmo(struct class_device *cdev, const char *buf, | |||
519 | struct Scsi_Host *shost = rport_to_shost(rport); | 525 | struct Scsi_Host *shost = rport_to_shost(rport); |
520 | struct fc_internal *i = to_fc_internal(shost->transportt); | 526 | struct fc_internal *i = to_fc_internal(shost->transportt); |
521 | if ((rport->port_state == FC_PORTSTATE_BLOCKED) || | 527 | if ((rport->port_state == FC_PORTSTATE_BLOCKED) || |
528 | (rport->port_state == FC_PORTSTATE_DELETED) || | ||
522 | (rport->port_state == FC_PORTSTATE_NOTPRESENT)) | 529 | (rport->port_state == FC_PORTSTATE_NOTPRESENT)) |
523 | return -EBUSY; | 530 | return -EBUSY; |
524 | val = simple_strtoul(buf, NULL, 0); | 531 | val = simple_strtoul(buf, NULL, 0); |
@@ -1769,7 +1776,7 @@ fc_timeout_deleted_rport(void *data) | |||
1769 | rport->maxframe_size = -1; | 1776 | rport->maxframe_size = -1; |
1770 | rport->supported_classes = FC_COS_UNSPECIFIED; | 1777 | rport->supported_classes = FC_COS_UNSPECIFIED; |
1771 | rport->roles = FC_RPORT_ROLE_UNKNOWN; | 1778 | rport->roles = FC_RPORT_ROLE_UNKNOWN; |
1772 | rport->port_state = FC_PORTSTATE_NOTPRESENT; | 1779 | rport->port_state = FC_PORTSTATE_DELETED; |
1773 | 1780 | ||
1774 | /* remove the identifiers that aren't used in the consisting binding */ | 1781 | /* remove the identifiers that aren't used in the consisting binding */ |
1775 | switch (fc_host_tgtid_bind_type(shost)) { | 1782 | switch (fc_host_tgtid_bind_type(shost)) { |
@@ -1789,14 +1796,23 @@ fc_timeout_deleted_rport(void *data) | |||
1789 | break; | 1796 | break; |
1790 | } | 1797 | } |
1791 | 1798 | ||
1792 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
1793 | |||
1794 | /* | 1799 | /* |
1795 | * As this only occurs if the remote port (scsi target) | 1800 | * As this only occurs if the remote port (scsi target) |
1796 | * went away and didn't come back - we'll remove | 1801 | * went away and didn't come back - we'll remove |
1797 | * all attached scsi devices. | 1802 | * all attached scsi devices. |
1803 | * | ||
1804 | * We'll schedule the shost work item to perform the actual removal | ||
1805 | * to avoid recursion in the different flush calls if we perform | ||
1806 | * the removal in each target - and there are lots of targets | ||
1807 | * whose timeouts fire at the same time. | ||
1798 | */ | 1808 | */ |
1799 | fc_rport_tgt_remove(rport); | 1809 | |
1810 | if ( !(fc_host_flags(shost) & FC_SHOST_RPORT_DEL_SCHEDULED)) { | ||
1811 | fc_host_flags(shost) |= FC_SHOST_RPORT_DEL_SCHEDULED; | ||
1812 | scsi_queue_work(shost, &fc_host_rport_del_work(shost)); | ||
1813 | } | ||
1814 | |||
1815 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
1800 | } | 1816 | } |
1801 | 1817 | ||
1802 | /** | 1818 | /** |
@@ -1818,6 +1834,41 @@ fc_scsi_scan_rport(void *data) | |||
1818 | } | 1834 | } |
1819 | 1835 | ||
1820 | 1836 | ||
1837 | /** | ||
1838 | * fc_shost_remove_rports - called to remove all rports that are marked | ||
1839 | * as in a deleted (not connected) state. | ||
1840 | * | ||
1841 | * @data: shost whose rports are to be looked at | ||
1842 | **/ | ||
1843 | static void | ||
1844 | fc_shost_remove_rports(void *data) | ||
1845 | { | ||
1846 | struct Scsi_Host *shost = (struct Scsi_Host *)data; | ||
1847 | struct fc_rport *rport, *next_rport; | ||
1848 | unsigned long flags; | ||
1849 | |||
1850 | spin_lock_irqsave(shost->host_lock, flags); | ||
1851 | while (fc_host_flags(shost) & FC_SHOST_RPORT_DEL_SCHEDULED) { | ||
1852 | |||
1853 | fc_host_flags(shost) &= ~FC_SHOST_RPORT_DEL_SCHEDULED; | ||
1854 | |||
1855 | restart_search: | ||
1856 | list_for_each_entry_safe(rport, next_rport, | ||
1857 | &fc_host_rport_bindings(shost), peers) { | ||
1858 | if (rport->port_state == FC_PORTSTATE_DELETED) { | ||
1859 | rport->port_state = FC_PORTSTATE_NOTPRESENT; | ||
1860 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
1861 | fc_rport_tgt_remove(rport); | ||
1862 | spin_lock_irqsave(shost->host_lock, flags); | ||
1863 | goto restart_search; | ||
1864 | } | ||
1865 | } | ||
1866 | |||
1867 | } | ||
1868 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
1869 | } | ||
1870 | |||
1871 | |||
1821 | MODULE_AUTHOR("Martin Hicks"); | 1872 | MODULE_AUTHOR("Martin Hicks"); |
1822 | MODULE_DESCRIPTION("FC Transport Attributes"); | 1873 | MODULE_DESCRIPTION("FC Transport Attributes"); |
1823 | MODULE_LICENSE("GPL"); | 1874 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index e197ce9353de..e80ef9467825 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -1432,7 +1432,8 @@ static int usb_generic_suspend(struct device *dev, pm_message_t message) | |||
1432 | mark_quiesced(intf); | 1432 | mark_quiesced(intf); |
1433 | } else { | 1433 | } else { |
1434 | // FIXME else if there's no suspend method, disconnect... | 1434 | // FIXME else if there's no suspend method, disconnect... |
1435 | dev_warn(dev, "no %s?\n", "suspend"); | 1435 | dev_warn(dev, "no suspend for driver %s?\n", driver->name); |
1436 | mark_quiesced(intf); | ||
1436 | status = 0; | 1437 | status = 0; |
1437 | } | 1438 | } |
1438 | return status; | 1439 | return status; |
@@ -1460,8 +1461,10 @@ static int usb_generic_resume(struct device *dev) | |||
1460 | } | 1461 | } |
1461 | 1462 | ||
1462 | if ((dev->driver == NULL) || | 1463 | if ((dev->driver == NULL) || |
1463 | (dev->driver_data == &usb_generic_driver_data)) | 1464 | (dev->driver_data == &usb_generic_driver_data)) { |
1465 | dev->power.power_state.event = PM_EVENT_FREEZE; | ||
1464 | return 0; | 1466 | return 0; |
1467 | } | ||
1465 | 1468 | ||
1466 | intf = to_usb_interface(dev); | 1469 | intf = to_usb_interface(dev); |
1467 | driver = to_usb_driver(dev->driver); | 1470 | driver = to_usb_driver(dev->driver); |
@@ -1481,7 +1484,7 @@ static int usb_generic_resume(struct device *dev) | |||
1481 | mark_quiesced(intf); | 1484 | mark_quiesced(intf); |
1482 | } | 1485 | } |
1483 | } else | 1486 | } else |
1484 | dev_warn(dev, "no %s?\n", "resume"); | 1487 | dev_warn(dev, "no resume for driver %s?\n", driver->name); |
1485 | return 0; | 1488 | return 0; |
1486 | } | 1489 | } |
1487 | 1490 | ||
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 4837524eada7..4ef5527028c5 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -109,7 +109,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
109 | * data comes from. | 109 | * data comes from. |
110 | */ | 110 | */ |
111 | if (sdev->scsi_level < SCSI_2) | 111 | if (sdev->scsi_level < SCSI_2) |
112 | sdev->scsi_level = SCSI_2; | 112 | sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; |
113 | 113 | ||
114 | /* According to the technical support people at Genesys Logic, | 114 | /* According to the technical support people at Genesys Logic, |
115 | * devices using their chips have problems transferring more than | 115 | * devices using their chips have problems transferring more than |
@@ -162,7 +162,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
162 | * a Get-Max-LUN request, we won't lose much by setting the | 162 | * a Get-Max-LUN request, we won't lose much by setting the |
163 | * revision level down to 2. The only devices that would be | 163 | * revision level down to 2. The only devices that would be |
164 | * affected are those with sparse LUNs. */ | 164 | * affected are those with sparse LUNs. */ |
165 | sdev->scsi_level = SCSI_2; | 165 | sdev->scsi_level = sdev->sdev_target->scsi_level = SCSI_2; |
166 | 166 | ||
167 | /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable | 167 | /* USB-IDE bridges tend to report SK = 0x04 (Non-recoverable |
168 | * Hardware Error) when any low-level error occurs, | 168 | * Hardware Error) when any low-level error occurs, |