Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2884559imm; Sun, 29 Jul 2018 05:44:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfkV6/zjqoolSF9TUcmMuME2lMYK/JYgXEtFZtfYWRyA/QmdYsFvuLftjDyXcrgUJUOTeuz X-Received: by 2002:a62:45d2:: with SMTP id n79-v6mr13830114pfi.137.1532868268295; Sun, 29 Jul 2018 05:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532868268; cv=none; d=google.com; s=arc-20160816; b=zljtKEEky+OaPlmRmUJREToepjORS1L5Wm6cAKUPUeI70ldD04YUT7aWBJp0eJF4Ws hz3n/+MAHGzWa6eveap+SuIaXsEWhacNexKW6Df6EQg4QF1mL1A1+FhaKYSVWwTK+3wZ i8xnP/WOApOadMSGIzUYoQTgkHeSrT6ng3BOey55UJhuifgo1Vn0rKaWaUs07Hh/JK20 J/OXCOEbJ34ctLrNiEBzgTl6t2Ia0oEOwJUv4YLeq83oPm1c7J7DpxDSrkaZAwRG+iyk OV9/tNTHBwg7554q8zrLbe92eD7cCyo1htGNS0u1VHe7c7cYeD/h6AAPwD/dfLaAZxuc Ccmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=l0PkfRwJ/0yDpMs8KGLUGTF1umlf+xIjxFqOT0wFV1s=; b=sXFDKDmT9UumA9D9q1aCNznarfFasRGO3l8OVaRCJDYd9GDuB+E5i2EfkrMW2BtuzV 6w3ICJ3QnLJ70NuEcv8tKf9sZdSx0QDvg5Nbz/SiL4vDJcW3c+wc7xz5YQq87H5Penwi q28fKczHcIklD/e1Ue/v0XCAJX1XHzsHBn/nWWsplMSxQ2alSs9dI1s1i8mDgEFuHM9m gaTzDaWUtCpOhJqzm49YcdT0XV8Cto6174zBnxytG6J8LxPgLnt23MLThedPWM/0o4YN 7sirmiCU3B8DbzU5pXG9wBmTbIpzk4DGOpltw0MTYtIHhPU+XybjP4JkqluDuesX13Xd F4Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j8-v6si7277800pgp.548.2018.07.29.05.44.13; Sun, 29 Jul 2018 05:44:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbeG2ONp (ORCPT + 99 others); Sun, 29 Jul 2018 10:13:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33700 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbeG2ONp (ORCPT ); Sun, 29 Jul 2018 10:13:45 -0400 Received: from localhost (D57D388D.static.ziggozakelijk.nl [213.125.56.141]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6DB30898; Sun, 29 Jul 2018 12:43:23 +0000 (UTC) Date: Sun, 29 Jul 2018 14:43:20 +0200 From: Greg Kroah-Hartman To: Georgios Tsotsos Cc: devel@driverdev.osuosl.org, James Hogan , linux-kernel@vger.kernel.org, Aaro Koskinen Subject: Re: [PATCH v3 1/1] Staging: octeon-usb: Breaks down cvmx_usb_poll_channel(). Message-ID: <20180729124320.GA27275@kroah.com> References: <3b90173dc3a8ce12ef7f4896f05673140ac3b4d7.camel@perches.com> <81f71a7c1997e53ec97f2b90ae562ff361a46f42.1532864059.git.tsotsos@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <81f71a7c1997e53ec97f2b90ae562ff361a46f42.1532864059.git.tsotsos@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 29, 2018 at 02:41:53PM +0300, Georgios Tsotsos wrote: > In order to make this function more clear a new function created that controls > channels halt on no DMA mode. > > Signed-off-by: Georgios Tsotsos > --- > drivers/staging/octeon-usb/octeon-hcd.c | 81 +++++++++++++++++++++------------ > 1 file changed, 53 insertions(+), 28 deletions(-) > > diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c > index 8a7bdf1a9fe6..3f44ac260eff 100644 > --- a/drivers/staging/octeon-usb/octeon-hcd.c > +++ b/drivers/staging/octeon-usb/octeon-hcd.c > @@ -2593,7 +2593,51 @@ static void cvmx_usb_transfer_isoc(struct octeon_hcd *usb, > cvmx_usb_complete(usb, pipe, transaction, CVMX_USB_STATUS_OK); > } > } > +/** Blank line between functions please. Also, as this is not a global function, no need for kerneldoc formatting, but you did it already, so no big deal. > + * Handles channels halt in non DMA mode > + * @hcchar_chena: > + * @hcint_xfercompl: > + * @usb: USB device > + * @channel: Channel to poll > + * > + * In non DMA mode the channels don't halt themselves. We need > + * to manually disable channels that are left running > + * > + * Returns: -1 on halt > + */ > +static int cvmx_usb_dma_halt(u32 hcchar_chena, u32 hcint_xfercompl, > + struct octeon_hcd *usb, int channel) > +{ > + struct usb_hcd *hcd = octeon_to_hcd(usb); > + struct device *dev = hcd->self.controller; > > + if (hcchar_chena) { > + union cvmx_usbcx_hcintmskx hcintmsk; > + union cvmx_usbcx_hccharx usbc_hcchar; > + /* Disable all interrupts except CHHLTD */ > + hcintmsk.u32 = 0; > + hcintmsk.s.chhltdmsk = 1; > + cvmx_usb_write_csr32(usb, > + CVMX_USBCX_HCINTMSKX(channel, usb->index), > + hcintmsk.u32); > + usbc_hcchar.s.chdis = 1; > + cvmx_usb_write_csr32(usb, > + CVMX_USBCX_HCCHARX(channel, usb->index), > + usbc_hcchar.u32); > + return -1; Do not make up error values, return -EINVAL or something like that (what ever the real error here is.) > + } else if (hcint_xfercompl) { > + /* > + * Successful IN/OUT with transfer complete. > + * Channel halt isn't needed. > + */ > + } else { > + dev_err(dev, "USB%d: Channel %d interrupt without halt\n", > + usb->index, channel); > + return -1; Same here. thanks, greg k-h