From: Maxim Levitsky <maximlevitsky@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Philip Langdale <philipl@overt.org>,
Pierre Ossman <pierre@ossman.eu>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Port ricoh_mmc from driver to pci quirk.
Date: Thu, 26 Nov 2009 01:40:01 +0200 [thread overview]
Message-ID: <1259192401.15916.48.camel@maxim-laptop> (raw)
In-Reply-To: <20091125113501.1f4d42b9.akpm@linux-foundation.org>
On Wed, 2009-11-25 at 11:35 -0800, Andrew Morton wrote:
> On Wed, 25 Nov 2009 08:53:24 -0800
> Philip Langdale <philipl@overt.org> wrote:
>
> > On Wed, 25 Nov 2009 16:58:41 +0200
> > Maxim Levitsky <maximlevitsky@gmail.com> wrote:
> >
> > > >From 5c5e6f5ab1a5a09a430f410cab4b160a5e65501c Mon Sep 17 00:00:00
> > > >2001
> > > From: Maxim Levitsky <maximlevitsky@gmail.com>
> > > Date: Wed, 25 Nov 2009 16:37:46 +0200
> > > Subject: [PATCH] Port ricoh_mmc from driver to pci quirk.
> > > This is much cleaner and correct solution
>
> This patch actually fixes a bug but the changelog forgot to tell us
> this important fact.
>
> > I'm fine with the concept, but when I originally started work on
> > Ricoh support, Pierre specifically didn't want a pci quirk.
> >
> > Pierre wrote:
> > > I'd rather we didn't. The current style of quirks are bad enough,
> > > making them even more vendor or device specific is a bit more than I'm
> > > willing to accept right now (seriously, how hard can it be to follow
> > > the damn spec?).
>
> Can the bug be fixed by other means, within ricoh_mmc.c?
>
> It's a bit sad to add a lump of code to everyone's kernel like this -
> what percentage of those machines actually have a ricoh mmc controller?
You have valid point here.
However let me explain the situation:
We have a device with 5 functions,
One of the functions is propertary MMC contoller that writing driver for
will be a coolosal waste of time, because it can be disabled.
However, when it is disabled, it actually vanishes, and all pci
functions that belong to controller decrease by one.
Example:
07:00.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
07:00.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
07:00.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
07:00.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
07:00.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)
However the correct listing is:
07:00.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
07:00.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
07:00.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
07:00.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)
PCI core can handle hotplug, but it sure can't handle the sudden shift
in function numbers.
Thus the disable step should be done before it enumerates the device, as
my patch does, and unfortunately this can't be module.
Up to now this driver did work, because both functions whose numbers are
affected didn't have a driver, but I am going soon to implement one
driver, and maybe another too.
Of course, I can put that under config condition, that users that are
sure that have no such device could save few hundreds of bytes.
However a distro probably will enable this option.
I also agree that I need to print some notice to user about device being
disabled.
Aside from being almost an 1:1 copy of original driver, this patch was
sort of RFC, so I update it soon.
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2009-11-25 23:40 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-24 0:13 The work of ricoh_mmc isn't detected by pci core Maxim Levitsky
2009-11-24 0:21 ` Philip Langdale
2009-11-25 14:55 ` Maxim Levitsky
2009-11-25 14:58 ` [PATCH] Port ricoh_mmc from driver to pci quirk Maxim Levitsky
2009-11-25 16:53 ` Philip Langdale
2009-11-25 19:35 ` Andrew Morton
2009-11-25 23:40 ` Maxim Levitsky [this message]
2009-11-26 1:30 ` Philip Langdale
2009-11-26 23:51 ` Maxim Levitsky
2009-11-26 23:53 ` [PATCH v2] port ricoh_mmc to be " Maxim Levitsky
2009-11-27 7:55 ` Philip Langdale
2010-01-08 15:24 ` Maxim Levitsky
2010-01-08 15:40 ` Philip Langdale
2010-01-12 23:43 ` Andrew Morton
2010-01-13 1:23 ` Philip Langdale
2010-01-13 6:46 ` Wolfram Sang
2010-01-29 13:37 ` [PATCH v3] port ricoh_mmc to " Maxim Levitsky
2010-01-29 16:06 ` Philip Langdale
2010-01-29 22:10 ` Maxim Levitsky
2010-01-30 2:18 ` Philip Langdale
2010-01-29 16:33 ` Wolfram Sang
2010-01-29 22:13 ` Maxim Levitsky
2010-01-30 21:28 ` [PATCH] Port " Maxim Levitsky
2010-02-01 15:45 ` Maxim Levitsky
2009-11-25 20:30 ` [PATCH] Port ricoh_mmc from driver " Pierre Ossman
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=1259192401.15916.48.camel@maxim-laptop \
--to=maximlevitsky@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=philipl@overt.org \
--cc=pierre@ossman.eu \
/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