* Re: [Bluez-users] rfcomm shouldn't fail silently
From: Marcel Holtmann @ 2004-01-26 16:42 UTC (permalink / raw)
To: Edd Dumbill; +Cc: BlueZ Mailing List
In-Reply-To: <1075133668.12874.328.camel@saag>
Hi Edd,
> As reported in this bug
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=229167
>
> rfcomm shouldn't fail silently if an invalid command is given to ie.
it does not fail silently. It show the the list of bonded devices.
Regards
Marcel
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
^ permalink raw reply
* [Qemu-devel] problem bringing up QEMU test
From: Kyle Hayes @ 2004-01-26 16:39 UTC (permalink / raw)
To: qemu-devel
I'm doing something wrong somewhere. I am using Gentoo on x86 as the host.
I've loaded the precompiled QEMU binary 0.5.2.
I have the TUN/TAP device set up on the host:
bash-2.05b# ifconfig tap0
tap0 Link encap:Ethernet HWaddr FE:FD:00:00:00:00
inet addr:172.20.0.1 Bcast:172.20.255.255 Mask:255.255.0.0
inet6 addr: fe80::fcfd:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:5416 (5.2 Kb)
I set up a direct host route to the other end:
bash-2.05b# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.20.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tap0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.20.0.0 0.0.0.0 255.255.0.0 U 0 0 0 tap0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
I'm running QEMU as root (not particularly safe, but I want to see if I can
get it to work before I break things with permissions). The test image boots
and runs, but the network doesn't work:
bash-2.05b# ./qemu.sh
Connected to host network interface: tun0
Load kernel at 0xac100000 (0x00100000)
Linux version 2.4.21 (bellard@voyager.localdomain) (gcc version 3.2.2 20030222
(Red Hat Linux 3.2.2-5)) #5 Tue Nov 11 18:18:53 CET 2003
BIOS-provided physical RAM map:
BIOS-e801: 0000000000000000 - 000000000009f000 (usable)
BIOS-e801: 0000000000100000 - 0000000002000000 (usable)
32MB LOWMEM available.
On node 0 totalpages: 8192
zone(0): 4096 pages.
zone(1): 4096 pages.
zone(2): 0 pages.
Kernel command line: console=ttyS0 root=/dev/hda sb=0x220,5,1,5 ide2=noprobe
ide3=noprobe ide4=noprobe ide5=noprobe
ide_setup: ide2=noprobe
ide_setup: ide3=noprobe
ide_setup: ide4=noprobe
ide_setup: ide5=noprobe
Initializing CPU#0
Detected 2592.439 MHz processor.
Calibrating delay loop... 5164.23 BogoMIPS
Memory: 28880k/32768k available (1210k kernel code, 3500k reserved, 266k data,
64k init, 0k highmem)
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
CPU: L1 I cache: 8K<6>CPU: L2 cache: 128K
CPU: Intel Pentium Pro stepping 03
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
apm: BIOS not found.
Starting kswapd
Journalled Block Device driver loaded
Detected PS/2 Mouse Port.
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with no serial options enabled
ttyS00 at 0x03f8 (irq = 4) is a 16450
ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com)
Last modified Nov 1, 2000 by Paul Gortmaker
NE*000 ethercard probe at 0x300: 52 54 00 12 34 56
eth0: NE2000 found at 0x300, using IRQ 9.
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
Uniform Multi-Platform E-IDE driver Revision: 7.00beta4-2.4
ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx
hda: QEMU HARDDISK, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: attached ide-disk driver.
hda: 20480 sectors (10 MB) w/256KiB Cache, CHS=20/16/63
Partition check:
hda:
Soundblaster audio driver Copyright (C) by Hannu Savolainen 1993-1996
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 64k freed
Linux version 2.4.21 (bellard@voyager.localdomain) (gcc version 3.2.2 20030222
(Red Hat Linux 3.2.2-5)) #5 Tue Nov 11 18:18:53 CET 2003
QEMU Linux test distribution (based on Redhat 9)
Type 'exit' to halt the system
sh-2.05b# ping -c 3 172.20.0.1
PING 172.20.0.1 (172.20.0.1) 56(84) bytes of data.
From 172.20.0.2 icmp_seq=1 Destination Host Unreachable
From 172.20.0.2 icmp_seq=2 Destination Host Unreachable
From 172.20.0.2 icmp_seq=3 Destination Host Unreachable
--- 172.20.0.1 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2019ms
, pipe 3
sh-2.05b# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.20.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
sh-2.05b#
I cannot ping the other direction either (host to QEMU). Also ^C doesn't go
through to QEMU. I first typed ping without the -c and it just kept going...
Clearly I'm not doing something right here. Any clues?
I'm trying to work my way up to booting KNOPPIX in QEMU. It boots fine, but
it cannot find any X server that works and then dies. Until I get simpler
things running, I'm not going to worry about that too much :-)
Best,
Kyle
^ permalink raw reply
* RE : RE : DOC2k booting speed ...
From: Philippe @ 2004-01-26 16:39 UTC (permalink / raw)
To: linux-mtd
In-Reply-To: <1075133878.27507.15.camel@hades.cambridge.redhat.com>
Hi
> Perhaps you could use a read-only file system on the DiskOnChip, and use
> a ramfs for those areas of the file system which you need to be
> writable?
Well I had some troubles with the /etc/mtab....
>
> If you mount a ramfs on /mnt/ramfs, you can make symlinks into it from
> the 'real' file system.
I'll try to see if I can do something with tmpfs/ramfs...
Thank you
>
> --
> dwmw2
^ permalink raw reply
* [PATCH] 2.6.2-rc2 - MPT Fusion driver 3.00.02 update
From: Moore, Eric Dean @ 2004-01-26 16:37 UTC (permalink / raw)
To: linux-scsi; +Cc: James.Bottomley, hch
Here is another update for the MPT Fusion drivers.
Here is list of fix's.
* added new PCI API support
* added ACPI support
* added CONFIG_LBA, READ16, WRITE16 support
* underun fix
* chain buffer free list not being init properly
* reduce task management
(abort=2sec,reset bus=5sec, timeout=10sec)
* Hot plug fix's requested from Christoph Hellwig, and several
others from the linux-scsi@ list.
Here's location of patches and full source.
ftp://ftp.lsil.com/HostAdapterDrivers/linux/Fusion-MPT/2.6-patches/
diff -uarN linux-2.6.2-rc1-reference/drivers/message/fusion/mptbase.c
linux-2.6.2-rc1/drivers/message/fusion/mptbase.c
--- linux-2.6.2-rc1-reference/drivers/message/fusion/mptbase.c 2004-01-24
00:17:20.525861896 -0700
+++ linux-2.6.2-rc1/drivers/message/fusion/mptbase.c 2004-01-23
23:52:15.000000000 -0700
@@ -167,6 +167,7 @@
static MPT_EVHANDLER MptEvHandlers[MPT_MAX_PROTOCOL_DRIVERS];
/* Reset handler lookup table */
static MPT_RESETHANDLER
MptResetHandlers[MPT_MAX_PROTOCOL_DRIVERS];
+static struct mpt_pci_driver
*MptDeviceDriverHandlers[MPT_MAX_PROTOCOL_DRIVERS];
static int FusionInitCalled = 0;
static int mpt_base_index = -1;
@@ -183,7 +184,6 @@
static int mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *req,
MPT_FRAME_HDR *reply);
static int mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int
sleepFlag);
-static int mpt_adapter_install(struct pci_dev *pdev);
static void mpt_detect_bound_ports(MPT_ADAPTER *this, struct pci_dev
*pdev);
static void mpt_adapter_disable(MPT_ADAPTER *ioc, int freeup);
static void mpt_adapter_dispose(MPT_ADAPTER *ioc);
@@ -232,8 +232,12 @@
static void mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info);
static void mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info);
-int fusion_init(void);
-static void fusion_exit(void);
+/* module entry point */
+static int __devinit mptbase_probe (struct pci_dev *, const struct
pci_device_id *);
+static void __devexit mptbase_remove(struct pci_dev *);
+static void mptbase_shutdown(struct device * );
+static int __init fusion_init (void);
+static void __exit fusion_exit (void);
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/*
@@ -260,6 +264,30 @@
#endif
+/**************************************************************************
**
+ * Supported hardware
+ */
+
+static struct pci_device_id mptbase_pci_table[] = {
+ { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC909,
+ PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929,
+ PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919,
+ PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC929X,
+ PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_FC919X,
+ PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_53C1030,
+ PCI_ANY_ID, PCI_ANY_ID },
+ { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_1030_53C1035,
+ PCI_ANY_ID, PCI_ANY_ID },
+ {0} /* Terminating entry */
+};
+MODULE_DEVICE_TABLE(pci, mptbase_pci_table);
+
+
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/* 20000207 -sralston
* GRRRRR... IOSpace (port i/o) register access (for the 909) is back!
@@ -518,7 +546,7 @@
* @mf: Pointer to original MPT request frame
* @reply: Pointer to MPT reply frame (NULL if TurboReply)
*
- * Returns 1 indicating original alloc'd request frame ptr
+ * Returns 1 indicating original alloc'd request frame ptr
* should be freed, or 0 if it shouldn't.
*/
static int
@@ -805,6 +833,34 @@
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/**
+ * mpt_device_driver_register - Register device driver hooks
+ */
+int
+mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx)
+{
+ if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
+ return -1;
+
+ MptDeviceDriverHandlers[cb_idx] = dd_cbfunc;
+ return 0;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/**
+ * mpt_device_driver_deregister - DeRegister device driver hooks
+ */
+void
+mpt_device_driver_deregister(int cb_idx)
+{
+ if (cb_idx < 1 || cb_idx >= MPT_MAX_PROTOCOL_DRIVERS)
+ return;
+
+ MptDeviceDriverHandlers[cb_idx] = NULL;
+}
+
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/**
* mpt_get_msg_frame - Obtain a MPT request frame from the pool (of
1024)
* allocated per MPT adapter.
* @handle: Handle of registered MPT protocol driver
@@ -1142,88 +1198,6 @@
return next;
}
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
-/*
- * mpt_pci_scan - Scan PCI devices for MPT adapters.
- *
- * Returns count of MPT adapters found, keying off of PCI vendor and
- * device_id's.
- */
-static int __init
-mpt_pci_scan(void)
-{
- struct pci_dev *pdev = NULL;
- struct pci_dev *pdev2;
- int found = 0;
- int count = 0;
- int r;
-
- dprintk((KERN_INFO MYNAM ": Checking for MPT adapters...\n"));
-
- /*
- * NOTE: The 929, 929X, 1030 and 1035 will appear as 2 separate PCI
devices,
- * one for each channel.
- */
- while ((pdev = pci_find_device(PCI_VENDOR_ID_LSI_LOGIC, PCI_ANY_ID,
pdev)) != NULL) {
- pdev2 = NULL;
- if ((pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC909) &&
- (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC929) &&
- (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC919) &&
- (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC929X) &&
- (pdev->device != MPI_MANUFACTPAGE_DEVICEID_FC919X) &&
- (pdev->device != MPI_MANUFACTPAGE_DEVID_53C1030) &&
- (pdev->device != MPI_MANUFACTPAGE_DEVID_1030_53C1035) &&
- 1) {
- dprintk((KERN_INFO MYNAM ": Skipping LSI
device=%04xh\n", pdev->device));
- continue;
- }
-
- /* GRRRRR
- * dual function devices (929, 929X, 1030, 1035) may be
presented in Func 1,0 order,
- * but we'd really really rather have them in Func 0,1
order.
- * Do some kind of look ahead here...
- */
- if (pdev->devfn & 1) {
- pdev2 = pci_find_device(PCI_ANY_ID, PCI_ANY_ID,
pdev);
- if (pdev2 && (pdev2->vendor == 0x1000) &&
- (PCI_SLOT(pdev2->devfn) ==
PCI_SLOT(pdev->devfn)) &&
- (pdev2->device == pdev->device) &&
- (pdev2->bus->number == pdev->bus->number) &&
- !(pdev2->devfn & 1)) {
- dprintk((KERN_INFO MYNAM ": MPT adapter
found: PCI bus/dfn=%02x/%02xh, class=%08x, id=%xh\n",
- pdev2->bus->number, pdev2->devfn,
pdev2->class, pdev2->device));
- found++;
- if ((r = mpt_adapter_install(pdev2)) == 0)
- count++;
- } else {
- pdev2 = NULL;
- }
- }
-
- dprintk((KERN_INFO MYNAM ": MPT adapter found: PCI
bus/dfn=%02x/%02xh, class=%08x, id=%xh\n",
- pdev->bus->number, pdev->devfn, pdev->class,
pdev->device));
- found++;
- if ((r = mpt_adapter_install(pdev)) == 0)
- count++;
-
- if (pdev2)
- pdev = pdev2;
- }
-
- printk(KERN_INFO MYNAM ": %d MPT adapter%s found, %d installed.\n",
- found, (found==1) ? "" : "s", count);
-
- if (!found || !count) {
- fusion_exit();
- return -ENODEV;
- }
-
-#ifdef CONFIG_PROC_FS
- (void) procmpt_create();
-#endif
-
- return count;
-}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/**
@@ -1253,7 +1227,7 @@
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/*
- * mpt_adapter_install - Install a PCI intelligent MPT adapter.
+ * mptbase_probe - Install a PCI intelligent MPT adapter.
* @pdev: Pointer to pci_dev structure
*
* This routine performs all the steps necessary to bring the IOC of
@@ -1268,8 +1242,8 @@
*
* TODO: Add support for polled controllers
*/
-static int __init
-mpt_adapter_install(struct pci_dev *pdev)
+static int __devinit
+mptbase_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
MPT_ADAPTER *ioc;
u8 *mem;
@@ -1292,6 +1266,13 @@
return r;
}
+ if (!pci_set_consistent_dma_mask(pdev, mask))
+ dprintk((KERN_INFO MYNAM
+ ": Using 64 bit consistent mask\n"));
+ else
+ dprintk((KERN_INFO MYNAM
+ ": Not using 64 bit consistent mask\n"));
+
ioc = kmalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC);
if (ioc == NULL) {
printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add
adapter!\n");
@@ -1500,6 +1481,7 @@
ioc->pci_irq = pdev->irq;
pci_set_master(pdev); /* ?? */
+ pci_set_drvdata(pdev, ioc);
#ifndef __sparc__
dprintk((KERN_INFO MYNAM ": %s installed at interrupt %d\n",
ioc->name, pdev->irq));
@@ -1520,11 +1502,209 @@
ioc->name, r);
}
- return r;
+ if(r != 0 )
+ return r;
+
+
+ /* call per device driver probe entry point */
+ for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+ if(MptDeviceDriverHandlers[ii] &&
+ MptDeviceDriverHandlers[ii]->probe) {
+ MptDeviceDriverHandlers[ii]->probe(pdev,id);
+ }
+ }
+
+ return 0;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*
+ * mptbase_remove - Remove a PCI intelligent MPT adapter.
+ * @pdev: Pointer to pci_dev structure
+ *
+ */
+
+static void __devexit
+mptbase_remove(struct pci_dev *pdev)
+{
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+ int ii;
+
+ /* call per device driver remove entry point */
+ for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+ if(MptDeviceDriverHandlers[ii] &&
+ MptDeviceDriverHandlers[ii]->remove) {
+ MptDeviceDriverHandlers[ii]->remove(pdev);
+ }
+ }
+
+ /* Disable interrupts! */
+ CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
+
+ ioc->active = 0;
+
+ /* Clear any lingering interrupt */
+ CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
+
+ CHIPREG_READ32(&ioc->chip->IntStatus);
+
+ Q_DEL_ITEM(ioc);
+ mpt_adapter_dispose(ioc);
+
+ mptscsih_sync_irq(ioc->irq);
+ pci_set_drvdata(pdev, NULL);
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/*
+ * mptbase_shutdown -
+ *
+ */
+static void
+mptbase_shutdown(struct device * dev)
+{
+ int ii;
+
+ /* call per device driver shutdown entry point */
+ for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+ if(MptDeviceDriverHandlers[ii] &&
+ MptDeviceDriverHandlers[ii]->shutdown) {
+ MptDeviceDriverHandlers[ii]->shutdown(dev);
+ }
+ }
+
+}
+
+
+/**************************************************************************
+ * Power Management
+ */
+#ifdef CONFIG_PM
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*
+ * mptbase_suspend - Fusion MPT base driver suspend routine.
+ *
+ *
+ */
+static int
+mptbase_suspend(struct pci_dev *pdev, u32 state)
+{
+ u32 device_state;
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+ int ii;
+
+ switch(state)
+ {
+ case 1: /* S1 */
+ device_state=1; /* D1 */;
+ break;
+ case 3: /* S3 */
+ case 4: /* S4 */
+ device_state=3; /* D3 */;
+ break;
+ default:
+ return -EAGAIN /*FIXME*/;
+ break;
+ }
+
+ printk(MYIOC_s_INFO_FMT
+ "pci-suspend: pdev=0x%p, slot=%s, Entering operating state [D%d]\n",
+ ioc->name, pdev, pci_name(pdev), device_state);
+
+ /* call per device driver suspend entry point */
+ for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+ if(MptDeviceDriverHandlers[ii] &&
+ MptDeviceDriverHandlers[ii]->suspend) {
+ MptDeviceDriverHandlers[ii]->suspend(pdev, state);
+ }
+ }
+
+ pci_save_state(pdev, ioc->PciState);
+
+ /* put ioc into READY_STATE */
+ if(SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET,
CAN_SLEEP)) {
+ printk(MYIOC_s_ERR_FMT
+ "pci-suspend: IOC msg unit reset failed!\n", ioc->name);
+ }
+
+ /* disable interrupts */
+ CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF);
+ ioc->active = 0;
+
+ /* Clear any lingering interrupt */
+ CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
+
+ pci_disable_device(pdev);
+ pci_set_power_state(pdev, device_state);
+
+ return 0;
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*
+ * mptbase_resume - Fusion MPT base driver resume routine.
+ *
+ *
+ */
+static int
+mptbase_resume(struct pci_dev *pdev)
+{
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+ u32 device_state = pdev->current_state;
+ int recovery_state;
+ int ii;
+
+ printk(MYIOC_s_INFO_FMT
+ "pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
+ ioc->name, pdev, pci_name(pdev), device_state);
+
+ pci_set_power_state(pdev, 0);
+ pci_restore_state(pdev, ioc->PciState);
+ pci_enable_device(pdev);
+
+ /* enable interrupts */
+ CHIPREG_WRITE32(&ioc->chip->IntMask, ~(MPI_HIM_RIM));
+ ioc->active = 1;
+
+ /* F/W not running */
+ if(!CHIPREG_READ32(&ioc->chip->Doorbell)) {
+ /* enable domain validation flags */
+ for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) {
+ ioc->spi_data.dvStatus[ii] |= MPT_SCSICFG_NEED_DV;
+ }
+ }
+
+ printk(MYIOC_s_INFO_FMT
+ "pci-resume: ioc-state=0x%x,doorbell=0x%x\n",
+ ioc->name,
+ (mpt_GetIocState(ioc, 1) >> MPI_IOC_STATE_SHIFT),
+ CHIPREG_READ32(&ioc->chip->Doorbell));
+
+ /* bring ioc to operational state */
+ if ((recovery_state = mpt_do_ioc_recovery(ioc,
+ MPT_HOSTEVENT_IOC_RECOVER, CAN_SLEEP)) != 0) {
+ printk(MYIOC_s_INFO_FMT
+ "pci-resume: Cannot recover, error:[%x]\n",
+ ioc->name, recovery_state);
+ } else {
+ printk(MYIOC_s_INFO_FMT
+ "pci-resume: success\n", ioc->name);
+ }
+
+ /* call per device driver resume entry point */
+ for(ii=0; ii<MPT_MAX_PROTOCOL_DRIVERS; ii++) {
+ if(MptDeviceDriverHandlers[ii] &&
+ MptDeviceDriverHandlers[ii]->resume) {
+ MptDeviceDriverHandlers[ii]->resume(pdev);
+ }
+ }
+
+ return 0;
+}
+#endif
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*
* mpt_do_ioc_recovery - Initialize or recover MPT adapter.
* @ioc: Pointer to MPT adapter structure
* @reason: Event word / reason
@@ -5851,6 +6031,8 @@
EXPORT_SYMBOL(mpt_event_deregister);
EXPORT_SYMBOL(mpt_reset_register);
EXPORT_SYMBOL(mpt_reset_deregister);
+EXPORT_SYMBOL(mpt_device_driver_register);
+EXPORT_SYMBOL(mpt_device_driver_deregister);
EXPORT_SYMBOL(mpt_get_msg_frame);
EXPORT_SYMBOL(mpt_put_msg_frame);
EXPORT_SYMBOL(mpt_free_msg_frame);
@@ -5877,16 +6059,32 @@
EXPORT_SYMBOL(mpt_ASCQ_TableSz);
EXPORT_SYMBOL(mpt_ScsiOpcodesPtr);
+
+static struct pci_driver mptbase_driver = {
+ .name = "mptbase",
+ .id_table = mptbase_pci_table,
+ .probe = mptbase_probe,
+ .remove = __devexit_p(mptbase_remove),
+ .driver = {
+ .shutdown = mptbase_shutdown,
+ },
+#ifdef CONFIG_PM
+ .suspend = mptbase_suspend,
+ .resume = mptbase_resume,
+#endif
+};
+
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/*
* fusion_init - Fusion MPT base driver initialization routine.
*
* Returns 0 for success, non-zero for failure.
*/
-int __init
+static int __init
fusion_init(void)
{
int i;
+ int r;
if (FusionInitCalled++) {
dprintk((KERN_INFO MYNAM ": INFO - Driver late-init entry
point called\n"));
@@ -5920,10 +6118,15 @@
/* FIXME! */
}
- if ((i = mpt_pci_scan()) < 0)
- return i;
+ r = pci_module_init(&mptbase_driver);
+ if(r)
+ return(r);
- return 0;
+#ifdef CONFIG_PROC_FS
+ (void) procmpt_create();
+#endif
+
+ return r;
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
@@ -5933,13 +6136,12 @@
* This routine frees all resources associated with each MPT adapter
* and removes all %MPT_PROCFS_MPTBASEDIR entries.
*/
-static void
+static void __exit
fusion_exit(void)
{
- MPT_ADAPTER *this;
- struct pci_dev *pdev = NULL;
dprintk((KERN_INFO MYNAM ": fusion_exit() called!\n"));
+ pci_unregister_driver(&mptbase_driver);
/* Whups? 20010120 -sralston
* Moved this *above* removal of all MptAdapters!
@@ -5948,30 +6150,9 @@
(void) procmpt_destroy();
#endif
- while (! Q_IS_EMPTY(&MptAdapters)) {
- this = MptAdapters.head;
-
- /* Disable interrupts! */
- CHIPREG_WRITE32(&this->chip->IntMask, 0xFFFFFFFF);
-
- this->active = 0;
-
- pdev = (struct pci_dev *)this->pcidev;
- mptscsih_sync_irq(pdev->irq);
-
- /* Clear any lingering interrupt */
- CHIPREG_WRITE32(&this->chip->IntStatus, 0);
-
- CHIPREG_READ32(&this->chip->IntStatus);
-
- Q_DEL_ITEM(this);
- mpt_adapter_dispose(this);
- }
-
mpt_reset_deregister(mpt_base_index);
}
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
module_init(fusion_init);
module_exit(fusion_exit);
diff -uarN linux-2.6.2-rc1-reference/drivers/message/fusion/mptbase.h
linux-2.6.2-rc1/drivers/message/fusion/mptbase.h
--- linux-2.6.2-rc1-reference/drivers/message/fusion/mptbase.h 2004-01-24
00:17:20.449873448 -0700
+++ linux-2.6.2-rc1/drivers/message/fusion/mptbase.h 2004-01-23
23:52:57.000000000 -0700
@@ -80,8 +80,8 @@
#define COPYRIGHT "Copyright (c) 1999-2003 " MODULEAUTHOR
#endif
-#define MPT_LINUX_VERSION_COMMON "2.05.00.06"
-#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.05.00.06"
+#define MPT_LINUX_VERSION_COMMON "3.00.02"
+#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.00.02"
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \
@@ -180,6 +180,16 @@
MPTUNKNOWN_DRIVER
} MPT_DRIVER_CLASS;
+struct mpt_pci_driver{
+ int (*probe) (struct pci_dev *dev, const struct pci_device_id *id);
+ void (*remove) (struct pci_dev *dev);
+ int (*suspend) (struct pci_dev *dev, u32 state);
+#ifdef CONFIG_PM
+ int (*resume) (struct pci_dev *dev);
+ void (*shutdown) (struct device * dev);
+#endif
+};
+
/*
* MPT adapter / port / bus / device info structures...
*/
@@ -629,6 +639,9 @@
FCPortPage0_t fc_port_page0[2];
LANPage0_t lan_cnfg_page0;
LANPage1_t lan_cnfg_page1;
+#ifdef CONFIG_PM
+ u32 PciState[64]; /* save PCI state to this
area */
+#endif
u8 FirstWhoInit;
u8 upload_fw; /* If set, do a fw upload */
u8 reload_fw; /* Force a FW Reload on next
reset */
@@ -1001,6 +1014,8 @@
extern void mpt_event_deregister(int cb_idx);
extern int mpt_reset_register(int cb_idx, MPT_RESETHANDLER
reset_func);
extern void mpt_reset_deregister(int cb_idx);
+extern int mpt_device_driver_register(struct mpt_pci_driver *
dd_cbfunc, int cb_idx);
+extern void mpt_device_driver_deregister(int cb_idx);
extern int mpt_register_ascqops_strings(void *ascqTable, int
ascqtbl_sz, const char **opsTable);
extern void mpt_deregister_ascqops_strings(void);
extern MPT_FRAME_HDR *mpt_get_msg_frame(int handle, int iocid);
diff -uarN linux-2.6.2-rc1-reference/drivers/message/fusion/mptscsih.c
linux-2.6.2-rc1/drivers/message/fusion/mptscsih.c
--- linux-2.6.2-rc1-reference/drivers/message/fusion/mptscsih.c 2004-01-24
00:17:20.545858856 -0700
+++ linux-2.6.2-rc1/drivers/message/fusion/mptscsih.c 2004-01-23
23:49:18.000000000 -0700
@@ -75,7 +75,8 @@
#include <linux/interrupt.h> /* needed for in_interrupt() proto */
#include <linux/reboot.h> /* notifier code */
#include "../../scsi/scsi.h"
-#include "../../scsi/hosts.h"
+#include <scsi/scsi_host.h>
+
#include "mptbase.h"
#include "mptscsih.h"
@@ -164,8 +165,8 @@
static MPT_FRAME_HDR *mptscsih_search_pendingQ(MPT_SCSI_HOST *hd, int
scpnt_idx);
static void post_pendingQ_commands(MPT_SCSI_HOST *hd);
-static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8
lun, int ctx2abort, int sleepFlag);
-static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8
target, u8 lun, int ctx2abort, int sleepFlag);
+static int mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8
lun, int ctx2abort, ulong timeout, int sleepFlag);
+static int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8
target, u8 lun, int ctx2abort, ulong timeout, int sleepFlag);
static int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
static int mptscsih_event_process(MPT_ADAPTER *ioc,
EventNotificationReply_t *pEvReply);
@@ -184,7 +185,7 @@
static struct mpt_work_struct mptscsih_rstTask;
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
static int mptscsih_do_raid(MPT_SCSI_HOST *hd, u8 action, INTERNAL_CMD
*io);
static void mptscsih_domainValidation(void *hd);
static int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id);
@@ -194,14 +195,19 @@
static void mptscsih_fillbuf(char *buffer, int size, int index, int
width);
#endif
static int mptscsih_setup(char *str);
-static int mptscsih_halt(struct notifier_block *nb, ulong event, void
*buf);
-/*
- * Reboot Notification
- */
-static struct notifier_block mptscsih_notifier = {
- mptscsih_halt, NULL, 0
-};
+/* module entry point */
+static int __init mptscsih_init (void);
+static void __exit mptscsih_exit (void);
+
+static int __devinit mptscsih_probe (struct pci_dev *, const struct
pci_device_id *);
+static void __devexit mptscsih_remove(struct pci_dev *);
+static void mptscsih_shutdown(struct device *);
+#ifdef CONFIG_PM
+static int mptscsih_suspend(struct pci_dev *pdev, u32 state);
+static int mptscsih_resume(struct pci_dev *pdev);
+#endif
+
/*
* Private data...
@@ -216,7 +222,7 @@
#define SNS_LEN(scp) sizeof((scp)->sense_buffer)
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
/*
* Domain Validation task structure
*/
@@ -238,6 +244,32 @@
driver_setup = MPTSCSIH_DRIVER_SETUP;
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
+
+/* see mptscsih.h */
+
+static struct scsi_host_template driver_template = {
+ .proc_name = "mptscsih",
+ .proc_info = x_scsi_proc_info,
+ .name = "MPT SCSI Host",
+ .info = x_scsi_info,
+ .queuecommand = x_scsi_queuecommand,
+ .slave_alloc = x_scsi_slave_alloc,
+ .slave_configure = x_scsi_slave_configure,
+ .slave_destroy = x_scsi_slave_destroy,
+ .eh_abort_handler = x_scsi_abort,
+ .eh_device_reset_handler = x_scsi_dev_reset,
+ .eh_bus_reset_handler = x_scsi_bus_reset,
+ .eh_host_reset_handler = x_scsi_host_reset,
+ .bios_param = x_scsi_bios_param,
+ .can_queue = MPT_SCSI_CAN_QUEUE,
+ .this_id = -1,
+ .sg_tablesize = MPT_SCSI_SG_DEPTH,
+ .max_sectors = MPT_SCSI_MAX_SECTORS,
+ .cmd_per_lun = MPT_SCSI_CMD_PER_LUN,
+ .use_clustering = ENABLE_CLUSTERING,
+};
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
/*
* Private inline routines...
*/
@@ -264,12 +296,14 @@
mptscsih_io_direction(Scsi_Cmnd *cmd)
{
switch (cmd->cmnd[0]) {
- case WRITE_6:
- case WRITE_10:
+ case WRITE_6:
+ case WRITE_10:
+ case WRITE_16:
return SCSI_DATA_WRITE;
break;
- case READ_6:
- case READ_10:
+ case READ_6:
+ case READ_10:
+ case READ_16:
return SCSI_DATA_READ;
break;
}
@@ -280,6 +314,7 @@
switch (cmd->cmnd[0]) {
/* _DATA_OUT commands */
case WRITE_6: case WRITE_10: case WRITE_12:
+ case WRITE_16:
case WRITE_LONG: case WRITE_SAME: case WRITE_BUFFER:
case WRITE_VERIFY: case WRITE_VERIFY_12:
case COMPARE: case COPY: case COPY_VERIFY:
@@ -826,6 +861,13 @@
sc->resid = sc->request_bufflen - xfer_cnt;
dprintk((KERN_NOTICE " SET sc->resid=%02xh\n",
sc->resid));
+ if(sc->underflow > xfer_cnt) {
+ printk(MYIOC_s_INFO_FMT
+ "SCSI data underrun: underflow=%02x,
xfercnt=%02x\n",
+ ioc->name, sc->underflow, xfer_cnt);
+ sc->result = DID_SOFT_ERROR << 16;
+ }
+
/* Report Queue Full
*/
if (sc->result == MPI_SCSI_STATUS_TASK_SET_FULL)
@@ -1235,7 +1277,6 @@
for(ii=0;ii<hd->ioc->req_depth;ii++)
hd->ReqToChain[ii] = MPT_HOST_NO_CHAIN;
-
/* ChainToChain size must equal the total number
* of chain buffers to be allocated.
* index = chain_idx
@@ -1277,7 +1318,6 @@
mem = (u8 *) hd->ChainToChain;
}
memset(mem, 0xFF, sz);
-
sz = num_chain * hd->ioc->req_sz;
if (hd->ChainBuffer == NULL) {
/* Allocate free chain buffer pool
@@ -1353,28 +1393,25 @@
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
-static int BeenHereDoneThat = 0;
static char *info_kbuf = NULL;
-/* SCSI host fops start here... */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
-/**
- * mptscsih_detect - Register MPT adapter(s) as SCSI host(s) with
- * linux scsi mid-layer.
- * @tpnt: Pointer to Scsi_Host_Template structure
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*
+ * mptscsih_probe - Installs scsi devices per bus.
+ * @pdev: Pointer to pci_dev structure
*
- * (linux Scsi_Host_Template.detect routine)
+ * Returns 0 for success, non-zero for failure.
*
- * Returns number of SCSI host adapters that were successfully
- * registered with the linux scsi mid-layer via the scsi_register()
- * API call.
*/
-int
-mptscsih_detect(Scsi_Host_Template *tpnt)
+
+static int __devinit
+mptscsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct Scsi_Host *sh = NULL;
MPT_SCSI_HOST *hd = NULL;
- MPT_ADAPTER *this;
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+ int portnum;
MPT_DONE_Q *freedoneQ;
unsigned long flags;
int sz, ii;
@@ -1382,325 +1419,312 @@
int scale;
u8 *mem;
- if (! BeenHereDoneThat++) {
- show_mptmod_ver(my_NAME, my_VERSION);
-
- ScsiDoneCtx = mpt_register(mptscsih_io_done,
MPTSCSIH_DRIVER);
- ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete,
MPTSCSIH_DRIVER);
- ScsiScanDvCtx = mpt_register(mptscsih_scandv_complete,
MPTSCSIH_DRIVER);
+ for (portnum=0; portnum < ioc->facts.NumberOfPorts; portnum++) {
- if (mpt_event_register(ScsiDoneCtx, mptscsih_event_process)
== 0) {
- dprintk((KERN_INFO MYNAM ": Registered for IOC event
notifications\n"));
- } else {
- /* FIXME! */
+ /* 20010215 -sralston
+ * Added sanity check on SCSI Initiator-mode enabled
+ * for this MPT adapter.
+ */
+ if (!(ioc->pfacts[portnum].ProtocolFlags &
+ MPI_PORTFACTS_PROTOCOL_INITIATOR)) {
+ printk(MYIOC_s_WARN_FMT
+ "Skipping because SCSI Initiator mode is NOT
enabled!\n",
+ ioc->name);
+ continue;
}
- if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) ==
0) {
- dprintk((KERN_INFO MYNAM ": Registered for IOC reset
notifications\n"));
- } else {
- /* FIXME! */
+ /* 20010202 -sralston
+ * Added sanity check on readiness of the MPT adapter.
+ */
+ if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
+ printk(MYIOC_s_WARN_FMT
+ "Skipping because it's not operational!\n",
+ ioc->name);
+ continue;
}
- }
- dprintk((KERN_INFO MYNAM ": mpt_scsih_detect()\n"));
-#ifdef MODULE
- /* Evaluate the command line arguments, if any */
- if (mptscsih)
- mptscsih_setup(mptscsih);
-#endif
+ sh = scsi_host_alloc(&driver_template,
sizeof(MPT_SCSI_HOST));
+ if (sh != NULL) {
+ spin_lock_irqsave(&ioc->FreeQlock, flags);
- this = mpt_adapter_find_first();
- while (this != NULL) {
- int portnum;
- for (portnum=0; portnum < this->facts.NumberOfPorts;
portnum++) {
-
- /* 20010215 -sralston
- * Added sanity check on SCSI Initiator-mode
enabled
- * for this MPT adapter.
- */
- if (!(this->pfacts[portnum].ProtocolFlags &
MPI_PORTFACTS_PROTOCOL_INITIATOR)) {
- printk(MYIOC_s_WARN_FMT "Skipping because
SCSI Initiator mode is NOT enabled!\n",
- this->name);
- continue;
- }
+ /* Attach the SCSI Host to the IOC structure
+ */
+ ioc->sh = sh;
- /* 20010202 -sralston
- * Added sanity check on readiness of the MPT
adapter.
+ sh->io_port = 0;
+ sh->n_io_port = 0;
+ sh->irq = 0;
+
+ /* set 16 byte cdb's */
+ sh->max_cmd_len = 16;
+
+ /* Yikes! This is important!
+ * Otherwise, by default, linux
+ * only scans target IDs 0-7!
+ * pfactsN->MaxDevices unreliable
+ * (not supported in early
+ * versions of the FW).
+ * max_id = 1 + actual max id,
+ * max_lun = 1 + actual last lun,
+ * see hosts.h :o(
*/
- if (this->last_state != MPI_IOC_STATE_OPERATIONAL) {
- printk(MYIOC_s_WARN_FMT "Skipping because
it's not operational!\n",
- this->name);
- continue;
+ if ((int)ioc->chip_type > (int)FC929) {
+ sh->max_id = MPT_MAX_SCSI_DEVICES;
+ } else {
+ /* For FC, increase the queue depth
+ * from MPT_SCSI_CAN_QUEUE (31)
+ * to MPT_FC_CAN_QUEUE (63).
+ */
+ sh->can_queue = MPT_FC_CAN_QUEUE;
+ sh->max_id =
+ MPT_MAX_FC_DEVICES<256 ?
MPT_MAX_FC_DEVICES : 255;
}
- tpnt->proc_info = mptscsih_proc_info;
- sh = scsi_register(tpnt, sizeof(MPT_SCSI_HOST));
- if (sh != NULL) {
- spin_lock_irqsave(&this->FreeQlock, flags);
- sh->io_port = 0;
- sh->n_io_port = 0;
- sh->irq = 0;
-
- /* Yikes! This is important!
- * Otherwise, by default, linux
- * only scans target IDs 0-7!
- * pfactsN->MaxDevices unreliable
- * (not supported in early
- * versions of the FW).
- * max_id = 1 + actual max id,
- * max_lun = 1 + actual last lun,
- * see hosts.h :o(
- */
- if ((int)this->chip_type > (int)FC929)
- sh->max_id = MPT_MAX_SCSI_DEVICES;
- else {
- /* For FC, increase the queue depth
- * from MPT_SCSI_CAN_QUEUE (31)
- * to MPT_FC_CAN_QUEUE (63).
- */
- sh->can_queue = MPT_FC_CAN_QUEUE;
- sh->max_id = MPT_MAX_FC_DEVICES<256
? MPT_MAX_FC_DEVICES : 255;
- }
- sh->max_lun = MPT_LAST_LUN + 1;
+ sh->max_lun = MPT_LAST_LUN + 1;
+ sh->max_sectors = MPT_SCSI_MAX_SECTORS;
+ sh->this_id = ioc->pfacts[portnum].PortSCSIID;
- sh->max_sectors = MPT_SCSI_MAX_SECTORS;
- sh->this_id =
this->pfacts[portnum].PortSCSIID;
+ /* Required entry.
+ */
+ sh->unique_id = ioc->id;
- /* Required entry.
- */
- sh->unique_id = this->id;
+ /* Verify that we won't exceed the maximum
+ * number of chain buffers
+ * We can optimize: ZZ = req_sz/sizeof(SGE)
+ * For 32bit SGE's:
+ * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
+ * + (req_sz - 64)/sizeof(SGE)
+ * A slightly different algorithm is required for
+ * 64bit SGEs.
+ */
+ scale = ioc->req_sz/(sizeof(dma_addr_t) +
sizeof(u32));
+ if (sizeof(dma_addr_t) == sizeof(u64)) {
+ numSGE = (scale - 1) *
+ (ioc->facts.MaxChainDepth-1) + scale +
+ (ioc->req_sz - 60) / (sizeof(dma_addr_t) +
+ sizeof(u32));
+ } else {
+ numSGE = 1 + (scale - 1) *
+ (ioc->facts.MaxChainDepth-1) + scale +
+ (ioc->req_sz - 64) / (sizeof(dma_addr_t) +
+ sizeof(u32));
+ }
- /* Verify that we won't exceed the maximum
- * number of chain buffers
- * We can optimize: ZZ = req_sz/sizeof(SGE)
- * For 32bit SGE's:
- * numSGE = 1 + (ZZ-1)*(maxChain -1) + ZZ
- * + (req_sz - 64)/sizeof(SGE)
- * A slightly different algorithm is
required for
- * 64bit SGEs.
- */
- scale = this->req_sz/(sizeof(dma_addr_t) +
sizeof(u32));
- if (sizeof(dma_addr_t) == sizeof(u64)) {
- numSGE = (scale - 1) *
(this->facts.MaxChainDepth-1) + scale +
- (this->req_sz - 60) /
(sizeof(dma_addr_t) + sizeof(u32));
- } else {
- numSGE = 1 + (scale - 1) *
(this->facts.MaxChainDepth-1) + scale +
- (this->req_sz - 64) /
(sizeof(dma_addr_t) + sizeof(u32));
- }
+ if (numSGE < sh->sg_tablesize) {
+ /* Reset this value */
+ dprintk((MYIOC_s_INFO_FMT
+ "Resetting sg_tablesize to %d from %d\n",
+ ioc->name, numSGE, sh->sg_tablesize));
+ sh->sg_tablesize = numSGE;
+ }
- if (numSGE < sh->sg_tablesize) {
- /* Reset this value */
- dprintk((MYIOC_s_INFO_FMT
- "Resetting sg_tablesize to
%d from %d\n",
- this->name, numSGE,
sh->sg_tablesize));
- sh->sg_tablesize = numSGE;
- }
+ /* Set the pci device pointer in Scsi_Host
structure.
+ */
+ scsi_set_device(sh, &ioc->pcidev->dev);
- /* Set the pci device pointer in Scsi_Host
structure.
- */
- scsi_set_device(sh, &this->pcidev->dev);
+ spin_unlock_irqrestore(&ioc->FreeQlock, flags);
- spin_unlock_irqrestore(&this->FreeQlock,
flags);
+ hd = (MPT_SCSI_HOST *) sh->hostdata;
+ hd->ioc = ioc;
+ hd->max_sge = sh->sg_tablesize;
- hd = (MPT_SCSI_HOST *) sh->hostdata;
- hd->ioc = this;
- hd->max_sge = sh->sg_tablesize;
+ if ((int)ioc->chip_type > (int)FC929)
+ hd->is_spi = 1;
- if ((int)this->chip_type > (int)FC929)
- hd->is_spi = 1;
+ if (DmpService && (ioc->chip_type == FC919 ||
+ ioc->chip_type == FC929)) {
+ hd->is_multipath = 1;
+ }
+ hd->port = 0; /* FIXME! */
- if (DmpService &&
- (this->chip_type == FC919 ||
this->chip_type == FC929))
- hd->is_multipath = 1;
+ /* SCSI needs Scsi_Cmnd lookup table!
+ * (with size equal to req_depth*PtrSz!)
+ */
+ sz = hd->ioc->req_depth * sizeof(void *);
+ mem = kmalloc(sz, GFP_ATOMIC);
+ if (mem == NULL)
+ goto mptscsih_probe_failed;
- hd->port = 0; /* FIXME! */
+ memset(mem, 0, sz);
+ hd->ScsiLookup = (struct scsi_cmnd **) mem;
- /* SCSI needs Scsi_Cmnd lookup table!
- * (with size equal to req_depth*PtrSz!)
- */
- sz = hd->ioc->req_depth * sizeof(void *);
- mem = kmalloc(sz, GFP_ATOMIC);
- if (mem == NULL)
- goto done;
+ dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p,
sz=%d\n",
+ ioc->name, hd->ScsiLookup, sz));
- memset(mem, 0, sz);
- hd->ScsiLookup = (struct scsi_cmnd **) mem;
+ if (mptscsih_initChainBuffers(hd, 1) < 0)
+ goto mptscsih_probe_failed;
- dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p,
sz=%d\n",
- this->name, hd->ScsiLookup, sz));
+ /* Allocate memory for free and doneQ's
+ */
+ sz = sh->can_queue * sizeof(MPT_DONE_Q);
+ mem = kmalloc(sz, GFP_ATOMIC);
+ if (mem == NULL)
+ goto mptscsih_probe_failed;
- if (mptscsih_initChainBuffers(hd, 1) < 0)
- goto done;
+ memset(mem, 0xFF, sz);
+ hd->memQ = mem;
- /* Allocate memory for free and doneQ's
- */
- sz = sh->can_queue * sizeof(MPT_DONE_Q);
- mem = kmalloc(sz, GFP_ATOMIC);
- if (mem == NULL)
- goto done;
+ /* Initialize the free, done and pending Qs.
+ */
+ Q_INIT(&hd->freeQ, MPT_DONE_Q);
+ Q_INIT(&hd->doneQ, MPT_DONE_Q);
+ Q_INIT(&hd->pendingQ, MPT_DONE_Q);
+ spin_lock_init(&hd->freedoneQlock);
+
+ mem = hd->memQ;
+ for (ii=0; ii < sh->can_queue; ii++) {
+ freedoneQ = (MPT_DONE_Q *) mem;
+ Q_ADD_TAIL(&hd->freeQ.head, freedoneQ,
MPT_DONE_Q);
+ mem += sizeof(MPT_DONE_Q);
+ }
- memset(mem, 0xFF, sz);
- hd->memQ = mem;
+ /* Initialize this Scsi_Host
+ * internal task Q.
+ */
+ Q_INIT(&hd->taskQ, MPT_FRAME_HDR);
+ hd->taskQcnt = 0;
- /* Initialize the free, done and pending Qs.
- */
- Q_INIT(&hd->freeQ, MPT_DONE_Q);
- Q_INIT(&hd->doneQ, MPT_DONE_Q);
- Q_INIT(&hd->pendingQ, MPT_DONE_Q);
- spin_lock_init(&hd->freedoneQlock);
-
- mem = hd->memQ;
- for (ii=0; ii < sh->can_queue; ii++) {
- freedoneQ = (MPT_DONE_Q *) mem;
- Q_ADD_TAIL(&hd->freeQ.head,
freedoneQ, MPT_DONE_Q);
- mem += sizeof(MPT_DONE_Q);
- }
+ /* Allocate memory for the device structures.
+ * A non-Null pointer at an offset
+ * indicates a device exists.
+ * max_id = 1 + maximum id (hosts.h)
+ */
+ sz = sh->max_id * sizeof(void *);
+ mem = kmalloc(sz, GFP_ATOMIC);
+ if (mem == NULL)
+ goto mptscsih_probe_failed;
- /* Initialize this Scsi_Host
- * internal task Q.
- */
- Q_INIT(&hd->taskQ, MPT_FRAME_HDR);
- hd->taskQcnt = 0;
+ memset(mem, 0, sz);
+ hd->Targets = (VirtDevice **) mem;
- /* Allocate memory for the device
structures.
- * A non-Null pointer at an offset
- * indicates a device exists.
- * max_id = 1 + maximum id (hosts.h)
- */
- sz = sh->max_id * sizeof(void *);
- mem = kmalloc(sz, GFP_ATOMIC);
- if (mem == NULL)
- goto done;
+ dprintk((KERN_INFO
+ " Targets @ %p, sz=%d\n", hd->Targets, sz));
- memset(mem, 0, sz);
- hd->Targets = (VirtDevice **) mem;
- dprintk((KERN_INFO " Targets @ %p,
sz=%d\n", hd->Targets, sz));
+ /* Clear the TM flags
+ */
+ hd->tmPending = 0;
+ hd->tmState = TM_STATE_NONE;
+ hd->resetPending = 0;
+ hd->abortSCpnt = NULL;
+ hd->tmPtr = NULL;
+ hd->numTMrequests = 0;
+ /* Clear the pointer used to store
+ * single-threaded commands, i.e., those
+ * issued during a bus scan, dv and
+ * configuration pages.
+ */
+ hd->cmdPtr = NULL;
- /* Clear the TM flags
- */
- hd->tmPending = 0;
- hd->tmState = TM_STATE_NONE;
- hd->resetPending = 0;
- hd->abortSCpnt = NULL;
- hd->tmPtr = NULL;
- hd->numTMrequests = 0;
+ /* Initialize this SCSI Hosts' timers
+ * To use, set the timer expires field
+ * and add_timer
+ */
+ init_timer(&hd->timer);
+ hd->timer.data = (unsigned long) hd;
+ hd->timer.function = mptscsih_timer_expired;
+
+ init_timer(&hd->TMtimer);
+ hd->TMtimer.data = (unsigned long) hd;
+ hd->TMtimer.function = mptscsih_taskmgmt_timeout;
+ hd->qtag_tick = jiffies;
- /* Clear the pointer used to store
- * single-threaded commands, i.e., those
- * issued during a bus scan, dv and
- * configuration pages.
- */
- hd->cmdPtr = NULL;
+ /* Moved Earlier Pam D */
+ /* ioc->sh = sh; */
- /* Attach the SCSI Host to the IOC structure
+ if (hd->is_spi) {
+ /* Update with the driver setup
+ * values.
*/
- this->sh = sh;
+ if (hd->ioc->spi_data.maxBusWidth >
+ driver_setup.max_width) {
+ hd->ioc->spi_data.maxBusWidth =
+ driver_setup.max_width;
+ }
- /* Initialize this SCSI Hosts' timers
- * To use, set the timer expires field
- * and add_timer
- */
- init_timer(&hd->timer);
- hd->timer.data = (unsigned long) hd;
- hd->timer.function = mptscsih_timer_expired;
-
- init_timer(&hd->TMtimer);
- hd->TMtimer.data = (unsigned long) hd;
- hd->TMtimer.function =
mptscsih_taskmgmt_timeout;
- hd->qtag_tick = jiffies;
-
- /* Moved Earlier Pam D */
- /* this->sh = sh; */
-
- if (hd->is_spi) {
- /* Update with the driver setup
- * values.
- */
- if (hd->ioc->spi_data.maxBusWidth >
driver_setup.max_width)
-
hd->ioc->spi_data.maxBusWidth = driver_setup.max_width;
- if (hd->ioc->spi_data.minSyncFactor
< driver_setup.min_sync_fac)
-
hd->ioc->spi_data.minSyncFactor = driver_setup.min_sync_fac;
+ if (hd->ioc->spi_data.minSyncFactor <
+ driver_setup.min_sync_fac) {
+ hd->ioc->spi_data.minSyncFactor =
+ driver_setup.min_sync_fac;
+ }
- if (hd->ioc->spi_data.minSyncFactor
== MPT_ASYNC)
-
hd->ioc->spi_data.maxSyncOffset = 0;
+ if (hd->ioc->spi_data.minSyncFactor ==
MPT_ASYNC) {
+ hd->ioc->spi_data.maxSyncOffset = 0;
+ }
- hd->negoNvram = 0;
-#ifdef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
- hd->negoNvram =
MPT_SCSICFG_USE_NVRAM;
+ hd->negoNvram = 0;
+#ifndef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
+ hd->negoNvram = MPT_SCSICFG_USE_NVRAM;
#endif
- if (driver_setup.dv == 0)
- hd->negoNvram =
MPT_SCSICFG_USE_NVRAM;
-
- hd->ioc->spi_data.forceDv = 0;
- for (ii=0; ii <
MPT_MAX_SCSI_DEVICES; ii++)
-
hd->ioc->spi_data.dvStatus[ii] = MPT_SCSICFG_NEGOTIATE;
-
- if (hd->negoNvram == 0) {
- for (ii=0; ii <
MPT_MAX_SCSI_DEVICES; ii++)
-
hd->ioc->spi_data.dvStatus[ii] |= MPT_SCSICFG_DV_NOT_DONE;
- }
+ if (driver_setup.dv == 0) {
+ hd->negoNvram =
MPT_SCSICFG_USE_NVRAM;
+ }
- ddvprintk((MYIOC_s_INFO_FMT
- "dv %x width %x factor %x
\n",
- hd->ioc->name,
driver_setup.dv,
- driver_setup.max_width,
- driver_setup.min_sync_fac));
+ hd->ioc->spi_data.forceDv = 0;
+ for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++)
{
+ hd->ioc->spi_data.dvStatus[ii] =
+ MPT_SCSICFG_NEGOTIATE;
+ }
+ if (hd->negoNvram == 0) {
+ for (ii=0; ii <
MPT_MAX_SCSI_DEVICES; ii++)
+
hd->ioc->spi_data.dvStatus[ii] |=
+ MPT_SCSICFG_DV_NOT_DONE;
}
- mpt_scsi_hosts++;
+ ddvprintk((MYIOC_s_INFO_FMT
+ "dv %x width %x factor %x \n",
+ hd->ioc->name, driver_setup.dv,
+ driver_setup.max_width,
+ driver_setup.min_sync_fac));
+
}
- } /* for each adapter port */
+ mpt_scsi_hosts++;
- this = mpt_adapter_find_next(this);
- }
+ if(scsi_add_host (sh, &ioc->pcidev->dev)) {
+ dprintk((KERN_ERR MYNAM,
+ "scsi_add_host failed\n"));
+ goto mptscsih_probe_failed;
+ }
-done:
- if (mpt_scsi_hosts > 0)
- register_reboot_notifier(&mptscsih_notifier);
- else {
- mpt_reset_deregister(ScsiDoneCtx);
- dprintk((KERN_INFO MYNAM ": Deregistered for IOC reset
notifications\n"));
+ scsi_scan_host(sh);
+ return 0;
- mpt_event_deregister(ScsiDoneCtx);
- dprintk((KERN_INFO MYNAM ": Deregistered for IOC event
notifications\n"));
+ } /* scsi_host_alloc */
- mpt_deregister(ScsiScanDvCtx);
- mpt_deregister(ScsiTaskCtx);
- mpt_deregister(ScsiDoneCtx);
+ } /* for each adapter port */
- if (info_kbuf != NULL)
- kfree(info_kbuf);
- }
+mptscsih_probe_failed:
+
+ mptscsih_remove(pdev);
+ return -ENODEV;
- return mpt_scsi_hosts;
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
-/**
- * mptscsih_release - Unregister SCSI host from linux scsi mid-layer
- * @host: Pointer to Scsi_Host structure
+/*
+ * mptscsih_remove - Removed scsi devices
+ * @pdev: Pointer to pci_dev structure
*
- * (linux Scsi_Host_Template.release routine)
- * This routine releases all resources associated with the SCSI host
- * adapter.
*
- * Returns 0 for success.
*/
-int
-mptscsih_release(struct Scsi_Host *host)
+static void __devexit
+mptscsih_remove(struct pci_dev *pdev)
{
- MPT_SCSI_HOST *hd;
- int count;
- unsigned long flags;
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+ struct Scsi_Host *host = ioc->sh;
+ MPT_SCSI_HOST *hd;
+ int count;
+ unsigned long flags;
+
+ if(!host)
+ return;
- hd = (MPT_SCSI_HOST *) host->hostdata;
+ scsi_remove_host(host);
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
/* Check DV thread active */
count = 10 * HZ;
spin_lock_irqsave(&dvtaskQ_lock, flags);
@@ -1721,8 +1745,7 @@
#endif
#endif
- unregister_reboot_notifier(&mptscsih_notifier);
-
+ hd = (MPT_SCSI_HOST *)host->hostdata;
if (hd != NULL) {
int sz1, sz2, sz3, sztarget=0;
int szr2chain = 0;
@@ -1730,9 +1753,7 @@
int szchain = 0;
int szQ = 0;
- /* Synchronize disk caches
- */
- (void) mptscsih_synchronize_cache(hd, 0);
+ mptscsih_shutdown(&pdev->dev);
sz1 = sz2 = sz3 = 0;
@@ -1796,72 +1817,203 @@
hd->Targets = NULL;
}
- dprintk((MYIOC_s_INFO_FMT "Free'd ScsiLookup (%d), chain
(%d) and Target (%d+%d) memory\n",
- hd->ioc->name, sz1, szchain, sz3,
sztarget));
+ dprintk((MYIOC_s_INFO_FMT
+ "Free'd ScsiLookup (%d), chain (%d) and Target (%d+%d)
memory\n",
+ hd->ioc->name, sz1, szchain, sz3, sztarget));
dprintk(("Free'd done and free Q (%d) memory\n", szQ));
+
+ /* NULL the Scsi_Host pointer
+ */
+ hd->ioc->sh = NULL;
}
- /* NULL the Scsi_Host pointer
+
+ scsi_host_put(host);
+
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*
+ * mptscsih_shutdown - reboot notifier
+ *
+ */
+static void
+mptscsih_shutdown(struct device * dev)
+{
+ MPT_ADAPTER *ioc = pci_get_drvdata(to_pci_dev(dev));
+ struct Scsi_Host *host = ioc->sh;
+ MPT_SCSI_HOST *hd;
+
+ if(!host)
+ return;
+
+ hd = (MPT_SCSI_HOST *)host->hostdata;
+
+ /* Flush the cache of this adapter
*/
- hd->ioc->sh = NULL;
- scsi_unregister(host);
+ if(hd != NULL)
+ mptscsih_synchronize_cache(hd, 0);
- if (mpt_scsi_hosts) {
- if (--mpt_scsi_hosts == 0) {
- mpt_reset_deregister(ScsiDoneCtx);
- dprintk((KERN_INFO MYNAM ": Deregistered for IOC
reset notifications\n"));
+}
- mpt_event_deregister(ScsiDoneCtx);
- dprintk((KERN_INFO MYNAM ": Deregistered for IOC
event notifications\n"));
+#ifdef CONFIG_PM
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*
+ * mptscsih_suspend - Fusion MPT scsie driver suspend routine.
+ *
+ *
+ */
+static int
+mptscsih_suspend(struct pci_dev *pdev, u32 state)
+{
+ mptscsih_shutdown(&pdev->dev);
+ return 0;
+}
- mpt_deregister(ScsiScanDvCtx);
- mpt_deregister(ScsiTaskCtx);
- mpt_deregister(ScsiDoneCtx);
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*
+ * mptscsih_resume - Fusion MPT scsi driver resume routine.
+ *
+ *
+ */
+static int
+mptscsih_resume(struct pci_dev *pdev)
+{
+ MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
+ struct Scsi_Host *host = ioc->sh;
+ MPT_SCSI_HOST *hd;
- if (info_kbuf != NULL)
- kfree(info_kbuf);
- }
- }
+ if(!host)
+ return 0;
+ hd = (MPT_SCSI_HOST *)host->hostdata;
+ if(!hd)
+ return 0;
+
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
+ {
+ unsigned long lflags;
+ spin_lock_irqsave(&dvtaskQ_lock, lflags);
+ if (!dvtaskQ_active) {
+ dvtaskQ_active = 1;
+ spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
+ MPT_INIT_WORK(&mptscsih_dvTask,
+ mptscsih_domainValidation, (void *) hd);
+ SCHEDULE_TASK(&mptscsih_dvTask);
+ } else {
+ spin_unlock_irqrestore(&dvtaskQ_lock, lflags);
+ }
+ }
+#endif
return 0;
}
+#endif
+
+static struct mpt_pci_driver mptscsih_driver = {
+ .probe = mptscsih_probe,
+ .remove = __devexit_p(mptscsih_remove),
+ .shutdown = mptscsih_shutdown,
+#ifdef CONFIG_PM
+ .suspend = mptscsih_suspend,
+ .resume = mptscsih_resume,
+#endif
+};
+
+
+/* SCSI host fops start here... */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/**
- * mptscsih_halt - Process the reboot notification
- * @nb: Pointer to a struct notifier_block (ignored)
- * @event: event (SYS_HALT, SYS_RESTART, SYS_POWER_OFF)
- * @buf: Pointer to a data buffer (ignored)
- *
- * This routine called if a system shutdown or reboot is to occur.
+ * mptscsih_init - Register MPT adapter(s) as SCSI host(s) with
+ * linux scsi mid-layer.
*
- * Return NOTIFY_DONE if this is something other than a reboot message.
- * NOTIFY_OK if this is a reboot message.
+ * Returns 0 for success, non-zero for failure.
*/
static int
-mptscsih_halt(struct notifier_block *nb, ulong event, void *buf)
+__init mptscsih_init(void)
{
- MPT_ADAPTER *ioc = NULL;
- MPT_SCSI_HOST *hd = NULL;
+ MPT_ADAPTER *ioc;
- /* Ignore all messages other than reboot message
- */
- if ((event != SYS_RESTART) && (event != SYS_HALT)
- && (event != SYS_POWER_OFF))
- return (NOTIFY_DONE);
+ show_mptmod_ver(my_NAME, my_VERSION);
- for (ioc = mpt_adapter_find_first(); ioc != NULL; ioc =
mpt_adapter_find_next(ioc)) {
- /* Flush the cache of this adapter
- */
- if (ioc->sh) {
- hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
- if (hd) {
- mptscsih_synchronize_cache(hd, 0);
- }
+ ScsiDoneCtx = mpt_register(mptscsih_io_done, MPTSCSIH_DRIVER);
+ ScsiTaskCtx = mpt_register(mptscsih_taskmgmt_complete,
MPTSCSIH_DRIVER);
+ ScsiScanDvCtx = mpt_register(mptscsih_scandv_complete,
MPTSCSIH_DRIVER);
+
+ if(mpt_device_driver_register(&mptscsih_driver,
+ MPTSCSIH_DRIVER) != 0 ) {
+ dprintk((KERN_INFO MYNAM
+ ": failed to register dd callbacks\n"));
+ }
+
+ if (mpt_event_register(ScsiDoneCtx, mptscsih_event_process) == 0) {
+ dprintk((KERN_INFO MYNAM
+ ": Registered for IOC event notifications\n"));
+ }
+
+ if (mpt_reset_register(ScsiDoneCtx, mptscsih_ioc_reset) == 0) {
+ dprintk((KERN_INFO MYNAM
+ ": Registered for IOC reset notifications\n"));
+ }
+
+#ifdef MODULE
+ /* Evaluate the command line arguments, if any */
+ if (mptscsih)
+ mptscsih_setup(mptscsih);
+#endif
+
+ /* probing for devices */
+ for(ioc = mpt_adapter_find_first(); ioc != NULL;
+ ioc = mpt_adapter_find_next(ioc)) {
+ if(mptscsih_probe(ioc->pcidev,
ioc->pcidev->driver->id_table)) {
+ dprintk((KERN_INFO MYNAM ": probe failed\n"));
+ return -ENODEV;
}
}
- unregister_reboot_notifier(&mptscsih_notifier);
- return NOTIFY_OK;
+ if (mpt_scsi_hosts > 0)
+ return 0;
+
+ mptscsih_exit();
+ return -ENODEV;
+
+}
+
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
+/**
+ * mptscsih_exit - Unregisters MPT adapter(s)
+ *
+ */
+static void
+__exit mptscsih_exit(void)
+{
+ MPT_ADAPTER *ioc;
+
+ /* removing devices */
+ for(ioc = mpt_adapter_find_first(); ioc != NULL;
+ ioc = mpt_adapter_find_next(ioc)) {
+ if ((ioc->last_state != MPI_IOC_STATE_OPERATIONAL) ||
+ (ioc->sh == NULL))
+ continue;
+ mptscsih_remove(ioc->pcidev);
+ }
+
+ mpt_reset_deregister(ScsiDoneCtx);
+ dprintk((KERN_INFO MYNAM
+ ": Deregistered for IOC reset notifications\n"));
+
+ mpt_event_deregister(ScsiDoneCtx);
+ dprintk((KERN_INFO MYNAM
+ ": Deregistered for IOC event notifications\n"));
+
+ mpt_device_driver_deregister(MPTSCSIH_DRIVER);
+ mpt_deregister(ScsiScanDvCtx);
+ mpt_deregister(ScsiTaskCtx);
+ mpt_deregister(ScsiDoneCtx);
+
+ if (info_kbuf != NULL)
+ kfree(info_kbuf);
+
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
@@ -2436,7 +2588,7 @@
hd->ioc->spi_data.dvStatus[target] =
dvStatus;
}
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
if ((dvStatus & MPT_SCSICFG_NEED_DV) ||
(hd->ioc->spi_data.forceDv &
MPT_SCSICFG_NEED_DV)) {
unsigned long lflags;
@@ -2608,7 +2760,7 @@
* Returns 0 for SUCCESS or -1 if FAILED.
*/
static int
-mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int
ctx2abort, int sleepFlag)
+mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int
ctx2abort, ulong timeout, int sleepFlag)
{
MPT_ADAPTER *ioc = NULL;
int rc = -1;
@@ -2664,7 +2816,7 @@
*/
if (hd->hard_resets < -1)
hd->hard_resets++;
- rc = mptscsih_IssueTaskMgmt(hd, type, target, lun,
ctx2abort, sleepFlag);
+ rc = mptscsih_IssueTaskMgmt(hd, type, target, lun,
ctx2abort, timeout, sleepFlag);
if (rc) {
printk(MYIOC_s_INFO_FMT "Issue of TaskMgmt
failed!\n", hd->ioc->name);
} else {
@@ -2710,7 +2862,7 @@
* else other non-zero value returned.
*/
static int
-mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int
ctx2abort, int sleepFlag)
+mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 target, u8 lun, int
ctx2abort, ulong timeout, int sleepFlag)
{
MPT_FRAME_HDR *mf;
SCSITaskMgmt_t *pScsiTm;
@@ -2760,7 +2912,7 @@
*/
hd->tmPtr = mf;
hd->numTMrequests++;
- hd->TMtimer.expires = jiffies + HZ*20; /* 20 seconds */
+ hd->TMtimer.expires = jiffies + timeout;
add_timer(&hd->TMtimer);
if ((retval = mpt_send_handshake_request(ScsiTaskCtx, hd->ioc->id,
@@ -2870,7 +3022,8 @@
spin_unlock_irq(host_lock);
if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
- SCpnt->device->id, SCpnt->device->lun,
ctx2abort, CAN_SLEEP)
+ SCpnt->device->id, SCpnt->device->lun,
+ ctx2abort, (HZ*2) /* 2 second timeout */,CAN_SLEEP)
< 0) {
/* The TM request failed and the subsequent FW-reload
failed!
@@ -2940,7 +3093,7 @@
}
if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
- SCpnt->device->id, 0, 0, CAN_SLEEP)
+ SCpnt->device->id, 0, 0, (HZ*5) /* 5 second timeout */,
CAN_SLEEP)
< 0){
/* The TM request failed and the subsequent FW-reload
failed!
* Fatal error case.
@@ -3004,7 +3157,7 @@
/* We are now ready to execute the task management request. */
if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS,
- 0, 0, 0, CAN_SLEEP)
+ 0, 0, 0, (HZ*5) /* 5 second timeout */, CAN_SLEEP)
< 0){
/* The TM request failed and the subsequent FW-reload
failed!
@@ -3087,7 +3240,7 @@
mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd)
{
unsigned long flags;
- int loop_count = 60 * 4; /* Wait 60 seconds */
+ int loop_count = 10 * 4; /* Wait 10 seconds */
int status = FAILED;
do {
@@ -3227,18 +3380,50 @@
*/
int
mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev,
- sector_t capacity, int *ip)
+ sector_t capacity, int geom[])
{
- int size;
+ int heads;
+ int sectors;
+ sector_t cylinders;
+#ifdef CONFIG_LBD
+ ulong dummy;
+#endif
- size = capacity;
- ip[0] = 64; /* heads
*/
- ip[1] = 32; /* sectors
*/
- if ((ip[2] = size >> 11) > 1024) { /* cylinders, test for big
disk */
- ip[0] = 255; /* heads
*/
- ip[1] = 63; /* sectors
*/
- ip[2] = size / (255 * 63); /* cylinders
*/
+ heads = 64;
+ sectors = 32;
+#ifdef CONFIG_LBD
+ dummy = heads * sectors;
+ cylinders = capacity;
+ sector_div(cylinders,dummy);
+#else
+ cylinders = (ulong)capacity / (heads * sectors);
+#endif
+
+ /*
+ * Handle extended translation size for logical drives
+ * > 1Gb
+ */
+ if ((ulong)capacity >= 0x200000) {
+ heads = 255;
+ sectors = 63;
+#ifdef CONFIG_LBD
+ dummy = heads * sectors;
+ cylinders = capacity;
+ sector_div(cylinders,dummy);
+#else
+ cylinders = (ulong)capacity / (heads * sectors);
+#endif
}
+
+ /* return result */
+ geom[0] = heads;
+ geom[1] = sectors;
+ geom[2] = cylinders;
+
+ dprintk((KERN_NOTICE
+ ": bios_param: Id=%i Lun=%i Channel=%i CHS=%i/%i/%i\n",
+ sdev->id,
sdev->lun,sdev->channel,(int)cylinders,heads,sectors));
+
return 0;
}
@@ -3368,7 +3553,7 @@
vdev->raidVolume = 0;
if (hd->is_spi && (hd->ioc->spi_data.isRaid & (1 <<
(device->id)))) {
vdev->raidVolume = 1;
- ddvtprintk((KERN_INFO "RAID Volume @ id
%d\n", target_id));
+ ddvtprintk((KERN_INFO "RAID Volume @ id
%d\n", device->id));
}
mptscsih_target_settings(hd, vdev, device);
@@ -3650,36 +3835,6 @@
return -1;
}
-/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-=*/
-
-/* see mptscsih.h */
-
-#ifdef MPT_SCSIHOST_NEED_ENTRY_EXIT_HOOKUPS
-static Scsi_Host_Template driver_template = {
- .proc_name = "mptscsih",
- .proc_info = x_scsi_proc_info,
- .name = "MPT SCSI Host",
- .detect = x_scsi_detect,
- .release = x_scsi_release,
- .info = x_scsi_info,
- .queuecommand = x_scsi_queuecommand,
- .slave_alloc = x_scsi_slave_alloc,
- .slave_configure = x_scsi_slave_configure,
- .slave_destroy = x_scsi_slave_destroy,
- .eh_abort_handler = x_scsi_abort,
- .eh_device_reset_handler = x_scsi_dev_reset,
- .eh_bus_reset_handler = x_scsi_bus_reset,
- .eh_host_reset_handler = x_scsi_host_reset,
- .bios_param = x_scsi_bios_param,
- .can_queue = MPT_SCSI_CAN_QUEUE,
- .this_id = -1,
- .sg_tablesize = MPT_SCSI_SG_DEPTH,
- .max_sectors = MPT_SCSI_MAX_SECTORS,
- .cmd_per_lun = MPT_SCSI_CMD_PER_LUN,
- .use_clustering = ENABLE_CLUSTERING,
-};
-#include "../../scsi/scsi_module.c"
-#endif
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/* Search the pendingQ for a command with specific index.
@@ -3958,7 +4113,7 @@
break;
case MPI_EVENT_INTEGRATED_RAID: /* 0B */
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
/* negoNvram set to 0 if DV enabled and to USE_NVRAM if
* if DV disabled. Need to check for target mode.
*/
@@ -3972,7 +4127,7 @@
int numPDisk;
u8 reason;
u8 physDiskNum;
-
+
reason = (le32_to_cpu(pEvReply->Data[0]) &
0x00FF0000) >> 16;
if (reason == MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED) {
/* New or replaced disk.
@@ -4320,6 +4475,8 @@
case WRITE_10:
case READ_12:
case WRITE_12:
+ case READ_16:
+ case WRITE_16:
break;
default:
return 0;
@@ -4618,7 +4775,7 @@
//negoFlags = MPT_TARGET_NO_NEGO_SYNC;
}
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
/* Force to async and narrow if DV has not been executed
* for this ID
*/
@@ -5000,7 +5157,7 @@
return;
}
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/* mptscsih_do_raid - Format and Issue a RAID volume request message.
* @hd: Pointer to scsi host structure
@@ -5071,7 +5228,7 @@
return 0;
}
-#endif /* ~MPTSCSIH_DISABLE_DOMAIN_VALIDATION */
+#endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/**
@@ -5383,7 +5540,7 @@
if (ioc->spi_data.sdp1length > 0) {
pcfg1Data = (SCSIDevicePage1_t
*)pci_alloc_consistent(ioc->pcidev,
ioc->spi_data.sdp1length * 4,
&cfg1_dma_addr);
-
+
if (pcfg1Data != NULL) {
doConfig = 1;
header1.PageVersion =
ioc->spi_data.sdp1version;
@@ -5415,7 +5572,7 @@
flags = hd->ioc->spi_data.noQas;
if (hd->ioc->spi_data.nvram &&
(hd->ioc->spi_data.nvram[id] != MPT_HOST_NVRAM_INVALID)) {
data = hd->ioc->spi_data.nvram[id];
-
+
if (data & MPT_NVRAM_WIDE_DISABLE)
flags |=
MPT_TARGET_NO_NEGO_WIDE;
@@ -5424,7 +5581,7 @@
flags |=
MPT_TARGET_NO_NEGO_SYNC;
}
}
-
+
/* Force to async, narrow */
mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0,
&requested,
&configuration, flags);
@@ -5467,7 +5624,7 @@
return 0;
}
-#ifndef MPTSCSIH_DISABLE_DOMAIN_VALIDATION
+#ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/**
* mptscsih_domainValidation - Top level handler for domain validation.
@@ -5520,7 +5677,7 @@
/* DV only to SCSI adapters */
if ((int)ioc->chip_type <= (int)FC929)
continue;
-
+
/* Make sure everything looks ok */
if (ioc->sh == NULL)
continue;
@@ -6914,7 +7071,7 @@
break;
}
}
-#endif /* ~MPTSCSIH_DISABLE_DOMAIN_VALIDATION */
+#endif /* ~MPTSCSIH_ENABLE_DOMAIN_VALIDATION */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
/* Commandline Parsing routines and defines.
@@ -7009,3 +7166,6 @@
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
+
+module_init(mptscsih_init);
+module_exit(mptscsih_exit);
diff -uarN linux-2.6.2-rc1-reference/drivers/message/fusion/mptscsih.h
linux-2.6.2-rc1/drivers/message/fusion/mptscsih.h
--- linux-2.6.2-rc1-reference/drivers/message/fusion/mptscsih.h 2004-01-24
00:17:20.569855208 -0700
+++ linux-2.6.2-rc1/drivers/message/fusion/mptscsih.h 2004-01-13
15:46:09.000000000 -0700
@@ -98,13 +98,14 @@
#define MPT_SCSI_SG_DEPTH 40
#endif
-/* To disable domain validation, uncomment the
+/* To disable domain validation, comment the
* following line. No effect for FC devices.
* For SCSI devices, driver will negotiate to
* NVRAM settings (if available) or to maximum adapter
* capabilities.
*/
-/* #define MPTSCSIH_DISABLE_DOMAIN_VALIDATION */
+
+#define MPTSCSIH_ENABLE_DOMAIN_VALIDATION
/* SCSI driver setup structure. Settings can be overridden
@@ -138,15 +139,6 @@
*/
/*
- * Conditionalizing with "#ifdef MODULE/#endif" around:
- * static Scsi_Host_Template driver_template = XX;
- * #include <../../scsi/scsi_module.c>
- * lines was REMOVED @ lk-2.4.0-test9
- * Issue discovered 20001213 by: sshirron
- */
-#define MPT_SCSIHOST_NEED_ENTRY_EXIT_HOOKUPS 1
-
-/*
* tq_scheduler disappeared @ lk-2.4.0-test12
* (right when <linux/sched.h> newly defined TQ_ACTIVE)
* tq_struct reworked in 2.5.41. Include workqueue.h.
@@ -160,8 +152,6 @@
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=*/
-#define x_scsi_detect mptscsih_detect
-#define x_scsi_release mptscsih_release
#define x_scsi_info mptscsih_info
#define x_scsi_queuecommand mptscsih_qcmd
#define x_scsi_abort mptscsih_abort
@@ -170,9 +160,6 @@
#define x_scsi_host_reset mptscsih_host_reset
#define x_scsi_bios_param mptscsih_bios_param
-#define x_scsi_taskmgmt_bh mptscsih_taskmgmt_bh
-#define x_scsi_old_abort mptscsih_old_abort
-#define x_scsi_old_reset mptscsih_old_reset
#define x_scsi_slave_alloc mptscsih_slave_alloc
#define x_scsi_slave_configure mptscsih_slave_configure
#define x_scsi_slave_destroy mptscsih_slave_destroy
@@ -182,8 +169,6 @@
/*
* MPT SCSI Host / Initiator decls...
*/
-extern int x_scsi_detect(Scsi_Host_Template *);
-extern int x_scsi_release(struct Scsi_Host *host);
extern const char *x_scsi_info(struct Scsi_Host *);
extern int x_scsi_queuecommand(Scsi_Cmnd *, void
(*done)(Scsi_Cmnd *));
extern int x_scsi_abort(Scsi_Cmnd *);
@@ -191,8 +176,7 @@
extern int x_scsi_dev_reset(Scsi_Cmnd *);
extern int x_scsi_host_reset(Scsi_Cmnd *);
extern int x_scsi_bios_param(struct scsi_device * sdev, struct
block_device *bdev,
- sector_t capacity, int *ip);
-extern void x_scsi_taskmgmt_bh(void *);
+ sector_t capacity, int geom[]);
extern int x_scsi_slave_alloc(Scsi_Device *);
extern int x_scsi_slave_configure(Scsi_Device *);
extern void x_scsi_slave_destroy(Scsi_Device *);
^ permalink raw reply
* Re: DMA timeout error and then kernel halted
From: Jan Mynarik @ 2004-01-26 16:37 UTC (permalink / raw)
To: linux-kernel; +Cc: andre
In-Reply-To: <1074533362.7913.14.camel@narsil>
I've resolved my problem, DMA must be turned on by "Use DMA by default
in kernel config", it siply doesn't like latter attempts by hdparm. I
tried to have DMA by default previously but only by ide2=dma kernel boot
parameter.
Now, I'm on 40MB/s and happy :-)
Jan "Pogo" Mynarik
On Mon, 2004-01-19 at 18:29, Jan Mynarik wrote:
> Hi,
>
> I have DMA problems with HPT366 on BP6 (newest BIOS version RU incl.
> 1.28 BIOS for HPT366) and Seagate's 80 GB disk (please see exact model
> numbers in attached dmesg).
>
> It's reproducible (with or without SMP, various kernel versions,
> overclocking or not, ACPI on and off) on 2.4.22 and 2.6.0 (test9, test11
> and vanilla) and 2.6.1-rc3. On 2.4 kernel it doesn't halt kernel.
>
> Problem description:
> When I try to set DMA by hdparm, after several seconds the HDD led gets
> on and remains on for another amount of seconds, then I got
>
> hde: dma_timer_expiry: dma status == 0x21
>
> and after a while
>
> hde: DMA timeout error
>
> then kernel is halted and I need to reset my PC.
>
>
> After some investigations I realized that the problem could be in the
> combination of HPT366 and Seagate disk. In the source code of
> HighPoint's driver
> (http://www.highpoint-tech.com/hpt3xx-opensource-v131.tgz - link is in
> kernel's drivers/ide/pci/hpt366.c) I can see some function
> (seagate_hdd_fix) used to fix
> some seagate disk initialization problem which is not present in
> hpt366.c in kernel. I think that's the problem because I
> haven't found any reported problem and I think that BP6 is still widely
> used.
>
> Is it known? Any patches, workarounds, or other suggestions?
>
> Regards,
>
> Jan "Pogo" Mynarik
--
Jan Mynarik <mynarikj@phoenix.inf.upol.cz>
^ permalink raw reply
* Re: REISER4 corruptions errors
From: Carl-Daniel Hailfinger @ 2004-01-26 16:36 UTC (permalink / raw)
To: Alex Zarochentsev; +Cc: Paolo Correnti, Nikita Danilov, REISER LIST
In-Reply-To: <20040126152607.GB21337@backtop.namesys.com>
Alex Zarochentsev wrote:
> this patch should help (! not tested):
>
> ===== tree.c 1.562 vs edited =====
> --- 1.562/tree.c Wed Jan 14 11:46:20 2004
> +++ edited/tree.c Mon Jan 26 18:24:39 2004
> @@ -1468,7 +1468,7 @@
> if ((result != 0) && (result != -E_NO_NEIGHBOR))
> break;
> /* Check can we delete the node as a whole. */
> - if (iterations && znode_get_level(node) == LEAF_LEVEL &&
> + if (0 && iterations && znode_get_level(node) == LEAF_LEVEL &&
> UNDER_RW(dk, current_tree, read,
> keyle(from_key, znode_get_ld_key(node)))) {
> result = delete_node(next_node_lock.node,
Was it your intention to disable the above code path?
Carl-Daniel
--
http://www.hailfinger.org/
^ permalink raw reply
* Stange behavior
From: Jarmo @ 2004-01-26 16:35 UTC (permalink / raw)
To: linux-hams
Hi
We have found very strange behavior of ax25/netrom with
2.4.x and 2.6.x kernels.
First setup contains BBS F6FBB 7.04j,cluster DXSPIDER 1.51 and
node with 4 radio ports and 1 ethernet port.
libax25-0.0.11
ax25-apps-0.0.6
ax25-tools-0.0.8
node-0.3.2
Ax ports uses 6pack.
Now when using kernel 2.4.x if coming to node using telnet,connection
from some reason fails forinstance to bbs,node after timeout try disconnect
telnet connection.Everything seems to go ok,but actually connection never
breaks.
Now other bbs waits,say 5 minutes and tries to connect again,same happens..
and so and so...Soon we have huge number connections in node sending
DM- packets and eating up system resources until all hangs...kernel panic..
This does not happen using ax25 protocol...
When using 2.6.x series kernel situation is totally opposite!
Kernels tested here 2.4.22 23 24 25-pre6
2.6.0 (fbb didn't work)
2.6.1 (fbb didn't work)
2.6.2-rc1 (fbb didn't work)
In 2.6 series FBB does not work...Every thing goes up without any
complain,no errors.It really starts,but connection into fbb just hangs.
When connecting into fbb we get connected to OH1RBF and that's all...
No command can be altered...We stay connected there for ever,unless
somebody kills the pid,or too many connections...Kernel Panic!
Read somewhere that we should use 2.2 series kernels...Ok...tested
latest 2.2.25 but can't get it installed...;-) too new distro propably?
Mandrake 9.2...Too much compile etc..errors.Compiler is 3.3.1...
Hardware tested amdk6-2 400 390M ram 15G hd...
466 celeron 256 ram 13G hd...
amd duron 800 390 15G...Not long,MB kaboom;-)
So seems that at the moment we are in deep swamp...
OH...Forgot almost...We tested also 2.4.23 and 24 kernels with 9a4gl
patch...Got all up,but when connected to node from home
using plain ax25 got connected,but that was all...no commands
worked ..Then after timeout node kicked
out,BUT left connection pid living and eating resources.
Anyone else got similar?
Now best usable is 2.4.25-pre6 intelnet disabled.Still every now and then
kernel panic...
Could it be from 6pack.We are getting 6pack:Bad checksum xx,where xx
is some hex number.
Are we in troubles...?;-)
As said,no particular error messages or similar in any logs found..
"kernel picnic";-) says allways that lost interrupt handler Aieeee!
As known that message can't be read from any log,especially when
we don't have any debugging set on...And my knowledge is still
limited after 6 years using LIN.
At my home MDK9.2 with 2.6.2-rc1 kernel works OK...
1 radioport out using 6pack...Only few "bad checksum" messages..
Again...Someone familiar with this...Any succestions so far...Yes sure
much questions...Shoot...
73 de Jarmo
oh1mrr
^ permalink raw reply
* Re: New NUMA scheduler and hotplug CPU
From: Martin J. Bligh @ 2004-01-26 16:34 UTC (permalink / raw)
To: Nick Piggin, Rusty Russell; +Cc: linux-kernel
In-Reply-To: <4014CF39.50209@cyberone.com.au>
>> Looking at your new scheduler in -mm, it uses cpu_online_map
>> alot in arch_init_sched_domains. This means with hotplug CPU that it
>> would need to be modified: certainly possible to do, but messy.
>>
>> The other option is to use cpu_possible_map to create the full
>> topology up front, and then it need never change. AFAICT, no other
>> changes are neccessary: you already check against moving tasks to
>> offline cpus.
>>
>> Anyway, I was just porting the hotplug CPU patches over to -mm, and
>> came across this, so I thought I'd ask.
>>
>
> Hi Rusty,
> Yes I'd like to use the cpu_possible_map to create the full
> topology straight up. Martin?
Well isn't it a bad idea to have cpus in the data that are offline?
It'll throw off all your balancing calculations, won't it? You seemed
to be careful to do things like divide the total load on the node by
the number of CPUs on the node, and that'll get totally borked if you
have fake CPUs in there.
To me, it'd make more sense to add the CPUs to the scheduler structures
as they get brought online. I can also imagine machines where you have
a massive (infinite?) variety of possible CPUs that could appear -
like an NUMA box where you could just plug arbitrary numbers of new
nodes in as you wanted.
Moreover, as the CPUs aren't fixed numbers in advance, how are you going
to know which node to put them in, etc? Setting up every possible thing
in advance seems like an infeasible way to do hotplug to me.
M.
^ permalink raw reply
* Re: Question about procfs function
From: Pablo Neira @ 2004-01-26 16:34 UTC (permalink / raw)
To: netfilter-devel
In-Reply-To: <Pine.LNX.4.44.0401251921480.2228-100000@truta.dcc.ufmg.br>
Hi leonardo,
Leonardo Henrique Machado wrote:
>Where can I find a complete tutorial about procfs?
>
>
This question is not netfilter related at all, better the linux kernel
maillist, anyway have a look at:
Linux Device Drivers, 2nd edition
http://www.xml.com/ldd/chapter/book/
and
Linux Kernel Modules Programming (mostly for kernel 2.2, so some things
won't work for your 2.4 and 2.6 kernel but it's a reference anyway).
http://www.faqs.org/docs/kernel/
>procfs_getinfo is a very confusing function! I would like
>to save a linked list in a buffer and after that I'll print
>it in the procfs buffer file.
>
>
I think that there's some examples in those docs.
Pablo
^ permalink raw reply
* preparing toshiba_acpi driver release
From: John Belmonte @ 2004-01-26 16:32 UTC (permalink / raw)
To: Brown, Len; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello Len,
I'm preparing a new release of the toshiba_acpi driver. Below is the
tentative changelog. I haven't been following the check-in policy of
the kernel or acpi subsystem lately, so I'm wondering if I can give this
to you as a single patch or do you need it in several parts.
~ * Fix remote chance of invalid buffer access in write_video.
~ * Support alternate HCI method path (recent "Phoenix BIOS" Toshiba's).
~ * Report more proc-write errors.
~ * On proc-reads, report errors via printk instead of proc output.
~ * Add level to all printk's.
~ * Add missing __init and __exit function attributes.
Regards,
- -John Belmonte
- --
http:// if ile.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFAFUE35Nfg6kxAQQoRAjQaAKCsdt8QoBH6w2TbtyPSzfpEy1ywMACguflq
cc6Z79zaEhCmj4C9USs5TBE=
=oq55
-----END PGP SIGNATURE-----
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
^ permalink raw reply
* [patch] pg-r4k.c bugs for R4600 rev.2.0
From: Maciej W. Rozycki @ 2004-01-26 16:31 UTC (permalink / raw)
To: Dominik 'Rathann' Mierzejewski, Ralf Baechle; +Cc: linux-mips
In-Reply-To: <20040123161410.GC20047@icm.edu.pl>
On Fri, 23 Jan 2004, Dominik 'Rathann' Mierzejewski wrote:
> > > 6242 2003/12/11 01:29:17 linux_2_4 ralf Fix a bunch of long standing bugs
> > > and performance clear_page issues: - Fi .....
> > [...]
> >
> > Found it! After applying the above patch, the kernel no longer goes
> > past the "Freeing unused kernel memory" stage. So for now I'm sticking
> > with the 20031205 kernel.
>
> Could someone please look into this?
There are a few bugs in arch/mips*/mm/pg-r4k.c and one of them affects
your system:
> ARCH: SGI-IP22
> PROMLIB: ARC firmware Version 1 Revision 10
> CPU revision is: 00002020
> FPU revision is: 00002020
> Primary instruction cache 16kB, physically tagged, 2-way, linesize 32 bytes.
> Primary data cache 16kB 2-way, linesize 32 bytes.
> Linux version 2.4.22 (dominik@indy0) (gcc version 3.3.1 20030626 (Debian
> prerelease)) #1 Thu Sep 25 15:11:35 CEST 2003
This is an R4600 rev.2.0 which has a D-cache erratum that is worked around
in these files. Unfortunately, the work around corrupts the $at register
that is assumed to be initialized and used afterwards elsewhere. Since
the functions affected are called with the assumption of the usual ABI
convention, there's plenty of temporary registers to use and I propose to
reserve $at for use as a local scratch register. Here is a patch. It
should fix the problems for you.
I have two other fixes for the file -- you might try them as well, as
I've only tested all three of them together, because of a different
configuration of the system I've used. They fix a problem with R4k
systems with a secondary cache and a coprocessor 0 hazard with R4000/R4400
systems with primary caches only.
Ralf, OK to apply this one?
Maciej
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
patch-mips-2.4.24-pre2-20040116-mips-pg-r4k-5
diff -up --recursive --new-file linux-mips-2.4.24-pre2-20040116.macro/arch/mips/mm/pg-r4k.c linux-mips-2.4.24-pre2-20040116/arch/mips/mm/pg-r4k.c
--- linux-mips-2.4.24-pre2-20040116.macro/arch/mips/mm/pg-r4k.c 2004-01-03 03:56:38.000000000 +0000
+++ linux-mips-2.4.24-pre2-20040116/arch/mips/mm/pg-r4k.c 2004-01-26 12:09:56.000000000 +0000
@@ -96,7 +96,7 @@ static inline void __build_load_reg(int
else
mi.i_format.opcode = lw_op;
mi.i_format.rs = 5; /* $a1 */
- mi.i_format.rt = reg; /* $zero */
+ mi.i_format.rt = reg; /* $reg */
mi.i_format.simmediate = load_offset;
load_offset += (cpu_has_64bit_registers ? 8 : 4);
@@ -197,7 +197,7 @@ static inline void __build_store_reg(int
reg_size = 8;
#endif
mi.i_format.rs = 4; /* $a0 */
- mi.i_format.rt = reg; /* $zero */
+ mi.i_format.rt = reg; /* $reg */
mi.i_format.simmediate = store_offset;
store_offset += reg_size;
@@ -218,7 +218,7 @@ static inline void build_store_reg(int r
__build_store_reg(reg);
}
-static inline void build_addiu_at_a0(unsigned long offset)
+static inline void build_addiu_a2_a0(unsigned long offset)
{
union mips_instruction mi;
@@ -226,7 +226,7 @@ static inline void build_addiu_at_a0(uns
mi.i_format.opcode = cpu_has_64bit_addresses ? daddiu_op : addiu_op;
mi.i_format.rs = 4; /* $a0 */
- mi.i_format.rt = 1; /* $at */
+ mi.i_format.rt = 6; /* $a2 */
mi.i_format.simmediate = offset;
*epc++ = mi.word;
@@ -269,7 +269,7 @@ static inline void build_bne(unsigned in
union mips_instruction mi;
mi.i_format.opcode = bne_op;
- mi.i_format.rs = 1; /* $at */
+ mi.i_format.rs = 6; /* $a2 */
mi.i_format.rt = 4; /* $a0 */
mi.i_format.simmediate = dest - epc - 1;
@@ -313,7 +313,7 @@ void __init build_clear_page(void)
}
}
- build_addiu_at_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0));
+ build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0));
if (R4600_V2_HIT_CACHEOP_WAR && ((read_c0_prid() & 0xfff0) == 0x2020)) {
*epc++ = 0x40026000; /* mfc0 $v0, $12 */
@@ -352,7 +352,7 @@ dest = epc;
build_store_reg(0);
if (cpu_has_prefetch && pref_offset_clear) {
- build_addiu_at_a0(pref_offset_clear);
+ build_addiu_a2_a0(pref_offset_clear);
dest = epc;
__build_store_reg(0);
__build_store_reg(0);
@@ -382,7 +382,7 @@ void __init build_copy_page(void)
{
epc = (unsigned int *) ©_page_array;
- build_addiu_at_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0));
+ build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0));
if (R4600_V2_HIT_CACHEOP_WAR && ((read_c0_prid() & 0xfff0) == 0x2020)) {
*epc++ = 0x40026000; /* mfc0 $v0, $12 */
@@ -438,7 +438,7 @@ dest = epc;
build_store_reg(11);
if (cpu_has_prefetch && pref_offset_copy) {
- build_addiu_at_a0(pref_offset_copy);
+ build_addiu_a2_a0(pref_offset_copy);
dest = epc;
__build_load_reg( 8);
__build_load_reg( 9);
diff -up --recursive --new-file linux-mips-2.4.24-pre2-20040116.macro/arch/mips64/mm/pg-r4k.c linux-mips-2.4.24-pre2-20040116/arch/mips64/mm/pg-r4k.c
--- linux-mips-2.4.24-pre2-20040116.macro/arch/mips64/mm/pg-r4k.c 2004-01-03 03:56:46.000000000 +0000
+++ linux-mips-2.4.24-pre2-20040116/arch/mips64/mm/pg-r4k.c 2004-01-26 12:09:56.000000000 +0000
@@ -96,7 +96,7 @@ static inline void __build_load_reg(int
else
mi.i_format.opcode = lw_op;
mi.i_format.rs = 5; /* $a1 */
- mi.i_format.rt = reg; /* $zero */
+ mi.i_format.rt = reg; /* $reg */
mi.i_format.simmediate = load_offset;
load_offset += (cpu_has_64bit_registers ? 8 : 4);
@@ -197,7 +197,7 @@ static inline void __build_store_reg(int
reg_size = 8;
#endif
mi.i_format.rs = 4; /* $a0 */
- mi.i_format.rt = reg; /* $zero */
+ mi.i_format.rt = reg; /* $reg */
mi.i_format.simmediate = store_offset;
store_offset += reg_size;
@@ -218,7 +218,7 @@ static inline void build_store_reg(int r
__build_store_reg(reg);
}
-static inline void build_addiu_at_a0(unsigned long offset)
+static inline void build_addiu_a2_a0(unsigned long offset)
{
union mips_instruction mi;
@@ -226,7 +226,7 @@ static inline void build_addiu_at_a0(uns
mi.i_format.opcode = cpu_has_64bit_addresses ? daddiu_op : addiu_op;
mi.i_format.rs = 4; /* $a0 */
- mi.i_format.rt = 1; /* $at */
+ mi.i_format.rt = 6; /* $a2 */
mi.i_format.simmediate = offset;
*epc++ = mi.word;
@@ -269,7 +269,7 @@ static inline void build_bne(unsigned in
union mips_instruction mi;
mi.i_format.opcode = bne_op;
- mi.i_format.rs = 1; /* $at */
+ mi.i_format.rs = 6; /* $a2 */
mi.i_format.rt = 4; /* $a0 */
mi.i_format.simmediate = dest - epc - 1;
@@ -313,7 +313,7 @@ void __init build_clear_page(void)
}
}
- build_addiu_at_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0));
+ build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_clear : 0));
if (R4600_V2_HIT_CACHEOP_WAR && ((read_c0_prid() & 0xfff0) == 0x2020)) {
*epc++ = 0x40026000; /* mfc0 $v0, $12 */
@@ -352,7 +352,7 @@ dest = epc;
build_store_reg(0);
if (cpu_has_prefetch && pref_offset_clear) {
- build_addiu_at_a0(pref_offset_clear);
+ build_addiu_a2_a0(pref_offset_clear);
dest = epc;
__build_store_reg(0);
__build_store_reg(0);
@@ -382,7 +382,7 @@ void __init build_copy_page(void)
{
epc = (unsigned int *) ©_page_array;
- build_addiu_at_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0));
+ build_addiu_a2_a0(PAGE_SIZE - (cpu_has_prefetch ? pref_offset_copy : 0));
if (R4600_V2_HIT_CACHEOP_WAR && ((read_c0_prid() & 0xfff0) == 0x2020)) {
*epc++ = 0x40026000; /* mfc0 $v0, $12 */
@@ -438,7 +438,7 @@ dest = epc;
build_store_reg(11);
if (cpu_has_prefetch && pref_offset_copy) {
- build_addiu_at_a0(pref_offset_copy);
+ build_addiu_a2_a0(pref_offset_copy);
dest = epc;
__build_load_reg( 8);
__build_load_reg( 9);
^ permalink raw reply
* Re: ethtool -d MCAs rx2600
From: Jack Steiner @ 2004-01-26 16:30 UTC (permalink / raw)
To: linux-ia64
In-Reply-To: <20040123231254.GC31911@cup.hp.com>
On Fri, Jan 23, 2004 at 03:56:50PM -0800, Grant Grundler wrote:
> On Fri, Jan 23, 2004 at 03:12:54PM -0800, Grant Grundler wrote:
> > In case someone wants to dig more now, I've dropped the "errdump mca"
> > output on
> > ftp://gsyprf10.external.hp.com/kernels/rx2600/mca_ethtool
> >
> > (Matching vmlinuz, System.map, .config is also there 2.6.1-rc1.tgz)
>
> Alex Williams tells me it's a PIO read timeout.
> (confirms my guess given what man page said)
>
> Offending address is likely 0x0000000090807000.
> Matches nicely with what /proc/iomem thinks:
> ...
> 90000000-97ffffff : PCI Bus 0000:20
> 90800000-9080ffff : tg3
> ...
>
> Now just need to hunt down the code that pokes at +0x7000.
>
> thanks,
> grant
We see a similar problem with "ethtool -d" on the SGI SN systems. We havent
isolated the cause, but it looks similar - PIO read timeout.
FWIW, the failure occurs in the vicinity of tg3_get_regs+0xb60 called from
tg3_ethtool_ioctl+0xbb0. (This is on 2.4.21+).
Looks like it occurs here (but I dont put a lot of faith in this):
GET_REG32_LOOP(BUFMGR_MODE, 0x58);
GET_REG32_LOOP(RDMAC_MODE, 0x08);
>>>> GET_REG32_LOOP(WDMAC_MODE, 0x08);
GET_REG32_LOOP(RX_CPU_BASE, 0x280);
GET_REG32_LOOP(TX_CPU_BASE, 0x280);
--
Thanks
Jack Steiner (steiner@sgi.com) 651-683-5302
Principal Engineer SGI - Silicon Graphics, Inc.
^ permalink raw reply
* RE: iptables routing help
From: bmcdowell @ 2004-01-26 16:29 UTC (permalink / raw)
To: john.sullivan, w_knop; +Cc: netfilter
I was about to suggest the exact same thing.
Bob
-----Original Message-----
From: netfilter-admin@lists.netfilter.org
[mailto:netfilter-admin@lists.netfilter.org]On Behalf Of John A.
Sullivan III
Sent: Monday, January 26, 2004 6:06 AM
To: William Knop
Cc: netfilter@lists.netfilter.org
Subject: Re: iptables routing help
On Sun, 2004-01-25 at 13:53, William Knop wrote:
> Okay, the problem is that we don't want to do nat (as I said in my
> original plee for help). We need external ips on all of the machines.
> Additionally, The ISP's DHCP server specifies it's own gateway, so I
> can't do normal routing, without spoofing the gateway's address and
> doing all sorts of ugly stuff (please correct me if I'm wrong).
>
>
> I was under the impression one could have iptables drop a packet from
> the prerouting or brouting table and it would go through the machine's
> routing table, without being specified on all the lan machines as the
> gateway.
>
>
> The physical layout we have are a bunch of boxes connected to a
> switch, and the dsl modem connected to the switch's uplink port. I
> could have the modem jack into a firewall box, or something, however
> the linux ethernet bridge seems to do very odd things to arps, and
> also iptables. Would bridging be necessary?
>
>
>
<snip>
This may not be as bad as it sounds and it my be a netfilter issue.
Looking at the topology, I would assume that there are several devices
on the same public subnet connect through the switch to the DSL modem in
which case they should talk to each other directly on that subnet
without sending the data across the DSL modem. But am I correct to
understand that even though these devices share the same switch and the
same DSL modem that they are allocated public addresses out of different
IP subnets?
If that is the case, the best solution is to install a second NIC into
each device and create a separate private network as already suggested.
Barring that, you can create a second, logical network on the same
media. Use iproute2 to bind a second address to each of the public
interfaces. These will all come from the same subnet and should be able
to communicate with each other. Just be sure to use the secondary
address when sending data between those devices.
ip address add dev0 192.168.1.4/24
ip address add dev0 192.168.1.5/24
ip address add dev0 192.168.1.6/24 . . . etc.
This is a bit dangerous as these devices are still publicly exposed and
the ISP may allow traffic on RFC1918 addresses on their internal
networks so you may want to tightly secure the devices even for traffic
from these "private" addresses using iptables.
This is the sort of set up that we use on our internal routers to
participate in the worldwide VPN project (http://www.worldwidevpn.com).
Good luck - John
--
John A. Sullivan III
Chief Technology Officer
Nexus Management
+1 207-985-7880
john.sullivan@nexusmgmt.com
---
If you are interested in helping to develop a GPL enterprise class
VPN/Firewall/Security device management console, please visit
http://iscs.sourceforge.net
^ permalink raw reply
* Re: [Bridge] received packet with own address as source address
From: Christopher S. Aker @ 2004-01-26 16:28 UTC (permalink / raw)
To: bridge
In-Reply-To: <Pine.LNX.4.33.0401191551410.3962-100000@ns.varna.net>
> just my $0.02:
>
> ethertap interfaces has fake mac addresses, generated somehow by the
> tun/tap driver, and they are same on both sides in your case. Don't know
> why.
>
> -- Nikolay Datchev
Not sure what gave me the idea to use the same MAC on the TAP and inside the UML.
Since the earlier versions of bridge didn't complain about it, perhaps I figured I
should fight it :) Anyways, using a different MAC for the TAP and the UML seems
to have solved all of the issues.
Thanks for the help!
-Chris
^ permalink raw reply
* Re: 2.6.1: Alsa 0.9.7?
From: Daniel Andersen @ 2004-01-26 16:26 UTC (permalink / raw)
To: Harald Dunkel; +Cc: linux-kernel
In-Reply-To: <401538AB.8090106@t-online.de>
> Hi folks,
>
> CONFIG_SND_VERSION says that Alsa in 2.6.1 is version
> 0.9.7. Is this correct?
>
> I'm just curious.
>
>
> Regards
>
> Harri
That is correct.
Please look at linux/include/sound/version.h in the kernel-source.
Daniel Andersen
^ permalink raw reply
* RE: [PATCH] 2.6.1 enable PIOW/DMAR relaxed ordering on ZX1
From: Luck, Tony @ 2004-01-26 16:26 UTC (permalink / raw)
To: linux-ia64
In-Reply-To: <20040123024302.GD24857@cup.hp.com>
> I'm not sure Tony's tree is ready for prime-time yet. Could you
> please diff against my tree instead (linux-ia64-2.5)? I'd have merged
> the patch by hand, but the context in the patch you posted doesn't
> look like anything that appears in the current sba_iommu.c.
In the U.K. (where I'm from originally) people learning to
drive must display a large "L" (for "Learning driver") on
their car to warn other motorists that they may make erratic
moves.
In the bitkeeper world, I'm still learning ... so keep a safe
distance from my tree until I pass my proficiency exam.
-Tony
^ permalink raw reply
* [PATCH] ALIM7101 watchdog
From: Steve Hill @ 2004-01-26 16:23 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 371 bytes --]
Attached is a patch against 2.4.24 to fix the ALIM7101 watchdog driver
which wasn't properly taking notice of NOWAYOUT not being set.
- Steve Hill
Senior Software Developer Email: steve@navaho.co.uk
Navaho Technologies Ltd. Tel: +44-870-7034015
... Alcohol and calculus don't mix - Don't drink and derive! ...
[-- Attachment #2: Type: TEXT/PLAIN, Size: 546 bytes --]
diff -urN linux-2.4.24.vanilla/drivers/char/alim7101_wdt.c linux-2.4.24/drivers/char/alim7101_wdt.c
--- linux-2.4.24.vanilla/drivers/char/alim7101_wdt.c 2002-11-28 23:53:12.000000000 +0000
+++ linux-2.4.24/drivers/char/alim7101_wdt.c 2004-01-26 11:53:06.000000000 +0000
@@ -209,7 +209,7 @@
static int fop_close(struct inode * inode, struct file * file)
{
- if(wdt_expect_close)
+ if ((wdt_expect_close) || (! nowayout))
wdt_turnoff();
else {
printk(OUR_NAME ": device file closed unexpectedly. Will not stop the WDT!\n");
^ permalink raw reply
* Re: PATCH: (as177) Add class_device_unregister_wait() and platform_device_unregister_wait() to the driver model core
From: Roman Zippel @ 2004-01-26 16:22 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alan Stern, Greg KH, Kernel development list, Patrick Mochel
In-Reply-To: <Pine.LNX.4.58.0401251054340.18932@home.osdl.org>
Hi,
On Sun, 25 Jan 2004, Linus Torvalds wrote:
> - doing proper refcounting of modules is _really_ really hard. The reason
> is that proper refcounting is a "local" issue: you reference count a
> single data structure. It's basically impossible to make a "global"
> reference count without jumping through hoops.
IOW module reference counts are evil, no matter what you do it will always
add more overhead. I fully agree with Al, once we have proper per object
protection it's rather easy to build the module infrastructure on top of
it. I only want to add a bit what it means practically.
For example pci drivers currently do something like:
int init()
{
if (pci_register_driver(drv) < 0)
pci_unregister_driver(drv);
}
void exit()
{
pci_unregister_driver(drv);
}
All this is done without a module count, this means that
pci_unregister_driver() cannot return before the last reference is gone.
For network devices this is not that much of a problem, as they can be
rather easily deconfigured automatically, but that's not that easy for
mounted block devices, so one has to be damned careful when to call the
exit function.
To prevent module unloading we usually added a reference to the module, so
the generic module code knows, when it's safe to unload the module. OTOH
with the driver object we can easily tell without any additional overhead
whether the driver is busy, we only have to find a way to tell that the
generic module code.
Technically there are a number of ways to do this, but practically we have
to decide which module unload semantics we want to have and how easy it
should be to upgrade the drivers to this.
We are now in the situation, where we should decide whether we want to
continue the status quo and module unloading stays a PITA or we fix it
properly once and for all, but that requires changing every single driver.
For a large number of drivers (all which Al mentioned) the updates should
be rather staightforward, the rest would simply be not unloadable, unless
they fix their interfaces.
bye, Roman
^ permalink raw reply
* [Jonathan Kamens: 2.6.2-rc1-mm3: SCSI TARGET RESET on boot with no indication of why]
From: Jonathan Kamens @ 2004-01-26 16:21 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 141 bytes --]
I think I was supposed to send the attached message here. Please CC
me on any responses -- I'm not on the linux-scsi list.
Thanks,
jik
[-- Attachment #2: forwarded message --]
[-- Type: message/rfc822, Size: 3676 bytes --]
From: Jonathan Kamens <jik@kamens.brookline.ma.us>
To: linux-kernel@vger.kernel.org
Subject: 2.6.2-rc1-mm3: SCSI TARGET RESET on boot with no indication of why
Date: Mon, 26 Jan 2004 10:37:50 -0500
Message-ID: <16405.13390.835889.391521@jik.kamens.brookline.ma.us>
With my AIC7XXX controller and my rather old Microtek ScanMaker E6
SCSI scanner, 2.6.2-rc1-mm3 for some reason feels compelled to attempt
to reset the scanner immediately after identifying it during the boot
sequence. When I see "immediately" I mean that there doesn't seem to
be any delay between when it prints out the "Attached scsi generic"
message in the transcript below and when it prints out the subsequent
messages about the TARGET RESET message.
Despite these messages, the scanner appears to work when booting is
finished.
This does not occur with 2.4.22-ac4.
My question is -- do these messages indicate that something is wrong,
what could it be, and what should I do about it?
I tried to find a maintainer for the AIC7XXX code to contact about
this, but I didn't see one in MAINTAINERS.
Thanks,
jik
Boot log excerpt:
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.36
<Adaptec aic7890/91 Ultra2 SCSI adapter>
aic7890/91: Ultra2 Wide Channel A, SCSI Id=7, 32/253 SCBs
hub 1-0:1.0: new USB device on port 2, assigned address 3
Vendor: Model: Scanner 600 Rev: 1.91
Type: Scanner ANSI SCSI revision: 03
Attached scsi generic sg0 at scsi0, channel 0, id 4, lun 0, type 6
scsi0:0:4:0: Attempting to queue a TARGET RESET message
CDB: 0xa0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x4 0x8 0x0 0x0
scsi0:0:4:0: Command not found
aic7xxx_dev_reset returns 0x2002
scsi0:0:4:0: Attempting to queue a TARGET RESET message
CDB: 0xa0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x4 0x8 0x0 0x0
scsi0:0:4:0: Command not found
aic7xxx_dev_reset returns 0x2002
scsi0:0:4:0: Attempting to queue a TARGET RESET message
CDB: 0xa0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x4 0x8 0x0 0x0
scsi0:0:4:0: Command not found
aic7xxx_dev_reset returns 0x2002
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* Re: ip_conntrack_pptp
From: Harald Welte @ 2004-01-26 16:19 UTC (permalink / raw)
To: Jan Kaastrup; +Cc: Netfilter Mailinglist
In-Reply-To: <000d01c3e3ed$9875b0f0$2d64a8c0@pcjka>
[-- Attachment #1: Type: text/plain, Size: 980 bytes --]
On Mon, Jan 26, 2004 at 10:20:10AM +0100, Jan Kaastrup wrote:
> Hi Harald
>
> I have read the README file for POM - and I cannot find anything that
> could tell what is wrong:(
The README doesn't tell you anywhere to apply that patchc manually. It
tells you to run the './runme' script.
However, you are telling me, that you are manually applying the patch.
Witch will only give you about 90% of the required changes, not all of
them.
> >I do something like this for patching my kernel (2.4.21):
> >patch -p1 < ./path-o-mat.../ip_conntrack_pptp.patch, and everything
> >seems allright.
--
- Harald Welte <laforge@netfilter.org> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: Q: Filesystem choice..
From: Eric W. Biederman @ 2004-01-26 16:20 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
In-Reply-To: <1075109506.19924.45.camel@imladris.demon.co.uk>
David Woodhouse <dwmw2@infradead.org> writes:
> On Mon, 2004-01-26 at 02:23 -0700, Eric W. Biederman wrote:
>
> Fix up some other assumptions about the first byte in any given page
> also being the first byte in a node, and fix up the garbage-collection
> which will need to have enough workspace to decompress and recompress
> the largest block it may encounter, and it should work.
Cool. Then if it comes up I will look.
> > My real question here is how difficult is it to disable compression?
> > Or can compression be deliberately disabled on a per file basis?
>
> It's not too hard. To disable it completely you just need to change a
> few #defines in os-linux.h. The support for disabling it on a per-file
> basis isn't complete, but there are flags allocated in the inode
> structure to keep track of it.
Nice.
> > I have a truly perverse case I would like to ask your opinion about.
> > A filesystem composed of 2 8K erase blocks? That is one of the
> > weird special cases that flash chips often support. I could
> > only store my parameter file in there but it would be interesting.
>
> To be honest, at that size I'd just do it directly via /dev/mtd0. Put
> the file directly on the flash with a checksum. Alternate between the
> eraseblocks each time it changes, then erase the old copy.
Right that would work, and I might do that. If could put a fs in
there I get some extensibility benefits. As well as being able to
write a couple copies of my small file before I switch to the next
erase block. The extensibility is that other pieces of firmware
could have their own files of settings, decoupling things a little bit.
If I could get the degenerate case to work without needing gross hacks
jffs2 would have scaled down to a useful level.
Primarily I am interested in not reinventing if I can, and it looks
like that may be a possibility.
> > And a last question. jffs2 rounds all erase blocks up to a common size
> > doesn't it?
>
> Yes.
Thanks for information.
I'm not quite certain where I will go with this but it has made
where the trade offs pretty clear.
Eric
^ permalink raw reply
* Re: RE : DOC2k booting speed ...
From: David Woodhouse @ 2004-01-26 16:17 UTC (permalink / raw)
To: Philippe; +Cc: linux-mtd
In-Reply-To: <000001c3e427$947bbaa0$247dfea9@jennifer>
On Mon, 2004-01-26 at 17:15 +0100, Philippe wrote:
> Is there another way to
> 1) boot from the DOC,
> 2) build up the OS filesystem
> 3) umount the DOC ? -> protect filesystem in case of unexpected powerdown
Perhaps you could use a read-only file system on the DiskOnChip, and use
a ramfs for those areas of the file system which you need to be
writable?
If you mount a ramfs on /mnt/ramfs, you can make symlinks into it from
the 'real' file system.
--
dwmw2
^ permalink raw reply
* Re: Bluetooth USB oopses on unplug (2.6.1)
From: Pavel Machek @ 2004-01-26 16:16 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Linux Kernel Mailing List, Max Krasnyansky
In-Reply-To: <1075124726.25442.2.camel@pegasus>
Hi!
> > In 2.6.1, bluetooth-over-usb (hci_usb) works very well... As long as I
> > do not unplug it. When I do, it oopses. Is there newer version of
> > bluetooth that I should try?
>
> try to disable the SCO audio option for the driver itself. It should
> work then, because the driver no longer uses ISOC transfers.
Will try.
> However show us the oops (through ksymoops) and show us your USB
> hardware on your motherboard (lspci).
pavel@amd:~$ lspci
00:00.0 Host bridge: VIA Technologies, Inc.: Unknown device 3188 (rev 01)
00:01.0 PCI bridge: VIA Technologies, Inc.: Unknown device b188
00:0a.0 CardBus bridge: ENE Technology Inc CB1410 Cardbus Controller
00:0c.0 Network controller: Broadcom Corporation BCM94306 802.11g (rev 02)
00:10.0 USB Controller: VIA Technologies, Inc. USB (rev 80)
00:10.1 USB Controller: VIA Technologies, Inc. USB (rev 80)
00:10.2 USB Controller: VIA Technologies, Inc. USB (rev 80)
00:10.3 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 82)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8235 ISA Bridge
00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE (rev 06)
00:11.5 Multimedia audio controller: VIA Technologies, Inc. VT8233/A/8235 AC97 Audio Controller (rev 50)
00:11.6 Communication controller: VIA Technologies, Inc. Intel 537 [AC97 Modem] (rev 80)
00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 74)
00:13.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 NorthBridge
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R250 Lf [Radeon Mobility 9000 M9] (rev 02)
pavel@amd:~$
I'll have to hand-copy the oops, as machine dies after unplug. Here it
is:
Oops: 2
EIP is at uhci_remov_pending_qhs
Call trace:
uhci_irq
usb_hcd_irq
handle_irq_event
do_IRQ
common_interrupt_1
Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
^ permalink raw reply
* Re: [PATCH] Timer interrupt extras for sn2
From: Martin Hicks @ 2004-01-26 16:16 UTC (permalink / raw)
To: linux-ia64
In-Reply-To: <20040123161721.GJ15871@localhost>
[-- Attachment #1: Type: text/plain, Size: 443 bytes --]
On Fri, Jan 23, 2004 at 11:17:21AM -0500, Martin Hicks wrote:
>
> Hi David,
>
> Here is a patch that has been floating around for a while for adding a
> a new hook inside timer_interrupt() so that platforms can execute a bit
> of their own code during the timer interrupt.
Oops. I still had a debug printk in the last on in the sn2
timer_interrupt().
Here's a better one.
mh
--
Martin Hicks || mort@bork.org || PGP/GnuPG: 0x4C7F2BEE
[-- Attachment #2: sn2-timer-interrupt.diff --]
[-- Type: text/plain, Size: 7027 bytes --]
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1499 -> 1.1500
# arch/ia64/kernel/time.c 1.37 -> 1.38
# include/asm-ia64/machvec_sn2.h 1.9 -> 1.10
# include/asm-ia64/machvec.h 1.16 -> 1.17
# arch/ia64/sn/kernel/sn2/Makefile 1.13 -> 1.14
# (new) -> 1.1 arch/ia64/sn/kernel/sn2/timer_interrupt.c
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/01/23 mort@green.i.bork.org 1.1500
# Add a machvec hook in the timer_interrupt so platforms
# can execute their own code during the timer_interrupt.
# --------------------------------------------
#
diff -Nru a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
--- a/arch/ia64/kernel/time.c Fri Jan 23 10:20:12 2004
+++ b/arch/ia64/kernel/time.c Fri Jan 23 10:20:12 2004
@@ -21,6 +21,7 @@
#include <linux/profile.h>
#include <linux/timex.h>
+#include <asm/machvec.h>
#include <asm/delay.h>
#include <asm/hw_irq.h>
#include <asm/ptrace.h>
@@ -242,6 +243,8 @@
timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long new_itm;
+
+ platform_timer_interrupt(irq, dev_id, regs);
new_itm = local_cpu_data->itm_next;
diff -Nru a/arch/ia64/sn/kernel/sn2/Makefile b/arch/ia64/sn/kernel/sn2/Makefile
--- a/arch/ia64/sn/kernel/sn2/Makefile Fri Jan 23 10:20:12 2004
+++ b/arch/ia64/sn/kernel/sn2/Makefile Fri Jan 23 10:20:12 2004
@@ -10,4 +10,4 @@
#
obj-y += cache.o io.o ptc_deadlock.o sn2_smp.o sn_proc_fs.o \
- prominfo_proc.o timer.o
+ prominfo_proc.o timer.o timer_interrupt.o
diff -Nru a/arch/ia64/sn/kernel/sn2/timer_interrupt.c b/arch/ia64/sn/kernel/sn2/timer_interrupt.c
--- /dev/null Wed Dec 31 16:00:00 1969
+++ b/arch/ia64/sn/kernel/sn2/timer_interrupt.c Fri Jan 23 10:20:12 2004
@@ -0,0 +1,63 @@
+/*
+ *
+ *
+ * Copyright (c) 2003 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like. Any license provided herein, whether implied or
+ * otherwise, applies only to this software file. Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA 94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/NoticeExplan
+ */
+
+#include <linux/interrupt.h>
+#include <asm/sn/pda.h>
+#include <asm/sn/leds.h>
+
+extern void sn_lb_int_war_check(void);
+extern irqreturn_t timer_interrupt (int irq, void *dev_id, struct pt_regs *regs);
+
+#define SN_LB_INT_WAR_INTERVAL 100
+
+void
+sn_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+ /* LED blinking */
+ if (!pda->hb_count--) {
+ pda->hb_count = HZ/2;
+ set_led_bits(pda->hb_state ^= LED_CPU_HEARTBEAT, LED_CPU_HEARTBEAT);
+ }
+
+ if (enable_shub_wars_1_1()) {
+ /* Bugfix code for SHUB 1.1 */
+ if (pda->pio_shub_war_cam_addr)
+ *pda->pio_shub_war_cam_addr = 0x8000000000000010UL;
+ }
+ if (pda->sn_lb_int_war_ticks == 0)
+ sn_lb_int_war_check();
+ pda->sn_lb_int_war_ticks++;
+ if (pda->sn_lb_int_war_ticks >= SN_LB_INT_WAR_INTERVAL)
+ pda->sn_lb_int_war_ticks = 0;
+}
diff -Nru a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h
--- a/include/asm-ia64/machvec.h Fri Jan 23 10:20:12 2004
+++ b/include/asm-ia64/machvec.h Fri Jan 23 10:20:12 2004
@@ -28,6 +28,7 @@
typedef void ia64_mv_cmci_handler_t (int, void *, struct pt_regs *);
typedef void ia64_mv_log_print_t (void);
typedef void ia64_mv_send_ipi_t (int, int, int, int);
+typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *);
typedef void ia64_mv_global_tlb_purge_t (unsigned long, unsigned long, unsigned long);
typedef struct irq_desc *ia64_mv_irq_desc (unsigned int);
typedef u8 ia64_mv_irq_to_vector (u8);
@@ -90,6 +91,7 @@
# define platform_cmci_handler ia64_mv.cmci_handler
# define platform_log_print ia64_mv.log_print
# define platform_send_ipi ia64_mv.send_ipi
+# define platform_timer_interrupt ia64_mv.timer_interrupt
# define platform_global_tlb_purge ia64_mv.global_tlb_purge
# define platform_dma_init ia64_mv.dma_init
# define platform_dma_alloc_coherent ia64_mv.dma_alloc_coherent
@@ -131,6 +133,7 @@
ia64_mv_cmci_handler_t *cmci_handler;
ia64_mv_log_print_t *log_print;
ia64_mv_send_ipi_t *send_ipi;
+ ia64_mv_timer_interrupt_t *timer_interrupt;
ia64_mv_global_tlb_purge_t *global_tlb_purge;
ia64_mv_dma_init *dma_init;
ia64_mv_dma_alloc_coherent *dma_alloc_coherent;
@@ -168,6 +171,7 @@
platform_cmci_handler, \
platform_log_print, \
platform_send_ipi, \
+ platform_timer_interrupt, \
platform_global_tlb_purge, \
platform_dma_init, \
platform_dma_alloc_coherent, \
@@ -242,6 +246,9 @@
#endif
#ifndef platform_send_ipi
# define platform_send_ipi ia64_send_ipi /* default to architected version */
+#endif
+#ifndef platform_timer_interrupt
+# define platform_timer_interrupt ((ia64_mv_timer_interrupt_t *) machvec_noop)
#endif
#ifndef platform_global_tlb_purge
# define platform_global_tlb_purge ia64_global_tlb_purge /* default to architected version */
diff -Nru a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h
--- a/include/asm-ia64/machvec_sn2.h Fri Jan 23 10:20:12 2004
+++ b/include/asm-ia64/machvec_sn2.h Fri Jan 23 10:20:12 2004
@@ -37,6 +37,7 @@
extern ia64_mv_cpu_init_t sn_cpu_init;
extern ia64_mv_irq_init_t sn_irq_init;
extern ia64_mv_send_ipi_t sn2_send_IPI;
+extern ia64_mv_timer_interrupt_t sn_timer_interrupt;
extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge;
extern ia64_mv_irq_desc sn_irq_desc;
extern ia64_mv_irq_to_vector sn_irq_to_vector;
@@ -73,6 +74,7 @@
#define platform_cpu_init sn_cpu_init
#define platform_irq_init sn_irq_init
#define platform_send_ipi sn2_send_IPI
+#define platform_timer_interrupt sn_timer_interrupt
#define platform_global_tlb_purge sn2_global_tlb_purge
#define platform_pci_fixup sn_pci_fixup
#define platform_inb __sn_inb
^ permalink raw reply
* RE : DOC2k booting speed ...
From: Philippe @ 2004-01-26 16:15 UTC (permalink / raw)
To: linux-mtd
In-Reply-To: <1075129659.24024.86.camel@hades.cambridge.redhat.com>
Hi,
Thank you for your quick answer
> Grub's drivers are not particularly optimised. Why use an initrd rather
> loaded by the bootloader, rather than having the kernel itself access
> the device? That should be much faster, and wouldn't even need to whole
> device to be read at startup.
As I cannot use JFFS2 with the DOC, I use an initrd to put the whole system
in ramdrive without having the doc mounted.
I did it to avoid filesystem failures.
Is there another way to
1) boot from the DOC,
2) build up the OS filesystem
3) umount the DOC ? -> protect filesystem in case of unexpected powerdown
I saw many things about pivot_root but didn't found any simple example to
get started.
Thank you.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.