From: "Samuel Iglesias Gonsálvez" <siglesias@igalia.com>
To: Jens Taprogge <jens.taprogge@taprogge.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
industrypack-devel@lists.sourceforge.net
Subject: Re: [PATCH 08/20] Staging: ipack: Switch to 8MHz operation before reading ID.
Date: Tue, 11 Sep 2012 16:39:37 +0200 [thread overview]
Message-ID: <1347374377.4539.115.camel@fourier.local.igalia.com> (raw)
In-Reply-To: <20120911113919.GA7174@endeavour.taprogge.org>
[-- Attachment #1: Type: text/plain, Size: 2980 bytes --]
On Tue, 2012-09-11 at 13:39 +0200, Jens Taprogge wrote:
> On Tue, Sep 11, 2012 at 01:31:06PM +0200, Samuel Iglesias Gonsálvez wrote:
> > On Tue, 2012-09-11 at 11:48 +0300, Dan Carpenter wrote:
> > > On Mon, Sep 10, 2012 at 10:51:46AM +0200, Samuel Iglesias Gonsálvez wrote:
> > > > From: Jens Taprogge <jens.taprogge@taprogge.org>
> > > >
> > > > Reading the ID space at 8 MHz is always supported. Most carriers will
> > > > boot up in 8MHz mode. Still, play it safe and ensure we are operating at
> > > > 8Mhz.
> > > >
> > > > Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
> > > > Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
> > > > ---
> > > > drivers/staging/ipack/ipack.c | 11 ++++++++---
> > > > 1 file changed, 8 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/ipack/ipack.c b/drivers/staging/ipack/ipack.c
> > > > index 4f3c945..95f56b8 100644
> > > > --- a/drivers/staging/ipack/ipack.c
> > > > +++ b/drivers/staging/ipack/ipack.c
> > > > @@ -376,6 +376,9 @@ struct ipack_device *ipack_device_register(struct ipack_bus_device *bus,
> > > > dev_set_name(&dev->dev,
> > > > "ipack-dev.%u.%u", dev->bus_nr, dev->slot);
> > > >
> > > > + if (bus->ops->set_clockrate(dev, 8))
> > > > + dev_warn(&dev->dev, "failed to switch to 8 MHz operation for reading of device ID.\n");
> > > > +
> > > > ret = ipack_device_read_id(dev);
> > > > if (ret < 0) {
> > > > dev_err(&dev->dev, "error reading device id section.\n");
> > > > @@ -384,9 +387,11 @@ struct ipack_device *ipack_device_register(struct ipack_bus_device *bus,
> > > > }
> > > >
> > > > /* if the device supports 32 MHz operation, use it. */
> > > > - ret = bus->ops->set_clockrate(dev, dev->speed_32mhz ? 32 : 8);
> > > > - if (ret < 0)
> > > > - dev_err(&dev->dev, "failed to switch to 32 MHz operation.\n");
> > > > + if (dev->speed_32mhz) {
> > > > + ret = bus->ops->set_clockrate(dev, 32);
> > > > + if (ret < 0)
> > > > + dev_err(&dev->dev, "failed to switch to 32 MHz operation.\n");
> > > > + }
> > >
> > > Ah. Well done. That's what I suggested earlier. I think you
> > > should get rid of the ->speed_8mhz all together.
> >
> > I will do it in a follow-up patch. The rest of suggestions have been
> > integrated in the patches. I will submit the patches very soon.
>
> I have not seen any IPack V2 device yet. But since the ID space
> provides the 8MHz flag, it might be useful. On the other hand, we can
> still readd it when we see it.
>
If we have the flag, we should use it in some point. Not only save it in
the variable speed_8mhz and don't use it at all.
> When you remove the flag, you can perhaps leave a comment in the code so
> that it is easy to re-enable.
>
OK. I will send a patch in Industry Pack mailing list and we can discuss
there if this is a good solution or not before sending to staging ML.
Thanks,
Sam
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2012-09-11 14:38 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 8:51 [PATCH 01/20] Staging: ipack/bridges/tpci200: Put the TPCI200 control registers into a struct Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 02/20] Staging: ipack: Provide several carrier callbacks Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 03/20] Staging: ipack/bridges/tpci200: provide new callbacks to tpci200 Samuel Iglesias Gonsálvez
2012-09-11 8:47 ` Dan Carpenter
2012-09-12 9:28 ` Jens Taprogge
2012-09-12 11:13 ` Dan Carpenter
2012-09-12 11:21 ` Samuel Iglesias Gonsálvez
2012-09-12 11:59 ` Dan Carpenter
2012-09-12 12:28 ` Jens Taprogge
2012-09-12 12:47 ` Samuel Iglesias Gonsálvez
2012-09-12 11:58 ` Jens Taprogge
2012-09-10 8:51 ` [PATCH 04/20] Staging: ipack: Obtain supported speeds from ID ROM Samuel Iglesias Gonsálvez
2012-09-11 8:47 ` Dan Carpenter
2012-09-10 8:51 ` [PATCH 05/20] Staging: ipack: Choose the optimum bus speed by default Samuel Iglesias Gonsálvez
2012-09-11 8:47 ` Dan Carpenter
2012-09-10 8:51 ` [PATCH 06/20] Staging: ipack: remove field driver from struct ipack_device Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 07/20] Staging: ipack/bridges/tpci200: remove struct list_head Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 08/20] Staging: ipack: Switch to 8MHz operation before reading ID Samuel Iglesias Gonsálvez
2012-09-11 8:48 ` Dan Carpenter
2012-09-11 11:31 ` Samuel Iglesias Gonsálvez
2012-09-11 11:39 ` Jens Taprogge
2012-09-11 14:39 ` Samuel Iglesias Gonsálvez [this message]
2012-09-11 15:33 ` Dan Carpenter
2012-09-10 8:51 ` [PATCH 09/20] Staging: ipack: reset previous timeouts during device registration Samuel Iglesias Gonsálvez
2012-09-11 8:48 ` Dan Carpenter
2012-09-10 8:51 ` [PATCH 10/20] Staging: ipack: check the device ID space CRC Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 11/20] Staging: ipack/bridges/tpci200: reorder the iounmap and pci_release_region Samuel Iglesias Gonsálvez
2012-09-11 8:49 ` Dan Carpenter
2012-09-10 8:51 ` [PATCH 12/20] Staging: ipack/bridges/tpci200: increment the reference counter of the pci_dev Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 13/20] Staging: ipack/bridges/tpci200: fix the uninstall the ipack device Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 14/20] Staging: ipack/devices/ipoctal: change exiting procedure Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 15/20] Staging: ipack/devices/ipoctal: free the IRQ Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 16/20] Staging: ipack: unregister devices when uninstall the carrier device Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 17/20] Staging: ipack/bridges/tpci200: delete ipack_device_unregister calls when exiting Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 18/20] Staging: ipack/bridges/tpci200: remove tpci200_slot_unregister Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 19/20] Staging: ipack: delete .remove_device() callback Samuel Iglesias Gonsálvez
2012-09-10 8:51 ` [PATCH 20/20] Staging: ipack/bridges/tpci200: Store the irq holder in slot_irq Samuel Iglesias Gonsálvez
2012-09-11 8:51 ` Dan Carpenter
2012-09-11 9:05 ` Samuel Iglesias Gonsálvez
2012-09-11 9:57 ` Dan Carpenter
2012-09-10 18:29 ` [PATCH 01/20] Staging: ipack/bridges/tpci200: Put the TPCI200 control registers into a struct Greg Kroah-Hartman
2012-09-11 7:01 ` Samuel Iglesias Gonsálvez
2012-09-11 7:42 ` Miguel Gómez
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=1347374377.4539.115.camel@fourier.local.igalia.com \
--to=siglesias@igalia.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=industrypack-devel@lists.sourceforge.net \
--cc=jens.taprogge@taprogge.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®