Changeset 705b65ea in mainline


Ignore:
Timestamp:
2024-07-11T11:29:43Z (5 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
994f87b
Parents:
f77ede10
Message:

Do not automatically mount floppy. Reduce driver verbosity.

Location:
uspace/drv/block/pc-floppy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/pc-floppy/main.c

    rf77ede10 r705b65ea  
    105105
    106106        /* IRQ */
    107         ddf_msg(LVL_NOTE, "irqs count=%zu", hw_res.irqs.count);
    108107        if (hw_res.irqs.count > 0) {
    109                 ddf_msg(LVL_NOTE, "set IRQ=%u", hw_res.irqs.irqs[0]);
    110108                res->irq = hw_res.irqs.irqs[0];
    111109        } else {
    112                 ddf_msg(LVL_NOTE, "set IRQ=-1");
    113110                res->irq = -1;
    114111        }
  • uspace/drv/block/pc-floppy/pc-floppy.c

    rf77ede10 r705b65ea  
    165165        rc = pc_fdc_init_irq(fdc);
    166166        if (rc != EOK) {
    167                 ddf_msg(LVL_NOTE, "Init IRQ failed");
     167                ddf_msg(LVL_ERROR, "Init IRQ failed");
    168168                return rc;
    169169        }
     
    179179            AS_AREA_WRITE | AS_AREA_READ, 0, &fdc->dma_buf_pa, &buffer);
    180180        if (rc != EOK) {
    181                 ddf_msg(LVL_NOTE, "Failed allocating PRD table.");
     181                ddf_msg(LVL_ERROR, "Failed allocating PRD table.");
    182182                goto error;
    183183        }
     
    185185        fdc->dma_buf = buffer;
    186186
    187         ddf_msg(LVL_NOTE, "pc_fdc_ctrl_init: reset controller...");
     187        ddf_msg(LVL_DEBUG, "pc_fdc_ctrl_init: reset controller...");
    188188        (void)pc_fdc_reset(fdc);
    189         ddf_msg(LVL_NOTE, "pc_fdc_ctrl_init: read_ID..");
    190 
    191         ddf_msg(LVL_NOTE, "pc_fdc_ctrl_init: MSR=0x%x",
     189        ddf_msg(LVL_DEBUG, "pc_fdc_ctrl_init: read_ID..");
     190
     191        ddf_msg(LVL_DEBUG, "pc_fdc_ctrl_init: MSR=0x%x",
    192192            pio_read_8(&fdc->regs->msr));
    193         ddf_msg(LVL_NOTE, "pc_fdc_ctrl_init: DIR=0x%x",
     193        ddf_msg(LVL_DEBUG, "pc_fdc_ctrl_init: DIR=0x%x",
    194194            pio_read_8(&fdc->regs->dir));
    195         ddf_msg(LVL_NOTE, "pc_fdc_ctrl_init: SRA=0x%x",
     195        ddf_msg(LVL_DEBUG, "pc_fdc_ctrl_init: SRA=0x%x",
    196196            pio_read_8(&fdc->regs->sra));
    197         ddf_msg(LVL_NOTE, "pc_fdc_ctrl_init: SRB=0x%x",
     197        ddf_msg(LVL_DEBUG, "pc_fdc_ctrl_init: SRB=0x%x",
    198198            pio_read_8(&fdc->regs->srb));
    199199
     
    213213        /* Read ID MFM, D0, H0 */
    214214        rc = pc_fdc_read_id(fdc, true, 0, 0);
    215         ddf_msg(LVL_NOTE, "pc_fdc_ctrl_init: read_ID -> %d", rc);
     215        ddf_msg(LVL_DEBUG, "pc_fdc_ctrl_init: read_ID -> %d", rc);
    216216
    217217        rc = pc_fdc_drive_create(fdc, 0, &fdc->drive[0]);
    218218        if (rc != EOK) {
    219                 ddf_msg(LVL_NOTE, "pc_fdc_ctrl_init: pc_fdc_drive_create "
     219                ddf_msg(LVL_ERROR, "pc_fdc_ctrl_init: pc_fdc_drive_create "
    220220                    "failed");
    221221                goto error;
     
    454454        bound = true;
    455455
     456#if 0
    456457        rc = ddf_fun_add_to_category(fun, "partition");
    457458        if (rc != EOK) {
     
    460461                goto error;
    461462        }
     463#endif
    462464
    463465        free(fun_name);
     
    497499
    498500        status = pio_read_8(&fdc->regs->msr);
    499         ddf_msg(LVL_NOTE, "pc_fdc_send_byte: status=0x%x", status);
     501        ddf_msg(LVL_DEBUG, "pc_fdc_send_byte: status=0x%x", status);
    500502        do {
    501503                cnt = msr_read_cycles;
     
    513515                stopwatch_stop(&sw);
    514516                nsec = stopwatch_get_nanos(&sw);
    515                 ddf_msg(LVL_NOTE, "nsec=%lld", nsec);
     517                ddf_msg(LVL_DEBUG, "nsec=%lld", nsec);
    516518        } while (nsec < 1000 * msr_max_wait_usec);
    517519
    518         ddf_msg(LVL_NOTE, "pc_fdc_send_byte: FAILED (status=0x%x)", status);
     520        ddf_msg(LVL_ERROR, "pc_fdc_send_byte: FAILED (status=0x%x)", status);
    519521        return EIO;
    520522}
     
    541543
    542544        status = pio_read_8(&fdc->regs->msr);
    543         ddf_msg(LVL_NOTE, "pc_fdc_send: final status=0x%x", status);
     545        ddf_msg(LVL_DEBUG, "pc_fdc_send: final status=0x%x", status);
    544546        return EOK;
    545547}
     
    567569
    568570        status = pio_read_8(&fdc->regs->msr);
    569         ddf_msg(LVL_NOTE, "pc_fdc_get_byte: status=0x%x", status);
     571        ddf_msg(LVL_DEBUG, "pc_fdc_get_byte: status=0x%x", status);
    570572        do {
    571573                cnt = msr_read_cycles;
     
    585587        } while (nsec / 1000 < 1000 * msr_max_wait_usec);
    586588
    587         ddf_msg(LVL_NOTE, "pc_fdc_get_byte: FAILED (status=0x%x)", status);
     589        ddf_msg(LVL_ERROR, "pc_fdc_get_byte: FAILED (status=0x%x)", status);
    588590        return EIO;
    589591}
     
    606608                rc = pc_fdc_get_byte(fdc, &((uint8_t *)buf)[i]);
    607609                if (rc != EOK) {
    608                         ddf_msg(LVL_NOTE, "pc_fdc_get: abort after "
     610                        ddf_msg(LVL_ERROR, "pc_fdc_get: abort after "
    609611                            "reading %zu bytes", i);
    610612                        return rc;
     
    612614        }
    613615
    614         ddf_msg(LVL_NOTE, "pc_fdc_get: successfully read %zu bytes", i);
     616        ddf_msg(LVL_DEBUG, "pc_fdc_get: successfully read %zu bytes", i);
    615617        status = pio_read_8(&fdc->regs->msr);
    616         ddf_msg(LVL_NOTE, "pc_fdc_get: final status=0x%x", status);
     618        ddf_msg(LVL_DEBUG, "pc_fdc_get: final status=0x%x", status);
    617619        return EOK;
    618620}
     
    632634        /* Clear DOR reset in case it was set (i.e., nreset := 1) */
    633635        dor = pio_read_8(&fdc->regs->dor);
    634         ddf_msg(LVL_NOTE, "pc_fdc_reset: old DOR=0x%x, DOR := 0x%x", dor,
     636        ddf_msg(LVL_DEBUG, "pc_fdc_reset: old DOR=0x%x, DOR := 0x%x", dor,
    635637            dor & ~fdor_nreset);
    636638        pio_write_8(&fdc->regs->dor, dor & ~fdor_nreset);
    637639
    638640        dor = pio_read_8(&fdc->regs->dor);
    639         ddf_msg(LVL_NOTE, "pc_fdc_reset: read DOR: value= 0x%x", dor);
     641        ddf_msg(LVL_DEBUG, "pc_fdc_reset: read DOR: value= 0x%x", dor);
    640642
    641643        fibril_usleep(4);
    642644
    643         ddf_msg(LVL_NOTE, "pc_fdc_reset: old DOR=0x%x, DOR := 0x%x", dor,
     645        ddf_msg(LVL_DEBUG, "pc_fdc_reset: old DOR=0x%x, DOR := 0x%x", dor,
    644646            dor | fdor_nreset | fdor_ndmagate);
    645647        pio_write_8(&fdc->regs->dor, dor | fdor_nreset | fdor_ndmagate);
    646648
    647649        dor = pio_read_8(&fdc->regs->dor);
    648         ddf_msg(LVL_NOTE, "pc_fdc_reset: read DOR: value= 0x%x", dor);
     650        ddf_msg(LVL_DEBUG, "pc_fdc_reset: read DOR: value= 0x%x", dor);
    649651
    650652        return EOK;
     
    669671
    670672        dor = pio_read_8(&fdc->regs->dor);
    671         ddf_msg(LVL_NOTE, "pc_fdc_read_id: read DOR: value= 0x%x", dor);
     673        ddf_msg(LVL_DEBUG, "pc_fdc_read_id: read DOR: value= 0x%x", dor);
    672674
    673675        dor |= fdor_me0; /* turn drive 0 motor on */
    674676        dor = (dor & ~0x03) | 0x00; /* select drive 0 */
    675677        pio_write_8(&fdc->regs->dor, dor);
    676         ddf_msg(LVL_NOTE, "pc_fdc_read_id: DOR := 0x%x", dor);
     678        ddf_msg(LVL_DEBUG, "pc_fdc_read_id: DOR := 0x%x", dor);
    677679
    678680        dor = pio_read_8(&fdc->regs->dor);
    679         ddf_msg(LVL_NOTE, "pc_fdc_read_id: read DOR: value= 0x%x", dor);
     681        ddf_msg(LVL_DEBUG, "pc_fdc_read_id: read DOR: value= 0x%x", dor);
    680682
    681683        /* 500 ms to let drive spin up */
     
    685687        cmd.hd_us = 0x00;
    686688
    687         ddf_msg(LVL_NOTE, "read ID: send");
     689        ddf_msg(LVL_DEBUG, "read ID: send");
    688690        rc = pc_fdc_send(fdc, &cmd, sizeof(cmd));
    689691        if (rc != EOK) {
     
    692694        }
    693695
    694         ddf_msg(LVL_NOTE, "read ID: get");
     696        ddf_msg(LVL_DEBUG, "read ID: get");
    695697        rc = pc_fdc_get(fdc, &status, sizeof(status));
    696698        if (rc != EOK) {
     
    699701        }
    700702
    701         ddf_msg(LVL_NOTE, "read ID: DONE");
    702         ddf_msg(LVL_NOTE, "st0=0x%x st1=0x%x st2=0x%x cyl=%u head=%u rec=%u "
     703        ddf_msg(LVL_DEBUG, "read ID: DONE");
     704        ddf_msg(LVL_DEBUG, "st0=0x%x st1=0x%x st2=0x%x cyl=%u head=%u rec=%u "
    703705            "number=%u", status.st0, status.st1, status.st2,
    704706            status.cyl, status.head, status.rec, status.number);
     
    732734        errno_t rc;
    733735
    734         ddf_msg(LVL_NOTE, "pc_fdc_drive_read_data");
     736        ddf_msg(LVL_DEBUG, "pc_fdc_drive_read_data");
    735737
    736738        memset(fdc->dma_buf, 0, fdc->dma_buf_size);
    737739
    738740        sess = ddf_dev_parent_sess_get(fdc->dev);
    739         ddf_msg(LVL_NOTE, "hw_res_dma_channel_setup(sess=%p, chan=%d "
     741        ddf_msg(LVL_DEBUG, "hw_res_dma_channel_setup(sess=%p, chan=%d "
    740742            "pa=%lu size=%zu", sess, fdc->dma, fdc->dma_buf_pa,
    741743            fdc->dma_buf_size);
     
    743745            fdc->dma_buf_size, DMA_MODE_READ | DMA_MODE_AUTO |
    744746            DMA_MODE_ON_DEMAND);
    745         ddf_msg(LVL_NOTE, "hw_res_dma_channel_setup->%d", rc);
     747        ddf_msg(LVL_DEBUG, "hw_res_dma_channel_setup->%d", rc);
    746748
    747749        cmd.flags_cc = fcf_mf | fcc_read_data;
     
    755757        cmd.dtl = 0xff;
    756758
    757         ddf_msg(LVL_NOTE, "read data: send");
     759        ddf_msg(LVL_DEBUG, "read data: send");
    758760        rc = pc_fdc_send(fdc, &cmd, sizeof(cmd));
    759761        if (rc != EOK) {
     
    762764        }
    763765
    764         ddf_msg(LVL_NOTE, "read data: get");
     766        ddf_msg(LVL_DEBUG, "read data: get");
    765767        rc = pc_fdc_get(fdc, &status, sizeof(status));
    766768        if (rc != EOK) {
     
    769771        }
    770772
    771         ddf_msg(LVL_NOTE, "read data: DONE");
    772         ddf_msg(LVL_NOTE, "st0=0x%x st1=0x%x st2=0x%x cyl=%u head=%u rec=%u "
     773        ddf_msg(LVL_DEBUG, "read data: DONE");
     774        ddf_msg(LVL_DEBUG, "st0=0x%x st1=0x%x st2=0x%x cyl=%u head=%u rec=%u "
    773775            "number=%u", status.st0, status.st1, status.st2,
    774776            status.cyl, status.head, status.rec, status.number);
     
    806808        errno_t rc;
    807809
    808         ddf_msg(LVL_NOTE, "pc_fdc_drive_write_data");
     810        ddf_msg(LVL_DEBUG, "pc_fdc_drive_write_data");
    809811
    810812        /* Copy data from source buffer to DMA buffer */
     
    813815
    814816        sess = ddf_dev_parent_sess_get(fdc->dev);
    815         ddf_msg(LVL_NOTE, "hw_res_dma_channel_setup(sess=%p, chan=%d "
     817        ddf_msg(LVL_DEBUG, "hw_res_dma_channel_setup(sess=%p, chan=%d "
    816818            "pa=%lu size=%zu", sess, fdc->dma, fdc->dma_buf_pa,
    817819            fdc->dma_buf_size);
     
    819821            fdc->dma_buf_size, DMA_MODE_WRITE | DMA_MODE_AUTO |
    820822            DMA_MODE_ON_DEMAND);
    821         ddf_msg(LVL_NOTE, "hw_res_dma_channel_setup->%d", rc);
     823        ddf_msg(LVL_DEBUG, "hw_res_dma_channel_setup->%d", rc);
    822824
    823825        cmd.flags_cc = fcf_mf | fcc_write_data;
     
    831833        cmd.dtl = 0xff;
    832834
    833         ddf_msg(LVL_NOTE, "write data: send");
     835        ddf_msg(LVL_DEBUG, "write data: send");
    834836        rc = pc_fdc_send(fdc, &cmd, sizeof(cmd));
    835837        if (rc != EOK) {
     
    838840        }
    839841
    840         ddf_msg(LVL_NOTE, "write data: get");
     842        ddf_msg(LVL_DEBUG, "write data: get");
    841843        rc = pc_fdc_get(fdc, &status, sizeof(status));
    842844        if (rc != EOK) {
     
    845847        }
    846848
    847         ddf_msg(LVL_NOTE, "write data: DONE");
    848         ddf_msg(LVL_NOTE, "st0=0x%x st1=0x%x st2=0x%x cyl=%u head=%u rec=%u "
     849        ddf_msg(LVL_DEBUG, "write data: DONE");
     850        ddf_msg(LVL_DEBUG, "st0=0x%x st1=0x%x st2=0x%x cyl=%u head=%u rec=%u "
    849851            "number=%u", status.st0, status.st1, status.st2,
    850852            status.cyl, status.head, status.rec, status.number);
     
    874876        cmd.cc = fcc_sense_int_sts;
    875877
    876         ddf_msg(LVL_NOTE, "Sense Interrupt Status: send");
     878        ddf_msg(LVL_DEBUG, "Sense Interrupt Status: send");
    877879        rc = pc_fdc_send(fdc, &cmd, sizeof(cmd));
    878880        if (rc != EOK) {
     
    882884        }
    883885
    884         ddf_msg(LVL_NOTE, "Sense Interrupt Status: get");
     886        ddf_msg(LVL_DEBUG, "Sense Interrupt Status: get");
    885887        rc = pc_fdc_get(fdc, &status, sizeof(status));
    886888        if (rc != EOK) {
     
    890892        }
    891893
    892         ddf_msg(LVL_NOTE, "Sense Interrupt Status: DONE");
    893         ddf_msg(LVL_NOTE, "st0=0x%x pcn=0x%x", status.st0, status.pcn);
     894        ddf_msg(LVL_DEBUG, "Sense Interrupt Status: DONE");
     895        ddf_msg(LVL_DEBUG, "st0=0x%x pcn=0x%x", status.st0, status.pcn);
    894896
    895897        return EOK;
     
    916918        h = ipc_get_arg5(call);
    917919        n = ipc_get_imethod(call);
    918         ddf_msg(LVL_NOTE, "pc_fdc_irq_handler st0=%x st1=%x st2=%x c=%u h=%u n=%u",
     920        ddf_msg(LVL_DEBUG, "pc_fdc_irq_handler st0=%x st1=%x st2=%x c=%u h=%u n=%u",
    919921            st0, st1, st2, c, h, n);
    920922
     
    990992        errno_t rc;
    991993
    992         ddf_msg(LVL_NOTE, "pc_fdc_bd_read_blocks");
     994        ddf_msg(LVL_DEBUG, "pc_fdc_bd_read_blocks");
    993995
    994996        if (size < cnt * drive->sec_size) {
     
    10131015        return EOK;
    10141016error:
    1015         ddf_msg(LVL_NOTE, "pc_fdc_bd_read_blocks: rc=%d", rc);
     1017        ddf_msg(LVL_ERROR, "pc_fdc_bd_read_blocks: rc=%d", rc);
    10161018        return rc;
    10171019}
     
    10481050        errno_t rc;
    10491051
    1050         ddf_msg(LVL_NOTE, "pc_fdc_bd_write_blocks");
     1052        ddf_msg(LVL_DEBUG, "pc_fdc_bd_write_blocks");
    10511053
    10521054        if (size < cnt * drive->sec_size) {
     
    10711073        return EOK;
    10721074error:
    1073         ddf_msg(LVL_NOTE, "pc_fdc_bd_write_blocks: rc=%d", rc);
     1075        ddf_msg(LVL_ERROR, "pc_fdc_bd_write_blocks: rc=%d", rc);
    10741076        return rc;
    10751077}
Note: See TracChangeset for help on using the changeset viewer.