[Sound-open-firmware] host_dma_cb() error: Wrong callback type = 3
Hello, I'm currently implementing the DMA driver for the IMX platform (Dummy DMA). With this partial implementation I have noticed the error message in the title.
The thing is, within host.c I see that dma_set_cb is called with the type as DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY (which is 3), yet in host_dma_cb itself I only see the cases for these bits individually, and it falls into the default case.
I've also noticed this in the dai.c file.
Host are registering the same callback function for both of them, but DMAs call them individually. Probably your Dummy DMA is calling the cb function with DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY.
Tomek
-----Original Message----- From: Sound-open-firmware [mailto:sound-open-firmware-bounces@alsa-project.org] On Behalf Of Paul Olaru Sent: Thursday, August 1, 2019 11:59 AM To: sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: [Sound-open-firmware] host_dma_cb() error: Wrong callback type = 3
Hello, I'm currently implementing the DMA driver for the IMX platform (Dummy DMA). With this partial implementation I have noticed the error message in the title.
The thing is, within host.c I see that dma_set_cb is called with the type as DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY (which is 3), yet in host_dma_cb itself I only see the cases for these bits individually, and it falls into the default case.
I've also noticed this in the dai.c file. _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware --------------------------------------------------------------------
Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
Wait, so the type parameter is not opaque but a bitmask of situations when the callback should be called? And then the driver will call with one of the types specified in there? I will look into the drivers for the other Platforms to see how this actually works, though a more thorough explanation may be nice.
-----Original Message----- From: Lauda, Tomasz [mailto:tomasz.lauda@intel.com] Sent: Thursday, August 1, 2019 1:17 PM To: Paul Olaru paul.olaru@nxp.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
Host are registering the same callback function for both of them, but DMAs call them individually. Probably your Dummy DMA is calling the cb function with DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY.
Tomek
-----Original Message----- From: Sound-open-firmware [mailto:sound-open-firmware-bounces@alsa-project.org] On Behalf Of Paul Olaru Sent: Thursday, August 1, 2019 11:59 AM To: sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: [Sound-open-firmware] host_dma_cb() error: Wrong callback type = 3
Hello, I'm currently implementing the DMA driver for the IMX platform (Dummy DMA). With this partial implementation I have noticed the error message in the title.
The thing is, within host.c I see that dma_set_cb is called with the type as DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY (which is 3), yet in host_dma_cb itself I only see the cases for these bits individually, and it falls into the default case.
I've also noticed this in the dai.c file. _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.al... --------------------------------------------------------------------
Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
It works this way due to the fact, that we can only register one callback function to the DMA. It will get much simpler after someone will refactor/reimplement the callback system and allow for the multiple callbacks.
Tomek
-----Original Message----- From: Paul Olaru [mailto:paul.olaru@nxp.com] Sent: Thursday, August 1, 2019 12:29 PM To: Lauda, Tomasz tomasz.lauda@intel.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
Wait, so the type parameter is not opaque but a bitmask of situations when the callback should be called? And then the driver will call with one of the types specified in there? I will look into the drivers for the other Platforms to see how this actually works, though a more thorough explanation may be nice.
-----Original Message----- From: Lauda, Tomasz [mailto:tomasz.lauda@intel.com] Sent: Thursday, August 1, 2019 1:17 PM To: Paul Olaru paul.olaru@nxp.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
Host are registering the same callback function for both of them, but DMAs call them individually. Probably your Dummy DMA is calling the cb function with DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY.
Tomek
-----Original Message----- From: Sound-open-firmware [mailto:sound-open-firmware-bounces@alsa-project.org] On Behalf Of Paul Olaru Sent: Thursday, August 1, 2019 11:59 AM To: sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: [Sound-open-firmware] host_dma_cb() error: Wrong callback type = 3
Hello, I'm currently implementing the DMA driver for the IMX platform (Dummy DMA). With this partial implementation I have noticed the error message in the title.
The thing is, within host.c I see that dma_set_cb is called with the type as DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY (which is 3), yet in host_dma_cb itself I only see the cases for these bits individually, and it falls into the default case.
I've also noticed this in the dai.c file. _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.al... --------------------------------------------------------------------
Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
--------------------------------------------------------------------
Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
Alright, thanks, so for now I will call it with DMA_CB_TYPE_COPY (since I only do the callback from copy() itself at least currently) and ignore registrations which don't specify this bit. Will keep an eye on it when the framework gets updated in this sense.
Paul
-----Original Message----- From: Lauda, Tomasz [mailto:tomasz.lauda@intel.com] Sent: Thursday, August 1, 2019 1:34 PM To: Paul Olaru paul.olaru@nxp.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
It works this way due to the fact, that we can only register one callback function to the DMA. It will get much simpler after someone will refactor/reimplement the callback system and allow for the multiple callbacks.
Tomek
-----Original Message----- From: Paul Olaru [mailto:paul.olaru@nxp.com] Sent: Thursday, August 1, 2019 12:29 PM To: Lauda, Tomasz tomasz.lauda@intel.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
Wait, so the type parameter is not opaque but a bitmask of situations when the callback should be called? And then the driver will call with one of the types specified in there? I will look into the drivers for the other Platforms to see how this actually works, though a more thorough explanation may be nice.
-----Original Message----- From: Lauda, Tomasz [mailto:tomasz.lauda@intel.com] Sent: Thursday, August 1, 2019 1:17 PM To: Paul Olaru paul.olaru@nxp.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
Host are registering the same callback function for both of them, but DMAs call them individually. Probably your Dummy DMA is calling the cb function with DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY.
Tomek
-----Original Message----- From: Sound-open-firmware [mailto:sound-open-firmware-bounces@alsa-project.org] On Behalf Of Paul Olaru Sent: Thursday, August 1, 2019 11:59 AM To: sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: [Sound-open-firmware] host_dma_cb() error: Wrong callback type = 3
Hello, I'm currently implementing the DMA driver for the IMX platform (Dummy DMA). With this partial implementation I have noticed the error message in the title.
The thing is, within host.c I see that dma_set_cb is called with the type as DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY (which is 3), yet in host_dma_cb itself I only see the cases for these bits individually, and it falls into the default case.
I've also noticed this in the dai.c file. _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.al... --------------------------------------------------------------------
Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
--------------------------------------------------------------------
Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
Hello again, do you have any resource on what the dma_cb_status values mean? Right now I'm ignoring them and that doesn't seem to work. Also tried treating DMA_CB_STATUS_SPLIT in a sense but that leads to IPC timeouts and a sort of hanging (when aplay stops due to the timeout the firmware seems to acknowledge and recover).
-----Original Message----- From: Sound-open-firmware [mailto:sound-open-firmware-bounces@alsa-project.org] On Behalf Of Paul Olaru Sent: Thursday, August 1, 2019 1:37 PM To: Lauda, Tomasz tomasz.lauda@intel.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com Subject: Re: [Sound-open-firmware] host_dma_cb() error: Wrong callback type = 3
Alright, thanks, so for now I will call it with DMA_CB_TYPE_COPY (since I only do the callback from copy() itself at least currently) and ignore registrations which don't specify this bit. Will keep an eye on it when the framework gets updated in this sense.
Paul
-----Original Message----- From: Lauda, Tomasz [mailto:tomasz.lauda@intel.com] Sent: Thursday, August 1, 2019 1:34 PM To: Paul Olaru paul.olaru@nxp.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
It works this way due to the fact, that we can only register one callback function to the DMA. It will get much simpler after someone will refactor/reimplement the callback system and allow for the multiple callbacks.
Tomek
-----Original Message----- From: Paul Olaru [mailto:paul.olaru@nxp.com] Sent: Thursday, August 1, 2019 12:29 PM To: Lauda, Tomasz tomasz.lauda@intel.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
Wait, so the type parameter is not opaque but a bitmask of situations when the callback should be called? And then the driver will call with one of the types specified in there? I will look into the drivers for the other Platforms to see how this actually works, though a more thorough explanation may be nice.
-----Original Message----- From: Lauda, Tomasz [mailto:tomasz.lauda@intel.com] Sent: Thursday, August 1, 2019 1:17 PM To: Paul Olaru paul.olaru@nxp.com; sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: RE: host_dma_cb() error: Wrong callback type = 3
Host are registering the same callback function for both of them, but DMAs call them individually. Probably your Dummy DMA is calling the cb function with DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY.
Tomek
-----Original Message----- From: Sound-open-firmware [mailto:sound-open-firmware-bounces@alsa-project.org] On Behalf Of Paul Olaru Sent: Thursday, August 1, 2019 11:59 AM To: sound-open-firmware@alsa-project.org Cc: Daniel Baluta daniel.baluta@nxp.com; tomasz.lauda@linux.intel.com Subject: [Sound-open-firmware] host_dma_cb() error: Wrong callback type = 3
Hello, I'm currently implementing the DMA driver for the IMX platform (Dummy DMA). With this partial implementation I have noticed the error message in the title.
The thing is, within host.c I see that dma_set_cb is called with the type as DMA_CB_TYPE_IRQ | DMA_CB_TYPE_COPY (which is 3), yet in host_dma_cb itself I only see the cases for these bits individually, and it falls into the default case.
I've also noticed this in the dai.c file. _______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.al... --------------------------------------------------------------------
Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
--------------------------------------------------------------------
Intel Technology Poland sp. z o.o. ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
_______________________________________________ Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.al...
On Mon, Aug 5, 2019 at 10:04 AM Paul Olaru paul.olaru@nxp.com wrote:
Hello again, do you have any resource on what the dma_cb_status values mean? Right now I'm ignoring them and that doesn't seem to work. Also tried treating DMA_CB_STATUS_SPLIT in a sense but that leads to IPC timeouts and a sort of hanging (when aplay stops due to the timeout the firmware seems to acknowledge and recover).
Hi all,
We pretty much understood the meaning of dma_cb_status.
Now we want to understand when the one needs to call DMA_CB_TYPE_IRQ vs DMA_CB_TYPE_COPY?
Can you help? A document describing the DMA workflow would be nice to have :).
thanks, Daniel.
participants (3)
-
Daniel Baluta
-
Lauda, Tomasz
-
Paul Olaru