Commit 671e72a4 authored by Ionela Voinescu's avatar Ionela Voinescu
Browse files

ANDROID: fix android specific bug in return value of amba_probe()



Errors from amba drivers probe calls should not be ignored. Therefore
fix return value of amba_probe().

The issue was reproduced on a arm64 juno development platform when using
the Arm MHU doorbell mailbox. When having:

mailbox: mhu@2b1f0000 {
    compatible = "arm,mhu-doorbell", "arm,primecell";
    ...
}

The following behavior is expected:
[..] calling  arm_mhu_driver_init+0x0/0x24 @ 1
[..] bus: 'amba': driver_probe_device: matched device 2b1f0000.mhu with driver mhu
[..] bus: 'amba': really_probe: probing driver mhu with device 2b1f0000.mhu
[..] mhu: probe of 2b1f0000.mhu rejects match -19
[..] probe of 2b1f0000.mhu returned 0 after 12975 usecs
[..] initcall arm_mhu_driver_init+0x0/0x24 returned 0 after 26423 usecs
[..] calling  arm_mhu_db_driver_init+0x0/0x24 @ 1
[..] bus: 'amba': driver_probe_device: matched device 2b1f0000.mhu with driver mhu-doorbell
[..] bus: 'amba': really_probe: probing driver mhu-doorbell with device 2b1f0000.mhu
[..] mhu-doorbell 2b1f0000.mhu: ARM MHU Doorbell mailbox registered
[..] driver: 'mhu-doorbell': driver_bound: bound to device '2b1f0000.mhu'
[..] bus: 'amba': really_probe: bound device 2b1f0000.mhu to driver mhu-doorbell
[..] probe of 2b1f0000.mhu returned 1 after 32287 usecs

First, the MHU driver is considered but should be rejected as
incompatible. After that, the MHU doorbell driver will succeed and bind
to the device.

Before this fix, the rejection of the MHU driver will be ignored and the
MHU doorbell will not be considered.

[..] calling  arm_mhu_driver_init+0x0/0x24 @ 1
[..] bus: 'amba': driver_probe_device: matched device 2b1f0000.mhu with driver mhu
[..] bus: 'amba': really_probe: probing driver mhu with device 2b1f0000.mhu
[..] driver: 'mhu': driver_bound: bound to device '2b1f0000.mhu'
[..] bus: 'amba': really_probe: bound device 2b1f0000.mhu to driver mhu
[..] probe of 2b1f0000.mhu returned 1 after 21547 usecs
[..] initcall arm_mhu_driver_init+0x0/0x24 returned 0 after 34791 usecs
[..] calling  arm_mhu_db_driver_init+0x0/0x24 @ 1
[..] initcall arm_mhu_db_driver_init+0x0/0x24 returned 0 after 24 usecs

Fixes: 74d428eb ("UPSTREAM: Linux 5.10.110")
Change-Id: Icaccc3a39963fc32f54074a1ff139399bbad493e
Signed-off-by: default avatarIonela Voinescu <ionela.voinescu@arm.com>
parent f57b7aab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment