linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jung Daehwan <dh10.jung@samsung.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	"open list:USB XHCI DRIVER" <linux-usb@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Subject: Re: [PATCH] usb: host: Add a quirk for writing ERST in high-low order
Date: Tue, 28 May 2024 17:58:05 +0900	[thread overview]
Message-ID: <20240528085805.GA80763@ubuntu> (raw)
In-Reply-To: <2024052838-fifth-liver-fb4e@gregkh>

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

On Tue, May 28, 2024 at 09:30:34AM +0200, Greg Kroah-Hartman wrote:
> On Tue, May 28, 2024 at 09:23:43AM +0200, Greg Kroah-Hartman wrote:
> > On Tue, May 28, 2024 at 02:57:16PM +0900, Daehwan Jung wrote:
> > > [Synopsys]- The host controller was design to support ERST setting
> > > during the RUN state. But since there is a limitation in controller
> > > in supporting separate ERSTBA_HI and ERSTBA_LO programming,
> > > It is supported when the ERSTBA is programmed in 64bit,
> > > or in 32 bit mode ERSTBA_HI before ERSTBA_LO
> > > 
> > > [Synopsys]- The internal initialization of event ring fetches
> > > the "Event Ring Segment Table Entry" based on the indication of
> > > ERSTBA_LO written.
> > > 
> > > Signed-off-by: Daehwan Jung <dh10.jung@samsung.com>
> > > ---
> > >  drivers/usb/host/xhci-mem.c | 5 ++++-
> > >  drivers/usb/host/xhci.h     | 2 ++
> > >  2 files changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> > > index 3100219..ef768e6 100644
> > > --- a/drivers/usb/host/xhci-mem.c
> > > +++ b/drivers/usb/host/xhci-mem.c
> > > @@ -2325,7 +2325,10 @@ xhci_add_interrupter(struct xhci_hcd *xhci, struct xhci_interrupter *ir,
> > >  	erst_base = xhci_read_64(xhci, &ir->ir_set->erst_base);
> > >  	erst_base &= ERST_BASE_RSVDP;
> > >  	erst_base |= ir->erst.erst_dma_addr & ~ERST_BASE_RSVDP;
> > > -	xhci_write_64(xhci, erst_base, &ir->ir_set->erst_base);
> > > +	if (xhci->quirks & XHCI_WRITE_64_HI_LO)
> > > +		hi_lo_writeq(erst_base, &ir->ir_set->erst_base);
> > > +	else
> > > +		xhci_write_64(xhci, erst_base, &ir->ir_set->erst_base);
> > >  
> > >  	/* Set the event ring dequeue address of this interrupter */
> > >  	xhci_set_hc_event_deq(xhci, ir);
> > > diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> > > index 3041515..8664dd1 100644
> > > --- a/drivers/usb/host/xhci.h
> > > +++ b/drivers/usb/host/xhci.h
> > > @@ -17,6 +17,7 @@
> > >  #include <linux/kernel.h>
> > >  #include <linux/usb/hcd.h>
> > >  #include <linux/io-64-nonatomic-lo-hi.h>
> > > +#include <linux/io-64-nonatomic-hi-lo.h>
> 
> Why not put this in the .c file?

I add it following similar header file.
#include <linux/io-64-nonatomic-lo-hi.h>

Do you think it should be put in .c file because .c file only uses it?
If so, I will modify it in the next submission.

> 
> > >  /* Code sharing between pci-quirks and xhci hcd */
> > >  #include	"xhci-ext-caps.h"
> > > @@ -1627,6 +1628,7 @@ struct xhci_hcd {
> > >  #define XHCI_RESET_TO_DEFAULT	BIT_ULL(44)
> > >  #define XHCI_ZHAOXIN_TRB_FETCH	BIT_ULL(45)
> > >  #define XHCI_ZHAOXIN_HOST	BIT_ULL(46)
> > > +#define XHCI_WRITE_64_HI_LO	BIT_ULL(47)
> 
> Note, you define this, and check it, but it is never set, so this patch
> is useless on its own and so we can not accept it as-is at all.
> 
> How was this tested?

I got it. I will add other patches and send the patchset.

> 
> thanks,
> 
> greg k-h
> 

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



      reply	other threads:[~2024-05-28  8:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240528055659epcas2p4f86642d6647855747cea35b04f8a46cc@epcas2p4.samsung.com>
2024-05-28  5:57 ` [PATCH] usb: host: Add a quirk for writing ERST in high-low order Daehwan Jung
2024-05-28  7:23   ` Greg Kroah-Hartman
2024-05-28  7:29     ` Greg Kroah-Hartman
2024-05-30  7:40       ` Jung Daehwan
2024-05-28  7:30     ` Greg Kroah-Hartman
2024-05-28  8:58       ` Jung Daehwan [this message]

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=20240528085805.GA80763@ubuntu \
    --to=dh10.jung@samsung.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).