libsas, libata: suspend / resume and "reset once"
Subsystems (6)
cover libsas, libata: suspend / resume and "reset once"
Hi Jeff,
Let me know if any of these need reworking, otherwise I believe James is waiting on your ack to take them (well all except patch1) through scsi.git.
--
Dan
Original description:
Set4 of 5 patchsets to update scsi, libsas, and libata in support of the isci driver.
Let libsas hook into the generic suspend resume infrastructure in libata, and provide a common suspend/resume implementation for lldds to reuse.
"Reset once" is not part of the suspend/resume work. But it is relevant to libsas users who need to wait for domain-wide ata error recovery and want to limit the effort for known well-behaved devices.
These have been in -next for the past couple kernel cycles.
---
Artur Wojcik (1):
isci: implement suspend/resume support
Dan Williams (4):
libata: reset once
libata: export ata_port suspend/resume infrastructure for sas
libsas: suspend / resume support
libsas, ipr: cleanup ata_host flags initialization via ata_host_init
Documentation/kernel-parameters.txt | 3 + drivers/ata/libata-core.c | 69 +++++++++++++++++++-------- drivers/ata/libata-eh.c | 2 + drivers/scsi/ipr.c | 3 - drivers/scsi/isci/host.c | 2 - drivers/scsi/isci/host.h | 2 - drivers/scsi/isci/init.c | 58 ++++++++++++++++++++++ drivers/scsi/libsas/sas_ata.c | 91 +++++++++++++++++++++++++++++++++-- drivers/scsi/libsas/sas_discover.c | 69 +++++++++++++++++++++++---- drivers/scsi/libsas/sas_dump.c | 1 drivers/scsi/libsas/sas_event.c | 4 +- drivers/scsi/libsas/sas_init.c | 90 ++++++++++++++++++++++++++++++++++- drivers/scsi/libsas/sas_internal.h | 1 drivers/scsi/libsas/sas_phy.c | 21 ++++++++ drivers/scsi/libsas/sas_port.c | 52 ++++++++++++++++++++ include/linux/libata.h | 15 +++++- include/scsi/libsas.h | 20 ++++++-- include/scsi/sas_ata.h | 10 ++++ 18 files changed, 463 insertions(+), 50 deletions(-)
PATCH RESEND 1/5 libata: reset once
Hotplug testing with libsas currently encounters a 55 second wait for link recovery to give up. In the case where the user trusts the response time of their devices permit the recovery attempts to be limited to one.
--- Documentation/kernel-parameters.txt | 3 +++ drivers/ata/libata-core.c | 1 + drivers/ata/libata-eh.c | 2 ++ include/linux/libata.h | 1 + 4 files changed, 7 insertions(+)
Documentation/kernel-parameters.txt +3 -0
@@ -1351,6 +1351,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted. * nohrst, nosrst, norst: suppress hard, soft and both resets. + * rstonce: only attempt one reset during + hot-unplug link recovery + * dump_id: dump IDENTIFY data. If there are multiple matching configurations changing
drivers/ata/libata-core.c +1 -0
@@ -6388,6 +6388,7 @@ static int __init ata_parse_force_one(char **cur, { "nohrst", .lflags = ATA_LFLAG_NO_HRST }, { "nosrst", .lflags = ATA_LFLAG_NO_SRST }, { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, + { "rstonce", .lflags = ATA_LFLAG_RST_ONCE }, };char *start = *cur, *p = *cur;char *id, *val, *endp;
drivers/ata/libata-eh.c +2 -0
@@ -2623,6 +2623,8 @@ int ata_eh_reset(struct ata_link *link, int classify,*/ while (ata_eh_reset_timeouts[max_tries] !=ULONG_MAX ) max_tries++; +if (link->flags &ATA_LFLAG_RST_ONCE ) + max_tries =1 ;if (link->flags &ATA_LFLAG_NO_HRST ) hardreset =NULL ;if (link->flags &ATA_LFLAG_NO_SRST )
include/linux/libata.h +1 -0
@@ -182,6 +182,7 @@ enum {ATA_LFLAG_DISABLED = (1 <<6 ),/* link is disabled */ ATA_LFLAG_SW_ACTIVITY = (1 <<7 ),/* keep activity stats */ ATA_LFLAG_NO_LPM = (1 <<8 ),/* disable LPM on this link */ +ATA_LFLAG_RST_ONCE = (1 <<9 ),/* limit recovery to one reset */ /* struct ata_port flags */ ATA_FLAG_SLAVE_POSS = (1 << 0), /* host supports slave dev */
Re: [resend PATCH 1/5] libata: reset once
Quoted 6 lines · Dan Williams
Hotplug testing with libsas currently encounters a 55 second wait for link recovery to give up. In the case where the user trusts the response time of their devices permit the recovery attempts to be limited to one.
Signed-off-by Dan Williams <[email protected]>
PATCH RESEND 2/5 libata: export ata_port suspend/resume infrastructure for sas
In reply to Dan WilliamsReuse ata_port_{suspend|resume}_common for sas. This path is chosen over adding coordination between ata-tranport and sas-transport because libsas wants to revalidate the domain at resume-time at the host level. It can not validate links have resumed properly until libata has had a chance to perform its revalidation, and any sane placing of an ata_port in the sas-transport model would delay it's resumption until after the host.
Export the common portion of port suspend/resume (bypass pm_runtime), and allow sas to perform these operations asynchronously (similar to the libsas async-ata probe implmentation). Async operation is determined by having an external, rather than stack based, location for storing the result of the operation.
--- drivers/ata/libata-core.c | 58 ++++++++++++++++++++++++++++++++++++--------- include/linux/libata.h | 11 +++++++++ 2 files changed, 57 insertions(+), 12 deletions(-)
drivers/ata/libata-core.c +46 -12
@@ -5248,16 +5248,20 @@ bool ata_link_offline(struct ata_link *link)#ifdef CONFIG_PM static int ata_port_request_pm (struct ata_port *ap,pm_message_t mesg,unsigned int action,unsigned int ehi_flags, -int wait) +int *async) {struct ata_link *link;unsigned long flags; -int rc; +int rc =0 ;/* Previous resume operation might still be in * progress. Wait for PM_PENDING to clear. */ if (ap->pflags &ATA_PFLAG_PM_PENDING ) { +if (async) { + *async = -EAGAIN ; +return 0 ; + }ata_port_wait_eh (ap);WARN_ON (ap->pflags &ATA_PFLAG_PM_PENDING ); }
@@ -5266,10 +5270,10 @@ static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg,spin_lock_irqsave (ap->lock, flags); ap->pm_mesg = mesg; -if (wait) { - rc =0 ; +if (async) + ap->pm_result = async; +else ap->pm_result = &rc; - } ap->pflags |=ATA_PFLAG_PM_PENDING ;ata_for_each_link (link, ap,HOST_FIRST ) {
@@ -5282,7 +5286,7 @@ static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg,spin_unlock_irqrestore (ap->lock, flags);/* wait and check result */ -if (wait) { +if (!async) {ata_port_wait_eh (ap);WARN_ON (ap->pflags &ATA_PFLAG_PM_PENDING ); }
@@ -5292,9 +5296,8 @@ static int ata_port_request_pm(struct ata_port *ap, pm_message_t mesg,#define to_ata_port (d) container_of(d, struct ata_port, tdev) -static int ata_port_suspend_common (struct device *dev,pm_message_t mesg) +static int __ata_port_suspend_common (struct ata_port *ap,pm_message_t mesg,int *async) { -struct ata_port *ap =to_ata_port (dev);unsigned int ehi_flags =ATA_EHI_QUIET ;int rc;
@@ -5309,10 +5312,17 @@ static int ata_port_suspend_common(struct device *dev, pm_message_t mesg)if (mesg.event ==PM_EVENT_SUSPEND ) ehi_flags |=ATA_EHI_NO_AUTOPSY |ATA_EHI_NO_RECOVERY ; - rc =ata_port_request_pm (ap, mesg,0 , ehi_flags,1 ); + rc =ata_port_request_pm (ap, mesg,0 , ehi_flags, async);return rc; } +static int ata_port_suspend_common (struct device *dev,pm_message_t mesg) +{ +struct ata_port *ap =to_ata_port (dev); + +return __ata_port_suspend_common (ap, mesg,NULL ); +} +static int ata_port_suspend (struct device *dev) {if (pm_runtime_suspended (dev))
@@ -5337,16 +5347,22 @@ static int ata_port_poweroff(struct device *dev)return ata_port_suspend_common (dev,PMSG_HIBERNATE ); } -static int ata_port_resume_common (struct device *dev) +static int __ata_port_resume_common (struct ata_port *ap,int *async) { -struct ata_port *ap =to_ata_port (dev);int rc; rc =ata_port_request_pm (ap,PMSG_ON ,ATA_EH_RESET , -ATA_EHI_NO_AUTOPSY |ATA_EHI_QUIET ,1 ); +ATA_EHI_NO_AUTOPSY |ATA_EHI_QUIET , async);return rc; } +static int ata_port_resume_common (struct device *dev) +{ +struct ata_port *ap =to_ata_port (dev); + +return __ata_port_resume_common (ap,NULL ); +} +static int ata_port_resume (struct device *dev) {int rc;
@@ -5379,6 +5395,24 @@ static const struct dev_pm_ops ata_port_pm_ops = { .runtime_idle = ata_port_runtime_idle, }; +/* sas ports don't participate in pm runtime management of ata_ports, +* and need to resume ata devices at the domain level, not the per-port +* level. sas suspend/resume is async to allow parallel port recovery +* since sas has multiple ata_port instances per Scsi_Host. +*/ +int ata_sas_port_async_suspend (struct ata_port *ap,int *async) +{ +return __ata_port_suspend_common (ap,PMSG_SUSPEND , async); +} +EXPORT_SYMBOL_GPL (ata_sas_port_async_suspend); + +int ata_sas_port_async_resume (struct ata_port *ap,int *async) +{ +return __ata_port_resume_common (ap, async); +} +EXPORT_SYMBOL_GPL (ata_sas_port_async_resume); + +/** * ata_host_suspend - suspend host * @host: host to suspend
include/linux/libata.h +11 -0
@@ -1016,6 +1016,17 @@ extern bool ata_link_offline(struct ata_link *link);#ifdef CONFIG_PM extern int ata_host_suspend (struct ata_host *host,pm_message_t mesg);extern void ata_host_resume (struct ata_host *host); +extern int ata_sas_port_async_suspend (struct ata_port *ap,int *async); +extern int ata_sas_port_async_resume (struct ata_port *ap,int *async); +#else +static inline int ata_sas_port_async_suspend (struct ata_port *ap,int *async) +{ +return 0 ; +} +static inline int ata_sas_port_async_resume (struct ata_port *ap,int *async) +{ +return 0 ; +}#endif extern int ata_ratelimit (void );extern void ata_msleep (struct ata_port *ap,unsigned int msecs);
Re: [resend PATCH 2/5] libata: export ata_port suspend/resume infrastructure for sas
Quoted 8 lines · Dan Williams
Reuse ata_port_{suspend|resume}_common for sas. This path is chosen over adding coordination between ata-tranport and sas-transport because libsas wants to revalidate the domain at resume-time at the host level. It can not validate links have resumed properly until libata has had a chance to perform its revalidation, and any sane placing of an
ata_portin the sas-transport model would delay it's resumption until after the host.
Quoted 8 lines
Export the common portion of port suspend/resume (bypass
pm_runtime), and allow sas to perform these operations asynchronously (similar to the libsas async-ata probe implmentation). Async operation is determined by having an external, rather than stack based, location for storing the result of the operation.Reviewed-by Jacek Danecki <[email protected]>Signed-off-by Dan Williams <[email protected]>
PATCH RESEND 3/5 libsas: suspend / resume support
In reply to Dan Williamslibsas power management routines to suspend and recover the sas domain based on a model where the lldd is allowed and expected to be "forgetful".
sas_suspend_ha - disable event processing allowing the lldd to take down
links without concern for causing hotplug events. Regardless of whether the lldd actually posts link down messages libsas notifies the lldd that all domain_devices are gone.
sas_prep_resume_ha - on the way back up before the lldd starts link
training clean out any spurious events that were generated on the way down, and re-enable event processing
sas_resume_ha - after the lldd has started and decided that all phys
have posted link-up events this routine is called to let libsas start it's own timeout of any phys that did not resume. After the timeout an lldd can cancel the phy teardown by posting a link-up event.
Storage for ex_change_count (u16) and phy_change_count (u8) are changed to int so they can be set to -1 to indicate 'invalidated'.
--- drivers/scsi/libsas/sas_ata.c | 86 ++++++++++++++++++++++++++++++++++ drivers/scsi/libsas/sas_discover.c | 69 ++++++++++++++++++++++++---- drivers/scsi/libsas/sas_dump.c | 1 drivers/scsi/libsas/sas_event.c | 4 +- drivers/scsi/libsas/sas_init.c | 90 ++++++++++++++++++++++++++++++++++++ drivers/scsi/libsas/sas_internal.h | 1 drivers/scsi/libsas/sas_phy.c | 21 ++++++++ drivers/scsi/libsas/sas_port.c | 52 ++++++++++++++++++++- include/scsi/libsas.h | 20 ++++++-- include/scsi/sas_ata.h | 10 ++++ 10 files changed, 335 insertions(+), 19 deletions(-)
drivers/scsi/libsas/sas_ata.c +86 -0
@@ -700,6 +700,92 @@ void sas_probe_sata(struct asd_sas_port *port)if (ata_dev_disabled (sas_to_ata_dev (dev)))sas_fail_probe (dev, __func__, -ENODEV ); } + +} + +static bool sas_ata_flush_pm_eh (struct asd_sas_port *port,const char *func) +{ +struct domain_device *dev, *n; +bool retry = false; + +list_for_each_entry_safe (dev, n, &port->dev_list, dev_list_node) { +int rc; + +if (!dev_is_sata (dev)) +continue ; + +sas_ata_wait_eh (dev); + rc = dev->sata_dev.pm_result; +if (rc == -EAGAIN ) + retry = true; +else if (rc) { +/* since we don't have a +* ->port_{suspend|resume} routine in our +* ata_port ops, and no entanglements with +* acpi, suspend should just be mechanical trip +* through eh, catch cases where these +* assumptions are invalidated +*/ +WARN_ONCE (1 ,"failed %s %s error: %d\n" , func, +dev_name (&dev->rphy->dev), rc); + } + +/* if libata failed to power manage the device, tear it down */ +if (ata_dev_disabled (sas_to_ata_dev (dev))) +sas_fail_probe (dev, func, -ENODEV ); + } + +return retry; +} + +void sas_suspend_sata (struct asd_sas_port *port) +{ +struct domain_device *dev; + + retry: +mutex_lock (&port->ha->disco_mutex); +list_for_each_entry (dev, &port->dev_list, dev_list_node) { +struct sata_device *sata; + +if (!dev_is_sata (dev)) +continue ; + + sata = &dev->sata_dev; +if (sata->ap->pm_mesg.event ==PM_EVENT_SUSPEND ) +continue ; + + sata->pm_result = -EIO ; +ata_sas_port_async_suspend (sata->ap, &sata->pm_result); + } +mutex_unlock (&port->ha->disco_mutex); + +if (sas_ata_flush_pm_eh (port, __func__)) + goto retry; +} + +void sas_resume_sata (struct asd_sas_port *port) +{ +struct domain_device *dev; + + retry: +mutex_lock (&port->ha->disco_mutex); +list_for_each_entry (dev, &port->dev_list, dev_list_node) { +struct sata_device *sata; + +if (!dev_is_sata (dev)) +continue ; + + sata = &dev->sata_dev; +if (sata->ap->pm_mesg.event ==PM_EVENT_ON ) +continue ; + + sata->pm_result = -EIO ; +ata_sas_port_async_resume (sata->ap, &sata->pm_result); + } +mutex_unlock (&port->ha->disco_mutex); + +if (sas_ata_flush_pm_eh (port, __func__)) + goto retry; }/**
drivers/scsi/libsas/sas_discover.c +59 -10
100 lines not on this page · raw message
drivers/scsi/libsas/sas_dump.c +1 -0
@@ -41,6 +41,7 @@ static const char *sas_phye_str[] = { [1] = "PHYE_OOB_DONE", [2] = "PHYE_OOB_ERROR", [3] = "PHYE_SPINUP_HOLD", + [4] = "PHYE_RESUME_TIMEOUT", };void sas_dprint_porte (int phyid,enum port_event pe)
drivers/scsi/libsas/sas_event.c +2 -2
@@ -134,7 +134,7 @@ static void notify_port_event(struct asd_sas_phy *phy, enum port_event event) &phy->port_events[event].work, ha); } -static void notify_phy_event (struct asd_sas_phy *phy,enum phy_event event) +void sas_notify_phy_event (struct asd_sas_phy *phy,enum phy_event event) {struct sas_ha_struct *ha = phy->ha;
@@ -159,7 +159,7 @@ int sas_init_events(struct sas_ha_struct *sas_ha) sas_ha->notify_ha_event = notify_ha_event; sas_ha->notify_port_event = notify_port_event; - sas_ha->notify_phy_event = notify_phy_event; + sas_ha->notify_phy_event = sas_notify_phy_event;return 0 ; }
drivers/scsi/libsas/sas_init.c +89 -1
109 lines not on this page · raw message
drivers/scsi/libsas/sas_internal.h +1 -0
@@ -89,6 +89,7 @@ int sas_smp_phy_control(struct domain_device *dev, int phy_id, enum phy_func phy_func, struct sas_phy_linkrates *);int sas_smp_get_phy_events (struct sas_phy *phy); +void sas_notify_phy_event (struct asd_sas_phy *phy,enum phy_event event);void sas_device_set_phy (struct domain_device *dev,struct sas_port *port);struct domain_device *sas_find_dev_by_rphy (struct sas_rphy *rphy);struct domain_device *sas_ex_to_ata (struct domain_device *ex_dev,int phy_id);
drivers/scsi/libsas/sas_phy.c +21 -0
@@ -94,6 +94,25 @@ static void sas_phye_spinup_hold(struct work_struct *work) i->dft->lldd_control_phy (phy,PHY_FUNC_RELEASE_SPINUP_HOLD ,NULL ); } +static void sas_phye_resume_timeout (struct work_struct *work) +{ +struct asd_sas_event *ev =to_asd_sas_event (work); +struct asd_sas_phy *phy = ev->phy; + +clear_bit (PHYE_RESUME_TIMEOUT , &phy->phy_events_pending); + +/* phew, lldd got the phy back in the nick of time */ +if (!phy->suspended) { +dev_info (&phy->phy->dev,"resume timeout cancelled\n" ); +return ; + } + + phy->error =0 ; + phy->suspended =0 ; +sas_deform_port (phy,1 ); +} + +/* ---------- Phy class registration ---------- */ int sas_register_phys (struct sas_ha_struct *sas_ha)
@@ -105,6 +124,8 @@ int sas_register_phys(struct sas_ha_struct *sas_ha) [PHYE_OOB_DONE] = sas_phye_oob_done, [PHYE_OOB_ERROR] = sas_phye_oob_error, [PHYE_SPINUP_HOLD] = sas_phye_spinup_hold, + [PHYE_RESUME_TIMEOUT] = sas_phye_resume_timeout, + };static const work_func_t sas_port_event_fns[PORT_NUM_EVENTS ] = {
drivers/scsi/libsas/sas_port.c +51 -1
64 lines not on this page · raw message
include/scsi/libsas.h +15 -5
@@ -79,7 +79,8 @@ enum phy_event {PHYE_OOB_DONE =1 ,PHYE_OOB_ERROR =2 ,PHYE_SPINUP_HOLD =3 ,/* hot plug SATA, no COMWAKE sent */ - PHY_NUM_EVENTS = 4, +PHYE_RESUME_TIMEOUT =4 , + PHY_NUM_EVENTS = 5, }; enum discover_event {
@@ -87,8 +88,10 @@ enum discover_event {DISCE_REVALIDATE_DOMAIN =1 ,DISCE_PORT_GONE =2 ,DISCE_PROBE =3 , -DISCE_DESTRUCT =4 , - DISC_NUM_EVENTS = 5, +DISCE_SUSPEND =4 , +DISCE_RESUME =5 , +DISCE_DESTRUCT =6 , + DISC_NUM_EVENTS = 7, };/* ---------- Expander Devices ---------- */
@@ -128,7 +131,7 @@ struct ex_phy {u8 attached_sas_addr[SAS_ADDR_SIZE ];u8 attached_phy_id; -u8 phy_change_count; +int phy_change_count;enum routing_attribute routing_attr; u8 virtual:1;
@@ -141,7 +144,7 @@ struct ex_phy {struct expander_device {struct list_head children; -u16 ex_change_count; +int ex_change_count;u16 max_route_indexes;u8 num_phys;
@@ -169,6 +172,7 @@ struct sata_device {enum ata_command_set command_set;struct smp_resp rps_resp;/* report_phy_sata_resp */ u8 port_no;/* port number, if this is a PM (Port) */ +int pm_result;struct ata_port *ap;struct ata_host ata_host;
@@ -182,6 +186,7 @@ struct ssp_device {enum {SAS_DEV_GONE , +SAS_DEV_FOUND ,/* device notified to lldd */ SAS_DEV_DESTROY ,SAS_DEV_EH_PENDING ,SAS_DEV_LU_RESET ,
@@ -273,6 +278,7 @@ struct asd_sas_port {enum sas_linkrate linkrate;struct sas_work work; +int suspended;/* public: */ int id;
@@ -321,6 +327,7 @@ struct asd_sas_phy {unsigned long phy_events_pending;int error; +int suspended;struct sas_phy *phy;
@@ -687,6 +694,9 @@ struct sas_domain_function_template {extern int sas_register_ha (struct sas_ha_struct *);extern int sas_unregister_ha (struct sas_ha_struct *); +extern void sas_prep_resume_ha (struct sas_ha_struct *sas_ha); +extern void sas_resume_ha (struct sas_ha_struct *sas_ha); +extern void sas_suspend_ha (struct sas_ha_struct *sas_ha);int sas_set_phy_speed (struct sas_phy *phy,struct sas_phy_linkrates *rates);
include/scsi/sas_ata.h +10 -0
@@ -45,6 +45,8 @@ void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q,void sas_ata_schedule_reset (struct domain_device *dev);void sas_ata_wait_eh (struct domain_device *dev);void sas_probe_sata (struct asd_sas_port *port); +void sas_suspend_sata (struct asd_sas_port *port); +void sas_resume_sata (struct asd_sas_port *port);void sas_ata_end_eh (struct ata_port *ap);#else
@@ -82,6 +84,14 @@ static inline void sas_probe_sata(struct asd_sas_port *port) { } +static inline void sas_suspend_sata (struct asd_sas_port *port) +{ +} + +static inline void sas_resume_sata (struct asd_sas_port *port) +{ +} +static inline int sas_get_ata_info (struct domain_device *dev,struct ex_phy *phy) {return 0 ;
PATCH RESEND 4/5 isci: implement suspend/resume support
In reply to Dan WilliamsFrom: Artur Wojcik <[email protected]>
Provide a "simple-dev-pm-ops" implementation that shuts down the domain and the device on suspend, and resumes the device and the domain on resume. All of the mechanics of restoring domain connectivity are handled by libsas once isci has notified libsas that all links should be back up. libsas is in charge of handling links that did not resume, or resumed out of order.
--- drivers/scsi/isci/host.c | 2 +- drivers/scsi/isci/host.h | 2 +- drivers/scsi/isci/init.c | 58 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 59 insertions(+), 3 deletions(-)
drivers/scsi/isci/host.c +1 -1
@@ -1044,7 +1044,7 @@ static enum sci_status sci_controller_start(struct isci_host *ihost,return SCI_SUCCESS ; } -void isci_host_scan_start (struct Scsi_Host *shost) +void isci_host_start (struct Scsi_Host *shost) {struct isci_host *ihost =SHOST_TO_SAS_HA (shost)->lldd_ha;unsigned long tmo =sci_controller_get_suggested_start_timeout (ihost);
drivers/scsi/isci/host.h +1 -1
@@ -473,7 +473,7 @@ void sci_controller_remote_device_stopped(struct isci_host *ihost,enum sci_status sci_controller_continue_io (struct isci_request *ireq);int isci_host_scan_finished (struct Scsi_Host *,unsigned long ); -void isci_host_scan_start (struct Scsi_Host *); +void isci_host_start (struct Scsi_Host *);u16 isci_alloc_tag (struct isci_host *ihost);enum sci_status isci_free_tag (struct isci_host *ihost,u16 io_tag);void isci_tci_free (struct isci_host *ihost,u16 tci);
drivers/scsi/isci/init.c +57 -1
75 lines not on this page · raw message
PATCH RESEND 5/5 libsas, ipr: cleanup ata_host flags initialization via ata_host_init
In reply to Dan Williamslibsas and ipr pass flags to ata_host_init that are meant for the port.
ata_host flags:
ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ ATA_HOST_STARTED = (1 << 1), /* Host started */ ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */ ATA_HOST_IGNORE_ATA = (1 << 3), /* Ignore ATA devices on this host. */
flags passed by libsas:
ATA_FLAG_SATA = (1 << 1), ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */
The only one that aliases is ATA_HOST_STARTED which is a 'don't care' in the libsas and ipr cases since ata_hosts from these sources are not registered with libata.
--- drivers/ata/libata-core.c | 10 ++-------- drivers/scsi/ipr.c | 3 +-- drivers/scsi/libsas/sas_ata.c | 5 +---- include/linux/libata.h | 3 +-- 4 files changed, 5 insertions(+), 16 deletions(-)
drivers/ata/libata-core.c +2 -8
@@ -5958,24 +5958,18 @@ int ata_host_start(struct ata_host *host) }/** -* ata_sas_host_init - Initialize a host struct +* ata_sas_host_init - Initialize a host struct for sas (ipr, libsas) * @host: host to initialize * @dev: device host is attached to -* @flags: host flags * @ops: port_ops * -* LOCKING: -* PCI/etc. bus probe sem. -* */ -/* KILLME - the only user left is ipr */ void ata_host_init (struct ata_host *host,struct device *dev, -unsigned long flags,struct ata_port_operations *ops) +struct ata_port_operations *ops) {spin_lock_init (&host->lock);mutex_init (&host->eh_mutex); host->dev = dev; - host->flags = flags; host->ops = ops; }
drivers/scsi/ipr.c +1 -2
@@ -8775,8 +8775,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, ioa_cfg = (struct ipr_ioa_cfg *)host->hostdata;memset (ioa_cfg,0 ,sizeof (struct ipr_ioa_cfg )); -ata_host_init (&ioa_cfg->ata_host, &pdev->dev, - sata_port_info.flags, &ipr_sata_ops); +ata_host_init (&ioa_cfg->ata_host, &pdev->dev, &ipr_sata_ops); ioa_cfg->ipr_chip =ipr_get_chip_info (dev_id);
drivers/scsi/libsas/sas_ata.c +1 -4
@@ -580,10 +580,7 @@ int sas_ata_init(struct domain_device *found_dev)struct ata_port *ap;int rc; -ata_host_init (&found_dev->sata_dev.ata_host, - ha->dev, - sata_port_info.flags, - &sas_sata_ops); +ata_host_init (&found_dev->sata_dev.ata_host, ha->dev, &sas_sata_ops); ap =ata_sas_port_alloc (&found_dev->sata_dev.ata_host, &sata_port_info, shost);
include/linux/libata.h +1 -2
@@ -990,8 +990,7 @@ extern int ata_host_activate(struct ata_host *host, int irq, irq_handler_t irq_handler, unsigned long irq_flags, struct scsi_host_template *sht);extern void ata_host_detach (struct ata_host *host); -extern void ata_host_init (struct ata_host *,struct device *, -unsigned long ,struct ata_port_operations *); +extern void ata_host_init (struct ata_host *,struct device *,struct ata_port_operations *);extern int ata_scsi_detect (struct scsi_host_template *sht);extern int ata_scsi_ioctl (struct scsi_device *dev,int cmd,void __user *arg);extern int ata_scsi_queuecmd (struct Scsi_Host *h,struct scsi_cmnd *cmd);
Re: [resend PATCH 5/5] libsas, ipr: cleanup ata_host flags initialization via ata_host_init
Quoted 17 lines · Dan Williams
libsas and ipr pass flags to
ata_host_initthat are meant for the port.
ata_hostflags:ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ ATA_HOST_STARTED = (1 << 1), /* Host started */ ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */ ATA_HOST_IGNORE_ATA = (1 << 3), /* Ignore ATA devices on this host. */flags passed by libsas:
ATA_FLAG_SATA = (1 << 1), ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */The only one that aliases is
ATA_HOST_STARTEDwhich is a 'don't care' in the libsas and ipr cases sinceata_hostsfrom these sources are not registered with libata.
Quoted 8 lines
Cc Brian King <[email protected]>Reported-by Hannes Reinecke <[email protected]>Signed-off-by Dan Williams <[email protected]>--- drivers/ata/libata-core.c | 10 ++-------- drivers/scsi/ipr.c | 3 +-- drivers/scsi/libsas/sas_ata.c | 5 +---- include/linux/libata.h | 3 +--
Re: [resend PATCH 5/5] libsas, ipr: cleanup ata_host flags initialization via ata_host_init
In reply to Dan WilliamsQuoted 17 lines · Dan Williams
libsas and ipr pass flags to
ata_host_initthat are meant for the port.
ata_hostflags:ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ ATA_HOST_STARTED = (1 << 1), /* Host started */ ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */ ATA_HOST_IGNORE_ATA = (1 << 3), /* Ignore ATA devices on this host. */flags passed by libsas:
ATA_FLAG_SATA = (1 << 1), ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */The only one that aliases is
ATA_HOST_STARTEDwhich is a 'don't care' in the libsas and ipr cases sinceata_hostsfrom these sources are not registered with libata.
Quoted 8 lines
Cc Brian King <[email protected]>Reported-by Hannes Reinecke <[email protected]>Signed-off-by Dan Williams <[email protected]>--- drivers/ata/libata-core.c | 10 ++-------- drivers/scsi/ipr.c | 3 +-- drivers/scsi/libsas/sas_ata.c | 5 +---- include/linux/libata.h | 3 +--
Signature · 3 lines
Brian King Power Linux I/O IBM Linux Technology Center