[PATCH] scsi: sd: add missing KERN_CONT for disk spin-up

2017-11-24 Thread Michał Mirosław
KERN_CONT is now required for continued printks(). Add it.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/sd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index d175c5c5ccf8..9743b5f0800d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2142,7 +2142,7 @@ sd_spinup_disk(struct scsi_disk *sdkp)
}
/* Wait 1 second for next try */
msleep(1000);
-   printk(".");
+   printk(KERN_CONT ".");
 
/*
 * Wait for USB flash devices with slow firmware.
@@ -2172,9 +2172,9 @@ sd_spinup_disk(struct scsi_disk *sdkp)
 
if (spintime) {
if (scsi_status_is_good(the_result))
-   printk("ready\n");
+   printk(KERN_CONT "ready\n");
else
-   printk("not responding...\n");
+   printk(KERN_CONT "not responding...\n");
}
 }
 
-- 
2.11.0



[PATCH] scsi: sd: make disk spin-up quieter

2017-08-29 Thread Michał Mirosław
Currently disk spin-up is generating one line per second. Make it
less verbose by setting DEBUG level for progress indicators.
Add device id prefixes while at it.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/sd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index b6bb4e0ce0e3..7544b60e5a6d 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2117,7 +2117,7 @@ sd_spinup_disk(struct scsi_disk *sdkp)
}
/* Wait 1 second for next try */
msleep(1000);
-   printk(".");
+   sd_printk(KERN_DEBUG, sdkp, ".");
 
/*
 * Wait for USB flash devices with slow firmware.
@@ -2147,9 +2147,9 @@ sd_spinup_disk(struct scsi_disk *sdkp)
 
if (spintime) {
if (scsi_status_is_good(the_result))
-   printk("ready\n");
+   sd_printk(KERN_NOTICE, sdkp, "disk is ready\n");
else
-   printk("not responding...\n");
+   sd_printk(KERN_NOTICE, sdkp, "disk not 
responding...\n");
}
 }
 
-- 
2.11.0



[RFT PATCH v3 1/1] aic7xxx: printk() lines unbroken (WIP)

2017-08-09 Thread Michał Mirosław
Current code is not SMP-friendly and since now each printk() call
generates a separate line in the log, the output is mostly unreadable.

This patch makes printed lines consistent and unbroken. It is necessarily
big since it touches almost every printk() in the driver.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
v3:
 - update after testing: turns out, there are a lot more of broken lines

---
 drivers/scsi/Kconfig |   3 +-
 drivers/scsi/aic7xxx/Kconfig |   6 +
 drivers/scsi/aic7xxx/Kconfig.aic79xx |   1 +
 drivers/scsi/aic7xxx/Kconfig.aic7xxx |   1 +
 drivers/scsi/aic7xxx/Makefile|   1 +
 drivers/scsi/aic7xxx/aic79xx.h   |   7 -
 drivers/scsi/aic7xxx/aic79xx_core.c  | 382 --
 drivers/scsi/aic7xxx/aic79xx_osm.c   |  77 ++--
 drivers/scsi/aic7xxx/aic79xx_osm.h   |   2 +-
 drivers/scsi/aic7xxx/aic79xx_reg.h_shipped   | 307 +++
 drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped | 480 +++
 drivers/scsi/aic7xxx/aic7xxx.h   |   7 -
 drivers/scsi/aic7xxx/aic7xxx_core.c  | 181 -
 drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped   | 157 
 drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped | 242 ++--
 drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c  |  39 +-
 drivers/scsi/aic7xxx/aiclib.c| 140 +--
 drivers/scsi/aic7xxx/aiclib.h|  30 ++
 18 files changed, 1035 insertions(+), 1028 deletions(-)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 3c52867dfe28..13971769bb62 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -463,8 +463,7 @@ config SCSI_AACRAID
  will be called aacraid.
 
 
-source "drivers/scsi/aic7xxx/Kconfig.aic7xxx"
-source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
+source "drivers/scsi/aic7xxx/Kconfig"
 source "drivers/scsi/aic94xx/Kconfig"
 source "drivers/scsi/hisi_sas/Kconfig"
 source "drivers/scsi/mvsas/Kconfig"
diff --git a/drivers/scsi/aic7xxx/Kconfig b/drivers/scsi/aic7xxx/Kconfig
new file mode 100644
index ..aeae1ba88281
--- /dev/null
+++ b/drivers/scsi/aic7xxx/Kconfig
@@ -0,0 +1,6 @@
+config SCSI_AICLIB
+   tristate
+   default n
+
+source "drivers/scsi/aic7xxx/Kconfig.aic7xxx"
+source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
diff --git a/drivers/scsi/aic7xxx/Kconfig.aic79xx 
b/drivers/scsi/aic7xxx/Kconfig.aic79xx
index 3b3d599103f8..7cf29839bc54 100644
--- a/drivers/scsi/aic7xxx/Kconfig.aic79xx
+++ b/drivers/scsi/aic7xxx/Kconfig.aic79xx
@@ -6,6 +6,7 @@ config SCSI_AIC79XX
tristate "Adaptec AIC79xx U320 support"
depends on PCI && SCSI
select SCSI_SPI_ATTRS
+   select SCSI_AICLIB
help
This driver supports all of Adaptec's Ultra 320 PCI-X
based SCSI controllers.
diff --git a/drivers/scsi/aic7xxx/Kconfig.aic7xxx 
b/drivers/scsi/aic7xxx/Kconfig.aic7xxx
index 55ac55ee6068..0d6cea939551 100644
--- a/drivers/scsi/aic7xxx/Kconfig.aic7xxx
+++ b/drivers/scsi/aic7xxx/Kconfig.aic7xxx
@@ -6,6 +6,7 @@ config SCSI_AIC7XXX
tristate "Adaptec AIC7xxx Fast -> U160 support (New Driver)"
depends on (PCI || EISA) && SCSI
select SCSI_SPI_ATTRS
+   select SCSI_AICLIB
---help---
This driver supports all of Adaptec's Fast through Ultra 160 PCI
based SCSI controllers as well as the aic7770 based EISA and VLB
diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index 58ce5af3970f..834cb410a44a 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -7,6 +7,7 @@
 # Let kbuild descend into aicasm when cleaning
 subdir-+= aicasm
 
+obj-$(CONFIG_SCSI_AICLIB)  += aiclib.o
 obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx.o
 obj-$(CONFIG_SCSI_AIC79XX) += aic79xx.o
 
diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h
index d47b527b25dd..f81287db98bb 100644
--- a/drivers/scsi/aic7xxx/aic79xx.h
+++ b/drivers/scsi/aic7xxx/aic79xx.h
@@ -1468,11 +1468,4 @@ extern uint32_t ahd_debug;
 void   ahd_print_devinfo(struct ahd_softc *ahd,
  struct ahd_devinfo *devinfo);
 void   ahd_dump_card_state(struct ahd_softc *ahd);
-intahd_print_register(const ahd_reg_parse_entry_t *table,
-  u_int num_entries,
-  const char *name,
-  u_int address,
-  u_int value,
-  u_int *cur_column,
-  u_int wrap_point);
 #endif /* _AIC79XX_H_ */
di

Re: [PATCH v2 3/5] aic7xxx: remove rules for shipped files

2017-08-09 Thread Michał Mirosław
On Fri, Aug 04, 2017 at 01:28:09AM +0200, Michał Mirosław wrote:
[...]
> --- a/drivers/scsi/aic7xxx/Makefile
> +++ b/drivers/scsi/aic7xxx/Makefile
> @@ -61,8 +61,6 @@ $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg 
> $(obj)/aicasm/aicasm
[...]
> -else
> -$(obj)/aic7xxx_reg_print.c: $(src)/aic7xxx_reg_print.c_shipped
[...]

Hi,

Please drop this patch (only this one). I didn't notice, that the file is
needed by modpost:

  Building modules, stage 2.
  MODPOST 785 modules
WARNING: could not open drivers/scsi/aic7xxx/aic79xx_reg_print.c: No
such file or directory
  LD [M]  drivers/scsi/aic7xxx/aic79xx.ko

Best Regards,
Michał Mirosław



[PATCH v2 1/5] aic7xxx: remove empty function

2017-08-03 Thread Michał Mirosław

ahc_platform_dump_card_state() does nothing. Remove it.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 1 -
 drivers/scsi/aic7xxx/aic7xxx_osm.c  | 5 -
 drivers/scsi/aic7xxx/aic7xxx_osm.h  | 1 -
 3 files changed, 7 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c 
b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 64ab9eaec428..381846164003 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -7340,7 +7340,6 @@ ahc_dump_card_state(struct ahc_softc *ahc)
printk("\n");
}
 
-   ahc_platform_dump_card_state(ahc);
printk("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n");
ahc_outb(ahc, SCBPTR, saved_scbptr);
if (paused == 0)
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c 
b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index fc6a83188c1e..acd687f4554e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -2329,11 +2329,6 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, 
scb_flag flag)
return (retval);
 }
 
-void
-ahc_platform_dump_card_state(struct ahc_softc *ahc)
-{
-}
-
 static void ahc_linux_set_width(struct scsi_target *starget, int width)
 {
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h 
b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 54c702864103..f8489078f003 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -688,7 +688,6 @@ voidahc_done(struct ahc_softc*, struct scb*);
 void   ahc_send_async(struct ahc_softc *, char channel,
   u_int target, u_int lun, ac_code);
 void   ahc_print_path(struct ahc_softc *, struct scb *);
-void   ahc_platform_dump_card_state(struct ahc_softc *ahc);
 
 #ifdef CONFIG_PCI
 #define AHC_PCI_CONFIG 1
-- 
2.11.0



[PATCH v2 5/5] aic7[9x]xx: printk() lines unbroken

2017-08-03 Thread Michał Mirosław
Current code is not SMP-friendly and since now each printk() call
generates a separate line in the log, the output is mostly unreadable.
Make it better formatted.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/Kconfig |   3 +-
 drivers/scsi/aic7xxx/Kconfig |   6 +
 drivers/scsi/aic7xxx/Kconfig.aic79xx |   1 +
 drivers/scsi/aic7xxx/Kconfig.aic7xxx |   1 +
 drivers/scsi/aic7xxx/Makefile|   1 +
 drivers/scsi/aic7xxx/aic79xx.h   |   7 -
 drivers/scsi/aic7xxx/aic79xx_core.c  | 242 +---
 drivers/scsi/aic7xxx/aic79xx_reg.h_shipped   | 307 +++
 drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped | 480 +++
 drivers/scsi/aic7xxx/aic7xxx.h   |   7 -
 drivers/scsi/aic7xxx/aic7xxx_core.c  | 181 -
 drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped   | 157 
 drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped | 242 ++--
 drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c  |  39 +-
 drivers/scsi/aic7xxx/aiclib.c| 103 +++--
 drivers/scsi/aic7xxx/aiclib.h|  32 ++
 16 files changed, 871 insertions(+), 938 deletions(-)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index f4538d7a3016..b76939b77319 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -452,8 +452,7 @@ config SCSI_AACRAID
  will be called aacraid.
 
 
-source "drivers/scsi/aic7xxx/Kconfig.aic7xxx"
-source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
+source "drivers/scsi/aic7xxx/Kconfig"
 source "drivers/scsi/aic94xx/Kconfig"
 source "drivers/scsi/hisi_sas/Kconfig"
 source "drivers/scsi/mvsas/Kconfig"
diff --git a/drivers/scsi/aic7xxx/Kconfig b/drivers/scsi/aic7xxx/Kconfig
new file mode 100644
index ..aeae1ba88281
--- /dev/null
+++ b/drivers/scsi/aic7xxx/Kconfig
@@ -0,0 +1,6 @@
+config SCSI_AICLIB
+   tristate
+   default n
+
+source "drivers/scsi/aic7xxx/Kconfig.aic7xxx"
+source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
diff --git a/drivers/scsi/aic7xxx/Kconfig.aic79xx 
b/drivers/scsi/aic7xxx/Kconfig.aic79xx
index 3b3d599103f8..7cf29839bc54 100644
--- a/drivers/scsi/aic7xxx/Kconfig.aic79xx
+++ b/drivers/scsi/aic7xxx/Kconfig.aic79xx
@@ -6,6 +6,7 @@ config SCSI_AIC79XX
tristate "Adaptec AIC79xx U320 support"
depends on PCI && SCSI
select SCSI_SPI_ATTRS
+   select SCSI_AICLIB
help
This driver supports all of Adaptec's Ultra 320 PCI-X
based SCSI controllers.
diff --git a/drivers/scsi/aic7xxx/Kconfig.aic7xxx 
b/drivers/scsi/aic7xxx/Kconfig.aic7xxx
index 55ac55ee6068..0d6cea939551 100644
--- a/drivers/scsi/aic7xxx/Kconfig.aic7xxx
+++ b/drivers/scsi/aic7xxx/Kconfig.aic7xxx
@@ -6,6 +6,7 @@ config SCSI_AIC7XXX
tristate "Adaptec AIC7xxx Fast -> U160 support (New Driver)"
depends on (PCI || EISA) && SCSI
select SCSI_SPI_ATTRS
+   select SCSI_AICLIB
---help---
This driver supports all of Adaptec's Fast through Ultra 160 PCI
based SCSI controllers as well as the aic7770 based EISA and VLB
diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index 1a5509d40f8a..3e7565a9d37a 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -7,6 +7,7 @@
 # Let kbuild descend into aicasm when cleaning
 subdir-+= aicasm
 
+obj-$(CONFIG_SCSI_AICLIB)  += aiclib.o
 obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx.o
 obj-$(CONFIG_SCSI_AIC79XX) += aic79xx.o
 
diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h
index d47b527b25dd..f81287db98bb 100644
--- a/drivers/scsi/aic7xxx/aic79xx.h
+++ b/drivers/scsi/aic7xxx/aic79xx.h
@@ -1468,11 +1468,4 @@ extern uint32_t ahd_debug;
 void   ahd_print_devinfo(struct ahd_softc *ahd,
  struct ahd_devinfo *devinfo);
 void   ahd_dump_card_state(struct ahd_softc *ahd);
-intahd_print_register(const ahd_reg_parse_entry_t *table,
-  u_int num_entries,
-  const char *name,
-  u_int address,
-  u_int value,
-  u_int *cur_column,
-  u_int wrap_point);
 #endif /* _AIC79XX_H_ */
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c 
b/drivers/scsi/aic7xxx/aic79xx_core.c
index 95d8f25cbcca..b895c43e9a5d 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -2672,6 +2672,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat)
 static void
 ahd_handle_tra

[PATCH v2 0/4] aic7xxx: fix debugging printks

2017-08-03 Thread Michał Mirosław
This series aims to clean up printing of card state after a problem event.
Currently, the output is pretty much unreadable, as it is spread over a lot
of single-word lines.

This series compiles (on x86), but is not tested, yet.

v2: rebased after 516b7db593 ("scsi: aic7xxx: fix firmware build with O=path")


Michał Mirosław (5):
  aic7xxx: remove empty function
  aic7xxx: fix firmware build deps
  aic7xxx: remove rules for shipped files
  aic7xxx: regenerate firmware files
  aic7[9x]xx: printk() lines unbroken

 drivers/scsi/Kconfig |3 +-
 drivers/scsi/aic7xxx/Kconfig |6 +
 drivers/scsi/aic7xxx/Kconfig.aic79xx |1 +
 drivers/scsi/aic7xxx/Kconfig.aic7xxx |1 +
 drivers/scsi/aic7xxx/Makefile|   11 +-
 drivers/scsi/aic7xxx/aic79xx.h   |7 -
 drivers/scsi/aic7xxx/aic79xx_core.c  |  242 ++--
 drivers/scsi/aic7xxx/aic79xx_reg.h_shipped   | 1560 +-
 drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped |  504 +++
 drivers/scsi/aic7xxx/aic7xxx.h   |7 -
 drivers/scsi/aic7xxx/aic7xxx_core.c  |  182 +--
 drivers/scsi/aic7xxx/aic7xxx_osm.c   |5 -
 drivers/scsi/aic7xxx/aic7xxx_osm.h   |1 -
 drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped   |  201 ++-
 drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped |  242 ++--
 drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c  |   39 +-
 drivers/scsi/aic7xxx/aiclib.c|  103 +-
 drivers/scsi/aic7xxx/aiclib.h|   32 +
 18 files changed, 1098 insertions(+), 2049 deletions(-)
 create mode 100644 drivers/scsi/aic7xxx/Kconfig

-- 
2.11.0



[PATCH v2 4/5] aic7xxx: regenerate firmware files

2017-08-03 Thread Michał Mirosław
Regenerate firmware files to make cleaner base for following fix.
This removes some unused definitions and reorders some #defines, but
the code remains the same.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/aic7xxx/aic79xx_reg.h_shipped   | 1267 --
 drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped |   34 +-
 drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped   |   44 +-
 3 files changed, 235 insertions(+), 1110 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped 
b/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
index cdcead071ef6..ddcd5a7701ac 100644
--- a/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
+++ b/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
@@ -13,13 +13,6 @@ typedef struct ahd_reg_parse_entry {
 } ahd_reg_parse_entry_t;
 
 #if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_mode_ptr_print;
-#else
-#define ahd_mode_ptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "MODE_PTR", 0x00, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
 ahd_reg_print_t ahd_intstat_print;
 #else
 #define ahd_intstat_print(regvalue, cur_col, wrap) \
@@ -27,27 +20,6 @@ ahd_reg_print_t ahd_intstat_print;
 #endif
 
 #if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_seqintcode_print;
-#else
-#define ahd_seqintcode_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "SEQINTCODE", 0x02, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_error_print;
-#else
-#define ahd_error_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "ERROR", 0x04, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_hescb_qoff_print;
-#else
-#define ahd_hescb_qoff_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "HESCB_QOFF", 0x08, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
 ahd_reg_print_t ahd_hs_mailbox_print;
 #else
 #define ahd_hs_mailbox_print(regvalue, cur_col, wrap) \
@@ -62,27 +34,6 @@ ahd_reg_print_t ahd_seqintstat_print;
 #endif
 
 #if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_clrseqintstat_print;
-#else
-#define ahd_clrseqintstat_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "CLRSEQINTSTAT", 0x0c, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_swtimer_print;
-#else
-#define ahd_swtimer_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "SWTIMER", 0x0e, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_sescb_qoff_print;
-#else
-#define ahd_sescb_qoff_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "SESCB_QOFF", 0x12, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
 ahd_reg_print_t ahd_intctl_print;
 #else
 #define ahd_intctl_print(regvalue, cur_col, wrap) \
@@ -111,111 +62,6 @@ ahd_reg_print_t ahd_sg_cache_shadow_print;
 #endif
 
 #if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_lqin_print;
-#else
-#define ahd_lqin_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "LQIN", 0x20, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_lunptr_print;
-#else
-#define ahd_lunptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "LUNPTR", 0x22, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_cmdlenptr_print;
-#else
-#define ahd_cmdlenptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "CMDLENPTR", 0x25, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_attrptr_print;
-#else
-#define ahd_attrptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "ATTRPTR", 0x26, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_flagptr_print;
-#else
-#define ahd_flagptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "FLAGPTR", 0x27, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_cmdptr_print;
-#else
-#define ahd_cmdptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "CMDPTR", 0x28, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_qnextptr_print;
-#else
-#define ahd_qnextptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "QNEXTPTR", 0x29, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_abrtbyteptr_print;
-#else
-#define ahd_abrtbyteptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "ABRTBYTEPTR", 0x2b, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_abrtbitptr_print;
-#else
-#define ahd_abrtbitptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "ABRTBITPTR", 0x2c, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_lunlen_print;
-#else
-#define ahd

[PATCH v2 3/5] aic7xxx: remove rules for shipped files

2017-08-03 Thread Michał Mirosław
There are Kbuild rules for that already.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/aic7xxx/Makefile | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index b03ba0df7a83..1a5509d40f8a 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -61,8 +61,6 @@ $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg 
$(obj)/aicasm/aicasm
 
 $(aic7xxx-gen-y): $(objtree)/$(obj)/aic7xxx_seq.h
@true
-else
-$(obj)/aic7xxx_reg_print.c: $(src)/aic7xxx_reg_print.c_shipped
 endif
 
 aic79xx-gen-$(CONFIG_AIC79XX_BUILD_FIRMWARE)   := $(obj)/aic79xx_reg.h
@@ -79,8 +77,6 @@ $(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg 
$(obj)/aicasm/aicasm
 
 $(aic79xx-gen-y): $(objtree)/$(obj)/aic79xx_seq.h
@true
-else
-$(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
 endif
 
 $(obj)/aicasm/aicasm: $(srctree)/$(src)/aicasm/*.[chyl]
-- 
2.11.0



[PATCH v2 2/5] aic7xxx: fix firmware build deps

2017-08-03 Thread Michał Mirosław
We need to override Kbuild rules for copying shipped files, otherwise
aic7xxx_reg.h and aic7xxx_reg_print.c will be ovewritten by old versions.

Fixes: 516b7db593f3a541e2e98867575c3c697f41a247
Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/aic7xxx/Makefile | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index 07b60a780c06..b03ba0df7a83 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -59,7 +59,8 @@ $(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg 
$(obj)/aicasm/aicasm
  $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
  $(srctree)/$(src)/aic7xxx.seq
 
-$(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h
+$(aic7xxx-gen-y): $(objtree)/$(obj)/aic7xxx_seq.h
+   @true
 else
 $(obj)/aic7xxx_reg_print.c: $(src)/aic7xxx_reg_print.c_shipped
 endif
@@ -76,7 +77,8 @@ $(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg 
$(obj)/aicasm/aicasm
  $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
  $(srctree)/$(src)/aic79xx.seq
 
-$(aic79xx-gen-y): $(obj)/aic79xx_seq.h
+$(aic79xx-gen-y): $(objtree)/$(obj)/aic79xx_seq.h
+   @true
 else
 $(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
 endif
-- 
2.11.0



[PATCH 2/4] aic7xxx: fix aicasm out-of-tree build

2017-07-28 Thread Michał Mirosław
Fix out-of-tree build with CONFIG_PREVENT_FIRMWARE_BUILD=n.

[...]
make[3]: *** No rule to make target 'drivers/scsi/aic7xxx/aicasm/*.[chyl]', 
needed by 'drivers/scsi/aic7xxx/aicasm/aicasm'.  Stop.
/mnt/src/jaja/git/scsi-upstream/Makefile:1682: recipe for target 
'drivers/scsi/aic7xxx/' failed
make[2]: *** [drivers/scsi/aic7xxx/] Error 2
[...]

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/aic7xxx/Makefile| 36 ++--
 drivers/scsi/aic7xxx/aicasm/Makefile |  3 ++-
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index 741d81861d17..d76cbbba795d 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -47,39 +47,39 @@ clean-files += aic79xx_seq.h aic79xx_reg.h 
aic79xx_reg_print.c
 $(addprefix $(obj)/,$(aic7xxx-y)): $(obj)/aic7xxx_seq.h $(obj)/aic7xxx_reg.h
 $(addprefix $(obj)/,$(aic79xx-y)): $(obj)/aic79xx_seq.h $(obj)/aic79xx_reg.h
 
-aic7xxx-gen-$(CONFIG_AIC7XXX_BUILD_FIRMWARE)   := $(obj)/aic7xxx_reg.h
+aicasm-src := $(if $(KBUILD_SRC),$(srctree)/)$(src)
+
+aic7xxx-gen-$(CONFIG_AIC7XXX_BUILD_FIRMWARE)   := $(obj)/aic7xxx_reg.h \
+  $(obj)/aic7xxx_seq.h
 aic7xxx-gen-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) += $(obj)/aic7xxx_reg_print.c
 
 aicasm-7xxx-opts-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) := \
-p $(obj)/aic7xxx_reg_print.c -i aic7xxx_osm.h
 
 ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
-$(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg 
$(obj)/aicasm/aicasm
-   $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic7xxx_reg.h \
+$(aic7xxx-gen-y): $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
+   $(obj)/aicasm/aicasm -I$(aicasm-src) -r $(obj)/aic7xxx_reg.h \
  $(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
- $(src)/aic7xxx.seq
-
-$(aic7xxx-gen-y): $(obj)/aic7xxx_seq.h
-else
-$(obj)/aic7xxx_reg_print.c: $(src)/aic7xxx_reg_print.c_shipped
+ $(aicasm-src)/aic7xxx.seq
 endif
 
-aic79xx-gen-$(CONFIG_AIC79XX_BUILD_FIRMWARE)   := $(obj)/aic79xx_reg.h
+aic79xx-gen-$(CONFIG_AIC79XX_BUILD_FIRMWARE)   := $(obj)/aic79xx_reg.h \
+  $(obj)/aic79xx_seq.h
 aic79xx-gen-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) += $(obj)/aic79xx_reg_print.c
 
 aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \
-p $(obj)/aic79xx_reg_print.c -i aic79xx_osm.h
 
 ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
-$(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg 
$(obj)/aicasm/aicasm
-   $(obj)/aicasm/aicasm -I$(src) -r $(obj)/aic79xx_reg.h \
+$(aic79xx-gen-y): $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
+   $(obj)/aicasm/aicasm -I$(aicasm-src) -r $(obj)/aic79xx_reg.h \
  $(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
- $(src)/aic79xx.seq
-
-$(aic79xx-gen-y): $(obj)/aic79xx_seq.h
-else
-$(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
+ $(aicasm-src)/aic79xx.seq
 endif
 
-$(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl]
-   $(MAKE) -C $(src)/aicasm
+$(obj)/aicasm/aicasm: $(aicasm-src)/aicasm/Makefile 
$(aicasm-src)/aicasm/*.[chyl]
+ifneq ($(KBUILD_SRC),)
+   mkdir -p $(obj)/aicasm
+   cp -ax $^ $(obj)/aicasm/
+endif
+   $(MAKE) -C $(obj)/aicasm KSRC=$(if $(KBUILD_SRC),$(aicasm-src)/aicasm,.)
diff --git a/drivers/scsi/aic7xxx/aicasm/Makefile 
b/drivers/scsi/aic7xxx/aicasm/Makefile
index b98c5c1056c3..29ca14d50597 100644
--- a/drivers/scsi/aic7xxx/aicasm/Makefile
+++ b/drivers/scsi/aic7xxx/aicasm/Makefile
@@ -13,7 +13,7 @@ SRCS= ${CSRCS} ${GENSRCS}
 LIBS=  -ldb
 clean-files:= ${GENSRCS} ${GENHDRS} $(YSRCS:.y=.output) $(PROG)
 # Override default kernel CFLAGS.  This is a userland app.
-AICASM_CFLAGS:= -I/usr/include -I.
+AICASM_CFLAGS:= -I/usr/include -I. -I$(KSRC)
 LEX= flex
 YACC= bison
 YFLAGS= -d
@@ -50,6 +50,7 @@ aicdb.h:
echo "#include " > aicdb.h;   \
 else   \
echo "*** Install db development libraries";\
+   false;  \
 fi
 
 clean:
-- 
2.11.0



[PATCH 4/4] aic7xxx: printk() lines unbroken

2017-07-28 Thread Michał Mirosław
Current code is not SMP-friendly and since now each printk() call
generates a separate line in the log, the output is mostly unreadable.
Make it better formatted.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/Kconfig |   3 +-
 drivers/scsi/aic7xxx/Kconfig |   6 +
 drivers/scsi/aic7xxx/Kconfig.aic79xx |   1 +
 drivers/scsi/aic7xxx/Kconfig.aic7xxx |   1 +
 drivers/scsi/aic7xxx/Makefile|   1 +
 drivers/scsi/aic7xxx/aic79xx.h   |   7 -
 drivers/scsi/aic7xxx/aic79xx_core.c  | 242 +---
 drivers/scsi/aic7xxx/aic79xx_reg.h_shipped   | 307 +++
 drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped | 480 +++
 drivers/scsi/aic7xxx/aic7xxx.h   |   7 -
 drivers/scsi/aic7xxx/aic7xxx_core.c  | 181 -
 drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped   | 157 
 drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped | 242 ++--
 drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c  |  39 +-
 drivers/scsi/aic7xxx/aiclib.c| 103 +++--
 drivers/scsi/aic7xxx/aiclib.h|  32 ++
 16 files changed, 871 insertions(+), 938 deletions(-)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index d384f4f86c26..fdb4c8e3b0ca 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -452,8 +452,7 @@ config SCSI_AACRAID
  will be called aacraid.
 
 
-source "drivers/scsi/aic7xxx/Kconfig.aic7xxx"
-source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
+source "drivers/scsi/aic7xxx/Kconfig"
 source "drivers/scsi/aic94xx/Kconfig"
 source "drivers/scsi/hisi_sas/Kconfig"
 source "drivers/scsi/mvsas/Kconfig"
diff --git a/drivers/scsi/aic7xxx/Kconfig b/drivers/scsi/aic7xxx/Kconfig
new file mode 100644
index ..aeae1ba88281
--- /dev/null
+++ b/drivers/scsi/aic7xxx/Kconfig
@@ -0,0 +1,6 @@
+config SCSI_AICLIB
+   tristate
+   default n
+
+source "drivers/scsi/aic7xxx/Kconfig.aic7xxx"
+source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
diff --git a/drivers/scsi/aic7xxx/Kconfig.aic79xx 
b/drivers/scsi/aic7xxx/Kconfig.aic79xx
index 3b3d599103f8..7cf29839bc54 100644
--- a/drivers/scsi/aic7xxx/Kconfig.aic79xx
+++ b/drivers/scsi/aic7xxx/Kconfig.aic79xx
@@ -6,6 +6,7 @@ config SCSI_AIC79XX
tristate "Adaptec AIC79xx U320 support"
depends on PCI && SCSI
select SCSI_SPI_ATTRS
+   select SCSI_AICLIB
help
This driver supports all of Adaptec's Ultra 320 PCI-X
based SCSI controllers.
diff --git a/drivers/scsi/aic7xxx/Kconfig.aic7xxx 
b/drivers/scsi/aic7xxx/Kconfig.aic7xxx
index 55ac55ee6068..0d6cea939551 100644
--- a/drivers/scsi/aic7xxx/Kconfig.aic7xxx
+++ b/drivers/scsi/aic7xxx/Kconfig.aic7xxx
@@ -6,6 +6,7 @@ config SCSI_AIC7XXX
tristate "Adaptec AIC7xxx Fast -> U160 support (New Driver)"
depends on (PCI || EISA) && SCSI
select SCSI_SPI_ATTRS
+   select SCSI_AICLIB
---help---
This driver supports all of Adaptec's Fast through Ultra 160 PCI
based SCSI controllers as well as the aic7770 based EISA and VLB
diff --git a/drivers/scsi/aic7xxx/Makefile b/drivers/scsi/aic7xxx/Makefile
index d76cbbba795d..d1f4bdf1726f 100644
--- a/drivers/scsi/aic7xxx/Makefile
+++ b/drivers/scsi/aic7xxx/Makefile
@@ -7,6 +7,7 @@
 # Let kbuild descend into aicasm when cleaning
 subdir-+= aicasm
 
+obj-$(CONFIG_SCSI_AICLIB)  += aiclib.o
 obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx.o
 obj-$(CONFIG_SCSI_AIC79XX) += aic79xx.o
 
diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h
index d47b527b25dd..f81287db98bb 100644
--- a/drivers/scsi/aic7xxx/aic79xx.h
+++ b/drivers/scsi/aic7xxx/aic79xx.h
@@ -1468,11 +1468,4 @@ extern uint32_t ahd_debug;
 void   ahd_print_devinfo(struct ahd_softc *ahd,
  struct ahd_devinfo *devinfo);
 void   ahd_dump_card_state(struct ahd_softc *ahd);
-intahd_print_register(const ahd_reg_parse_entry_t *table,
-  u_int num_entries,
-  const char *name,
-  u_int address,
-  u_int value,
-  u_int *cur_column,
-  u_int wrap_point);
 #endif /* _AIC79XX_H_ */
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c 
b/drivers/scsi/aic7xxx/aic79xx_core.c
index 95d8f25cbcca..b895c43e9a5d 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -2672,6 +2672,7 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat)
 static void
 ahd_handle_tra

[PATCH 1/4] aic7xxx: remove empty function

2017-07-28 Thread Michał Mirosław
ahc_platform_dump_card_state() does nothing. Remove it.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/aic7xxx/aic7xxx_core.c | 1 -
 drivers/scsi/aic7xxx/aic7xxx_osm.c  | 5 -
 drivers/scsi/aic7xxx/aic7xxx_osm.h  | 1 -
 3 files changed, 7 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c 
b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 64ab9eaec428..381846164003 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -7340,7 +7340,6 @@ ahc_dump_card_state(struct ahc_softc *ahc)
printk("\n");
}
 
-   ahc_platform_dump_card_state(ahc);
printk("\n<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>\n");
ahc_outb(ahc, SCBPTR, saved_scbptr);
if (paused == 0)
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c 
b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index fc6a83188c1e..acd687f4554e 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -2329,11 +2329,6 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, 
scb_flag flag)
return (retval);
 }
 
-void
-ahc_platform_dump_card_state(struct ahc_softc *ahc)
-{
-}
-
 static void ahc_linux_set_width(struct scsi_target *starget, int width)
 {
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h 
b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 54c702864103..f8489078f003 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -688,7 +688,6 @@ voidahc_done(struct ahc_softc*, struct scb*);
 void   ahc_send_async(struct ahc_softc *, char channel,
   u_int target, u_int lun, ac_code);
 void   ahc_print_path(struct ahc_softc *, struct scb *);
-void   ahc_platform_dump_card_state(struct ahc_softc *ahc);
 
 #ifdef CONFIG_PCI
 #define AHC_PCI_CONFIG 1
-- 
2.11.0



[PATCH 0/4] aic7xxx: fix debugging printks

2017-07-28 Thread Michał Mirosław
This series aims to clean up printing of card state after a problem event.
Now the output is pretty much unreadable, as it is spread over a lot of
single-word lines.

This series compiles (on x86), but is not tested, yet.

Best Regards,
Michał Mirosław

---

Michał Mirosław (4):
  aic7xxx: remove empty function
  aic7xxx: fix aicasm out-of-tree build
  aic7xxx: regenerate firmware files
  aic7xxx: printk() lines unbroken

 drivers/scsi/Kconfig |3 +-
 drivers/scsi/aic7xxx/Kconfig |6 +
 drivers/scsi/aic7xxx/Kconfig.aic79xx |1 +
 drivers/scsi/aic7xxx/Kconfig.aic7xxx |1 +
 drivers/scsi/aic7xxx/Makefile|   37 +-
 drivers/scsi/aic7xxx/aic79xx.h   |7 -
 drivers/scsi/aic7xxx/aic79xx_core.c  |  242 ++--
 drivers/scsi/aic7xxx/aic79xx_reg.h_shipped   | 1560 +-
 drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped |  504 +++
 drivers/scsi/aic7xxx/aic7xxx.h   |7 -
 drivers/scsi/aic7xxx/aic7xxx_core.c  |  182 +--
 drivers/scsi/aic7xxx/aic7xxx_osm.c   |5 -
 drivers/scsi/aic7xxx/aic7xxx_osm.h   |1 -
 drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped   |  201 ++-
 drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped |  242 ++--
 drivers/scsi/aic7xxx/aicasm/Makefile |3 +-
 drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c  |   39 +-
 drivers/scsi/aic7xxx/aiclib.c|  103 +-
 drivers/scsi/aic7xxx/aiclib.h|   32 +
 19 files changed, 1114 insertions(+), 2062 deletions(-)
 create mode 100644 drivers/scsi/aic7xxx/Kconfig

-- 
2.11.0



[PATCH 3/4] aic7xxx: regenerate firmware files

2017-07-28 Thread Michał Mirosław
Regenerate firmware files to make cleaner base for following fix.
This removes some unused definitions and reorders some #defines, but
the code remains the same.

Signed-off-by: Michał Mirosław <mirq-li...@rere.qmqm.pl>
---
 drivers/scsi/aic7xxx/aic79xx_reg.h_shipped   | 1267 --
 drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped |   34 +-
 drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped   |   44 +-
 3 files changed, 235 insertions(+), 1110 deletions(-)

diff --git a/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped 
b/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
index cdcead071ef6..ddcd5a7701ac 100644
--- a/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
+++ b/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped
@@ -13,13 +13,6 @@ typedef struct ahd_reg_parse_entry {
 } ahd_reg_parse_entry_t;
 
 #if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_mode_ptr_print;
-#else
-#define ahd_mode_ptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "MODE_PTR", 0x00, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
 ahd_reg_print_t ahd_intstat_print;
 #else
 #define ahd_intstat_print(regvalue, cur_col, wrap) \
@@ -27,27 +20,6 @@ ahd_reg_print_t ahd_intstat_print;
 #endif
 
 #if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_seqintcode_print;
-#else
-#define ahd_seqintcode_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "SEQINTCODE", 0x02, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_error_print;
-#else
-#define ahd_error_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "ERROR", 0x04, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_hescb_qoff_print;
-#else
-#define ahd_hescb_qoff_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "HESCB_QOFF", 0x08, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
 ahd_reg_print_t ahd_hs_mailbox_print;
 #else
 #define ahd_hs_mailbox_print(regvalue, cur_col, wrap) \
@@ -62,27 +34,6 @@ ahd_reg_print_t ahd_seqintstat_print;
 #endif
 
 #if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_clrseqintstat_print;
-#else
-#define ahd_clrseqintstat_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "CLRSEQINTSTAT", 0x0c, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_swtimer_print;
-#else
-#define ahd_swtimer_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "SWTIMER", 0x0e, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_sescb_qoff_print;
-#else
-#define ahd_sescb_qoff_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "SESCB_QOFF", 0x12, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
 ahd_reg_print_t ahd_intctl_print;
 #else
 #define ahd_intctl_print(regvalue, cur_col, wrap) \
@@ -111,111 +62,6 @@ ahd_reg_print_t ahd_sg_cache_shadow_print;
 #endif
 
 #if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_lqin_print;
-#else
-#define ahd_lqin_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "LQIN", 0x20, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_lunptr_print;
-#else
-#define ahd_lunptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "LUNPTR", 0x22, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_cmdlenptr_print;
-#else
-#define ahd_cmdlenptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "CMDLENPTR", 0x25, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_attrptr_print;
-#else
-#define ahd_attrptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "ATTRPTR", 0x26, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_flagptr_print;
-#else
-#define ahd_flagptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "FLAGPTR", 0x27, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_cmdptr_print;
-#else
-#define ahd_cmdptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "CMDPTR", 0x28, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_qnextptr_print;
-#else
-#define ahd_qnextptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "QNEXTPTR", 0x29, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_abrtbyteptr_print;
-#else
-#define ahd_abrtbyteptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "ABRTBYTEPTR", 0x2b, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_abrtbitptr_print;
-#else
-#define ahd_abrtbitptr_print(regvalue, cur_col, wrap) \
-ahd_print_register(NULL, 0, "ABRTBITPTR", 0x2c, regvalue, cur_col, wrap)
-#endif
-
-#if AIC_DEBUG_REGISTERS
-ahd_reg_print_t ahd_lunlen_print;
-#else
-#define ahd