Skip to content

Commit 224b148

Browse files
author
Linus Torvalds
committed
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/scjody/ieee1394
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/scjody/ieee1394: ohci1394: cleanup the "Unexpected PCI resource length" warning. sbp2: misc debug logging cleanups sbp2: proper treatment of DID_OK ieee1394: set read permission for parameter disable_irm sbp2: check for ARM failure ohci1394: clean up asynchronous and physical request filters programming ieee1394: remove amdtp remains from ieee1394_core.h ieee1394: remove devfs support Signed-off-by: Jody McIntyre <scjody@modernduck.com> sbp2: prevent unloading of 1394 low-level driver
2 parents 5476790 + c0e4077 commit 224b148

File tree

7 files changed

+86
-182
lines changed

7 files changed

+86
-182
lines changed

drivers/ieee1394/dv1394.c

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
- fix all XXX showstoppers
7474
- disable IR/IT DMA interrupts on shutdown
7575
- flush pci writes to the card by issuing a read
76-
- devfs and character device dispatching (* needs testing with Linux 2.2.x)
76+
- character device dispatching
7777
- switch over to the new kernel DMA API (pci_map_*()) (* needs testing on platforms with IOMMU!)
7878
- keep all video_cards in a list (for open() via chardev), set file->private_data = video
7979
- dv1394_poll should indicate POLLIN when receiving buffers are available
@@ -1096,7 +1096,6 @@ static int do_dv1394_init_default(struct video_card *video)
10961096

10971097
init.api_version = DV1394_API_VERSION;
10981098
init.n_frames = DV1394_MAX_FRAMES / 4;
1099-
/* the following are now set via devfs */
11001099
init.channel = video->channel;
11011100
init.format = video->pal_or_ntsc;
11021101
init.cip_n = video->cip_n;
@@ -1791,8 +1790,6 @@ static int dv1394_open(struct inode *inode, struct file *file)
17911790
{
17921791
struct video_card *video = NULL;
17931792

1794-
/* if the device was opened through devfs, then file->private_data
1795-
has already been set to video by devfs */
17961793
if (file->private_data) {
17971794
video = (struct video_card*) file->private_data;
17981795

@@ -2211,7 +2208,7 @@ static int dv1394_init(struct ti_ohci *ohci, enum pal_or_ntsc format, enum modes
22112208
video = kzalloc(sizeof(*video), GFP_KERNEL);
22122209
if (!video) {
22132210
printk(KERN_ERR "dv1394: cannot allocate video_card\n");
2214-
goto err;
2211+
return -1;
22152212
}
22162213

22172214
video->ohci = ohci;
@@ -2266,37 +2263,14 @@ static int dv1394_init(struct ti_ohci *ohci, enum pal_or_ntsc format, enum modes
22662263
list_add_tail(&video->list, &dv1394_cards);
22672264
spin_unlock_irqrestore(&dv1394_cards_lock, flags);
22682265

2269-
if (devfs_mk_cdev(MKDEV(IEEE1394_MAJOR,
2270-
IEEE1394_MINOR_BLOCK_DV1394*16 + video->id),
2271-
S_IFCHR|S_IRUGO|S_IWUGO,
2272-
"ieee1394/dv/host%d/%s/%s",
2273-
(video->id>>2),
2274-
(video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"),
2275-
(video->mode == MODE_RECEIVE ? "in" : "out")) < 0)
2276-
goto err_free;
2277-
22782266
debug_printk("dv1394: dv1394_init() OK on ID %d\n", video->id);
2279-
22802267
return 0;
2281-
2282-
err_free:
2283-
kfree(video);
2284-
err:
2285-
return -1;
22862268
}
22872269

22882270
static void dv1394_un_init(struct video_card *video)
22892271
{
2290-
char buf[32];
2291-
22922272
/* obviously nobody has the driver open at this point */
22932273
do_dv1394_shutdown(video, 1);
2294-
snprintf(buf, sizeof(buf), "dv/host%d/%s/%s", (video->id >> 2),
2295-
(video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"),
2296-
(video->mode == MODE_RECEIVE ? "in" : "out")
2297-
);
2298-
2299-
devfs_remove("ieee1394/%s", buf);
23002274
kfree(video);
23012275
}
23022276

@@ -2333,9 +2307,6 @@ static void dv1394_remove_host (struct hpsb_host *host)
23332307

23342308
class_device_destroy(hpsb_protocol_class,
23352309
MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)));
2336-
devfs_remove("ieee1394/dv/host%d/NTSC", id);
2337-
devfs_remove("ieee1394/dv/host%d/PAL", id);
2338-
devfs_remove("ieee1394/dv/host%d", id);
23392310
}
23402311

23412312
static void dv1394_add_host (struct hpsb_host *host)
@@ -2352,9 +2323,6 @@ static void dv1394_add_host (struct hpsb_host *host)
23522323
class_device_create(hpsb_protocol_class, NULL, MKDEV(
23532324
IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)),
23542325
NULL, "dv1394-%d", id);
2355-
devfs_mk_dir("ieee1394/dv/host%d", id);
2356-
devfs_mk_dir("ieee1394/dv/host%d/NTSC", id);
2357-
devfs_mk_dir("ieee1394/dv/host%d/PAL", id);
23582326

23592327
dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE);
23602328
dv1394_init(ohci, DV1394_NTSC, MODE_TRANSMIT);
@@ -2611,10 +2579,8 @@ MODULE_LICENSE("GPL");
26112579
static void __exit dv1394_exit_module(void)
26122580
{
26132581
hpsb_unregister_protocol(&dv1394_driver);
2614-
26152582
hpsb_unregister_highlevel(&dv1394_highlevel);
26162583
cdev_del(&dv1394_cdev);
2617-
devfs_remove("ieee1394/dv");
26182584
}
26192585

26202586
static int __init dv1394_init_module(void)
@@ -2630,15 +2596,12 @@ static int __init dv1394_init_module(void)
26302596
return ret;
26312597
}
26322598

2633-
devfs_mk_dir("ieee1394/dv");
2634-
26352599
hpsb_register_highlevel(&dv1394_highlevel);
26362600

26372601
ret = hpsb_register_protocol(&dv1394_driver);
26382602
if (ret) {
26392603
printk(KERN_ERR "dv1394: failed to register protocol\n");
26402604
hpsb_unregister_highlevel(&dv1394_highlevel);
2641-
devfs_remove("ieee1394/dv");
26422605
cdev_del(&dv1394_cdev);
26432606
return ret;
26442607
}

drivers/ieee1394/ieee1394_core.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ MODULE_PARM_DESC(disable_nodemgr, "Disable nodemgr functionality.");
5858

5959
/* Disable Isochronous Resource Manager functionality */
6060
int hpsb_disable_irm = 0;
61-
module_param_named(disable_irm, hpsb_disable_irm, bool, 0);
61+
module_param_named(disable_irm, hpsb_disable_irm, bool, 0444);
6262
MODULE_PARM_DESC(disable_irm,
6363
"Disable Isochronous Resource Manager functionality.");
6464

@@ -1078,17 +1078,10 @@ static int __init ieee1394_init(void)
10781078
goto exit_release_kernel_thread;
10791079
}
10801080

1081-
/* actually this is a non-fatal error */
1082-
ret = devfs_mk_dir("ieee1394");
1083-
if (ret < 0) {
1084-
HPSB_ERR("unable to make devfs dir for device major %d!\n", IEEE1394_MAJOR);
1085-
goto release_chrdev;
1086-
}
1087-
10881081
ret = bus_register(&ieee1394_bus_type);
10891082
if (ret < 0) {
10901083
HPSB_INFO("bus register failed");
1091-
goto release_devfs;
1084+
goto release_chrdev;
10921085
}
10931086

10941087
for (i = 0; fw_bus_attrs[i]; i++) {
@@ -1099,7 +1092,7 @@ static int __init ieee1394_init(void)
10991092
fw_bus_attrs[i--]);
11001093
}
11011094
bus_unregister(&ieee1394_bus_type);
1102-
goto release_devfs;
1095+
goto release_chrdev;
11031096
}
11041097
}
11051098

@@ -1152,8 +1145,6 @@ static int __init ieee1394_init(void)
11521145
for (i = 0; fw_bus_attrs[i]; i++)
11531146
bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]);
11541147
bus_unregister(&ieee1394_bus_type);
1155-
release_devfs:
1156-
devfs_remove("ieee1394");
11571148
release_chrdev:
11581149
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
11591150
exit_release_kernel_thread:
@@ -1191,7 +1182,6 @@ static void __exit ieee1394_cleanup(void)
11911182
hpsb_cleanup_config_roms();
11921183

11931184
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
1194-
devfs_remove("ieee1394");
11951185
}
11961186

11971187
module_init(ieee1394_init);

drivers/ieee1394/ieee1394_core.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#define _IEEE1394_CORE_H
44

55
#include <linux/slab.h>
6-
#include <linux/devfs_fs_kernel.h>
76
#include <asm/atomic.h>
87
#include <asm/semaphore.h>
98
#include "hosts.h"
@@ -202,14 +201,12 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
202201
#define IEEE1394_MINOR_BLOCK_RAW1394 0
203202
#define IEEE1394_MINOR_BLOCK_VIDEO1394 1
204203
#define IEEE1394_MINOR_BLOCK_DV1394 2
205-
#define IEEE1394_MINOR_BLOCK_AMDTP 3
206204
#define IEEE1394_MINOR_BLOCK_EXPERIMENTAL 15
207205

208206
#define IEEE1394_CORE_DEV MKDEV(IEEE1394_MAJOR, 0)
209207
#define IEEE1394_RAW1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16)
210208
#define IEEE1394_VIDEO1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_VIDEO1394 * 16)
211209
#define IEEE1394_DV1394_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16)
212-
#define IEEE1394_AMDTP_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_AMDTP * 16)
213210
#define IEEE1394_EXPERIMENTAL_DEV MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_EXPERIMENTAL * 16)
214211

215212
/* return the index (within a minor number block) of a file */

drivers/ieee1394/ohci1394.c

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,19 @@ static void ohci_initialize(struct ti_ohci *ohci)
544544
/* Initialize IR Legacy DMA channel mask */
545545
ohci->ir_legacy_channels = 0;
546546

547-
/*
548-
* Accept AT requests from all nodes. This probably
549-
* will have to be controlled from the subsystem
550-
* on a per node basis.
551-
*/
552-
reg_write(ohci,OHCI1394_AsReqFilterHiSet, 0x80000000);
547+
/* Accept AR requests from all nodes */
548+
reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000);
549+
550+
/* Set the address range of the physical response unit.
551+
* Most controllers do not implement it as a writable register though.
552+
* They will keep a hardwired offset of 0x00010000 and show 0x0 as
553+
* register content.
554+
* To actually enable physical responses is the job of our interrupt
555+
* handler which programs the physical request filter. */
556+
reg_write(ohci, OHCI1394_PhyUpperBound, 0xffff0000);
557+
558+
DBGMSG("physUpperBoundOffset=%08x",
559+
reg_read(ohci, OHCI1394_PhyUpperBound));
553560

554561
/* Specify AT retries */
555562
reg_write(ohci, OHCI1394_ATRetries,
@@ -572,6 +579,7 @@ static void ohci_initialize(struct ti_ohci *ohci)
572579
OHCI1394_reqTxComplete |
573580
OHCI1394_isochRx |
574581
OHCI1394_isochTx |
582+
OHCI1394_postedWriteErr |
575583
OHCI1394_cycleInconsistent);
576584

577585
/* Enable link */
@@ -2374,15 +2382,17 @@ static irqreturn_t ohci_irq_handler(int irq, void *dev_id,
23742382

23752383
event &= ~OHCI1394_unrecoverableError;
23762384
}
2377-
2385+
if (event & OHCI1394_postedWriteErr) {
2386+
PRINT(KERN_ERR, "physical posted write error");
2387+
/* no recovery strategy yet, had to involve protocol drivers */
2388+
}
23782389
if (event & OHCI1394_cycleInconsistent) {
23792390
/* We subscribe to the cycleInconsistent event only to
23802391
* clear the corresponding event bit... otherwise,
23812392
* isochronous cycleMatch DMA won't work. */
23822393
DBGMSG("OHCI1394_cycleInconsistent");
23832394
event &= ~OHCI1394_cycleInconsistent;
23842395
}
2385-
23862396
if (event & OHCI1394_busReset) {
23872397
/* The busReset event bit can't be cleared during the
23882398
* selfID phase, so we disable busReset interrupts, to
@@ -2426,7 +2436,6 @@ static irqreturn_t ohci_irq_handler(int irq, void *dev_id,
24262436
}
24272437
event &= ~OHCI1394_busReset;
24282438
}
2429-
24302439
if (event & OHCI1394_reqTxComplete) {
24312440
struct dma_trm_ctx *d = &ohci->at_req_context;
24322441
DBGMSG("Got reqTxComplete interrupt "
@@ -2514,26 +2523,20 @@ static irqreturn_t ohci_irq_handler(int irq, void *dev_id,
25142523
reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);
25152524
spin_unlock_irqrestore(&ohci->event_lock, flags);
25162525

2517-
/* Accept Physical requests from all nodes. */
2518-
reg_write(ohci,OHCI1394_AsReqFilterHiSet, 0xffffffff);
2519-
reg_write(ohci,OHCI1394_AsReqFilterLoSet, 0xffffffff);
2520-
25212526
/* Turn on phys dma reception.
25222527
*
25232528
* TODO: Enable some sort of filtering management.
25242529
*/
25252530
if (phys_dma) {
2526-
reg_write(ohci,OHCI1394_PhyReqFilterHiSet, 0xffffffff);
2527-
reg_write(ohci,OHCI1394_PhyReqFilterLoSet, 0xffffffff);
2528-
reg_write(ohci,OHCI1394_PhyUpperBound, 0xffff0000);
2529-
} else {
2530-
reg_write(ohci,OHCI1394_PhyReqFilterHiSet, 0x00000000);
2531-
reg_write(ohci,OHCI1394_PhyReqFilterLoSet, 0x00000000);
2531+
reg_write(ohci, OHCI1394_PhyReqFilterHiSet,
2532+
0xffffffff);
2533+
reg_write(ohci, OHCI1394_PhyReqFilterLoSet,
2534+
0xffffffff);
25322535
}
25332536

25342537
DBGMSG("PhyReqFilter=%08x%08x",
2535-
reg_read(ohci,OHCI1394_PhyReqFilterHiSet),
2536-
reg_read(ohci,OHCI1394_PhyReqFilterLoSet));
2538+
reg_read(ohci, OHCI1394_PhyReqFilterHiSet),
2539+
reg_read(ohci, OHCI1394_PhyReqFilterLoSet));
25372540

25382541
hpsb_selfid_complete(host, phyid, isroot);
25392542
} else
@@ -3259,8 +3262,8 @@ static int __devinit ohci1394_pci_probe(struct pci_dev *dev,
32593262
* fail to report the right length. Anyway, the ohci spec
32603263
* clearly says it's 2kb, so this shouldn't be a problem. */
32613264
ohci_base = pci_resource_start(dev, 0);
3262-
if (pci_resource_len(dev, 0) != OHCI1394_REGISTER_SIZE)
3263-
PRINT(KERN_WARNING, "Unexpected PCI resource length of %lx!",
3265+
if (pci_resource_len(dev, 0) < OHCI1394_REGISTER_SIZE)
3266+
PRINT(KERN_WARNING, "PCI resource length of %lx too small!",
32643267
pci_resource_len(dev, 0));
32653268

32663269
/* Seems PCMCIA handles this internally. Not sure why. Seems

drivers/ieee1394/raw1394.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include <linux/cdev.h>
4242
#include <asm/uaccess.h>
4343
#include <asm/atomic.h>
44-
#include <linux/devfs_fs_kernel.h>
4544
#include <linux/compat.h>
4645

4746
#include "csr1212.h"
@@ -2999,9 +2998,6 @@ static int __init init_raw1394(void)
29992998
goto out_unreg;
30002999
}
30013000

3002-
devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16),
3003-
S_IFCHR | S_IRUSR | S_IWUSR, RAW1394_DEVICE_NAME);
3004-
30053001
cdev_init(&raw1394_cdev, &raw1394_fops);
30063002
raw1394_cdev.owner = THIS_MODULE;
30073003
kobject_set_name(&raw1394_cdev.kobj, RAW1394_DEVICE_NAME);
@@ -3023,7 +3019,6 @@ static int __init init_raw1394(void)
30233019
goto out;
30243020

30253021
out_dev:
3026-
devfs_remove(RAW1394_DEVICE_NAME);
30273022
class_device_destroy(hpsb_protocol_class,
30283023
MKDEV(IEEE1394_MAJOR,
30293024
IEEE1394_MINOR_BLOCK_RAW1394 * 16));
@@ -3039,7 +3034,6 @@ static void __exit cleanup_raw1394(void)
30393034
MKDEV(IEEE1394_MAJOR,
30403035
IEEE1394_MINOR_BLOCK_RAW1394 * 16));
30413036
cdev_del(&raw1394_cdev);
3042-
devfs_remove(RAW1394_DEVICE_NAME);
30433037
hpsb_unregister_highlevel(&raw1394_highlevel);
30443038
hpsb_unregister_protocol(&raw1394_driver);
30453039
}

0 commit comments

Comments
 (0)