Linux 2.5.19
Subsystems (5)
More VM/FS interaction updates from Andrew Morton. Block layer (and IDE) updates. USB and driverfs stuff (the driverfs thing is starting to slowly add flesh on its original promise).
In short, all over the map.
Linus
-----
Summary of changes from v2.5.18 to v2.5.19
============================================
<[email protected]>
o usb-storage
<[email protected]>
o small fixes for usb-uhci-hcd
<[email protected]>
o drivers/char/rio/rio_linux.c
Andrew Morton <[email protected]>
o enable direct-to-BIO readahead for ext3
o factor common code in page_alloc.c
o relax nr_to_write requirements
o ext3 set_page_dirty fix
o small fixes in buffer.c
o fix loop driver for large BIOs
o block_truncate_page fix
o mark swapout pages PageWriteback()
o direct-to-BIO writeback
o remove mem_map_t
o rename writeback_mapping to writepages
o move BH_JBD out of buffer_head.h
o generic_file_write() cleanup
o fix ext3 __FUNCTION__ warnings
o direct-to-BIO readahead
o move nr_active and nr_inactive into per-CPU page
o dirsync
o avoid sys_sync livelocks
<[email protected]>
o ia64: Don't assume out registers are preserved across call to
<[email protected]>
o TLB shootdown infrastructure in 2.5
Jens Axboe <[email protected]>
o block documentation updates
o a few ll_rw_blk exports missing
o block plugging reworked
o block plugging reworked/fixed
Brian Gerst <[email protected]>
o fix thermal_interrupt
o i386 mm init cleanup part 2
o i386 head.S cleanup
o i386 mm init cleanup part 1
Martin Dalecki <[email protected]>
o 2.5.18 IDE 71-75
o airo
o 2.5.18 QUEUE_EMPTY and the unpleasant friends.
<[email protected]>
o ehci split interrupt transactions
<[email protected]>
o ia64: Fix misc. merge errors and typos.
o ia64: Change local_irq_restore() to restore only psr.i, so that it
o ia64: Misc. fixes.
o ia64: Make pci_dma_supported() a platform-specific function.
o ia64: Various small fixes.
o ia64: Update pte macros for new pfn-based versions.
o ia64: Sync up with 2.5.17 tree.
o ia64: Sync up with 2.5.18.
<[email protected]>
o ia64: Force bitkeeper update.
o ia64: Rename McKinley to Itanium 2. Fix some compilation issues. Fix alignment
<[email protected]>
o ia64: Perfmon update.
<[email protected]>
o net/ipv4/ipconfig.c minor fix
<[email protected]>
o USB irda driver
o USB SL811HS host controller driver.
<[email protected]>
o Fix the handling of dentry on msdos_lookup() (1/4)
o Fix the utf8 option of vfat (again)
<[email protected]>
o 2.5.18: unnamed PCI bus resources
o 2.5.18 pci/setup-bus.c: incorrect BUG() calls
<[email protected]>
o Quota update
<[email protected]>
o Trivial compile fix to fs/binfmt_em86.c
o SRM cleanup for generic Alpha kernels
<[email protected]>
o Documentation in usb.c
James Simmons <[email protected]>
o Moved VESA framebuffer driver over to new fbdev api
o Moved VESA framebuffer over to new fbdev api
o More porting to new api.
o Forgot to include removal of using fbcon-cfb* for the new drivers ported over.
o A new new drivers. Also several bug fixes and a few drivers ported over to new fbdev api.
o Added in support for new drivers.
o More drivers ported over to new API.
o More drivers ported over to the new api. Also a bug fix in the software drawing image routine.
o More changes for new fbdev subsytem.
o Ported Voodoo3+ cards over to new api.
<[email protected]>
o kbuild: Figure out flags independently from pass
o ISDN/CAPI: Move methods from capi_driver to capi_ctr
o kbuild: Simplify rule for just building one subdir
o kbuild: Use consistently FORCE instead of dummy
o drivers/video/matrox/matroxfb_accel.c: Explicitly export symbols.
o ISDN/CAPI: Cleanup /proc/capi
o ISDN: CAPI: Remove unused capi_driver::driver_read_proc
o ISDN/CAPI: Have hardware driver alloc struct capi_drv
o ISDN/CAPI: Export callbacks for CAPI drivers directly
o ISDN/CAPI: Remove struct capi_driver
o kbuild: built-in and modules in one pass
o kbuild: Normal sources should not include <linux/compile.h>
o kbuild: Add EXTRA_TARGETS variable
o kbuild: Remove remaining O_TARGET in drivers/*/Makefile
o kbuild: Don't overwrite Rules.make's first_rule
o kbuild: beautify Makefile / Rules.make...
o kbuild: Group together descending/linking in drivers/*
o kbuild: Build targets locally
o kbuild: Provide correct 'make some/dir/file.[iso]'
o kbuild: Hand merge link order change form driverfs update.
<[email protected]>
o [2.4] [2.5] Fix PPPoATM crash on disconnection
<[email protected]>
o Additional comments for usb-storage
<[email protected]>
o usb-storage abort path cleanup
<[email protected]>
o Introduce struct bus_type for describing types of buses
o Device Model: do better cleanup on device removal
o deivce model: actually compile and use bus drivers
o PCI: define pci_bus_type and register it on startup
o driverfs: add and export driverfs_create_symlink for general kernel use
o device model: Create symlinks in bus's 'devices' dir for a device when its registered
o device model: Need to back up one more directory when creating the symlink between the bus's 'devices' dir and the device's physical dir.
o PCI: start to use common fields of struct device_driver more
o Beef up centralized driver mgmt:
Paul Mackerras <[email protected]>
o PPC32: trivial whitespace fix, from Rusty Russell
o PPC32: add definitions for fls(), pmd_free_tlb() and pte_free_tlb(),
o PPC32: Updates for PPC405 processors. A lot of stuff that was under
o PPC32: two warning fixes from Rusty Russell, plus fix the PPC603
o PPC32: remove some compile warnings in the CHRP and powermac boot
o PPC32: Use copy_siginfo_to_user to copy the siginfo stuff to
o PPC32: use the standard kernel min macro in a couple of places.
<[email protected]>
o swsusp: cleanup
Russell King <[email protected]>
o 2.5.18: Fix ramdisk
<[email protected]>
o trivial: no "error" on preempt_count notice
o set_cpus_allowed optimization
o documentation for the new scheduler
o preempt-safe net/ code
o real-time info in /proc/<pid>/stats
o Robert Love likes leather and chains
o O(1) count_active_tasks
<[email protected]>
o dcache.c spelling
o autofs_wqt_t for ppc64
o xconfig fix
o MAINTAINERS file addition: Al Viro
o ppc chrp/start.c warnings removal
o do_mounts warning removal
o vmscan.c tidy up
o CREDITS sort order
o semctl SUSv2 compliance
o ppc spinlock warning removal
o Alpha macro standardize
o jiffies.h includes asm/param.h
o exit path cleanup in drivers/cdrom/sonycd535.c
o irq.h comment fix
o check_region cleanup from drivers/char/ip2main.c
o DIE "Russel", DIE!
<[email protected]>
o consolidate errno definitions
o consolidate generic peices of the siginfo structures and associated stuff
o consolidate arch specific copy_siginfo_to_user
o consolidate do_signal
<[email protected]>
o Fix mmap cornercase with wrong return value for invalid "len".
o Merge Keith Whitwell's radeon ring-buffer updates
o More drm updates from Keith Whitwell
o Add missing thermal interrupt prototype.
o Remove re-use of "struct mm_struct" at execve() time.
o Allocate new mm_struct for execve() early, so that we have
o Fix IDE Makefile typo
o Kernel version 2.5.19
<[email protected]>
o PPC32: Numerous minor platform updates and cleanups.
o PPC32: Cleanup the i8259 code slightly. Allow for polling of interrupts again
o PPC32: In the bootwrapper/loader, rename setup_legacy to serial_fixups to
o PPC32: Forward-port the /proc/residual stuffs from 2.4. This is
<[email protected]>
o Clean out routines that were obsoleted by previous
o Teach RPC client to send pages rather than iovecs.
o RPC client receive deadlock removal on HIGHMEM systems
Quoted 13 lines · you
<[email protected]>
o kbuild: Figure out flags independently from pass
o ISDN/CAPI: Move methods fromcapi_drivertocapi_ctr
o kbuild: Simplify rule for just building one subdir
o kbuild: Use consistently FORCE instead of dummy
odrivers/video/matrox/matroxfb_accel.c: Explicitly export symbols.
o ISDN/CAPI: Cleanup/proc/capi
o ISDN: CAPI: Remove unusedcapi_driver::driver_read_proc
o ISDN/CAPI: Have hardware driver alloc structcapi_drv
o ISDN/CAPI: Export callbacks for CAPI drivers directly
o ISDN/CAPI: Remove structcapi_driver
o kbuild: built-in and modules in one pass
o kbuild: Normal sources should not include <linux/compile.h>
Quoted 8 lines
o kbuild: Add
EXTRA_TARGETSvariable
o kbuild: Remove remainingO_TARGETindrivers/*/Makefile
o kbuild: Don't overwrite Rules.make'sfirst_rule
o kbuild: beautifyMakefile/ Rules.make...
o kbuild: Group together descending/linking indrivers/*
o kbuild: Build targets locally
o kbuild: Provide correct 'make some/dir/file.[iso]'
o kbuild: Hand merge link order change form driverfs update.
Are these purely patches to kbuild 1 or are they the beginning of a gradual migration to kbuild 2?
Signature · 2 lines
Jason Lunz Reflex Security [email protected] http://www.reflexsecurity.com/
The following change appeared in 2.5.19:
xx- a/drivers/video/cyber2000fb.c Wed May 29 11:43:02 2002
xx+ b/drivers/video/cyber2000fb.c Wed May 29 11:43:02 2002
@@ -1729,9 +1729,8 @@
}
static struct pci_device_id cyberpro_pci_table[] __devinitdata = {
-// Not yet
-// { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
-// PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 },
+ { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 },
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 },
{ PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010,This is completely wrong - the driver has been tested NOT to work on the Integraphics 1682. As such, please do uncomment these lines.
In addition, I'm disappointed that no one forwarded the patch for maintainer approval PRIOR to submitting it to Linus.
Linus, I request that you apply the following patch. Thanks.
drivers/video/cyber2000fb.c +3 -2
@@ -1729,8 +1729,9 @@ }static struct pci_device_id cyberpro_pci_table[]__devinitdata = { - {PCI_VENDOR_ID_INTERG ,PCI_DEVICE_ID_INTERG_1682 , -PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,ID_IGA_1682 }, +// Not yet +// { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, +// PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 }, {PCI_VENDOR_ID_INTERG ,PCI_DEVICE_ID_INTERG_2000 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,ID_CYBERPRO_2000 }, {PCI_VENDOR_ID_INTERG ,PCI_DEVICE_ID_INTERG_2010 ,
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Quoted 3 lines
This is completely wrong - the driver has been tested NOT to work on the Integraphics 1682. As such, please do uncomment these lines.
Due to a error with merging some stuff from a older DJ tree. I fixed it in the fbdev BK repository.
Quoted 2 lines
In addition, I'm disappointed that no one forwarded the patch for maintainer approval PRIOR to submitting it to Linus.
I'm even more disappointed that some people DONT test my patches especially when I announce them and usually wait about 5 days before pushing them to Linus. Some of the changes I have done have been sitting around for months in the DJ tree. The good news is that people can now look at skeletonfb.c to see how to port the fbdev drivers to the new api. Of course I have a feeling most will not bother so I will have to do it for them.
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Quoted 5 lines · James Simmons
Quoted 2 lines
This is completely wrong - the driver has been tested NOT to work on the Integraphics 1682. As such, please do uncomment these lines.
Due to a error with merging some stuff from a older DJ tree. I fixed it in the fbdev BK repository.
They haven't *been* in any DJ tree.
Quoted 9 lines
Quoted 2 lines
In addition, I'm disappointed that no one forwarded the patch for maintainer approval PRIOR to submitting it to Linus.
I'm even more disappointed that some people DONT test my patches especially when I announce them and usually wait about 5 days before pushing them to Linus. Some of the changes I have done have been sitting around for months in the DJ tree. The good news is that people can now look at
skeletonfb.cto see how to port the fbdev drivers to the new api. Of course I have a feeling most will not bother so I will have to do it for them.
Why the fuck should I go around finding and testing peoples trees when I haven't submitted the stuff to them? *YOU* shouldn't go around randomly pulling stuff from maintainers trees without first asking them why the change hasn't been submitted.
I'm not talking about general maintainence of the cyber2000fb driver here, or general "keep it working" type changes. I'm talking about a blatent "take the version from the rmk patch and submit it to Linus without telling the maintainer of the code you're buggering with" attitude here.
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Quoted 5 lines
Quoted 3 lines
Due to a error with merging some stuff from a older DJ tree. I fixed it in the fbdev BK repository.
They haven't *been* in any DJ tree.
Looking threw the many patches I have from people I did grab it from
patch-2.5.15-rmk1. It is right above the fbcmap.c fix which I did need. That is where I go it from. Thank you for that fix.
While grabbing that fix I noticed what a appeared to be a simple two
line fix for the cyber2000fb driver. Actually I was tempted to port the whole driver over to the new api but I didn't because I feared you be ticked off. Especially since I don't have the hardware. The only drivers I have ported over are the ones that are really simple. I touched the anakin driver because of this reason. The complex one where I don't have the hardware I don't touch. Now that we have enough functionally drivers people can see the new changes needed to be done.
Quoted 2 lines
Why the fuck should I go around finding and testing peoples trees when I haven't submitted the stuff to them?
Look here. I'm not looking for trouble or to upset anyone. I know alot
of the fbdev driver maintainers are too busy to properly maintain the drivers. Several have told me this. Or the drivers have been abandon. Plus the docs have been shotty for porting to the new api. I am willing to do extra work and port these drivers to save the maintainers time. I'm not going to do a perfect port but I do hope what work I did do will help them out.
I do admit and apologize for not properly saying which drivers have
been altered. I will make a special note of doing that in the future. Especially since very few actually look at my patches.
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Quoted 4 lines · James Simmons
I do admit and apologize for not properly saying which drivers have
been altered. I will make a special note of doing that in the future. Especially since very few actually look at my patches.
Plese don't take silent aprobation for "don't look" :-). I *like* the patches you do... well just my 0.02EUR.
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Quoted 2 lines · Martin Dalecki
Plese don't take silent aprobation for "don't look" :-). I *like* the patches you do... well just my 0.02EUR.
This is about people who think they're god nicking patches from the author and maintainer of drivers and bypassing the maintainer completely.
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Framebuffer policy [ was Re: Linux 2.5.19]
Quoted 4 lines
This is about people who think they're god nicking patches from the author and maintainer of drivers and bypassing the maintainer completely.
Please no fighting. It is clear the problem is the lack of order here. I understand how Russell feels. Most of the time people send in new fbdev drivers or good size patches without consulting me or Geert first. I have to say it has gotten better. So here goes for policy time:
--------------------------------------------------------------------
Framebuffer driver policy.
1) Basic one or few line fixes for drivers can go straight into the kernel. Please don't abuse this.
2) All new drivers must be posted to the fbdev developement list for peer review. Me and/or geert have final fword about them going in. Please note we do get busy so just harass me about your driver. I will not be offended and it pushs me to go do it. I'm the type of person if I don't do it right away I will forget.
3) Large changes should be posted to both the framebuffer list and the kernel mailing list as well to the framebuffer author if they are know. Again it is for peer review and wide scale testing. We need to make clear what drivers where effect. And yes if you are the maintainer of a driver you should mail yourself. It makes it easier for users to reply to you directly.
If no one follows these rules then their changes will be ignored. No exceptions including for myself.
-----------------------------------------------------------------
How does this sound? Again sorry about the confusion.
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Quoted 4 lines · Russell King
I'm not talking about general maintainence of the cyber2000fb driver here, or general "keep it working" type changes. I'm talking about a blatent "take the version from the rmk patch and submit it to Linus without telling the maintainer of the code you're buggering with" attitude here.
Dear Russell why don't you just abuse Linus as a spinlock for this kind of synchronization its his job. No need to get angry at this. Hey it's developement series time...
Quoted 3 lines · Martin Dalecki
Dear Russell why don't you just abuse Linus as a spinlock for this kind of synchronization its his job. No need to get angry at this. Hey it's developement series time...
The fundamental point I'm making is people shouldn't go around taking changes randomly from maintainers trees, and believing that they know far better than the maintainer what they're doing, especially when they don't have the hardware to even try it out, and go submitting these changes to Linus without even asking about it first... after the maintainer has been very careful and explicitly not submitted the change because they have very good reasons not to.
What if I were to take, say, Mochel's experimental tree and send some random alpha code to Linus? Let anarchy rule!
Signature · 2 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html
Quoted 2 lines · Russell King
What if I were to take, say, Mochel's experimental tree and send some random alpha code to Linus? Let anarchy rule!
Well ... they have once excuse... if the maintainer is himself a bit slow on submitting to Linus. Yes I know that's a matter primary of personal style so there is no need to discuss about it until down...
About the anarchy - are you sure a Kozaks blood like me couldn't life up with it ruling? :-).
Quoted 4 lines · Martin Dalecki
Well ... they have once excuse... if the maintainer is himself a bit slow on submitting to Linus. Yes I know that's a matter primary of personal style so there is no need to discuss about it until down...
You still don't get the point.
1. Patches from cyber2000fb.c have been submitted and the driver in Linus' tree up to 2.5.18 is completely up to date and functional, with zero known problems.
2. Someone comes along, scans my patch and finds a change.
3. This person takes it upon themselves to solely take that change, and, without querying the person who put out the patch set, or the maintainer of the driver, decides to send it to Linus without testing it in any way since they don't have the hardware to test it.
4. Maintainer, naturally, gets really pissed off.
If you think this is acceptable, why the hell did I bother sending those IDE DMA changes through you? After all, you don't need to know about them because I know better than you, don't I? *That's* what you're advocating here, and I'm sure you're going to object to that.
Signature · 8 lines
Russell King ([email protected]) The developer of ARM Linux http://www.arm.linux.org.uk/personal/aboutme.html _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Quoted 4 lines · Russell King
If you think this is acceptable, why the hell did I bother sending those IDE DMA changes through you? After all, you don't need to know about them because I know better than you, don't I? *That's* what you're advocating here, and I'm sure you're going to object to that.
Well just to make my point clear. I trust you and I thing that you indeed know better then me on ARM stuff. (At least you can run it on more then my tinny PSION 5mx... where I still didn't revert to the original OS, quite cute this little thing under linux :-). But I wouldn't have minded it at all if you had just sendid the ARM adjustments directly to Linus!
In the particular case we had it was however good to
have some direct communication in front
just to resolve the API issues. OK?
PATCH 1/1 Missing include in drivers/base/bus.c and drivers/pci/pci-driver.c
In reply to Linus Torvaldsdrivers/base/bus.c and drivers/pci/pci-driver.c both have functions which are marked with __init, but didn't include <linux/init.h> directly. The following fixes that (and allows 2.5.19 to compile on PPC32).
Signature · 25 lines
Tom Rini (TR1265) http://gate.crashing.org/~trini/ ===== drivers/base/bus.c 1.4 vs edited ===== --- 1.4/drivers/base/bus.c Tue May 28 11:35:01 2002 +++ edited/drivers/base/bus.c Wed May 29 13:30:05 2002 @@ -13,6 +13,7 @@ #include <linux/module.h> #include <linux/errno.h> #include <linux/stat.h> +#include <linux/init.h> #include "base.h" static LIST_HEAD(bus_driver_list); ===== drivers/pci/pci-driver.c 1.5 vs edited ===== --- 1.5/drivers/pci/pci-driver.c Tue May 28 18:02:33 2002 +++ edited/drivers/pci/pci-driver.c Wed May 29 13:32:06 2002 @@ -5,6 +5,7 @@ #include <linux/pci.h> #include <linux/module.h> +#include <linux/init.h> /* * Registration of PCI drivers and handling of hot-pluggable devices.
Quoted 31 lines · Russell King
The following change appeared in 2.5.19:
xx-
a/drivers/video/cyber2000fb.cWed May 29 11:43:02 2002
xx+b/drivers/video/cyber2000fb.cWed May 29 11:43:02 2002(quoted diff) +2
-3@@ -1729,9 +1729,8 @@ } static struct pci_device_id cyberpro_pci_table[] __devinitdata = { -// Not yet -// { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, -// PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 }, + { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 }, { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_CYBERPRO_2000 }, { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010,This is completely wrong - the driver has been tested NOT to work on the Integraphics 1682. As such, please do uncomment these lines.
In addition, I'm disappointed that no one forwarded the patch for maintainer approval PRIOR to submitting it to Linus.
Linus, I request that you apply the following patch. Thanks.
drivers/video/cyber2000fb.c +0
-0@@ -1729,8 +1729,9 @@ }
drivers/video/cyber2000fb.c line 1737
Quoted 10 lines
drivers/video/cyber2000fb.c +3
-2static struct pci_device_id cyberpro_pci_table[]__devinitdata = { - {PCI_VENDOR_ID_INTERG ,PCI_DEVICE_ID_INTERG_1682 , -PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,ID_IGA_1682 }, +// Not yet +// { PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_1682, +// PCI_ANY_ID, PCI_ANY_ID, 0, 0, ID_IGA_1682 }, {PCI_VENDOR_ID_INTERG ,PCI_DEVICE_ID_INTERG_2000 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,ID_CYBERPRO_2000 }, {PCI_VENDOR_ID_INTERG ,PCI_DEVICE_ID_INTERG_2010 ,
How about s/Not yet/This driver has been tested NOT to work on the Integraphics 1682. Do not enable with out contacting the maintainer./ instead? That might avoid the problem recurring...
Just a thought, ignore if you wish.
Eli
--------------------. "If it ain't broke now,
Eli Carter \ it will be soon." -- crypto-gram
eli.carter(a)inet.com `-------------------------------------------------
Hello. The following fixes compilation with CONFIG_BLK_DEV_RAM=y I assume that Rusty intended to use a test for CONFIG_BLK_DEV_RAM and not BLOCK_DEV_RAM.
Signature · 15 lines
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
===== init/do_mounts.c 1.16 vs edited =====
--- 1.16/init/do_mounts.c Mon May 27 05:07:34 2002
+++ edited/init/do_mounts.c Wed May 29 15:22:38 2002
@@ -365,7 +365,7 @@
return sys_symlink(path + n + 5, name);
}
-#if defined(BLOCK_DEV_RAM) || defined(CONFIG_BLK_DEV_FD)
+#if defined(CONFIG_BLK_DEV_RAM) || defined(CONFIG_BLK_DEV_FD)
static void __init change_floppy(char *fmt, ...)
{
struct termios termios;In message <[email protected]> you write:
Quoted 3 lines
Hello. The following fixes compilation with
CONFIG_BLK_DEV_RAM=yI assume that Rusty intended to use a test forCONFIG_BLK_DEV_RAMand notBLOCK_DEV_RAM.
Oops.... Damn you, Peter Chubb!
Thanks,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
On Wed, 29 May 2002, Linus Torvalds wrote:
Summary of changes from v2.5.18 to v2.5.19
Quoted 4 lines
============================================
<[email protected]>
o usb-storage
[...]
Linus,
is there any particular reason why you have not yet updated to my lk-changelog.pl script or ever replied to any of my mails on that subject?
I am constantly updating it to have it resolve most addresses to names, fixing bugs, and it seems people are all in favor of my script, but still it looks as though some very early version was used to generate this summary which knows hardly half of the common mail addresses.
I'm not adding the script again, it has been posted less than 24 hours ago (in response to Marcelo's 2.4.19-pre9 announcement), if you need it, find it at http://mandree.home.pages.de/linux/kernel/ or drop me a line -- the current version is v0.21.
Thanks for your attention.
Matthias
Quoted 4 lines · On 2002.05.29 Linus Torvalds wrote:
Summary of changes from v2.5.18 to v2.5.19
============================================
[...]
Quoted 1 line
o Robert Love likes leather and chains
this is funny...
Signature · 4 lines
J.A. Magallon # Let the source be with you... mailto:[email protected] Mandrake Linux release 8.3 (Cooker) for i586 Linux werewolf 2.4.19-pre9-jam1 #1 SMP mié may 29 02:20:48 CEST 2002 i686
PATCH 1/1 2.5.19 blk.h and more about the ugly kids.
In reply to Linus Torvalds- Remove DEVICE_INTR and associated code from floppy driver.
- Savlage s390 xpram code from kernel version dependant compilation disease.
- Eliminate SET_INTR code from the places where it was used.
- Eliminate bogous support for multiple sbpcd controllers. The driver didn't even compile right now before we could think about further supporting it at all we have to get rid of this hack first.
Don't call invalidate_buffers in the release method there.
Why should it be necessary?
- Resurrect sonycd535 compilation.
- Let CURRENT request macro use the same primitive at the remaining QUEUE macro in blk.h, which is still not quite right, but first things first :-).
drivers/acorn/block/mfmhd.c +8 -8
@@ -570,7 +570,7 @@DBG ("mfm_rw_intr: returned from cont->done\n" ); }else {/* Its going to generate another interrupt */ -SET_INTR (mfm_rw_intr); +DEVICE_INTR = mfm_rw_intr; }; }
@@ -578,7 +578,7 @@ {DBG ("setting up for rw...\n" ); -SET_INTR (mfm_rw_intr); +DEVICE_INTR = mfm_rw_intr;issue_command (raw_cmd.cmdcode, raw_cmd.cmddata, raw_cmd.cmdlen); }
@@ -608,7 +608,7 @@/* Command end without seek end (see data sheet p.20) for parallel seek - we have to send a POL command to wait for the seek */ if (mfm_status &STAT_CED ) { -SET_INTR (mfm_recal_intr); +DEVICE_INTR = mfm_recal_intr;issue_command (CMD_POL ,NULL ,0 );return ; }
@@ -638,7 +638,7 @@return ; }if (mfm_status &STAT_CED ) { -SET_INTR (mfm_seek_intr); +DEVICE_INTR = mfm_seek_intr;issue_command (CMD_POL ,NULL ,0 );return ; }
@@ -696,7 +696,7 @@DBG ("seeking...\n" );if (MFM_DRV_INFO .cylinder <0 ) { -SET_INTR (mfm_recal_intr); +DEVICE_INTR = mfm_recal_intr;DBG ("mfm_seek: about to call specify\n" );mfm_specify ();/* DAG added this */
@@ -712,7 +712,7 @@ cmdb[2 ] = raw_cmd.cylinder >>8 ; cmdb[3 ] = raw_cmd.cylinder; -SET_INTR (mfm_seek_intr); +DEVICE_INTR = mfm_seek_intr;issue_command (CMD_SEK , cmdb,4 ); }else mfm_setup_rw ();
@@ -907,7 +907,7 @@if (blk_queue_empty (QUEUE )) {printk ("mfm_request: Exiting due to empty queue (pre)\n" ); -CLEAR_INTR ; +DEVICE_INTR =NULL ; Busy =0 ;return ; }
@@ -971,7 +971,7 @@ {void (*handler) (void ) =DEVICE_INTR ; -CLEAR_INTR ; +DEVICE_INTR =NULL ;DBG ("mfm_interrupt_handler (handler=0x%p)\n" , handler);
drivers/block/acsi.c +3 -3
@@ -1041,7 +1041,7 @@ } CurrentBuffer = buffer; CurrentNSect = nsect; - +if (CURRENT ->cmd ==WRITE ) {CMDSET_TARG_LUN ( write_cmd, target, lun );CMDSET_BLOCK ( write_cmd, block );
@@ -1049,7 +1049,7 @@if (buffer == acsi_buffer)copy_to_acsibuffer ();dma_cache_maintenance ( pbuffer, nsect*512 ,1 ); -SET_INTR (write_intr); +DEVICE_INTR = write_intr;if (!acsicmd_dma ( write_cmd, buffer, nsect,1 ,1 )) {CLEAR_INTR ;printk (KERN_ERR "ACSI (write): Timeout in command block\n" );
@@ -1063,7 +1063,7 @@CMDSET_TARG_LUN ( read_cmd, target, lun );CMDSET_BLOCK ( read_cmd, block );CMDSET_LEN ( read_cmd, nsect ); -SET_INTR (read_intr); +DEVICE_INTR = read_intr;if (!acsicmd_dma ( read_cmd, buffer, nsect,0 ,1 )) {CLEAR_INTR ;printk (KERN_ERR "ACSI (read): Timeout in command block\n" );
drivers/block/floppy.c +17 -15
@@ -633,6 +633,8 @@ }#endif +static void (*do_floppy)(void ) =NULL ; +#ifdef FLOPPY_SANITY_CHECK #define OLOGSIZE 20
@@ -920,9 +922,9 @@if (!fdc_busy)DPRINT ("FDC access conflict!\n" ); -if (DEVICE_INTR ) +if (do_floppy)DPRINT ("device interrupt still active at FDC release: %p!\n" , -DEVICE_INTR ); + do_floppy); command_status =FD_COMMAND_NONE ;del_timer (&fd_timeout); cont =NULL ;
@@ -1005,7 +1007,7 @@static void cancel_activity (void ) { -CLEAR_INTR ; + do_floppy =NULL ; floppy_tq.routine = (void *)(void *) empty;del_timer (&fd_timer); }
@@ -1524,7 +1526,7 @@setup_DMA ();if (flags &FD_RAW_INTR ) -SET_INTR (main_command_interrupt); + do_floppy = main_command_interrupt; r=0 ;for (i=0 ; i< raw_cmd->cmd_count; i++)
@@ -1656,7 +1658,7 @@ } } -SET_INTR (seek_interrupt); + do_floppy = seek_interrupt;output_byte (FD_SEEK );output_byte (UNIT (current_drive));LAST_OUT (track);
@@ -1736,7 +1738,7 @@/* interrupt handler. Note that this can be called externally on the Sparc */ void floppy_interrupt (int irq,void *dev_id,struct pt_regs * regs) { -void (*handler)(void ) =DEVICE_INTR ; +void (*handler)(void ) = do_floppy;int do_print;unsigned long f;
@@ -1746,9 +1748,9 @@ f=claim_dma_lock ();fd_disable_dma ();release_dma_lock (f); - +floppy_enable_hlt (); -CLEAR_INTR ; + do_floppy =NULL ;if (fdc >=N_FDC ||FDCS ->address ==-1 ){/* we don't even know which FDC is the culprit */ printk ("DOR0=%x\n" , fdc_state[0 ].dor);
@@ -1795,7 +1797,7 @@#ifdef DEBUGT debugt ("recalibrate floppy:" );#endif -SET_INTR (recal_interrupt); + do_floppy = recal_interrupt;output_byte (FD_RECALIBRATE );LAST_OUT (UNIT (current_drive)); }
@@ -1823,14 +1825,14 @@static void reset_fdc (void ) {unsigned long flags; - -SET_INTR (reset_interrupt); + + do_floppy = reset_interrupt;FDCS ->reset =0 ;reset_fdc_info (0 );/* Pseudo-DMA may intercept 'reset finished' interrupt. */ /* Irrelevant for systems with true DMA (i386). */ - + flags=claim_dma_lock ();fd_disable_dma ();release_dma_lock (flags);
@@ -1873,8 +1875,8 @@printk ("status=%x\n" ,fd_inb (FD_STATUS ));printk ("fdc_busy=%lu\n" , fdc_busy); -if (DEVICE_INTR ) -printk ("DEVICE_INTR=%p\n" ,DEVICE_INTR ); +if (do_floppy) +printk ("do_floppy=%p\n" , do_floppy);if (floppy_tq.sync)printk ("floppy_tq.routine=%p\n" , floppy_tq.routine);if (timer_pending (&fd_timer))
@@ -2920,7 +2922,7 @@for (;;) {if (blk_queue_empty (QUEUE )) { -CLEAR_INTR ; + do_floppy =NULL ;unlock_fdc ();return ; }
drivers/cdrom/Config.help +0 -21
@@ -106,27 +106,6 @@ The module will be called sbpcd.o. If you want to compile it as a module, say M here and read <file:Documentation/modules.txt>. -CONFIG_SBPCD2 - Say Y here only if you have two CD-ROM controller cards of this type - (usually only if you have more than four drives). You should enter - the parameters for the second, third and fourth interface card into - <file:drivers/cdrom/sbpcd.h> before compiling the new kernel. Read - the file <file:Documentation/cdrom/sbpcd>. - -CONFIG_SBPCD3 - Say Y here only if you have three CD-ROM controller cards of this - type (usually only if you have more than six drives). You should - enter the parameters for the second, third and fourth interface card - into <file:include/linux/sbpcd.h> before compiling the new kernel. - Read the file <file:Documentation/cdrom/sbpcd>. - -CONFIG_SBPCD4 - Say Y here only if you have four CD-ROM controller cards of this - type (usually only if you have more than eight drives). You should - enter the parameters for the second, third and fourth interface card - into <file:include/linux/sbpcd.h> before compiling the new kernel. - Read the file <file:Documentation/cdrom/sbpcd>. - CONFIG_AZTCD This is your driver if you have an Aztech CDA268-01A, Orchid CD-3110, Okano or Wearnes CDD110, Conrad TXC, or CyCD-ROM CR520 or
drivers/cdrom/Config.in +0 -9
@@ -4,15 +4,6 @@ tristate ' Aztech/Orchid/Okano/Wearnes/TXC/CyDROM CDROM support' CONFIG_AZTCD tristate ' Goldstar R420 CDROM support' CONFIG_GSCD tristate ' Matsushita/Panasonic/Creative, Longshine, TEAC CDROM support' CONFIG_SBPCD -if [ "$CONFIG_SBPCD" = "y" ]; then - bool ' Matsushita/Panasonic, ... second CDROM controller support' CONFIG_SBPCD2 - if [ "$CONFIG_SBPCD2" = "y" ]; then - bool ' Matsushita/Panasonic, ... third CDROM controller support' CONFIG_SBPCD3 - if [ "$CONFIG_SBPCD3" = "y" ]; then - bool ' Matsushita/Panasonic, ... fourth CDROM controller support' CONFIG_SBPCD4 - fi - fi -fi tristate ' Mitsumi (standard) [no XA/Multisession] CDROM support' CONFIG_MCD if [ "$CONFIG_MCD" != "n" ]; then int 'MCD IRQ' CONFIG_MCD_IRQ 11
drivers/cdrom/gscd.c +1 -1
@@ -292,7 +292,7 @@ goto out;if (CURRENT ->cmd !=READ ) { -printk ("GSCD: bad cmd %d\n" ,CURRENT ->cmd); +printk ("GSCD: bad cmd %p\n" ,CURRENT ->cmd);end_request (0 ); goto repeat; }
drivers/cdrom/Makefile +0 -3
@@ -34,9 +34,6 @@ obj-$(CONFIG_MCDX) += mcdx.o cdrom.o obj-$(CONFIG_OPTCD) += optcd.o obj-$(CONFIG_SBPCD) += sbpcd.o cdrom.o -obj-$(CONFIG_SBPCD2) += sbpcd2.o cdrom.o -obj-$(CONFIG_SBPCD3) += sbpcd3.o cdrom.o -obj-$(CONFIG_SBPCD4) += sbpcd4.o cdrom.o obj-$(CONFIG_SJCD) += sjcd.o obj-$(CONFIG_CDU535) += sonycd535.o
drivers/cdrom/sbpcd2.c +0 -5
@@ -1,5 +0,0 @@ -/* -* duplication of sbpcd.c for multiple interfaces -*/ -#define SBPCD_ISSUE 2 -#include "sbpcd.c"
drivers/cdrom/sbpcd3.c +0 -5
@@ -1,5 +0,0 @@ -/* -* duplication of sbpcd.c for multiple interfaces -*/ -#define SBPCD_ISSUE 3 -#include "sbpcd.c"
drivers/cdrom/sbpcd4.c +0 -5
@@ -1,5 +0,0 @@ -/* -* duplication of sbpcd.c for multiple interfaces -*/ -#define SBPCD_ISSUE 4 -#include "sbpcd.c"
drivers/cdrom/sbpcd.c +50 -147
375 lines not on this page · raw message
drivers/cdrom/sbpcd.h +0 -20
@@ -74,30 +74,10 @@* Example: #define SOUND_BASE 0x220 enables the sound card's CD channels * #define SOUND_BASE 0 leaves the soundcard untouched */ -#if !(SBPCD_ISSUE -1 )/* first (or if you have only one) interface board: */ #define CDROM_PORT 0x340/* <-----------<< port address */ #define SBPRO 0/* <-----------<< interface type */ #define MAX_DRIVES 4/* set to 1 if the card does not use "drive select" */ #define SOUND_BASE 0x220/* <-----------<< sound address of this card or 0 */ -#endif -#if !(SBPCD_ISSUE -2 )/* ==================== second interface board: === */ -#define CDROM_PORT 0x344/* <-----------<< port address */ -#define SBPRO 0/* <-----------<< interface type */ -#define MAX_DRIVES 4/* set to 1 if the card does not use "drive select" */ -#define SOUND_BASE 0x000/* <-----------<< sound address of this card or 0 */ -#endif -#if !(SBPCD_ISSUE -3 )/* ===================== third interface board: === */ -#define CDROM_PORT 0x630/* <-----------<< port address */ -#define SBPRO 1/* <-----------<< interface type */ -#define MAX_DRIVES 4/* set to 1 if the card does not use "drive select" */ -#define SOUND_BASE 0x240/* <-----------<< sound address of this card or 0 */ -#endif -#if !(SBPCD_ISSUE -4 )/* ==================== fourth interface board: === */ -#define CDROM_PORT 0x634/* <-----------<< port address */ -#define SBPRO 0/* <-----------<< interface type */ -#define MAX_DRIVES 4/* set to 1 if the card does not use "drive select" */ -#define SOUND_BASE 0x000/* <-----------<< sound address of this card or 0 */ -#endif /* * some more or less user dependent definitions - service them!
drivers/cdrom/sonycd535.c +4 -4
@@ -118,6 +118,7 @@#include <linux/timer.h> #include <linux/fs.h> #include <linux/kernel.h> +#include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/hdreg.h> #include <linux/genhd.h>
@@ -134,7 +135,8 @@#include <linux/cdrom.h> #define MAJOR_NR CDU535_CDROM_MAJOR -# include <linux/blk.h> +#include <linux/blk.h> +#define sony535_cd_base_io sonycd535/* for compatible parameter passing with "insmod" */ #include "sonycd535.h"
@@ -1589,7 +1591,6 @@ &cdu_fops, NULL);if (devfs_register_blkdev (MAJOR_NR ,CDU535_HANDLE , &cdu_fops)) {printk ("Unable to get major %d for %s\n" , - devfs_unregister(sony_devfs_handle);MAJOR_NR ,CDU535_MESSAGE_NAME );return -EIO ; }
@@ -1663,8 +1664,7 @@devfs_unregister (sony_devfs_handle);if (sony535_irq_used)free_irq (sony535_irq_used,NULL ); - } - +return -EIO ; }register_disk (NULL ,mk_kdev (MAJOR_NR ,0 ),1 , &cdu_fops,0 );
drivers/ide/hd.c +6 -10
@@ -110,20 +110,16 @@static struct timer_list device_timer; -#define SET_TIMER \ +#define SET_TIMER \ do { \ mod_timer(&device_timer, jiffies + TIMEOUT_VALUE); \ } while (0) -#define CLEAR_TIMER del_timer(&device_timer); - -#undef SET_INTR - -#define SET_INTR (x) \ +#define SET_HANDLER (x) \ if ((DEVICE_INTR = (x)) != NULL) \ SET_TIMER; \ else \ - CLEAR_TIMER; + del_timer(&device_timer);#if (HD_DELAY >0 )
@@ -279,7 +275,7 @@ reset =1 ;return ; } -SET_INTR (intr_addr); +SET_HANDLER (intr_addr);outb_p (hd_info[drive].ctl,HD_CMD ); port=HD_DATA ;outb_p (hd_info[drive].wpcom>>2 ,++port);
@@ -429,7 +425,7 @@if (CURRENT ->current_nr_sectors <=0 )end_request (1 );if (i >0 ) { -SET_INTR (&read_intr); +SET_HANDLER (&read_intr);return ; } (void )inb_p (HD_STATUS );
@@ -467,7 +463,7 @@if (!i || (CURRENT ->bio && !SUBSECTOR (i)))end_request (1 );if (i >0 ) { -SET_INTR (&write_intr); +SET_HANDLER (&write_intr);outsw (HD_DATA ,CURRENT ->buffer,256 );sti (); }else {
drivers/s390/block/xpram.c +15 -119
290 lines not on this page · raw message
include/linux/blk.h +9 -31
@@ -125,7 +125,6 @@static void floppy_off (unsigned int nr);#define DEVICE_NAME "floppy" -#define DEVICE_INTR do_floppy#define DEVICE_NR (device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))#elif (MAJOR_NR ==HD_MAJOR )
@@ -149,14 +148,14 @@#elif (MAJOR_NR ==SCSI_TAPE_MAJOR )#define DEVICE_NAME "scsitape" -#define DEVICE_INTR do_st +#define DEVICE_INTR do_st#define DEVICE_NR (device) (minor(device) & 0x7f)#elif (MAJOR_NR ==OSST_MAJOR ) -#define DEVICE_NAME "onstream" +#define DEVICE_NAME "onstream"#define DEVICE_INTR do_osst -#define DEVICE_NR (device) (minor(device) & 0x7f) +#define DEVICE_NR (device) (minor(device) & 0x7f)#elif (MAJOR_NR ==SCSI_CDROM_MAJOR )
@@ -187,33 +186,16 @@#elif (MAJOR_NR ==MITSUMI_CDROM_MAJOR )#define DEVICE_NAME "Mitsumi CD-ROM" -/* #define DEVICE_INTR do_mcd */ #define DEVICE_NR (device) (minor(device))#elif (MAJOR_NR ==MITSUMI_X_CDROM_MAJOR )#define DEVICE_NAME "Mitsumi CD-ROM" -/* #define DEVICE_INTR do_mcdx */ #define DEVICE_NR (device) (minor(device))#elif (MAJOR_NR ==MATSUSHITA_CDROM_MAJOR ) -#define DEVICE_NAME "Matsushita CD-ROM controller #1" -#define DEVICE_NR (device) (minor(device)) - -#elif (MAJOR_NR ==MATSUSHITA_CDROM2_MAJOR ) - -#define DEVICE_NAME "Matsushita CD-ROM controller #2" -#define DEVICE_NR (device) (minor(device)) - -#elif (MAJOR_NR ==MATSUSHITA_CDROM3_MAJOR ) - -#define DEVICE_NAME "Matsushita CD-ROM controller #3" -#define DEVICE_NR (device) (minor(device)) - -#elif (MAJOR_NR ==MATSUSHITA_CDROM4_MAJOR ) - -#define DEVICE_NAME "Matsushita CD-ROM controller #4" +#define DEVICE_NAME "Matsushita CD-ROM controller"#define DEVICE_NR (device) (minor(device))#elif (MAJOR_NR ==AZTECH_CDROM_MAJOR )
@@ -292,27 +274,23 @@#if (MAJOR_NR !=SCSI_TAPE_MAJOR ) && (MAJOR_NR !=OSST_MAJOR )#if !defined(IDE_DRIVER ) -#ifndef CURRENT -# define CURRENT elv_next_request(&blk_dev[MAJOR_NR].request_queue) -#endif #ifndef QUEUE # define QUEUE (&blk_dev[MAJOR_NR].request_queue)#endif +#ifndef CURRENT +# define CURRENT elv_next_request(QUEUE) +#endif #ifndef DEVICE_NAME # define DEVICE_NAME "unknown"#endif #ifdef DEVICE_INTR static void (*DEVICE_INTR )(void ) =NULL ; -#endif - -#define SET_INTR (x) (DEVICE_INTR = (x)) - -# ifdef DEVICE_INTR -# define CLEAR_INTR SET_INTR(NULL) +# define CLEAR_INTR DEVICE_INTR = NULL# else # define CLEAR_INTR # endif +#endif /* !defined(IDE_DRIVER) */ /*
PATCH 1/1 2.5.19 IDE 76
In reply to Linus TorvaldsWed May 29 19:02:15 CEST 2002 ide-clean-76
- Since Bartek has released finally an entierly user space based setup monitoring utility, we can finally remove the nonfunctional PROC code from the host chip drivers. We have preserved it thus far only for documentation purposes.
- Use generic bus master DMA setup code. There is nothing wrong with it.
- Make the ide-scsi code actually just allow for one device id per scsi host, since we are registering a host per device right now. This prevents the repetitive device recognition. Well registering an SCSI host of every single disk out there isn't the proper thing to do. I will deal with that later after my visual perception recovers again from already looking too long at the SCSI code :-).
- Deal properly with host specific data mapping. (Could be that solves some problems with the driver, which where in reality kernel data corruptions.)
- Homogenize flag handling for ATAPI drivers.
PATCH 1/1 2.5.19 IDE 77
In reply to Linus TorvaldsFri May 31 13:45:52 CEST 2002 ide-clean-77
- Get rid of SELECT_DRIVE macro. Start to move all direct hardware access functions in to one place.
- Get rid of SELECT_MASK macro. Realize that the mask is always equal 0. Simplify the maskproc therefore.
- Get rid of GET_STAT and OK_STAT macros as well.
- hpt366 cleanups by Andrej Panin.
- Artop driver update by Franz Sirl.
arch/cris/drivers/ide.c +4 -5
@@ -688,17 +688,16 @@/* * etrax_dma_intr() is the handler for disk read/write DMA interrupts */ -static ide_startstop_t etrax_dma_intr (struct ata_device *drive,struct request *rq) +static ide_startstop_t etrax_dma_intr (struct ata_device *drive,struct request *rq) {int i, dma_stat; -byte stat;LED_DISK_READ (0 );LED_DISK_WRITE (0 ); dma_stat = drive->channel->udma (ide_dma_end, drive, rq); - stat =GET_STAT ();/* get drive status */ -if (OK_STAT (stat,DRIVE_READY ,drive->bad_wstat|DRQ_STAT )) { +/* get drive status */ +if (ata_status (drive,DRIVE_READY , drive->bad_wstat |DRQ_STAT )) {if (!dma_stat) {for (i = rq->nr_sectors; i >0 ;) { i -= rq->current_nr_sectors;
@@ -708,7 +707,7 @@ }printk ("%s: bad DMA status\n" , drive->name); } -return ide_error (drive,"dma_intr" , stat); +return ide_error (drive,"dma_intr" , drive->status); }/*
drivers/ide/aec62xx.c +15 -3
@@ -54,6 +54,12 @@#define AEC_IDE_ENABLE 0x4a#define AEC_UDMA_OLD 0x54 +#define AEC_BM_STAT_PCH 0x02 +#define AEC_BM_STAT_SCH 0x0a + +#define AEC_PLLCLK_ATA133 0x10 +#define AEC_CABLEPINS_INPUT 0x10 +static unsigned char aec_cyc2udma[17 ] = {0 ,0 ,7 ,6 ,5 ,4 ,4 ,3 ,3 ,2 ,2 ,2 ,2 ,1 ,1 ,1 ,1 };/*
@@ -146,6 +152,7 @@#ifdef CONFIG_BLK_DEV_IDEDMA static int aec62xx_dmaproc (struct ata_device *drive) { +u32 bmide =pci_resource_start (drive->channel->pci_dev,4 );short speed;int map;
@@ -155,7 +162,9 @@switch (drive->channel->pci_dev->device) {case PCI_DEVICE_ID_ARTOP_ATP865R :case PCI_DEVICE_ID_ARTOP_ATP865 : - map |=XFER_UDMA_100 |XFER_UDMA_133 ; +/* Can't use these modes simultaneously, +based on which PLL clock was chosen. */ + map |=inb (bmide +AEC_BM_STAT_PCH ) &AEC_PLLCLK_ATA133 ?XFER_UDMA_133 :XFER_UDMA_100 ;case PCI_DEVICE_ID_ARTOP_ATP860R :case PCI_DEVICE_ID_ARTOP_ATP860 : map |=XFER_UDMA_66 ;
@@ -172,10 +181,12 @@/* * The initialization callback. Here we determine the IDE chip type * and initialize its drive independent registers. +* We return the IRQ assigned to the chip. */ static unsigned int __init aec62xx_init_chipset (struct pci_dev *dev) { +u32 bmide =pci_resource_start (dev,4 );unsigned char t;/*
@@ -202,8 +213,9 @@/* Enable burst mode. */ pci_read_config_byte (dev,AEC_IDE_ENABLE , &t);pci_write_config_byte (dev,AEC_IDE_ENABLE , t |0x80 ); -#endif +/* switch cable detection pins to input-only. */ +outb (inb (bmide +AEC_BM_STAT_SCH ) |AEC_CABLEPINS_INPUT , bmide +AEC_BM_STAT_SCH ); }/*
@@ -214,7 +226,7 @@printk (KERN_INFO "AEC_IDE: %s (rev %02x) controller on pci%s\n" , dev->name, t, dev->slot_name); -return 0 ; +return dev->irq; }static unsigned int __init aec62xx_ata66_check (struct ata_channel *ch)
drivers/ide/device.c +95 -0
95 lines not on this page · raw message
drivers/ide/hpt366.c +49 -54
241 lines not on this page · raw message
drivers/ide/icside.c +6 -7
@@ -232,8 +232,9 @@* Handle routing of interrupts. This is called before * we write the command to the drive. */ -static void icside_maskproc (struct ata_device *drive,int mask) +static void icside_maskproc (struct ata_device *drive) { +const int mask =0 ;struct ata_channel *ch = drive->channel;struct icside_state *state = ch->hw.priv;unsigned long flags;
@@ -465,12 +466,9 @@static ide_startstop_t icside_dmaintr (struct ata_device *drive,struct request *rq) {int dma_stat; -byte stat; dma_stat =icside_dma_stop (drive); - - stat =GET_STAT ();/* get drive status */ -if (OK_STAT (stat,DRIVE_READY ,drive->bad_wstat|DRQ_STAT )) { +if (ata_status (drive,DRIVE_READY , drive->bad_wstat |DRQ_STAT )) {if (!dma_stat) {__ide_end_request (drive, rq,1 , rq->nr_sectors);return ide_stopped;
@@ -478,7 +476,7 @@printk ("%s: dma_intr: bad DMA status (dma_stat=%x)\n" , drive->name, dma_stat); } -return ide_error (drive, rq,"dma_intr" , stat); +return ide_error (drive, rq,"dma_intr" , drive->status); } static int
@@ -587,7 +585,8 @@static void icside_dma_timeout (struct ata_device *drive) {printk (KERN_ERR "ATA: %s: UDMA timeout occured:" , drive->name); -ide_dump_status (drive,NULL ,"UDMA timeout" ,GET_STAT ()); +ata_status (drive,0 ,0 ); +ide_dump_status (drive,NULL ,"UDMA timeout" , drive->status); }static void icside_irq_lost (struct ata_device *drive)
drivers/ide/ide.c +42 -40
231 lines not on this page · raw message
drivers/ide/ide-cd.c +15 -16
@@ -565,14 +565,14 @@static int cdrom_decode_status (ide_startstop_t *startstop,struct ata_device *drive,struct request *rq,int good_stat,int *stat_ret) { -int stat, err, sense_key; +int err, sense_key;struct packet_command *pc; +int ok;/* Check for errors. */ - stat =GET_STAT (); - *stat_ret = stat; - -if (OK_STAT (stat, good_stat,BAD_R_STAT )) + ok =ata_status (drive, good_stat,BAD_R_STAT ); + *stat_ret = drive->status; +if (ok)return 0 ;/* Get the IDE error register. */
@@ -594,7 +594,7 @@ pc = (struct packet_command *) rq->special; pc->stat =1 ;cdrom_end_request (drive, rq,1 ); - *startstop =ide_error (drive, rq,"request sense failure" , stat); + *startstop =ide_error (drive, rq,"request sense failure" , drive->status);return 1 ; }else if (rq->flags & (REQ_PC |REQ_BLOCK_PC )) {
@@ -614,7 +614,7 @@return 0 ; }else if (!pc->quiet) {/* Otherwise, print an error. */ -ide_dump_status (drive, rq,"packet command error" , stat); +ide_dump_status (drive, rq,"packet command error" , drive->status); }/* Set the error flag and complete the request.
@@ -625,7 +625,7 @@the semaphore from the packet command request to the request sense request. */ -if ((stat &ERR_STAT ) !=0 ) { +if (drive->status &ERR_STAT ) { wait = rq->waiting; rq->waiting =NULL ; }
@@ -637,7 +637,7 @@* Think hard about how to get rid of it... */ -if ((stat &ERR_STAT ) !=0 ) +if (drive->status &ERR_STAT )cdrom_queue_request_sense (drive, wait, pc->sense, pc); }else if (rq->flags &REQ_CMD ) {/* Handle errors from READ and WRITE requests. */
@@ -662,18 +662,18 @@ sense_key == DATA_PROTECT) {/* No point in retrying after an illegal request or data protect error.*/ -ide_dump_status (drive, rq,"command error" , stat); +ide_dump_status (drive, rq,"command error" , drive->status);cdrom_end_request (drive, rq,0 ); } else if (sense_key == MEDIUM_ERROR) {/* No point in re-trying a zillion times on a bad * sector. The error is not correctable at all. */ -ide_dump_status (drive, rq,"media error (bad sector)" , stat); +ide_dump_status (drive, rq,"media error (bad sector)" , drive->status);cdrom_end_request (drive, rq,0 ); } else if ((err & ~ABRT_ERR) != 0) {/* Go to the default handler for other errors. */ - *startstop =ide_error (drive, rq, __FUNCTION__, stat); + *startstop =ide_error (drive, rq, __FUNCTION__, drive->status);return 1 ; } else if ((++rq->errors > ERROR_MAX)) {/* We've racked up too many retries. Abort. */
@@ -682,7 +682,7 @@/* If we got a CHECK_CONDITION status, queue a request sense command. */ -if ((stat &ERR_STAT ) !=0 ) +if (drive->status &ERR_STAT )cdrom_queue_request_sense (drive,NULL ,NULL ,NULL ); }else blk_dump_rq_flags (rq,"ide-cd bad flags" );
@@ -880,7 +880,7 @@/* Some drives (ASUS) seem to tell us that status * info is available. just get it and ignore. */ -GET_STAT (); +ata_status (drive,0 ,0 );return 0 ; }else {/* Drive wants a command packet, or invalid ireason... */
@@ -1619,9 +1619,8 @@if (rq->flags &REQ_CMD ) {if (CDROM_CONFIG_FLAGS (drive)->seeking) {unsigned long elpased = jiffies - info->start_seek; -int stat =GET_STAT (); -if ((stat &SEEK_STAT ) !=SEEK_STAT ) { +if (!ata_status (drive,SEEK_STAT ,0 )) {if (elpased <IDECD_SEEK_TIMEOUT ) {ide_stall_queue (drive,IDECD_SEEK_TIMER );return ide_stopped;
drivers/ide/ide-floppy.c +5 -3
@@ -637,7 +637,7 @@return 0 ; } rq->errors = error; -ide_end_drive_cmd (drive, rq,0 ,0 ); +ide_end_drive_cmd (drive, rq,0 );return 0 ; }
@@ -844,7 +844,8 @@ }#endif - status.all =GET_STAT ();/* Clear the interrupt */ +ata_status (drive,0 ,0 ); + status.all = drive->status;/* Clear the interrupt */ if (!status.b.drq) {/* No more interrupts */ #if IDEFLOPPY_DEBUG_LOG
@@ -1588,7 +1589,8 @@__save_flags (flags);__cli (); - status.all=GET_STAT (); +ata_status (drive,0 ,0 ); + status.all = drive->status;__restore_flags (flags); progress_indication= !status.b.dsc ?0 :0x10000 ;
drivers/ide/ide-pmac.c +14 -14
@@ -395,21 +395,21 @@ {/* Timeout bumped for some powerbooks */ int timeout =2000 ; -byte stat; -while (--timeout) { - stat =GET_STAT (); -if (!(stat &BUSY_STAT )) { +while (--timeout) { +if (ata_status (drive,0 ,BUSY_STAT )) {if (drive->ready_stat ==0 )break ; -else if ((stat & drive->ready_stat) || (stat &ERR_STAT )) +else if ((drive->status & drive->ready_stat) + || (drive->status &ERR_STAT ))break ; }mdelay (1 ); } -if ((stat &ERR_STAT ) || timeout <=0 ) { -if (stat &ERR_STAT ) { -printk (KERN_ERR "ide_pmac: wait_for_ready, error status: %x\n" , stat); +if ((drive->status &ERR_STAT ) || timeout <=0 ) { +if (drive->status &ERR_STAT ) { +printk (KERN_ERR "ide_pmac: wait_for_ready, error status: %x\n" , + drive->status); }return 1 ; }
@@ -417,7 +417,7 @@ } static int __pmac -pmac_ide_do_setfeature (struct ata_device *drive,byte command) +pmac_ide_do_setfeature (struct ata_device *drive,u8 command) {int result =1 ;unsigned long flags;
@@ -425,11 +425,11 @@disable_irq (hwif->irq);/* disable_irq_nosync ?? */ udelay (1 ); -SELECT_DRIVE (drive->channel, drive); -SELECT_MASK (drive->channel, drive,0 ); +ata_select (drive,0 ); +ata_mask (drive);udelay (1 ); - (void )GET_STAT ();/* Get rid of pending error state */ -if (wait_for_ready (drive)) { +ata_status (drive,0 ,0 );/* Get rid of pending error state */ +if (wait_for_ready (drive)) {printk (KERN_ERR "pmac_ide_do_setfeature disk not ready before SET_FEATURE!\n" ); goto out; }
@@ -447,7 +447,7 @@if (result)printk (KERN_ERR "pmac_ide_do_setfeature disk not ready after SET_FEATURE !\n" ); out: -SELECT_MASK (drive->channel, drive,0 ); +ata_mask (drive);if (result ==0 ) { drive->id->dma_ultra &= ~0xFF00 ; drive->id->dma_mword &= ~0x0F00 ;
drivers/ide/ide-tape.c +9 -6
@@ -1864,7 +1864,7 @@idetape_increase_max_pipeline_stages (drive); } } -ide_end_drive_cmd (drive, rq,0 ,0 ); +ide_end_drive_cmd (drive, rq,0 );if (remove_stage)idetape_remove_stage_head (drive);if (tape->active_data_request ==NULL )
@@ -1991,7 +1991,8 @@printk (KERN_INFO "ide-tape: Reached idetape_pc_intr interrupt handler\n" );#endif - status.all =GET_STAT ();/* Clear the interrupt */ +ata_status (drive,0 ,0 ); + status.all = drive->status;/* Clear the interrupt */ #ifdef CONFIG_BLK_DEV_IDEDMA if (test_bit (PC_DMA_IN_PROGRESS , &pc->flags)) {
@@ -2415,7 +2416,8 @@if (tape->onstream)printk (KERN_INFO "ide-tape: bug: onstream, media_access_finished\n" ); - status.all =GET_STAT (); +ata_status (drive,0 ,0 ); + status.all = drive->status;if (status.b.dsc) {if (status.b.check) {/* Error detected */ printk (KERN_ERR "ide-tape: %s: I/O error, " ,tape->name);
@@ -2603,10 +2605,11 @@ tape->postponed_rq =NULL ;/* -* If the tape is still busy, postpone our request and service -* the other device meanwhile. +* If the tape is still busy, postpone our request and service +* the other device meanwhile. */ - status.all =GET_STAT (); +ata_status (drive,0 ,0 ); + status.all = drive->status;/* * The OnStream tape drive doesn't support DSC. Assume
drivers/ide/ide-taskfile.c +47 -47
227 lines not on this page · raw message
drivers/ide/main.c +1 -0
@@ -1293,6 +1293,7 @@printk (KERN_INFO "ATA/ATAPI device driver v" VERSION "\n" ); ide_devfs_handle =devfs_mk_dir (NULL ,"ata" ,NULL ); +devfs_mk_symlink (NULL ,"ide" ,DEVFS_FL_DEFAULT ,"ata" ,NULL ,NULL );/* * Because most of the ATA adapters represent the timings in unit of
drivers/ide/Makefile +2 -2
@@ -8,7 +8,7 @@ # In the future, some of these should be built conditionally. # -export-objs := ide-taskfile.o main.o ide.o probe.o quirks.o pcidma.o tcq.o \ +export-objs := device.o ide-taskfile.o main.o ide.o probe.o quirks.o pcidma.o tcq.o \ atapi.o ataraid.o obj-$(CONFIG_BLK_DEV_HD) += hd.o
@@ -68,7 +68,7 @@ obj-$(CONFIG_BLK_DEV_ATARAID_PDC) += pdcraid.o obj-$(CONFIG_BLK_DEV_ATARAID_HPT) += hptraid.o -ide-mod-objs := ide-taskfile.o main.o ide.o probe.o \ +ide-mod-objs := device.o ide-taskfile.o main.o ide.o probe.o \ ioctl.o atapi.o ata-timing.o $(ide-obj-y) include $(TOPDIR)/Rules.make
drivers/ide/ns87415.c +1 -1
@@ -195,7 +195,7 @@#ifdef __sparc_v9__/* * XXX: Reset the device, if we don't it will not respond -* to SELECT_DRIVE() properly during first probe_hwif(). +* to select properly during first probe. */ timeout =10000 ;outb (12 , hwif->io_ports[IDE_CONTROL_OFFSET ]);
drivers/ide/pcidma.c +5 -6
@@ -39,10 +39,9 @@*/ ide_startstop_t ide_dma_intr (struct ata_device *drive,struct request *rq) { -u8 stat, dma_stat; - +u8 dma_stat; dma_stat =udma_stop (drive); -if (OK_STAT (stat =GET_STAT (),DRIVE_READY ,drive->bad_wstat|DRQ_STAT )) { +if (ata_status (drive,DRIVE_READY , drive->bad_wstat |DRQ_STAT )) {if (!dma_stat) {__ide_end_request (drive, rq,1 , rq->nr_sectors);return ide_stopped;
@@ -50,7 +49,7 @@printk (KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n" , drive->name, dma_stat); } -return ide_error (drive, rq,"dma_intr" , stat); +return ide_error (drive, rq,"dma_intr" , drive->status); }/*
@@ -130,8 +129,8 @@#endif if (dma_stat &2 ) {/* ERROR */ -u8 stat =GET_STAT (); -return ide_error (drive, rq,"dma_timer_expiry" , stat); +ata_status (drive,0 ,0 ); +return ide_error (drive, rq,"dma_timer_expiry" , drive->status); }if (dma_stat &1 )/* DMAing */ return WAIT_CMD ;
drivers/ide/pdc4030.c +14 -17
@@ -373,15 +373,13 @@*/ static ide_startstop_t promise_read_intr (struct ata_device *drive,struct request *rq) { -u8 stat;int total_remaining;unsigned int sectors_left, sectors_avail, nsect;unsigned long flags;char *to; -if (!OK_STAT (stat=GET_STAT (),DATA_READY ,BAD_R_STAT )) { -return ide_error (drive, rq,"promise_read_intr" , stat); - } +if (!ata_status (drive,DATA_READY ,BAD_R_STAT )) +return ide_error (drive, rq,"promise_read_intr" , drive->status); read_again: do {
@@ -427,10 +425,10 @@if (total_remaining >0 ) {if (sectors_avail) goto read_next; - stat =GET_STAT (); -if (stat &DRQ_STAT ) +ata_status (drive,0 ,0 ); +if (drive->status &DRQ_STAT ) goto read_again; -if (stat &BUSY_STAT ) { +if (drive->status &BUSY_STAT ) {ide_set_handler (drive, promise_read_intr,WAIT_CMD ,NULL );#ifdef DEBUG_READ printk(KERN_DEBUG "%s: promise_read: waiting for"
@@ -440,7 +438,7 @@ }printk (KERN_ERR "%s: Eeek! promise_read_intr: sectors left " "!DRQ !BUSY\n" , drive->name); -return ide_error (drive, rq,"promise read intr" , stat); +return ide_error (drive, rq,"promise read intr" , drive->status); }return ide_stopped; }
@@ -457,7 +455,7 @@ {struct ata_channel *ch = drive->channel; -if (GET_STAT () &BUSY_STAT ) { +if (!ata_status (drive,0 ,BUSY_STAT )) {if (time_before (jiffies, ch->poll_timeout)) {ide_set_handler (drive, promise_complete_pollfunc,HZ /100 ,NULL );return ide_started;/* continue polling... */
@@ -465,7 +463,7 @@ ch->poll_timeout =0 ;printk (KERN_ERR "%s: completion timeout - still busy!\n" , drive->name); -return ide_error (drive, rq,"busy timeout" ,GET_STAT ()); +return ide_error (drive, rq,"busy timeout" , drive->status); } ch->poll_timeout =0 ;
@@ -543,7 +541,8 @@ } ch->poll_timeout =0 ;printk (KERN_ERR "%s: write timed out!\n" ,drive->name); -return ide_error (drive, rq,"write timeout" ,GET_STAT ()); +ata_status (drive,0 ,0 ); +return ide_error (drive, rq,"write timeout" , drive->status); }/*
@@ -554,7 +553,7 @@ide_set_handler (drive, promise_complete_pollfunc,HZ /100 ,NULL );#ifdef DEBUG_WRITE printk (KERN_DEBUG "%s: Done last 4 sectors - status = %02x\n" , - drive->name,GET_STAT ()); + drive->name, drive->status);#endif return ide_started; }
@@ -597,7 +596,7 @@ide_set_handler (drive, promise_complete_pollfunc,HZ /100 ,NULL );#ifdef DEBUG_WRITE printk (KERN_DEBUG "%s: promise_write: <= 4 sectors, " -"status = %02x\n" , drive->name,GET_STAT ()); +"status = %02x\n" , drive->name, drive->status);#endif return ide_started; }
@@ -612,7 +611,6 @@ {struct hd_drive_task_hdr *taskfile = &(args->taskfile);unsigned long timeout; -byte stat;/* Check that it's a regular command. If not, bomb out early. */ if (!(rq->flags &REQ_CMD )) {
@@ -623,7 +621,7 @@if (IDE_CONTROL_REG )outb (drive->ctl,IDE_CONTROL_REG );/* clear nIEN */ -SELECT_MASK (drive->channel, drive,0 ); +ata_mask (drive);outb (taskfile->feature,IDE_FEATURE_REG );outb (taskfile->sector_count,IDE_NSECTOR_REG );
@@ -649,8 +647,7 @@*/ timeout = jiffies +HZ /20 ;/* 50ms wait */ do { - stat=GET_STAT(); - if (stat & DRQ_STAT) { + if (!ata_status(drive, 0, DRQ_STAT)) { udelay(1); return promise_read_intr(drive, rq); }
drivers/ide/probe.c +33 -36
165 lines not on this page · raw message
drivers/ide/tcq.c +27 -28
141 lines not on this page · raw message
drivers/scsi/ide-scsi.c +6 -7
@@ -242,7 +242,7 @@ide_end_request (drive, rq, uptodate);return 0 ; } -ide_end_drive_cmd (drive, rq,0 ,0 ); +ide_end_drive_cmd (drive, rq,0 );if (rq->errors >=ERROR_MAX ) { pc->s.scsi_cmd->result =DID_ERROR <<16 ;if (log)
@@ -286,7 +286,7 @@ {struct Scsi_Host *host = drive->driver_data;idescsi_scsi_t *scsi = (idescsi_scsi_t *) host->hostdata[0 ]; -byte status, ireason; +u8 ireason;int bcount;struct atapi_packet_command *pc=scsi->pc;unsigned int temp;
@@ -303,13 +303,12 @@udma_stop (drive); } - status =GET_STAT ();/* Clear the interrupt */ - -if ((status &DRQ_STAT ) ==0 ) {/* No more interrupts */ +/* Clear the interrupt */ +if (ata_status (drive,0 ,DRQ_STAT )) {/* No more interrupts */ if (test_bit (IDESCSI_LOG_CMD , &scsi->log))printk (KERN_INFO "Packet command completed, %d bytes transferred\n" , pc->actually_transferred);ide__sti (); -if (status &ERR_STAT ) +if (drive->status &ERR_STAT ) rq->errors++;idescsi_end_request (drive, rq,1 );return ide_stopped;
@@ -411,7 +410,7 @@ dma_ok = !udma_read (drive, rq); } -SELECT_DRIVE (drive->channel, drive); +ata_select (drive,10 );if (IDE_CONTROL_REG )OUT_BYTE (drive->ctl,IDE_CONTROL_REG );OUT_BYTE (dma_ok,IDE_FEATURE_REG );
include/linux/ide.h +13 -18
@@ -112,8 +112,6 @@#define GET_ALTSTAT () IN_BYTE(IDE_CONTROL_REG)#define GET_FEAT () IN_BYTE(IDE_NSECTOR_REG) -#define OK_STAT (stat,good,bad) (((stat)&((good)|(bad)))==(good)) -#define BAD_R_STAT (BUSY_STAT | ERR_STAT)#define BAD_W_STAT (BAD_R_STAT | WRERR_STAT)#define BAD_STAT (BAD_R_STAT | DRQ_STAT)
@@ -157,19 +155,6 @@#define WAIT_CMD (10*HZ)/* 10sec - maximum wait for an IRQ to happen */ #define WAIT_MIN_SLEEP (2*HZ/100)/* 20msec - minimum sleep time */ -#define SELECT_DRIVE (channel, drive) \ -{ \ - if (channel->selectproc) \ - channel->selectproc(drive); \ - OUT_BYTE((drive)->select.all, channel->io_ports[IDE_SELECT_OFFSET]); \ -} - -#define SELECT_MASK (channel, drive, mask) \ -{ \ - if (channel->maskproc) \ - channel->maskproc(drive,mask); \ -} -/* * Check for an interrupt and acknowledge the interrupt status */
@@ -359,8 +344,12 @@ unsigned ata_flash : 1; /* 1=present, 0=default */unsigned addressing;/* : 2; 0=28-bit, 1=48-bit, 2=64-bit */ byte scsi;/* 0=default, 1=skip current ide-subdriver for ide-scsi emulation */ +select_t select;/* basic drive/head select reg value */ -byte ctl;/* "normal" value for IDE_CONTROL_REG */ + +u8 ctl;/* "normal" value for IDE_CONTROL_REG */ +u8 status;/* last retrived status value for device */ +byte ready_stat;/* min status value for drive ready */ byte mult_count;/* current multiple sector setting */ byte bad_wstat;/* used for ignoring WRERR_STAT */
@@ -485,7 +474,7 @@void (*intrproc) (struct ata_device *);/* special host masking for drive selection */ -void (*maskproc) (struct ata_device *,int ); +void (*maskproc) (struct ata_device *);/* check host's drive quirk list */ int (*quirkproc) (struct ata_device *);
@@ -730,7 +719,7 @@/* * Clean up after success/failure of an explicit drive cmd. */ -extern void ide_end_drive_cmd (struct ata_device *,struct request *,u8 ,u8 ); +extern void ide_end_drive_cmd (struct ata_device *,struct request *,u8 );struct ata_taskfile {struct hd_drive_task_hdr taskfile;
@@ -902,4 +891,10 @@extern int drive_is_ready (struct ata_device *drive); +/* Low level device access functions. */ + +extern void ata_select (struct ata_device *,unsigned long ); +extern void ata_mask (struct ata_device *); +extern int ata_status (struct ata_device *,u8 ,u8 ); +#endif
PATCH 1/1 2.5.19 IDE 78
In reply to Linus TorvaldsSat Jun 1 16:54:57 CEST 2002 ide-clean-78
- Move ide_fixstring() from ide.c to probe.c, since this is the place, where it's most used.
- Remove GET_STAT() - it's not used any longer.
- Remove last parameter of ide_error. Rename it to ata_error().
- Don't use ide_fixstring in qd65xx.c host chip driver. The model name is already fixed in probe.c.
- Invent ata_irq_enable() for the handling of the trice nIEN bit of the control register. Consistently use ch->intrproc method every time we toggle this bit. This simply wasn't the case before!
- Disable interrupts on a previous channel only when we share them indeed.
- Eliminate simple drive command handling function drive_cmd.
- Simplify the ioctl handler. Move it to ioctl, since that's the only place where it's actually used.
arch/cris/drivers/ide.c +1 -1
@@ -707,7 +707,7 @@ }printk ("%s: bad DMA status\n" , drive->name); } -return ide_error (drive,"dma_intr" , drive->status); +return ata_error (drive, __FUNCTION__); }/*
drivers/ide/device.c +52 -2
73 lines not on this page · raw message
drivers/ide/hpt34x.c +1 -1
@@ -264,7 +264,7 @@if (drive->type !=ATA_DISK )return 0 ; -ide_set_handler (drive, &ide_dma_intr,WAIT_CMD ,NULL );/* issue cmd to drive */ +ide_set_handler (drive, ide_dma_intr,WAIT_CMD ,NULL );/* issue cmd to drive */ OUT_BYTE ((reading ==9 ) ?WIN_READDMA :WIN_WRITEDMA ,IDE_COMMAND_REG );return 0 ;
drivers/ide/hpt366.c +8 -13
@@ -813,31 +813,26 @@if (drive->quirk_list) {/* drives in the quirk_list may not like intr setups/cleanups */ }else { -OUT_BYTE ((drive)->ctl|2 , drive->channel->io_ports[IDE_CONTROL_OFFSET ]); +OUT_BYTE (0x02 , drive->channel->io_ports[IDE_CONTROL_OFFSET ]); } }static void hpt3xx_maskproc (struct ata_device *drive) {struct pci_dev *dev = drive->channel->pci_dev; -const int mask =0 ; +struct ata_channel *ch = drive->channel;if (drive->quirk_list) {if (hpt_min_rev (dev,3 )) {u8 reg5a;pci_read_config_byte (dev,0x5a , ®5a); -if (((reg5a &0x10 ) >>4 ) != mask) -pci_write_config_byte (dev,0x5a , mask ? (reg5a |0x10 ) : (reg5a & ~0x10 )); - }else { -if (mask) { -disable_irq (drive->channel->irq); - }else { -enable_irq (drive->channel->irq); - } - } +if ((reg5a &0x10 ) >>4 ) +pci_write_config_byte (dev,0x5a , reg5a & ~0x10 ); + }else +enable_irq (drive->channel->irq); }else { -if (IDE_CONTROL_REG ) -OUT_BYTE (mask ? (drive->ctl |2 ) : (drive->ctl & ~2 ),IDE_CONTROL_REG ); +if (ch->io_ports[IDE_CONTROL_OFFSET ]) +OUT_BYTE (0x00 , ch->io_ports[IDE_CONTROL_OFFSET ]); } }
drivers/ide/ht6560b.c +28 -28
142 lines not on this page · raw message
drivers/ide/icside.c +1 -1
@@ -476,7 +476,7 @@printk ("%s: dma_intr: bad DMA status (dma_stat=%x)\n" , drive->name, dma_stat); } -return ide_error (drive, rq,"dma_intr" , drive->status); +return ata_error (drive, rq, __FUNCTION__); } static int
drivers/ide/ide.c +38 -99
266 lines not on this page · raw message
drivers/ide/ide-cd.c +5 -7
@@ -594,7 +594,7 @@ pc = (struct packet_command *) rq->special; pc->stat =1 ;cdrom_end_request (drive, rq,1 ); - *startstop =ide_error (drive, rq,"request sense failure" , drive->status); + *startstop =ata_error (drive, rq,"request sense failure" );return 1 ; }else if (rq->flags & (REQ_PC |REQ_BLOCK_PC )) {
@@ -673,7 +673,7 @@ }else if ((err & ~ABRT_ERR ) !=0 ) {/* Go to the default handler for other errors. */ - *startstop =ide_error (drive, rq, __FUNCTION__, drive->status); + *startstop =ata_error (drive, rq, __FUNCTION__);return 1 ; }else if ((++rq->errors >ERROR_MAX )) {/* We've racked up too many retries. Abort. */
@@ -751,9 +751,7 @@OUT_BYTE (xferlen &0xff ,IDE_LCYL_REG );OUT_BYTE (xferlen >>8 ,IDE_HCYL_REG ); -if (IDE_CONTROL_REG ) -OUT_BYTE (drive->ctl,IDE_CONTROL_REG ); - +ata_irq_enable (drive,1 );if (info->dma)udma_start (drive, rq);
@@ -918,7 +916,7 @@__ide_end_request (drive, rq,1 , rq->nr_sectors);return ide_stopped; }else -return ide_error (drive, rq,"dma error" , stat); +return ata_error (drive, rq,"dma error" ); }/* Read the interrupt reason and the transfer length. */
@@ -1498,7 +1496,7 @@*/ if (dma) {if (dma_error) -return ide_error (drive, rq,"dma error" , stat); +return ata_error (drive, rq,"dma error" );__ide_end_request (drive, rq,1 , rq->nr_sectors);return ide_stopped;
drivers/ide/ide-disk.c +5 -4
@@ -257,14 +257,15 @@ args.taskfile.sector_number = block;/* low lba */ args.taskfile.low_cylinder = (block >>=8 );/* mid lba */ args.taskfile.high_cylinder = (block >>=8 );/* hi lba */ + args.taskfile.device_head = drive->select.all; args.hobfile.sector_number = (block >>=8 );/* low lba */ args.hobfile.low_cylinder = (block >>=8 );/* mid lba */ args.hobfile.high_cylinder = (block >>=8 );/* hi lba */ + args.hobfile.device_head = drive->select.all; + + args.hobfile.control =0x80 ; - args.taskfile.device_head = drive->select.all; - args.hobfile.device_head = args.taskfile.device_head; - args.hobfile.control = (drive->ctl|0x80 ); args.taskfile.command =get_command (drive,rq_data_dir (rq));#ifdef DEBUG
@@ -727,7 +728,7 @@ args.hobfile.high_cylinder = (addr_req >>=8 ); args.hobfile.device_head =0x40 ; - args.hobfile.control = (drive->ctl |0x80 ); + args.hobfile.control =0x80 ; args.handler = task_no_data_intr;/* submit command request */
drivers/ide/ide-floppy.c +1 -2
@@ -1064,8 +1064,7 @@ }#endif -if (IDE_CONTROL_REG ) -OUT_BYTE (drive->ctl,IDE_CONTROL_REG ); +ata_irq_enable (drive,1 );OUT_BYTE (dma_ok ?1 :0 ,IDE_FEATURE_REG );/* Use PIO/DMA */ OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG );OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG );
drivers/ide/ide-pmac.c +3 -3
@@ -434,7 +434,7 @@ goto out; }udelay (10 ); -OUT_BYTE (drive->ctl |2 ,IDE_CONTROL_REG ); +ata_irq_enale (drive,0 );OUT_BYTE (command,IDE_NSECTOR_REG );OUT_BYTE (SETFEATURES_XFER ,IDE_FEATURE_REG );OUT_BYTE (WIN_SETFEATURES ,IDE_COMMAND_REG );
@@ -443,7 +443,7 @@ide__sti ();/* local CPU only -- for jiffies */ result =wait_for_ready (drive);__restore_flags (flags);/* local CPU only */ -OUT_BYTE (drive->ctl,IDE_CONTROL_REG ); +ata_irq_enable (drive,1 );if (result)printk (KERN_ERR "pmac_ide_do_setfeature disk not ready after SET_FEATURE !\n" ); out:
@@ -1330,7 +1330,7 @@/* Normal MultiWord DMA modes. */ drive->using_dma =pmac_ide_mdma_enable (drive, idx); } -OUT_BYTE (0 ,IDE_CONTROL_REG ); +ata_irq_enable (drive,1 );/* Apply settings to controller */ pmac_ide_selectproc (drive); }
drivers/ide/ide-tape.c +1 -2
@@ -2263,8 +2263,7 @@ }#endif -if (IDE_CONTROL_REG ) -OUT_BYTE (drive->ctl,IDE_CONTROL_REG ); +ata_irq_enable (drive,1 );OUT_BYTE (dma_ok ?1 :0 ,IDE_FEATURE_REG );/* Use PIO/DMA */ OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG );OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG );
drivers/ide/ide-taskfile.c +32 -47
176 lines not on this page · raw message
drivers/ide/main.c +1 -2
@@ -205,9 +205,8 @@struct ata_device *drive = &ch->drives[unit]; drive->type =ATA_DISK ; - drive->select.all = (unit<<4 )|0xa0 ; + drive->select.all = (unit <<4 ) |0xa0 ; drive->channel = ch; - drive->ctl =0x08 ; drive->ready_stat =READY_STAT ; drive->bad_wstat =BAD_W_STAT ;sprintf (drive->name,"hd%c" ,'a' + (index *MAX_DRIVES ) + unit);
drivers/ide/ns87415.c +1 -14
@@ -141,10 +141,6 @@struct pci_dev *dev = hwif->pci_dev;unsigned int ctrl, using_inta;byte progif; -#ifdef __sparc_v9__ -int timeout; -byte stat; -#endif /* Set a good latency timer and cache line size value. */ (void )pci_write_config_byte (dev,PCI_LATENCY_TIMER ,64 );
@@ -197,16 +193,7 @@* XXX: Reset the device, if we don't it will not respond * to select properly during first probe. */ - timeout =10000 ; -outb (12 , hwif->io_ports[IDE_CONTROL_OFFSET ]); -udelay (10 ); -outb (8 , hwif->io_ports[IDE_CONTROL_OFFSET ]); -do { -udelay (50 ); - stat =inb (hwif->io_ports[IDE_STATUS_OFFSET ]); -if (stat ==0xff ) -break ; - }while ((stat &BUSY_STAT ) && --timeout); + ata_reset(struct ata_channel *hwif);#endif }
drivers/ide/pcidma.c +6 -3
@@ -41,6 +41,7 @@ {u8 dma_stat; dma_stat =udma_stop (drive); +if (ata_status (drive,DRIVE_READY , drive->bad_wstat |DRQ_STAT )) {if (!dma_stat) {__ide_end_request (drive, rq,1 , rq->nr_sectors);
@@ -49,7 +50,8 @@printk (KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n" , drive->name, dma_stat); } -return ide_error (drive, rq,"dma_intr" , drive->status); + +return ata_error (drive, rq, __FUNCTION__); }/*
@@ -118,7 +120,7 @@static int dma_timer_expiry (struct ata_device *drive,struct request *rq) {/* FIXME: What's that? */ -u8 dma_stat =inb (drive->channel->dma_base+2 ); +u8 dma_stat =inb (drive->channel->dma_base +2 );#ifdef DEBUG printk ("%s: dma_timer_expiry: dma status == 0x%02x\n" , drive->name, dma_stat);
@@ -130,10 +132,11 @@if (dma_stat &2 ) {/* ERROR */ ata_status (drive,0 ,0 ); -return ide_error (drive, rq,"dma_timer_expiry" , drive->status); +return ata_error (drive, rq, __FUNCTION__); }if (dma_stat &1 )/* DMAing */ return WAIT_CMD ; +return 0 ; }
drivers/ide/pdc202xx.c +5 -3
@@ -686,9 +686,11 @@void pdc202xx_new_reset (struct ata_device *drive) { -set_reg_and_wait (0x04 ,IDE_CONTROL_REG ,1000 ); -set_reg_and_wait (0x00 ,IDE_CONTROL_REG ,1000 ); -printk ("PDC202XX: %s channel reset.\n" , +ata_reset (drive->channel); +mdelay (1000 ); +ata_irq_enable (drive,1 ); +mdelay (1000 ); +printk (KERN_INFO "PDC202XX: %s channel reset.\n" , drive->channel->unit ?"Secondary" :"Primary" ); }
drivers/ide/pdc4030.c +9 -10
@@ -243,9 +243,8 @@if (inb (IDE_NSECTOR_REG ) ==0xFF ||inb (IDE_SECTOR_REG ) ==0xFF ) {return 0 ; } -if (IDE_CONTROL_REG ) -outb (0x08 ,IDE_CONTROL_REG ); -if (pdc4030_cmd (drive,PROMISE_GET_CONFIG )) { +ata_irq_enable (drive,1 ); +if (pdc4030_cmd (drive,PROMISE_GET_CONFIG )) {return 0 ; }if (ide_wait_stat (&startstop, drive,NULL ,DATA_READY ,BAD_W_STAT ,WAIT_DRQ )) {
@@ -379,7 +378,7 @@char *to;if (!ata_status (drive,DATA_READY ,BAD_R_STAT )) -return ide_error (drive, rq,"promise_read_intr" , drive->status); +return ata_error (drive, rq, __FUNCTION__); read_again: do {
@@ -438,7 +437,7 @@ }printk (KERN_ERR "%s: Eeek! promise_read_intr: sectors left " "!DRQ !BUSY\n" , drive->name); -return ide_error (drive, rq,"promise read intr" , drive->status); +return ata_error (drive, rq,"promise read intr" ); }return ide_stopped; }
@@ -463,7 +462,7 @@ ch->poll_timeout =0 ;printk (KERN_ERR "%s: completion timeout - still busy!\n" , drive->name); -return ide_error (drive, rq,"busy timeout" , drive->status); +return ata_error (drive, rq,"busy timeout" ); } ch->poll_timeout =0 ;
@@ -540,9 +539,9 @@return ide_started;/* continue polling... */ } ch->poll_timeout =0 ; -printk (KERN_ERR "%s: write timed out!\n" ,drive->name); +printk (KERN_ERR "%s: write timed out!\n" , drive->name);ata_status (drive,0 ,0 ); -return ide_error (drive, rq,"write timeout" , drive->status); +return ata_error (drive, rq,"write timeout" ); }/*
@@ -616,11 +615,11 @@if (!(rq->flags &REQ_CMD )) {blk_dump_rq_flags (rq,"pdc4030 bad flags" );ide_end_request (drive, rq,0 ); +return ide_stopped; } -if (IDE_CONTROL_REG ) -outb (drive->ctl,IDE_CONTROL_REG );/* clear nIEN */ +ata_irq_enable (drive,1 );/* clear nIEN */ ata_mask (drive);outb (taskfile->feature,IDE_FEATURE_REG );
drivers/ide/probe.c +73 -46
230 lines not on this page · raw message
drivers/ide/qd65xx.c +1 -3
@@ -173,9 +173,7 @@if (!*drive->id->model)return 0 ; -strncpy (model,drive->id->model,40 ); -ide_fixstring (model,40 ,1 );/* byte-swap */ - +strncpy (model,drive->id->model,40 );for (p = qd65xx_timing ; p->offset !=-1 ; p++) {if (!strncmp (p->model, model+p->offset,4 )) {printk (KERN_DEBUG "%s: listed !\n" , drive->name);
drivers/ide/tcq.c +15 -20
@@ -55,17 +55,6 @@static ide_startstop_t ide_dmaq_intr (struct ata_device *drive,struct request *rq);static ide_startstop_t service (struct ata_device *drive,struct request *rq); -static inline void drive_ctl_nien (struct ata_device *drive,int set) -{ -#ifdef IDE_TCQ_NIEN -if (IDE_CONTROL_REG ) { -int mask = set ?0x02 :0x00 ; - -OUT_BYTE (drive->ctl | mask,IDE_CONTROL_REG ); - } -#endif -} -static ide_startstop_t tcq_nop_handler (struct ata_device *drive,struct request *rq) {struct ata_taskfile *args = rq->special;
@@ -136,11 +125,10 @@ rq->rq_dev =mk_kdev (drive->channel->major, (drive->select.b.unit)<<PARTN_BITS );_elv_add_request (q, rq,0 ,0 ); -/* -* make sure that nIEN is cleared -*/ out: -drive_ctl_nien (drive,0 ); +#ifdef IDE_TCQ_NIEN +ata_irq_enable (drive,1 ); +#endif /* * start doing stuff again
@@ -250,8 +238,9 @@if (drive != drive->channel->drive)ata_select (drive,10 ); -drive_ctl_nien (drive,1 ); - +#ifdef IDE_TCQ_NIEN +ata_irq_enable (drive,0 ); +#endif /* * send SERVICE, wait 400ns, wait for BUSY_STAT to clear */
@@ -265,7 +254,9 @@return ide_stopped; } -drive_ctl_nien (drive,0 ); +#ifdef IDE_TCQ_NIEN +ata_irq_enable (drive,1 ); +#endif /* * FIXME, invalidate queue
@@ -559,7 +550,9 @@* set nIEN, tag start operation will enable again when * it is safe */ -drive_ctl_nien (drive,1 ); +#ifdef IDE_TCQ_NIEN +ata_irq_enable (drive,0 ); +#endif OUT_BYTE (args->taskfile.command,IDE_COMMAND_REG );
@@ -569,7 +562,9 @@return ide_stopped; } -drive_ctl_nien (drive,0 ); +#ifdef IDE_TCQ_NIEN +ata_irq_enable (drive,1 ); +#endif if (stat &ERR_STAT ) {ide_dump_status (drive, rq,"tcq_start" , stat);
drivers/ide/trm290.c +1 -1
@@ -222,7 +222,7 @@if (drive->type !=ATA_DISK )return 0 ; -ide_set_handler (drive, &ide_dma_intr,WAIT_CMD ,NULL ); +ide_set_handler (drive, ide_dma_intr,WAIT_CMD ,NULL );OUT_BYTE (reading ?WIN_READDMA :WIN_WRITEDMA ,IDE_COMMAND_REG );return 0 ;
drivers/scsi/ide-scsi.c +1 -2
@@ -411,8 +411,7 @@ }ata_select (drive,10 ); -if (IDE_CONTROL_REG ) -OUT_BYTE (drive->ctl,IDE_CONTROL_REG ); +ata_irq_enable (drive,1 );OUT_BYTE (dma_ok,IDE_FEATURE_REG );OUT_BYTE (bcount >>8 ,IDE_BCOUNTH_REG );OUT_BYTE (bcount &0xff ,IDE_BCOUNTL_REG );
include/linux/ide.h +20 -43
110 lines not on this page · raw message
Re: [PATCH] 2.5.19 IDE 78
Quoted 12 lines · Martin Dalecki
static void
hpt3xx_maskproc(struct ata_device *drive){drivers/ide/hpt366.c +1
-3struct pci_dev *dev = drive->channel->pci_dev; -const int mask =0 ; +struct ata_channel *ch = drive->channel;if (drive->quirk_list) {if (hpt_min_rev (dev,3 )) {u8 reg5a;pci_read_config_byte (dev,0x5a , ®5a); -if (((reg5a &0x10 ) >>4 ) != mask) -pci_write_config_byte (dev,0x5a , mask ? (reg5a |0x10 ) : (reg5a & ~0x10 ));
[...]
drivers/ide/hpt366.c line 830
Quoted 2 lines
drivers/ide/hpt366.c +2
-0+if ((reg5a &0x10 ) >>4 ) +pci_write_config_byte (dev,0x5a , reg5a & ~0x10 );
Perhaps you can remove the " >> 4" too.
-Paul
Re: [PATCH] 2.5.19 IDE 78
In reply to Martin DaleckiMartin,
I think you have a typo here:
drivers/ide/ide-pmac.c line 437
Quoted 9 lines
diff -urN
linux-2.5.19/drivers/ide/ide-pmac.clinux/drivers/ide/ide-pmac.cdrivers/ide/ide-pmac.c +1
-1@@ -434,7 +434,7 @@ goto out; }udelay (10 ); -OUT_BYTE (drive->ctl |2 ,IDE_CONTROL_REG ); +ata_irq_enale (drive,0 );
ata_irq_enable surely?
Also, we need the patch below now that ata_channel.active is a pointer.
Paul.
drivers/ide/ide-pmac.c +4 -4
@@ -1584,9 +1584,9 @@*/ if (used_dma && !ide_spin_wait_hwgroup (drive)) {/* Lock HW group */ -set_bit (IDE_BUSY , &drive->channel->active); +set_bit (IDE_BUSY , drive->channel->active);pmac_ide_check_dma (drive); -clear_bit (IDE_BUSY , &drive->channel->active); +clear_bit (IDE_BUSY , drive->channel->active);spin_unlock_irq (drive->channel->lock); }#endif
@@ -1633,7 +1633,7 @@return ; else {/* Lock HW group */ -set_bit (IDE_BUSY , &drive->channel->active); +set_bit (IDE_BUSY , drive->channel->active);/* Stop the device */ idepmac_sleep_device (drive, idx, base);spin_unlock_irq (drive->channel->lock);
@@ -1663,7 +1663,7 @@/* We resume processing on the lock group */ spin_lock_irq (drive->channel->lock); -clear_bit (IDE_BUSY , &drive->channel->active); +clear_bit (IDE_BUSY , drive->channel->active);if (!list_empty (&drive->queue.queue_head))do_ide_request (&drive->queue);spin_unlock_irq (drive->channel->lock);
[PATCH} 2.5.19 IDE 79
In reply to Linus TorvaldsSat Jun 1 21:31:47 CEST 2002 ide-clean-79
- Fix typo in sparc_v9 code, in ns87415, just introduced.
- Eliminate unnecessary struct hd_drive_hob_hdr those are in reality precisely the same registers as usual.
- Eliminate control_t, nowhere used type.
- Unfold ide_init_drive_cmd() at the places where it's used. This makes obvious that REQ_DRIVE_CMD gets only used on the ioctl command path.
drivers/ide/device.c +14 -0
@@ -142,4 +142,18 @@EXPORT_SYMBOL (ata_reset); +/* +* Output a complete register file. +*/ +void ata_out_regfile (struct ata_device *drive,struct hd_drive_task_hdr *rf) +{ +struct ata_channel *ch = drive->channel; + +OUT_BYTE (rf->feature, ch->io_ports[IDE_FEATURE_OFFSET ]); +OUT_BYTE (rf->sector_count, ch->io_ports[IDE_NSECTOR_OFFSET ]); +OUT_BYTE (rf->sector_number, ch->io_ports[IDE_SECTOR_OFFSET ]); +OUT_BYTE (rf->low_cylinder, ch->io_ports[IDE_LCYL_OFFSET ]); +OUT_BYTE (rf->high_cylinder, ch->io_ports[IDE_HCYL_OFFSET ]); +} +MODULE_LICENSE ("GPL" );
drivers/ide/ide.c +17 -25
57 lines not on this page · raw message
drivers/ide/ide-cd.c +3 -4
@@ -535,7 +535,7 @@/* stuff the sense request in front of our current request */ rq = &info->request_sense_request; -ide_init_drive_cmd (rq); +memset (rq,0 ,sizeof (*rq)); rq->cmd[0 ] =GPCMD_REQUEST_SENSE ; rq->cmd[4 ] = pc->buflen; rq->flags =REQ_SENSE ;
@@ -1389,9 +1389,8 @@/* Start of retry loop. */ do { - ide_init_drive_cmd(&rq); + memset(&rq, 0, sizeof(rq)); memcpy(rq.cmd, cmd, CDROM_PACKET_SIZE); - rq.flags = REQ_PC; /* FIXME --mdcki */
@@ -2276,7 +2275,7 @@struct request req;int ret; -ide_init_drive_cmd (&req); +memset (&req,0 ,sizeof (req)); req.flags =REQ_SPECIAL ; ret =ide_do_drive_cmd (drive, &req, ide_wait);
drivers/ide/ide-disk.c +0 -3
@@ -264,8 +264,6 @@ args.hobfile.high_cylinder = (block >>=8 );/* hi lba */ args.hobfile.device_head = drive->select.all; - args.hobfile.control =0x80 ; - args.taskfile.command =get_command (drive,rq_data_dir (rq));#ifdef DEBUG
@@ -728,7 +726,6 @@ args.hobfile.high_cylinder = (addr_req >>=8 ); args.hobfile.device_head =0x40 ; - args.hobfile.control =0x80 ; args.handler = task_no_data_intr;/* submit command request */
drivers/ide/ide-floppy.c +9 -8
@@ -712,10 +712,10 @@static void idefloppy_queue_pc_head (struct ata_device *drive,struct atapi_packet_command *pc,struct request *rq) { -ide_init_drive_cmd (rq); +memset (rq,0 ,sizeof (*rq)); + rq->flags =IDEFLOPPY_RQ ;/* FIXME: --mdcki */ rq->buffer = (char *) pc; - rq->flags =IDEFLOPPY_RQ ; (void )ide_do_drive_cmd (drive, rq, ide_preempt); }
@@ -1065,10 +1065,10 @@#endif ata_irq_enable (drive,1 ); -OUT_BYTE (dma_ok ?1 :0 ,IDE_FEATURE_REG );/* Use PIO/DMA */ -OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG ); -OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG ); -OUT_BYTE (drive->select.all,IDE_SELECT_REG ); +OUT_BYTE (dma_ok ?1 :0 ,IDE_FEATURE_REG );/* Use PIO/DMA */ +OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG ); +OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG ); +OUT_BYTE (drive->select.all,IDE_SELECT_REG );#ifdef CONFIG_BLK_DEV_IDEDMA if (dma_ok) {/* Begin DMA, if necessary */
@@ -1271,11 +1271,12 @@ {struct request rq; -ide_init_drive_cmd (&rq); +memset (&rq,0 ,sizeof (rq));/* FIXME: --mdcki */ rq.buffer = (char *) pc; rq.flags =IDEFLOPPY_RQ ; -return ide_do_drive_cmd (drive, &rq, ide_wait); + +return ide_do_drive_cmd (drive, &rq, ide_wait); }/*
drivers/ide/ide-tape.c +10 -9
@@ -1921,7 +1921,7 @@*/ static void idetape_queue_pc_head (struct ata_device *drive,struct atapi_packet_command *pc,struct request *rq) { -ide_init_drive_cmd (rq); +memset (rq,0 ,sizeof (*rq)); rq->buffer = (char *) pc; rq->flags =IDETAPE_PC_RQ1 ;ide_do_drive_cmd (drive, rq, ide_preempt);
@@ -3153,7 +3153,7 @@ {struct request rq; -ide_init_drive_cmd (&rq); +memset (&rq,0 ,sizeof (rq));/* FIXME: --mdcki */ rq.buffer = (char *) pc; rq.flags =IDETAPE_PC_RQ1 ;
@@ -3414,17 +3414,17 @@#if IDETAPE_DEBUG_LOG if (tape->debug_level >=2 )printk (KERN_INFO "ide-tape: idetape_queue_rw_tail: cmd=%d\n" ,cmd); -#endif /* IDETAPE_DEBUG_LOG */ +#endif #if IDETAPE_DEBUG_BUGS if (idetape_pipeline_active (tape)) {printk (KERN_ERR "ide-tape: bug: the pipeline is active in idetape_queue_rw_tail\n" );return (0 ); } -#endif /* IDETAPE_DEBUG_BUGS */ +#endif -ide_init_drive_cmd (&rq); - rq.bio = bio; +memset (&rq,0 ,sizeof (rq)); rq.flags = cmd; + rq.bio = bio; rq.sector = tape->first_frame_position; rq.nr_sectors = rq.current_nr_sectors = blocks;if (tape->onstream)
@@ -3472,7 +3472,7 @@printk (KERN_INFO "ide-tape: %s: read back logical block %d, data %x %x %x %x\n" , tape->name, logical_blk_num, *p++, *p++, *p++, *p++);#endif rq = &stage->rq; -ide_init_drive_cmd (rq); +memset (rq,0 ,sizeof (*rq)); rq->flags =IDETAPE_WRITE_RQ ; rq->sector = tape->first_frame_position; rq->nr_sectors = rq->current_nr_sectors = tape->capabilities.ctl;
@@ -3748,7 +3748,7 @@ } } rq = &new_stage->rq; -ide_init_drive_cmd (rq); +memset (rq,0 ,sizeof (*rq)); rq->flags =IDETAPE_WRITE_RQ ; rq->sector = tape->first_frame_position;/* Doesn't actually matter - We always assume sequential access */ rq->nr_sectors = rq->current_nr_sectors = blocks;
@@ -3938,7 +3938,8 @@ }if (tape->restart_speed_control_req)idetape_restart_speed_control (drive); -ide_init_drive_cmd (&rq); + +memset (&rq,0 ,sizeof (rq)); rq.flags =IDETAPE_READ_RQ ; rq.sector = tape->first_frame_position; rq.nr_sectors = rq.current_nr_sectors = blocks;
drivers/ide/ide-taskfile.c +11 -158
205 lines not on this page · raw message
drivers/ide/ioctl.c +142 -33
235 lines not on this page · raw message
drivers/ide/ns87415.c +1 -1
@@ -193,7 +193,7 @@* XXX: Reset the device, if we don't it will not respond * to select properly during first probe. */ - ata_reset(struct ata_channel *hwif); +ata_reset (hwif);#endif }
drivers/scsi/ide-scsi.c +11 -8
@@ -412,9 +412,9 @@ata_select (drive,10 );ata_irq_enable (drive,1 ); -OUT_BYTE (dma_ok,IDE_FEATURE_REG ); -OUT_BYTE (bcount >>8 ,IDE_BCOUNTH_REG ); -OUT_BYTE (bcount &0xff ,IDE_BCOUNTL_REG ); +OUT_BYTE (dma_ok,IDE_FEATURE_REG ); +OUT_BYTE (bcount >>8 ,IDE_BCOUNTH_REG ); +OUT_BYTE (bcount &0xff ,IDE_BCOUNTL_REG );if (dma_ok) {set_bit (PC_DMA_IN_PROGRESS , &pc->flags);
@@ -662,17 +662,20 @@ } } -ide_init_drive_cmd (rq); +memset (rq,0 ,sizeof (*rq)); + rq->flags =REQ_SPECIAL ; rq->special = (char *) pc; rq->bio =idescsi_dma_bio (drive, pc); - rq->flags =REQ_SPECIAL ;spin_unlock_irq (cmd->host->host_lock); - (void )ide_do_drive_cmd (drive, rq, ide_end); +ide_do_drive_cmd (drive, rq, ide_end);spin_lock_irq (cmd->host->host_lock); +return 0 ; abort: -if (pc)kfree (pc); -if (rq)kfree (rq); +if (pc) +kfree (pc); +if (rq) +kfree (rq); cmd->result =DID_ERROR <<16 ;done (cmd);
include/linux/hdreg.h +2 -11
@@ -81,18 +81,9 @@u8 low_cylinder;u8 high_cylinder;u8 device_head; -u8 command; -} __attribute__((packed)); -struct hd_drive_hob_hdr { -u8 data; -u8 feature; -u8 sector_count; -u8 sector_number; -u8 low_cylinder; -u8 high_cylinder; -u8 device_head; -u8 control; +/* FXIME: Consider moving this out from here. */ +u8 command; } __attribute__((packed));/*
include/linux/ide.h +8 -38
99 lines not on this page · raw message
PATCH 1/1 2.5.19 IDE 80
In reply to Linus TorvaldsSun Jun 2 03:31:56 CEST 2002 ide-clean-80
- Sanitize the handling of the ioctl's and fix a bug on the way in dealing with the WIN_SMART command where arguments where exchanged.
- Finally sanitize ioctl further until it turned out that we could get rid of the special request type REQ_DRIVE_CMD entierly. We are now using consistently REQ_DRIVE_ACB.
One hidden code path less again!
- Realize the ide_end_drive_cmd can be on the REQ_DRIVE_ACB only for ioctl() to a disk. Eliminate it's usage from device type driver modules.
- Remove command member from struct hd_drive_task_hdr and place it in strcut ata_taskfile. It is not common between the normal register file and HOB.
We will have to introduce some helper functions for particular command types.
drivers/block/ll_rw_blk.c +15 -5
@@ -490,11 +490,21 @@ } } -static char *rq_flags[] = {"REQ_RW" ,"REQ_RW_AHEAD" ,"REQ_BARRIER" , -"REQ_CMD" ,"REQ_NOMERGE" ,"REQ_STARTED" , -"REQ_DONTPREP" ,"REQ_QUEUED" ,"REQ_DRIVE_CMD" , -"REQ_DRIVE_ACB" ,"REQ_PC" ,"REQ_BLOCK_PC" , -"REQ_SENSE" ,"REQ_SPECIAL" }; +static char *rq_flags[] = { +"REQ_RW" , +"REQ_RW_AHEAD" , +"REQ_BARRIER" , +"REQ_CMD" , +"REQ_NOMERGE" , +"REQ_STARTED" , +"REQ_DONTPREP" , +"REQ_QUEUED" , +"REQ_DRIVE_ACB" , +"REQ_PC" , +"REQ_BLOCK_PC" , +"REQ_SENSE" , +"REQ_SPECIAL" +};void blk_dump_rq_flags (struct request *rq,char *msg) {
drivers/ide/ide.c +29 -92
174 lines not on this page · raw message
drivers/ide/ide-disk.c +19 -19
@@ -170,7 +170,7 @@ args.taskfile.device_head = head; args.taskfile.device_head |= drive->select.all; - args.taskfile.command =get_command (drive,rq_data_dir (rq)); + args.cmd =get_command (drive,rq_data_dir (rq));#ifdef DEBUG printk("%s: %sing: ", drive->name,
@@ -211,7 +211,7 @@ args.taskfile.device_head = ((block >>8 ) &0x0f ); args.taskfile.device_head |= drive->select.all; - args.taskfile.command =get_command (drive,rq_data_dir (rq)); + args.cmd =get_command (drive,rq_data_dir (rq));#ifdef DEBUG printk("%s: %sing: ", drive->name,
@@ -264,7 +264,7 @@ args.hobfile.high_cylinder = (block >>=8 );/* hi lba */ args.hobfile.device_head = drive->select.all; - args.taskfile.command =get_command (drive,rq_data_dir (rq)); + args.cmd =get_command (drive,rq_data_dir (rq));#ifdef DEBUG printk("%s: %sing: ", drive->name,
@@ -355,7 +355,7 @@memset (&args,0 ,sizeof (args)); - args.taskfile.command =WIN_DOORLOCK ; + args.cmd =WIN_DOORLOCK ;ide_cmd_type_parser (&args);/*
@@ -377,9 +377,9 @@memset (&args,0 ,sizeof (args));if (drive->id->cfs_enable_2 &0x2400 ) - args.taskfile.command =WIN_FLUSH_CACHE_EXT ; + args.cmd =WIN_FLUSH_CACHE_EXT ;else - args.taskfile.command =WIN_FLUSH_CACHE ; + args.cmd =WIN_FLUSH_CACHE ;ide_cmd_type_parser (&args);
@@ -395,7 +395,7 @@invalidate_bdev (inode->i_bdev,0 );memset (&args,0 ,sizeof (args)); - args.taskfile.command =WIN_DOORUNLOCK ; + args.cmd =WIN_DOORUNLOCK ;ide_cmd_type_parser (&args); if (drive->doorlocking &&
@@ -444,7 +444,7 @@memset (&args,0 ,sizeof (args)); args.taskfile.sector_count = arg; - args.taskfile.command =WIN_SETMULT ; + args.cmd =WIN_SETMULT ;ide_cmd_type_parser (&args);if (!ide_raw_taskfile (drive, &args)) {
@@ -475,7 +475,7 @@memset (&args,0 ,sizeof (args)); args.taskfile.feature = (arg) ?SETFEATURES_EN_WCACHE :SETFEATURES_DIS_WCACHE ; - args.taskfile.command =WIN_SETFEATURES ; + args.cmd =WIN_SETFEATURES ;ide_cmd_type_parser (&args);ide_raw_taskfile (drive, &args);
@@ -489,7 +489,7 @@struct ata_taskfile args;memset (&args,0 ,sizeof (args)); - args.taskfile.command =WIN_STANDBYNOW1 ; + args.cmd =WIN_STANDBYNOW1 ;ide_cmd_type_parser (&args);return ide_raw_taskfile (drive, &args);
@@ -502,7 +502,7 @@memset (&args,0 ,sizeof (args)); args.taskfile.feature = (arg)?SETFEATURES_EN_AAM :SETFEATURES_DIS_AAM ; args.taskfile.sector_count = arg; - args.taskfile.command =WIN_SETFEATURES ; + args.cmd =WIN_SETFEATURES ;ide_cmd_type_parser (&args);ide_raw_taskfile (drive, &args);
@@ -622,14 +622,14 @@/* Create IDE/ATA command request structure */ memset (&args,0 ,sizeof (args)); args.taskfile.device_head =0x40 ; - args.taskfile.command =WIN_READ_NATIVE_MAX ; + args.cmd =WIN_READ_NATIVE_MAX ; args.handler = task_no_data_intr;/* submit command request */ ide_raw_taskfile (drive, &args);/* if OK, compute maximum address value */ -if ((args.taskfile.command &0x01 ) ==0 ) { +if ((args.cmd &0x01 ) ==0 ) { addr = ((args.taskfile.device_head &0x0f ) <<24 ) | (args.taskfile.high_cylinder <<16 ) | (args.taskfile.low_cylinder <<8 )
@@ -650,14 +650,14 @@memset (&args,0 ,sizeof (args)); args.taskfile.device_head =0x40 ; - args.taskfile.command =WIN_READ_NATIVE_MAX_EXT ; + args.cmd =WIN_READ_NATIVE_MAX_EXT ; args.handler = task_no_data_intr;/* submit command request */ ide_raw_taskfile (drive, &args);/* if OK, compute maximum address value */ -if ((args.taskfile.command &0x01 ) ==0 ) { +if ((args.cmd &0x01 ) ==0 ) {u32 high = (args.hobfile.high_cylinder <<16 ) | (args.hobfile.low_cylinder <<8 ) | args.hobfile.sector_number;
@@ -691,12 +691,12 @@ args.taskfile.high_cylinder = (addr_req >>16 ); args.taskfile.device_head = ((addr_req >>24 ) &0x0f ) |0x40 ; - args.taskfile.command =WIN_SET_MAX ; + args.cmd =WIN_SET_MAX ; args.handler = task_no_data_intr;/* submit command request */ ide_raw_taskfile (drive, &args);/* if OK, read new maximum address value */ -if ((args.taskfile.command &0x01 ) ==0 ) { +if ((args.cmd &0x01 ) ==0 ) { addr_set = ((args.taskfile.device_head &0x0f ) <<24 ) | (args.taskfile.high_cylinder <<16 ) | (args.taskfile.low_cylinder <<8 )
@@ -719,7 +719,7 @@ args.taskfile.low_cylinder = (addr_req >>=8 ); args.taskfile.high_cylinder = (addr_req >>=8 ); args.taskfile.device_head =0x40 ; - args.taskfile.command =WIN_SET_MAX_EXT ; + args.cmd =WIN_SET_MAX_EXT ; args.hobfile.sector_number = (addr_req >>=8 ); args.hobfile.low_cylinder = (addr_req >>=8 );
@@ -731,7 +731,7 @@/* submit command request */ ide_raw_taskfile (drive, &args);/* if OK, compute maximum address value */ -if ((args.taskfile.command &0x01 ) ==0 ) { +if ((args.cmd &0x01 ) ==0 ) {u32 high = (args.hobfile.high_cylinder <<16 ) | (args.hobfile.low_cylinder <<8 ) | args.hobfile.sector_number;
drivers/ide/ide-floppy.c +6 -2
@@ -620,7 +620,7 @@#if IDEFLOPPY_DEBUG_LOG printk (KERN_INFO "Reached idefloppy_end_request\n" ); -#endif /* IDEFLOPPY_DEBUG_LOG */ +#endif switch (uptodate) {case 0 : error =IDEFLOPPY_ERROR_GENERAL ;break ;
@@ -632,12 +632,16 @@/* Why does this happen? */ if (!rq)return 0 ; +if (!(rq->flags &IDEFLOPPY_RQ )) {ide_end_request (drive, rq, uptodate);return 0 ; } + rq->errors = error; -ide_end_drive_cmd (drive, rq,0 ); +blkdev_dequeue_request (rq); + drive->rq =NULL ; +end_that_request_last (rq);return 0 ; }
drivers/ide/ide-tape.c +5 -2
@@ -1864,9 +1864,12 @@idetape_increase_max_pipeline_stages (drive); } } -ide_end_drive_cmd (drive, rq,0 ); +blkdev_dequeue_request (rq); + drive->rq =NULL ; +end_that_request_last (rq); +if (remove_stage) -idetape_remove_stage_head (drive); +idetape_remove_stage_head (drive);if (tape->active_data_request ==NULL )clear_bit (IDETAPE_PIPELINE_ACTIVE , &tape->flags);spin_unlock_irqrestore (&tape->spinlock, flags);
drivers/ide/ide-taskfile.c +25 -33
134 lines not on this page · raw message
drivers/ide/ioctl.c +55 -71
183 lines not on this page · raw message
drivers/ide/pcidma.c +2 -1
@@ -541,9 +541,10 @@ide_set_handler (drive, ide_dma_intr,WAIT_CMD , dma_timer_expiry);/* issue cmd to drive */ if ((rq->flags &REQ_DRIVE_ACB ) && (drive->addressing ==1 )) { +/* FIXME: this should never happen */ struct ata_taskfile *args = rq->special; -outb (args->taskfile.command,IDE_COMMAND_REG ); +outb (args->cmd,IDE_COMMAND_REG ); }else if (drive->addressing) {outb (reading ?WIN_READDMA_EXT :WIN_WRITEDMA_EXT ,IDE_COMMAND_REG ); }else {
drivers/ide/pdc4030.c +2 -2
@@ -630,7 +630,7 @@outb (taskfile->low_cylinder,IDE_LCYL_REG );outb (taskfile->high_cylinder,IDE_HCYL_REG );outb (taskfile->device_head,IDE_SELECT_REG ); -outb (taskfile->command,IDE_COMMAND_REG ); +outb (args->cmd,IDE_COMMAND_REG );switch (rq_data_dir (rq)) {case READ :
@@ -708,7 +708,7 @@ args.taskfile.low_cylinder = (block>>=8 ); args.taskfile.high_cylinder = (block>>=8 ); args.taskfile.device_head = ((block>>8 )&0x0f )|drive->select.all; - args.taskfile.command = (rq_data_dir (rq)==READ )?PROMISE_READ :PROMISE_WRITE ; + args.cmd = (rq_data_dir (rq)==READ )?PROMISE_READ :PROMISE_WRITE ;/* We can't call ide_cmd_type_parser here, since it won't understand our command, but that doesn't matter, since we don't use the
drivers/ide/tcq.c +7 -7
@@ -60,7 +60,7 @@struct ata_taskfile *args = rq->special;ide__sti (); -ide_end_drive_cmd (drive, rq,GET_ERR ()); +ide_end_drive_cmd (drive, rq);kfree (args);return ide_stopped;
@@ -118,7 +118,7 @@BUG_ON (!rq); rq->special = args; - args->taskfile.command =WIN_NOP ; + args->cmd =WIN_NOP ; args->handler = tcq_nop_handler; args->command_type =IDE_DRIVE_TASK_NO_DATA ;
@@ -407,7 +407,7 @@memset (&args,0 ,sizeof (args)); args.taskfile.feature =0x01 ; - args.taskfile.command =WIN_NOP ; + args.cmd =WIN_NOP ;ide_cmd_type_parser (&args);/*
@@ -442,7 +442,7 @@memset (&args,0 ,sizeof (args)); args.taskfile.feature =SETFEATURES_EN_WCACHE ; - args.taskfile.command =WIN_SETFEATURES ; + args.cmd =WIN_SETFEATURES ;ide_cmd_type_parser (&args);if (ide_raw_taskfile (drive, &args)) {
@@ -456,7 +456,7 @@*/ memset (&args,0 ,sizeof (args)); args.taskfile.feature =SETFEATURES_DIS_RI ; - args.taskfile.command =WIN_SETFEATURES ; + args.cmd =WIN_SETFEATURES ;ide_cmd_type_parser (&args);if (ide_raw_taskfile (drive, &args)) {
@@ -470,7 +470,7 @@*/ memset (&args,0 ,sizeof (args)); args.taskfile.feature =SETFEATURES_EN_SI ; - args.taskfile.command =WIN_SETFEATURES ; + args.cmd =WIN_SETFEATURES ;ide_cmd_type_parser (&args);if (ide_raw_taskfile (drive, &args)) {
@@ -554,7 +554,7 @@ata_irq_enable (drive,0 );#endif -OUT_BYTE (args->taskfile.command,IDE_COMMAND_REG ); +OUT_BYTE (args->cmd,IDE_COMMAND_REG );if (wait_altstat (drive, &stat,BUSY_STAT )) {ide_dump_status (drive, rq,"queued start" , stat);
drivers/scsi/ide-scsi.c +5 -1
@@ -242,7 +242,11 @@ide_end_request (drive, rq, uptodate);return 0 ; } -ide_end_drive_cmd (drive, rq,0 ); + +blkdev_dequeue_request (rq); + drive->rq =NULL ; +end_that_request_last (rq); +if (rq->errors >=ERROR_MAX ) { pc->s.scsi_cmd->result =DID_ERROR <<16 ;if (log)
include/linux/blkdev.h +0 -2
@@ -81,7 +81,6 @@/* * for ATA/ATAPI devices */ - __REQ_DRIVE_CMD, __REQ_DRIVE_ACB, __REQ_PC, /* packet command (special) */
@@ -101,7 +100,6 @@#define REQ_STARTED (1 << __REQ_STARTED)#define REQ_DONTPREP (1 << __REQ_DONTPREP)#define REQ_QUEUED (1 << __REQ_QUEUED) -#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)#define REQ_DRIVE_ACB (1 << __REQ_DRIVE_ACB)#define REQ_PC (1 << __REQ_PC)#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
include/linux/hdreg.h +0 -4
@@ -74,16 +74,12 @@#define IDE_DRIVE_TASK_RAW_WRITE 4struct hd_drive_task_hdr { -u8 data;u8 feature;u8 sector_count;u8 sector_number;u8 low_cylinder;u8 high_cylinder;u8 device_head; - -/* FXIME: Consider moving this out from here. */ -u8 command; } __attribute__((packed));/*
include/linux/ide.h +5 -4
@@ -253,11 +253,11 @@ unsigned all : 8; /* all of the bits together */struct {#if defined(__LITTLE_ENDIAN_BITFIELD) -unsigned XXX_head :4 ;/* always zeros here */ +unsigned head :4 ;/* always zeros here */ unsigned unit :1 ;/* drive select number: 0/1 */ -unsigned XXX_bit5 :1 ;/* always 1 */ +unsigned bit5 :1 ;/* always 1 */ unsigned lba :1 ;/* using LBA instead of CHS */ -unsigned XXX_bit7 :1 ;/* always 1 */ +unsigned bit7 :1 ;/* always 1 */ #elif defined(__BIG_ENDIAN_BITFIELD)unsigned bit7 :1 ;unsigned lba :1 ;
@@ -666,11 +666,12 @@/* * Clean up after success/failure of an explicit drive cmd. */ -extern void ide_end_drive_cmd (struct ata_device *,struct request *,u8 ); +extern void ide_end_drive_cmd (struct ata_device *,struct request *);struct ata_taskfile {struct hd_drive_task_hdr taskfile;struct hd_drive_task_hdr hobfile; +u8 cmd;/* actual ATA command */ int command_type;ide_startstop_t (*prehandler)(struct ata_device *,struct request *);ide_startstop_t (*handler)(struct ata_device *,struct request *);
Re: [PATCH] 2.5.19 IDE 78
In reply to Linus TorvaldsQuoted 5 lines · Paul Mackerras
Martin,
I think you have a typo here:
Quoted 9 lines
drivers/ide/ide-pmac.c line 437
Quoted 9 lines
diff -urN
linux-2.5.19/drivers/ide/ide-pmac.clinux/drivers/ide/ide-pmac.cdrivers/ide/ide-pmac.c +1
-1@@ -434,7 +434,7 @@ goto out; }udelay (10 ); -OUT_BYTE (drive->ctl |2 ,IDE_CONTROL_REG ); +ata_irq_enale (drive,0 );
For sure not. The nIEN bit is *negated* on the part of the device - please look at the ata_irq_enable() functions definition. I have explained it there.
Quoted 1 line
ata_irq_enablesurely?
The toggle is the second parameter becouse I didn't wan't to provide two functions. - 0 measn disable it 1 means enable it.
Quoted 3 lines
Also, we need the patch below now that ata_channel.active is a pointer.
That actually is obviously correct - thank's I will include it.
Quoted 38 lines
Paul.
diff -urN
linux-2.5/drivers/ide/ide-pmac.cpmac-2.5/drivers/ide/ide-pmac.cdrivers/ide/ide-pmac.c +4
-4@@ -1584,9 +1584,9 @@*/ if (used_dma && !ide_spin_wait_hwgroup (drive)) {/* Lock HW group */ -set_bit (IDE_BUSY , &drive->channel->active); +set_bit (IDE_BUSY , drive->channel->active);pmac_ide_check_dma (drive); -clear_bit (IDE_BUSY , &drive->channel->active); +clear_bit (IDE_BUSY , drive->channel->active);spin_unlock_irq (drive->channel->lock); }#endif @@ -1633,7 +1633,7 @@return ; else {/* Lock HW group */ -set_bit (IDE_BUSY , &drive->channel->active); +set_bit (IDE_BUSY , drive->channel->active);/* Stop the device */ idepmac_sleep_device (drive, idx, base);spin_unlock_irq (drive->channel->lock);@@ -1663,7 +1663,7 @@/* We resume processing on the lock group */ spin_lock_irq (drive->channel->lock); -clear_bit (IDE_BUSY , &drive->channel->active); +clear_bit (IDE_BUSY , drive->channel->active);if (!list_empty (&drive->queue.queue_head))do_ide_request (&drive->queue);spin_unlock_irq (drive->channel->lock);
Signature · 3 lines
- phone: +49 214 8656 283 - job: eVision-Ventures AG, LEV .de (MY OPINIONS ARE MY OWN!) - langs: de_DE.ISO8859-1, en_US, pl_PL.ISO8859-2, last ressort: ru_RU.KOI8-R
Re: [PATCH] 2.5.19 IDE 78
Quoted 6 lines · Martin Dalecki
Quoted 5 lines · Paul Mackerras
Martin,
I think you have a typo here:
Quoted 10 lines
Quoted 9 lines
drivers/ide/ide-pmac.c line 437
Quoted 9 lines
diff -urN
linux-2.5.19/drivers/ide/ide-pmac.clinux/drivers/ide/ide-pmac.cdrivers/ide/ide-pmac.c +1
-1@@ -434,7 +434,7 @@ goto out; }udelay (10 ); -OUT_BYTE (drive->ctl |2 ,IDE_CONTROL_REG ); +ata_irq_enale (drive,0 );
I think Paul was talking about ata_irq_enale() ;)
Quoted 8 lines
For sure not. The nIEN bit is *negated* on the part of the device - please look at the
ata_irq_enable()functions definition. I have explained it there.Quoted 1 line
ata_irq_enablesurely?The toggle is the second parameter becouse I didn't wan't to provide two functions. - 0 measn disable it 1 means enable it.>
--
Bartlomiej
Re: [PATCH] 2.5.19 IDE 78
In reply to Martin DaleckiQuoted 6 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- OUT_BYTE(drive->ctl | 2, IDE_CONTROL_REG); + ata_irq_enale(drive, 0);For sure not. The nIEN bit is *negated* on the part of the device - please look at the
ata_irq_enable()functions definition. I have explained it there.
Martin, that's a bit of your patch I was quoting. I was just trying to point out that you wrote "ata_irq_enale" instead of "ata_irq_enable".
Paul.
PATCH 1/1 2.5.19 IDE 81
In reply to Linus TorvaldsSun Jun 2 07:29:17 CEST 2002 ide-clean-81
- Don't use ata_taskfiles cmd field for drive status reporting, we can now simply use drive->status instead.
- Unify command type parser entries which could be unified due to the unification of corresponding interrupt handlers.
- Eliminate reading parameter from ata_do_udma(). We have this information already in the rq. This allows us to merge several methods.
- Rename XXX_udma to udma_setup, since we have finally settled up on this semantics.
- Simplify tons of host chip code by removing wrapper functions.
drivers/ide/aec62xx.c +4 -4
@@ -150,7 +150,7 @@ }#ifdef CONFIG_BLK_DEV_IDEDMA -static int aec62xx_dmaproc (struct ata_device *drive) +static int aec62xx_udma_setup (struct ata_device *drive) {u32 bmide =pci_resource_start (drive->channel->pci_dev,4 );short speed;
@@ -244,8 +244,8 @@ {int i; - ch->tuneproc = &aec62xx_tune_drive; - ch->speedproc = &aec_set_drive; + ch->tuneproc = aec62xx_tune_drive; + ch->speedproc = aec_set_drive; ch->autodma =0 ; ch->io_32bit =1 ;
@@ -259,7 +259,7 @@#ifdef CONFIG_BLK_DEV_IDEDMA if (ch->dma_base) { ch->highmem =1 ; - ch->XXX_udma = aec62xx_dmaproc; + ch->udma_setup = aec62xx_udma_setup;#ifdef CONFIG_IDEDMA_AUTO if (!noautodma) ch->autodma =1 ;
drivers/ide/alim15x3.c +5 -10
@@ -199,7 +199,7 @@return !ali15x3_tune_chipset (drive, mode); } -static int ali15x3_config_drive_for_dma (struct ata_device *drive) +static int ali15x3_udma_setup (struct ata_device *drive) {struct hd_driveid *id = drive->id;struct ata_channel *hwif = drive->channel;
@@ -261,17 +261,12 @@ return 0; } -static int ali15x3_udma_write (struct ata_device *drive,struct request *rq) +static int ali15x3_udma_init (struct ata_device *drive,struct request *rq) {if ((m5229_revision <0xC2 ) && (drive->type !=ATA_DISK ))return 1 ;/* try PIO instead of DMA */ -return ata_do_udma (0 , drive, rq); -} - -static int ali15x3_dmaproc (struct ata_device *drive) -{ -return ali15x3_config_drive_for_dma (drive); +return udma_pci_init (drive, rq); }#endif
@@ -447,8 +442,8 @@/* * M1543C or newer for DMAing */ - hwif->udma_write = ali15x3_udma_write; - hwif->XXX_udma = ali15x3_dmaproc; + hwif->udma_init = ali15x3_udma_init; + hwif->udma_setup = ali15x3_udma_setup; hwif->autodma =1 ; }
drivers/ide/amd74xx.c +2 -2
@@ -177,7 +177,7 @@ }#ifdef CONFIG_BLK_DEV_IDEDMA -int amd74xx_dmaproc (struct ata_device *drive) +static int amd74xx_udma_setup (struct ata_device *drive) {short w80 = drive->channel->udma_four;
@@ -291,7 +291,7 @@#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) { hwif->highmem =1 ; - hwif->XXX_udma = amd74xx_dmaproc; + hwif->udma_setup = amd74xx_udma_setup;# ifdef CONFIG_IDEDMA_AUTO if (!noautodma) hwif->autodma =1 ;
drivers/ide/cmd64x.c +7 -7
@@ -627,7 +627,7 @@return 0 ; } -static int cmd680_dmaproc (struct ata_device *drive) +static int cmd680_udma_setup (struct ata_device *drive) {return cmd64x_config_drive_for_dma (drive); }
@@ -680,7 +680,7 @@return (dma_stat &4 ) ==4 ;/* return 1 if INTR asserted */ } -static int cmd64x_dmaproc (struct ata_device *drive) +static int cmd64x_udma_setup (struct ata_device *drive) {return cmd64x_config_drive_for_dma (drive); }
@@ -703,7 +703,7 @@* ASUS P55T2P4D with CMD646 chipset revision 0x01 requires the old * event order for DMA transfers. */ -static int cmd646_1_dmaproc (struct ata_device *drive) +static int cmd646_1_udma_setup (struct ata_device *drive) {return cmd64x_config_drive_for_dma (drive); }
@@ -903,7 +903,7 @@ hwif->busproc = cmd680_busproc;#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) - hwif->XXX_udma = cmd680_dmaproc; + hwif->udma_setup = cmd680_udma_setup;#endif hwif->resetproc = cmd680_reset; hwif->speedproc = cmd680_tune_chipset;
@@ -914,7 +914,7 @@case PCI_DEVICE_ID_CMD_643 :#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) { - hwif->XXX_udma = cmd64x_dmaproc; + hwif->udma_setup = cmd64x_udma_setup; hwif->udma_stop = cmd64x_udma_stop; hwif->udma_irq_status = cmd64x_udma_irq_status; }
@@ -927,10 +927,10 @@#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) {if (class_rev ==0x01 ) { - hwif->XXX_udma = cmd646_1_dmaproc; + hwif->udma_setup = cmd646_1_udma_setup; hwif->udma_stop = cmd646_1_udma_stop; }else { - hwif->XXX_udma = cmd64x_dmaproc; + hwif->udma_setup = cmd64x_udma_setup; hwif->udma_stop = cmd64x_udma_stop; hwif->udma_irq_status = cmd64x_udma_irq_status; }
drivers/ide/cs5530.c +2 -2
@@ -191,7 +191,7 @@return 0 ; } -int cs5530_dmaproc (struct ata_device *drive) +static int cs5530_udma_setup (struct ata_device *drive) {return cs5530_config_dma (drive); }
@@ -292,7 +292,7 @@unsigned int basereg, d0_timings;#ifdef CONFIG_BLK_DEV_IDEDMA - hwif->XXX_udma = cs5530_dmaproc; + hwif->udma_setup = cs5530_udma_setup; hwif->highmem =1 ;#else hwif->autodma =0 ;
drivers/ide/cy82c693.c +2 -2
@@ -236,7 +236,7 @@/* * used to set DMA mode for CY82C693 (single and multi modes) */ -static int cy82c693_dmaproc (struct ata_device *drive) +static int cy82c693_udma_setup (struct ata_device *drive) {/* * Set dma mode for drive everything else is done by the defaul func.
@@ -443,7 +443,7 @@#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) { hwif->highmem =1 ; - hwif->XXX_udma = cy82c693_dmaproc; + hwif->udma_setup = cy82c693_udma_setup;if (!noautodma) hwif->autodma =1 ; }
drivers/ide/hpt34x.c +13 -29
77 lines not on this page · raw message
drivers/ide/hpt366.c +6 -25
@@ -836,7 +836,7 @@ } } -static int config_drive_xfer_rate (struct ata_device *drive) +static int hpt3xx_udma_setup (struct ata_device *drive) {struct hd_driveid *id = drive->id;int on =1 ;
@@ -903,15 +903,6 @@pci_write_config_byte (drive->channel->pci_dev,0x5a , reg5ah & ~0x10 ); } -/* -* This is specific to the HPT366 UDMA bios chipset -* by HighPoint|Triones Technologies, Inc. -*/ -static int hpt366_dmaproc (struct ata_device *drive) -{ -return config_drive_xfer_rate (drive); -} -static void do_udma_start (struct ata_device *drive) {struct ata_channel *ch = drive->channel;
@@ -992,11 +983,6 @@return (dma_stat &7 ) !=4 ? (0x10 | dma_stat) :0 ;/* verify good DMA status */ } -static int hpt370_dmaproc (struct ata_device *drive) -{ -return config_drive_xfer_rate (drive); -} -static int hpt374_udma_stop (struct ata_device *drive) {struct ata_channel *ch = drive->channel;
@@ -1019,11 +1005,6 @@ return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0; /* verify good DMA status */ } - -static int hpt374_dmaproc (struct ata_device *drive) -{ -return config_drive_xfer_rate (drive); -}#endif /*
@@ -1364,27 +1345,27 @@if (hpt_min_rev (dev,7 )) { ch->udma_stop = hpt374_udma_stop; - ch->XXX_udma = hpt374_dmaproc; + ch->udma_setup = hpt3xx_udma_setup; }else if (hpt_min_rev (dev,5 )) { ch->udma_stop = hpt374_udma_stop; - ch->XXX_udma = hpt374_dmaproc; + ch->udma_setup = hpt3xx_udma_setup; }else if (hpt_min_rev (dev,3 )) { ch->udma_start = hpt370_udma_start; ch->udma_stop = hpt370_udma_stop; ch->udma_timeout = hpt370_udma_timeout; ch->udma_irq_lost = hpt370_udma_irq_lost; - ch->XXX_udma = hpt370_dmaproc; + ch->udma_setup = hpt3xx_udma_setup; } }else if (hpt_min_rev (dev,2 )) { ch->udma_irq_lost = hpt366_udma_irq_lost;// ch->resetproc = hpt3xx_reset; // ch->busproc = hpt3xx_tristate; - ch->XXX_udma = hpt366_dmaproc; + ch->udma_setup = hpt3xx_udma_setup; }else { ch->udma_irq_lost = hpt366_udma_irq_lost;// ch->resetproc = hpt3xx_reset; // ch->busproc = hpt3xx_tristate; - ch->XXX_udma = hpt366_dmaproc; + ch->udma_setup = hpt3xx_udma_setup; }if (!noautodma) ch->autodma =1 ;
drivers/ide/icside.c +3 -4
@@ -544,7 +544,7 @@return 0 ; } -static int icside_dma_write (struct ata_device *drive,struct request *rq) +static int icside_dma_init (struct ata_device *drive,struct request *rq) {struct ata_channel *ch = drive->channel;unsigned int cmd;
@@ -612,12 +612,11 @@ ch->dmatable_cpu =NULL ; ch->dmatable_dma =0 ; ch->speedproc = icside_set_speed; - ch->XXX_udma = icside_dma_check; + ch->udma_setup = icside_dma_check; ch->udma_enable = icside_dma_enable; ch->udma_start = icside_dma_start; ch->udma_stop = icside_dma_stop; - ch->udma_read = icside_dma_read; - ch->udma_write = icside_dma_write; + ch->udma_init = icside_dma_init; ch->udma_irq_status = icside_irq_status; ch->udma_timeout = icside_dma_timeout; ch->udma_irq_lost = icside_irq_lost;
drivers/ide/ide.c +28 -27
73 lines not on this page · raw message
drivers/ide/ide-cd.c +2 -4
@@ -736,10 +736,8 @@return startstop;if (info->dma) { -if (info->cmd ==READ ) - info->dma = !udma_read (drive, rq); -else if (info->cmd ==WRITE ) - info->dma = !udma_write (drive, rq); +if (info->cmd ==READ || info->cmd ==WRITE ) + info->dma = !udma_init (drive, rq);else printk ("ide-cd: DMA set, but not allowed\n" ); }
drivers/ide/ide-disk.c +5 -5
@@ -517,7 +517,7 @@if (!drive->driver)return -EPERM ; -if (!drive->channel->XXX_udma) +if (!drive->channel->udma_setup)return -EPERM ;if (arg == drive->queue_depth && drive->using_tcq)
@@ -629,7 +629,7 @@ide_raw_taskfile (drive, &args);/* if OK, compute maximum address value */ -if ((args.cmd &0x01 ) ==0 ) { +if (!(drive->status &ERR_STAT )) { addr = ((args.taskfile.device_head &0x0f ) <<24 ) | (args.taskfile.high_cylinder <<16 ) | (args.taskfile.low_cylinder <<8 )
@@ -657,7 +657,7 @@ide_raw_taskfile (drive, &args);/* if OK, compute maximum address value */ -if ((args.cmd &0x01 ) ==0 ) { +if (!(drive->status &ERR_STAT )) {u32 high = (args.hobfile.high_cylinder <<16 ) | (args.hobfile.low_cylinder <<8 ) | args.hobfile.sector_number;
@@ -696,7 +696,7 @@/* submit command request */ ide_raw_taskfile (drive, &args);/* if OK, read new maximum address value */ -if ((args.cmd &0x01 ) ==0 ) { +if (!(drive->status &ERR_STAT )) { addr_set = ((args.taskfile.device_head &0x0f ) <<24 ) | (args.taskfile.high_cylinder <<16 ) | (args.taskfile.low_cylinder <<8 )
@@ -731,7 +731,7 @@/* submit command request */ ide_raw_taskfile (drive, &args);/* if OK, compute maximum address value */ -if ((args.cmd &0x01 ) ==0 ) { +if (!(drive->status &ERR_STAT )) {u32 high = (args.hobfile.high_cylinder <<16 ) | (args.hobfile.low_cylinder <<8 ) | args.hobfile.sector_number;
drivers/ide/ide-floppy.c +2 -6
@@ -1060,12 +1060,8 @@if (test_and_clear_bit (PC_DMA_ERROR , &pc->flags))udma_enable (drive,0 ,1 ); -if (test_bit (PC_DMA_RECOMMENDED , &pc->flags) && drive->using_dma) { -if (test_bit (PC_WRITING , &pc->flags)) - dma_ok = !udma_write (drive, rq); -else - dma_ok = !udma_read (drive, rq); - } +if (test_bit (PC_DMA_RECOMMENDED , &pc->flags) && drive->using_dma) + dma_ok = !udma_init (drive, rq);#endif ata_irq_enable (drive,1 );
drivers/ide/ide-pmac.c +16 -23
@@ -260,11 +260,9 @@static void pmac_udma_enable (struct ata_device *drive,int on,int verbose);static int pmac_udma_start (struct ata_device *drive,struct request *rq);static int pmac_udma_stop (struct ata_device *drive); -static int pmac_do_udma (unsigned int reading,struct ata_device *drive,struct request *rq); -static int pmac_udma_read (struct ata_device *drive,struct request *rq); -static int pmac_udma_write (struct ata_device *drive,struct request *rq); +static int pmac_udma_init (struct ata_device *drive,struct request *rq);static int pmac_udma_irq_status (struct ata_device *drive); -static int pmac_ide_dmaproc (struct ata_device *drive); +static int pmac_udma_setup (struct ata_device *drive);static int pmac_ide_build_dmatable (struct ata_device *drive,struct request *rq,int ix,int wr);static int pmac_ide_tune_chipset (struct ata_device *drive,byte speed);static void pmac_ide_tuneproc (struct ata_device *drive,byte pio);
@@ -334,10 +332,9 @@ ide_hwifs[ix].udma_enable = pmac_udma_enable; ide_hwifs[ix].udma_start = pmac_udma_start; ide_hwifs[ix].udma_stop = pmac_udma_stop; - ide_hwifs[ix].udma_read = pmac_udma_read; - ide_hwifs[ix].udma_write = pmac_udma_write; + ide_hwifs[ix].udma_init = pmac_udma_init; ide_hwifs[ix].udma_irq_status = pmac_udma_irq_status; - ide_hwifs[ix].XXX_udma = pmac_ide_dmaproc; + ide_hwifs[ix].udma_setup = pmac_udma_setup;#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO if (!noautodma) ide_hwifs[ix].autodma =1 ;
@@ -1043,10 +1040,9 @@ ide_hwifs[ix].udma_enable = pmac_udma_enable; ide_hwifs[ix].udma_start = pmac_udma_start; ide_hwifs[ix].udma_stop = pmac_udma_stop; - ide_hwifs[ix].udma_read = pmac_udma_read; - ide_hwifs[ix].udma_write = pmac_udma_write; + ide_hwifs[ix].udma_init = pmac_udma_init; ide_hwifs[ix].udma_irq_status = pmac_udma_irq_status; - ide_hwifs[ix].XXX_udma = pmac_ide_dmaproc; + ide_hwifs[ix].udma_setup = pmac_udma_setup;#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO if (!noautodma) ide_hwifs[ix].autodma =1 ;
@@ -1405,11 +1401,12 @@return (dstat & (RUN |DEAD |ACTIVE )) !=RUN ; } -static int pmac_do_udma (unsigned int reading,struct ata_device *drive,struct request *rq) +static int pmac_udma_init (struct ata_device *drive,struct request *rq) {int ix, ata4;volatile struct dbdma_regs *dma; -byte unit = (drive->select.b.unit &0x01 ); +u8 unit = (drive->select.b.unit &0x01 ); +int reading;/* Can we stuff a pointer to our intf structure in config_data * or select_data in hwif ?
@@ -1417,6 +1414,12 @@ ix =pmac_ide_find (drive);if (ix <0 )return 0 ; + +if (rq_data_dir (rq) ==READ ) + reading =1 ; +else + reading =0 ; + dma = pmac_ide[ix].dma_regs; ata4 = (pmac_ide[ix].kind == controller_kl_ata4 || pmac_ide[ix].kind == controller_kl_ata4_80);
@@ -1447,16 +1450,6 @@return udma_start (drive, rq); } -static int pmac_udma_read (struct ata_device *drive,struct request *rq) -{ -return pmac_do_udma (1 , drive, rq); -} - -static int pmac_udma_write (struct ata_device *drive,struct request *rq) -{ -return pmac_do_udma (0 , drive, rq); -} -/* * FIXME: This should be attached to a channel as we can see now! */
@@ -1514,7 +1507,7 @@return 0 ; } -static int pmac_ide_dmaproc (struct ata_device *drive) +static int pmac_udma_setup (struct ata_device *drive) {/* Change this to better match ide-dma.c */ pmac_ide_check_dma (drive);
drivers/ide/ide-tape.c +2 -6
@@ -2258,12 +2258,8 @@printk (KERN_WARNING "ide-tape: DMA disabled, reverting to PIO\n" ); udma_enable(drive, 0, 1); } -if (test_bit (PC_DMA_RECOMMENDED , &pc->flags) && drive->using_dma) { -if (test_bit (PC_WRITING , &pc->flags)) - dma_ok = !udma_write (drive, rq); -else - dma_ok = !udma_read (drive, rq); - } +if (test_bit (PC_DMA_RECOMMENDED , &pc->flags) && drive->using_dma) + dma_ok = !udma_init (drive, rq);#endif ata_irq_enable (drive,1 );
drivers/ide/ide-taskfile.c +48 -60
227 lines not on this page · raw message
drivers/ide/ioctl.c +1 -1
@@ -235,7 +235,7 @@if (!drive->driver)return -EPERM ; -if (!drive->id || !(drive->id->capability &1 ) || !drive->channel->XXX_udma) +if (!drive->id || !(drive->id->capability &1 ) || !drive->channel->udma_setup)return -EPERM ;if (ide_spin_wait_hwgroup (drive))
drivers/ide/main.c +4 -5
@@ -520,12 +520,11 @@ ch->ata_write = old.ata_write; ch->atapi_read = old.atapi_read; ch->atapi_write = old.atapi_write; - ch->XXX_udma = old.XXX_udma; + ch->udma_setup = old.udma_setup; ch->udma_enable = old.udma_enable; ch->udma_start = old.udma_start; ch->udma_stop = old.udma_stop; - ch->udma_read = old.udma_read; - ch->udma_write = old.udma_write; + ch->udma_init = old.udma_init; ch->udma_irq_status = old.udma_irq_status; ch->udma_timeout = old.udma_timeout; ch->udma_irq_lost = old.udma_irq_lost;
@@ -1092,7 +1091,7 @@spin_unlock_irqrestore (&ide_lock, flags);/* Default autotune or requested autotune */ if (drive->autotune !=2 ) { -if (drive->channel->XXX_udma) { +if (drive->channel->udma_setup) {/* * Force DMAing for the beginning of the check. Some
@@ -1103,7 +1102,7 @@*/ udma_enable (drive,0 ,0 ); - drive->channel->XXX_udma (drive); + drive->channel->udma_setup (drive);#ifdef CONFIG_BLK_DEV_IDE_TCQ_DEFAULT udma_tcq_enable (drive,1 );#endif
drivers/ide/ns87415.c +6 -19
@@ -101,11 +101,11 @@ } -static int ns87415_udma_read (struct ata_device *drive,struct request *rq) +static int ns87415_udma_init (struct ata_device *drive,struct request *rq) {ns87415_prepare_drive (drive,1 );/* select DMA xfer */ -if (!ata_do_udma (1 , drive, rq))/* use standard DMA stuff */ +if (!udma_pci_init (drive, rq))/* use standard DMA stuff */ return 0 ;ns87415_prepare_drive (drive,0 );/* DMA failed: select PIO xfer */
@@ -113,26 +113,14 @@ return 1; } -static int ns87415_udma_write (struct ata_device *drive,struct request *rq) -{ -ns87415_prepare_drive (drive,1 );/* select DMA xfer */ - -if (!ata_do_udma (0 , drive, rq))/* use standard DMA stuff */ -return 0 ; - -ns87415_prepare_drive (drive,0 );/* DMA failed: select PIO xfer */ - -return 1 ; -} - -static int ns87415_dmaproc (struct ata_device *drive) +static int ns87415_udma_setup (struct ata_device *drive) {if (drive->type !=ATA_DISK ) {udma_enable (drive,0 ,0 );return 0 ; } -return XXX_ide_dmaproc (drive); +return udma_pci_setup (drive); }#endif
@@ -218,9 +206,8 @@#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) { hwif->udma_stop = ns87415_udma_stop; - hwif->udma_read = ns87415_udma_read; - hwif->udma_write = ns87415_udma_write; - hwif->XXX_udma = ns87415_dmaproc; + hwif->udma_init = ns87415_udma_init; + hwif->udma_setup = ns87415_udma_setup; }#endif
drivers/ide/pcidma.c +17 -28
96 lines not on this page · raw message
drivers/ide/pdc202xx.c +3 -7
@@ -563,7 +563,7 @@return !(hwif->speedproc (drive, mode)); } -static int config_drive_xfer_rate (struct ata_device *drive) +static int pdc202xx_udma_setup (struct ata_device *drive) {struct hd_driveid *id = drive->id;struct ata_channel *hwif = drive->channel;
@@ -670,7 +670,7 @@return (dma_stat &4 ) ==4 ;/* return 1 if INTR asserted */ } -static void pdc202xx_bug (struct ata_device *drive) +static void pdc202xx_bug (struct ata_device *drive) {if (!drive->channel->resetproc)return ;
@@ -678,10 +678,6 @@ drive->channel->resetproc(drive); } -static int pdc202xx_dmaproc (struct ata_device *drive) -{ -return config_drive_xfer_rate (drive); -}#endif void pdc202xx_new_reset (struct ata_device *drive)
@@ -838,7 +834,7 @@if (hwif->dma_base) { hwif->udma_irq_lost = pdc202xx_bug; hwif->udma_timeout = pdc202xx_bug; - hwif->XXX_udma = pdc202xx_dmaproc; + hwif->udma_setup = pdc202xx_udma_setup; hwif->highmem =1 ;if (!noautodma) hwif->autodma =1 ;
drivers/ide/pdc4030.c +6 -16
@@ -619,16 +619,11 @@return ide_stopped; } -ata_irq_enable (drive,1 );/* clear nIEN */ +ata_irq_enable (drive,1 );ata_mask (drive); -outb (taskfile->feature,IDE_FEATURE_REG ); -outb (taskfile->sector_count,IDE_NSECTOR_REG ); -/* refers to number of sectors to transfer */ -outb (taskfile->sector_number,IDE_SECTOR_REG ); -/* refers to sector offset or start sector */ -outb (taskfile->low_cylinder,IDE_LCYL_REG ); -outb (taskfile->high_cylinder,IDE_HCYL_REG ); +ata_out_regfile (drive, taskfile); +outb (taskfile->device_head,IDE_SELECT_REG );outb (args->cmd,IDE_COMMAND_REG );
@@ -708,14 +703,9 @@ args.taskfile.low_cylinder = (block>>=8 ); args.taskfile.high_cylinder = (block>>=8 ); args.taskfile.device_head = ((block>>8 )&0x0f )|drive->select.all; - args.cmd = (rq_data_dir (rq)==READ )?PROMISE_READ :PROMISE_WRITE ; - -/* We can't call ide_cmd_type_parser here, since it won't understand -our command, but that doesn't matter, since we don't use the -generic interrupt handlers either. Setup the bits of args that we -will need. */ - args.handler =NULL ; - rq->special = &args; + args.cmd = (rq_data_dir (rq) ==READ ) ?PROMISE_READ :PROMISE_WRITE ; + args.handler =NULL ; + rq->special = &args;return do_pdc4030_io (drive, &args, rq); }
drivers/ide/piix.c +2 -2
@@ -253,7 +253,7 @@#ifdef CONFIG_BLK_DEV_IDEDMA -int piix_dmaproc (struct ata_device *drive) +static int piix_udma_setup (struct ata_device *drive) {short w80 = drive->channel->udma_four;
@@ -399,7 +399,7 @@#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) { hwif->highmem =1 ; - hwif->XXX_udma = piix_dmaproc; + hwif->udma_setup = piix_udma_setup;# ifdef CONFIG_IDEDMA_AUTO if (!noautodma) hwif->autodma =1 ;
drivers/ide/serverworks.c +2 -7
@@ -290,7 +290,7 @@return !svwks_tune_chipset (drive, mode); } -static int config_drive_xfer_rate (struct ata_device *drive) +static int svwks_udma_setup (struct ata_device *drive) {struct hd_driveid *id = drive->id;int on =1 ;
@@ -387,11 +387,6 @@ return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0; /* verify good DMA status */ } - -static int svwks_dmaproc (struct ata_device *drive) -{ -return config_drive_xfer_rate (drive); -}#endif static unsigned int __init svwks_init_chipset (struct pci_dev *dev)
@@ -506,7 +501,7 @@ hwif->autodma =1 ;#endif hwif->udma_stop = svwks_udma_stop; - hwif->XXX_udma = svwks_dmaproc; + hwif->udma_setup = svwks_udma_setup; hwif->highmem =1 ; }else { hwif->autodma =0 ;
drivers/ide/sis5513.c +4 -10
@@ -466,12 +466,14 @@return !sis5513_tune_chipset (drive, mode); } -static int config_drive_xfer_rate (struct ata_device *drive) +static int sis5513_udma_setup (struct ata_device *drive) {struct hd_driveid *id = drive->id;int on =0 ;int verbose =1 ; +config_drive_art_rwp (drive); +config_art_rwp_pio (drive,5 );config_chipset_for_pio (drive,5 );if (id && (id->capability &1 ) && drive->channel->autodma) {
@@ -520,14 +522,6 @@ return 0; } - -static int sis5513_dmaproc (struct ata_device *drive) -{ -config_drive_art_rwp (drive); -config_art_rwp_pio (drive,5 ); - -return config_drive_xfer_rate (drive); -}#endif /* Chip detection and general config */
@@ -633,7 +627,7 @@if (chipset_family >ATA_16 ) { hwif->autodma = noautodma ?0 :1 ; hwif->highmem =1 ; - hwif->XXX_udma = sis5513_dmaproc; + hwif->udma_setup = sis5513_udma_setup; }else {#endif hwif->autodma =0 ;
drivers/ide/sl82c105.c +6 -22
@@ -130,7 +130,7 @@* Check to see if the drive and * chipset is capable of DMA mode */ -static int sl82c105_check_drive (struct ata_device *drive) +static int sl82c105_dma_setup (struct ata_device *drive) {int on =0 ;
@@ -173,15 +173,6 @@ }/* -* Our very own dmaproc. We need to intercept various calls -* to fix up the SL82C105 specific behaviour. -*/ -static int sl82c105_dmaproc (struct ata_device *drive) -{ -return sl82c105_check_drive (drive); -} - -/* * The SL82C105 holds off all IDE interrupts while in DMA mode until * all DMA activity is completed. Sometimes this causes problems (eg, * when the drive wants to report an error condition).
@@ -215,16 +206,10 @@* The generic IDE core will have disabled the BMEN bit before this * function is called. */ -static int sl82c105_dma_read (struct ata_device *drive,struct request *rq) -{ -sl82c105_reset_host (drive->channel->pci_dev); -return udma_pci_read (drive, rq); -} - -static int sl82c105_dma_write (struct ata_device *drive,struct request *rq) +static int sl82c105_dma_init (struct ata_device *drive,struct request *rq) {sl82c105_reset_host (drive->channel->pci_dev); -return udma_pci_write (drive, rq); +return udma_pci_init (drive, rq); }static void sl82c105_timeout (struct ata_device *drive)
@@ -354,12 +339,11 @@ata_init_dma (ch, dma_base);if (bridge_rev <=5 ) - ch->XXX_udma =NULL ; + ch->udma_setup =NULL ;else { - ch->XXX_udma = sl82c105_dmaproc; + ch->udma_setup = sl82c105_dma_setup; ch->udma_enable = sl82c105_dma_enable; - ch->udma_read = sl82c105_dma_read; - ch->udma_write = sl82c105_dma_write; + ch->udma_init = sl82c105_dma_init; ch->udma_timeout = sl82c105_timeout; ch->udma_irq_lost = sl82c105_lostirq; }
drivers/ide/trm290.c +14 -17
@@ -191,10 +191,18 @@return (inw (ch->dma_base +2 ) !=0x00ff ); } -static int do_udma (unsigned int reading,struct ata_device *drive,struct request *rq) +static int trm290_udma_init (struct ata_device *drive,struct request *rq) {struct ata_channel *ch = drive->channel; -unsigned int count, writing; +unsigned int count; +int writing; +int reading; + + +if (rq_data_dir (rq) ==READ ) + reading =1 ; +else + reading =0 ;if (!reading) { reading =0 ;
@@ -228,24 +236,14 @@ return 0; } -static int trm290_udma_read (struct ata_device *drive,struct request *rq) -{ -return do_udma (1 , drive, rq); -} - -static int trm290_udma_write (struct ata_device *drive,struct request *rq) -{ -return do_udma (0 , drive, rq); -} -static int trm290_udma_irq_status (struct ata_device *drive) {return (inw (drive->channel->dma_base +2 ) ==0x00ff ); } -static int trm290_dmaproc (struct ata_device *drive) +static int trm290_udma_setup (struct ata_device *drive) { -return XXX_ide_dmaproc (drive); +return udma_pci_setup (drive); }#endif
@@ -301,10 +299,9 @@#ifdef CONFIG_BLK_DEV_IDEDMA hwif->udma_start = trm290_udma_start; hwif->udma_stop = trm290_udma_stop; - hwif->udma_read = trm290_udma_read; - hwif->udma_write = trm290_udma_write; + hwif->udma_init = trm290_udma_init; hwif->udma_irq_status = trm290_udma_irq_status; - hwif->XXX_udma = trm290_dmaproc; + hwif->udma_setup = trm290_udma_setup;#endif hwif->selectproc = &trm290_selectproc;
drivers/ide/via82cxxx.c +2 -2
@@ -223,7 +223,7 @@ }#ifdef CONFIG_BLK_DEV_IDEDMA -static int via82cxxx_dmaproc (struct ata_device *drive) +static int via82cxxx_udma_setup (struct ata_device *drive) {short w80 = drive->channel->udma_four;
@@ -368,7 +368,7 @@#ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) { hwif->highmem =1 ; - hwif->XXX_udma = &via82cxxx_dmaproc; + hwif->udma_setup = via82cxxx_udma_setup;# ifdef CONFIG_IDEDMA_AUTO if (!noautodma) hwif->autodma =1 ;
drivers/scsi/ide-scsi.c +2 -6
@@ -407,12 +407,8 @@ pc->current_position=pc->buffer; bcount =min (pc->request_transfer,63 *1024 );/* Request to transfer the entire buffer at once */ -if (drive->using_dma && rq->bio) { -if (test_bit (PC_WRITING , &pc->flags)) - dma_ok = !udma_write (drive, rq); -else - dma_ok = !udma_read (drive, rq); - } +if (drive->using_dma && rq->bio) + dma_ok = !udma_init (drive, rq);ata_select (drive,10 );ata_irq_enable (drive,1 );
include/linux/ide.h +16 -26
83 lines not on this page · raw message
PATCH 1/1 2.5.19 IDE 82
In reply to Linus TorvaldsSun Jun 2 22:41:45 CEST 2002 ide-clean-82
- PPC compilation fix by Paul Mackerras.
- Various fixes by Bartek:
fix ata_irq_enable() and ata_reset() for legacy ATA-1 devices
in start_request() for REQ_DRIVE_ACB
a) don't run ->prehandler() twice
b) return ata_taskfile() value
drivers/ide/device.c +7 -4
@@ -105,11 +105,12 @@if (!ch->io_ports[IDE_CONTROL_OFFSET ])return 0 ; +/* 0x08 is for legacy ATA-1 devices */ if (on) -OUT_BYTE (0x00 , ch->io_ports[IDE_CONTROL_OFFSET ]); +OUT_BYTE (0x08 |0x00 , ch->io_ports[IDE_CONTROL_OFFSET ]);else {if (!ch->intrproc) -OUT_BYTE (0x02 , ch->io_ports[IDE_CONTROL_OFFSET ]); +OUT_BYTE (0x08 |0x02 , ch->io_ports[IDE_CONTROL_OFFSET ]);else ch->intrproc (drive); }
@@ -131,9 +132,11 @@return ;printk ("%s: reset\n" , ch->name); -OUT_BYTE (0x04 , ch->io_ports[IDE_CONTROL_OFFSET ]); +/* 0x08 is for legacy ATA-1 devices */ +OUT_BYTE (0x08 |0x04 , ch->io_ports[IDE_CONTROL_OFFSET ]);udelay (10 ); -OUT_BYTE (0x00 , ch->io_ports[IDE_CONTROL_OFFSET ]); +/* 0x08 is for legacy ATA-1 devices */ +OUT_BYTE (0x08 |0x00 , ch->io_ports[IDE_CONTROL_OFFSET ]); do { mdelay(50); stat = IN_BYTE(ch->io_ports[IDE_STATUS_OFFSET]);
drivers/ide/ide.c +1 -8
@@ -754,14 +754,7 @@if (!(ar)) goto args_error; -ata_taskfile (drive, ar,NULL ); - -if (((ar->command_type ==IDE_DRIVE_TASK_RAW_WRITE ) || - (ar->command_type ==IDE_DRIVE_TASK_OUT )) && - ar->prehandler && ar->handler) -return ar->prehandler (drive, rq); - -return ide_started; +return ata_taskfile (drive, ar,NULL ); }/* The normal way of execution is to pass and execute the request
drivers/ide/ide-pmac.c +5 -5
@@ -431,7 +431,7 @@ goto out; }udelay (10 ); -ata_irq_enale (drive,0 ); +ata_irq_enable (drive,0 );OUT_BYTE (command,IDE_NSECTOR_REG );OUT_BYTE (SETFEATURES_XFER ,IDE_FEATURE_REG );OUT_BYTE (WIN_SETFEATURES ,IDE_COMMAND_REG );
@@ -1577,9 +1577,9 @@*/ if (used_dma && !ide_spin_wait_hwgroup (drive)) {/* Lock HW group */ -set_bit (IDE_BUSY , &drive->channel->active); +set_bit (IDE_BUSY , drive->channel->active);pmac_ide_check_dma (drive); -clear_bit (IDE_BUSY , &drive->channel->active); +clear_bit (IDE_BUSY , drive->channel->active);spin_unlock_irq (drive->channel->lock); }#endif
@@ -1626,7 +1626,7 @@return ; else {/* Lock HW group */ -set_bit (IDE_BUSY , &drive->channel->active); +set_bit (IDE_BUSY , drive->channel->active);/* Stop the device */ idepmac_sleep_device (drive, idx, base);spin_unlock_irq (drive->channel->lock);
@@ -1656,7 +1656,7 @@/* We resume processing on the lock group */ spin_lock_irq (drive->channel->lock); -clear_bit (IDE_BUSY , &drive->channel->active); +clear_bit (IDE_BUSY , drive->channel->active);if (!list_empty (&drive->queue.queue_head))do_ide_request (&drive->queue);spin_unlock_irq (drive->channel->lock);
Re: [PATCH] 2.5.19 IDE 78
In reply to Linus TorvaldsQuoted 10 lines · Paul Mackerras
Quoted 6 lines
Quoted 3 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- OUT_BYTE(drive->ctl | 2, IDE_CONTROL_REG); + ata_irq_enale(drive, 0);For sure not. The nIEN bit is *negated* on the part of the device - please look at the
ata_irq_enable()functions definition. I have explained it there.Martin, that's a bit of your patch I was quoting. I was just trying to point out that you wrote "
ata_irq_enale" instead of "ata_irq_enable".
Yeep I realized and it's fixed in 82.