Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 574200 Details for
Bug 808743
SATA AHCI hotpluggable port fails to recognize eSATA drive the 2nd time (patch)
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Lin Ming's patch from LKML
libata_disable_runtime_pm_for_hotpluggable_port.txt (text/plain), 3.76 KB, created by
Patrick
on 2012-03-31 12:23:29 UTC
(
hide
)
Description:
Lin Ming's patch from LKML
Filename:
MIME Type:
Creator:
Patrick
Created:
2012-03-31 12:23:29 UTC
Size:
3.76 KB
patch
obsolete
>From 28bf2f0592f231c2caba816428beaffc28873d8e Mon Sep 17 00:00:00 2001 >From: Lin Ming <ming.m.lin@intel.com> >Date: Thu, 23 Feb 2012 10:21:18 +0800 >Subject: [PATCH] libata: disable runtime pm for hotpluggable port > >--- > drivers/ata/ahci.c | 3 +++ > drivers/ata/ahci.h | 3 +++ > drivers/ata/libahci.c | 21 +++++++++++++++++++++ > drivers/ata/libata-transport.c | 6 ++++-- > include/linux/libata.h | 4 +++- > 5 files changed, 34 insertions(+), 3 deletions(-) > >diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c >index d07bf03..02e93ff 100644 >--- a/drivers/ata/ahci.c >+++ b/drivers/ata/ahci.c >@@ -1145,6 +1145,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) > if (hpriv->cap & HOST_CAP_PMP) > pi.flags |= ATA_FLAG_PMP; > >+ if (hpriv->cap & HOST_CAP_SXS) >+ pi.flags |= ATA_FLAG_EXTERNAL; >+ > ahci_set_em_messages(hpriv, &pi); > > if (ahci_broken_system_poweroff(pdev)) { >diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h >index b175000..92f7172 100644 >--- a/drivers/ata/ahci.h >+++ b/drivers/ata/ahci.h >@@ -172,6 +172,9 @@ enum { > PORT_CMD_ALPE = (1 << 26), /* Aggressive Link PM enable */ > PORT_CMD_ATAPI = (1 << 24), /* Device is ATAPI */ > PORT_CMD_FBSCP = (1 << 22), /* FBS Capable Port */ >+ PORT_CMD_ESP = (1 << 21), /* External SATA Port */ >+ PORT_CMD_MPSP = (1 << 19), /* Mechanical Presence Switch Attached to Port */ >+ PORT_CMD_HPCP = (1 << 18), /* Hot Plug Capable Port */ > PORT_CMD_PMP = (1 << 17), /* PMP attached */ > PORT_CMD_LIST_ON = (1 << 15), /* cmd list DMA engine running */ > PORT_CMD_FIS_ON = (1 << 14), /* FIS DMA engine running */ >diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c >index a72bfd0..a0222e9 100644 >--- a/drivers/ata/libahci.c >+++ b/drivers/ata/libahci.c >@@ -1097,6 +1097,24 @@ static void ahci_port_init(struct device *dev, struct ata_port *ap, > writel(1 << port_no, mmio + HOST_IRQ_STAT); > } > >+static bool ahci_port_pluggable(struct ata_port *ap) >+{ >+ void __iomem *port_mmio = ahci_port_base(ap); >+ u32 cmd; >+ >+ cmd = readl(port_mmio + PORT_CMD); >+ printk(KERN_ERR "DEBUG: port %d, PORT_CMD=0x%x\n", ap->port_no, cmd); >+ >+ if ((ap->flags & ATA_FLAG_EXTERNAL) && >+ (cmd & PORT_CMD_ESP)) >+ return true; >+ >+ if (cmd & (PORT_CMD_MPSP | PORT_CMD_HPCP)) >+ return true; >+ >+ return false; >+} >+ > void ahci_init_controller(struct ata_host *host) > { > struct ahci_host_priv *hpriv = host->private_data; >@@ -1112,6 +1130,9 @@ void ahci_init_controller(struct ata_host *host) > if (ata_port_is_dummy(ap)) > continue; > >+ if (ahci_port_pluggable(ap)) >+ ap->flags |= ATA_FLAG_PLUGGABLE; >+ > ahci_port_init(host->dev, ap, i, mmio, port_mmio); > } > >diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c >index 74aaee3..a7166b9 100644 >--- a/drivers/ata/libata-transport.c >+++ b/drivers/ata/libata-transport.c >@@ -292,8 +292,10 @@ int ata_tport_add(struct device *parent, > } > > device_enable_async_suspend(dev); >- pm_runtime_set_active(dev); >- pm_runtime_enable(dev); >+ if (!(ap->flags & ATA_FLAG_PLUGGABLE)) { >+ pm_runtime_set_active(dev); >+ pm_runtime_enable(dev); >+ } > > transport_add_device(dev); > transport_configure_device(dev); >diff --git a/include/linux/libata.h b/include/linux/libata.h >index cafc09a..e8221cf 100644 >--- a/include/linux/libata.h >+++ b/include/linux/libata.h >@@ -207,8 +207,10 @@ enum { > ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity > * led */ > ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ >+ ATA_FLAG_EXTERNAL = (1 << 24), /* controller supports external SATA */ >+ ATA_FLAG_PLUGGABLE = (1 << 25), /* port is hotpluggable */ > >- /* bits 24:31 of ap->flags are reserved for LLD specific flags */ >+ /* bits 26:31 of ap->flags are reserved for LLD specific flags */ > > > /* struct ata_port pflags */ >-- >1.7.9 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 808743
: 574200