All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Christian Gromm <christian.gromm@microchip.com>
Cc: driverdev-devel@linuxdriverproject.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH 2/3] staging: most: hdm-usb: do h/w specific synchronization at configuration time
Date: Thu, 27 Oct 2016 15:06:59 +0200	[thread overview]
Message-ID: <20161027130659.GA10816@kroah.com> (raw)
In-Reply-To: <20161027130047.350c6ae7@muaddib>

On Thu, Oct 27, 2016 at 01:00:47PM +0200, Christian Gromm wrote:
> On Thu, 27 Oct 2016 12:00:28 +0300
> Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 
> > On Thu, Oct 27, 2016 at 10:57:07AM +0200, Christian Gromm wrote:
> > > On Wed, 26 Oct 2016 17:22:50 +0300
> > > Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > > 
> > > > On Tue, Oct 25, 2016 at 05:44:20PM +0200, Christian Gromm wrote:
> > > > > From: Andrey Shvetsov <andrey.shvetsov@k2l.de>
> > > > > 
> > > > > This patch puts the synchronization procedure trigger for asynchronous
> > > > > channels into the function hdm_configure_channel. Likewise, it removes
> > > > > triggering of hardware specific synchronization for other channel types
> > > > > from the probe function as it is not required.
> > > > > 
> > > > > Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
> > > > > Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
> > > > > ---
> > > > >  drivers/staging/most/hdm-usb/hdm_usb.c | 17 +++++++++--------
> > > > >  1 file changed, 9 insertions(+), 8 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
> > > > > index 1a630e1..db11930 100644
> > > > > --- a/drivers/staging/most/hdm-usb/hdm_usb.c
> > > > > +++ b/drivers/staging/most/hdm-usb/hdm_usb.c
> > > > > @@ -695,6 +695,15 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
> > > > >  			  - conf->buffer_size;
> > > > >  exit:
> > > > >  	mdev->conf[channel] = *conf;
> > > > > +	if (conf->data_type == MOST_CH_ASYNC) {
> > > > > +		u16 ep = mdev->ep_address[channel];
> > > > > +		int err = drci_wr_reg(mdev->usb_device,
> > > > > +				      DRCI_REG_BASE + DRCI_COMMAND + ep * 16,
> > > > > +				      1);
> > > > > +
> > > > > +		if (err < 0)
> > > > > +			dev_warn(dev, "sync for ep%02x failed", ep);
> > > > > +	}
> > > > >  	return 0;
> > > > 
> > > > This code is weird, because we goto exit without checking the
> > > > frame_size.  It looks like it doesn't matter much but it's sort of
> > > > puzzling what's going on.  There weren't any comments to explain it.
> > > > 
> > > 
> > > The frame size is only needed if we are dealing with synchronous and
> > > (in some cases) isochronous data. So you're right, the variable
> > > frame_size is _not_ needed in case we be jumping to the 'exit' label
> > > and hence, not being checked.
> > > 
> > > Haven't had the feeling that this is worth a comment. It isn't easy
> > > to decide what needs a comment and what does not anyway. Then I would
> > > probably also have to explain why we jump to 'exit' if we have
> > > isochronous data and a packet_per_transaction value unequal to 0xff.
> > > (I don't expect anyone to understand what this is supposed mean, unless
> > > he is familiar with the network interface controller.)
> > > 
> > > So, let me know if a comment on the frame_size usage can fix the
> > > confusion.
> > 
> > A comment would be nice, yes.
> 
> Fine. It would be cool if this patch set will be accepted and I'll be
> sending in a new patch that adds the desired comment.
> 
> Greg, does this make sense to you?

Yes, that's fine.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2016-10-27 13:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 15:44 [PATCH 0/3] staging: most: fix driver issues Christian Gromm
2016-10-25 15:44 ` [PATCH 1/3] staging: most: aim-networking: keep channels closed if ndo_open fails Christian Gromm
2016-10-25 15:44 ` [PATCH 2/3] staging: most: hdm-usb: do h/w specific synchronization at configuration time Christian Gromm
2016-10-26 14:22   ` Dan Carpenter
2016-10-27  8:57     ` Christian Gromm
2016-10-27  9:00       ` Dan Carpenter
2016-10-27 11:00         ` Christian Gromm
2016-10-27 13:06           ` Greg KH [this message]
2016-10-31 17:33           ` Dan Carpenter
2016-10-25 15:44 ` [PATCH 3/3] staging: most: hdm-usb: introduce synchronization function Christian Gromm

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=20161027130659.GA10816@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=christian.gromm@microchip.com \
    --cc=dan.carpenter@oracle.com \
    --cc=driverdev-devel@linuxdriverproject.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.