Re: usb: cdns3: Onchip memory reservation for built-in gadgets

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

 



Hi,

On 27/06/2023 15:56, Ravi Gunasekaran wrote:
> Hi,
> 
> Firstly, I'm not sure if it is alright to post queries this way. 
> If it is wrong, I apologize for it. Please let me know the right path/forum to ask the questions.
> 
> This is regarding the commit
> dce49449e04f usb: cdns3: allocate TX FIFO size according to composite EP number
> 
> This commit introduced cdns3_gadget_check_config() which is invoked while binding gadget created via configfs and
> also a logic to calculate ep_buf_size (which was CDNS3_EP_BUF_SIZE = 4).
> 
> But for gadgets such as g_ether, g_cdc, the checks are not performed. And also for these legacy gadget drivers,
> memory needs to be reserved for multiple IN end points and shared memory for OUT end points. So when ep_buf_size = 15,
> the memory reservation fails, as it exceeds total onchip memory.
> 
> So I was wondering if additional checks need to done in the cadence gadget driver or am I doing something wrong while
> loading gadgets such as g_ether. 
> 

I think Ravi's concern is that.

prior to commit dce49449e04f, priv_dev->ep_buf_size was fixed at 4.
After commit dce49449e04f, it is at 0 if check_config() is not called e.g.
in the legacy gadget cases (e.g. g_ether).
So cdns3_ep_config() fails with dev_err(priv_dev->dev, "onchip mem is full, ep is invalid\n").

A potential fix might be to start with priv_dev->ep_buf_size = 4
instead of 0 so it works for legacy gadgets as well where check_config() is not invoked.

-- 
cheers,
-roger



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux