[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4gFtrDVTE6JCLFqG4SP2SQNALNwstaULcM67Zi5RrpJ5Q@mail.gmail.com>
Date: Tue, 4 Feb 2014 22:57:09 -0800
From: Dan Williams <dan.j.williams@...el.com>
To: Mathias Nyman <mathias.nyman@...ux.intel.com>
Cc: USB list <linux-usb@...r.kernel.org>,
Sarah Sharp <sarah.a.sharp@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFCv2 08/10] xhci: Add a global command queue
On Thu, Jan 30, 2014 at 6:10 AM, Mathias Nyman
<mathias.nyman@...ux.intel.com> 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@...ux.intel.com>
> ---
> 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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists