Skip to content

bcm2708-dmaengine: Use more DMA channels (but not 12) #1113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2015

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Aug 20, 2015

  1. Only the bcm2708_fb drivers uses the legacy DMA API, and
    it requires a BULK-capable channel, so all other types
    (FAST, NORMAL and LITE) can be made available to the regular
    DMA API.

  2. DMA channels 11-14 share an interrupt. The driver can't
    handle this, so don't use channels 12-14 (12 was used, probably
    because it appears to have an interrupt, but in reality that
    interrupt is for activity on ANY channel). This may explain
    a lockup encountered when running out of DMA channels.

The combined effect of this patch is to leave 7 DMA channels
available + channel 0 for bcm2708_fb via the legacy API.

See: #1110
#1108

1) Only the bcm2708_fb drivers uses the legacy DMA API, and
it requires a BULK-capable channel, so all other types
(FAST, NORMAL and LITE) can be made available to the regular
DMA API.

2) DMA channels 11-14 share an interrupt. The driver can't
handle this, so don't use channels 12-14 (12 was used, probably
because it appears to have an interrupt, but in reality that
interrupt is for activity on ANY channel). This may explain
a lockup encountered when running out of DMA channels.

The combined effect of this patch is to leave 7 DMA channels
available + channel 0 for bcm2708_fb via the legacy API.

See: raspberrypi#1110
     raspberrypi#1108
@popcornmix
Copy link
Collaborator

Okay - feel free to merge.

@msperl
Copy link
Contributor

msperl commented Aug 20, 2015

Can you also merge it into 4.2?

pelwell added a commit that referenced this pull request Aug 20, 2015
bcm2708-dmaengine: Use more DMA channels (but not 12)
@pelwell pelwell merged commit 06c135b into raspberrypi:rpi-4.1.y Aug 20, 2015
@pelwell
Copy link
Contributor Author

pelwell commented Aug 20, 2015

It's also on 4.2.

@kukabu
Copy link

kukabu commented Aug 24, 2015

I'm not sure but look like this commit break sdhost-overlay and spi-dma-overlay
foundation kernel without this pacth (for apt-get) - https://gist.github.com/kukabu/da83930e40d54cb7c454
my custom kernel with this patch - https://gist.github.com/kukabu/f5fc74ea8f0f93481f0e
dmesg diff - https://gist.github.com/kukabu/dd61a4d6f45b343dceab

How do I debug the overlay?

@pelwell
Copy link
Contributor Author

pelwell commented Aug 24, 2015

It's working for me, so one of us is doing something wrong. Can you post your config.txt (just the active bits - you can delete the comments) and the output of:

sudo vcdbg log msg |& grep -viE "(hdmi|gpioman):"

please?

@kukabu
Copy link

kukabu commented Aug 24, 2015

config.txt - https://gist.github.com/kukabu/9a7f8e508c58618d75b5
vcdbg log msg - https://gist.github.com/kukabu/5629b5c2b4368b0199c5

@pelwell thanks, if it work for you then I something broken :(

@pelwell
Copy link
Contributor Author

pelwell commented Aug 24, 2015

001291.049: Failed to load overlay 'sdhost-overlay'
001295.702: Failed to load overlay 'spi-dma-overlay'

The "-overlay" part is inferred and should not be used - remove it. However, at the moment it still ought to work, so that shouldn't be the problem.

Oh - now I see:

001231.524: Kernel trailer DDTK property says yes

DDTK is an unreleased development feature in the loader that will cause it to look for different filenames. dtoverlay=sdhost will look for sdhost.dtbo instead of sdhost-overlay.dtb, which isn't useful to you at the moment. This mode is selected by a flag in the kernel trailer (added by an unreleased version of mkknlimg).

How have you built this kernel? What does scripts/knlinfo kernel.img show (you may need to change the paths)?

Also, do you really want to turn on both i2c interfaces? i2c0 (or i2c1 on a Rev 1 Model B) is intended for the VideoCore processor. The recommended setting for people using i2c is:

dtparam=i2c_arm=on

which will automatically select the correct interface on each Pi. If you want to explicitly allow the ARM to access the VideoCore I2C then use:

dtparam=i2c_vc=on

but be aware that it will stop the camera from working.

@pelwell
Copy link
Contributor Author

pelwell commented Aug 24, 2015

OK, so that version is released (in the tools repo), but it isn't one found in any of the kernel trees. I suspect you are trying to enable some extra kernel features and ended up setting CONFIG_OF_OVERLAY. This enables the new kernel dynamic Device Tree support, but it isn't very useful because it doesn't include a userspace interface; apart from some self tests, only one driver uses it in the 4.2 tree. Note that this isn't required in a standard Pi kernel because all of the overlay functionality is in the loader.

Your options are:

  1. Don't define CONFIG_OF_OVERLAY.
  2. Use the version of mkknlimg found in the scripts folder of the kernel tree.

For reference, the latest documentation for kernel building can be found here.

I think any apparent link to this bcm2708-dmaengine commit is just coincidental.

@kukabu
Copy link

kukabu commented Aug 24, 2015

I found the my mistake. CONFIG_OF_OVERLAY=y in .config.
@pelwell thanks and excuse my disturbing you.

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Sep 10, 2015
See: raspberrypi/linux#756

kernel: spi-bcm2835: merge upstream patches allowing DMA transfers
See: raspberrypi/linux#1085

kernel: rpisense-fb: add low-light mode and gamma control
See: raspberrypi/linux#1104

kernel: bcm2708-dmaengine: Use more DMA channels (but not 12)
See:  raspberrypi/linux#1113

kernel: Add /dev/gpiomem device for rootless user GPIO access
See: raspberrypi/linux#1112

kernel: Add RaspiDAC3 support

kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue
See: raspberrypi/linux#1125

kernel: BCM270X_DT: Add SDIO overlay
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Sep 10, 2015
See: raspberrypi/linux#756

kernel: spi-bcm2835: merge upstream patches allowing DMA transfers
See: raspberrypi/linux#1085

kernel: rpisense-fb: add low-light mode and gamma control
See: raspberrypi/linux#1104

kernel: bcm2708-dmaengine: Use more DMA channels (but not 12)
See:  raspberrypi/linux#1113

kernel: Add /dev/gpiomem device for rootless user GPIO access
See: raspberrypi/linux#1112

kernel: Add RaspiDAC3 support

kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue
See: raspberrypi/linux#1125

kernel: BCM270X_DT: Add SDIO overlay
neuschaefer pushed a commit to neuschaefer/raspi-binary-firmware that referenced this pull request Feb 27, 2017
See: raspberrypi/linux#756

kernel: spi-bcm2835: merge upstream patches allowing DMA transfers
See: raspberrypi/linux#1085

kernel: rpisense-fb: add low-light mode and gamma control
See: raspberrypi/linux#1104

kernel: bcm2708-dmaengine: Use more DMA channels (but not 12)
See:  raspberrypi/linux#1113

kernel: Add /dev/gpiomem device for rootless user GPIO access
See: raspberrypi/linux#1112

kernel: Add RaspiDAC3 support

kernel: Rpi 4.1.y spi bcm2835 patches clock-polarity issue
See: raspberrypi/linux#1125

kernel: BCM270X_DT: Add SDIO overlay
@pelwell pelwell deleted the rpi-4.1.y branch September 15, 2021 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants