Received: by 10.213.65.68 with SMTP id h4csp1968644imn; Thu, 5 Apr 2018 06:56:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx48e45yaTUUrwML6fsCZL/D1iPa6AYDMln+T4zCm5nA8iNRzaYlGiICQJXnA5c9YD/OdSavf X-Received: by 2002:a17:902:822:: with SMTP id 31-v6mr23581216plk.200.1522936591925; Thu, 05 Apr 2018 06:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522936591; cv=none; d=google.com; s=arc-20160816; b=AZV0XyCfriS204Ecou1lkxXIGMZnaPE+B0+0xKxe4aYqHBuROLQH74pQp1uT11HF/Z NaHNg3Zj+oZF/h+XP1RKyyPmgsZRhtF0rm+l+p9gzvvYeklexmopa90L1PY13FSkBv3q 9HlWdQ7LygpqUulDmWoQagcnMMhW6THBfU3aT4RA/lW/SextWx30wLx51EfFbhI85jPw QmUh9kTE1omyA2X4iUZ3QH9EvOKHGzU/ARPO/6Yb+V09KRXzANLz1OyxajnPR0lWEhTI 768m4+fddxteMkQLjcuV+rNMbckZxp//Mj4y07yQNcutLaYzZYYjtnTYz+SS9rHBb4Rj 0ySw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=O8QCumwpXlAWnk+5flo/xUa7LhCGLvzSMdn7h+HQis8=; b=INkaSx9qp97hG9PrhXOxbA9OK7LsIpO6yBNMVL5u9DlRlPlFouJAL4H9QMIOdRATX7 KjQsZMvrpUfB7Xgy8PJiU+k5l3xbaMz/tARoqJNxHaVdqO5frIQlRbB+kVZlBf4zsM4Q 6MBXb51tZi/j/ngKOGUsqBp6sxm66P1JIkHOdl6u8jwYMdNPp13HvkWx/cBeOMPqU68I Kq8e+FRmQEgfKmK5dzEf3cL9Yj7UftLC98gKe+GIY08uazbSOydeuKQjOojjnOiN+Dzm Ch5iuoZlvIzZ4ADxwKiq6KyZyuLdIMvxEGOD46bZ1fzxFSmzznghYxFunsbMPU2IFqim l/nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kSO/5ruK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si5522637pgu.518.2018.04.05.06.56.17; Thu, 05 Apr 2018 06:56:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kSO/5ruK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751314AbeDENyj (ORCPT + 99 others); Thu, 5 Apr 2018 09:54:39 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36070 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750835AbeDENyi (ORCPT ); Thu, 5 Apr 2018 09:54:38 -0400 Received: by mail-wm0-f65.google.com with SMTP id x82so7398523wmg.1; Thu, 05 Apr 2018 06:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=O8QCumwpXlAWnk+5flo/xUa7LhCGLvzSMdn7h+HQis8=; b=kSO/5ruKoYzTzicXpEcaKTqSAhaSo3IPYg3AstHBL2h3Cgmia6GjmUWANCcoA6pukx 7RzW4Ll8bznnQfobxjLMYCHEL3IpU/t6vGgP11TxjuWTWQPswxjk7hlSXDw/WY17awx+ ue8+89kqJJ2cDS9YiE8KwYMq9zCQe00RgeztDz/BkqfWum0YjOGitL9UdXwH/++ONQzM /3PRU/D51Dzd2Ct4Tl7+PiEOyWuqKrPykKHeJGYTyOdY+bzPMjFYAhIFmOxjRn8eJTlK o1rgarHIbojT9ZIoZ73/YsF3tcYsiOtGqN1C1iBcyYQX4PHV+Ux7Y9+6qMFpi3VGZhk0 zjgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=O8QCumwpXlAWnk+5flo/xUa7LhCGLvzSMdn7h+HQis8=; b=sapzfGPhQ6R6M4pJGVcOhbz0qapd/yXCCLPVKURRjogl6nuZVu7XbSTG3jDl8WCGVk g0zdYMb704FitZeggBqDv1ZEqSf9kE5cyb36X9RvBP3aCLw0aJ2eo69WqXOMTfx7tWqU uHlXvcYAT4g9vD9rTQGZKcovnGDcz9A7tAVts0TOxyLhph+vDhMV2m16F+Uq66f82Ekg BDguSsMRWRiRxGMaL312XlvMglqAVTjoFq2eAkyUqFH3Rq7bliDrVlsIJB7GxYtG2OXt FJZQ1XA4c0zwFJ8QwX4Jnoyggy5SN6tSm5tp/zsvDYzAXL1xLdW0hs1ebWeqU3218Z/0 gLTA== X-Gm-Message-State: ALQs6tB+wW/t0g09XFZajVbkOuKgtTPad+dnDSIAkOUyVwIXgsLFIWFl fZ/qkltrRMKHqzQX14vM5DY= X-Received: by 10.28.202.26 with SMTP id a26mr5662382wmg.120.1522936476572; Thu, 05 Apr 2018 06:54:36 -0700 (PDT) Received: from localhost (p200300E41F193100D36CEB00B2C8378E.dip0.t-ipconnect.de. [2003:e4:1f19:3100:d36c:eb00:b2c8:378e]) by smtp.gmail.com with ESMTPSA id r11sm5097073wrl.42.2018.04.05.06.54.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Apr 2018 06:54:35 -0700 (PDT) Date: Thu, 5 Apr 2018 15:54:35 +0200 From: Thierry Reding To: Hans de Goede Cc: Patrice CHOTARD , Kunihiko Hayashi , Tejun Heo , Matthias Brugger , Rob Herring , Mark Rutland , "linux-ide@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mediatek@lists.infradead.org" Subject: Re: [PATCH] ata: ahci-platform: add reset control support Message-ID: <20180405135435.GA10860@ulmo> References: <1521768653-11824-1-git-send-email-hayashi.kunihiko@socionext.com> <20180405095429.GA7506@ulmo> <1f7d0738-1963-21c5-c293-e46fb0214ecf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <1f7d0738-1963-21c5-c293-e46fb0214ecf@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 05, 2018 at 03:27:03PM +0200, Hans de Goede wrote: > Hi, >=20 > On 05-04-18 15:17, Patrice CHOTARD wrote: > > Hi Thierry > >=20 > > On 04/05/2018 11:54 AM, Thierry Reding wrote: > > > On Fri, Mar 23, 2018 at 10:30:53AM +0900, Kunihiko Hayashi wrote: > > > > Add support to get and control a list of resets for the device > > > > as optional and shared. These resets must be kept de-asserted until > > > > the device is enabled. > > > >=20 > > > > This is specified as shared because some SoCs like UniPhier series > > > > have common reset controls with all ahci controller instances. > > > >=20 > > > > Signed-off-by: Kunihiko Hayashi > > > > --- > > > > .../devicetree/bindings/ata/ahci-platform.txt | 1 + > > > > drivers/ata/ahci.h | 1 + > > > > drivers/ata/libahci_platform.c | 24 ++++++++= +++++++++++--- > > > > 3 files changed, 23 insertions(+), 3 deletions(-) > > >=20 > > > This causes a regression on Tegra because we explicitly request the > > > resets after the call to ahci_platform_get_resources(). > >=20 > > I confirm, we got exactly the same behavior on STi platform. > >=20 > > >=20 > > > From a quick look, ahci_mtk and ahci_st are in the same boat, addin= g the > > > corresponding maintainers to Cc. > > >=20 > > > Patrice, Matthias: does SATA still work for you after this patch? This > > > has been in linux-next since next-20180327. > >=20 > > SATA is still working after this patch, but a kernel warning is > > triggered due to the fact that resets are both requested by > > libahci_platform and by ahci_st driver. >=20 > So in your case you might be able to remove the reset handling > from the ahci_st driver and rely on the new libahci_platform > handling instead? If that works that seems like a win to me. >=20 > As said elsewhere in this thread I think it makes sense to keep (or re-add > after a revert) the libahci_platform reset code, but make it conditional > on a flag passed to ahci_platform_get_resources(). This way we get > the shared code for most cases and platforms which need special handling > can opt-out. Agreed, although I prefer such helpers to be opt-in, rather than opt-out. In my experience that tends make the helpers more resilient to this kind of regression. It also simplifies things because instead of drivers saying "I want all the helpers except this one and that one", they can simply say "I want these helpers and that one". In the former case whenever you add some new (opt-out) feature, you have to update all drivers and add the exception. In the latter you only need to extend the drivers that want to make use of the new helper. With that in mind, rather than adding a flag to the ahci_platform_get_resources() function, it might be more flexible to split the helpers into finer-grained functions. That way drivers can pick whatever functionality they want from the helpers. Thierry --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEiOrDCAFJzPfAjcif3SOs138+s6EFAlrGKpgACgkQ3SOs138+ s6HSKA/7BWzpQMlq3BAf0hZ3rDVbOwWJhmJQwIiAdKf+B0ndSEVo4vblW0Sekfwz uUqYANthL+uEOMU7cFinJvKs6+g5vkTjEr1Cd6ziAz6JR6JGfJMnM3RdbYjqr5xC lrdWxbjUHjHg6C2LqMtanXY3eAhlPdXnjFJ5OvbBMQSgQi/5hoF/TTl7+8v7QWaG tSZ8ob8M+i8sF4H+ObBRUcRieGSRse8gfgNaHZaEf1NfytnG4hf92HivV/+SAS8S FKd0oCkAulyHxZqlPl+Qf3qTkhyHhR+InrdSMRAtZwuNPneTMITB6ANx90sIqq98 PVZ/Xvfz6UsxZPVsQrCUHnqtYiZ8swe/geHppydD5lkOe7DibqP+wRrl+49XxK1V +Y3A/7xDxDkepO/cTnXgDL3DFdGfKcZ/B5s3iX92XL/c4J7KqkEKx3wgS98di/o/ K3LevdQ3AUDXEtFZ5kxO/XJMLy9EnvQTXrdq7ZgQtaXNhgHCcB1bnn/QPqNEZ+v2 0JoHfRECq5bar/hiw5Ni8IxrHXq3jBnqPXiye3eKh9eyJIMtna8X20i1sQefCyKA gp8cvS5ZM5osbhUatUQ+pK1MrEBAWCxdRPrRPl5bi3quxuiEu47rHHm6wFBg6n1R u1CDk+Cofnv1qptcH1e9Vs1IesX2qpRP6GrJjB4AG72fpURkdso= =F112 -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz--