linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Felipe Balbi <balbi@ti.com>,
	Linux USB Mailing List <linux-usb@vger.kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Linux OMAP Mailing List <linux-omap@vger.kernel.org>
Subject: Re: [PATCH] usb: host: ehci: allow ehci_* symbols to be unused
Date: Tue, 14 Feb 2012 18:01:17 +0200	[thread overview]
Message-ID: <20120214160114.GA11841@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1202140959320.1544-100000@iolanthe.rowland.org>

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

On Tue, Feb 14, 2012 at 10:06:47AM -0500, Alan Stern wrote:
> On Tue, 14 Feb 2012, Felipe Balbi wrote:
> 
> > not all platforms will use all of those ehci_*
> > symbols on their hc_driver structure. Sometimes
> > we might need to provide a modified version of
> > a certain method or not provide it at all, as is
> > the case with OMAPs which don't support port handoff
> > feature.
> > 
> > Whenever we compile a kernel for an OMAP board with
> > EHCI enabled, we get compile warnings:
> > 
> > drivers/usb/host/ehci-hub.c:1079: warning: 'ehci_relinquish_port' \
> > 	defined but not used
> > drivers/usb/host/ehci-hub.c:1088: warning: 'ehci_port_handed_over' \
> > 	defined but not used
> > 
> > In order to cleanup those warnings, we're adding
> > __maybe_unused annotation to those functions. We're
> > also trying to cope with other platforms which might
> > have similar issues with different methods by adding
> > the same annotation to all ehci_* functions.
> > 
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> > 
> > Alan, what do you think about this patch ? It fixes our warnings
> > and tries to cope with other possible such cases.
> 
> Some of this makes sense: ehci_port_change, ehci_relinquish_port, 
> and ehci_port_handed_over are fine.
> 
> The others are questionable.  What reason could there be for not 
> implementing ehci_bus_suspend and ehci_bus_resume?  Neither of those 
> should involve much platform-specific work, if any.

you never know what kind of silicon erratas might come up, right ? :-)

> ehci_hub_status_data, ehci_hub_descriptor, and ehci_hub_control are 
> even more puzzling.  These are things that _have_ to be implemented for 
> the driver to work at all.  Platform code shouldn't replace them; it 
> most it should call them as subroutines and override the results when 
> necessary.

There's no doubt it needs to be implemented, but the fact is that in
some situations we might need to implement it differently because of
whatever reason.

See for example that I have a pending workaround to implement for
OMAP3 EHCI where we need to reparent a clock before handling
SetFeature(port_suspend) so I would need to reimplement
echi_hub_control() in order not to expose that detail to core ehci.

Because clock reparenting is something so ARCH-specific it makes no
sense to come up with a "quirk" flag for that.

Granted, the way I had envisioned, I would reimplement the particular
request that needs special handling and call the generic
ehci_hub_control() otherwise, but still. Like I said, you never know
what kind of erratas could pop up.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-02-14 16:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14  9:14 [PATCH] usb: host: ehci: allow ehci_* symbols to be unused Felipe Balbi
2012-02-14 15:06 ` Alan Stern
2012-02-14 16:01   ` Felipe Balbi [this message]
2012-02-14 20:11     ` Alan Stern
     [not found]       ` <Pine.LNX.4.44L0.1202141505400.1544-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2012-02-15  7:34         ` [PATCH v2] " Felipe Balbi
2012-02-15 15:48           ` Alan Stern
     [not found]           ` <1329291266-15798-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2012-02-15 15:57             ` Govindraj
     [not found]               ` <CAAL8m4z72at5heepktM1ieQHFKkApzVY9OzO-hte-U=AZfA=nw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-15 16:03                 ` Felipe Balbi

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=20120214160114.GA11841@legolas.emea.dhcp.ti.com \
    --to=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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).