Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I am developing a CD driver for data CD. The CD device is controlled through I2C and the data comes through SPDIF channel. The SPDIF driver is part of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2010
    Posts
    7

    Block device driver crashes on making i2c_master_send call in request


    Hello,
    I am developing a CD driver for data CD. The CD device is controlled through I2C and the data comes through SPDIF channel. The SPDIF driver is part of the BSP. To read sectors from the CD device, I need to send a i2C play command and then subsequently make a call to spdif_read() function of BSP to read the data. So, in my block driver's request(...) function, when I realize that the request from the kernel is read, I issue a PLAY I2C command using I2c_master_send() api. Then I go on to make a spidif_read() subsequently. The issue is that moment I issue the i2c_master_send(), my driver is crashing.
    Can some one throw some light on this? Is it legal to call other driver / Subsystem functions from request() function (which I guess is in the context of the I/O scheduler)

    Regards,
    Souvik

  2. #2
    Just Joined!
    Join Date
    Oct 2010
    Posts
    7
    I have found the solution but I am not sure of the impact though. Need to investigate more on this.
    Actually when the kernel calls the request() function, it holds a spinlock. Now when I am making i2c_master_send(), internally (needs to find where) it some where causes the CPU to get relinquished. This is causing the issue.
    So before calling i2c_master_send() I released the spinlock and locked it again after the call returned.
    It solved the crashing issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •