Repository navigation
Commit d2f025b
mmc: sdhci: Use "mmc" directly rather than "host->mmc"
Clean up the code to use the "mmc" directly instead of "host->mmc".
If the code sits in hot code path, this clean up also brings trvial
performance improvement. Take the sdhci_post_req() for example:
before the patch:
...
8d0: a9be7bfd stp x29, x30, [sp, #-32]!
8d4: 910003fd mov x29, sp
8d8: f9000bf3 str x19, [sp, raspberrypi#16]
8dc: f9400833 ldr x19, [x1, raspberrypi#16]
8e0: b9404261 ldr w1, [x19, raspberrypi#64]
8e4: 34000161 cbz w1, 910 <sdhci_post_req+0x50>
8e8: f9424400 ldr x0, [x0, raspberrypi#1160]
8ec: d2800004 mov x4, #0x0 // #0
8f0: b9401a61 ldr w1, [x19, raspberrypi#24]
8f4: b9403262 ldr w2, [x19, raspberrypi#48]
8f8: f9400000 ldr x0, [x0]
8fc: f278003f tst x1, #0x100
900: f9401e61 ldr x1, [x19, raspberrypi#56]
904: 1a9f17e3 cset w3, eq // eq = none
908: 11000463 add w3, w3, #0x1
90c: 94000000 bl 0 <dma_unmap_sg_attrs>
...
After the patch:
...
8d0: a9be7bfd stp x29, x30, [sp, #-32]!
8d4: 910003fd mov x29, sp
8d8: f9000bf3 str x19, [sp, raspberrypi#16]
8dc: f9400833 ldr x19, [x1, raspberrypi#16]
8e0: b9404261 ldr w1, [x19, raspberrypi#64]
8e4: 34000141 cbz w1, 90c <sdhci_post_req+0x4c>
8e8: b9401a61 ldr w1, [x19, raspberrypi#24]
8ec: d2800004 mov x4, #0x0 // #0
8f0: b9403262 ldr w2, [x19, raspberrypi#48]
8f4: f9400000 ldr x0, [x0]
8f8: f278003f tst x1, #0x100
8fc: f9401e61 ldr x1, [x19, raspberrypi#56]
900: 1a9f17e3 cset w3, eq // eq = none
904: 11000463 add w3, w3, #0x1
908: 94000000 bl 0 <dma_unmap_sg_attrs>
...
We saved one ldr instruction: "ldr x0, [x0, raspberrypi#1160]"
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20210311174046.597d1951@xhacker.debian
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>1 parent ba8734d commit d2f025b
1 file changed
Lines changed: 16 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
910 | | - | |
| 910 | + | |
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
| |||
2269 | 2269 | | |
2270 | 2270 | | |
2271 | 2271 | | |
2272 | | - | |
2273 | | - | |
| 2272 | + | |
| 2273 | + | |
2274 | 2274 | | |
2275 | | - | |
| 2275 | + | |
2276 | 2276 | | |
2277 | 2277 | | |
2278 | 2278 | | |
2279 | | - | |
| 2279 | + | |
2280 | 2280 | | |
2281 | 2281 | | |
2282 | 2282 | | |
| |||
2399 | 2399 | | |
2400 | 2400 | | |
2401 | 2401 | | |
2402 | | - | |
| 2402 | + | |
2403 | 2403 | | |
2404 | 2404 | | |
2405 | 2405 | | |
| |||
2489 | 2489 | | |
2490 | 2490 | | |
2491 | 2491 | | |
2492 | | - | |
| 2492 | + | |
2493 | 2493 | | |
2494 | 2494 | | |
2495 | 2495 | | |
2496 | 2496 | | |
2497 | 2497 | | |
2498 | 2498 | | |
2499 | | - | |
| 2499 | + | |
2500 | 2500 | | |
2501 | 2501 | | |
2502 | 2502 | | |
| |||
2837 | 2837 | | |
2838 | 2838 | | |
2839 | 2839 | | |
2840 | | - | |
| 2840 | + | |
2841 | 2841 | | |
2842 | 2842 | | |
2843 | 2843 | | |
| |||
2886 | 2886 | | |
2887 | 2887 | | |
2888 | 2888 | | |
2889 | | - | |
2890 | 2889 | | |
2891 | 2890 | | |
2892 | 2891 | | |
2893 | | - | |
| 2892 | + | |
2894 | 2893 | | |
2895 | 2894 | | |
2896 | 2895 | | |
| |||
2941 | 2940 | | |
2942 | 2941 | | |
2943 | 2942 | | |
2944 | | - | |
| 2943 | + | |
2945 | 2944 | | |
2946 | | - | |
| 2945 | + | |
2947 | 2946 | | |
2948 | 2947 | | |
2949 | 2948 | | |
| |||
3677 | 3676 | | |
3678 | 3677 | | |
3679 | 3678 | | |
3680 | | - | |
| 3679 | + | |
3681 | 3680 | | |
3682 | 3681 | | |
3683 | 3682 | | |
3684 | 3683 | | |
3685 | 3684 | | |
3686 | 3685 | | |
3687 | 3686 | | |
3688 | | - | |
| 3687 | + | |
3689 | 3688 | | |
3690 | 3689 | | |
3691 | 3690 | | |
3692 | 3691 | | |
3693 | 3692 | | |
3694 | 3693 | | |
3695 | 3694 | | |
3696 | | - | |
| 3695 | + | |
3697 | 3696 | | |
3698 | 3697 | | |
3699 | 3698 | | |
| |||
4380 | 4379 | | |
4381 | 4380 | | |
4382 | 4381 | | |
4383 | | - | |
| 4382 | + | |
4384 | 4383 | | |
4385 | 4384 | | |
4386 | 4385 | | |
| |||
0 commit comments