All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6 01/10] drivers/char: allow using both dbgp=xhci and dbgp=ehci
Date: Tue, 6 Sep 2022 17:46:12 +0200	[thread overview]
Message-ID: <YxdrRUEJ31ZgmilH@mail-itl> (raw)
In-Reply-To: <08c9df71-0470-c9eb-94f0-776eaacefa5b@suse.com>

[-- Attachment #1: Type: text/plain, Size: 2871 bytes --]

On Tue, Sep 06, 2022 at 05:07:27PM +0200, Jan Beulich wrote:
> On 02.09.2022 15:17, Marek Marczykowski-Górecki wrote:
> > This allows configuring EHCI and XHCI consoles separately,
> > simultaneously.
> > 
> > This changes string_param() to custom_param() in both ehci and xhci
> > drivers. Both drivers parse only values applicable to them.
> > 
> > While at it, drop unnecessary memset() of a static variable.
> 
> Are you sure of this? What if there are two "dbgp=xhci,..." options
> on the command line, the latter intended to override the earlier but
> malformed. Then ->enabled would be left set from parsing the first
> instance, afaict.

Right.

> > --- a/docs/misc/xen-command-line.pandoc
> > +++ b/docs/misc/xen-command-line.pandoc
> > @@ -409,7 +409,7 @@ The following are examples of correct specifications:
> >  Specify the size of the console ring buffer.
> >  
> >  ### console
> > -> `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | none ]`
> > +> `= List of [ vga | com1[H,L] | com2[H,L] | pv | dbgp | xhci | none ]`
> 
> Personally I consider "dbc" more in line with "dbgp", but I'm okay
> with "xhci". We may want to allow for "ehci" then as an alias of
> "dbgp", though (in a separate, later patch).

I've changed "dbc" to "xhci", as "dbc" isn't really surfaced to the user
anywhere else. As in - it requires some deeper knowledge to draw a
connection between console=dbc and dbgp=xhci. And yes, when going this
way, "ehci" alias would make sense.

> 
> > --- a/xen/drivers/char/ehci-dbgp.c
> > +++ b/xen/drivers/char/ehci-dbgp.c
> > @@ -1464,7 +1464,18 @@ static struct uart_driver __read_mostly ehci_dbgp_driver = {
> >  static struct ehci_dbgp ehci_dbgp = { .state = dbgp_unsafe, .phys_port = 1 };
> >  
> >  static char __initdata opt_dbgp[30];
> > -string_param("dbgp", opt_dbgp);
> > +
> > +static int __init parse_ehci_dbgp(const char *opt)
> > +{
> > +    if ( strncmp(opt, "ehci", 4) )
> > +        return 0;
> > +
> > +    strlcpy(opt_dbgp, opt, sizeof(opt_dbgp));
> > +
> > +    return 0;
> > +}
> > +
> > +custom_param("dbgp", parse_ehci_dbgp);
> 
> We commonly don't put a blank line between the function and this
> construct. (Same again further down then.)
> 
> > --- a/xen/drivers/char/xhci-dbc.c
> > +++ b/xen/drivers/char/xhci-dbc.c
> > @@ -245,6 +245,7 @@ struct dbc {
> >      uint64_t xhc_dbc_offset;
> >      void __iomem *xhc_mmio;
> >  
> > +    bool enable; /* whether dbgp=xhci was set at all */
> 
> In dbc_init_xhc() there's an assumption that the "sbdf" field is
> always non-zero. Do you really need this separate flag then?

Not really, sbdf == 0 means "find Nth xhci", where N=xhc_num+1 (and
xhc_num can be zero too). See the "if" at the very top of
dbc_init_xhc().

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-09-06 21:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02 13:17 [PATCH v6 00/10] Add Xue - console over USB 3 Debug Capability Marek Marczykowski-Górecki
2022-09-02 13:17 ` [PATCH v6 01/10] drivers/char: allow using both dbgp=xhci and dbgp=ehci Marek Marczykowski-Górecki
2022-09-06 15:07   ` Jan Beulich
2022-09-06 15:46     ` Marek Marczykowski-Górecki [this message]
2022-09-06 15:54       ` Jan Beulich
2022-09-02 13:17 ` [PATCH v6 02/10] console: support multiple serial console simultaneously Marek Marczykowski-Górecki
2022-09-02 13:17 ` [PATCH v6 03/10] IOMMU: add common API for device reserved memory Marek Marczykowski-Górecki
2022-09-02 13:17 ` [PATCH v6 04/10] IOMMU/VT-d: wire common device reserved memory API Marek Marczykowski-Górecki
2022-09-02 13:17 ` [PATCH v6 05/10] IOMMU/AMD: " Marek Marczykowski-Górecki
2022-09-02 13:17 ` [PATCH v6 06/10] drivers/char: mark DMA buffers as reserved for the XHCI Marek Marczykowski-Górecki
2022-09-02 13:17 ` [PATCH v6 07/10] drivers/char: add RX support to the XHCI driver Marek Marczykowski-Górecki
2022-09-02 13:17 ` [PATCH v6 08/10] drivers/char: allow driving the rest of XHCI by a domain while Xen uses DbC Marek Marczykowski-Górecki
2022-09-02 13:17 ` [PATCH v6 09/10] drivers/char: fix handling cable re-plug in XHCI console driver Marek Marczykowski-Górecki
2022-09-06  9:21   ` Jan Beulich
2022-09-02 13:17 ` [PATCH v6 10/10] drivers/char: use smp barriers in xhci driver Marek Marczykowski-Górecki
2022-09-06  9:23   ` Jan Beulich
2022-09-06 15:11 ` [PATCH v6 00/10] Add Xue - console over USB 3 Debug Capability Jan Beulich
2022-09-06 16:05   ` Marek Marczykowski-Górecki
2022-09-06 16:12     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YxdrRUEJ31ZgmilH@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.