Re: [RFCv2 08/10] xhci: Add a global command queue

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

 



On Thu, Jan 30, 2014 at 6:10 AM, Mathias Nyman
<mathias.nyman@xxxxxxxxxxxxxxx> wrote:
> Create a list to store command structures, add a strucure to it every time
> a command is submitted, and remove it from the list once we get a
> command completion event matching the command.
>
> Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
> ---
>  drivers/usb/host/xhci-mem.c  |  8 ++++++++
>  drivers/usb/host/xhci-ring.c | 13 ++++++++++++-
>  drivers/usb/host/xhci.h      |  1 +
>  3 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 49b8bd0..7f8e4c3 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -1694,6 +1694,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
>  {
>         struct pci_dev  *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
>         struct xhci_cd  *cur_cd, *next_cd;
> +       struct xhci_command *cur_cmd, *next_cmd;
>         int size;
>         int i, j, num_ports;
>
> @@ -1722,6 +1723,12 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
>                 kfree(cur_cd);
>         }
>
> +       list_for_each_entry_safe(cur_cmd, next_cmd,
> +                       &xhci->cmd_list, cmd_list) {
> +               list_del(&cur_cmd->cmd_list);
> +               kfree(cur_cmd);
> +       }
> +

Aren't commands on the cmd_list currently being executed, or are there
other guarantees that make sure all commands have terminated?
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux