Priyanka Gupta | 3 Jan 2011 06:07
Picon

Re: Adding runtime PM support to sata_mv driver

Hi,

Thanks for your replies. I am ccing the ide list now (and re-pasting
the ide patch).

Let me try and elaborate on what I am trying to achieve: I would like
to add a way to move the marvell sata controller to D3hot to save some
power. For my short term use case, I am just interested in turning off
the controllers which don't have any disks attached to them. For this,
I guess I don't really need to do much as the pci pm subsystem takes
care of suspending the controller. However, my goal is to keep the
patch generic, i.e. be able to turn off any marvell controller. So, if
there are disks attached to it, then I think that it should spin down
all the disks and power off the controller.

I would think that some userspace algorithm would decide if the
sata_mv controller should be moved into auto mode (i.e runtime power
managed). This might be done when there are no disks attached or the
system doesn't expect to use the disks behind the controller. If there
is intermittent disk usage, then the user space would not move it into
auto and keep the state as ON.

I am using the ata_pci_device_suspend for the runtime _suspend method
also because AFAICT it does exactly what I am trying to achieve. This
will try and do error handling (scsi_error_handler) which tries to
resume a device if its in the suspending state causing both threads to
be stuck.

Rafael, you mentioned in one of your emails that the patch doesn't
seem to be doing anything useful. How else do I suspend the sata_mv
(Continue reading)

Roedel, Joerg | 3 Jan 2011 12:29
Picon
Favicon

Re: IOMMU and DMA mode of pata_jmicron

On Tue, Dec 28, 2010 at 08:00:12PM -0500, Jeff Garzik wrote:
> (CC'd linux-ide, Joerg)
> 
> On 12/28/2010 06:43 PM, Steffen Moser wrote:
> > I've encountered a problem with my AMD 890FX based system
> > and linux-2.6.35.10 (x86_64 platform).
> >
> > After activating the option "IOMMU" in the mainboard's BIOS
> > setup, the onboard P-ATA controller "JMicron Technology Corp.
> > JMB361 AHCI/IDE (rev 02)" puts itself back in the PIO mode.
> > When loading the module, the kernel reports:
> >
> >    pata_jmicron 0000:06:00.1: BMDMA: failed to set dma mask, \
> >                               falling back to PIO
> [...]
> > As soon as I deactivate IOMMU in BIOS setup, the P-ATA channel
> > runs in the DMA mode again. The S-ATA controllers don't seem
> > to be affected.
> >
> > My question is: Is this a known behavior? Are there any
> > things I have to consider when activating IOMMU (which seems
> > to be AMD-Vi) on an 890FX based system? Is it a problem of
> > the chipset and/or the controller or is it related to a
> > problem in the libata area?
> >
> > Some information about the affected system:
> >
> >  - Mainboard:    ASUS M4A89TD Pro/USB3
> >  - BIOS version: 1101 (most recent version)
> >  - Chipset:      AMD 890FX
(Continue reading)

Tejun Heo | 3 Jan 2011 14:59

Re: PowerPC MPC5200B ATA MWDMA regression

On Mon, Jan 03, 2011 at 02:45:47PM +0100, Roman Fietze wrote:
> Hello,
> 
> When merging more recent kernel versions, tried that using v2.6.35 and
> v2.6.36, into our tree (branched at v2.6.34), I detected, that MWDMA2
> on the HW listed in the subject does no longer work.
> 
> So I bisected that using the original, standard kernel tree using a
> minimum config using
> 
>    git bisect start v2.6.35 v2.6.34
> 
> The final result is:
> 
> 360ff7833098e944e5003618b03894251e937802 is the first bad commit
> commit 360ff7833098e944e5003618b03894251e937802
> Author: Tejun Heo <tj <at> kernel.org>
> Date:   Mon May 10 21:41:42 2010 +0200
> 
>     libata-sff: separate out BMDMA qc_issue
> 
> ...
> 
> 
> I double checked the failure with the latest torvalds/master as well
> (b518a64983cbf2ff31), still the same issue.
> 
> The HW is an own board very close to the original Freescale
> Lite5200/Lite5200B. The relevant part of the device tree source file
> contains "mwdma-mode = <2>;" inside the ata section.
(Continue reading)

Sergei Shtylyov | 3 Jan 2011 15:29

Re: PowerPC MPC5200B ATA MWDMA regression

Hello.

On 03-01-2011 16:59, Tejun Heo wrote:

>> When merging more recent kernel versions, tried that using v2.6.35 and
>> v2.6.36, into our tree (branched at v2.6.34), I detected, that MWDMA2
>> on the HW listed in the subject does no longer work.

>> So I bisected that using the original, standard kernel tree using a
>> minimum config using

>>     git bisect start v2.6.35 v2.6.34

>> The final result is:

>> 360ff7833098e944e5003618b03894251e937802 is the first bad commit
>> commit 360ff7833098e944e5003618b03894251e937802
>> Author: Tejun Heo<tj <at> kernel.org>
>> Date:   Mon May 10 21:41:42 2010 +0200

>>      libata-sff: separate out BMDMA qc_issue

>> ...

>> I double checked the failure with the latest torvalds/master as well
>> (b518a64983cbf2ff31), still the same issue.

>> The HW is an own board very close to the original Freescale
>> Lite5200/Lite5200B. The relevant part of the device tree source file
>> contains "mwdma-mode =<2>;" inside the ata section.
(Continue reading)

Tejun Heo | 3 Jan 2011 15:33

Re: PowerPC MPC5200B ATA MWDMA regression

On Mon, Jan 3, 2011 at 3:29 PM, Sergei Shtylyov <sshtylyov <at> mvista.com> wrote:
>> The commit you bisected to contains all those conversions too.  Take a
>> look at a similar driver and look at how it has been converted
>> recently.  Even better, just send the driver upstream.  :-)
>
>   It's already there...

Ouch, did I forget to convert it or was it a merge timing problem?
Anyways, sorry about that.  Please go ahead and fix it. :-)

--

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Roman Fietze | 3 Jan 2011 15:34
Picon
Favicon

Re: PowerPC MPC5200B ATA MWDMA regression

Hallo Tejun,

On Monday, 03.January.2011 14:59:29 Tejun Heo wrote:

> Which driver is it?

drivers/ata/pata_mpc52xx.c from the standard tree, 100% unchanged. As
I said, for the bisect I was using the original, unchanged
torvalds/master tree from git.kernel.org.

> You probably now want to use ata_bmdma_qc_issue() ...

I'm sorry, but if I would know about the details, and would know more
about ATA I would have tried to patch pata_mpc52xx.c by myself.

>  Even better, just send the driver upstream.

It has been there for a long while. You even patched it last summer.

Roman

--

-- 
Roman Fietze              Telemotive AG Buero Muehlhausen
Breitwiesen                             73347 Muehlhausen
Tel.: +49(0)7335/18493-45        http://www.telemotive.de
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

(Continue reading)

Tejun Heo | 3 Jan 2011 15:39

Re: Adding runtime PM support to sata_mv driver

Hello,

On Sun, Jan 02, 2011 at 11:07:43PM -0600, Priyanka Gupta wrote:
> Let me try and elaborate on what I am trying to achieve: I would like
> to add a way to move the marvell sata controller to D3hot to save some
> power.

Oh I see.  You wanna put the controller into sleep.  You'll have to
implement EH actions for it and invoke EH to do it.  The problem is
that for it to work in generic manner, the operations need to be
synchronized with other accesses to the hardware and going through EH
is the easiest way to achieve that.  Something like the following
would work.

On runtime suspend

* Tell EH to kick in and suspend the controller (and wait (or not)).

* EH kicks in.  Mark the port inactive so that further commands
  processing won't happen (it would probably be nice if this is
  something the PM framework can guarantee but I don't think it's done
  that way, is it?)

* EH skips all other EH actions and put the controller in sleep.

On runtime resume

* Tell EH to kick in and wake up the controller.

* EH kicks in.  Powers up the controller and revalidates all the
(Continue reading)

Alan Stern | 3 Jan 2011 16:15
Picon
Favicon

Re: Adding runtime PM support to sata_mv driver

On Mon, 3 Jan 2011, Tejun Heo wrote:

> Hello,
> 
> On Sun, Jan 02, 2011 at 11:07:43PM -0600, Priyanka Gupta wrote:
> > Let me try and elaborate on what I am trying to achieve: I would like
> > to add a way to move the marvell sata controller to D3hot to save some
> > power.
> 
> Oh I see.  You wanna put the controller into sleep.  You'll have to
> implement EH actions for it and invoke EH to do it.  The problem is
> that for it to work in generic manner, the operations need to be
> synchronized with other accesses to the hardware and going through EH
> is the easiest way to achieve that.  Something like the following
> would work.

Are you talking about the usual SCSI error handler or something else 
specific to ATA drivers?

Runtime suspend should not occur unless all the child devices (i.e.,
the attached drives) are already suspended.  This means it is not
necessary to synchronize any operations, since there shouldn't be any
other accesses to the hardware going on.  Therefore there is no need to
use the error handler.

> On runtime suspend
> 
> * Tell EH to kick in and suspend the controller (and wait (or not)).
> 
> * EH kicks in.  Mark the port inactive so that further commands
(Continue reading)

Sergei Shtylyov | 3 Jan 2011 16:27

Re: PowerPC MPC5200B ATA MWDMA regression

Hello.

On 03-01-2011 17:33, Tejun Heo wrote:

>>> The commit you bisected to contains all those conversions too.  Take a
>>> look at a similar driver and look at how it has been converted
>>> recently.  Even better, just send the driver upstream.  :-)

>>    It's already there...

> Ouch, did I forget to convert

    It probably wasn't obvious as this driver had lived in non-BMDMA section 
of Kconfig before the recent patch:

http://marc.info/?l=linux-ide&m=129303304605907

> it or was it a merge timing problem?
> Anyways, sorry about that.  Please go ahead and fix it. :-)

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Tejun Heo | 3 Jan 2011 16:31

Re: Adding runtime PM support to sata_mv driver

Hello, Alan.

On Mon, Jan 03, 2011 at 10:15:40AM -0500, Alan Stern wrote:
> > Oh I see.  You wanna put the controller into sleep.  You'll have to
> > implement EH actions for it and invoke EH to do it.  The problem is
> > that for it to work in generic manner, the operations need to be
> > synchronized with other accesses to the hardware and going through EH
> > is the easiest way to achieve that.  Something like the following
> > would work.
> 
> Are you talking about the usual SCSI error handler or something else 
> specific to ATA drivers?

I'm talking specifically about libata EH.

> Runtime suspend should not occur unless all the child devices (i.e.,
> the attached drives) are already suspended.  This means it is not
> necessary to synchronize any operations, since there shouldn't be any
> other accesses to the hardware going on.  Therefore there is no need to
> use the error handler.

Well, it's not that simple I'm afraid.  EH actions are asynchronous.
Even if all the downstream devices are suspended, PHY events can
happen any time and EH could be active.  Hmmm... a delta but it would
make more sense to put only the controller into hot sleep while
leaving the disk alone for rotating devices.

Also, on resume, as the controller was out, libata needs to do full
revalidation & reconfiguration.  There's no way to avoid EH.

(Continue reading)


Gmane