From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756771AbcBQHwv (ORCPT ); Wed, 17 Feb 2016 02:52:51 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:40237 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756607AbcBQHws (ORCPT ); Wed, 17 Feb 2016 02:52:48 -0500 X-AuditID: cbfec7f5-f79b16d000005389-40-56c426c52b1a Subject: Re: [PATCH v5 RESEND 4/5] ARM: amba: Move reading of periphid to amba_match() To: Russell King - ARM Linux References: <1455101250-11327-1-git-send-email-m.szyprowski@samsung.com> <1455101250-11327-5-git-send-email-m.szyprowski@samsung.com> <20160215175250.GJ10826@n2100.arm.linux.org.uk> Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ulf Hansson , Tomeu Vizoso , Greg Kroah-Hartman , Dan Williams , Kukjin Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz From: Marek Szyprowski Message-id: <56C426C4.7040907@samsung.com> Date: Wed, 17 Feb 2016 08:52:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: <20160215175250.GJ10826@n2100.arm.linux.org.uk> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkkeLIzCtJLcpLzFFi42I5/e/4Zd2jakfCDH59l7bYOGM9q8X0qRcY LZoXr2ezeP3C0KL/8Wtmi02Pr7FaXN41h81ixvl9TBa3L/Na9K29xGZxfG24A7dHS3MPm8eO u0sYPRbvecnksWlVJ5vHnWt72Dz2z13D7rF5Sb1H35ZVjB6fN8kFcEZx2aSk5mSWpRbp2yVw ZfRuXcZWsIO3YsKka0wNjF+5uhg5OSQETCTezljBBGGLSVy4t56ti5GLQ0hgKaNE+84LzBDO c0aJd3P3sIJUCQtESPw6/IUdxBYRMJW49ugZVNFORomLbevAEswCS5glNt8pB7HZBAwlut52 sYHYvAJaEu/eLWABsVkEVCWu33gKFhcViJG42HmECaJGUOLH5HtgNZwCNhJ3G3axQcw0k/jy 8jArhC0vsXnNW+YJjAKzkLTMQlI2C0nZAkbmVYyiqaXJBcVJ6blGesWJucWleel6yfm5mxgh EfN1B+PSY1aHGAU4GJV4eFdkHQ4TYk0sK67MPcQowcGsJML7VvlImBBvSmJlVWpRfnxRaU5q 8SFGaQ4WJXHembvehwgJpCeWpGanphakFsFkmTg4pRoYFUIZz307d9rrknG6cujTv6z+X98n 3JhQVaZ45Kuo/vN7ppbte+13naxwNvvI/HTipeqpqmpr9zxXDwy/9vhy6PlORtXQ54UGmv/D +YTtp3y8cWHC833ype8mP5yYfH2fd40rR3rD3RnaWz/p269r6evYtrn1XLS93f8C7am7t9vO 9Zh4RONetRJLcUaioRZzUXEiAIiCM0OUAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 2016-02-15 18:52, Russell King - ARM Linux wrote: > On Wed, Feb 10, 2016 at 11:47:29AM +0100, Marek Szyprowski wrote: >> From: Tomeu Vizoso >> >> Reading the periphid when the Primecell device is registered means that >> the apb pclk must be available by then or the device won't be registered >> at all. >> >> By reading the periphid in amba_match() we can return -EPROBE_DEFER if >> the apb pclk isn't there yet and the device will be retried later. > I've just realised, we can't do this. We need to read the peripheral > ID at registration time, because that's published to userspace via > (a) a sysfs attribute, and (b) as part of the uevent, which will be > used by udev to locate the driver module. > > So, this will have the side effect of breaking systems which have > AMBA primecell devices configured as modules. > > Sorry, I can't apply this. We can't regress existing platforms for > the sake of introducing new platforms to this code. Then the only solution right now I see is to get back to v1: http://lists.infradead.org/pipermail/linux-arm-kernel/2015-November/388199.html which at least handles correctly device registration when power domain driver is available. You pointed that the patch cannot be applied, because failure of dev_pm_domain_attach() will be fatal for device registration. Right now lack of such call is fatal for the whole system, so there is really not a big difference. Please also note that amba_get_enable_pclk() calls clk_get(), which also might return -EPROBE_DEFER, which already breaks device registration the same way. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland