Repository navigation
reduce IPC platform driver API - #740
Conversation
plbossart
left a comment
There was a problem hiding this comment.
@lyakh code looks good, and I like the way your patches progress logically, but I need your help to split them in a different way so that the fixes apply in a more direct way to the code already submitted upstream (which doesn't include haswell, skylake/kabylake, compressed, spi). Thanks!
There was a problem hiding this comment.
@lyakh please add a more complete prefix in your patches, e.g. for this one this should be ASoC: SOF: Intel since you are only touching intel-specific patches.
There was a problem hiding this comment.
@lyakh this comment still applies. ASoC: SOF: Intel prefix please, it makes things easier to track for reviewers (some of whom may not care about Intel specifics)
There was a problem hiding this comment.
@lyakh can you do me a favor and not bundle things aren't ready for upstream with things that are. Specifically Haswell/SKL/KBL/Compressed/SPI are not shared upstream just yet, so it helps if your patches follow this split.
There was a problem hiding this comment.
sorry, what branch should I be making patches against? I was using topic/sof-dev, should I use integration/... instead?
There was a problem hiding this comment.
@lyakh we should use topic/sof-dev but if you look at the patches posted upstream HSW/KBL/SKL/Compressed/SPI are not included in them. So it will be easier to maintain the squash/rebase cycles if you split for ex. your commit: "ASoC: SOF: eliminate redundant mailbox reads" into 2. One intended for the files in the upstream patches and another one for those not in it (hsw.c etc).
There was a problem hiding this comment.
I see, but how should I know which ones are and which ones aren't included? I think we need a separate branch, really.
There was a problem hiding this comment.
@lyakh check topic/sof-dev-rebase, everything after 'add build support' is not upstream yet. Ideally your patches should apply cleanly on the initial batch. Thanks!
There was a problem hiding this comment.
@plbossart let me take a semi-qualified guess: is this the commit, that I should be branching from?
commit af23c43
Author: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
Date: Mon May 21 18:19:44 2018 -0500ASoC: Intel: boards: initial support for Hifiberry Digiplus w/ WM8804
lgirdwood
left a comment
There was a problem hiding this comment.
This all looks good - more pink than green in the diffs :)
There was a problem hiding this comment.
Does %u make it obvious to the user that it's base16 ?
There was a problem hiding this comment.
%u is for size_t and will print in decimal. Andy commented that the sizes should be decimal, not hex and I agree.
There was a problem hiding this comment.
Oh, I missed that there are two sizes printed in this one, so both have to be made %u. And for size_t it might be %zu, I'll have to double check.
|
@plbossart <https://github.com/plbossart> let me take a semi-qualified
guess: is this the commit, that I should be branching from?
the last patch submitted upstream is c12f340 ('ASoC: Intel: select
relevant machine drivers for SOF')
|
|
@plbossart I forked from an earlier commit that didn't contain hsw, spi, etc., rebased my patches on top of it and pushed it. Now gh is trying to merge this to the head, which creates a mess, of course. Can you maybe just pull / cherry pick from that my branch? |
sorry no, I can only review and use the web interface this week. What's the issue with splitting the patches in a part that will apply on the v5 set and one that applies on top of topic/sof-dev? |
If there were a branch somewhere with exactly v5 there would be no issue at all. But if I understood correctly I was supposed to make patches that apply "to a branch but not to its head but N patches before the head." That's what I've done here, but when pushing and making a PR the github produced a PR with 47 commits and a mountain of conflicts. Maybe I've done something wrong, but it really would have been much easier to have a clean branch with just v5 and nothing else in it. |
|
topic/sof-def-rebase branch, commit e92423f contains exactly the v5 patches. |
right, and it's 24 commits behind the topic/sof-dev-rebase head, which is exactly the problem |
|
@plbossart how do we progress with this? |
I really don't get the issue. Split the patches in two, and make sure the first patches apply on top of v5, and the second batch on top of sof-dev, then submit the whole thing as one PR. |
@plbossart ah, so you want me to split my patches into two lots so that the first one can apply to v5 and the second one applies on top of sof-dev+my first lot, and then (hopefully the first lot will also apply on top of sof-dev) apply both lots in that order on top of sof-dev and push to you. After that you'll again split them... |
I would actually cherry-pick the first lot to push it as either incremental patches to alsa-devel if Mark merges the v5, or squash them into a v6 otherwise. You will save me time with this split, thanks in advance! |
|
@plbossart I think something went wrong with github links, both your references to c12f340 and e92423f point to a commit from 2017. |
the commit are quite old, i've been squashing for 1.5 years now. It's the branch that matters. |
|
@plbossart I think this should do it now: the first 7 commits are for upstream, the remaining 5 are for sof-dev |
There was a problem hiding this comment.
@lyakh this comment still applies. ASoC: SOF: Intel prefix please, it makes things easier to track for reviewers (some of whom may not care about Intel specifics)
There was a problem hiding this comment.
comment on subject: ASoC: SOF: Intel again
There was a problem hiding this comment.
ASoC: SOF: ipc: for the subject line please
There was a problem hiding this comment.
ASoC: SOF: core: prefix for subject, this isn't really related to the IPC.
There was a problem hiding this comment.
ASoC: SOF: hsw: simplify .get_reply() implementations
There was a problem hiding this comment.
I am probably getting on your nerves but even this needs to be split in 3. My topic/sof-def-rebase have haswell, SKL and SPI added in 3 separate steps.
There was a problem hiding this comment.
So, besides removing the else clause your patch also modifies the format for dev_err. I think that should be the subject of another patch.
All SOF .get_reply() implementations follow the same pattern, which can be trivially simplified to remove an "else" clause. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Arguably for most humans sizes, printed out in decimal format are easier to read than in hexadecimal. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
sof_ipc_tx_msg_reply_complete() is a static function with two arguments, of which one isn't used, it only contains two lines and is only called once. Removing it makes the flow more readable. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
msg->msg_data is pre-allocated during SOF probing, if the allocation fails, the probing is aborted. Moreover, in hda-ipc.c that buffer is used before being checked. Remove the redundant test. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The .get_reply() callback is always called by the IPC core immediately upon a wake-up from the platform IPC drived's interrupt handler. Therefore it can be directly called from the interrupt handler, avoiding the indirection. To make this possible the message has to be accessible from the "struct snd_sof_dev" instance and the .ipc_lock spin-lock has to be taken while manipulating the message. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
*_get_reply() functions on all platforms are very similar and they share the same flaw: in case of an error the response is read from the mailbox twice. This patch replaces the second of the two reads with a memcpy(). Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
.ipc_done() is always called after an IPC IRQ, either immediately or in a task, woken up by the IRQ. This can be simplified by directly executing the respective code from the IRQ thread. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
All SOF .get_reply() implementations follow the same pattern, which can be trivially simplified to remove an "else" clause. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Unlike addresses sizes are usually easier to read in decimal format. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
msg->msg_data is pre-allocated during SOF probing, if the allocation fails, the probing is aborted. Moreover, in hda-ipc.c that buffer is used before being checked. Remove the redundant test. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The .get_reply() callback is always called by the IPC core immediately upon a wake-up from the platform IPC drived's interrupt handler. Therefore it can be directly called from the interrupt handler, avoiding the indirection. To make this possible the message has to be accessible from the "struct snd_sof_dev" instance and the .ipc_lock spin-lock has to be taken while manipulating the message. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The .get_reply() callback is always called by the IPC core immediately upon a wake-up from the platform IPC drived's interrupt handler. Therefore it can be directly called from the interrupt handler, avoiding the indirection. To make this possible the message has to be accessible from the "struct snd_sof_dev" instance and the .ipc_lock spin-lock has to be taken while manipulating the message. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The .get_reply() callback is always called by the IPC core immediately upon a wake-up from the platform IPC drived's interrupt handler. Therefore it can be directly called from the interrupt handler, avoiding the indirection. To make this possible the message has to be accessible from the "struct snd_sof_dev" instance and the .ipc_lock spin-lock has to be taken while manipulating the message. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
*_get_reply() functions on all platforms are very similar and they share the same flaw: in case of an error the response is read from the mailbox twice. This patch replaces the second of the two reads with a memcpy(). Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
.ipc_done() is always called after an IPC IRQ, either immediately or in a task, woken up by the IRQ. This can be simplified by directly executing the respective code from the IRQ thread. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
.ipc_done() is always called after an IPC IRQ, either immediately or in a task, woken up by the IRQ. This can be simplified by directly executing the respective code from the IRQ thread. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
.ipc_done() is always called after an IPC IRQ, either immediately or in a task, woken up by the IRQ. This can be simplified by directly executing the respective code from the IRQ thread. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
|
@plbossart I've got the next lot of IPC patches, basically just removing .mailbox_read() and .mailbox_write(), should I wait until this is merged or push on top? |
|
regression reported on #773 narrowed down to this PR. |
Most importantly this patch series removes 2 IPC platform driver methods: .get_ready and .cmd_done, additionally it contains some simple improvements. Removing those methods is not a completely "lossless" process, e.g. some register access operations had to be swapped. That shouldn't cause problems, but it has to be thoroughly tested for any regressions. I've only tested on Up^2 with a HifiBerry DAC+ on its RCA output.