Author: mav
Date: Mon Dec  7 16:23:25 2009
New Revision: 200218
URL: http://svn.freebsd.org/changeset/base/200218

Log:
  MFp4;
  - Cleanup kernel messages, mostly PMP.
  - Took references on devices, while PMP reinitializes them, to not let them
  go and distort freeze reference counting.

Modified:
  head/sys/cam/ata/ata_all.c
  head/sys/cam/ata/ata_pmp.c
  head/sys/cam/ata/ata_xpt.c

Modified: head/sys/cam/ata/ata_all.c
==============================================================================
--- head/sys/cam/ata/ata_all.c  Mon Dec  7 16:10:48 2009        (r200217)
+++ head/sys/cam/ata/ata_all.c  Mon Dec  7 16:23:25 2009        (r200218)
@@ -256,8 +256,10 @@ ata_print_ident(struct ata_params *ident
                   sizeof(product));
        cam_strvis(revision, ident_data->revision, sizeof(ident_data->revision),
                   sizeof(revision));
-       printf("<%s %s> ATA/ATAPI-%d",
-           product, revision, ata_version(ident_data->version_major));
+       printf("<%s %s> %s-%d",
+           product, revision,
+           (ident_data->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA",
+           ata_version(ident_data->version_major));
        if (ident_data->satacapabilities && ident_data->satacapabilities != 
0xffff) {
                if (ident_data->satacapabilities & ATA_SATA_GEN3)
                        printf(" SATA 3.x");

Modified: head/sys/cam/ata/ata_pmp.c
==============================================================================
--- head/sys/cam/ata/ata_pmp.c  Mon Dec  7 16:10:48 2009        (r200217)
+++ head/sys/cam/ata/ata_pmp.c  Mon Dec  7 16:23:25 2009        (r200218)
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
 #include <cam/cam_ccb.h>
 #include <cam/cam_periph.h>
 #include <cam/cam_xpt_periph.h>
+#include <cam/cam_xpt_internal.h>
 #include <cam/cam_sim.h>
 
 #include <cam/ata/ata_all.h>
@@ -176,8 +177,8 @@ pmpfreeze(struct cam_periph *periph, int
                if (xpt_create_path(&dpath, periph,
                    xpt_path_path_id(periph->path),
                    i, 0) == CAM_REQ_CMP) {
-printf("PMP freeze: %d\n", i);
                        softc->frozen |= (1 << i);
+                       xpt_acquire_device(dpath->device);
                        cam_freeze_devq(dpath);
                        xpt_free_path(dpath);
                }
@@ -198,9 +199,9 @@ pmprelease(struct cam_periph *periph, in
                if (xpt_create_path(&dpath, periph,
                    xpt_path_path_id(periph->path),
                    i, 0) == CAM_REQ_CMP) {
-printf("PMP release: %d\n", i);
                        softc->frozen &= ~(1 << i);
                        cam_release_devq(dpath, 0, 0, 0, FALSE);
+                       xpt_release_device(dpath->device);
                        xpt_free_path(dpath);
                }
        }
@@ -228,6 +229,7 @@ pmponinvalidate(struct cam_periph *perip
                        xpt_free_path(dpath);
                }
        }
+       pmprelease(periph, -1);
        xpt_print(periph->path, "lost device\n");
 }
 
@@ -459,8 +461,6 @@ pmpstart(struct cam_periph *periph, unio
                      pmp_default_timeout * 1000);
                ata_pm_write_cmd(ataio, 2, softc->pm_step,
                    (softc->found & (1 << softc->pm_step)) ? 0 : 1);
-printf("PM RESET %d%s\n", softc->pm_step,
-    (softc->found & (1 << softc->pm_step)) ? " skipping" : "");
                break;
        case PMP_STATE_CONNECT:
                cam_fill_ataio(ataio,
@@ -584,7 +584,9 @@ pmpdone(struct cam_periph *periph, union
                if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 
||
                    softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095)
                        softc->pm_ports--;
-               printf("PM ports: %d\n", softc->pm_ports);
+               printf("%s%d: %d fan-out ports\n",
+                   periph->periph_name, periph->unit_number,
+                   softc->pm_ports);
                softc->state = PMP_STATE_PRECONFIG;
                xpt_release_ccb(done_ccb);
                xpt_schedule(periph, priority);
@@ -606,7 +608,6 @@ pmpdone(struct cam_periph *periph, union
                            /*reduction*/0,
                            /*timeout*/5,
                            /*getcount_only*/0);
-                       printf("PM reset done\n");
                        softc->state = PMP_STATE_CONNECT;
                }
                xpt_release_ccb(done_ccb);
@@ -623,7 +624,6 @@ pmpdone(struct cam_periph *periph, union
                            /*reduction*/0,
                            /*timeout*/10,
                            /*getcount_only*/0);
-                       printf("PM connect done\n");
                        softc->state = PMP_STATE_CHECK;
                }
                xpt_release_ccb(done_ccb);
@@ -635,7 +635,11 @@ pmpdone(struct cam_periph *periph, union
                    (done_ccb->ataio.res.lba_low << 8) +
                    done_ccb->ataio.res.sector_count;
                if ((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) {
-                       printf("PM status: %d - %08x\n", softc->pm_step, res);
+                       if (bootverbose) {
+                               printf("%s%d: port %d status: %08x\n",
+                                   periph->periph_name, periph->unit_number,
+                                   softc->pm_step, res);
+                       }
                        /* Report device speed. */
                        if (xpt_create_path(&dpath, periph,
                            xpt_path_path_id(periph->path),
@@ -661,7 +665,11 @@ pmpdone(struct cam_periph *periph, union
                                    /*getcount_only*/0);
                                softc->pm_try++;
                        } else {
-                               printf("PM status: %d - %08x\n", 
softc->pm_step, res);
+                               if (bootverbose) {
+                                       printf("%s%d: port %d status: %08x\n",
+                                           periph->periph_name, 
periph->unit_number,
+                                           softc->pm_step, res);
+                               }
                                softc->found &= ~(1 << softc->pm_step);
                                if (xpt_create_path(&dpath, periph,
                                    done_ccb->ccb_h.path_id,

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c  Mon Dec  7 16:10:48 2009        (r200217)
+++ head/sys/cam/ata/ata_xpt.c  Mon Dec  7 16:23:25 2009        (r200218)
@@ -729,7 +729,8 @@ noerror:
        {
                int sign = (done_ccb->ataio.res.lba_high << 8) +
                    done_ccb->ataio.res.lba_mid;
-               xpt_print(path, "SIGNATURE: %04x\n", sign);
+               if (bootverbose)
+                       xpt_print(path, "SIGNATURE: %04x\n", sign);
                if (sign == 0x0000 &&
                    done_ccb->ccb_h.target_id != 15) {
                        path->device->protocol = PROTO_ATA;
@@ -921,7 +922,6 @@ noerror:
                    (done_ccb->ataio.res.lba_low << 8) +
                    done_ccb->ataio.res.sector_count;
                ((uint32_t *)ident_buf)[0] = softc->pm_pid;
-               printf("PM Product ID: %08x\n", softc->pm_pid);
                snprintf(ident_buf->model, sizeof(ident_buf->model),
                    "Port Multiplier %08x", softc->pm_pid);
                PROBE_SET_ACTION(softc, PROBE_PM_PRV);
@@ -934,7 +934,6 @@ noerror:
                    (done_ccb->ataio.res.lba_low << 8) +
                    done_ccb->ataio.res.sector_count;
                ((uint32_t *)ident_buf)[1] = softc->pm_prv;
-               printf("PM Revision: %08x\n", softc->pm_prv);
                snprintf(ident_buf->revision, sizeof(ident_buf->revision),
                    "%04x", softc->pm_prv);
                path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to