All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@intel.com>
To: Kamal Mostafa <kamal@canonical.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH 097/105] libata-acpi: add back ACPI based hotplug functionality
Date: Sat, 29 Jun 2013 22:40:44 +0800	[thread overview]
Message-ID: <51CEF1EC.3080702@intel.com> (raw)
In-Reply-To: <1372445527-24414-98-git-send-email-kamal@canonical.com>

On 06/29/2013 02:51 AM, Kamal Mostafa wrote:
> 3.8.13.4 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Aaron Lu <aaron.lu@intel.com>
> 
> commit 44521527be36172864e6e7a6fba4b66e9aa48e40 upstream.
> 
> Commit 30dcf76acc69 "libata: migrate ACPI code over to new bindings"
> mistakenly dropped the code to register hotplug notificaion handler
> for ATA port/devices, causing regression for people using ATA bay,
> as kernel bug #59871 shows.
> 
> Fix this by adding back the hotplug notification handler registration
> code.  Since this code has to be run once and notification needs to
> be installed on every ATA port/devices handle no matter if there is
> actual device attached, we can't do this in binding time for ATA
> device ACPI handle, as the binding only occurs when a SCSI device is
> created, i.e. there is device attached.  So introduce the
> ata_acpi_hotplug_init() function to loop scan all ATA ACPI handles
> and if it is available, install the notificaion handler for it during
> ATA init time.
> 
> With the ATA ACPI handle binding to SCSI device tree, it is possible
> now that when the SCSI hotplug work removes the SCSI device, the ACPI
> unbind function will find that the corresponding ACPI device has
> already been deleted by dock driver, causing a scaring message like:
> [  128.263966] scsi 4:0:0:0: Oops, 'acpi_handle' corrupt
> Fix this by waiting for SCSI hotplug task finish in our notificaion
> handler, so that the removal of ACPI device done in ACPI unbind
> function triggered by the removal of SCSI device is run earlier when
> ACPI device is still available.
> 
> [rjw: Rebased]
> References: https://bugzilla.kernel.org/show_bug.cgi?id=59871
> Reported-bisected-and-tested-by: Dirk Griesbach <spamthis@freenet.de>
> Signed-off-by: Aaron Lu <aaron.lu@intel.com>
> Acked-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> [ kamal: backport to 3.8 ]

Cool, thanks for the backport, I should have noticed this change of API.
I'll be more careful next time. BTW, the backport looks good to me.

Thanks,
Aaron

> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  drivers/ata/libata-acpi.c | 36 +++++++++++++++++++++++++++++++++++-
>  drivers/ata/libata-core.c |  2 ++
>  drivers/ata/libata.h      |  2 ++
>  3 files changed, 39 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
> index cc8aa9e..4cdeee4 100644
> --- a/drivers/ata/libata-acpi.c
> +++ b/drivers/ata/libata-acpi.c
> @@ -156,8 +156,10 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev,
>  
>  	spin_unlock_irqrestore(ap->lock, flags);
>  
> -	if (wait)
> +	if (wait) {
>  		ata_port_wait_eh(ap);
> +		flush_work(&ap->hotplug_task.work);
> +	}
>  }
>  
>  static void ata_acpi_dev_notify_dock(acpi_handle handle, u32 event, void *data)
> @@ -214,6 +216,38 @@ static const struct acpi_dock_ops ata_acpi_ap_dock_ops = {
>  	.uevent = ata_acpi_ap_uevent,
>  };
>  
> +void ata_acpi_hotplug_init(struct ata_host *host)
> +{
> +	int i;
> +
> +	for (i = 0; i < host->n_ports; i++) {
> +		struct ata_port *ap = host->ports[i];
> +		acpi_handle handle;
> +		struct ata_device *dev;
> +
> +		if (!ap)
> +			continue;
> +
> +		handle = ata_ap_acpi_handle(ap);
> +		if (handle) {
> +			/* we might be on a docking station */
> +			register_hotplug_dock_device(handle,
> +						     &ata_acpi_ap_dock_ops, ap);
> +		}
> +
> +		ata_for_each_dev(dev, &ap->link, ALL) {
> +			handle = ata_dev_acpi_handle(dev);
> +			if (!handle)
> +				continue;
> +
> +			/* we might be on a docking station */
> +			register_hotplug_dock_device(handle,
> +						     &ata_acpi_dev_dock_ops,
> +						     dev);
> +		}
> +	}
> +}
> +
>  /**
>   * ata_acpi_dissociate - dissociate ATA host from ACPI objects
>   * @host: target ATA host
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 3b3afa8..5866bf5 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -6124,6 +6124,8 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
>  	if (rc)
>  		goto err_tadd;
>  
> +	ata_acpi_hotplug_init(host);
> +
>  	/* set cable, sata_spd_limit and report */
>  	for (i = 0; i < host->n_ports; i++) {
>  		struct ata_port *ap = host->ports[i];
> diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
> index 7148a58..15ac13f 100644
> --- a/drivers/ata/libata.h
> +++ b/drivers/ata/libata.h
> @@ -122,6 +122,7 @@ extern int ata_acpi_register(void);
>  extern void ata_acpi_unregister(void);
>  extern void ata_acpi_bind(struct ata_device *dev);
>  extern void ata_acpi_unbind(struct ata_device *dev);
> +extern void ata_acpi_hotplug_init(struct ata_host *host);
>  #else
>  static inline void ata_acpi_dissociate(struct ata_host *host) { }
>  static inline int ata_acpi_on_suspend(struct ata_port *ap) { return 0; }
> @@ -134,6 +135,7 @@ static inline int ata_acpi_register(void) { return 0; }
>  static inline void ata_acpi_unregister(void) { }
>  static inline void ata_acpi_bind(struct ata_device *dev) { }
>  static inline void ata_acpi_unbind(struct ata_device *dev) { }
> +static inline void ata_acpi_hotplug_init(struct ata_host *host) {}
>  #endif
>  
>  /* libata-scsi.c */
> 


  reply	other threads:[~2013-06-29 14:42 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 18:50 [ 3.8.y.z extended stable ] Linux 3.8.13.4 stable review Kamal Mostafa
2013-06-28 18:50 ` [PATCH 001/105] usb: dwc3: gadget: req->queued must be forced to false in cleanup Kamal Mostafa
2013-06-28 18:50 ` [PATCH 002/105] idr: fix top layer handling Kamal Mostafa
2013-06-28 18:50 ` [PATCH 003/105] Bluetooth: Add support for atheros 04ca:3004 device to ath3k Kamal Mostafa
2013-06-28 18:50 ` [PATCH 004/105] Bluetooth: Device 0cf3:3008 should map AR 3012 Kamal Mostafa
2013-06-28 18:50 ` [PATCH 005/105] regulator: fixed regulator_bulk_enable unwinding code Kamal Mostafa
2013-06-28 18:50 ` [PATCH 006/105] perf: Fix error return code Kamal Mostafa
2013-06-28 18:50 ` [PATCH 007/105] netrom: fix invalid use of sizeof in nr_recvmsg() Kamal Mostafa
2013-06-28 18:50 ` [PATCH 008/105] r8169: honor jumbo settings when chipset is requested to start Kamal Mostafa
2013-06-28 18:50 ` [PATCH 009/105] nfsd4: don't allow owner override on 4.1 CLAIM_FH opens Kamal Mostafa
2013-06-28 18:50 ` [PATCH 010/105] iwlwifi: add new pci id for 6x35 series Kamal Mostafa
2013-06-28 18:50 ` [PATCH 011/105] net: qmi_wwan: fixup missing ethernet header (firmware bug workaround) Kamal Mostafa
2013-06-28 18:50 ` [PATCH 012/105] net: qmi_wwan: fixup destination address " Kamal Mostafa
2013-06-28 18:50 ` [PATCH 013/105] net: qmi_wwan: prevent duplicate mac address on link " Kamal Mostafa
2013-06-28 18:50 ` [PATCH 014/105] Kirkwood: Enable PCIe port 1 on QNAP TS-11x/TS-21x Kamal Mostafa
2013-06-28 18:50 ` [PATCH 015/105] ARM: plat-orion: Fix num_resources and id for ge10 and ge11 Kamal Mostafa
2013-06-28 18:50 ` [PATCH 016/105] staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe() Kamal Mostafa
2013-06-28 18:50 ` [PATCH 017/105] tg3: Skip powering down function 0 on certain serdes devices Kamal Mostafa
2013-06-28 18:50 ` [PATCH 018/105] jfs: fix a couple races Kamal Mostafa
2013-06-28 18:50 ` [PATCH 019/105] reiserfs: fix deadlock with nfs racing on create/lookup Kamal Mostafa
2013-06-28 18:50 ` [PATCH 020/105] reiserfs: fix problems with chowning setuid file w/ xattrs Kamal Mostafa
2013-06-28 18:50 ` [PATCH 021/105] reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry Kamal Mostafa
2013-06-28 18:50 ` [PATCH 022/105] xen-netback: remove skb in xen_netbk_alloc_page Kamal Mostafa
2013-06-28 18:50 ` [PATCH 023/105] xen-netback: fix sparse warning Kamal Mostafa
2013-06-28 18:50 ` [PATCH 024/105] xen-netback: coalesce slots in TX path and fix regressions Kamal Mostafa
2013-06-28 18:50 ` [PATCH 025/105] xen-netback: don't disconnect frontend when seeing oversize packet Kamal Mostafa
2013-06-28 18:50 ` [PATCH 026/105] xen-netback: remove redundent parameter in netbk_count_requests Kamal Mostafa
2013-06-28 18:50 ` [PATCH 027/105] xen-netback: avoid allocating variable size array on stack Kamal Mostafa
2013-06-28 18:50 ` [PATCH 028/105] xen-netback: better names for thresholds Kamal Mostafa
2013-06-28 18:50 ` [PATCH 029/105] xen-netfront: reduce gso_max_size to account for max TCP header Kamal Mostafa
2013-06-28 18:50 ` [PATCH 030/105] iommu/amd: Re-enable IOMMU event log interrupt after handling Kamal Mostafa
2013-06-28 18:50 ` [PATCH 031/105] xen/events: Handle VIRQ_TIMER before any other hardirq in event loop Kamal Mostafa
2013-06-28 18:50 ` [PATCH 032/105] klist: del waiter from klist_remove_waiters before wakeup waitting process Kamal Mostafa
2013-06-28 18:50 ` [PATCH 033/105] drm/gma500: Increase max resolution for mode setting Kamal Mostafa
2013-06-28 18:50 ` [PATCH 034/105] libceph: clear messenger auth_retry flag when we authenticate Kamal Mostafa
2013-06-28 18:50 ` [PATCH 035/105] libceph: fix authorizer invalidation Kamal Mostafa
2013-06-28 18:50 ` [PATCH 036/105] libceph: add update_authorizer auth method Kamal Mostafa
2013-06-28 18:50 ` [PATCH 037/105] libceph: wrap auth ops in wrapper functions Kamal Mostafa
2013-06-28 18:51 ` [PATCH 038/105] libceph: wrap auth methods in a mutex Kamal Mostafa
2013-06-28 18:51 ` [PATCH 039/105] MODSIGN: do not send garbage to stderr when enabling modules signature Kamal Mostafa
2013-06-28 18:51 ` [PATCH 040/105] Input: cyttsp - fix memcpy size param Kamal Mostafa
2013-06-28 18:51 ` [PATCH 041/105] clk: remove notifier from list before freeing it Kamal Mostafa
2013-06-28 18:51 ` [PATCH 042/105] USB: f81232: fix device initialisation at open Kamal Mostafa
2013-06-28 18:51 ` [PATCH 043/105] USB: spcp8x5: " Kamal Mostafa
2013-06-28 18:51 ` [PATCH 044/105] USB: pl2303: " Kamal Mostafa
2013-06-28 18:51 ` [PATCH 045/105] drm/radeon: do not try to uselessly update virtual memory pagetable Kamal Mostafa
2013-06-28 18:51 ` [PATCH 046/105] tg3: Wait for boot code to finish after power on Kamal Mostafa
2013-06-28 18:51 ` [PATCH 047/105] target/iscsi: don't corrupt bh_count in iscsit_stop_time2retain_timer() Kamal Mostafa
2013-06-28 18:51 ` [PATCH 048/105] tcm_qla2xxx: Fix residual for underrun commands that fail Kamal Mostafa
2013-06-28 18:51 ` [PATCH 049/105] powerpc: Fix stack overflow crash in resume_kernel when ftracing Kamal Mostafa
2013-06-28 18:51 ` [PATCH 050/105] powerpc: Fix emulation of illegal instructions on PowerNV platform Kamal Mostafa
2013-06-28 18:51 ` [PATCH 051/105] powerpc: Fix missing/delayed calls to irq_work Kamal Mostafa
2013-06-28 18:51 ` [PATCH 052/105] tilepro: work around module link error with gcc 4.7 Kamal Mostafa
2013-06-28 18:51 ` [PATCH 053/105] ALSA: usb-audio: work around Android accessory firmware bug Kamal Mostafa
2013-06-28 18:51 ` [PATCH 054/105] ALSA: usb-audio: Fix invalid volume resolution for Logitech HD Webcam c310 Kamal Mostafa
2013-06-28 18:51 ` [PATCH 055/105] ARM: 7752/1: errata: LoUIS bit field in CLIDR register is incorrect Kamal Mostafa
2013-06-28 18:51 ` [PATCH 056/105] ARM: 7754/1: Fix the CPU ID and the mask associated to the PJ4B Kamal Mostafa
2013-06-28 18:51 ` [PATCH 057/105] ARM: 7755/1: handle user space mapped pages in flush_kernel_dcache_page Kamal Mostafa
2013-06-28 18:51 ` [PATCH 058/105] KVM: x86: remove vcpu's CPL check in host-invoked XCR set Kamal Mostafa
2013-06-28 18:51 ` [PATCH 059/105] x86: fix build error and kconfig for ia32_emulation and binfmt Kamal Mostafa
2013-06-28 18:51 ` [PATCH 060/105] x86: kvmclock: zero initialize pvclock shared memory area Kamal Mostafa
2013-06-28 18:51 ` [PATCH 061/105] USB: serial: ti_usb_3410_5052: new device id for Abbot strip port cable Kamal Mostafa
2013-06-28 18:51 ` [PATCH 062/105] perf: arm64: Record the user-mode PC in the call chain Kamal Mostafa
2013-06-28 18:51 ` [PATCH 063/105] drm/radeon: update lockup tracking when scheduling in empty ring Kamal Mostafa
2013-06-28 18:51 ` [PATCH 064/105] ncpfs: fix rmdir returns Device or resource busy Kamal Mostafa
2013-06-28 18:51 ` [PATCH 065/105] tcp: fix tcp_md5_hash_skb_data() Kamal Mostafa
2013-06-28 18:51 ` [PATCH 066/105] gianfar: add missing iounmap() on error in gianfar_ptp_probe() Kamal Mostafa
2013-06-28 18:51 ` [PATCH 067/105] vxlan: Update vxlan fdb 'used' field after each usage Kamal Mostafa
2013-06-28 18:51 ` [PATCH 068/105] ipv6: fix possible crashes in ip6_cork_release() Kamal Mostafa
2013-06-28 18:51   ` Kamal Mostafa
2013-06-28 18:51 ` [PATCH 069/105] netlabel: improve domain mapping validation Kamal Mostafa
2013-06-28 18:51 ` [PATCH 070/105] r8169: fix offloaded tx checksum for small packets Kamal Mostafa
2013-06-28 18:51 ` [PATCH 071/105] 8139cp: reset BQL when ring tx ring cleared Kamal Mostafa
2013-06-28 18:51 ` [PATCH 072/105] tcp: bug fix in proportional rate reduction Kamal Mostafa
2013-06-28 18:51 ` [PATCH 073/105] tcp: xps: fix reordering issues Kamal Mostafa
2013-06-28 18:51 ` [PATCH 074/105] ip_tunnel: fix kernel panic with icmp_dest_unreach Kamal Mostafa
2013-06-28 18:51 ` [PATCH 075/105] net: phy: fix a bug when verify the EEE support Kamal Mostafa
2013-06-28 18:51 ` [PATCH 076/105] ipv4: fix redirect handling for TCP packets Kamal Mostafa
2013-06-28 18:51 ` [PATCH 077/105] net: Block MSG_CMSG_COMPAT in send(m)msg and recv(m)msg Kamal Mostafa
2013-06-28 18:51 ` [PATCH 078/105] net/core/sock.c: add missing VSOCK string in af_family_*_key_strings Kamal Mostafa
2013-06-28 18:51 ` [PATCH 079/105] tuntap: forbid changing mq flag for persistent device Kamal Mostafa
2013-06-28 18:51 ` [PATCH 080/105] net: force a reload of first item in hlist_nulls_for_each_entry_rcu Kamal Mostafa
2013-06-28 18:51 ` [PATCH 081/105] ipv6: assign rt6_info to inet6_ifaddr in init_loopback Kamal Mostafa
2013-06-28 18:51 ` [PATCH 082/105] vhost_net: clear msg.control for non-zerocopy case during tx Kamal Mostafa
2013-06-28 18:51 ` [PATCH 083/105] net: sctp: fix NULL pointer dereference in socket destruction Kamal Mostafa
2013-06-28 18:51 ` [PATCH 084/105] tuntap: set SOCK_ZEROCOPY flag during open Kamal Mostafa
2013-06-28 18:51 ` [PATCH 085/105] team: check return value of team_get_port_by_index_rcu() for NULL Kamal Mostafa
2013-06-28 18:51 ` [PATCH 086/105] team: move add to port list before port enablement Kamal Mostafa
2013-06-28 18:51 ` [PATCH 087/105] packet: packet_getname_spkt: make sure string is always 0-terminated Kamal Mostafa
2013-06-28 18:51 ` [PATCH 088/105] l2tp: Fix PPP header erasure and memory leak Kamal Mostafa
2013-06-28 18:51 ` [PATCH 089/105] l2tp: Fix sendmsg() return value Kamal Mostafa
2013-06-28 18:51 ` [PATCH 090/105] sctp: fully initialize sctp_outq in sctp_outq_init Kamal Mostafa
2013-06-28 18:51   ` Kamal Mostafa
2013-06-28 18:51 ` [PATCH 091/105] net: sh_eth: fix incorrect RX length error if R8A7740 Kamal Mostafa
2013-06-28 18:51 ` [PATCH 092/105] hw_breakpoint: Fix cpu check in task_bp_pinned(cpu) Kamal Mostafa
2013-06-28 18:51 ` [PATCH 093/105] hw_breakpoint: Use cpu_possible_mask in {reserve,release}_bp_slot() Kamal Mostafa
2013-06-28 18:51 ` [PATCH 094/105] s390/ipl: Fix FCP WWPN and LUN format strings for read Kamal Mostafa
2013-06-28 18:51 ` [PATCH 095/105] ARM: 7762/1: kernel: fix arm_dt_init_cpu_maps() to skip non-cpu nodes Kamal Mostafa
2013-06-28 23:53   ` Lorenzo Pieralisi
2013-06-29 14:22     ` Kamal Mostafa
2013-06-28 18:51 ` [PATCH 096/105] ARM: 7772/1: Fix missing flush_kernel_dcache_page() for noMMU Kamal Mostafa
2013-06-28 18:51 ` [PATCH 097/105] libata-acpi: add back ACPI based hotplug functionality Kamal Mostafa
2013-06-29 14:40   ` Aaron Lu [this message]
2013-06-28 18:52 ` [PATCH 098/105] iwlwifi: dvm: fix chain noise calibration Kamal Mostafa
2013-06-28 18:52 ` [PATCH 099/105] rt2800: fix RT5390 & RT3290 TX power settings regression Kamal Mostafa
2013-06-28 18:52 ` [PATCH 100/105] Bluetooth: Fix crash in l2cap_build_cmd() with small MTU Kamal Mostafa
2013-06-28 18:52 ` [PATCH 101/105] Bluetooth: Fix invalid length check in l2cap_information_rsp() Kamal Mostafa
2013-06-28 18:52 ` [PATCH 102/105] ath9k_htc: Handle IDLE state transition properly Kamal Mostafa
2013-06-28 18:52 ` [PATCH 103/105] dlci: acquire rtnl_lock before calling __dev_get_by_name() Kamal Mostafa
2013-06-28 18:52 ` [PATCH 104/105] dlci: validate the net device in dlci_del() Kamal Mostafa
2013-06-28 18:52 ` [PATCH 105/105] KVM: x86: fix deadlock in clock-in-progress request handling Kamal Mostafa

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=51CEF1EC.3080702@intel.com \
    --to=aaron.lu@intel.com \
    --cc=kamal@canonical.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.