Skip to contentSkip to conversation

2.5.1-pre2 does not compile

DISCUSSION f5ibh 18 participants 33 messages Nov 27, 2001 – Dec 1, 2001

Subsystems (15)
lore
Share & tools
lore

f5ibh

author
#0 lore raw

Hi,

I've the following error :

gcc -D__KERNEL__ -I/usr/src/kernel-sources-2.5.1-pre2/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=k6 -DMODULE -DMODVERSIONS -include
/usr/src/kernel-sources-2.5.1-pre2/include/linux/modversions.h -c -o
aha1542.o aha1542.c
aha1542.c: In function `do_aha1542_intr_handle':
aha1542.c:423: `io_request_lock' undeclared (first use in this function) aha1542.c:423: (Each undeclared identifier is reported only once aha1542.c:423: for each function it appears in.)
aha1542.c: In function `aha1542_bus_reset':
aha1542.c:1479: io_request_lock' undeclared (first use in this function) aha1542.c: In function aha1542_host_reset':
aha1542.c:1543: `io_request_lock' undeclared (first use in this function) aha1542.c: At top level:
aha1542.c:114: warning: `setup_str' defined but not used
make[3]: *** [aha1542.o] Erreur 1
make[3]: Leaving directory `/usr/src/kernel-sources-2.5.1-pre2/drivers/scsi' make[2]: *** [_modsubdir_scsi] Erreur 2
make[2]: Leaving directory `/usr/src/kernel-sources-2.5.1-pre2/drivers' make[1]: *** [_mod_drivers] Erreur 2
make[1]: Leaving directory `/usr/src/kernel-sources-2.5.1-pre2'
make: *** [stamp-build] Erreur 2

-------
Regards
Jean-Luc

#1 lore raw

In article <[email protected]>,

Quoted 2 lines · f5ibh <[email protected]> wrote:

I've the following error :

Yes.

The next-generation block-layer support is starting to be merged into the 2.5.x tree, and that breaks old drivers that haven't been updated to the new locking.

In particular, there used to be _one_ lock for the whole IO system ("io_request_lock"), and these days it's a per-block-queue lock.

In many cases the fix is as simple as just replacing the "io_request_lock" with "host->host_lock", but sometimes this is complicated by the need to pass the right data structures down far enough..

Many drivers have been converted (ie IDE, symbios, aic7xxx etc), but many more have not (especially older SCSI drivers, in your case it's the classic aha1542).

It will probably take some time until most drivers have been converted. Tested patches are more than welcome,

Linus

#2 lore raw
Quoted 11 lines · Linus Torvalds

The next-generation block-layer support is starting to be merged into the 2.5.x tree, and that breaks old drivers that haven't been updated to the new locking.

In particular, there used to be _one_ lock for the whole IO system ("io_request_lock"), and these days it's a per-block-queue lock.

In many cases the fix is as simple as just replacing the "io_request_lock" with "host->host_lock", but sometimes this is complicated by the need to pass the right data structures down far enough..

Is there a description of the new block layer and its interface to block device drivers somewhere? That would be helpful, since Ben Herrenschmidt and I are going to have to convert several powermac-specific drivers.

Thanks,
Paul.

#3 lore raw
Quoted 5 lines · Paul Mackerras

Is there a description of the new block layer and its interface to block device drivers somewhere? That would be helpful, since Ben Herrenschmidt and I are going to have to convert several powermac-specific drivers.

Jens has something written up, which he sent to me as an introduction to the patch. I'll send that out unless he does a cleaned-up version, but I'd actually prefer for him to do the sending. Jens?

Linus

#4 lore raw

Re: 2.5.1-pre2 bio offset by one error in VIA IDE

Quoted 5 lines · Anton Altaparmakov

I just booted my Athlon VIA KT133 chipset box with 2.5.1-pre2 only to discover it dropped me into single user mode because /dev/hda2 could not be mounted. (Rebooting into 2.5.0+viro patch everything is ok, back into 2.5.1-pre2 is broken...)

Quoted 7 lines

Looking with hexedit /dev/hda2 when booted into 2.5.1-pre2 the first sector contains junk, the second sector contains the real data that I see as the first sector when booted into 2.5.0+viro fix.

That suggests to me there is an off by one error in the VIA IDE driver in the 2.5.10pre2 kernel causing the partition to start one sector earlier than it should.

It may be an issue with your particular partition table having /dev/hda1 being an odd number of 512-byte sectors long, but Jens' code only doing math on 1kB blocks. Just speculation of course. What does "fdisk -ul" tell you under the two kernels?

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

#5 lore raw

Re: 2.5.1-pre2 bio offset by one error in VIA IDE

Quoted 12 lines · Andreas Dilger
Quoted 2 lines · Anton Altaparmakov

I just booted my Athlon VIA KT133 chipset box with 2.5.1-pre2 only to discover it dropped me into single user mode because /dev/hda2 could

not be

Quoted 4 lines

mounted. (Rebooting into 2.5.0+viro patch everything is ok, back into 2.5.1-pre2 is broken...)

Looking with hexedit /dev/hda2 when booted into 2.5.1-pre2 the first

sector

Quoted 3 lines

contains junk, the second sector contains the real data that I see as the first sector when booted into 2.5.0+viro fix.

Quoted 8 lines
Quoted 3 lines

That suggests to me there is an off by one error in the VIA IDE driver in the 2.5.10pre2 kernel causing the partition to start one sector earlier than it should.

It may be an issue with your particular partition table having /dev/hda1 being an odd number of 512-byte sectors long, but Jens' code only doing math on 1kB blocks. Just speculation of course. What does "fdisk -ul" tell you under the two kernels?

Both exactly the same:

Disk /dev/hda: 255 heads, 63 sectors, 5005 cylinders Units = sectors of 1 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *        63  31471334  15735636   83  Linux
/dev/hda2      31471335  35680364   2104515   83  Linux
/dev/hda3      35680365  39889394   2104515   82  Linux swap
/dev/hda4      39889395  80405324  20257965    f  Win95 Ext'd (LBA)
/dev/hda5      39889458  71360729  15735636   83  Linux
/dev/hda6      71360793  75264524   1951866    7  HPFS/NTFS

So everything always starts on same sector. And yes, hda2 starts on an odd sector.

However, that is not the explanation as the ntfs partition hda6 also starts with an odd sector but that works fine (using NTFS TNG to mount it and also looking at start of partition with hexedit).

Best regards,

Anton

Signature · 5 lines
  "I've not lost my mind. It's backed up on tape somewhere." - Unknown
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/
#6 lore raw

Block I/O Enchancements, 2.5.1-pre2

In reply to Paul Mackerras
Quoted 8 lines · Linus Torvalds
Quoted 5 lines · Paul Mackerras

Is there a description of the new block layer and its interface to block device drivers somewhere? That would be helpful, since Ben Herrenschmidt and I are going to have to convert several powermac-specific drivers.

Quoted 6 lines

Jens has something written up, which he sent to me as an introduction to the patch. I'll send that out unless he does a cleaned-up version, but I'd actually prefer for him to do the sending. Jens?

Linus

Linus/Jens,

I've just completed my review of submit_bio and the changes to generic_make_request and I have some questions for whomever can answer.

1. The changes made to submit_bh indicate I can now send long chains of variable block size requests to the I/O layer similiar to the capability of Windows 2000 and NetWare I/O subsystems.

2. The elevator layer is merging these requests, and making a single sweep request for contiguous sector runs.

3. In theory, I should be able to support page cache capability for NWFS and possibly NTFS in Linux the way these wierd non-Unix OS's work.

4. This interface may **NOT** support non-block aligned requests across all the drivers. I also need to be able to submit a request chain 512-2048-512-1024-4096 where the first IO requested may by on a non-block aligned boundry. i.e. Device is configured for 1024 byte blocks, I start the request as 512 @ LBA 1 -> 1024 @ LBA 2, etc. The code looks like it will work.

I would love to test this wonderful code and will hopefully this evening, however, all the SCSI drivers appear to be broken, as well as the 3Ware. :-)

Please advise,

Jeff

Quoted 5 lines

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#7 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

In reply to Paul Mackerras
Quoted 3 lines · Jeff V. Merkey

1. The changes made to submit_bh indicate I can now send long chains of variable block size requests to the I/O layer similiar to the capability of Windows 2000 and NetWare I/O subsystems.

I don't want to speak for either Jens or Linus, but from what Jens was telling me months ago, and from my reading of Jens' earlier patches, this seems to indeed be the case. I've been looking forward to sending non-block-sized I/Os to and from a new filesystem I'm working on.

Quoted 3 lines

3. In theory, I should be able to support page cache capability for NWFS and possibly NTFS in Linux the way these wierd non-Unix OS's work.

If you are hacking on NTFS please make sure to base changes on "ntfs-driver-tng" in the "linux-ntfs" sourceforge cvs. It is now, as of the past week, completely modern to 2.4 vfs standards, and should support all read-only features except attribute lists.

Regards,

Jeff

Signature · 3 lines
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno
#8 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

In reply to Paul Mackerras
Quoted 11 lines · Jeff Garzik
Quoted 3 lines · Jeff V. Merkey

1. The changes made to submit_bh indicate I can now send long chains of variable block size requests to the I/O layer similiar to the capability of Windows 2000 and NetWare I/O subsystems.

I don't want to speak for either Jens or Linus, but from what Jens was telling me months ago, and from my reading of Jens' earlier patches, this seems to indeed be the case. I've been looking forward to sending non-block-sized I/Os to and from a new filesystem I'm working on.

Quoted 8 lines
Quoted 3 lines

3. In theory, I should be able to support page cache capability for NWFS and possibly NTFS in Linux the way these wierd non-Unix OS's work.

If you are hacking on NTFS please make sure to base changes on "ntfs-driver-tng" in the "linux-ntfs" sourceforge cvs. It is now, as of the past week, completely modern to 2.4 vfs standards, and should support all read-only features except attribute lists.

I have a version that supports everything, including the journal, and does not "barf" on writes. Unfortunately it's written in "merkey code style" which is ThoseF_ckingLongAssNamesForEveryDamnFunction()
I was trained to write at Novell. Merging it into the sourceforge
version will be nasty. I have a few other projects and code I am tardy in sending to Brazil :-). I think just letting Anton review some of it may be a better approach. NWFS is first
up and needs to get finished and in so if I get hit by
a truck or killed by a deranged Novell employee who has
been recently laid off, someone can take maintain it.

:-)

Jeff

Quoted 14 lines

Regards,

Jeff

Signature · 3 lines
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno
#9 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

In reply to Paul Mackerras

Oh yeah, I meant to ask: do we get 64-bit inode numbers and 64-bit block numbers on x86 sometime in 2.5?

Signature · 3 lines
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno
#10 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

Quoted 3 lines · Jeff Garzik

Oh yeah, I meant to ask: do we get 64-bit inode numbers and 64-bit block numbers on x86 sometime in 2.5?

Well, the 64-bit sector number skeleton is already there in pre2..

We will probably _not_ get 64-bit page index numbers, though. I don't want to make the page structure bigger/slower for very little gain. So the page cache is probably going to be limited to about 44 bits (45+ if people start doing large pages, which is probably worth it). So there would still be partition/file limits on the order of 16-64 TB in the next few years.

(In a longer timeframe, assuming RAM keeps getting cheaper and cheaper, and 64-bit computing starts hppening on PC's, a few years down the line we can re-visit this - that particular transition is not going to be too painful).

And yes, I realize that you can already build big arrays and use LVM etc to make them be more than 16TB. I just do not think it's a problem yet, and I'd rather cater to "normal" people than to peopel who can't bother to partition their data at all.

Linus

#11 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

Quoted 5 lines · Linus Torvalds

We will probably _not_ get 64-bit page index numbers, though. I don't want to make the page structure bigger/slower for very little gain. So the page cache is probably going to be limited to about 44 bits (45+ if people start doing large pages, which is probably worth it). So there would still be partition/file limits on the order of 16-64 TB in the next few years.

The Ext2+ crowd is actively working on preparing for the world of larger blocks, so that 64KB blocks will be entirely practical. This will get us to 1/4 Petabyte, still with 32 bit block pointers internally. The main problem that has to be solved is internal fragmentation.

Going beyond 64KB blocks with mimimal changes is possible too, basically just working around the 16 bit pointers in directory blocks. However, it's not clear it's a pressing need.

Quoted 9 lines

(In a longer timeframe, assuming RAM keeps getting cheaper and cheaper, and 64-bit computing starts hppening on PC's, a few years down the line we can re-visit this - that particular transition is not going to be too painful).

And yes, I realize that you can already build big arrays and use LVM etc to make them be more than 16TB. I just do not think it's a problem yet, and I'd rather cater to "normal" people than to peopel who can't bother to partition their data at all.

Right, there's still a lot more scalability to be squeezed out of good old 32 bits. If we do run out of something it's likely to be the 32 bits of inodes, after all, who can get by on a mere 4 billion files these days?

--
Daniel

#12 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

In reply to Linus Torvalds
Quoted 11 lines · Daniel Phillips
Quoted 6 lines · Linus Torvalds

We will probably _not_ get 64-bit page index numbers, though. I don't want to make the page structure bigger/slower for very little gain. So the page cache is probably going to be limited to about 44 bits (45+ if people start doing large pages, which is probably worth it). So there would still be partition/file limits on the order of 16-64 TB in the next few years.

The Ext2+ crowd is actively working on preparing for the world of larger blocks, so that 64KB blocks will be entirely practical. This will get us to 1/4 Petabyte, still with 32 bit block pointers internally. The main problem that has to be solved is internal fragmentation.

This is a bad idea for general purpose usage patterns. The problem is that if you cure the internal fragmentation problem like reiserfs did, you are still going to be left with a memory bandwidth consumption that is proportional to the size of nodes, because inserting an 8 byte item is likely to cause a shift of contents proportional to node size.

We need to go to 64 bit blocknumbers and 64 bit inode numbers. If we are not going to do this, well, I really need to change the design of Reiser4, as I was just assuming it would be done. We get some nice simplicities out of never reusing objectids (with 64 bits, you never run out of them, the math for what it takes to run out of them assuming you use a trillion a second is a bit amusing.)

I recommend the use of 64 bits for inode numbers and blocknumbers plus the use of compression (effective for filesystems small enough to not use all 64 bits) for those who dislike the byte wastage.

Hans

#13 lore raw

Re: [reiserfs-dev] Re: Block I/O Enchancements, 2.5.1-pre2

In reply to Linus Torvalds
Quoted 9 lines · Nikita Danilov

Hans Reiser writes:

Having 64 bit inode numbers is good, but we *can* live without them:
currently inode hash table can store inodes with identical inode numbers, provided they can be distinguished by find_actor. Inode numbers are just first fast guess during table scan, if they coincide, find_actor is used.

Nikita is entirely correct, 32 bits of inode number hash is plenty.

64k blocks remain a solution whose potential drain on memory bandwidth worries me.

Hans

#14 lore raw
In reply to Paul Mackerras
Quoted 11 lines · Linus Torvalds
Quoted 5 lines · Paul Mackerras

Is there a description of the new block layer and its interface to block device drivers somewhere? That would be helpful, since Ben Herrenschmidt and I are going to have to convert several powermac-specific drivers.

Jens has something written up, which he sent to me as an introduction to the patch. I'll send that out unless he does a cleaned-up version, but I'd actually prefer for him to do the sending. Jens?

No problem, I'll clean it up and send it out. I also planned on doing a specific guide to converting drivers to exploit the new features.

Signature · 1 line
Jens Axboe
#15 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

In reply to Paul Mackerras
Quoted 3 lines · Jeff Garzik

Oh yeah, I meant to ask: do we get 64-bit inode numbers and 64-bit block numbers on x86 sometime in 2.5?

Well at least the patch from Jens makes this much easier...

#16 lore raw

bio write-up (was: Re: 2.5.1-pre2 does not compile)

In reply to Paul Mackerras
Quoted 11 lines · Linus Torvalds
Quoted 5 lines · Paul Mackerras

Is there a description of the new block layer and its interface to block device drivers somewhere? That would be helpful, since Ben Herrenschmidt and I are going to have to convert several powermac-specific drivers.

Jens has something written up, which he sent to me as an introduction to the patch. I'll send that out unless he does a cleaned-up version, but I'd actually prefer for him to do the sending. Jens?

Ok, here's the stuff I sent Linus + some extra comments on how exactly it differs for stuff like drivers.

--->
o io_request_lock removal. it's completely gone, although lots of SCSI drivers still need to be fixed (with it gone they break during compile though, which is what we want). locking is per-queue (q->queue_lock), the locking semantics are the same though (locking is still imposed by the block layer, grabbing the lock before request_fn execution -- I want to keep it this way, because it means we can leave lots of older drivers alone and they will automagically be SMP safe still. clever drivers are free to drop the queue lock whenever they want, of course).

SCSI mid layer is in an ok state, low level drivers that currently work are sym, sym2, aic7xxx_old, and aic7xxx. IDE should be completely ok, basically it relies on a new ide_lock to keep the same serialization that it currently has. Keeping a couple of disks busy in IDE didn't show this as being a big bottleneck at all, I guess we can later optimize this if we really want... The "other" block drivers like DAC960, cpqarray, and cciss are fixed too although at least DAC960 may have multi-page bio quirks. Not a big deal at this point since only raw I/O is the user that.

o main unit of I/O is the bio, not the buffer_head. this is the really major change that requires updates to basically all block drivers. the exception are drivers that only reference CURRENT and CURRENT->buffer for transfers (hence forth called "old-style drivers", they will still work as usual. Any driver that currently traverse segments in a request must be updated.

A bio has no virtual mapping of the data at all. This basically forces highmem support on drivers, at least it is no different than doing low memory I/O which is what I think matters. Of course bounce limits can be set by the driver. A bio looks like this:

struct bio {
	sector_t		bi_sector;
	struct bio		*bi_next;	/* request queue link */
	atomic_t		bi_cnt;		/* pin count */
	kdev_t			bi_dev;		/* will be block device */
	struct bio_vec_list	*bi_io_vec;
	unsigned long		bi_flags;	/* status, command, etc */
	unsigned long		bi_rw;		/* bottom bits READ/WRITE,
						 * top bits priority
						 */
	int (*bi_end_io)(struct bio *bio, int nr_sectors);
	void			*bi_private;

	void (*bi_destructor)(struct bio *);	/* destructor */
};

Most of the above is self-explanatory, so I'll just brief you on some of the differences from buffer_head. bi_io_vec is the actual io vector, it's composed of these:

struct bio_vec {
	struct page	*bv_page;
	unsigned int	bv_len;
	unsigned int	bv_offset;
};

struct bio_vec_list {
unsigned int bvl_cnt; /* how may bio_vec's */
unsigned int bvl_idx; /* current index into bvl_vec */
unsigned int bvl_size; /* total size in bytes */
unsigned int bvl_max; /* max bvl_vecs we can hold, used
as index into pool */
struct bio_vec bvl_vec[0]; /* the iovec array */
};

The main reason for doing an array like this is that it enables easy pre-clustering of pages for I/O submission. Stuff like read_cluster, raw I/O, O_DIRECT etc can queue nice big portions of pages at once. And XFS will really like it too. Also, the vm can pre-alloc a bio + veclist and do it's own merging if it wants to (again XFS, I know they do this on Irix (well sort of, pass it down differently, the merging at the vm layer is what I'm comparing it to)). The I/O scheduler still uses bi_next to singly link merges at that level.

The end_io callback now has a number of sectors argument, basically so we don't have to loop around ending requests. No uptodate flag is passed down, all that can be fitted in the bi_flags now. One bit of completion info was never enough anyways.

bi_desctructor is only there because a bio can originate from different sources. Normally it will be gotten with bio_alloc(int gfp_mask, int nr_iovecs) and the default destructor frees the necessary things on I/O completion. A bio may come from other sources though, or it may be a cloned or even a copied bio (ie loop can clone or copy a bio (similar to network skb stuff) with bio_clone/bio_copy), or maybe someone using just kmalloc for allocating the bio.

Traversal of data segments in a request becomes even more hairy at this point though, since a request still holds a list of bios which in turn can hold a map of segments. I've always thought that drivers had to initimate knowledge of how that works though, so I've moved this to something like:

	rq_for_each_bio(bio, rq)
		bio_for_each_segment(bio_vec, bio, i)
			/* bio_vec is now current segment */

which I think we should have had a long time ago. Then we are also free to change the implementation details later without having to change drivers again :-). I should mention that ll_rw_blk provides a blk_rq_map_sg helper to map a struct request to a scatterlist, so we can rip the scatterlist build out of a lot of drivers. They can simply do

	nr_segments = blk_rq_map_sg(q, rq, scatterlist);

I can say a lot more about the bio stuff, but it's probably better if you just start with commenting/flaming the above and we can go from there :-). I'll move on to a few more things...

o head active queues are a thing of the past. We never should have exposted the list implementation of requests to the drivers -- I've changed this so drivers merely do

	rq = elv_next_request(q);

which is the next request that the I/O scheduler thinks should be handled. That enables us to easily mark requests as active or not, so the elevator knows not to touch it. Then this head-active crap is handled transparently instead. Also, it enables us to mark more than the first request as untouchable, something we've needed for a while.

...

I'll finish off for now with a status... Basically the tree is stable for IDE and the SCSI stuff listed, same with cpqarray etc. loop probably needs a bit of fixing, but not much. O_DIRECT is currently a kludge, the kio blocks/bh stuff is a MESS that needs resolving real soon! Raw I/O is almost there too, we can pull lots of megs/sec with very little sys time now.

...

<---

Now, I guess what others are mainly interested in is either a) design of this stuff or b) what to look out for when converting drivers. Wrt a), read the source :-). For b, read on.

If you are maintaing and old-style driver that just uses CURRENT and ignores clustered requests, you should be alright and not need any changes. Maybe you are dropping the io_request_lock from your request_fn strategy, if so then just replace that with &q->queue_lock instead. The generic layer will automatically handle clustered requests, multi-page bios, etc for you. For a low performance driver or hardware that is PIO driven or just doesn't support scatter-gather, you can stop reading now.

Lets start by looking at how we transferred data in the 2.4 kernels. There are two structures you need to know about. The first is the buffer_head, this is the I/O "atom". For a block driver, the relevant parts of this struct is:

	unsigned long b_rsector;	/* where */
	kdev_t b_rdev;			/* who */

	char *b_data;			/* what */

	struct buffer_head *b_reqnext;	/* next buffer */

and that is basically it. b_rsector is offset from b_rdev which includes minor stuff for partitions. b_data is the virtual mapping of the buffer that wants to be read or written. actually, b_data is the virtual mapping og b_page and a possible offset, but now we are already getting into 2.4 + block-highmem or 2.5 land. b_reqnext is the next pointer to a chain of buffer_heads.

Most real-hardware (ie not loop, raid, rd, etc) don't receive the buffer_heads directly though. Instead they receive a list of struct requests to handle. struct request contains lots of house keeping info, the interesting part again for block drivers are:

unsigned long sector; /* like b_rsector */
unsigned long nr_sectors; /* total number of sectors */
unsigned long current_nr_sectors; /* "current" ditto of above */ unsigned int nr_segments;

char *buffer; /* like b_data */
struct buffer_head *bh; /* first bh in request */
struct buffer_head *bhtail; /* last bh in request */

So struct request ties a list of buffer_heads together for handing to the driver. Performance hardware usually builds a scatter-gather list of these chunks and sends it off to the driver. nr_sectors contains the total size of all the buffer_heads linked to the request, current_nr_sectors only the size of the currently first bh in the list (ie rq->bh). When I/O is ended on a request, the buffer_heads are pealed off the list as I/O on them completes.

Now lets take a look at how 2.5 does this differently. Struct buffer_head now has no relevance for block drivers, it's purely a buffer cache thing. Instead we deal with struct bio, which I explained the layout of earlier in this mail. Struct request is basically the same, except that now we link bio and biotail into it. For a sane block driver, the request handling loop with bio will look something like:

	do {
		struct request *rq = elv_next_request(q);
		struct scatterlist *sg;
		struct my_driver_cmd *cmd;
		int nr_segments;

		/*
		 * no more to handle
		 */
		if (!rq)
			break;

		blkdev_dequeue_request(rq);

		/*
		 * for queuing, otherwise you will probably just
		 * have a sg structure allocated at init time (see ide)
		 */
		sg = my_driver_alloc_sg(rq->nr_segments);

		/*
		 * block layer helper to map a struct request into
		 * a scatter-gather list
		 */
		nr_segments = blk_rq_map_sg(q, rq, sg);		

		cmd = my_driver_alloc_cmd();

		/*
		 * init hardware command with data direction and sg list
		 */
		my_driver_setup_cmd(cmd, rq->cmd, sg);
		my_driver_queue_cmd(cmd);
	} while (1);

You are free to loop through the request segments yourself using the technique described higher up of course, however I recommend using the blk_rq_map_sg helper to handle the grunt of the mapping work. That will (probably :-) also help you out later if the internals are changed again.

blk_rq_map_sg will look at several queue properties to handle stuff like:

- cluster contigious segments into one, if wanted (QUEUE_FLAG_CLUSTER)
- don't allow a clustered segment to cross a 4GB mem boundary
- don't build bigger segments than q->max_segment_size

and probably more.

Other changes that may affect you:

New queue property settings:

blk_queue_bounce_limit(q, u64 dma_address)
Enable I/O to highmem pages, dma_address being your limit. No highmem default.

blk_queue_max_sectors(q, max_sectors)
Maximum size request you can handle in units of 512 byte sectors. 255 default.

blk_queue_max_segments(q, max_segments)
Maximum segments you can handle in a request. 128 default.

blk_queue_max_segment_size(q, max_seg_size)
Maximum size of a clustered segment, 64kB default.

New queue flags:

QUEUE_FLAG_NOSPLIT
can handle a bio with more than one segment. ll_rw_blk will split bigger bio's for you if needed (not actually implemented yet :-)

QUEUE_FLAG_CLUSTER
Explained above.

- struct request ->queue is no more. with the introduction of elv_next_request, you are no longer supposed to handle looping directly over the request list.

- end_that_request_first takes an additional number_of_sectors argument. It used to handle always just the first buffer_head in a request, now it will loop and handle as many sectors (on a bio-segment granularity) as you want.

- bh->b_end_io is bio->bi_end_io, but you probably want to use bio_endio(bio, uptodate, nr_sectors) instead.

- you can set max sector size, max segment size etc per queue now. drivers that used to define their own merge functions to handle things like this can now just use the blk_queue_* functions at blk_init_queue time.

- you no longer have to map a {partition, sector offset} into the correct absolute location anymore, this is done by the block layer. so when you received a request ala this before:

	rq->rq_dev = MKDEV(3, 5);	/* /dev/hda5 */
	rq->sector = 0;			/* first sector on hda5 */

you will now see

	rq->rq_dev = MKDEV(3, 0);	/* /dev/hda */
	rq->sector = 123128;		/* offset from start of disk */

- As mentioned, there is no virtual mapping of a bio. For DMA, this is not a problem as you probably never will need a virtual mapping. Instead you want a bus mapping so you can ship it to the driver. For PIO drivers (or drivers that need to revert to PIO transfer once in a while (IDE for example)), where the CPU is doing the actual data transfer for you, you do need a virtual mapping though. If you are supporting highmem I/O, you need to use bio_kmap and bio_kmap_irq to temporarily map a bio into the virtual address space. See how IDE handles this with ide_map_buffer.

I've lost track of what else there is to explain, so I'll stop now. If you have problems convering a driver or questions in general, fire away. Suparana@IBM has written lots of stuff about bio as it was a WIP, see

http://lse.sourceforge.net/io/bionotes.txt

it may not be completely uptodate right now wrt multi-page bios etc, but I know that is on its way :-)

Signature · 1 line
Jens Axboe
#17 lore raw

2.5.1-pre2 bio offset by one error in VIA IDE

Jens,

I just booted my Athlon VIA KT133 chipset box with 2.5.1-pre2 only to discover it dropped me into single user mode because /dev/hda2 could not be mounted. (Rebooting into 2.5.0+viro patch everything is ok, back into 2.5.1-pre2 is broken...)

Looking with hexedit /dev/hda2 when booted into 2.5.1-pre2 the first sector contains junk, the second sector contains the real data that I see as the first sector when booted into 2.5.0+viro fix.

That suggests to me there is an off by one error in the VIA IDE driver in the 2.5.10pre2 kernel causing the partition to start one sector earlier than it should.

If you would like any further information / patch testing / whatever let me know.

Best regards,

Anton

Signature · 5 lines
  "I've not lost my mind. It's backed up on tape somewhere." - Unknown
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/
#18 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

In reply to Paul Mackerras
Quoted 19 lines · Jeff V. Merkey
Quoted 8 lines · Linus Torvalds
Quoted 5 lines · Paul Mackerras

Is there a description of the new block layer and its interface to block device drivers somewhere? That would be helpful, since Ben Herrenschmidt and I are going to have to convert several powermac-specific drivers.

Quoted 6 lines

Jens has something written up, which he sent to me as an introduction to the patch. I'll send that out unless he does a cleaned-up version, but I'd actually prefer for him to do the sending. Jens?

Linus

Linus/Jens,

Quoted 7 lines

I've just completed my review of submit_bio and the changes to generic_make_request and I have some questions for whomever can answer.

1. The changes made to submit_bh indicate I can now send long chains of variable block size requests to the I/O layer similiar to the capability of Windows 2000 and NetWare I/O subsystems.

Yes, you can build generically a single I/O unit that spans up to 256 pages. If you bypass the bio_alloc/bvec_alloc mechanism, the sky is the limit. Beware that a really big bio may need to be split up in the end for devices that can't handle them that big.

Quoted 2 lines

2. The elevator layer is merging these requests, and making a single sweep request for contiguous sector runs.

Like always, yes.

Quoted 3 lines

3. In theory, I should be able to support page cache capability for NWFS and possibly NTFS in Linux the way these wierd non-Unix OS's work.

Maybe :-)

Quoted 6 lines

4. This interface may **NOT** support non-block aligned requests across all the drivers. I also need to be able to submit a request chain 512-2048-512-1024-4096 where the first IO requested may by on a non-block aligned boundry. i.e. Device is configured for 1024 byte blocks, I start the request as 512 @ LBA 1 -> 1024 @ LBA 2, etc. The code looks like it will work.

As long as the smallest unit above is at least the size of the hardware sector on the target, it should be ok.

Quoted 3 lines

I would love to test this wonderful code and will hopefully this evening, however, all the SCSI drivers appear to be broken, as well as the 3Ware. :-)

Well not all, but many. I only converted stuff I could personally test, basically, plus a bit more. Usually converting a SCSI driver is not a lot of work, please see the changes to sym/sym2 etc in the pre2 patch.

Signature · 1 line
Jens Axboe
#19 lore raw

Re: Block I/O Enchancements, 2.5.1-pre2

In reply to Paul Mackerras

----- Original Message -----
From: "Jens Axboe" <[email protected]>
To: "Jeff V. Merkey" <[email protected]>
Cc: "Linus Torvalds" <[email protected]>; <[email protected]>; <[email protected]>
Sent: Wednesday, November 28, 2001 6:35 AM
Subject: Re: Block I/O Enchancements, 2.5.1-pre2

Quoted 11 lines · Jeff V. Merkey
Quoted 10 lines · Linus Torvalds
Quoted 9 lines · Paul Mackerras
Quoted 5 lines

Is there a description of the new block layer and its interface to block device drivers somewhere? That would be helpful, since Ben Herrenschmidt and I are going to have to convert several powermac-specific drivers.

Jens has something written up, which he sent to me as an introduction

to

Quoted 1 line
Quoted 1 line
Quoted 1 line

the patch. I'll send that out unless he does a cleaned-up version, but

I'd

Quoted 12 lines
Quoted 12 lines
Quoted 4 lines

actually prefer for him to do the sending. Jens?

Linus

Linus/Jens,

I've just completed my review of submit_bio and the changes to generic_make_request and I have some questions for whomever can answer.

Quoted 8 lines
Quoted 3 lines

1. The changes made to submit_bh indicate I can now send long chains of variable block size requests to the I/O layer similiar to the capability of Windows 2000 and NetWare I/O subsystems.

Yes, you can build generically a single I/O unit that spans up to 256 pages. If you bypass the bio_alloc/bvec_alloc mechanism, the sky is the limit. Beware that a really big bio may need to be split up in the end for devices that can't handle them that big.

I got your docs and tried this.

Quoted 11 lines
Quoted 3 lines

2. The elevator layer is merging these requests, and making a single sweep request for contiguous sector runs.

Like always, yes.

Quoted 3 lines

3. In theory, I should be able to support page cache capability for NWFS and possibly NTFS in Linux the way these wierd non-Unix OS's work.

Maybe :-)

The next posting of NWFS will have the page cache enabled. I am testing the code
this morning. I also have reduced the memory usage to about 1/100 of what I was doing
with the in-memory name hashes. I never liked the way NetWare did this. It's fast
as hell for lookups, but sure uses a lot of memory.

Quoted 6 lines
Quoted 6 lines

4. This interface may **NOT** support non-block aligned requests across all the drivers. I also need to be able to submit a request chain 512-2048-512-1024-4096 where the first IO requested may by on a non-block aligned boundry. i.e. Device is configured for 1024 byte blocks, I start the request as 512 @ LBA 1 -> 1024 @ LBA

2,

Quoted 4 lines
Quoted 1 line

etc. The code looks like it will work.

As long as the smallest unit above is at least the size of the hardware sector on the target, it should be ok.

Some of the Adaptec drivers will be busted. I remmeber trying this once before at
Linus' suggestion about a year ago, and I saw significant breakage. Oh well, this
is 2.5. I guess folks will just have to fix their drivers if this breaks them.

Quoted 2 lines
Quoted 2 lines

I would love to test this wonderful code and will hopefully this

evening,

Quoted 6 lines
Quoted 2 lines

however, all the SCSI drivers appear to be broken, as well as the 3Ware. :-)

Well not all, but many. I only converted stuff I could personally test, basically, plus a bit more. Usually converting a SCSI driver is not a lot of work, please see the changes to sym/sym2 etc in the pre2 patch.

I am testing on IDE systems -- no IDE breakage at present. Andre's IDE drivers are
some of the fastest implementations out there and are comparable in performance to
SCSI.

Jeff

Quoted 9 lines

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#20 lore raw
In reply to Linus Torvalds
Quoted 11 lines · In article <[email protected]> you wrote:

In many cases the fix is as simple as just replacing the "io_request_lock" with "host->host_lock", but sometimes this is complicated by the need to pass the right data structures down far enough..

Many drivers have been converted (ie IDE, symbios, aic7xxx etc), but many more have not (especially older SCSI drivers, in your case it's the classic aha1542).

It will probably take some time until most drivers have been converted. Tested patches are more than welcome,

While we are at breaking scsi, would you take a patch to remove the old-style (2.0) scsi error handling completly, forcing drivers still using it to be fixed? Early 2.5 looks like a good time for that to me..

Christoph

Signature · 1 line
Of course it doesn't work. We've performed a software upgrade.
#21 lore raw

onboard ethernet/sound on Soyo SY-K7V?

I'm looking a purchasing a dozen computers with the Soyo SY-K7V Dragon Plus motherboard. It has the KT266A chipset.

My question is Linux support for the onboard ethernet and sound. I've googled all over and haven't come up with a definitive answer.

They are described as "VIA 10/100 Ethernet" and "CMI 8738 Audio chip".

Does anyone know the scoop?

Dax

#22 lore raw

Re: onboard ethernet/sound on Soyo SY-K7V?

Quoted 5 lines · Dax Kelson

I'm looking a purchasing a dozen computers with the Soyo SY-K7V Dragon Plus motherboard. It has the KT266A chipset.

My question is Linux support for the onboard ethernet and sound. I've googled all over and haven't come up with a definitive answer.

They are described as "VIA 10/100 Ethernet" and "CMI 8738 Audio chip".

CMI 8738 has a driver in the current kernel.
As for VIA 10/100 Ethernet, I dunno... Maybe the via-rhine would work ? Not sure, though...

François

Quoted 3 lines

Does anyone know the scoop?

Dax

#23 lore raw

Re: onboard ethernet/sound on Soyo SY-K7V?

In reply to Dax Kelson
Quoted 8 lines · Dax Kelson

I'm looking a purchasing a dozen computers with the Soyo SY-K7V Dragon Plus motherboard. It has the KT266A chipset.

My question is Linux support for the onboard ethernet and sound. I've googled all over and haven't come up with a definitive answer.

They are described as "VIA 10/100 Ethernet" and "CMI 8738 Audio chip".

what does 'lspci -vn' show for your system?

Signature · 3 lines
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno
#24 lore raw
In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

While we are at breaking scsi, would you take a patch to remove the old-style (2.0) scsi error handling completly, forcing drivers still using it to be fixed? Early 2.5 looks like a good time for that to me..

Linus, please consider this at some early point. There isn't too much using the scsi_obsolete gunk anyhow, but let's clean it up. Good idea.

Robert Love

#25 lore raw
In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

While we are at breaking scsi, would you take a patch to remove the old-style (2.0) scsi error handling completly, forcing drivers still using it to be fixed? Early 2.5 looks like a good time for that to me..

I agree, that sounds like a good thing, and as I consider the block layer to be one of the major pushes for 2.5.x it makes perfect sense.

Linus

#26 lore raw
In reply to Christoph Hellwig
Quoted 9 lines · Linus Torvalds
Quoted 4 lines · Christoph Hellwig

While we are at breaking scsi, would you take a patch to remove the old-style (2.0) scsi error handling completly, forcing drivers still using it to be fixed? Early 2.5 looks like a good time for that to me..

I agree, that sounds like a good thing, and as I consider the block layer to be one of the major pushes for 2.5.x it makes perfect sense.

Ok, here is the patch:

drivers/acorn/scsi/arxescsi.h renamed from master/linux-2.5.1-pre2/drivers/acorn/scsi/arxescsi.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/acorn/scsi/arxescsi.h linux/drivers/acorn/scsi/arxescsi.h
@@ -61,7 +61,6 @@
 eh_bus_reset_handler:		fas216_eh_bus_reset,	\
 eh_device_reset_handler:	fas216_eh_device_reset,	\
 eh_abort_handler:		fas216_eh_abort,	\
-use_new_eh_code:		1			\
 	}
 
 #ifndef HOSTS_C
drivers/acorn/scsi/cumana_2.c renamed from master/linux-2.5.1-pre2/drivers/acorn/scsi/cumana_2.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/acorn/scsi/cumana_2.c linux/drivers/acorn/scsi/cumana_2.c
@@ -575,7 +575,6 @@
 	eh_bus_reset_handler:		fas216_eh_bus_reset,
 	eh_device_reset_handler:	fas216_eh_device_reset,
 	eh_abort_handler:		fas216_eh_abort,
-	use_new_eh_code:		1
 };
 
 static int __init cumanascsi2_init(void)
drivers/acorn/scsi/eesox.c renamed from master/linux-2.5.1-pre2/drivers/acorn/scsi/eesox.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/acorn/scsi/eesox.c linux/drivers/acorn/scsi/eesox.c
@@ -577,7 +577,6 @@
 	eh_bus_reset_handler:		fas216_eh_bus_reset,
 	eh_device_reset_handler:	fas216_eh_device_reset,
 	eh_abort_handler:		fas216_eh_abort,
-	use_new_eh_code:		1
 };
 
 static int __init eesox_init(void)
drivers/acorn/scsi/powertec.c renamed from master/linux-2.5.1-pre2/drivers/acorn/scsi/powertec.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/acorn/scsi/powertec.c linux/drivers/acorn/scsi/powertec.c
@@ -477,7 +477,6 @@
 	eh_bus_reset_handler:		fas216_eh_bus_reset,
 	eh_device_reset_handler:	fas216_eh_device_reset,
 	eh_abort_handler:		fas216_eh_abort,
-	use_new_eh_code:		1
 };
 
 static int __init powertecscsi_init(void)
drivers/message/fusion/mptscsih.h renamed from master/linux-2.5.1-pre2/drivers/message/fusion/mptscsih.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/message/fusion/mptscsih.h linux/drivers/message/fusion/mptscsih.h
@@ -198,7 +198,6 @@
 	cmd_per_lun:			MPT_SCSI_CMD_PER_LUN,	\
 	unchecked_isa_dma:		0,			\
 	use_clustering:			ENABLE_CLUSTERING,	\
-	use_new_eh_code:		1			\
 }
 
 #else
drivers/net/fc/iph5526.c renamed from master/linux-2.5.1-pre2/drivers/net/fc/iph5526.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/net/fc/iph5526.c linux/drivers/net/fc/iph5526.c
@@ -3802,7 +3802,6 @@
 		fi->host = host;
 		//host->max_id = MAX_SCSI_TARGETS;
 		host->max_id = 5;
-		host->hostt->use_new_eh_code = 1;
 		host->this_id = tmpt->this_id;
 
 		pci_maddr = pci_resource_start(pdev, 0);
drivers/scsi/3w-xxxx.h renamed from master/linux-2.5.1-pre2/drivers/scsi/3w-xxxx.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/3w-xxxx.h linux/drivers/scsi/3w-xxxx.h
@@ -461,7 +461,6 @@
 	present : 0,					\
 	unchecked_isa_dma : 0,				\
 	use_clustering : ENABLE_CLUSTERING,		\
- 	use_new_eh_code : 1,				\
 	emulated : 1					\
 }
 #endif /* _3W_XXXX_H */
drivers/scsi/53c700.c renamed from master/linux-2.5.1-pre2/drivers/scsi/53c700.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/53c700.c linux/drivers/scsi/53c700.c
@@ -267,7 +267,6 @@
 	tpnt->sg_tablesize = NCR_700_SG_SEGMENTS;
 	tpnt->cmd_per_lun = NCR_700_MAX_TAGS;
 	tpnt->use_clustering = DISABLE_CLUSTERING;
-	tpnt->use_new_eh_code = 1;
 	tpnt->proc_info = NCR_700_proc_directory_info;
 	
 	if(tpnt->name == NULL)
drivers/scsi/Makefile renamed from master/linux-2.5.1-pre2/drivers/scsi/Makefile +3 -5
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/Makefile linux/drivers/scsi/Makefile
@@ -133,11 +133,9 @@
 obj-$(CONFIG_CHR_DEV_SG)	+= sg.o
 
 list-multi	:= scsi_mod.o sd_mod.o sr_mod.o initio.o a100u2w.o cpqfc.o
-scsi_mod-objs	:= scsi.o hosts.o scsi_ioctl.o constants.o \
-			scsicam.o scsi_proc.o scsi_error.o \
-			scsi_obsolete.o scsi_queue.o scsi_lib.o \
-			scsi_merge.o scsi_dma.o scsi_scan.o \
-			scsi_syms.o
+scsi_mod-objs	:= scsi.o hosts.o scsi_ioctl.o constants.o scsicam.o \
+			scsi_proc.o scsi_error.o scsi_queue.o scsi_lib.o \
+			scsi_merge.o scsi_dma.o scsi_scan.o scsi_syms.o
 sd_mod-objs	:= sd.o
 sr_mod-objs	:= sr.o sr_ioctl.o sr_vendor.o
 initio-objs	:= ini9100u.o i91uscsi.o
drivers/scsi/advansys.h renamed from master/linux-2.5.1-pre2/drivers/scsi/advansys.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/advansys.h linux/drivers/scsi/advansys.h
@@ -77,7 +77,6 @@
     release:                    advansys_release, \
     info:                       advansys_info, \
     queuecommand:               advansys_queuecommand, \
-    use_new_eh_code:		1, \
     eh_bus_reset_handler:	advansys_reset, \
     bios_param:                 advansys_biosparam, \
     /* \
drivers/scsi/aha152x.h renamed from master/linux-2.5.1-pre2/drivers/scsi/aha152x.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/aha152x.h linux/drivers/scsi/aha152x.h
@@ -50,7 +50,6 @@
                   present:			0,			\
                   unchecked_isa_dma:		0,			\
                   use_clustering:		DISABLE_CLUSTERING,	\
-		  use_new_eh_code:		1 }
 #endif
 
 
drivers/scsi/aha1542.h renamed from master/linux-2.5.1-pre2/drivers/scsi/aha1542.h +2 -3
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/aha1542.h linux/drivers/scsi/aha1542.h
@@ -166,7 +166,6 @@
 		     sg_tablesize:		AHA1542_SCATTER, 	\
 		     cmd_per_lun:		AHA1542_CMDLUN, 	\
 		     unchecked_isa_dma:		1, 			\
-		     use_clustering:		ENABLE_CLUSTERING,	\
-		     use_new_eh_code:		1}
-
+		     use_clustering:		ENABLE_CLUSTERING	\
+}
 #endif
drivers/scsi/aic7xxx/aic7xxx_linux_host.h renamed from master/linux-2.5.1-pre2/drivers/scsi/aic7xxx/aic7xxx_linux_host.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/aic7xxx/aic7xxx_linux_host.h linux/drivers/scsi/aic7xxx/aic7xxx_linux_host.h
@@ -89,7 +89,6 @@
 	present: 0,		/* number of 7xxx's present   */\
 	unchecked_isa_dma: 0,	/* no memory DMA restrictions */\
 	use_clustering: ENABLE_CLUSTERING,			\
-	use_new_eh_code: 1,					\
 	highmem_io: 1						\
 }
 
drivers/scsi/aic7xxx_old/aic7xxx.h renamed from master/linux-2.5.1-pre2/drivers/scsi/aic7xxx_old/aic7xxx.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/aic7xxx_old/aic7xxx.h linux/drivers/scsi/aic7xxx_old/aic7xxx.h
@@ -55,7 +55,6 @@
 	present: 0,		/* number of 7xxx's present   */\
 	unchecked_isa_dma: 0,	/* no memory DMA restrictions */\
 	use_clustering: ENABLE_CLUSTERING,			\
-	use_new_eh_code: 0					\
 }
 
 extern int aic7xxx_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *));
drivers/scsi/atp870u.h renamed from master/linux-2.5.1-pre2/drivers/scsi/atp870u.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/atp870u.h linux/drivers/scsi/atp870u.h
@@ -65,7 +65,6 @@
 	present: 0,		/* number of 7xxx's present   */\
 	unchecked_isa_dma: 0,	/* no memory DMA restrictions */\
 	use_clustering: ENABLE_CLUSTERING,			\
-	use_new_eh_code: 0					\
 }
 
 #endif
drivers/scsi/cpqfcTS.h renamed from master/linux-2.5.1-pre2/drivers/scsi/cpqfcTS.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/cpqfcTS.h linux/drivers/scsi/cpqfcTS.h
@@ -38,7 +38,6 @@
  present:                0,                      \
  unchecked_isa_dma:      0,                      \
  use_clustering:         ENABLE_CLUSTERING,      \
- use_new_eh_code:        1			 \
 }
 
 #endif /* CPQFCTS_H */ 
drivers/scsi/dc390.h renamed from master/linux-2.5.1-pre2/drivers/scsi/dc390.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/dc390.h linux/drivers/scsi/dc390.h
@@ -64,7 +64,6 @@
    this_id:        7,					\
    sg_tablesize:   SG_ALL,				\
    cmd_per_lun:    16,					\
-   NEW_EH						\
    unchecked_isa_dma: 0,				\
    use_clustering: DISABLE_CLUSTERING			\
    }
drivers/scsi/dpt_i2o.c renamed from master/linux-2.5.1-pre2/drivers/scsi/dpt_i2o.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/dpt_i2o.c linux/drivers/scsi/dpt_i2o.c
@@ -178,7 +178,6 @@
 	adpt_hba* pHba;
 
 	adpt_init();
-	sht->use_new_eh_code = 1;
 
 	PINFO("Detecting Adaptec I2O RAID controllers...\n");
 
drivers/scsi/dpti.h renamed from master/linux-2.5.1-pre2/drivers/scsi/dpti.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/dpti.h linux/drivers/scsi/dpti.h
@@ -95,7 +95,6 @@
 	sg_tablesize: 0,		/* max scatter-gather cmds    */\
 	cmd_per_lun: 256,		/* cmds per lun (linked cmds) */\
 	use_clustering: ENABLE_CLUSTERING,				\
-	use_new_eh_code: 1,						\
 	proc_name: "dpt_i2o"	/* this is the name of our proc node*/	\
 }
 #endif
drivers/scsi/eata.h renamed from master/linux-2.5.1-pre2/drivers/scsi/eata.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/eata.h linux/drivers/scsi/eata.h
@@ -30,7 +30,6 @@
                 this_id:                 7,                                  \
                 unchecked_isa_dma:       1,                                  \
                 use_clustering:          ENABLE_CLUSTERING,                  \
-                use_new_eh_code:         1    /* Enable new error code */    \
              }
 
 #endif
drivers/scsi/esp.h renamed from master/linux-2.5.1-pre2/drivers/scsi/esp.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/esp.h linux/drivers/scsi/esp.h
@@ -416,7 +416,6 @@
 		sg_tablesize:   SG_ALL,				\
 		cmd_per_lun:    1,				\
 		use_clustering: ENABLE_CLUSTERING,		\
-		use_new_eh_code: 0				\
 }
 
 /* For our interrupt engine. */
drivers/scsi/fcal.h renamed from master/linux-2.5.1-pre2/drivers/scsi/fcal.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/fcal.h linux/drivers/scsi/fcal.h
@@ -35,7 +35,6 @@
 	sg_tablesize:		1,				\
 	cmd_per_lun:		1,				\
 	use_clustering:		ENABLE_CLUSTERING,		\
-	use_new_eh_code:	FCP_SCSI_USE_NEW_EH_CODE,	\
 	abort:			fcp_old_abort,			\
 	eh_abort_handler:	fcp_scsi_abort,			\
 	eh_device_reset_handler:fcp_scsi_dev_reset,		\
drivers/scsi/gdth.h renamed from master/linux-2.5.1-pre2/drivers/scsi/gdth.h +0 -2
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/gdth.h linux/drivers/scsi/gdth.h
@@ -1060,7 +1060,6 @@
                present:         0,                               \
                unchecked_isa_dma: 1,                             \
                use_clustering:  ENABLE_CLUSTERING,               \
-               use_new_eh_code: 1       /* use new error code */ }    
 
 #elif LINUX_VERSION_CODE >= 0x02015F
 int gdth_bios_param(Disk *,kdev_t,int *);
@@ -1092,7 +1091,6 @@
                present:         0,                               \
                unchecked_isa_dma: 1,                             \
                use_clustering:  ENABLE_CLUSTERING,               \
-               use_new_eh_code: 1       /* use new error code */ }    
 
 #elif LINUX_VERSION_CODE >= 0x010300
 int gdth_bios_param(Disk *,kdev_t,int *);
drivers/scsi/hosts.h renamed from master/linux-2.5.1-pre2/drivers/scsi/hosts.h +0 -7
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/hosts.h linux/drivers/scsi/hosts.h
@@ -280,13 +280,6 @@
     unsigned use_clustering:1;
 
     /*
-     * True if this driver uses the new error handling code.  This flag is
-     * really only temporary until all of the other drivers get converted
-     * to use the new error handling code.
-     */
-    unsigned use_new_eh_code:1;
-
-    /*
      * True for emulated SCSI host adapters (e.g. ATAPI)
      */
     unsigned emulated:1;
drivers/scsi/imm.h renamed from master/linux-2.5.1-pre2/drivers/scsi/imm.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/imm.h linux/drivers/scsi/imm.h
@@ -175,7 +175,6 @@
                 eh_device_reset_handler:        NULL,                   \
                 eh_bus_reset_handler:           imm_reset,              \
                 eh_host_reset_handler:          imm_reset,              \
-		use_new_eh_code:		1,			\
 		bios_param:		        imm_biosparam,		\
 		this_id:			7,			\
 		sg_tablesize:			SG_ALL,			\
drivers/scsi/in2000.h renamed from master/linux-2.5.1-pre2/drivers/scsi/in2000.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/in2000.h linux/drivers/scsi/in2000.h
@@ -423,7 +423,6 @@
                   sg_tablesize:    IN2000_SG,           /* scatter-gather table size */ \
                   cmd_per_lun:     IN2000_CPL,          /* commands per lun */ \
                   use_clustering:  DISABLE_CLUSTERING,  /* ENABLE_CLUSTERING may speed things up */ \
-                  use_new_eh_code: 0                    /* new error code - not using it yet */ \
                 }
 
 #endif /* IN2000_H */
drivers/scsi/ini9100u.h renamed from master/linux-2.5.1-pre2/drivers/scsi/ini9100u.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/ini9100u.h linux/drivers/scsi/ini9100u.h
@@ -115,7 +115,6 @@
 	present:	0, \
 	unchecked_isa_dma: 0, \
 	use_clustering:	ENABLE_CLUSTERING, \
- use_new_eh_code: 0 \
 }
 
 #define VIRT_TO_BUS(i)  (unsigned int) virt_to_bus((void *)(i))
drivers/scsi/inia100.h renamed from master/linux-2.5.1-pre2/drivers/scsi/inia100.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/inia100.h linux/drivers/scsi/inia100.h
@@ -110,7 +110,6 @@
 	present:	0, \
 	unchecked_isa_dma: 0, \
 	use_clustering:	ENABLE_CLUSTERING, \
- use_new_eh_code: 0 \
 }
 
 #define VIRT_TO_BUS(i)  (unsigned int) virt_to_bus((void *)(i))
drivers/scsi/ips.h renamed from master/linux-2.5.1-pre2/drivers/scsi/ips.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/ips.h linux/drivers/scsi/ips.h
@@ -472,7 +472,6 @@
     present : 0,                          \
     unchecked_isa_dma : 0,                \
     use_clustering : ENABLE_CLUSTERING,   \
-    use_new_eh_code : 1                   \
 }
 #endif
 
drivers/scsi/mac53c94.h renamed from master/linux-2.5.1-pre2/drivers/scsi/mac53c94.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/mac53c94.h linux/drivers/scsi/mac53c94.h
@@ -28,7 +28,6 @@
 	sg_tablesize:	SG_ALL,				\
 	cmd_per_lun:	1,				\
 	use_clustering:	DISABLE_CLUSTERING,		\
-	use_new_eh_code: 1,				\
 }
 
 /*
drivers/scsi/mac_esp.h renamed from master/linux-2.5.1-pre2/drivers/scsi/mac_esp.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/mac_esp.h linux/drivers/scsi/mac_esp.h
@@ -35,7 +35,6 @@
 			    sg_tablesize:	SG_ALL, \
 			    cmd_per_lun:	1, \
 			    use_clustering:	DISABLE_CLUSTERING, \
-			    use_new_eh_code:	0 }
 
 #endif /* MAC_ESP_H */
 
drivers/scsi/mesh.h renamed from master/linux-2.5.1-pre2/drivers/scsi/mesh.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/mesh.h linux/drivers/scsi/mesh.h
@@ -28,7 +28,6 @@
 	sg_tablesize:	SG_ALL,				\
 	cmd_per_lun:	2,				\
 	use_clustering:	DISABLE_CLUSTERING,		\
-	use_new_eh_code: 1,				\
 }
 
 /*
drivers/scsi/pci2000.h renamed from master/linux-2.5.1-pre2/drivers/scsi/pci2000.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/pci2000.h linux/drivers/scsi/pci2000.h
@@ -218,7 +218,6 @@
 	present:	0,						\
 	unchecked_isa_dma:0,						\
 	use_clustering:	DISABLE_CLUSTERING,				\
-	use_new_eh_code:0						\
 }
 
 #endif
drivers/scsi/pci2220i.h renamed from master/linux-2.5.1-pre2/drivers/scsi/pci2220i.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/pci2220i.h linux/drivers/scsi/pci2220i.h
@@ -56,6 +56,5 @@
 	present:		0,			\
 	unchecked_isa_dma:	0,			\
 	use_clustering:		DISABLE_CLUSTERING,	\
-	use_new_eh_code:	0			\
 }
 #endif
drivers/scsi/pcmcia/nsp_cs.c renamed from master/linux-2.5.1-pre2/drivers/scsi/pcmcia/nsp_cs.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/pcmcia/nsp_cs.c linux/drivers/scsi/pcmcia/nsp_cs.c
@@ -149,7 +149,6 @@
 /*	present:		0,*/
 /*	unchecked_isa_dma:	0,*/
 	use_clustering:		DISABLE_CLUSTERING,
-	use_new_eh_code:	0,
 /*	emulated:		0,*/
 };
 
drivers/scsi/pluto.h renamed from master/linux-2.5.1-pre2/drivers/scsi/pluto.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/pluto.h linux/drivers/scsi/pluto.h
@@ -53,7 +53,6 @@
 	sg_tablesize:		1,				\
 	cmd_per_lun:		1,				\
 	use_clustering:		ENABLE_CLUSTERING,		\
-	use_new_eh_code:	FCP_SCSI_USE_NEW_EH_CODE,	\
 	abort:			fcp_old_abort,			\
 	eh_abort_handler:	fcp_scsi_abort,			\
 	eh_device_reset_handler:fcp_scsi_dev_reset,		\
drivers/scsi/ppa.h renamed from master/linux-2.5.1-pre2/drivers/scsi/ppa.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/ppa.h linux/drivers/scsi/ppa.h
@@ -183,7 +183,6 @@
 		eh_device_reset_handler:	NULL,			\
 		eh_bus_reset_handler:		ppa_reset,		\
 		eh_host_reset_handler:		ppa_reset,		\
-		use_new_eh_code:		1,			\
 		bios_param:			ppa_biosparam,		\
 		this_id:			-1,			\
 		sg_tablesize:			SG_ALL,			\
drivers/scsi/qla1280.h renamed from master/linux-2.5.1-pre2/drivers/scsi/qla1280.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/qla1280.h linux/drivers/scsi/qla1280.h
@@ -1726,7 +1726,6 @@
 	present: 0,		/* number of 7xxx's present   */\
 	unchecked_isa_dma: 0,	/* no memory DMA restrictions */\
 	use_clustering: ENABLE_CLUSTERING,			\
-	use_new_eh_code: 0,					\
 	emulated: 0					        \
 }
 #endif
drivers/scsi/qlogicfc.c renamed from master/linux-2.5.1-pre2/drivers/scsi/qlogicfc.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/qlogicfc.c linux/drivers/scsi/qlogicfc.c
@@ -734,7 +734,6 @@
  			scsi_set_pci_device(host, pdev);
 			host->max_id = QLOGICFC_MAX_ID + 1;
 			host->max_lun = QLOGICFC_MAX_LUN;
-			host->hostt->use_new_eh_code = 1;
 			hostdata = (struct isp2x00_hostdata *) host->hostdata;
 
 			memset(hostdata, 0, sizeof(struct isp2x00_hostdata));
drivers/scsi/qlogicpti.h renamed from master/linux-2.5.1-pre2/drivers/scsi/qlogicpti.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/qlogicpti.h linux/drivers/scsi/qlogicpti.h
@@ -524,7 +524,6 @@
 	sg_tablesize:	QLOGICPTI_MAX_SG(QLOGICPTI_REQ_QUEUE_LEN), \
 	cmd_per_lun:	1,					   \
 	use_clustering:	ENABLE_CLUSTERING,			   \
-	use_new_eh_code: 0					   \
 }
 
 /* For our interrupt engine. */
drivers/scsi/scsi.c renamed from master/linux-2.5.1-pre2/drivers/scsi/scsi.c +24 -71

144 lines not on this page · raw message

drivers/scsi/scsi.h renamed from master/linux-2.5.1-pre2/drivers/scsi/scsi.h +0 -6
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/scsi.h linux/drivers/scsi/scsi.h
@@ -387,12 +387,6 @@
 #define SYNC_RESET      0x40
 
 /*
- * This is the crap from the old error handling code.  We have it in a special
- * place so that we can more easily delete it later on.
- */
-#include "scsi_obsolete.h"
-
-/*
  * Add some typedefs so that we can prototyope a bunch of the functions.
  */
 typedef struct scsi_device Scsi_Device;
drivers/scsi/scsi_debug.h renamed from master/linux-2.5.1-pre2/drivers/scsi/scsi_debug.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/scsi_debug.h linux/drivers/scsi/scsi_debug.h
@@ -37,6 +37,5 @@
 		    cmd_per_lun:       3,			\
 		    unchecked_isa_dma: 0,			\
 		    use_clustering:    ENABLE_CLUSTERING,	\
-		    use_new_eh_code:   1,			\
 }
 #endif
drivers/scsi/scsi_obsolete.c renamed from master/linux-2.5.1-pre2/drivers/scsi/scsi_obsolete.c +0 -1119

1,119 lines not on this page · raw message

drivers/scsi/scsi_obsolete.h renamed from master/linux-2.5.1-pre2/drivers/scsi/scsi_obsolete.h +0 -106

106 lines not on this page · raw message

drivers/scsi/scsi_syms.c renamed from master/linux-2.5.1-pre2/drivers/scsi/scsi_syms.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/scsi_syms.c linux/drivers/scsi/scsi_syms.c
@@ -54,7 +54,6 @@
 EXPORT_SYMBOL(scsi_release_command);
 EXPORT_SYMBOL(print_Scsi_Cmnd);
 EXPORT_SYMBOL(scsi_block_when_processing_errors);
-EXPORT_SYMBOL(scsi_mark_host_reset);
 EXPORT_SYMBOL(scsi_ioctl_send_command);
 #if defined(CONFIG_SCSI_LOGGING)	/* { */
 EXPORT_SYMBOL(scsi_logging_level);
