Re: [PATCH v4] i2c: bcm2835: Model Divider in CCF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Jun 12, 2019, at 3:41 AM, Wolfram Sang <wsa@xxxxxxxxxxxxx> wrote:
> 
> On Sat, Jun 08, 2019 at 10:14:43AM -0700, Annaliese McDermond wrote:
>> Model the I2C bus clock divider as a part of the Core Clock Framework.
>> Primarily this removes the clk_get_rate() call from each transfer.
>> This call causes problems for slave drivers that themselves have
>> internal clock components that are controlled by an I2C interface.
>> When the slave's internal clock component is prepared, the prepare
>> lock is obtained, and it makes calls to the I2C subsystem to
>> command the hardware to activate the clock.  In order to perform
>> the I2C transfer, this driver sets the divider, which requires
>> it to get the parent clock rate, which it does with clk_get_rate().
>> Unfortunately, this function will try to take the clock prepare
>> lock, which is already held by the slave's internal clock calls
>> creating a deadlock.
>> 
>> Modeling the divider in the CCF natively removes this dependency
>> and the divider value is only set upon changing the bus clock
>> frequency or changes in the parent clock that cascade down to this
>> divisor.  This obviates the need to set the divider with every
>> transfer and avoids the deadlock described above.  It also should
>> provide better clock debugging and save a few cycles on each
>> transfer due to not having to recalcuate the divider value.
>> 
>> Signed-off-by: Annaliese McDermond <nh6z@xxxxxxxx>
>> Acked-by: Stefan Wahren <stefan.wahren@xxxxxxxx>
>> Reviewed-by: Eric Anholt <eric@xxxxxxxxxx>
> 
> Applied to for-next, thanks for keeping at this!

Thanks for your patience with this.  I know it’s hard to deal with
newer folks sometimes, but I really appreciate your forbearance.

> And thanks to all
> reviewers, too.

Thanks too to Eric and Stefan.  If you’re ever in the Eugene, OR area
look me up for a free beverage of your choice. :)

> (One minor thing: next time, please start a new thread when sending a
> new patch. This makes applying patches easier.)

I’ll definitely do so next time.  Thank you.

--
Annaliese McDermond
nh6z@xxxxxxxx



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux