From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753347AbcBJKsD (ORCPT ); Wed, 10 Feb 2016 05:48:03 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:13357 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752512AbcBJKr5 (ORCPT ); Wed, 10 Feb 2016 05:47:57 -0500 X-AuditID: cbfec7f5-f79b16d000005389-87-56bb155a2940 From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Russell King - ARM Linux , Ulf Hansson , Tomeu Vizoso , Greg Kroah-Hartman , Dan Williams , Kukjin Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v5 RESEND 0/5] AMBA: add complete support for power domains Date: Wed, 10 Feb 2016 11:47:25 +0100 Message-id: <1455101250-11327-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsVy+t/xy7pRorvDDN7sMbTYOGM9q8X0qRcY LZoXr2ezeP3C0KL/8Wtmi02Pr7FaXN41h81ixvl9TBa3L/NarD1yl92ib+0lNovja8MdeDxa mnvYPHbcXcLosXjPSyaPTas62TzuXNvD5rF/7hp2j81L6j36tqxi9Pi8SS6AM4rLJiU1J7Ms tUjfLoEr40uDU8Ek6YqpO7pZGxgfiHYxcnBICJhIPN8s1sXICWSKSVy4t54NxBYSWMoo8W8e E4TdxCQx7UQ6iM0mYCjR9bYLrEZEIFti/t5u9i5GLg5mgfnMEg9X9bOCJIQFvCVe9Z9nAbFZ BFQl/qw4yQ6yi1fAQ+JVuw3ELjmJ/y9XME1g5F7AyLCKUTS1NLmgOCk910ivODG3uDQvXS85 P3cTIyTgvu5gXHrM6hCjAAejEg/vDZNdYUKsiWXFlbmHGCU4mJVEeCex7w4T4k1JrKxKLcqP LyrNSS0+xCjNwaIkzjtz1/sQIYH0xJLU7NTUgtQimCwTB6dUA6N/fui/ru8SCRec5S9Fb2L2 5Uq8x1JwzfSA1PFWrXm/lj3lz5c+lSMUKPBr+aWyFxt3ZfqZpj7Iu7uhvvLDtvjN3aXe5pwu jExzRVVcL32beyR5vlpMh9B2eV7Dnyc5vO+nXLqZofj9+F9L8x1Trs3sfchj7B7r62P7okCo 3G/+Pp3dfxrW1imxFGckGmoxFxUnAgA9imkTNAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (Old thread name: Exynos4210: fix power domain for MDMA1 device) This patchset fixes mysterious boot hang on Exynos 4210 SoCs, when IOMMU is enabled. There is no direct dependency between IOMMU devices and MDMA1. However enabling IOMMU changes the device probe order, what results in LCD0 power domain being turned off for some time. During that time the registration of MDMA1 device happens, what results in system hangs, because the common bus code tries to read PID/CID registers from turned-off device. Since the proposed change in the driver core had impact on existing drivers (see '-next regression: "driver cohandle -EPROBE_DEFER from bus_type.match()"' thread https://lkml.org/lkml/2015/12/17/390 ), I've checked all the functions assigned to match callback of struct bus_type objects and found that there are only 4 such functions that don't return 0/1 values: 1. arch/arm/common/sa1111.c: sa1111_match -> result of bitwise & 2. drivers/nvdimm/bus.c: nvdimm_bus_match -> result of test_bit() 3. drivers/sh/superhyway/superhyway.c: superhyway_bus_match -> error codes (this is really funny case, all errors are resolved to 'matched' case) 4. drivers/staging/unisys/visorbus/visorbus_main.c: visorbus_match -> 0 and some positive integer values, safe for now The list of functions that I've examined has been generated by following shell command: $ git grep -Pp "\.match\s" | grep -A1 bus_type | grep "\.match\s" | tr -s "\t;&,=:" " " | cut -d" " -f1,3 Only the first two functions require potential fixing to ensure that correct match will not result in negative return value, so the 2 additional patches have been added to v5 patchset. Best regards Marek Szyprowski Samsung R&D Institute Poland Changelog: v5: - added 2 more patches to avoid regression with existing drivers (nvdimm and sa1111), for more information, see https://lkml.org/lkml/2015/12/17/390 - changed thread name to "AMBA: add complete support for power domains" v4: https://lkml.org/lkml/2015/12/2/52 - fixed more issues pointed by Ulf Hansson and Russell King v3: https://lkml.org/lkml/2015/12/1/334 - fixed issues pointed by Ulf Hansson - dropped patch for exynos4210 dts, because it already got queued for merging v2: https://lkml.org/lkml/2015/11/26/229 - added 2 patches from 'On-demand device probing' thread (https://lkml.org/lkml/2015/9/29/189), which move PID/CIR reading from amba_device_add() to amba_match() - moved dev_pm_domain_attach() to amba_match(), which is allowed to return -EPROBE_DEFER v1: http://www.spinics.net/lists/arm-kernel/msg463185.html - initial version Patch summary: Dan Williams (1): drivers: nvdimm: ensure no negative value gets returned on positive match Marek Szyprowski (2): ARM: sa1111: ensure no negative value gets returned on positive match ARM: amba: Properly handle devices with power domains Tomeu Vizoso (2): driver core: handle -EPROBE_DEFER from bus_type.match() ARM: amba: Move reading of periphid to amba_match() Documentation/driver-model/porting.txt | 6 +- arch/arm/common/sa1111.c | 2 +- drivers/amba/bus.c | 152 ++++++++++++++++++--------------- drivers/base/dd.c | 24 +++++- drivers/nvdimm/bus.c | 2 +- include/linux/device.h | 7 +- 6 files changed, 114 insertions(+), 79 deletions(-) -- 1.9.2