No subject
Wed Jun 6 11:47:16 CEST 2007
578 if ((chip->mode & AD1848_MODE_PLAY) && chip->playback_substream &&
579 (chip->mode & AD1848_MODE_RUNNING))
580 snd_pcm_period_elapsed(chip->playback_substream);
Another CPU could close the substream between the check and the call to
snd_pcm_period_elapsed(). snd_pcm_period_elapsed() could be called with
either NULL or a stale substream pointer depending on how the code compiled.
I'd think creating an irq spinlock would be an easy way to fix this. The irq
handler would grab it, and the same with the open() and close() functions
around the code that sets the substream pointers. Alternatively, one could
disabled the irq handler during open and close.
I think there might also be problem with setting mixers controls during
auto-calibration . While waiting for auto-calibration to finish, the chip
isn't locked. If another thread tries to set the volume via the mixer
interface, it won't be blocked and will try to talk to the chip during AC.
The datasheet just says to wait for auto-calibration to finish, it doesn't say
what happens if you don't. So maybe there isn't any problem here.
--289736052-2121362787-1190179362=:27377
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ad1848_swa.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.58.0709182222420.27377 at shell4.speakeasy.net>
Content-Description:
Content-Disposition: attachment; filename="ad1848_swa.patch"
YWQxODQ4OiBGaXggbXNsZWVwIHdoaWxlIGF0b21pYw0KDQpTaW1wbGVzdCBm
aXguDQoNClNpZ25lZC1vZmYtYnk6IFRyZW50IFBpZXBobyA8eHl6enlAc3Bl
YWtlYXN5Lm9yZz4NCkFja2VkLWJ5OiBSZW5lIEhlcm1hbiA8cmVuZS5oZXJt
YW5AZ21haWwuY29tPg0KDQpkaWZmIC1yIDUwNTAyYzEzZDJjZiBpc2EvYWQx
ODQ4L2FkMTg0OF9saWIuYw0KLS0tIGEvaXNhL2FkMTg0OC9hZDE4NDhfbGli
LmMJTW9uIFNlcCAxNyAxOTowODozMiAyMDA3ICswMjAwDQorKysgYi9pc2Ev
YWQxODQ4L2FkMTg0OF9saWIuYwlNb24gU2VwIDE3IDE5OjE5OjUyIDIwMDcg
LTA3MDANCkBAIC0yMzYsNyArMjM2LDkgQEAgc3RhdGljIHZvaWQgc25kX2Fk
MTg0OF9tY2VfZG93bihzdHJ1Y3Qgcw0KIAkgKiBjYWxpYnJhdGlvbiBwcm9j
ZXNzIHRvIHN0YXJ0LiBOZWVkcyB1cHRvIDUgc2FtcGxlIHBlcmlvZHMgb24g
QUQxODQ4DQogCSAqIHdoaWNoIGF0IHRoZSBzbG93ZXN0IHBvc3NpYmxlIHJh
dGUgb2YgNS41MTI1IGtIeiBtZWFucyA5MDcgdXMuDQogCSAqLw0KKwlzcGlu
X3VubG9ja19pcnFyZXN0b3JlKCZjaGlwLT5yZWdfbG9jaywgZmxhZ3MpOw0K
IAltc2xlZXAoMSk7DQorCXNwaW5fbG9ja19pcnFzYXZlKCZjaGlwLT5yZWdf
bG9jaywgZmxhZ3MpOw0KIA0KIAlzbmRfcHJpbnRkZCgiKDIpIGppZmZpZXMg
PSAlbHVcbiIsIGppZmZpZXMpOw0KIA0K
--289736052-2121362787-1190179362=:27377
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ad1848.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.58.0709182222421.27377 at shell4.speakeasy.net>
Content-Description:
Content-Disposition: attachment; filename="ad1848.patch"
YWQxODQ4OiBzaW1wbGlmeSBNQ0UgZG93biBjb2RlDQoNClRoZSBwb2xsaW5n
IGxvb3AgdG8gY2hlY2sgZm9yIEFDSSB0byBnbyBkb3duIHdhcyBtb3JlIGNv
bnZvbHV0ZWQgdGhhbiBpdA0KbmVlZGVkIHRvIGJlLiAgTmV3IGxvb3Agc2hv
dWxkIGJlIG1vcmUgZWZmaWNpZW50IGFuZCBpdCBpcyBhIGxvdCBzaW1wbGVy
LiAgVGhlDQpvbGQgbG9vcCBjaGVja2VkIGZvciBhIHRpbWVvdXQgYmVmb3Jl
IGNoZWNraW5nIGZvciBBQ0kgZG93biwgd2hpY2ggY291bGQNCnJlc3VsdCBp
biBhbiBlcnJvbmVvdXMgdGltZW91dC4gIEl0J3Mgb25seSBhIGZhaWx1c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