From patchwork Wed Feb 8 19:43:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 725781 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vJWqJ3YSLz9rxm for ; Thu, 9 Feb 2017 06:43:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="h/GjsgRP"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbdBHTnt (ORCPT ); Wed, 8 Feb 2017 14:43:49 -0500 Received: from mail-yb0-f193.google.com ([209.85.213.193]:36588 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbdBHTnr (ORCPT ); Wed, 8 Feb 2017 14:43:47 -0500 Received: by mail-yb0-f193.google.com with SMTP id o65so6573343ybo.3 for ; Wed, 08 Feb 2017 11:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6fAyTAb6iVYDKmRbYqfSU9JkPGRJJtwzupjKgN06TYs=; b=h/GjsgRPsQtNM+kcMPKlFPLqf72LjHjpvZkDD/3sJaRtvHlh29J+nlbs5kPnKweXou 8HaoInms+ICDWCAOqIhDYyx58Gz3h19e0I2Isz91v3mgvvIO7k33twXTyNx7R1ko7zSQ 45ttJqN7U6t/vfia2EsP24jqKtWmDhOPio4m9n8O6UfXPgruDrDQlhqKrd5H8n8KE7j4 CrRPiY4yHjW/CvKklsbTotdzccTe3ZKnlUqQrWFvYCbhlAaiVRhTu/BhFxJQV8leuXIs 3U4fLIWkSvmBN2bsE1N2zzFKJE0YgMDLSXvTHHbJuCn+c9Ou/Rr+JdxytmoUubZXKDYW CTGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6fAyTAb6iVYDKmRbYqfSU9JkPGRJJtwzupjKgN06TYs=; b=F3VPMeGADzKOuls7KvOpbNdgGUubOiJWHVMyLiZkbyNIxnjWeK3yBuywNlghkR84Fn S+1aauIw1A3rEk5EvRbYtw7daWrjIjkyuZe0h8PDQvWBLxgPHzWiBvs1FOxSqARSaZRa W6LfuQGgbbu1nv/3vl3CeR8/gLReL74JlZhJ6Q8ySlUpUEYbo05Nle1gLzG9+V4QTEuN cfAfpssPbh1lsXCURonHYIK7YCJ6tVeCV+vTjNlBMr08KdLyMkDWfiUefrm6WytPq0Vq 8zr44173Cf/Jz4qIJvkyVM/n6PXIFeH4Dm9kCAiZ6RxbpAHvqedeXQ6PzL4exVj3XriV i9jA== X-Gm-Message-State: AMke39kbRZqhSVjzIY7TjsOpaK4bw+2DGoF0qw6/vCDzX8SIlvzckSft793CEBubF4TQRA== X-Received: by 10.37.84.8 with SMTP id i8mr16577942ybb.75.1486583012121; Wed, 08 Feb 2017 11:43:32 -0800 (PST) Received: from localhost ([2620:10d:c091:200::d:e4a7]) by smtp.gmail.com with ESMTPSA id v207sm4344097ywa.6.2017.02.08.11.43.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Feb 2017 11:43:31 -0800 (PST) Date: Wed, 8 Feb 2017 14:43:30 -0500 From: Tejun Heo To: Gwendal Grignou Cc: whiteheadm@acm.org, One Thousand Gnomes , Greg Kroah-Hartman , Sergei Shtylyov , IDE/ATA development list Subject: Re: [PATCH] pata_legacy: Allow disabling of legacy PATA device probes on non-PCI systems Message-ID: <20170208194330.GB25826@htj.duckdns.org> References: <20170119213737.GB25133@mtj.duckdns.org> <20170120191946.GA9280@mtj.duckdns.org> <20170120193828.GB9280@mtj.duckdns.org> <20170124161937.GE12281@htj.duckdns.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Hello, On Tue, Feb 07, 2017 at 12:21:37PM -0800, Gwendal Grignou wrote: > I am wondering if we don't have a circular dependency: > We do the final put_device (in scsi_host_put) on ap->scsi_host in > ata_host_release(), but it is not called because > [scsi_host]->shost_gendev.parent is &ap->tdev which hold the put on > its parent, ap. > > If my understanding is correct, as Tejun pointed out, removing the put > on ap in ata_tport_release and the get_device(parent) in ata_tport_add > should unlock the situation. Heh, I'm not quite sure I follow but something like the following, right? Matthew, can you please give this a try? Thanks. --- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/libata-transport.c b/drivers/ata/libata-transport.c index 7ef16c0..20e2b7a 100644 --- a/drivers/ata/libata-transport.c +++ b/drivers/ata/libata-transport.c @@ -224,7 +224,6 @@ static DECLARE_TRANSPORT_CLASS(ata_port_class, static void ata_tport_release(struct device *dev) { - put_device(dev->parent); } /** @@ -284,7 +283,7 @@ int ata_tport_add(struct device *parent, device_initialize(dev); dev->type = &ata_port_type; - dev->parent = get_device(parent); + dev->parent = parent; dev->release = ata_tport_release; dev_set_name(dev, "ata%d", ap->print_id); transport_setup_device(dev); @@ -348,7 +347,6 @@ static DECLARE_TRANSPORT_CLASS(ata_link_class, static void ata_tlink_release(struct device *dev) { - put_device(dev->parent); } /** @@ -410,7 +408,7 @@ int ata_tlink_add(struct ata_link *link) int error; device_initialize(dev); - dev->parent = get_device(&ap->tdev); + dev->parent = &ap->tdev; dev->release = ata_tlink_release; if (ata_is_host_link(link)) dev_set_name(dev, "link%d", ap->print_id); @@ -589,7 +587,6 @@ static DECLARE_TRANSPORT_CLASS(ata_dev_class, static void ata_tdev_release(struct device *dev) { - put_device(dev->parent); } /** @@ -662,7 +659,7 @@ static int ata_tdev_add(struct ata_device *ata_dev) int error; device_initialize(dev); - dev->parent = get_device(&link->tdev); + dev->parent = &link->tdev; dev->release = ata_tdev_release; if (ata_is_host_link(link)) dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);