All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>, oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev
Subject: Re: [mnyman-xhci:for-usb-next 9/10] drivers/usb/host/xhci-ring.c:1405 xhci_handle_cmd_set_deq() error: uninitialized symbol 'stream_ctx'.
Date: Thu, 26 Sep 2024 13:17:38 +0300	[thread overview]
Message-ID: <a0ee0cda-e824-43df-a72b-83bb2cdafc74@linux.intel.com> (raw)
In-Reply-To: <b40140f7-cfd8-4cd4-b442-4d3d4318c5db@stanley.mountain>

On 25.9.2024 17.31, Dan Carpenter wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git for-usb-next
> head:   645eb2ce6b3e541d3c651f136da8a16f76799526
> commit: fdd9a29e9139a8988b65dce295dfc3f089003ae0 [9/10] xhci: trace stream context at Set TR Deq command completion
> config: powerpc64-randconfig-r072-20240925 (https://download.01.org/0day-ci/archive/20240925/202409252250.WNZonX5o-lkp@intel.com/config)
> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 7773243d9916f98ba0ffce0c3a960e4aa9f03e81)
> 

> fdd9a29e9139a8 Mathias Nyman    2024-09-12  1364  	if (ep->ep_state & EP_HAS_STREAMS && ep->stream_info) {
> 
> stream_ctx is only initialized when ep->stream_info is non-NULL.
> Could we change this condition to:
> 	if ((ep->ep_state & EP_HAS_STREAMS) && cmd_comp_code == COMP_SUCCESS) {
> instead?

Thanks, this would work, but I'd like to keep the trace message below in cases
where the ep->stream_info is valid but command is not successful.

> 
> fdd9a29e9139a8 Mathias Nyman    2024-09-12  1365  		stream_ctx = &ep->stream_info->stream_ctx_array[stream_id];
> fdd9a29e9139a8 Mathias Nyman    2024-09-12  1366  		trace_xhci_handle_cmd_set_deq_stream(ep->stream_info, stream_id);
> fdd9a29e9139a8 Mathias Nyman    2024-09-12  1367  	}
> fdd9a29e9139a8 Mathias Nyman    2024-09-12  1368
> c69a059783b241 Xenia Ragiadakou 2013-09-09  1369  	if (cmd_comp_code != COMP_SUCCESS) {
> ae636747146ea9 Sarah Sharp      2009-04-29  1370  		unsigned int ep_state;
> ae636747146ea9 Sarah Sharp      2009-04-29  1371  		unsigned int slot_state;

...

> ae636747146ea9 Sarah Sharp      2009-04-29  1400  		 */
> ae636747146ea9 Sarah Sharp      2009-04-29  1401  	} else {
> 9aad95e292f58d Hans de Goede    2013-10-04  1402  		u64 deq;
> 9aad95e292f58d Hans de Goede    2013-10-04  1403  		/* 4.6.10 deq ptr is written to the stream ctx for streams */
> 9aad95e292f58d Hans de Goede    2013-10-04  1404  		if (ep->ep_state & EP_HAS_STREAMS) {
> fdd9a29e9139a8 Mathias Nyman    2024-09-12 @1405  			deq = le64_to_cpu(stream_ctx->stream_ring) & SCTX_DEQ_MASK;
>                                                                                            ^^^^^^^^^^
> Warning.  My guess is that if cmd_comp_code is success then ep->stream_info but
> it's hard to tell without more context...

Most likely yes if endpoint has streams.

I'll fix this

Thanks
Mathias

  reply	other threads:[~2024-09-26 10:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 14:31 [mnyman-xhci:for-usb-next 9/10] drivers/usb/host/xhci-ring.c:1405 xhci_handle_cmd_set_deq() error: uninitialized symbol 'stream_ctx' Dan Carpenter
2024-09-26 10:17 ` Mathias Nyman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-25 14:24 kernel test robot

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=a0ee0cda-e824-43df-a72b-83bb2cdafc74@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=dan.carpenter@linaro.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    /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.