[PATCH 40/52] atp870u: Remove unused irq from struct atp_unit

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.h |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/atp870u.h b/drivers/scsi/atp870u.h index 5cf6256..c3c6c13 100644 --- a/drivers/scsi/atp870u.h +++ b/drivers/scsi/atp870u.h @@ -26,7 +26,6 @@ struct

[PATCH 10/52] atp870u: Untangle tmport #8

2015-07-26 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 478 ++-- 1 file changed, 177 insertions(+), 301 deletions(-) diff --git a/drivers/scsi

[PATCH 39/52] atp870u: Remove useless and broken card counting

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index a06a0a4..0b349bc 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c

[PATCH 51/52] atp870u: Introduce atp885_init()

2015-07-26 Thread Ondrej Zary
Move 885-specific init code to a separate function atp885_init() Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 231 +++- 1 file changed, 113 insertions(+), 118 deletions(-) diff --git a/drivers/scsi/atp870u.c b

[PATCH 38/52] atp870u: Use n_io_port in request_region and release_region

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 7f53a50..a06a0a4 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers

[PATCH 02/52] atp870u: Remove tmport1

2015-07-26 Thread Ondrej Zary
Remove tmport1 temporary variable to simplify the code. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 3db9d0c..aac7d47 100644

[PATCH 29/52] atp870u: Remove is870()

2015-07-26 Thread Ondrej Zary
Now that is885() supports everything from is870() and the rest of the code is almost identical, remove is870() and use is885() instead. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 427 +--- 1 file changed, 1

[PATCH 19/52] atp870u: Convert is870() to use wrappers

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 276 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 07b50ac..305eda8 100644 --- a/drivers

[PATCH 05/52] atp870u: Untangle tmport #3

2015-07-26 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 118 1 file changed, 49 insertions(+), 69 deletions(-) diff --git a/drivers/scsi/atp870u.c

[PATCH 01/52] atp870u: Remove workport

2015-07-26 Thread Ondrej Zary
Remove workport temporary variable to simplify the code. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 59 +++- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi

[PATCH 20/52] atp870u: Convert is880() to use wrappers

2015-07-26 Thread Ondrej Zary
Subtract 0x40 to use _io access wrappers. Now it's obvious that is870() and is880() are very similar. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 352 1 file changed, 176 insertions(+), 176 deletions

[PATCH 45/52] atp870u: Introduce is880(), is885() and remove dev_id

2015-07-26 Thread Ondrej Zary
Introduce chip type inline functions to simplify code, allowing to delete dev_id from struct atp_unit. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 70 ++-- drivers/scsi/atp870u.h |1 - 2 files changed, 38

[PATCH 07/52] atp870u: Untangle tmport #5

2015-07-26 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 470 ++-- 1 file changed, 173 insertions(+), 297 deletions(-) diff --git a/drivers/scsi

[PATCH 41/52] atp870u: Improve _probe()

2015-07-26 Thread Ondrej Zary
Move scsi_host_alloc() to the top of _probe() to remove code duplication, *p and unneeded atpdev (de)allocation and copying. While at it, fix the error paths to return real error codes and also add missing pci_disble_device() call. Signed-off-by: Ondrej Zary li...@rainbow-software.org

[PATCH 24/52] atp870u: Move chip-specific lines out of is880() and is885()

2015-07-26 Thread Ondrej Zary
Move few chip-specifis lines out of is880() and is885() so they become almost identical. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/atp870u.c b

[PATCH 09/52] atp870u: Untangle tmport #7

2015-07-26 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index

[PATCH 06/52] atp870u: Untangle tmport #4

2015-07-26 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 370 ++-- 1 file changed, 138 insertions(+), 232 deletions(-) diff --git a/drivers/scsi

[PATCH 08/52] atp870u: Untangle tmport #6

2015-07-26 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 136 +--- 1 file changed, 49 insertions(+), 87 deletions(-) diff --git a/drivers/scsi/atp870u.c

[PATCH 28/52] atp870u: Move 870-specific code out of is870()

2015-07-26 Thread Ondrej Zary
Move few remaining 870-specific code lines out of is870() Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index d76d386..6427f87 100644

[PATCH 43/52] atp870u: Remove chip_ver from struct atp_unit

2015-07-26 Thread Ondrej Zary
chip_ver is used for wide chip detection only. Remove it and use a local variable instead (for 870; 880 and 885 are always wide). Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 39 ++- drivers/scsi/atp870u.h |1 - 2

[PATCH 15/52] atp870u: Remove ugly gotos #3

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 999bf74..b3d4e9d 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi

[PATCH 04/52] atp870u: Untangle tmport #2

2015-07-26 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 79 1 file changed, 32 insertions(+), 47 deletions(-) diff --git a/drivers/scsi/atp870u.c

[PATCH 00/52] atp870u: Major rework

2015-07-26 Thread Ondrej Zary
+- atp870u.h |4 2 files changed, 1064 insertions(+), 2647 deletions(-) Partially (up to patch 34) Acked-by: Christoph Hellwig h...@lst.de -- Ondrej Zary -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body

[PATCH 03/52] atp870u: Untangle tmport

2015-07-26 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 186 ++-- 1 file changed, 71 insertions(+), 115 deletions(-) diff --git a/drivers/scsi

[PATCH 42/52] atp870u: Improve unsupported chip detection

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index d0119f1..128613e 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers

[PATCH 48/52] atp870u: Remove scam_on from struct atp_unit

2015-07-26 Thread Ondrej Zary
scam_on is used only during probe, no need to keep it later. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 14 +++--- drivers/scsi/atp870u.h |1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers

[PATCH 27/52] atp870u: Add remaining 870 support to is885()

2015-07-26 Thread Ondrej Zary
] and mbuf[4] checks Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 45 +++-- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 0548d07..d76d386 100644

[PATCH 13/52] atp870u: Remove ugly gotos

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 84 +--- 1 file changed, 30 insertions(+), 54 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 4d840a5..886e54b 100644 --- a/drivers

[PATCH 30/52] atp870u: Rename is885() to atp_is()

2015-07-26 Thread Ondrej Zary
Now that all the is* functions except is885() are gone, rename is885() to atp_is() to avoid confusion. Don't know what is means, though... Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[PATCH 36/52] atp870u: Remove empty tscam_885()

2015-07-26 Thread Ondrej Zary
tscam_885() is empty (except a delay) so remove it. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index b662e39..2570919 100644

[PATCH 52/52] atp870u: Introduce atp870_init()

2015-07-26 Thread Ondrej Zary
Move 870-specific init code to a separate function atp870_init() Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 104 +--- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/drivers/scsi/atp870u.c b

[PATCH 34/52] atp870u: Introduce atp_set_host_id

2015-07-26 Thread Ondrej Zary
The code for setting host adapter ID is the same for all chips. Move it to a common function. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 57 +++- 1 file changed, 18 insertions(+), 39 deletions(-) diff --git

[PATCH 50/52] atp870u: Introduce atp880_init()

2015-07-26 Thread Ondrej Zary
Move 880-specific init code to a separate function atp880_init() Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 174 1 file changed, 88 insertions(+), 86 deletions(-) diff --git a/drivers/scsi/atp870u.c b

[PATCH 47/52] atp870u: Request IRQ later, remove weird locking

2015-07-26 Thread Ondrej Zary
Allocate IRQ later during probe to avoid code duplication and also remove the need for weird locking in _probe. (It was probably there to prevent race with the IRQ handler?) Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 47

[PATCH 31/52] atp870u: Convert remaining in[bwl] and out[bwl] to wrappers

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 222 +--- 1 file changed, 118 insertions(+), 104 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 0b7d3bd..bccf872 100644 --- a/drivers

[PATCH 37/52] atp870u: Use module_pci_driver

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 2570919..7f53a50 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi

[PATCH 21/52] atp870u: Convert is885() to use wrappers

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 358 1 file changed, 179 insertions(+), 179 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 1b9276f..ad7af54 100644 --- a/drivers

[PATCH 23/52] atp870u: Add channel parameter to is870() and is880()

2015-07-26 Thread Ondrej Zary
Add channel parameter to is870() and is880() functions to simplify comparing them with is885(). Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 684 1 file changed, 342 insertions(+), 342 deletions(-) diff

[PATCH 18/52] atp870u: Introduce HW access wrappers

2015-07-26 Thread Ondrej Zary
Introduce *_read? and *_write? wrappers to improve code readability. Also make sure that baseport is always initialized, not only for ATP880. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 472 ++-- 1 file changed

[PATCH 17/52] atp870u: Remove ugly gotos #5

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 134 ++-- 1 file changed, 62 insertions(+), 72 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 68afe11..fd2bb6f 100644 --- a/drivers

[PATCH 14/52] atp870u: Remove ugly gotos #2

2015-07-26 Thread Ondrej Zary
Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 68 +--- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 886e54b..999bf74 100644 --- a/drivers

[PATCH 11/52] atp870u: Untangle tmpcip

2015-07-26 Thread Ondrej Zary
Untangle the tmpcip crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 64 +--- 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/drivers/scsi/atp870u.c

[PATCH 49/52] atp870u: Initialize tables earlier

2015-07-26 Thread Ondrej Zary
Call _init_tables before chip-specific initialization. This avoids code duplication and fixes a bug(?) in 880 init where the values read from flash into atpdev-sp are then overwritten by calling init_tables. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 22

[PATCH 12/52] atp870u: Untangle tmpcip #2

2015-07-26 Thread Ondrej Zary
Untangle the tmpcip crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary li...@rainbow-software.org --- drivers/scsi/atp870u.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi

[PATCH 02/52] atp870u: Remove tmport1

2015-11-17 Thread Ondrej Zary
Remove tmport1 temporary variable to simplify the code. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 3db9d0c..aac7d47

[PATCH 00/52] [resend] atp870u: Major rework

2015-11-17 Thread Ondrej Zary
This patch series removes the first level of crap from atp870u - the worst (in-tree) SCSI driver [1] and then cleans up the code a bit. First the driver is converted to C from something that looks like a (bad) assembler code: use of tmport for all I/O accesses and gotos all over the code. Then

[PATCH 09/52] atp870u: Untangle tmport #7

2015-11-17 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c

[PATCH 03/52] atp870u: Untangle tmport

2015-11-17 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 186 ++-- 1 file changed, 71 insertions(+), 115 deletions(-) diff --git a/driver

[PATCH 07/52] atp870u: Untangle tmport #5

2015-11-17 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 470 ++-- 1 file changed, 173 insertions(+), 297 deletions(-) diff --git a/driver

[PATCH 05/52] atp870u: Untangle tmport #3

2015-11-17 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 118 1 file changed, 49 insertions(+), 69 deletions(-) diff --git a/driver

[PATCH 01/52] atp870u: Remove workport

2015-11-17 Thread Ondrej Zary
Remove workport temporary variable to simplify the code. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 59 +++- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/atp870u.c b/d

[PATCH 06/52] atp870u: Untangle tmport #4

2015-11-17 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 370 ++-- 1 file changed, 138 insertions(+), 232 deletions(-) diff --git a/driver

[PATCH 08/52] atp870u: Untangle tmport #6

2015-11-17 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 136 +--- 1 file changed, 49 insertions(+), 87 deletions(-) diff --git a/driver

[PATCH 04/52] atp870u: Untangle tmport #2

2015-11-17 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 79 1 file changed, 32 insertions(+), 47 deletions(-) diff --git a/driver

[PATCH 19/52] atp870u: Convert is870() to use wrappers

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 276 1 file changed, 138 insertions(+), 138 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 07b50ac..305eda8 100644 --- a/d

[PATCH 51/52] atp870u: Introduce atp885_init()

2015-11-17 Thread Ondrej Zary
Move 885-specific init code to a separate function atp885_init() Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 231 +++- 1 file changed, 113 insertions(+), 118 deletions(-) diff --git a/drivers/scsi/atp87

[PATCH 33/52] atp870u: Fix incorrect writeb_io access to register 0x3a

2015-11-17 Thread Ondrej Zary
The ioport region is 0x20 bytes long so accessing 0x3a register using writeb_io is incorrect. Use writeb_base instead. There's no change in behavior as 870 chips have ioport = baseport. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c |8

[PATCH 49/52] atp870u: Initialize tables earlier

2015-11-17 Thread Ondrej Zary
Call _init_tables before chip-specific initialization. This avoids code duplication and fixes a bug(?) in 880 init where the values read from flash into atpdev->sp are then overwritten by calling init_tables. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/

[PATCH 31/52] atp870u: Convert remaining in[bwl] and out[bwl] to wrappers

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 222 +--- 1 file changed, 118 insertions(+), 104 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 0b7d3bd..bccf872 100644 --- a/d

[PATCH 30/52] atp870u: Rename is885() to atp_is()

2015-11-17 Thread Ondrej Zary
Now that all the is* functions except is885() are gone, rename is885() to atp_is() to avoid confusion. Don't know what "is" means, though... Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 12 ++-- 1 file changed, 6 insertions

[PATCH 18/52] atp870u: Introduce HW access wrappers

2015-11-17 Thread Ondrej Zary
Introduce *_read? and *_write? wrappers to improve code readability. Also make sure that baseport is always initialized, not only for ATP880. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 472 ++-- 1 file c

[PATCH 15/52] atp870u: Remove ugly gotos #3

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 999bf74..b3d4e9d 100644 --- a/drivers/scsi/atp870u.c +++ b/d

[PATCH 50/52] atp870u: Introduce atp880_init()

2015-11-17 Thread Ondrej Zary
Move 880-specific init code to a separate function atp880_init() Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 174 1 file changed, 88 insertions(+), 86 deletions(-) diff --git a/drivers/scsi/atp87

[PATCH 11/52] atp870u: Untangle tmpcip

2015-11-17 Thread Ondrej Zary
Untangle the tmpcip crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 64 +--- 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/driver

[PATCH 21/52] atp870u: Convert is885() to use wrappers

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 358 1 file changed, 179 insertions(+), 179 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 1b9276f..ad7af54 100644 --- a/d

[PATCH 16/52] atp870u: Remove ugly gotos #4

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index b3d4e9d..68afe11 100644 --- a/drivers/scsi/atp

[PATCH 25/52] atp870u: Remove is880()

2015-11-17 Thread Ondrej Zary
Now that is880() and is885() are almost identical (except for some cpu_relax() calls and debug printks), remove is880() and use is885() instead. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 572 +---

[PATCH 20/52] atp870u: Convert is880() to use wrappers

2015-11-17 Thread Ondrej Zary
Subtract 0x40 to use _io access wrappers. Now it's obvious that is870() and is880() are very similar. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 352 1 file changed, 176 insertions(+), 176 del

[PATCH 26/52] atp870u: Add wide_chip parameter to is870() and is885()

2015-11-17 Thread Ondrej Zary
Don't check chip_ver in is870() but add wide_chip parameter for that. Then add the non-wide support to is885(). Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 46 +- 1 file changed, 25 insertions(+), 21 del

[PATCH 24/52] atp870u: Move chip-specific lines out of is880() and is885()

2015-11-17 Thread Ondrej Zary
Move few chip-specifis lines out of is880() and is885() so they become almost identical. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/atp87

[PATCH 36/52] atp870u: Remove empty tscam_885()

2015-11-17 Thread Ondrej Zary
tscam_885() is empty (except a delay) so remove it. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index b662e39..2

[PATCH 38/52] atp870u: Use n_io_port in request_region and release_region

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 20 +++- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 7f53a50..a06a0a4 100644 --- a/drivers/scsi/atp870u.c +++ b/d

[PATCH 40/52] atp870u: Remove unused irq from struct atp_unit

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.h |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/atp870u.h b/drivers/scsi/atp870u.h index 5cf6256..c3c6c13 100644 --- a/drivers/scsi/atp870u.h +++ b/drivers/scsi/atp870u.h @@ -26,7 +26,6 @@

[PATCH 12/52] atp870u: Untangle tmpcip #2

2015-11-17 Thread Ondrej Zary
Untangle the tmpcip crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/atp870u.c b/driver

[PATCH 45/52] atp870u: Introduce is880(), is885() and remove dev_id

2015-11-17 Thread Ondrej Zary
Introduce chip type inline functions to simplify code, allowing to delete dev_id from struct atp_unit. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 70 ++-- drivers/scsi/atp870u.h |1 - 2 files chang

[PATCH 48/52] atp870u: Remove scam_on from struct atp_unit

2015-11-17 Thread Ondrej Zary
scam_on is used only during probe, no need to keep it later. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 14 +++--- drivers/scsi/atp870u.h |1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/atp870u.c b/d

[PATCH 46/52] atp870u: Use pci_request_regions

2015-11-17 Thread Ondrej Zary
Use pci_request_regions and do it before accessing the I/O ports. Also add missing pci_disable_device() call to atp870u_remove(). Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 21 ++--- 1 file changed, 10 insertions(+), 11 del

[PATCH 13/52] atp870u: Remove ugly gotos

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 84 +--- 1 file changed, 30 insertions(+), 54 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 4d840a5..886e54b 100644 --- a/d

[PATCH 22/52] atp870u: Unify code format in is870(), is880() and is885()

2015-11-17 Thread Ondrej Zary
Unify code formatting in is870(), is880() and is885() functions to simplify comparing them. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 170 1 file changed, 101 insertions(+), 69 deletions(-) diff

[PATCH 44/52] atp870u: Simplify _probe()

2015-11-17 Thread Ondrej Zary
Move shpnt common code to the top, remove base_io, use pci_resource_len. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 65 +--- 1 file changed, 28 insertions(+), 37 deletions(-) diff --git a/driver

[PATCH 37/52] atp870u: Use module_pci_driver

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 20 +--- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 2570919..7f53a50 100644 --- a/drivers/scsi/atp870u.c +++ b/d

[PATCH 17/52] atp870u: Remove ugly gotos #5

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 134 ++-- 1 file changed, 62 insertions(+), 72 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 68afe11..fd2bb6f 100644 --- a/d

[PATCH 42/52] atp870u: Improve unsupported chip detection

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index d0119f1..128613e 100644 --- a/drivers/scsi/atp870u.c +++ b/d

[PATCH 10/52] atp870u: Untangle tmport #8

2015-11-17 Thread Ondrej Zary
Untangle the tmport crap so it becomes obvious what ports are accessed. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 478 ++-- 1 file changed, 177 insertions(+), 301 deletions(-) diff --git a/driver

[PATCH 27/52] atp870u: Add remaining 870 support to is885()

2015-11-17 Thread Ondrej Zary
] and mbuf[4] checks Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 45 +++-- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 0548d07..d76d386

[PATCH 43/52] atp870u: Remove chip_ver from struct atp_unit

2015-11-17 Thread Ondrej Zary
chip_ver is used for wide chip detection only. Remove it and use a local variable instead (for 870; 880 and 885 are always wide). Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 39 ++- drivers/scsi/atp870u.h |

[PATCH 34/52] atp870u: Introduce atp_set_host_id

2015-11-17 Thread Ondrej Zary
The code for setting host adapter ID is the same for all chips. Move it to a common function. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 57 +++- 1 file changed, 18 insertions(+), 39 deletions(-) diff

[PATCH 14/52] atp870u: Remove ugly gotos #2

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 68 +--- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 886e54b..999bf74 100644 --- a/d

[PATCH 47/52] atp870u: Request IRQ later, remove weird locking

2015-11-17 Thread Ondrej Zary
Allocate IRQ later during probe to avoid code duplication and also remove the need for weird locking in _probe. (It was probably there to prevent race with the IRQ handler?) Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c

[PATCH 32/52] atp870u: Replace port 0x80 delay by udelay

2015-11-17 Thread Ondrej Zary
tscam() is using port 0x80 access for delays but that's x86-only. Use udelay(2) instead. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/atp870u.c b/d

[PATCH 41/52] atp870u: Improve _probe()

2015-11-17 Thread Ondrej Zary
Move scsi_host_alloc() to the top of _probe() to remove code duplication, *p and unneeded atpdev (de)allocation and copying. While at it, fix the error paths to return real error codes and also add missing pci_disble_device() call. Signed-off-by: Ondrej Zary <li...@rainbow-software.

[PATCH 39/52] atp870u: Remove useless and broken card counting

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index a06a0a4..0b349bc 100644 --- a/drivers/scsi/atp870u.c +++ b/driver

[PATCH 52/52] atp870u: Introduce atp870_init()

2015-11-17 Thread Ondrej Zary
Move 870-specific init code to a separate function atp870_init() Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 104 +--- 1 file changed, 54 insertions(+), 50 deletions(-) diff --git a/drivers/scsi/atp87

[PATCH 28/52] atp870u: Move 870-specific code out of is870()

2015-11-17 Thread Ondrej Zary
Move few remaining 870-specific code lines out of is870() Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index d76d386..6427f87

[PATCH 35/52] atp870u: Reduce log spam on module load/unload

2015-11-17 Thread Ondrej Zary
Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 9621403..b662e39 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp

[PATCH 29/52] atp870u: Remove is870()

2015-11-17 Thread Ondrej Zary
Now that is885() supports everything from is870() and the rest of the code is almost identical, remove is870() and use is885() instead. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/atp870u.c | 427 +--- 1 file chan

[PATCH v2 78/71] ncr5380: Add support for HP 53C400A-based cards (C2502)

2015-12-07 Thread Ondrej Zary
. Add new magic numbers for these HP cards and hp_53c400a module parameter to use them. Tested with HP C2502 and DTCT-436P. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/g_NCR5380.c | 76 -- drivers/scsi/g_NCR5380.h

Re: [RFC PATCH 76/71] ncr5380: Enable PDMA for DTC chips

2015-12-04 Thread Ondrej Zary
On Friday 04 December 2015, Finn Thain wrote: > > On Fri, 4 Dec 2015, Ondrej Zary wrote: > > > Add I/O register mapping for DTC chips and enable PDMA mode. > > > > These chips have 16-bit wide HOST BUFFER register (counter register at > > offset 0x0d increme

[PATCH v3 76/71] ncr5380: Enable PDMA for DTC chips

2015-12-06 Thread Ondrej Zary
. The chip also crashes when we bang the C400 host status register too heavily after PDMA write - a small udelay is needed. Tested on DTCT-436P and verified that it does not break 53C400A. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/g_NCR5380.c

[PATCH v2 77/71] ncr5380: Fix wait for 53C80 registers registers after PDMA

2015-12-06 Thread Ondrej Zary
The check for 53C80 registers accessibility was commented out because it was broken (inverted). Fix and enable it. Signed-off-by: Ondrej Zary <li...@rainbow-software.org> --- drivers/scsi/g_NCR5380.c | 37 ++--- 1 file changed, 6 insertions(+), 31 del

<    1   2   3   4   >