diff options
Diffstat (limited to 'drivers/isdn/hysdn/hysdn_sched.c')
-rw-r--r-- | drivers/isdn/hysdn/hysdn_sched.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/isdn/hysdn/hysdn_sched.c b/drivers/isdn/hysdn/hysdn_sched.c index 1c0d54ac12ab..18758772b744 100644 --- a/drivers/isdn/hysdn/hysdn_sched.c +++ b/drivers/isdn/hysdn/hysdn_sched.c | |||
@@ -155,22 +155,17 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan) | |||
155 | if (card->debug_flags & LOG_SCHED_ASYN) | 155 | if (card->debug_flags & LOG_SCHED_ASYN) |
156 | hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1); | 156 | hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1); |
157 | 157 | ||
158 | save_flags(flags); | ||
159 | cli(); | ||
160 | while (card->async_busy) { | 158 | while (card->async_busy) { |
161 | sti(); | ||
162 | 159 | ||
163 | if (card->debug_flags & LOG_SCHED_ASYN) | 160 | if (card->debug_flags & LOG_SCHED_ASYN) |
164 | hysdn_addlog(card, "async tx-cfg delayed"); | 161 | hysdn_addlog(card, "async tx-cfg delayed"); |
165 | 162 | ||
166 | msleep_interruptible(20); /* Timeout 20ms */ | 163 | msleep_interruptible(20); /* Timeout 20ms */ |
167 | if (!--cnt) { | 164 | if (!--cnt) |
168 | restore_flags(flags); | ||
169 | return (-ERR_ASYNC_TIME); /* timed out */ | 165 | return (-ERR_ASYNC_TIME); /* timed out */ |
170 | } | ||
171 | cli(); | ||
172 | } /* wait for buffer to become free */ | 166 | } /* wait for buffer to become free */ |
173 | 167 | ||
168 | spin_lock_irqsave(&card->hysdn_lock, flags); | ||
174 | strcpy(card->async_data, line); | 169 | strcpy(card->async_data, line); |
175 | card->async_len = strlen(line) + 1; | 170 | card->async_len = strlen(line) + 1; |
176 | card->async_channel = chan; | 171 | card->async_channel = chan; |
@@ -178,30 +173,23 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan) | |||
178 | 173 | ||
179 | /* now queue the task */ | 174 | /* now queue the task */ |
180 | schedule_work(&card->irq_queue); | 175 | schedule_work(&card->irq_queue); |
181 | sti(); | 176 | spin_unlock_irqrestore(&card->hysdn_lock, flags); |
182 | 177 | ||
183 | if (card->debug_flags & LOG_SCHED_ASYN) | 178 | if (card->debug_flags & LOG_SCHED_ASYN) |
184 | hysdn_addlog(card, "async tx-cfg data queued"); | 179 | hysdn_addlog(card, "async tx-cfg data queued"); |
185 | 180 | ||
186 | cnt++; /* short delay */ | 181 | cnt++; /* short delay */ |
187 | cli(); | ||
188 | 182 | ||
189 | while (card->async_busy) { | 183 | while (card->async_busy) { |
190 | sti(); | ||
191 | 184 | ||
192 | if (card->debug_flags & LOG_SCHED_ASYN) | 185 | if (card->debug_flags & LOG_SCHED_ASYN) |
193 | hysdn_addlog(card, "async tx-cfg waiting for tx-ready"); | 186 | hysdn_addlog(card, "async tx-cfg waiting for tx-ready"); |
194 | 187 | ||
195 | msleep_interruptible(20); /* Timeout 20ms */ | 188 | msleep_interruptible(20); /* Timeout 20ms */ |
196 | if (!--cnt) { | 189 | if (!--cnt) |
197 | restore_flags(flags); | ||
198 | return (-ERR_ASYNC_TIME); /* timed out */ | 190 | return (-ERR_ASYNC_TIME); /* timed out */ |
199 | } | ||
200 | cli(); | ||
201 | } /* wait for buffer to become free again */ | 191 | } /* wait for buffer to become free again */ |
202 | 192 | ||
203 | restore_flags(flags); | ||
204 | |||
205 | if (card->debug_flags & LOG_SCHED_ASYN) | 193 | if (card->debug_flags & LOG_SCHED_ASYN) |
206 | hysdn_addlog(card, "async tx-cfg data send"); | 194 | hysdn_addlog(card, "async tx-cfg data send"); |
207 | 195 | ||