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

Re: [PATCH v1 01/10] drivers/char: Add support for Xue USB3 debugger


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 23 Jun 2022 11:29:31 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=p7Zpaic8PdMekytrLer6to1o4bb49ZM8wIG3WKMQn9Q=; b=Pn2hvZvRvC5QQQrtlcAT3fgNqjoCdBHQDzTLkLTTuf6h9Wth6DL4wce2lqtn5umm2y1h2BXXC4DxZdjKRa7corYOZ197b3t0PCUP3Dt0AV/r2FRiYzJaj51tAf85fhifuJGYRwSczquxgm8+mMGoht1+rV45njgODKZzdNeh/NoOuH2e6KF1oj3x/ean2w/ii814hExXCIzr6PbjYDw1cwVPolk8mbFWx1N+UUygxRdB5294atsu+Q4/sCnEY21B2qg4MDYDn2yRszwsZ3sa7UF9b3g6SmBRjTcy9I9F+XJOTdDLBx40V59aFXbz4ibo2ihQAWH166TEve30mD6hNQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ie6WJvauoc0OK47WD/d4tPddpzF+1IDarkUVXnnCRJgkgp5YTzPaMGa2KrPlG1eGKLeIxO4L+JV1QIODRnIENvFWqffk73pSL49csG2AwDDjUC0VKAJdf98CFkmzKrfna+kQerNH4PxC3lBKpa8DsV63IjaqboJbziwDx5liv+Va7JcUAvpZQPuHdc3NHN8w6JARw0M0ClZHbdXEjXo3inrR6hJX54RzA61lW+86FhS2eGFJNnKkcy4EUzz1NgwWl2MIUuG5wS82xGDTmep5I1gj2XmZ3lD6sq7d5YvzLvfLJ34UxUjm48XMzKTXSKYlJ56Dr2ha0L9pB43izzPyEw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Connor Davis <davisc@xxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 23 Jun 2022 09:29:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.06.2022 17:47, Marek Marczykowski-Górecki wrote:
> On Wed, Jun 15, 2022 at 04:25:54PM +0200, Jan Beulich wrote:
>> On 07.06.2022 16:30, Marek Marczykowski-Górecki wrote:
>>> +    /* ...we found it, so parse the BAR and map the registers */
>>> +    bar0 = pci_conf_read32(xue->sbdf, PCI_BASE_ADDRESS_0);
>>> +    bar1 = pci_conf_read32(xue->sbdf, PCI_BASE_ADDRESS_1);
>>
>> What if there are multiple?
> 
> You mean two 32-bit BARs? I check for that below (refusing to use them).
> Anyway, I don't think that's a thing in USB 3.0 controllers.

No, I mean multiple controllers. When making the remark I didn't know
yet that you'll deal with that in patch 3. A sentence making the
restriction (and its intended resolution) explicit in the description
would help.

>>> +    memset(xue, 0, sizeof(*xue));
>>> +
>>> +    xue->dbc_ctx = &ctx;
>>> +    xue->dbc_erst = &erst;
>>> +    xue->dbc_ering.trb = evt_trb;
>>> +    xue->dbc_oring.trb = out_trb;
>>> +    xue->dbc_iring.trb = in_trb;
>>> +    xue->dbc_owork.buf = wrk_buf;
>>> +    xue->dbc_str = str_buf;
>>
>> Especially the page-sized entities want allocating dynamically here, as
>> they won't be needed without the command line option requesting the use
>> of this driver.
> 
> Are you okay with changing this only in patch 9, where I restructure those
> buffers anyway?

I'm afraid I'll need to make it to patch 9 to answer this question. If
suitable dealt with later, I don't see a fundamental problem, as long
as it's clear then that I will request that this patch be committed in
a batch with that later one, not in isolation.

>>> +    serial_register_uart(SERHND_DBGP, &xue_uart_driver, &xue_uart);
>>> +}
>>> +
>>> +void xue_uart_dump(void)
>>> +{
>>> +    struct xue_uart *uart = &xue_uart;
>>> +    struct xue *xue = &uart->xue;
>>> +
>>> +    xue_dump(xue);
>>> +}
>>
>> This function looks to be unused (and lacks a declaration).
> 
> It is unused, same as xue_dump(), but is extremely useful when
> debugging. Should I put it behind something like #ifdef XUE_DEBUG,
> accompanied with a comment about its purpose?

Yes, please (or any other suitable means to make the functions
disappear from the final binary). The function here then also ought
to be static, I suppose - you're not adding a declaration anywhere
for it to be usable outside of this source file.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.