Skip to contentSkip to conversation

debloat aic7xxx and aic79xx drivers by deinlining

PATCH In review Denys Vlasenko 6 participants 11 messages Aug 25, 2007 – Aug 31, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 debloat aic7xxx and aic79xx drivers by deinlining

Hi,

Attached patch deinlines and moves big functions from .h to .c files in drivers/scsi/aic7xxx/*. I also had to add prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files.

No other code changes made.

Compile-tested on i386 and x86-64.
Total .text size reduction: ~60k in 64 bits, ~90k in 32 bits.

Per-object-file and whole-module size difference:
for x86-64:
text data bss dec hex filename

 261433   50018    1172  312623   4c52f org/built-in.o
 199622   50018    1172  250812   3d3bc aic/built-in.o
  11680    7168       0   18848    49a0 org/aic7xxx_reg_print.o
  11680    7168       0   18848    49a0 aic/aic7xxx_reg_print.o
   3065       0       0    3065     bf9 org/aic7xxx_proc.o
   2849       0       0    2849     b21 aic/aic7xxx_proc.o
  16037    1984       0   18021    4665 org/aic7xxx_pci.o
  12896    1984       0   14880    3a20 aic/aic7xxx_pci.o
   1977    4768       0    6745    1a59 aic/aic7xxx_osm_pci.o
   1704    4768       0    6472    1948 org/aic7xxx_osm_pci.o
  15033     865     564   16462    404e org/aic7xxx_osm.o
  13752     865     564   15181    3b4d aic/aic7xxx_osm.o
  53228    7424       0   60652    ecec org/aic7xxx_core.o
  42925    7424       0   50349    c4ad aic/aic7xxx_core.o
   3193      72       0    3265     cc1 org/aic7xxx_93cx6.o
   1778      72       0    1850     73a aic/aic7xxx_93cx6.o
 103971   22321     564  126856   1ef88 org/aic7xxx.o
  87888   22321     564  110773   1b0b5 aic/aic7xxx.o
  25743   14016       0   39759    9b4f org/aic79xx_reg_print.o
  25743   14016       0   39759    9b4f aic/aic79xx_reg_print.o
   3312       0       0    3312     cf0 org/aic79xx_proc.o
   2764       0       0    2764     acc aic/aic79xx_proc.o
   9420     544      24    9988    2704 org/aic79xx_pci.o
   6539     544      24    7107    1bc3 aic/aic79xx_pci.o
   1805    6336       0    8141    1fcd org/aic79xx_osm_pci.o
   1791    6336       0    8127    1fbf aic/aic79xx_osm_pci.o
  18982    1189     564   20735    50ff org/aic79xx_osm.o
  17287    1189     564   19040    4a60 aic/aic79xx_osm.o
  98160    5600       0  103760   19550 org/aic79xx_core.o
  57572    5600       0   63172    f6c4 aic/aic79xx_core.o
 157435   27697     596  185728   2d580 org/aic79xx.o
 111708   27697     596  140001   222e1 aic/aic79xx.o

and for i386:
text data bss dec hex filename

 280361   32633    1112  314106   4cafa org/built-in.o
 190406   32633    1112  224151   36b97 aic/built-in.o
  11697    3336       0   15033    3ab9 org/aic7xxx_reg_print.o
  11697    3336       0   15033    3ab9 aic/aic7xxx_reg_print.o
   2970       0       0    2970     b9a org/aic7xxx_proc.o
   2698       0       0    2698     a8a aic/aic7xxx_proc.o
  16700    1488       0   18188    470c org/aic7xxx_pci.o
  11984    1488       0   13472    34a0 aic/aic7xxx_pci.o
   1857    4044       0    5901    170d aic/aic7xxx_osm_pci.o
   1575    4044       0    5619    15f3 org/aic7xxx_osm_pci.o
  14876     561     548   15985    3e71 org/aic7xxx_osm.o
  12849     561     548   13958    3686 aic/aic7xxx_osm.o
  58959    5512       0   64471    fbd7 org/aic7xxx_core.o
  40907    5512       0   46419    b553 aic/aic7xxx_core.o
   3851      72       0    3923     f53 org/aic7xxx_93cx6.o
   1618      72       0    1690     69a aic/aic7xxx_93cx6.o
 110645   15013     548  126206   1ecfe org/aic7xxx.o
  83619   15013     548   99180   1836c aic/aic7xxx.o
  25762    6496       0   32258    7e02 org/aic79xx_reg_print.o
  25762    6496       0   32258    7e02 aic/aic79xx_reg_print.o
   3258       0       0    3258     cba org/aic79xx_proc.o
   2619       0       0    2619     a3b aic/aic79xx_proc.o
  10082     408      12   10502    2906 org/aic79xx_pci.o
   6145     408      12    6565    19a5 aic/aic79xx_pci.o
   1716    5416       0    7132    1bdc org/aic79xx_osm_pci.o
   1704    5416       0    7120    1bd0 aic/aic79xx_osm_pci.o
  18499     865     552   19916    4dcc org/aic79xx_osm.o
  16232     865     552   17649    44f1 aic/aic79xx_osm.o
 110391    4432       0  114823   1c087 org/aic79xx_core.o
  54314    4432       0   58746    e57a aic/aic79xx_core.o
 169715   17617     564  187896   2ddf8 org/aic79xx.o
 106784   17617     564  124965   1e825 aic/aic79xx.o

Please apply.

--
vda

drivers/scsi/aic7xxx/aic79xx_core.c +764 -2
@@ -266,8 +266,752 @@
 				      int target, char channel, int lun,
 				      u_int tag, role_t role);
 
-/******************************** Private Inlines *****************************/
+/************************ Sequencer Execution Control *************************/
+void
+ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst)
+{
+	if (ahd->src_mode == src && ahd->dst_mode == dst)
+		return;
+#ifdef AHD_DEBUG
+	if (ahd->src_mode == AHD_MODE_UNKNOWN
+	 || ahd->dst_mode == AHD_MODE_UNKNOWN)
+		panic("Setting mode prior to saving it.\n");
+	if ((ahd_debug & AHD_SHOW_MODEPTR) != 0)
+		printf("%s: Setting mode 0x%x\n", ahd_name(ahd),
+		       ahd_build_mode_state(ahd, src, dst));
+#endif
+	ahd_outb(ahd, MODE_PTR, ahd_build_mode_state(ahd, src, dst));
+	ahd->src_mode = src;
+	ahd->dst_mode = dst;
+}
 
+void
+ahd_update_modes(struct ahd_softc *ahd)
+{
+	ahd_mode_state mode_ptr;
+	ahd_mode src;
+	ahd_mode dst;
+
+	mode_ptr = ahd_inb(ahd, MODE_PTR);
+#ifdef AHD_DEBUG
+	if ((ahd_debug & AHD_SHOW_MODEPTR) != 0)
+		printf("Reading mode 0x%x\n", mode_ptr);
+#endif
+	ahd_extract_mode_state(ahd, mode_ptr, &src, &dst);
+	ahd_known_modes(ahd, src, dst);
+}
+
+void
+ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode,
+		 ahd_mode dstmode, const char *file, int line)
+{
+#ifdef AHD_DEBUG
+	if ((srcmode & AHD_MK_MSK(ahd->src_mode)) == 0
+	 || (dstmode & AHD_MK_MSK(ahd->dst_mode)) == 0) {
+		panic("%s:%s:%d: Mode assertion failed.\n",
+		       ahd_name(ahd), file, line);
+	}
+#endif
+}
+
+#define AHD_ASSERT_MODES(ahd, source, dest) \
+	ahd_assert_modes(ahd, source, dest, __FILE__, __LINE__);
+
+ahd_mode_state
+ahd_save_modes(struct ahd_softc *ahd)
+{
+	if (ahd->src_mode == AHD_MODE_UNKNOWN
+	 || ahd->dst_mode == AHD_MODE_UNKNOWN)
+		ahd_update_modes(ahd);
+
+	return (ahd_build_mode_state(ahd, ahd->src_mode, ahd->dst_mode));
+}
+
+void
+ahd_restore_modes(struct ahd_softc *ahd, ahd_mode_state state)
+{
+	ahd_mode src;
+	ahd_mode dst;
+
+	ahd_extract_mode_state(ahd, state, &src, &dst);
+	ahd_set_modes(ahd, src, dst);
+}
+
+/*
+ * Determine whether the sequencer has halted code execution.
+ * Returns non-zero status if the sequencer is stopped.
+ */
+int
+ahd_is_paused(struct ahd_softc *ahd)
+{
+	return ((ahd_inb(ahd, HCNTRL) & PAUSE) != 0);
+}
+
+/*
+ * Request that the sequencer stop and wait, indefinitely, for it
+ * to stop.  The sequencer will only acknowledge that it is paused
+ * once it has reached an instruction boundary and PAUSEDIS is
+ * cleared in the SEQCTL register.  The sequencer may use PAUSEDIS
+ * for critical sections.
+ */
+void
+ahd_pause(struct ahd_softc *ahd)
+{
+	ahd_outb(ahd, HCNTRL, ahd->pause);
+
+	/*
+	 * Since the sequencer can disable pausing in a critical section, we
+	 * must loop until it actually stops.
+	 */
+	while (ahd_is_paused(ahd) == 0)
+		;
+}
+
+/*
+ * Allow the sequencer to continue program execution.
+ * We check here to ensure that no additional interrupt
+ * sources that would cause the sequencer to halt have been
+ * asserted.  If, for example, a SCSI bus reset is detected
+ * while we are fielding a different, pausing, interrupt type,
+ * we don't want to release the sequencer before going back
+ * into our interrupt handler and dealing with this new
+ * condition.
+ */
+void
+ahd_unpause(struct ahd_softc *ahd)
+{
+	/*
+	 * Automatically restore our modes to those saved
+	 * prior to the first change of the mode.
+	 */
+	if (ahd->saved_src_mode != AHD_MODE_UNKNOWN
+	 && ahd->saved_dst_mode != AHD_MODE_UNKNOWN) {
+		if ((ahd->flags & AHD_UPDATE_PEND_CMDS) != 0)
+			ahd_reset_cmds_pending(ahd);
+		ahd_set_modes(ahd, ahd->saved_src_mode, ahd->saved_dst_mode);
+	}
+
+	if ((ahd_inb(ahd, INTSTAT) & ~CMDCMPLT) == 0)
+		ahd_outb(ahd, HCNTRL, ahd->unpause);
+
+	ahd_known_modes(ahd, AHD_MODE_UNKNOWN, AHD_MODE_UNKNOWN);
+}
+
+/*********************** Scatter Gather List Handling *************************/
+void *
+ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb,
+	     void *sgptr, dma_addr_t addr, bus_size_t len, int last)
+{
+	scb->sg_count++;
+	if (sizeof(dma_addr_t) > 4
+	 && (ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
+		struct ahd_dma64_seg *sg;
+
+		sg = (struct ahd_dma64_seg *)sgptr;
+		sg->addr = ahd_htole64(addr);
+		sg->len = ahd_htole32(len | (last ? AHD_DMA_LAST_SEG : 0));
+		return (sg + 1);
+	} else {
+		struct ahd_dma_seg *sg;
+
+		sg = (struct ahd_dma_seg *)sgptr;
+		sg->addr = ahd_htole32(addr & 0xFFFFFFFF);
+		sg->len = ahd_htole32(len | ((addr >> 8) & 0x7F000000)
+				    | (last ? AHD_DMA_LAST_SEG : 0));
+		return (sg + 1);
+	}
+}
+
+void
+ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb)
+{
+	/* XXX Handle target mode SCBs. */
+	scb->crc_retry_count = 0;
+	if ((scb->flags & SCB_PACKETIZED) != 0) {
+		/* XXX what about ACA??  It is type 4, but TAG_TYPE == 0x3. */
+		scb->hscb->task_attribute = scb->hscb->control & SCB_TAG_TYPE;
+	} else {
+		if (ahd_get_transfer_length(scb) & 0x01)
+			scb->hscb->task_attribute = SCB_XFERLEN_ODD;
+		else
+			scb->hscb->task_attribute = 0;
+	}
+
+	if (scb->hscb->cdb_len <= MAX_CDB_LEN_WITH_SENSE_ADDR
+	 || (scb->hscb->cdb_len & SCB_CDB_LEN_PTR) != 0)
+		scb->hscb->shared_data.idata.cdb_plus_saddr.sense_addr =
+		    ahd_htole32(scb->sense_busaddr);
+}
+
+void
+ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb)
+{
+	/*
+	 * Copy the first SG into the "current" data ponter area.
+	 */
+	if ((ahd->flags & AHD_64BIT_ADDRESSING) != 0) {
+		struct ahd_dma64_seg *sg;
+
+		sg = (struct ahd_dma64_seg *)scb->sg_list;
+		scb->hscb->dataptr = sg->addr;
+		scb->hscb->datacnt = sg->len;
+	} else {
+		struct ahd_dma_seg *sg;
+		uint32_t *dataptr_words;
+
+		sg = (struct ahd_dma_seg *)scb->sg_list;
+		dataptr_words = (uint32_t*)&scb->hscb->dataptr;
+		dataptr_words[0] = sg->addr;
+		dataptr_words[1] = 0;
+		if ((ahd->flags & AHD_39BIT_ADDRESSING) != 0) {
+			uint64_t high_addr;
+
+			high_addr = ahd_le32toh(sg->len) & 0x7F000000;
+			scb->hscb->dataptr |= ahd_htole64(high_addr << 8);
+		}
+		scb->hscb->datacnt = sg->len;
+	}
+	/*
+	 * Note where to find the SG entries in bus space.
+	 * We also set the full residual flag which the 
+	 * sequencer will clear as soon as a data transfer
+	 * occurs.
+	 */
+	scb->hscb->sgptr = ahd_htole32(scb->sg_list_busaddr|SG_FULL_RESID);
+}
+
+void
+ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb)
+{
+	scb->hscb->sgptr = ahd_htole32(SG_LIST_NULL);
+	scb->hscb->dataptr = 0;
+	scb->hscb->datacnt = 0;
+}
+
+/************************** Memory mapping routines ***************************/
+void *
+ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr)
+{
+	dma_addr_t sg_offset;
+
+	/* sg_list_phys points to entry 1, not 0 */
+	sg_offset = sg_busaddr - (scb->sg_list_busaddr - ahd_sg_size(ahd));
+	return ((uint8_t *)scb->sg_list + sg_offset);
+}
+
+uint32_t
+ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg)
+{
+	dma_addr_t sg_offset;
+
+	/* sg_list_phys points to entry 1, not 0 */
+	sg_offset = ((uint8_t *)sg - (uint8_t *)scb->sg_list)
+		  - ahd_sg_size(ahd);
+
+	return (scb->sg_list_busaddr + sg_offset);
+}
+
+void
+ahd_sync_scb(struct ahd_softc *ahd, struct scb *scb, int op)
+{
+	ahd_dmamap_sync(ahd, ahd->scb_data.hscb_dmat,
+			scb->hscb_map->dmamap,
+			/*offset*/(uint8_t*)scb->hscb - scb->hscb_map->vaddr,
+			/*len*/sizeof(*scb->hscb), op);
+}
+
+void
+ahd_sync_sglist(struct ahd_softc *ahd, struct scb *scb, int op)
+{
+	if (scb->sg_count == 0)
+		return;
+
+	ahd_dmamap_sync(ahd, ahd->scb_data.sg_dmat,
+			scb->sg_map->dmamap,
+			/*offset*/scb->sg_list_busaddr - ahd_sg_size(ahd),
+			/*len*/ahd_sg_size(ahd) * scb->sg_count, op);
+}
+
+void
+ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op)
+{
+	ahd_dmamap_sync(ahd, ahd->scb_data.sense_dmat,
+			scb->sense_map->dmamap,
+			/*offset*/scb->sense_busaddr,
+			/*len*/AHD_SENSE_BUFSIZE, op);
+}
+
+uint32_t
+ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index)
+{
+	return (((uint8_t *)&ahd->targetcmds[index])
+	       - (uint8_t *)ahd->qoutfifo);
+}
+
+/*********************** Miscelaneous Support Functions ***********************/
+/*
+ * Return pointers to the transfer negotiation information
+ * for the specified our_id/remote_id pair.
+ */
+struct ahd_initiator_tinfo *
+ahd_fetch_transinfo(struct ahd_softc *ahd, char channel, u_int our_id,
+		    u_int remote_id, struct ahd_tmode_tstate **tstate)
+{
+	/*
+	 * Transfer data structures are stored from the perspective
+	 * of the target role.  Since the parameters for a connection
+	 * in the initiator role to a given target are the same as
+	 * when the roles are reversed, we pretend we are the target.
+	 */
+	if (channel == 'B')
+		our_id += 8;
+	*tstate = ahd->enabled_targets[our_id];
+	return (&(*tstate)->transinfo[remote_id]);
+}
+
+uint16_t
+ahd_inw(struct ahd_softc *ahd, u_int port)
+{
+	/*
+	 * Read high byte first as some registers increment
+	 * or have other side effects when the low byte is
+	 * read.
+	 */
+	uint16_t r = ahd_inb(ahd, port+1) << 8;
+	return r | ahd_inb(ahd, port);
+}
+
+void
+ahd_outw(struct ahd_softc *ahd, u_int port, u_int value)
+{
+	/*
+	 * Write low byte first to accomodate registers
+	 * such as PRGMCNT where the order maters.
+	 */
+	ahd_outb(ahd, port, value & 0xFF);
+	ahd_outb(ahd, port+1, (value >> 8) & 0xFF);
+}
+
+uint32_t
+ahd_inl(struct ahd_softc *ahd, u_int port)
+{
+	return ((ahd_inb(ahd, port))
+	      | (ahd_inb(ahd, port+1) << 8)
+	      | (ahd_inb(ahd, port+2) << 16)
+	      | (ahd_inb(ahd, port+3) << 24));
+}
+
+void
+ahd_outl(struct ahd_softc *ahd, u_int port, uint32_t value)
+{
+	ahd_outb(ahd, port, (value) & 0xFF);
+	ahd_outb(ahd, port+1, ((value) >> 8) & 0xFF);
+	ahd_outb(ahd, port+2, ((value) >> 16) & 0xFF);
+	ahd_outb(ahd, port+3, ((value) >> 24) & 0xFF);
+}
+
+uint64_t
+ahd_inq(struct ahd_softc *ahd, u_int port)
+{
+	return ((ahd_inb(ahd, port))
+	      | (ahd_inb(ahd, port+1) << 8)
+	      | (ahd_inb(ahd, port+2) << 16)
+	      | (ahd_inb(ahd, port+3) << 24)
+	      | (((uint64_t)ahd_inb(ahd, port+4)) << 32)
+	      | (((uint64_t)ahd_inb(ahd, port+5)) << 40)
+	      | (((uint64_t)ahd_inb(ahd, port+6)) << 48)
+	      | (((uint64_t)ahd_inb(ahd, port+7)) << 56));
+}
+
+void
+ahd_outq(struct ahd_softc *ahd, u_int port, uint64_t value)
+{
+	ahd_outb(ahd, port, value & 0xFF);
+	ahd_outb(ahd, port+1, (value >> 8) & 0xFF);
+	ahd_outb(ahd, port+2, (value >> 16) & 0xFF);
+	ahd_outb(ahd, port+3, (value >> 24) & 0xFF);
+	ahd_outb(ahd, port+4, (value >> 32) & 0xFF);
+	ahd_outb(ahd, port+5, (value >> 40) & 0xFF);
+	ahd_outb(ahd, port+6, (value >> 48) & 0xFF);
+	ahd_outb(ahd, port+7, (value >> 56) & 0xFF);
+}
+
+u_int
+ahd_get_scbptr(struct ahd_softc *ahd)
+{
+	AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
+			 ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK));
+	return (ahd_inb(ahd, SCBPTR) | (ahd_inb(ahd, SCBPTR + 1) << 8));
+}
+
+void
+ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr)
+{
+	AHD_ASSERT_MODES(ahd, ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK),
+			 ~(AHD_MODE_UNKNOWN_MSK|AHD_MODE_CFG_MSK));
+	ahd_outb(ahd, SCBPTR, scbptr & 0xFF);
+	ahd_outb(ahd, SCBPTR+1, (scbptr >> 8) & 0xFF);
+}
+
+u_int
+ahd_get_hnscb_qoff(struct ahd_softc *ahd)
+{
+	return (ahd_inw_atomic(ahd, HNSCB_QOFF));
+}
+
+void
+ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value)
+{
+	ahd_outw_atomic(ahd, HNSCB_QOFF, value);
+}
+
+u_int
+ahd_get_hescb_qoff(struct ahd_softc *ahd)
+{
+	return (ahd_inb(ahd, HESCB_QOFF));
+}
+
+void
+ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value)
+{
+	ahd_outb(ahd, HESCB_QOFF, value);
+}
+
+u_int
+ahd_get_snscb_qoff(struct ahd_softc *ahd)
+{
+	u_int oldvalue;
+
+	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	oldvalue = ahd_inw(ahd, SNSCB_QOFF);
+	ahd_outw(ahd, SNSCB_QOFF, oldvalue);
+	return (oldvalue);
+}
+
+void
+ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value)
+{
+	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	ahd_outw(ahd, SNSCB_QOFF, value);
+}
+
+u_int
+ahd_get_sescb_qoff(struct ahd_softc *ahd)
+{
+	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	return (ahd_inb(ahd, SESCB_QOFF));
+}
+
+void
+ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value)
+{
+	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	ahd_outb(ahd, SESCB_QOFF, value);
+}
+
+u_int
+ahd_get_sdscb_qoff(struct ahd_softc *ahd)
+{
+	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	return (ahd_inb(ahd, SDSCB_QOFF) | (ahd_inb(ahd, SDSCB_QOFF + 1) << 8));
+}
+
+void
+ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value)
+{
+	AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK);
+	ahd_outb(ahd, SDSCB_QOFF, value & 0xFF);
+	ahd_outb(ahd, SDSCB_QOFF+1, (value >> 8) & 0xFF);
+}
+
+u_int
+ahd_inb_scbram(struct ahd_softc *ahd, u_int offset)
+{
+	u_int value;
+
+	/*
+	 * Workaround PCI-X Rev A. hardware bug.
+	 * After a host read of SCB memory, the chip
+	 * may become confused into thinking prefetch
+	 * was required.  This starts the discard timer
+	 * running and can cause an unexpected discard
+	 * timer interrupt.  The work around is to read
+	 * a normal register prior to the exhaustion of
+	 * the discard timer.  The mode pointer register
+	 * has no side effects and so serves well for
+	 * this purpose.
+	 *
+	 * Razor #528
+	 */
+	value = ahd_inb(ahd, offset);
+	if ((ahd->bugs & AHD_PCIX_SCBRAM_RD_BUG) != 0)
+		ahd_inb(ahd, MODE_PTR);
+	return (value);
+}
+
+u_int
+ahd_inw_scbram(struct ahd_softc *ahd, u_int offset)
+{
+	return (ahd_inb_scbram(ahd, offset)
+	      | (ahd_inb_scbram(ahd, offset+1) << 8));
+}
+
+uint32_t
+ahd_inl_scbram(struct ahd_softc *ahd, u_int offset)
+{
+	return (ahd_inw_scbram(ahd, offset)
+	      | (ahd_inw_scbram(ahd, offset+2) << 16));
+}
+
+uint64_t
+ahd_inq_scbram(struct ahd_softc *ahd, u_int offset)
+{
+	return (ahd_inl_scbram(ahd, offset)
+	      | ((uint64_t)ahd_inl_scbram(ahd, offset+4)) << 32);
+}
+
+struct scb *
+ahd_lookup_scb(struct ahd_softc *ahd, u_int tag)
+{
+	struct scb* scb;
+
+	if (tag >= AHD_SCB_MAX)
+		return (NULL);
+	scb = ahd->scb_data.scbindex[tag];
+	if (scb != NULL)
+		ahd_sync_scb(ahd, scb,
+			     BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
+	return (scb);
+}
+
+void
+ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb)
+{
+	struct	 hardware_scb *q_hscb;
+	struct	 map_node *q_hscb_map;
+	uint32_t saved_hscb_busaddr;
+
+	/*
+	 * Our queuing method is a bit tricky.  The card
+	 * knows in advance which HSCB (by address) to download,
+	 * and we can't disappoint it.  To achieve this, the next
+	 * HSCB to download is saved off in ahd->next_queued_hscb.
+	 * When we are called to queue "an arbitrary scb",
+	 * we copy the contents of the incoming HSCB to the one
+	 * the sequencer knows about, swap HSCB pointers and
+	 * finally assign the SCB to the tag indexed location
+	 * in the scb_array.  This makes sure that we can still
+	 * locate the correct SCB by SCB_TAG.
+	 */
+	q_hscb = ahd->next_queued_hscb;
+	q_hscb_map = ahd->next_queued_hscb_map;
+	saved_hscb_busaddr = q_hscb->hscb_busaddr;
+	memcpy(q_hscb, scb->hscb, sizeof(*scb->hscb));
+	q_hscb->hscb_busaddr = saved_hscb_busaddr;
+	q_hscb->next_hscb_busaddr = scb->hscb->hscb_busaddr;
+
+	/* Now swap HSCB pointers. */
+	ahd->next_queued_hscb = scb->hscb;
+	ahd->next_queued_hscb_map = scb->hscb_map;
+	scb->hscb = q_hscb;
+	scb->hscb_map = q_hscb_map;
+
+	/* Now define the mapping from tag to SCB in the scbindex */
+	ahd->scb_data.scbindex[SCB_GET_TAG(scb)] = scb;
+}
+
+/*
+ * Tell the sequencer about a new transaction to execute.
+ */
+void
+ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb)
+{
+	ahd_swap_with_next_hscb(ahd, scb);
+
+	if (SCBID_IS_NULL(SCB_GET_TAG(scb)))
+		panic("Attempt to queue invalid SCB tag %x\n",
+		      SCB_GET_TAG(scb));
+
+	/*
+	 * Keep a history of SCBs we've downloaded in the qinfifo.
+	 */
+	ahd->qinfifo[AHD_QIN_WRAP(ahd->qinfifonext)] = SCB_GET_TAG(scb);
+	ahd->qinfifonext++;
+
+	if (scb->sg_count != 0)
+		ahd_setup_data_scb(ahd, scb);
+	else
+		ahd_setup_noxfer_scb(ahd, scb);
+	ahd_setup_scb_common(ahd, scb);
+
+	/*
+	 * Make sure our data is consistent from the
+	 * perspective of the adapter.
+	 */
+	ahd_sync_scb(ahd, scb, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
+
+#ifdef AHD_DEBUG
+	if ((ahd_debug & AHD_SHOW_QUEUE) != 0) {
+		uint64_t host_dataptr;
+
+		host_dataptr = ahd_le64toh(scb->hscb->dataptr);
+		printf("%s: Queueing SCB %d:0x%x bus addr 0x%x - 0x%x%x/0x%x\n",
+		       ahd_name(ahd),
+		       SCB_GET_TAG(scb), scb->hscb->scsiid,
+		       ahd_le32toh(scb->hscb->hscb_busaddr),
+		       (u_int)((host_dataptr >> 32) & 0xFFFFFFFF),
+		       (u_int)(host_dataptr & 0xFFFFFFFF),
+		       ahd_le32toh(scb->hscb->datacnt));
+	}
+#endif
+	/* Tell the adapter about the newly queued SCB */
+	ahd_set_hnscb_qoff(ahd, ahd->qinfifonext);
+}
+
+/************************** Interrupt Processing ******************************/
+void
+ahd_sync_qoutfifo(struct ahd_softc *ahd, int op)
+{
+	ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap,
+			/*offset*/0,
+			/*len*/AHD_SCB_MAX * sizeof(struct ahd_completion), op);
+}
+
+void
+ahd_sync_tqinfifo(struct ahd_softc *ahd, int op)
+{
+#ifdef AHD_TARGET_MODE
+	if ((ahd->flags & AHD_TARGETROLE) != 0) {
+		ahd_dmamap_sync(ahd, ahd->shared_data_dmat,
+				ahd->shared_data_map.dmamap,
+				ahd_targetcmd_offset(ahd, 0),
+				sizeof(struct target_cmd) * AHD_TMODE_CMDS,
+				op);
+	}
+#endif
+}
+
+/*
+ * See if the firmware has posted any completed commands
+ * into our in-core command complete fifos.
+ */
+#define AHD_RUN_QOUTFIFO 0x1
+#define AHD_RUN_TQINFIFO 0x2
+u_int
+ahd_check_cmdcmpltqueues(struct ahd_softc *ahd)
+{
+	u_int retval;
+
+	retval = 0;
+	ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap,
+			/*offset*/ahd->qoutfifonext * sizeof(*ahd->qoutfifo),
+			/*len*/sizeof(*ahd->qoutfifo), BUS_DMASYNC_POSTREAD);
+	if (ahd->qoutfifo[ahd->qoutfifonext].valid_tag
+	  == ahd->qoutfifonext_valid_tag)
+		retval |= AHD_RUN_QOUTFIFO;
+#ifdef AHD_TARGET_MODE
+	if ((ahd->flags & AHD_TARGETROLE) != 0
+	 && (ahd->flags & AHD_TQINFIFO_BLOCKED) == 0) {
+		ahd_dmamap_sync(ahd, ahd->shared_data_dmat,
+				ahd->shared_data_map.dmamap,
+				ahd_targetcmd_offset(ahd, ahd->tqinfifofnext),
+				/*len*/sizeof(struct target_cmd),
+				BUS_DMASYNC_POSTREAD);
+		if (ahd->targetcmds[ahd->tqinfifonext].cmd_valid != 0)
+			retval |= AHD_RUN_TQINFIFO;
+	}
+#endif
+	return (retval);
+}
+
+/*
+ * Catch an interrupt from the adapter
+ */
+int
+ahd_intr(struct ahd_softc *ahd)
+{
+	u_int	intstat;
+
+	if ((ahd->pause & INTEN) == 0) {
+		/*
+		 * Our interrupt is not enabled on the chip
+		 * and may be disabled for re-entrancy reasons,
+		 * so just return.  This is likely just a shared
+		 * interrupt.
+		 */
+		return (0);
+	}
+
+	/*
+	 * Instead of directly reading the interrupt status register,
+	 * infer the cause of the interrupt by checking our in-core
+	 * completion queues.  This avoids a costly PCI bus read in
+	 * most cases.
+	 */
+	if ((ahd->flags & AHD_ALL_INTERRUPTS) == 0
+	 && (ahd_check_cmdcmpltqueues(ahd) != 0))
+		intstat = CMDCMPLT;
+	else
+		intstat = ahd_inb(ahd, INTSTAT);
+
+	if ((intstat & INT_PEND) == 0)
+		return (0);
+
+	if (intstat & CMDCMPLT) {
+		ahd_outb(ahd, CLRINT, CLRCMDINT);
+
+		/*
+		 * Ensure that the chip sees that we've cleared
+		 * this interrupt before we walk the output fifo.
+		 * Otherwise, we may, due to posted bus writes,
+		 * clear the interrupt after we finish the scan,
+		 * and after the sequencer has added new entries
+		 * and asserted the interrupt again.
+		 */
+		if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {
+			if (ahd_is_paused(ahd)) {
+				/*
+				 * Potentially lost SEQINT.
+				 * If SEQINTCODE is non-zero,
+				 * simulate the SEQINT.
+				 */
+				if (ahd_inb(ahd, SEQINTCODE) != NO_SEQINT)
+					intstat |= SEQINT;
+			}
+		} else {
+			ahd_flush_device_writes(ahd);
+		}
+		ahd_run_qoutfifo(ahd);
+		ahd->cmdcmplt_counts[ahd->cmdcmplt_bucket]++;
+		ahd->cmdcmplt_total++;
+#ifdef AHD_TARGET_MODE
+		if ((ahd->flags & AHD_TARGETROLE) != 0)
+			ahd_run_tqinfifo(ahd, /*paused*/FALSE);
+#endif
+	}
+
+	/*
+	 * Handle statuses that may invalidate our cached
+	 * copy of INTSTAT separately.
+	 */
+	if (intstat == 0xFF && (ahd->features & AHD_REMOVABLE) != 0) {
+		/* Hot eject.  Do nothing */
+	} else if (intstat & HWERRINT) {
+		ahd_handle_hwerrint(ahd);
+	} else if ((intstat & (PCIINT|SPLTINT)) != 0) {
+		ahd->bus_intr(ahd);
+	} else {
+
+		if ((intstat & SEQINT) != 0)
+			ahd_handle_seqint(ahd, intstat);
+
+		if ((intstat & SCSIINT) != 0)
+			ahd_handle_scsiint(ahd, intstat);
+	}
+	return (1);
+}
+
+/******************************** Private Inlines *****************************/
 static __inline void
 ahd_assert_atn(struct ahd_softc *ahd)
 {
@@ -280,7 +1024,7 @@
  * are currently in a packetized transfer.  We could
  * just as easily be sending or receiving a message.
  */
-static __inline int
+static int
 ahd_currently_packetized(struct ahd_softc *ahd)
 {
 	ahd_mode_state	 saved_modes;
@@ -6271,6 +7015,24 @@
 	"Under Terminated",
 	"Not Configured"
 };
+
+/***************************** Timer Facilities *******************************/
+#define ahd_timer_init init_timer
+#define ahd_timer_stop del_timer_sync
+typedef void ahd_linux_callback_t (u_long);
+
+static void
+ahd_timer_reset(ahd_timer_t *timer, int usec, ahd_callback_t *func, void *arg)
+{
+	struct ahd_softc *ahd;
+
+	ahd = (struct ahd_softc *)arg;
+	del_timer(timer);
+	timer->data = (u_long)arg;
+	timer->expires = jiffies + (usec * HZ)/1000000;
+	timer->function = (ahd_linux_callback_t*)func;
+	add_timer(timer);
+}
 
 /*
  * Start the board, ready for normal operation
drivers/scsi/aic7xxx/aic79xx_inline.h +86 -817

946 lines not on this page · raw message

drivers/scsi/aic7xxx/aic79xx_osm.c +159 -3

176 lines not on this page · raw message

drivers/scsi/aic7xxx/aic79xx_osm.h +9 -167

204 lines not on this page · raw message

drivers/scsi/aic7xxx/aic7xxx_core.c +504 -0

510 lines not on this page · raw message

drivers/scsi/aic7xxx/aic7xxx_inline.h +56 -554

379 lines not on this page · raw message

drivers/scsi/aic7xxx/aic7xxx_osm.c +73 -4

77 lines not on this page · raw message

drivers/scsi/aic7xxx/aic7xxx_osm.h +11 -126

137 lines not on this page · raw message

drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +51 -0

51 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 6 lines · On Sat, 25 Aug 2007 22:57:07 +0100 Denys Vlasenko <[email protected]>…

Hi,

Attached patch deinlines and moves big functions from .h to .c files in drivers/scsi/aic7xxx/*. I also had to add prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files.

one question... how many of these can actually be static (or would be if they were in their only-caller-c-file) ? Did you run the find static script or are you waiting for Adrian to do that ;-)

#2 lore raw
Quoted 11 lines · Arjan van de Ven

On Sat, 25 Aug 2007 22:57:07 +0100

Quoted 5 lines · Denys Vlasenko

Hi,

Attached patch deinlines and moves big functions from .h to .c files in drivers/scsi/aic7xxx/*. I also had to add prototypes for ahc_lookup_scb and ahd_lookup_scb to .h files.

one question... how many of these can actually be static (or would be if they were in their only-caller-c-file) ?

Seeing this patch ignored two or three times already, I tried to make as non-intrusive change as possible, thus maximizing the chances that it will be applied.

Come on, this patch saves 60k-90k of text, or 30-40% of driver size. This is ridiculous to have such enormous bloat.

In the functions I converted there are no non-static functions which are not declared in a .h file.

There are indeed functions which are used only in one .c file:

ahc_check_cmdcmpltqueues: aic7xxx_core.c
ahc_get_sense_bufaddr: aic7xxx_core.c
ahc_hscb_busaddr: aic7xxx_core.c
ahc_inq: aic7xxx_core.c
ahc_outq: aic7xxx_core.c
ahc_pause_bug_fix: aic7xxx_core.c
ahc_sg_bus_to_virt: aic7xxx_core.c
ahc_sg_virt_to_bus: aic7xxx_core.c
ahc_swap_with_next_hscb: aic7xxx_core.c
ahc_sync_qoutfifo: aic7xxx_core.c
ahc_sync_scb: aic7xxx_core.c
ahc_sync_tqinfifo: aic7xxx_core.c
ahc_targetcmd_offset: aic7xxx_core.c
ahc_update_residual: aic7xxx_core.c
ahd_assert_modes: aic79xx_core.c
ahd_check_cmdcmpltqueues: aic79xx_core.c
ahd_get_hescb_qoff: aic79xx_core.c
ahd_get_hnscb_qoff: aic79xx_core.c
ahd_get_sdscb_qoff: aic79xx_core.c
ahd_get_sescb_qoff: aic79xx_core.c
ahd_get_snscb_qoff: aic79xx_core.c
ahd_inl_scbram: aic79xx_core.c
ahd_inq: aic79xx_core.c
ahd_inq_scbram: aic79xx_core.c
ahd_outq: aic79xx_core.c
ahd_set_hescb_qoff: aic79xx_core.c
ahd_set_hnscb_qoff: aic79xx_core.c
ahd_set_sdscb_qoff: aic79xx_core.c
ahd_set_sescb_qoff: aic79xx_core.c
ahd_set_snscb_qoff: aic79xx_core.c
ahd_setup_data_scb: aic79xx_core.c
ahd_setup_noxfer_scb: aic79xx_core.c
ahd_setup_scb_common: aic79xx_core.c
ahd_sg_bus_to_virt: aic79xx_core.c
ahd_sg_virt_to_bus: aic79xx_core.c
ahd_swap_with_next_hscb: aic79xx_core.c
ahd_sync_qoutfifo: aic79xx_core.c
ahd_sync_scb: aic79xx_core.c
ahd_sync_sense: aic79xx_core.c
ahd_sync_tqinfifo: aic79xx_core.c
ahd_targetcmd_offset: aic79xx_core.c
ahd_update_modes: aic79xx_core.c

Converting them to static may save additional 3 or 4k, if gcc will be smart enough...

I, too, have many questions regarding this driver:
why __inline? why u_int?... and who's maintainer, btw?

Quoted 2 lines

Did you run the find static
script or are you waiting for Adrian to do that ;-)

$ find -name '*find*static*'
$
--
vda
#3 lore raw
Quoted 7 lines · Denys Vlasenko

On Saturday 25 August 2007 22:57, Arjan van de Ven wrote:
...

Quoted 2 lines

Did you run the find static
script or are you waiting for Adrian to do that ;-)

$ find -name '*find*static*'
$

make namespacecheck

Quoted 1 line

vda

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw
Quoted 11 lines · Adrian Bunk
Quoted 8 lines · Denys Vlasenko

On Saturday 25 August 2007 22:57, Arjan van de Ven wrote:
...

Quoted 2 lines

Did you run the find static
script or are you waiting for Adrian to do that ;-)

$ find -name '*find*static*'
$

make namespacecheck

Thanks, nice tool.

aic7xxx is kind of not very nice in this regard.

See below what I get even on non-patched driver.

I am willing to clean it up, but I still would like "debloating" patch to be accepted.

Otherwise I'm left in the dark whether _any_ patches touching aic7xxx are ever looked at, or not.

Okay, the list:

Externally defined symbols with no external references

drivers/scsi/aic7xxx/aic79xx_reg_print.o

    ahd_abrtbitptr_print
    ahd_abrtbyteptr_print
    ahd_accum_print
    ahd_accum_save_print
    ahd_ahd_pci_config_base_print
    ahd_allocfifo_scbptr_print
    ahd_allones_print
    ahd_allzeros_print
    ahd_annexcol_print
    ahd_annexdat_print
    ahd_arbctl_print
    ahd_arg_1_print
    ahd_arg_2_print
    ahd_attrptr_print
    ahd_brdctl_print
    ahd_brddat_print
    ahd_brkaddr0_print
    ahd_brkaddr1_print
    ahd_businitid_print
    ahd_bustargid_print
    ahd_ccscbacnt_print
    ahd_ccscbaddr_print
    ahd_ccscbadr_bk_print
    ahd_ccscbram_print
    ahd_ccsgaddr_print
    ahd_ccsgram_print
    ahd_cdblimit_print
    ahd_clrerr_print
    ahd_clrint_print
    ahd_clrlqiint0_print
    ahd_clrlqiint1_print
    ahd_clrlqoint0_print
    ahd_clrlqoint1_print
    ahd_clrseqintsrc_print
    ahd_clrseqintstat_print
    ahd_clrsint0_print
    ahd_clrsint1_print
    ahd_clrsint2_print
    ahd_clrsint3_print
    ahd_cmc_rambist_print
    ahd_cmcpcistat_print
    ahd_cmcrxmsg0_print
    ahd_cmcrxmsg1_print
    ahd_cmcrxmsg2_print
    ahd_cmcrxmsg3_print
    ahd_cmcseqbcnt_print
    ahd_cmcspltstat0_print
    ahd_cmcspltstat1_print
    ahd_cmdlenptr_print
    ahd_cmdptr_print
    ahd_cmdrsvd0_print
    ahd_cmds_pending_print
    ahd_cmdsize_table_print
    ahd_complete_dma_scb_head_print
    ahd_complete_dma_scb_tail_print
    ahd_complete_on_qfreeze_head_print
    ahd_complete_scb_dmainprog_head_print
    ahd_complete_scb_head_print
    ahd_crccontrol_print
    ahd_curaddr_print
    ahd_currscb_print
    ahd_data_count_odd_print
    ahd_datalenptr_print
    ahd_dchrxmsg0_print
    ahd_dchrxmsg1_print
    ahd_dchrxmsg2_print
    ahd_dchrxmsg3_print
    ahd_dchseqbcnt_print
    ahd_dchspltstat0_print
    ahd_dchspltstat1_print
    ahd_df0pcistat_print
    ahd_df1pcistat_print
    ahd_dfbcnt_print
    ahd_dfbkptr_print
    ahd_dfdat_print
    ahd_dfdbctl_print
    ahd_dff_thrsh_print
    ahd_dfftag_print
    ahd_dfptrs_print
    ahd_dfraddr_print
    ahd_dfscnt_print
    ahd_dfwaddr_print
    ahd_dgrpcrci_print
    ahd_dindex_print
    ahd_dindir_print
    ahd_dlcount_print
    ahd_dmaparams_print
    ahd_dscommand0_print
    ahd_dspackctl_print
    ahd_dspdatactl_print
    ahd_dspfltrctl_print
    ahd_dspreqctl_print
    ahd_dspselect_print
    ahd_error_print
    ahd_fairness_print
    ahd_flagptr_print
    ahd_flags_print
    ahd_flexadr_print
    ahd_flexcnt_print
    ahd_flexdata_print
    ahd_flexdmastat_print
    ahd_function1_print
    ahd_gsfifo_print
    ahd_haddr_print
    ahd_hcnt_print
    ahd_hcntrl_print
    ahd_hescb_qoff_print
    ahd_hnscb_qoff_print
    ahd_hodmaadr_print
    ahd_hodmacnt_print
    ahd_hodmaen_print
    ahd_idptr_print
    ahd_initiator_tag_print
    ahd_int_coalescing_cmdcount_print
    ahd_int_coalescing_maxcmds_print
    ahd_int_coalescing_mincmds_print
    ahd_int_coalescing_timer_print
    ahd_intvec1_addr_print
    ahd_intvec2_addr_print
    ahd_iopdnctl_print
    ahd_iownid_print
    ahd_kernel_tqinpos_print
    ahd_last_msg_print
    ahd_lastaddr_print
    ahd_lastscb_print
    ahd_local_hs_mailbox_print
    ahd_longjmp_addr_print
    ahd_lqctl0_print
    ahd_lqctl1_print
    ahd_lqctl2_print
    ahd_lqimode0_print
    ahd_lqimode1_print
    ahd_lqin_print
    ahd_lqistate_print
    ahd_lqomode0_print
    ahd_lqomode1_print
    ahd_lqoscsctl_print
    ahd_lqostate_print
    ahd_lqrsvd01_print
    ahd_lqrsvd16_print
    ahd_lqrsvd17_print
    ahd_lunlen_print
    ahd_lunptr_print
    ahd_maxcmd2rcv_print
    ahd_maxcmd_print
    ahd_maxcmdbytes_print
    ahd_maxcmdcnt_print
    ahd_mode_ptr_print
    ahd_msg_out_print
    ahd_msipcistat_print
    ahd_multargid_print
    ahd_negconopts_print
    ahd_negoaddr_print
    ahd_negoffset_print
    ahd_negperiod_print
    ahd_negppropts_print
    ahd_next_queued_scb_addr_print
    ahd_nextscb_print
    ahd_none_print
    ahd_nsenable_print
    ahd_optionmode_print
    ahd_os_space_cnt_print
    ahd_ost_print
    ahd_ovlyaddr_print
    ahd_ovlypcistat_print
    ahd_ovlyrxmsg0_print
    ahd_ovlyrxmsg1_print
    ahd_ovlyrxmsg2_print
    ahd_ovlyrxmsg3_print
    ahd_ovlyseqbcnt_print
    ahd_ovlyspltstat0_print
    ahd_ovlyspltstat1_print
    ahd_packcrci_print
    ahd_pcixctl_print
    ahd_pll400cnt0_print
    ahd_pll400ctl0_print
    ahd_pll400ctl1_print
    ahd_pll960cnt0_print
    ahd_pll960ctl0_print
    ahd_pll960ctl1_print
    ahd_plldelay_print
    ahd_prgmcnt_print
    ahd_qnextptr_print
    ahd_qoff_ctlsta_print
    ahd_qoutfifo_entry_valid_tag_print
    ahd_qoutfifo_next_addr_print
    ahd_rcvrbiascalc_print
    ahd_rcvrbiosctl_print
    ahd_reg0_print
    ahd_reg1_print
    ahd_reg_isr_print
    ahd_roenable_print
    ahd_romaddr_print
    ahd_romcntrl_print
    ahd_romdata_print
    ahd_saved_lun_print
    ahd_saved_scsiid_print
    ahd_sblkctl_print
    ahd_scb_base_print
    ahd_scb_busaddr_print
    ahd_scb_cdb_len_print
    ahd_scb_datacnt_print
    ahd_scb_dataptr_print
    ahd_scb_disconnected_lists_print
    ahd_scb_lun_print
    ahd_scb_next2_print
    ahd_scb_next_print
    ahd_scb_residual_datacnt_print
    ahd_scb_residual_sgptr_print
    ahd_scb_scsi_status_print
    ahd_scb_sense_busaddr_print
    ahd_scb_sgptr_print
    ahd_scb_spare_print
    ahd_scb_tag_print
    ahd_scb_target_data_dir_print
    ahd_scb_target_itag_print
    ahd_scb_target_phases_print
    ahd_scb_task_attribute_print
    ahd_scb_task_management_print
    ahd_scbautoptr_print
    ahd_scbcnt_print
    ahd_scbhaddr_print
    ahd_scbhcnt_print
    ahd_scbptr_print
    ahd_scsbist0_print
    ahd_scsbist1_print
    ahd_scschkn_print
    ahd_scsidat0_img_print
    ahd_scsidat_print
    ahd_scsiseq_template_print
    ahd_scsisigo_print
    ahd_scsitest_print
    ahd_sdscb_qoff_print
    ahd_seeadr_print
    ahd_seectl_print
    ahd_seedat_print
    ahd_seestat_print
    ahd_seqctl1_print
    ahd_seqintcode_print
    ahd_seqram_print
    ahd_sescb_qoff_print
    ahd_sfunct_print
    ahd_sg_cache_pre_print
    ahd_sghaddr_print
    ahd_sghcnt_print
    ahd_sgpcistat_print
    ahd_sgrxmsg0_print
    ahd_sgrxmsg1_print
    ahd_sgrxmsg2_print
    ahd_sgrxmsg3_print
    ahd_sgseqbcnt_print
    ahd_sgspltstat0_print
    ahd_sgspltstat1_print
    ahd_shaddr_print
    ahd_shared_data_addr_print
    ahd_shcnt_print
    ahd_shortthresh_print
    ahd_simode2_print
    ahd_simode3_print
    ahd_sindex_print
    ahd_sindir_print
    ahd_skewcalc_print
    ahd_slvspltoutadr0_print
    ahd_slvspltoutadr1_print
    ahd_slvspltoutadr2_print
    ahd_slvspltoutadr3_print
    ahd_slvspltoutattr0_print
    ahd_slvspltoutattr1_print
    ahd_slvspltoutattr2_print
    ahd_snscb_qoff_print
    ahd_sram_base_print
    ahd_stack_print
    ahd_statlenptr_print
    ahd_swtimer_print
    ahd_sxfrctl0_print
    ahd_sxfrctl1_print
    ahd_sxfrctl2_print
    ahd_tagptr_print
    ahd_targidin_print
    ahd_targpcistat_print
    ahd_townid_print
    ahd_tqinpos_print
    ahd_typeptr_print
    ahd_unfairness_print
    ahd_waiting_scb_tails_print
    ahd_waiting_tid_head_print
    ahd_waiting_tid_tail_print
    ahd_wrtbiascalc_print
    ahd_wrtbiasctl_print
    ahd_xsig_print
  drivers/scsi/aic7xxx/aic7xxx_core.o
    ahc_abort_scbs
    ahc_busy_tcl
    ahc_calc_residual
    ahc_chip_names
    ahc_clear_critical_section
    ahc_clear_intstat
    ahc_freeze_devq
    ahc_index_busy_tcl
    ahc_lookup_phase_entry
    ahc_print_scb
    ahc_restart
    ahc_run_untagged_queue
    ahc_run_untagged_queues
    ahc_shutdown
    ahc_unbusy_tcl
    ahc_validate_offset
    ahc_validate_width
  drivers/scsi/aic7xxx/aic7xxx_proc.o
    ahc_format_transinfo
  drivers/scsi/aic7xxx/aic7xxx_reg_print.o
    ahc_accum_print
    ahc_allones_print
    ahc_allzeros_print
    ahc_arg_1_print
    ahc_arg_2_print
    ahc_bctl_print
    ahc_brdctl_print
    ahc_busspd_print
    ahc_bustime_print
    ahc_busy_targets_print
    ahc_cchaddr_print
    ahc_cchcnt_print
    ahc_ccscbaddr_print
    ahc_ccscbcnt_print
    ahc_ccscbctl_print
    ahc_ccscbptr_print
    ahc_ccscbram_print
    ahc_ccsgaddr_print
    ahc_ccsgctl_print
    ahc_ccsgram_print
    ahc_clrint_print
    ahc_clrsint0_print
    ahc_clrsint1_print
    ahc_cmdsize_table_tail_print
    ahc_complete_scbh_print
    ahc_crccontrol1_print
    ahc_dfdat_print
    ahc_dff_thrsh_print
    ahc_dfraddr_print
    ahc_dfwaddr_print
    ahc_dindex_print
    ahc_dindir_print
    ahc_disc_dsb_print
    ahc_disconnected_scbh_print
    ahc_dmaparams_print
    ahc_dscommand0_print
    ahc_dscommand1_print
    ahc_dspcistatus_print
    ahc_flags_print
    ahc_free_scbh_print
    ahc_function1_print
    ahc_ha_274_biosctrl_print
    ahc_ha_274_biosglobal_print
    ahc_haddr_print
    ahc_hcnt_print
    ahc_hcntrl_print
    ahc_hnscb_qoff_print
    ahc_hostconf_print
    ahc_hs_mailbox_print
    ahc_hscb_addr_print
    ahc_intdef_print
    ahc_intstat_print
    ahc_kernel_qinpos_print
    ahc_kernel_tqinpos_print
    ahc_last_msg_print
    ahc_msg_out_print
    ahc_mwi_residual_print
    ahc_next_queued_scb_print
    ahc_none_print
    ahc_optionmode_print
    ahc_qincnt_print
    ahc_qinfifo_print
    ahc_qinpos_print
    ahc_qoff_ctlsta_print
    ahc_qoutcnt_print
    ahc_qoutfifo_print
    ahc_qoutpos_print
    ahc_saved_lun_print
    ahc_saved_scsiid_print
    ahc_scamctl_print
    ahc_scb_64_btt_print
    ahc_scb_64_spare_print
    ahc_scb_base_print
    ahc_scb_cdb_len_print
    ahc_scb_cdb_ptr_print
    ahc_scb_datacnt_print
    ahc_scb_dataptr_print
    ahc_scb_next_print
    ahc_scb_residual_sgptr_print
    ahc_scb_scsi_status_print
    ahc_scb_scsioffset_print
    ahc_scb_scsirate_print
    ahc_scb_sgptr_print
    ahc_scb_target_data_dir_print
    ahc_scb_target_itag_print
    ahc_scb_target_phases_print
    ahc_scbbaddr_print
    ahc_scbcnt_print
    ahc_scbptr_print
    ahc_scsibush_print
    ahc_scsiconf_print
    ahc_scsidath_print
    ahc_scsidatl_print
    ahc_scsiid_print
    ahc_scsiid_ultra2_print
    ahc_scsiseq_template_print
    ahc_scsisigo_print
    ahc_sdscb_qoff_print
    ahc_seectl_2840_print
    ahc_seectl_print
    ahc_selid_print
    ahc_seltimer_print
    ahc_seq_flags2_print
    ahc_seqaddr0_print
    ahc_seqaddr1_print
    ahc_seqram_print
    ahc_sfunct_print
    ahc_sg_cache_pre_print
    ahc_sg_cache_shadow_print
    ahc_shaddr_print
    ahc_shared_data_addr_print
    ahc_sindex_print
    ahc_sindir_print
    ahc_snscb_qoff_print
    ahc_spiocap_print
    ahc_sram_base_print
    ahc_stack_print
    ahc_status_2840_print
    ahc_stcnt_print
    ahc_sxfrctl1_print
    ahc_sxfrctl2_print
    ahc_targ_offset_print
    ahc_targcrccnt_print
    ahc_targid_print
    ahc_tqinpos_print
    ahc_ultra_enb_print
    ahc_waiting_scbh_print
  drivers/scsi/aic94xx/aic94xx_dump.o
    asd_dump_ddb_0
    asd_dump_scb_list
    asd_dump_scb_sites
    asd_dump_target_ddb

drivers/scsi/aic94xx/aic94xx_scb.o
asd_build_initiate_link_adm_task
drivers/scsi/aic94xx/aic94xx_seq.o
asd_pause_cseq
asd_pause_lseq
asd_unpause_cseq
asd_unpause_lseq

#5 lore raw
Quoted 11 lines · On Tue, 28 Aug 2007 12:56:34 +010 Denys Vlasenko <[email protected]>…
Quoted 2 lines

make namespacecheck

Thanks, nice tool.

aic7xxx is kind of not very nice in this regard.

See below what I get even on non-patched driver.

I am willing to clean it up, but I still would like "debloating" patch to be accepted.

Fwiw I do like your debloat patch a lot; it's just only half the equation ... if you also do the namespace fixes, I bet the driver debloats even more...

#6 lore raw
Quoted 9 lines · Arjan van de Ven

On Tue, 28 Aug 2007 12:56:34 +010

Quoted 6 lines · Denys Vlasenko
Quoted 1 line

make namespacecheck

Thanks, nice tool.

aic7xxx is kind of not very nice in this regard.

Quoted 8 lines
Quoted 4 lines

See below what I get even on non-patched driver.

I am willing to clean it up, but I still would like "debloating" patch to be accepted.

Fwiw I do like your debloat patch a lot; it's just only half the equation ... if you also do the namespace fixes, I bet the driver debloats even more...

Yes, I know, and I am happy to do that too. I just don't know whether patches will be accepted.

Why this patch is not commented on by scsi people? Am I sending patches to wrong people/lists? --
vda

#7 lore raw
Quoted 9 lines · Denys Vlasenko
Quoted 3 lines

Fwiw I do like your debloat patch a lot; it's just only half the equation ... if you also do the namespace fixes, I bet the driver debloats even more...

Yes, I know, and I am happy to do that too. I just don't know whether patches will be accepted.

Why this patch is not commented on by scsi people? Am I sending patches to wrong people/lists?

Well, you can send it to Linus/Andrew, that will usually upset people and they start commenting on it. Or they don't, and everything is fine. (The "default y" approach so to speak ;-)

Jan

#8 lore raw
Quoted 8 lines · Jan Engelhardt
Quoted 7 lines · Denys Vlasenko
Quoted 3 lines

Fwiw I do like your debloat patch a lot; it's just only half the equation ... if you also do the namespace fixes, I bet the driver debloats even more...

Yes, I know, and I am happy to do that too. I just don't know whether patches will be accepted.

Quoted 6 lines
Quoted 2 lines

Why this patch is not commented on by scsi people? Am I sending patches to wrong people/lists?

Well, you can send it to Linus/Andrew, that will usually upset people and they start commenting on it. Or they don't, and everything is fine. (The "default y" approach so to speak ;-)

The problem is that we don't really have a maintainer for the aic7xyz drivers any more. Volunteers welcome. NOT IT!

Signature · 4 lines
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
#9 lore raw
Quoted 7 lines · Matthew Wilcox
Quoted 4 lines

Well, you can send it to Linus/Andrew, that will usually upset people and they start commenting on it. Or they don't, and everything is fine. (The "default y" approach so to speak ;-)

The problem is that we don't really have a maintainer for the aic7xyz drivers any more. Volunteers welcome. NOT IT!

Take it before someone else does!

Jan

#10 lore raw
Quoted 9 lines · Jan Engelhardt
Quoted 5 lines · Matthew Wilcox
Quoted 3 lines

Well, you can send it to Linus/Andrew, that will usually upset people and they start commenting on it. Or they don't, and everything is fine. (The "default y" approach so to speak ;-)

The problem is that we don't really have a maintainer for the aic7xyz drivers any more. Volunteers welcome. NOT IT!

Take it before someone else does!

Well, the semi-official maintainers are James B. and me.

So I might as well do it officially.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)