drivers/scsi/sim710.h renamed from master/linux-2.5.1-pre2/drivers/scsi/sim710.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/sim710.h linux/drivers/scsi/sim710.h
@@ -38,7 +38,6 @@
 		      sg_tablesize:		128,		 	\
 		      cmd_per_lun:		1,		 	\
 		      use_clustering:		DISABLE_CLUSTERING,	\
-		      use_new_eh_code:		1}
 
 #ifndef HOSTS_C
 
drivers/scsi/sym53c8xx_2/sym53c8xx.h renamed from master/linux-2.5.1-pre2/drivers/scsi/sym53c8xx_2/sym53c8xx.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/sym53c8xx_2/sym53c8xx.h linux/drivers/scsi/sym53c8xx_2/sym53c8xx.h
@@ -109,7 +109,6 @@
 	release:		sym53c8xx_release,			\
 	info:			sym53c8xx_info, 			\
 	queuecommand:		sym53c8xx_queue_command,		\
-	use_new_eh_code:	1,					\
 	eh_abort_handler:	sym53c8xx_eh_abort_handler,		\
 	eh_device_reset_handler:sym53c8xx_eh_device_reset_handler,	\
 	eh_bus_reset_handler:	sym53c8xx_eh_bus_reset_handler,		\
drivers/scsi/u14-34f.h renamed from master/linux-2.5.1-pre2/drivers/scsi/u14-34f.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/u14-34f.h linux/drivers/scsi/u14-34f.h
@@ -30,7 +30,6 @@
                 this_id:                 7,                                  \
                 unchecked_isa_dma:       1,                                  \
                 use_clustering:          ENABLE_CLUSTERING,                  \
-                use_new_eh_code:         1    /* Enable new error code */    \
                 }
 
 #endif
drivers/scsi/wd7000.h renamed from master/linux-2.5.1-pre2/drivers/scsi/wd7000.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/scsi/wd7000.h linux/drivers/scsi/wd7000.h
@@ -57,6 +57,5 @@
 	cmd_per_lun:		1,				\
 	unchecked_isa_dma:	1,				\
 	use_clustering:		ENABLE_CLUSTERING,		\
-	use_new_eh_code:	0				\
 }
 #endif
drivers/usb/hpusbscsi.h renamed from master/linux-2.5.1-pre2/drivers/usb/hpusbscsi.h +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/usb/hpusbscsi.h linux/drivers/usb/hpusbscsi.h
@@ -73,7 +73,6 @@
 	present:		0,
 	unchecked_isa_dma:	FALSE,
 	use_clustering:		TRUE,
-	use_new_eh_code:	TRUE,
 	emulated:		TRUE
 };
 
drivers/usb/microtek.c renamed from master/linux-2.5.1-pre2/drivers/usb/microtek.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/usb/microtek.c linux/drivers/usb/microtek.c
@@ -760,7 +760,6 @@
 	present:		0,
 	unchecked_isa_dma:	FALSE,
 	use_clustering:		TRUE,
-	use_new_eh_code:	TRUE,
 	emulated:		TRUE
 };
 
drivers/usb/storage/scsiglue.c renamed from master/linux-2.5.1-pre2/drivers/usb/storage/scsiglue.c +0 -1
diff -uNr -Xdontdiff ../master/linux-2.5.1-pre2/drivers/usb/storage/scsiglue.c linux/drivers/usb/storage/scsiglue.c
@@ -388,7 +388,6 @@
 	present:		0,
 	unchecked_isa_dma:	FALSE,
 	use_clustering:		TRUE,
-	use_new_eh_code:	TRUE,
 	emulated:		TRUE
 };
 
#27 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig
Quoted 3 lines
Quoted 3 lines

While we are at breaking scsi, would you take a patch to remove the old-style (2.0) scsi error handling completly, forcing drivers still using it to be fixed? Early 2.5 looks like a good time for that to me..

drivers/scsi/aic7xxx_old/aic7xxx.h line 60

Quoted 7 lines
drivers/scsi/aic7xxx_old/aic7xxx.h renamed from master/linux-2.5.1-pre2/drivers/scsi/aic7xxx_old/aic7xxx.h +0 -1
@@ -55,7 +55,6 @@
 	present: 0,		/* number of 7xxx's present   */\
 	unchecked_isa_dma: 0,	/* no memory DMA restrictions */\
 	use_clustering: ENABLE_CLUSTERING,			\
-	use_new_eh_code: 0					\
 }
 
 extern int aic7xxx_queue(Scsi_Cmnd *, void (*)(Scsi_Cmnd *));

What would be nice in the case of drivers that don't use the new error handling code is to add something like:

#warning "Uses obsolete SCSI error code, see Documentation/2.5/scsi-error.txt"

for a hint as to the reason why it no longer compiles, and a short guide on how to update the drivers.

The same would be good for Jens' changes - his document could be put into 2.5/bio.txt or something, so any currently out-of-kernel coders can find it.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

#28 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Andreas Dilger

What would be nice in the case of drivers that don't use the new error handling code is to add something like:

#warning "Uses obsolete SCSI error code, see Documentation/2.5/scsi-error.txt"

for a hint as to the reason why it no longer compiles, and a short guide on how to update the drivers.

I already thought about that - as the old error handling code is selected by setting a member in a struct to '1' I don't see any easy way to do so...

Christoph

Signature · 1 line
Of course it doesn't work. We've performed a software upgrade.
#29 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Andreas Dilger

What would be nice in the case of drivers that don't use the new error handling code is to add something like:

#warning "Uses obsolete SCSI error code, see Documentation/2.5/scsi-error.txt"

Quoted 7 lines
Quoted 2 lines

for a hint as to the reason why it no longer compiles, and a short guide on how to update the drivers.

I already thought about that - as the old error handling code is selected by setting a member in a struct to '1' I don't see any easy way to do so...

Christoph

Please note that this selection is static with regard to the driver. It only happens in the initialization code for the driver! The #warning doesn't have to at the same place where the filed in the struct was.

#30 lore raw
In reply to Christoph Hellwig
Quoted 11 lines · Christoph Hellwig
Quoted 7 lines · Andreas Dilger

What would be nice in the case of drivers that don't use the new error handling code is to add something like:

#warning "Uses obsolete SCSI error code, see Documentation/2.5/scsi-error.txt"

for a hint as to the reason why it no longer compiles, and a short guide on how to update the drivers.

I already thought about that - as the old error handling code is selected by setting a member in a struct to '1' I don't see any easy way to do so...

I'm thinking about a compile-time #warning/#error, that at least tells an interested party where to start looking for how to fix this. It could be anywhere in the affected driver source file (preferrably at the top, so it is hit before the compiler exits because of too many other errors). It would just be a matter of cut-n-paste a single line into every file which previously used the old error-handling code.

I presume that the nature of this change will either cause compile errors anyways (because of missing struct definitions), or linker errors (because of missing functions). I think that having a #warning at compile time will at least avoid a whole bunch of "this driver doesn't compile, help me" emails, and may also help someone to actually update the driver rather than giving up because they have no idea where to begin looking for the fix.

Actually, what would also be nice is to include the kernel version where this change happened, so that interested parties could also see what changes where necessary to bring about this fix. In this case (removing the old error handling support), it probably doesn't help much, but in Jens' BIO changes it _would_ be very helpful to know when a major change was made so potential fixers can "follow along" with the changes rather than having to reverse-engineer it 50 releases from now (along with the 33 other major changes that have been made along the way). Even now, with the BIO + SCSI error handling changes there are a lot of SCSI drivers with problems and it won't be "obvious" how to fix them later on.

Cheers, Andreas

PS - are you sure the old error handling code was selected with a '1' and
not with a '0' for "use_new_eh_code"?
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

#31 lore raw
In reply to Linus Torvalds

Given that block is in the transition period, would you consider a schedule of when you are taking patchs ?

Regard,

Andre Hedrick
Linux Disk Certification Project Linux ATA Development

Quoted 33 lines · Linus Torvalds

In article <[email protected]>,

Quoted 2 lines · f5ibh <[email protected]> wrote:

I've the following error :

Yes.

The next-generation block-layer support is starting to be merged into the 2.5.x tree, and that breaks old drivers that haven't been updated to the new locking.

In particular, there used to be _one_ lock for the whole IO system ("io_request_lock"), and these days it's a per-block-queue lock.

In many cases the fix is as simple as just replacing the "io_request_lock" with "host->host_lock", but sometimes this is complicated by the need to pass the right data structures down far enough..

Many drivers have been converted (ie IDE, symbios, aic7xxx etc), but many more have not (especially older SCSI drivers, in your case it's the classic aha1542).

It will probably take some time until most drivers have been converted. Tested patches are more than welcome,

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#32 lore raw
In reply to f5ibh
Quoted 4 lines · Paul Mackerras

Is there a description of the new block layer and its interface to block device drivers somewhere? That would be helpful, since Ben Herrenschmidt and I are going to have to convert several powermac-specific drivers.

http://lse.sourceforge.net/io/bionotes.txt
(Writeup by Suparna on Jens' work and design issues, +5, insightful)

--
Daniel