~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to drivers/s390/cio/qdio_main.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
                "       ipm     %0\n"
64
64
                "       srl     %0,28\n"
65
65
                : "=d" (cc)
66
 
                : "d" (__fc), "d" (__schid), "d" (__mask) : "cc", "memory");
 
66
                : "d" (__fc), "d" (__schid), "d" (__mask) : "cc");
67
67
        return cc;
68
68
}
69
69
 
74
74
 * @bb: busy bit indicator, set only if SIGA-w/wt could not access a buffer
75
75
 * @fc: function code to perform
76
76
 *
77
 
 * Returns cc or QDIO_ERROR_SIGA_ACCESS_EXCEPTION.
 
77
 * Returns condition code.
78
78
 * Note: For IQDC unicast queues only the highest priority queue is processed.
79
79
 */
80
80
static inline int do_siga_output(unsigned long schid, unsigned long mask,
85
85
        register unsigned long __schid asm("1") = schid;
86
86
        register unsigned long __mask asm("2") = mask;
87
87
        register unsigned long __aob asm("3") = aob;
88
 
        int cc = QDIO_ERROR_SIGA_ACCESS_EXCEPTION;
 
88
        int cc;
89
89
 
90
90
        asm volatile(
91
91
                "       siga    0\n"
92
 
                "0:     ipm     %0\n"
 
92
                "       ipm     %0\n"
93
93
                "       srl     %0,28\n"
94
 
                "1:\n"
95
 
                EX_TABLE(0b, 1b)
96
 
                : "+d" (cc), "+d" (__fc), "+d" (__schid), "+d" (__mask),
97
 
                  "+d" (__aob)
98
 
                : : "cc", "memory");
99
 
        *bb = ((unsigned int) __fc) >> 31;
 
94
                : "=d" (cc), "+d" (__fc), "+d" (__aob)
 
95
                : "d" (__schid), "d" (__mask)
 
96
                : "cc");
 
97
        *bb = __fc >> 31;
100
98
        return cc;
101
99
}
102
100
 
167
165
 
168
166
        DBF_ERROR("%4x EQBS ERROR", SCH_NO(q));
169
167
        DBF_ERROR("%3d%3d%2d", count, tmp_count, nr);
170
 
        q->handler(q->irq_ptr->cdev, QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
 
168
        q->handler(q->irq_ptr->cdev, QDIO_ERROR_GET_BUF_STATE,
171
169
                   q->nr, q->first_to_kick, count, q->irq_ptr->int_parm);
172
170
        return 0;
173
171
}
215
213
 
216
214
        DBF_ERROR("%4x SQBS ERROR", SCH_NO(q));
217
215
        DBF_ERROR("%3d%3d%2d", count, tmp_count, nr);
218
 
        q->handler(q->irq_ptr->cdev, QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
 
216
        q->handler(q->irq_ptr->cdev, QDIO_ERROR_SET_BUF_STATE,
219
217
                   q->nr, q->first_to_kick, count, q->irq_ptr->int_parm);
220
218
        return 0;
221
219
}
313
311
        cc = do_siga_sync(schid, output, input, fc);
314
312
        if (unlikely(cc))
315
313
                DBF_ERROR("%4x SIGA-S:%2d", SCH_NO(q), cc);
316
 
        return cc;
 
314
        return (cc) ? -EIO : 0;
317
315
}
318
316
 
319
317
static inline int qdio_siga_sync_q(struct qdio_q *q)
384
382
        cc = do_siga_input(schid, q->mask, fc);
385
383
        if (unlikely(cc))
386
384
                DBF_ERROR("%4x SIGA-R:%2d", SCH_NO(q), cc);
387
 
        return cc;
 
385
        return (cc) ? -EIO : 0;
388
386
}
389
387
 
390
388
#define qdio_siga_sync_out(q) qdio_siga_sync(q, ~0U, 0)
443
441
        unsigned char state = (q->is_input_q) ? SLSB_P_INPUT_NOT_INIT :
444
442
                                        SLSB_P_OUTPUT_NOT_INIT;
445
443
 
446
 
        q->qdio_error |= QDIO_ERROR_SLSB_STATE;
 
444
        q->qdio_error = QDIO_ERROR_SLSB_STATE;
447
445
 
448
446
        /* special handling for no target buffer empty */
449
447
        if ((!q->is_input_q &&
519
517
        int count, stop;
520
518
        unsigned char state = 0;
521
519
 
522
 
        q->timestamp = get_clock_fast();
 
520
        q->timestamp = get_clock();
523
521
 
524
522
        /*
525
523
         * Don't check 128 buffers, as otherwise qdio_inbound_q_moved
575
573
 
576
574
        bufnr = get_inbound_buffer_frontier(q);
577
575
 
578
 
        if ((bufnr != q->last_move) || q->qdio_error) {
 
576
        if (bufnr != q->last_move) {
579
577
                q->last_move = bufnr;
580
578
                if (!is_thinint_irq(q->irq_ptr) && MACHINE_IS_LPAR)
581
579
                        q->u.in.timestamp = get_clock();
790
788
        int count, stop;
791
789
        unsigned char state = 0;
792
790
 
793
 
        q->timestamp = get_clock_fast();
 
791
        q->timestamp = get_clock();
794
792
 
795
793
        if (need_siga_sync(q))
796
794
                if (((queue_type(q) != QDIO_IQDIO_QFMT) &&
863
861
 
864
862
        bufnr = get_outbound_buffer_frontier(q);
865
863
 
866
 
        if ((bufnr != q->last_move) || q->qdio_error) {
 
864
        if (bufnr != q->last_move) {
867
865
                q->last_move = bufnr;
868
866
                DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out moved:%1d", q->nr);
869
867
                return 1;
894
892
                                goto retry;
895
893
                        }
896
894
                        DBF_ERROR("%4x cc2 BBC:%1d", SCH_NO(q), q->nr);
897
 
                        cc |= QDIO_ERROR_SIGA_BUSY;
898
 
                } else
 
895
                        cc = -EBUSY;
 
896
                } else {
899
897
                        DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w cc2:%1d", q->nr);
 
898
                        cc = -ENOBUFS;
 
899
                }
900
900
                break;
901
901
        case 1:
902
902
        case 3:
903
903
                DBF_ERROR("%4x SIGA-W:%1d", SCH_NO(q), cc);
 
904
                cc = -EIO;
904
905
                break;
905
906
        }
906
907
        if (retries) {
1090
1091
        }
1091
1092
 
1092
1093
        count = sub_buf(q->first_to_check, q->first_to_kick);
1093
 
        q->handler(q->irq_ptr->cdev, QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
 
1094
        q->handler(q->irq_ptr->cdev, QDIO_ERROR_ACTIVATE,
1094
1095
                   q->nr, q->first_to_kick, count, irq_ptr->int_parm);
1095
1096
no_handler:
1096
1097
        qdio_set_state(irq_ptr, QDIO_IRQ_STATE_STOPPED);
1691
1692
                      "do%02x b:%02x c:%02x", callflags, bufnr, count);
1692
1693
 
1693
1694
        if (irq_ptr->state != QDIO_IRQ_STATE_ACTIVE)
1694
 
                return -EBUSY;
 
1695
                return -EIO;
1695
1696
        if (!count)
1696
1697
                return 0;
1697
1698
        if (callflags & QDIO_FLAG_SYNC_INPUT)