* Pinctrl nodes missing for USB
From: Krzysztof Kozlowski @ 2016-10-26 16:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CANAwSgQ=pp93tDAERQ1iaryY3_pVhTeun=RaTo9ws1UKtS1PhA@mail.gmail.com>
On Wed, Oct 26, 2016 at 05:56:54PM +0530, Anand Moon wrote:
> Hi All,
>
> I have tried to enable CONFIG_DEBUG_PINCTRL=y on Odroid XU4.
> Just to try to understand the feature.
> Is this feature suppoted for USB nodes.
>
> Below is the output of failed to pase pinctrl for USB nodes via dts.
I do not see any question here...
Anyway the devices not instantiated from DT will have such warning and
USB devices are not present in DT, from obvious reasons... However what
surprises me is why pinctrl_dt_to_map() was called for USB devices?
Best regards,
Krzysztof
>
> [ 11.627809] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for gpx3:39
> [ 11.726818] xhci-hcd xhci-hcd.2.auto: no of_node; not parsing pinctrl DT
> [ 11.801452] usb usb3: no of_node; not parsing pinctrl DT
> [ 11.805471] hub 3-0:1.0: no of_node; not parsing pinctrl DT
> [ 11.883263] usb usb4: no of_node; not parsing pinctrl DT
> [ 11.887362] hub 4-0:1.0: no of_node; not parsing pinctrl DT
> [ 11.926683] xhci-hcd xhci-hcd.5.auto: no of_node; not parsing pinctrl DT
> [ 11.999588] usb usb5: no of_node; not parsing pinctrl DT
> [ 12.003208] hub 5-0:1.0: no of_node; not parsing pinctrl DT
> [ 12.085100] usb usb6: no of_node; not parsing pinctrl DT
> [ 12.088936] hub 6-0:1.0: no of_node; not parsing pinctrl DT
> [ 12.491299] usb 3-1: no of_node; not parsing pinctrl DT
> [ 12.528446] hub 3-1:1.0: no of_node; not parsing pinctrl DT
> [ 12.555071] usb 4-1: no of_node; not parsing pinctrl DT
> [ 12.611412] hub 4-1:1.0: no of_node; not parsing pinctrl DT
> [ 13.020668] usb 4-1.1: no of_node; not parsing pinctrl DT
> [ 13.081803] usb-storage 4-1.1:1.0: no of_node; not parsing pinctrl DT
> [ 13.091721] usb 5-1: no of_node; not parsing pinctrl DT
> [ 13.127124] r8152 5-1:2.0: no of_node; not parsing pinctrl DT
> [ 13.208321] r8152 5-1:1.0: no of_node; not parsing pinctrl DT
> [ 14.281196] sd 0:0:0:0: no of_node; not parsing pinctrl DT
> [ 16.057197] usb 4-1.2: no of_node; not parsing pinctrl DT
> [ 16.079507] usb-storage 4-1.2:1.0: no of_node; not parsing pinctrl DT
> [ 17.236626] sd 1:0:0:0: no of_node; not parsing pinctrl DT
> [ 17.612139] usbhid 2-1:1.0: no of_node; not parsing pinctrl DT
> [ 17.625511] usbhid 2-1:1.1: no of_node; not parsing pinctrl DT
> [ 17.755059] hid-generic 0003:24AE:1000.0001: no of_node; not
> parsing pinctrl DT
> [ 17.933665] hid-generic 0003:24AE:1000.0002: no of_node; not
> parsing pinctrl DT
> [ 1009.259380] usb 4-1.2: no of_node; not parsing pinctrl DT
> [ 1009.267240] usb-storage 4-1.2:1.0: no of_node; not parsing pinctrl DT
> [ 1010.311832] sd 1:0:0:0: no of_node; not parsing pinctrl DT
>
>
> Below is the complete output of dmesg | grep pinctr
> -------------------------------------
> root at odroidcsh:/usr/src/odroidxu3-4.y-devel# dmesg | grep pinc
> [ 1.704176] pinctrl core: initialized pinctrl subsystem
> [ 1.716053] reg-dummy reg-dummy: no of_node; not parsing pinctrl DT
> [ 2.221885] samsung-pinctrl 13400000.pinctrl: try to register 40 pins ...
> [ 2.221925] pinctrl core: registered pin 0 (gpy7-0) on samsung-pinctrl
> [ 2.222005] pinctrl core: registered pin 1 (gpy7-1) on samsung-pinctrl
> [ 2.222041] pinctrl core: registered pin 2 (gpy7-2) on samsung-pinctrl
> [ 2.222077] pinctrl core: registered pin 3 (gpy7-3) on samsung-pinctrl
> [ 2.222113] pinctrl core: registered pin 4 (gpy7-4) on samsung-pinctrl
> [ 2.222148] pinctrl core: registered pin 5 (gpy7-5) on samsung-pinctrl
> [ 2.222183] pinctrl core: registered pin 6 (gpy7-6) on samsung-pinctrl
> [ 2.222217] pinctrl core: registered pin 7 (gpy7-7) on samsung-pinctrl
> [ 2.222275] pinctrl core: registered pin 8 (gpx0-0) on samsung-pinctrl
> [ 2.222320] pinctrl core: registered pin 9 (gpx0-1) on samsung-pinctrl
> [ 2.222364] pinctrl core: registered pin 10 (gpx0-2) on samsung-pinctrl
> [ 2.222406] pinctrl core: registered pin 11 (gpx0-3) on samsung-pinctrl
> [ 2.222449] pinctrl core: registered pin 12 (gpx0-4) on samsung-pinctrl
> [ 2.222491] pinctrl core: registered pin 13 (gpx0-5) on samsung-pinctrl
> [ 2.222532] pinctrl core: registered pin 14 (gpx0-6) on samsung-pinctrl
> [ 2.222573] pinctrl core: registered pin 15 (gpx0-7) on samsung-pinctrl
> [ 2.222614] pinctrl core: registered pin 16 (gpx1-0) on samsung-pinctrl
> [ 2.222653] pinctrl core: registered pin 17 (gpx1-1) on samsung-pinctrl
> [ 2.222693] pinctrl core: registered pin 18 (gpx1-2) on samsung-pinctrl
> [ 2.222732] pinctrl core: registered pin 19 (gpx1-3) on samsung-pinctrl
> [ 2.222771] pinctrl core: registered pin 20 (gpx1-4) on samsung-pinctrl
> [ 2.222809] pinctrl core: registered pin 21 (gpx1-5) on samsung-pinctrl
> [ 2.222847] pinctrl core: registered pin 22 (gpx1-6) on samsung-pinctrl
> [ 2.222885] pinctrl core: registered pin 23 (gpx1-7) on samsung-pinctrl
> [ 2.222922] pinctrl core: registered pin 24 (gpx2-0) on samsung-pinctrl
> [ 2.222958] pinctrl core: registered pin 25 (gpx2-1) on samsung-pinctrl
> [ 2.222994] pinctrl core: registered pin 26 (gpx2-2) on samsung-pinctrl
> [ 2.223030] pinctrl core: registered pin 27 (gpx2-3) on samsung-pinctrl
> [ 2.223065] pinctrl core: registered pin 28 (gpx2-4) on samsung-pinctrl
> [ 2.223100] pinctrl core: registered pin 29 (gpx2-5) on samsung-pinctrl
> [ 2.223134] pinctrl core: registered pin 30 (gpx2-6) on samsung-pinctrl
> [ 2.223168] pinctrl core: registered pin 31 (gpx2-7) on samsung-pinctrl
> [ 2.223202] pinctrl core: registered pin 32 (gpx3-0) on samsung-pinctrl
> [ 2.223258] pinctrl core: registered pin 33 (gpx3-1) on samsung-pinctrl
> [ 2.223302] pinctrl core: registered pin 34 (gpx3-2) on samsung-pinctrl
> [ 2.223345] pinctrl core: registered pin 35 (gpx3-3) on samsung-pinctrl
> [ 2.223388] pinctrl core: registered pin 36 (gpx3-4) on samsung-pinctrl
> [ 2.223430] pinctrl core: registered pin 37 (gpx3-5) on samsung-pinctrl
> [ 2.223471] pinctrl core: registered pin 38 (gpx3-6) on samsung-pinctrl
> [ 2.223512] pinctrl core: registered pin 39 (gpx3-7) on samsung-pinctrl
> [ 2.324367] samsung-pinctrl 13410000.pinctrl: try to register 85 pins ...
> [ 2.324441] pinctrl core: registered pin 40 (gpc0-0) on samsung-pinctrl
> [ 2.324501] pinctrl core: registered pin 41 (gpc0-1) on samsung-pinctrl
> [ 2.324547] pinctrl core: registered pin 42 (gpc0-2) on samsung-pinctrl
> [ 2.324591] pinctrl core: registered pin 43 (gpc0-3) on samsung-pinctrl
> [ 2.324634] pinctrl core: registered pin 44 (gpc0-4) on samsung-pinctrl
> [ 2.324676] pinctrl core: registered pin 45 (gpc0-5) on samsung-pinctrl
> [ 2.324718] pinctrl core: registered pin 46 (gpc0-6) on samsung-pinctrl
> [ 2.324760] pinctrl core: registered pin 47 (gpc0-7) on samsung-pinctrl
> [ 2.324801] pinctrl core: registered pin 48 (gpc1-0) on samsung-pinctrl
> [ 2.324841] pinctrl core: registered pin 49 (gpc1-1) on samsung-pinctrl
> [ 2.324881] pinctrl core: registered pin 50 (gpc1-2) on samsung-pinctrl
> [ 2.324921] pinctrl core: registered pin 51 (gpc1-3) on samsung-pinctrl
> [ 2.324960] pinctrl core: registered pin 52 (gpc1-4) on samsung-pinctrl
> [ 2.324999] pinctrl core: registered pin 53 (gpc1-5) on samsung-pinctrl
> [ 2.325038] pinctrl core: registered pin 54 (gpc1-6) on samsung-pinctrl
> [ 2.325076] pinctrl core: registered pin 55 (gpc1-7) on samsung-pinctrl
> [ 2.325113] pinctrl core: registered pin 56 (gpc2-0) on samsung-pinctrl
> [ 2.325151] pinctrl core: registered pin 57 (gpc2-1) on samsung-pinctrl
> [ 2.325187] pinctrl core: registered pin 58 (gpc2-2) on samsung-pinctrl
> [ 2.325224] pinctrl core: registered pin 59 (gpc2-3) on samsung-pinctrl
> [ 2.325259] pinctrl core: registered pin 60 (gpc2-4) on samsung-pinctrl
> [ 2.325295] pinctrl core: registered pin 61 (gpc2-5) on samsung-pinctrl
> [ 2.325330] pinctrl core: registered pin 62 (gpc2-6) on samsung-pinctrl
> [ 2.325365] pinctrl core: registered pin 63 (gpc3-0) on samsung-pinctrl
> [ 2.325468] pinctrl core: registered pin 64 (gpc3-1) on samsung-pinctrl
> [ 2.325503] pinctrl core: registered pin 65 (gpc3-2) on samsung-pinctrl
> [ 2.325560] pinctrl core: registered pin 66 (gpc3-3) on samsung-pinctrl
> [ 2.325604] pinctrl core: registered pin 67 (gpc4-0) on samsung-pinctrl
> [ 2.325647] pinctrl core: registered pin 68 (gpc4-1) on samsung-pinctrl
> [ 2.325795] pinctrl core: registered pin 69 (gpd1-0) on samsung-pinctrl
> [ 2.325839] pinctrl core: registered pin 70 (gpd1-1) on samsung-pinctrl
> [ 2.325881] pinctrl core: registered pin 71 (gpd1-2) on samsung-pinctrl
> [ 2.325923] pinctrl core: registered pin 72 (gpd1-3) on samsung-pinctrl
> [ 2.325963] pinctrl core: registered pin 73 (gpd1-4) on samsung-pinctrl
> [ 2.326004] pinctrl core: registered pin 74 (gpd1-5) on samsung-pinctrl
> [ 2.326044] pinctrl core: registered pin 75 (gpd1-6) on samsung-pinctrl
> [ 2.326084] pinctrl core: registered pin 76 (gpd1-7) on samsung-pinctrl
> [ 2.326123] pinctrl core: registered pin 77 (gpy0-0) on samsung-pinctrl
> [ 2.326163] pinctrl core: registered pin 78 (gpy0-1) on samsung-pinctrl
> [ 2.326201] pinctrl core: registered pin 79 (gpy0-2) on samsung-pinctrl
> [ 2.326239] pinctrl core: registered pin 80 (gpy0-3) on samsung-pinctrl
> [ 2.326277] pinctrl core: registered pin 81 (gpy0-4) on samsung-pinctrl
> [ 2.326314] pinctrl core: registered pin 82 (gpy0-5) on samsung-pinctrl
> [ 2.326351] pinctrl core: registered pin 83 (gpy1-0) on samsung-pinctrl
> [ 2.326387] pinctrl core: registered pin 84 (gpy1-1) on samsung-pinctrl
> [ 2.326423] pinctrl core: registered pin 85 (gpy1-2) on samsung-pinctrl
> [ 2.326459] pinctrl core: registered pin 86 (gpy1-3) on samsung-pinctrl
> [ 2.326493] pinctrl core: registered pin 87 (gpy2-0) on samsung-pinctrl
> [ 2.326528] pinctrl core: registered pin 88 (gpy2-1) on samsung-pinctrl
> [ 2.326562] pinctrl core: registered pin 89 (gpy2-2) on samsung-pinctrl
> [ 2.326596] pinctrl core: registered pin 90 (gpy2-3) on samsung-pinctrl
> [ 2.326653] pinctrl core: registered pin 91 (gpy2-4) on samsung-pinctrl
> [ 2.326697] pinctrl core: registered pin 92 (gpy2-5) on samsung-pinctrl
> [ 2.326740] pinctrl core: registered pin 93 (gpy3-0) on samsung-pinctrl
> [ 2.326782] pinctrl core: registered pin 94 (gpy3-1) on samsung-pinctrl
> [ 2.326824] pinctrl core: registered pin 95 (gpy3-2) on samsung-pinctrl
> [ 2.326866] pinctrl core: registered pin 96 (gpy3-3) on samsung-pinctrl
> [ 2.326908] pinctrl core: registered pin 97 (gpy3-4) on samsung-pinctrl
> [ 2.326949] pinctrl core: registered pin 98 (gpy3-5) on samsung-pinctrl
> [ 2.326990] pinctrl core: registered pin 99 (gpy3-6) on samsung-pinctrl
> [ 2.327030] pinctrl core: registered pin 100 (gpy3-7) on samsung-pinctrl
> [ 2.327070] pinctrl core: registered pin 101 (gpy4-0) on samsung-pinctrl
> [ 2.327110] pinctrl core: registered pin 102 (gpy4-1) on samsung-pinctrl
> [ 2.327148] pinctrl core: registered pin 103 (gpy4-2) on samsung-pinctrl
> [ 2.327187] pinctrl core: registered pin 104 (gpy4-3) on samsung-pinctrl
> [ 2.327225] pinctrl core: registered pin 105 (gpy4-4) on samsung-pinctrl
> [ 2.327263] pinctrl core: registered pin 106 (gpy4-5) on samsung-pinctrl
> [ 2.327300] pinctrl core: registered pin 107 (gpy4-6) on samsung-pinctrl
> [ 2.327337] pinctrl core: registered pin 108 (gpy4-7) on samsung-pinctrl
> [ 2.327373] pinctrl core: registered pin 109 (gpy5-0) on samsung-pinctrl
> [ 2.327409] pinctrl core: registered pin 110 (gpy5-1) on samsung-pinctrl
> [ 2.327445] pinctrl core: registered pin 111 (gpy5-2) on samsung-pinctrl
> [ 2.327479] pinctrl core: registered pin 112 (gpy5-3) on samsung-pinctrl
> [ 2.327514] pinctrl core: registered pin 113 (gpy5-4) on samsung-pinctrl
> [ 2.327548] pinctrl core: registered pin 114 (gpy5-5) on samsung-pinctrl
> [ 2.327583] pinctrl core: registered pin 115 (gpy5-6) on samsung-pinctrl
> [ 2.327639] pinctrl core: registered pin 116 (gpy5-7) on samsung-pinctrl
> [ 2.327683] pinctrl core: registered pin 117 (gpy6-0) on samsung-pinctrl
> [ 2.327726] pinctrl core: registered pin 118 (gpy6-1) on samsung-pinctrl
> [ 2.327769] pinctrl core: registered pin 119 (gpy6-2) on samsung-pinctrl
> [ 2.327812] pinctrl core: registered pin 120 (gpy6-3) on samsung-pinctrl
> [ 2.327853] pinctrl core: registered pin 121 (gpy6-4) on samsung-pinctrl
> [ 2.327894] pinctrl core: registered pin 122 (gpy6-5) on samsung-pinctrl
> [ 2.327935] pinctrl core: registered pin 123 (gpy6-6) on samsung-pinctrl
> [ 2.327976] pinctrl core: registered pin 124 (gpy6-7) on samsung-pinctrl
> [ 2.381195] samsung-pinctrl 14000000.pinctrl: try to register 46 pins ...
> [ 2.381304] pinctrl core: registered pin 125 (gpe0-0) on samsung-pinctrl
> [ 2.381343] pinctrl core: registered pin 126 (gpe0-1) on samsung-pinctrl
> [ 2.381381] pinctrl core: registered pin 127 (gpe0-2) on samsung-pinctrl
> [ 2.381452] pinctrl core: registered pin 128 (gpe0-3) on samsung-pinctrl
> [ 2.381489] pinctrl core: registered pin 129 (gpe0-4) on samsung-pinctrl
> [ 2.381526] pinctrl core: registered pin 130 (gpe0-5) on samsung-pinctrl
> [ 2.381562] pinctrl core: registered pin 131 (gpe0-6) on samsung-pinctrl
> [ 2.381597] pinctrl core: registered pin 132 (gpe0-7) on samsung-pinctrl
> [ 2.381633] pinctrl core: registered pin 133 (gpe1-0) on samsung-pinctrl
> [ 2.381668] pinctrl core: registered pin 134 (gpe1-1) on samsung-pinctrl
> [ 2.381702] pinctrl core: registered pin 135 (gpf0-0) on samsung-pinctrl
> [ 2.381737] pinctrl core: registered pin 136 (gpf0-1) on samsung-pinctrl
> [ 2.381794] pinctrl core: registered pin 137 (gpf0-2) on samsung-pinctrl
> [ 2.381838] pinctrl core: registered pin 138 (gpf0-3) on samsung-pinctrl
> [ 2.381881] pinctrl core: registered pin 139 (gpf0-4) on samsung-pinctrl
> [ 2.381923] pinctrl core: registered pin 140 (gpf0-5) on samsung-pinctrl
> [ 2.381965] pinctrl core: registered pin 141 (gpf1-0) on samsung-pinctrl
> [ 2.382006] pinctrl core: registered pin 142 (gpf1-1) on samsung-pinctrl
> [ 2.382048] pinctrl core: registered pin 143 (gpf1-2) on samsung-pinctrl
> [ 2.382089] pinctrl core: registered pin 144 (gpf1-3) on samsung-pinctrl
> [ 2.382129] pinctrl core: registered pin 145 (gpf1-4) on samsung-pinctrl
> [ 2.382169] pinctrl core: registered pin 146 (gpf1-5) on samsung-pinctrl
> [ 2.382209] pinctrl core: registered pin 147 (gpf1-6) on samsung-pinctrl
> [ 2.382248] pinctrl core: registered pin 148 (gpf1-7) on samsung-pinctrl
> [ 2.382287] pinctrl core: registered pin 149 (gpg0-0) on samsung-pinctrl
> [ 2.382326] pinctrl core: registered pin 150 (gpg0-1) on samsung-pinctrl
> [ 2.382363] pinctrl core: registered pin 151 (gpg0-2) on samsung-pinctrl
> [ 2.382400] pinctrl core: registered pin 152 (gpg0-3) on samsung-pinctrl
> [ 2.382437] pinctrl core: registered pin 153 (gpg0-4) on samsung-pinctrl
> [ 2.382473] pinctrl core: registered pin 154 (gpg0-5) on samsung-pinctrl
> [ 2.382509] pinctrl core: registered pin 155 (gpg0-6) on samsung-pinctrl
> [ 2.382544] pinctrl core: registered pin 156 (gpg0-7) on samsung-pinctrl
> [ 2.382580] pinctrl core: registered pin 157 (gpg1-0) on samsung-pinctrl
> [ 2.382614] pinctrl core: registered pin 158 (gpg1-1) on samsung-pinctrl
> [ 2.382649] pinctrl core: registered pin 159 (gpg1-2) on samsung-pinctrl
> [ 2.382683] pinctrl core: registered pin 160 (gpg1-3) on samsung-pinctrl
> [ 2.382717] pinctrl core: registered pin 161 (gpg1-4) on samsung-pinctrl
> [ 2.382774] pinctrl core: registered pin 162 (gpg1-5) on samsung-pinctrl
> [ 2.382818] pinctrl core: registered pin 163 (gpg1-6) on samsung-pinctrl
> [ 2.382861] pinctrl core: registered pin 164 (gpg1-7) on samsung-pinctrl
> [ 2.382903] pinctrl core: registered pin 165 (gpg2-0) on samsung-pinctrl
> [ 2.382945] pinctrl core: registered pin 166 (gpg2-1) on samsung-pinctrl
> [ 2.382987] pinctrl core: registered pin 167 (gpj4-0) on samsung-pinctrl
> [ 2.383027] pinctrl core: registered pin 168 (gpj4-1) on samsung-pinctrl
> [ 2.383068] pinctrl core: registered pin 169 (gpj4-2) on samsung-pinctrl
> [ 2.383108] pinctrl core: registered pin 170 (gpj4-3) on samsung-pinctrl
> [ 2.443773] samsung-pinctrl 14010000.pinctrl: try to register 54 pins ...
> [ 2.443876] pinctrl core: registered pin 171 (gpa0-0) on samsung-pinctrl
> [ 2.443912] pinctrl core: registered pin 172 (gpa0-1) on samsung-pinctrl
> [ 2.443948] pinctrl core: registered pin 173 (gpa0-2) on samsung-pinctrl
> [ 2.443983] pinctrl core: registered pin 174 (gpa0-3) on samsung-pinctrl
> [ 2.444041] pinctrl core: registered pin 175 (gpa0-4) on samsung-pinctrl
> [ 2.444085] pinctrl core: registered pin 176 (gpa0-5) on samsung-pinctrl
> [ 2.444129] pinctrl core: registered pin 177 (gpa0-6) on samsung-pinctrl
> [ 2.444172] pinctrl core: registered pin 178 (gpa0-7) on samsung-pinctrl
> [ 2.444213] pinctrl core: registered pin 179 (gpa1-0) on samsung-pinctrl
> [ 2.444255] pinctrl core: registered pin 180 (gpa1-1) on samsung-pinctrl
> [ 2.444297] pinctrl core: registered pin 181 (gpa1-2) on samsung-pinctrl
> [ 2.444338] pinctrl core: registered pin 182 (gpa1-3) on samsung-pinctrl
> [ 2.444379] pinctrl core: registered pin 183 (gpa1-4) on samsung-pinctrl
> [ 2.444419] pinctrl core: registered pin 184 (gpa1-5) on samsung-pinctrl
> [ 2.444458] pinctrl core: registered pin 185 (gpa2-0) on samsung-pinctrl
> [ 2.444497] pinctrl core: registered pin 186 (gpa2-1) on samsung-pinctrl
> [ 2.444536] pinctrl core: registered pin 187 (gpa2-2) on samsung-pinctrl
> [ 2.444575] pinctrl core: registered pin 188 (gpa2-3) on samsung-pinctrl
> [ 2.444612] pinctrl core: registered pin 189 (gpa2-4) on samsung-pinctrl
> [ 2.444650] pinctrl core: registered pin 190 (gpa2-5) on samsung-pinctrl
> [ 2.444687] pinctrl core: registered pin 191 (gpa2-6) on samsung-pinctrl
> [ 2.444756] pinctrl core: registered pin 192 (gpa2-7) on samsung-pinctrl
> [ 2.444792] pinctrl core: registered pin 193 (gpb0-0) on samsung-pinctrl
> [ 2.444828] pinctrl core: registered pin 194 (gpb0-1) on samsung-pinctrl
> [ 2.444864] pinctrl core: registered pin 195 (gpb0-2) on samsung-pinctrl
> [ 2.444899] pinctrl core: registered pin 196 (gpb0-3) on samsung-pinctrl
> [ 2.444934] pinctrl core: registered pin 197 (gpb0-4) on samsung-pinctrl
> [ 2.444968] pinctrl core: registered pin 198 (gpb1-0) on samsung-pinctrl
> [ 2.445002] pinctrl core: registered pin 199 (gpb1-1) on samsung-pinctrl
> [ 2.445059] pinctrl core: registered pin 200 (gpb1-2) on samsung-pinctrl
> [ 2.445102] pinctrl core: registered pin 201 (gpb1-3) on samsung-pinctrl
> [ 2.445145] pinctrl core: registered pin 202 (gpb1-4) on samsung-pinctrl
> [ 2.445188] pinctrl core: registered pin 203 (gpb2-0) on samsung-pinctrl
> [ 2.445231] pinctrl core: registered pin 204 (gpb2-1) on samsung-pinctrl
> [ 2.445273] pinctrl core: registered pin 205 (gpb2-2) on samsung-pinctrl
> [ 2.445314] pinctrl core: registered pin 206 (gpb2-3) on samsung-pinctrl
> [ 2.445355] pinctrl core: registered pin 207 (gpb3-0) on samsung-pinctrl
> [ 2.445395] pinctrl core: registered pin 208 (gpb3-1) on samsung-pinctrl
> [ 2.445435] pinctrl core: registered pin 209 (gpb3-2) on samsung-pinctrl
> [ 2.445475] pinctrl core: registered pin 210 (gpb3-3) on samsung-pinctrl
> [ 2.445514] pinctrl core: registered pin 211 (gpb3-4) on samsung-pinctrl
> [ 2.445553] pinctrl core: registered pin 212 (gpb3-5) on samsung-pinctrl
> [ 2.445591] pinctrl core: registered pin 213 (gpb3-6) on samsung-pinctrl
> [ 2.445629] pinctrl core: registered pin 214 (gpb3-7) on samsung-pinctrl
> [ 2.445766] pinctrl core: registered pin 215 (gpb4-0) on samsung-pinctrl
> [ 2.445806] pinctrl core: registered pin 216 (gpb4-1) on samsung-pinctrl
> [ 2.445843] pinctrl core: registered pin 217 (gph0-0) on samsung-pinctrl
> [ 2.445879] pinctrl core: registered pin 218 (gph0-1) on samsung-pinctrl
> [ 2.445915] pinctrl core: registered pin 219 (gph0-2) on samsung-pinctrl
> [ 2.445950] pinctrl core: registered pin 220 (gph0-3) on samsung-pinctrl
> [ 2.445985] pinctrl core: registered pin 221 (gph0-4) on samsung-pinctrl
> [ 2.446019] pinctrl core: registered pin 222 (gph0-5) on samsung-pinctrl
> [ 2.446053] pinctrl core: registered pin 223 (gph0-6) on samsung-pinctrl
> [ 2.446088] pinctrl core: registered pin 224 (gph0-7) on samsung-pinctrl
> [ 2.459704] samsung-pinctrl 3860000.pinctrl: try to register 7 pins ...
> [ 2.459809] pinctrl core: registered pin 225 (gpz-0) on samsung-pinctrl
> [ 2.459849] pinctrl core: registered pin 226 (gpz-1) on samsung-pinctrl
> [ 2.459888] pinctrl core: registered pin 227 (gpz-2) on samsung-pinctrl
> [ 2.459927] pinctrl core: registered pin 228 (gpz-3) on samsung-pinctrl
> [ 2.459965] pinctrl core: registered pin 229 (gpz-4) on samsung-pinctrl
> [ 2.460003] pinctrl core: registered pin 230 (gpz-5) on samsung-pinctrl
> [ 2.460040] pinctrl core: registered pin 231 (gpz-6) on samsung-pinctrl
> [ 2.939603] pinctrl core: add 4 pinctrl maps
> [ 2.939841] samsung-pinctrl 14010000.pinctrl: found group selector
> 6 for gpa0-6
> [ 2.939894] samsung-pinctrl 14010000.pinctrl: found group selector
> 6 for gpa0-6
> [ 2.939944] samsung-pinctrl 14010000.pinctrl: found group selector
> 7 for gpa0-7
> [ 2.939992] samsung-pinctrl 14010000.pinctrl: found group selector
> 7 for gpa0-7
> [ 2.940022] samsung-pinctrl 14010000.pinctrl: request pin 177
> (gpa0-6) for 12c80000.i2c
> [ 2.940089] samsung-pinctrl 14010000.pinctrl: request pin 178
> (gpa0-7) for 12c80000.i2c
> [ 2.941356] s3c-i2c 12c80000.i2c: obtain a copy of previously claimed pinctrl
> [ 4.370371] alarmtimer alarmtimer: no of_node; not parsing pinctrl DT
> [ 5.154339] pinctrl core: add 2 pinctrl maps
> [ 5.154682] pinctrl core: add 2 pinctrl maps
> [ 5.154943] samsung-pinctrl 14010000.pinctrl: found group selector
> 32 for gpb2-0
> [ 5.155011] samsung-pinctrl 14010000.pinctrl: found group selector
> 32 for gpb2-0
> [ 5.155082] samsung-pinctrl 14010000.pinctrl: found group selector
> 34 for gpb2-2
> [ 5.155148] samsung-pinctrl 14010000.pinctrl: found group selector
> 34 for gpb2-2
> [ 5.155183] samsung-pinctrl 14010000.pinctrl: request pin 203
> (gpb2-0) for 12dd0000.pwm
> [ 5.155224] samsung-pinctrl 14010000.pinctrl: request pin 205
> (gpb2-2) for 12dd0000.pwm
> [ 6.901592] serial8250 serial8250: no of_node; not parsing pinctrl DT
> [ 9.157724] pinctrl core: add 2 pinctrl maps
> [ 9.157952] samsung-pinctrl 13400000.pinctrl: found group selector
> 39 for gpx3-7
> [ 9.158011] samsung-pinctrl 13400000.pinctrl: found group selector
> 39 for gpx3-7
> [ 9.158041] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for 14530000.hdmi
> [ 9.158853] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for gpx3:39
> [ 9.169059] exynos-drm exynos-drm: no of_node; not parsing pinctrl DT
> [ 9.683767] usb usb1: no of_node; not parsing pinctrl DT
> [ 9.688758] hub 1-0:1.0: no of_node; not parsing pinctrl DT
> [ 9.854041] usb usb2: no of_node; not parsing pinctrl DT
> [ 9.857966] hub 2-0:1.0: no of_node; not parsing pinctrl DT
> [ 9.925566] pinctrl core: add 4 pinctrl maps
> [ 9.925744] samsung-pinctrl 14010000.pinctrl: found group selector
> 14 for gpa2-0
> [ 9.925992] samsung-pinctrl 14010000.pinctrl: found group selector
> 14 for gpa2-0
> [ 9.926046] samsung-pinctrl 14010000.pinctrl: found group selector
> 15 for gpa2-1
> [ 9.926092] samsung-pinctrl 14010000.pinctrl: found group selector
> 15 for gpa2-1
> [ 9.926122] samsung-pinctrl 14010000.pinctrl: request pin 185
> (gpa2-0) for 12ca0000.i2c
> [ 9.926155] samsung-pinctrl 14010000.pinctrl: request pin 186
> (gpa2-1) for 12ca0000.i2c
> [ 9.938344] pinctrl core: add 2 pinctrl maps
> [ 9.938564] samsung-pinctrl 13400000.pinctrl: found group selector
> 12 for gpx0-4
> [ 9.938620] samsung-pinctrl 13400000.pinctrl: found group selector
> 12 for gpx0-4
> [ 9.938649] samsung-pinctrl 13400000.pinctrl: request pin 12
> (gpx0-4) for 4-0066
> [ 9.951595] s2mps11-pmic s2mps11-regulator: no of_node; not parsing
> pinctrl DT
> [ 10.354652] s5m-rtc s2mps14-rtc: no of_node; not parsing pinctrl DT
> [ 10.358618] dummy 4-0006: no of_node; not parsing pinctrl DT
> [ 10.391220] s2mps11-clk s2mps11-clk: no of_node; not parsing pinctrl DT
> [ 10.504969] cpufreq-dt cpufreq-dt: no of_node; not parsing pinctrl DT
> [ 10.605180] pinctrl core: add 2 pinctrl maps
> [ 10.605286] samsung-pinctrl 13410000.pinctrl: found group selector
> 29 for gpd1-0
> [ 10.605313] samsung-pinctrl 13410000.pinctrl: found group selector
> 29 for gpd1-0
> [ 10.605331] samsung-pinctrl 13410000.pinctrl: request pin 69
> (gpd1-0) for pwrseq
> [ 10.605645] samsung-pinctrl 13410000.pinctrl: request pin 69
> (gpd1-0) for gpd1:69
> [ 10.623242] pinctrl core: add 2 pinctrl maps
> [ 10.623392] pinctrl core: add 2 pinctrl maps
> [ 10.623536] pinctrl core: add 2 pinctrl maps
> [ 10.623706] pinctrl core: add 6 pinctrl maps
> [ 10.623878] pinctrl core: add 8 pinctrl maps
> [ 10.624024] pinctrl core: add 2 pinctrl maps
> [ 10.624174] pinctrl core: add 2 pinctrl maps
> [ 10.624278] samsung-pinctrl 13410000.pinctrl: found group selector
> 0 for gpc0-0
> [ 10.624307] samsung-pinctrl 13410000.pinctrl: found group selector
> 0 for gpc0-0
> [ 10.624335] samsung-pinctrl 13410000.pinctrl: found group selector
> 1 for gpc0-1
> [ 10.624362] samsung-pinctrl 13410000.pinctrl: found group selector
> 1 for gpc0-1
> [ 10.624389] samsung-pinctrl 13410000.pinctrl: found group selector
> 3 for gpc0-3
> [ 10.624415] samsung-pinctrl 13410000.pinctrl: found group selector
> 3 for gpc0-3
> [ 10.624442] samsung-pinctrl 13410000.pinctrl: found group selector
> 4 for gpc0-4
> [ 10.624467] samsung-pinctrl 13410000.pinctrl: found group selector
> 4 for gpc0-4
> [ 10.624493] samsung-pinctrl 13410000.pinctrl: found group selector
> 5 for gpc0-5
> [ 10.624518] samsung-pinctrl 13410000.pinctrl: found group selector
> 5 for gpc0-5
> [ 10.624543] samsung-pinctrl 13410000.pinctrl: found group selector
> 6 for gpc0-6
> [ 10.624568] samsung-pinctrl 13410000.pinctrl: found group selector
> 6 for gpc0-6
> [ 10.624594] samsung-pinctrl 13410000.pinctrl: found group selector
> 23 for gpc3-0
> [ 10.624619] samsung-pinctrl 13410000.pinctrl: found group selector
> 23 for gpc3-0
> [ 10.624644] samsung-pinctrl 13410000.pinctrl: found group selector
> 24 for gpc3-1
> [ 10.624668] samsung-pinctrl 13410000.pinctrl: found group selector
> 24 for gpc3-1
> [ 10.624693] samsung-pinctrl 13410000.pinctrl: found group selector
> 25 for gpc3-2
> [ 10.624717] samsung-pinctrl 13410000.pinctrl: found group selector
> 25 for gpc3-2
> [ 10.624755] samsung-pinctrl 13410000.pinctrl: found group selector
> 26 for gpc3-3
> [ 10.624785] samsung-pinctrl 13410000.pinctrl: found group selector
> 26 for gpc3-3
> [ 10.624815] samsung-pinctrl 13410000.pinctrl: found group selector
> 2 for gpc0-2
> [ 10.624843] samsung-pinctrl 13410000.pinctrl: found group selector
> 2 for gpc0-2
> [ 10.624873] samsung-pinctrl 13410000.pinctrl: found group selector
> 7 for gpc0-7
> [ 10.624901] samsung-pinctrl 13410000.pinctrl: found group selector
> 7 for gpc0-7
> [ 10.624917] samsung-pinctrl 13410000.pinctrl: request pin 40
> (gpc0-0) for 12200000.mmc
> [ 10.624936] samsung-pinctrl 13410000.pinctrl: request pin 41
> (gpc0-1) for 12200000.mmc
> [ 10.624954] samsung-pinctrl 13410000.pinctrl: request pin 43
> (gpc0-3) for 12200000.mmc
> [ 10.624972] samsung-pinctrl 13410000.pinctrl: request pin 44
> (gpc0-4) for 12200000.mmc
> [ 10.624990] samsung-pinctrl 13410000.pinctrl: request pin 45
> (gpc0-5) for 12200000.mmc
> [ 10.625007] samsung-pinctrl 13410000.pinctrl: request pin 46
> (gpc0-6) for 12200000.mmc
> [ 10.625025] samsung-pinctrl 13410000.pinctrl: request pin 63
> (gpc3-0) for 12200000.mmc
> [ 10.625043] samsung-pinctrl 13410000.pinctrl: request pin 64
> (gpc3-1) for 12200000.mmc
> [ 10.625061] samsung-pinctrl 13410000.pinctrl: request pin 65
> (gpc3-2) for 12200000.mmc
> [ 10.625078] samsung-pinctrl 13410000.pinctrl: request pin 66
> (gpc3-3) for 12200000.mmc
> [ 10.625095] samsung-pinctrl 13410000.pinctrl: request pin 42
> (gpc0-2) for 12200000.mmc
> [ 10.625113] samsung-pinctrl 13410000.pinctrl: request pin 47
> (gpc0-7) for 12200000.mmc
> [ 10.654376] samsung-pinctrl 13410000.pinctrl: request pin 42
> (gpc0-2) for gpc0:42
> [ 10.734790] pinctrl core: add 2 pinctrl maps
> [ 10.735262] pinctrl core: add 2 pinctrl maps
> [ 10.736085] pinctrl core: add 2 pinctrl maps
> [ 10.736604] pinctrl core: add 2 pinctrl maps
> [ 10.737220] pinctrl core: add 6 pinctrl maps
> [ 10.737601] samsung-pinctrl 13410000.pinctrl: found group selector
> 16 for gpc2-0
> [ 10.737699] samsung-pinctrl 13410000.pinctrl: found group selector
> 16 for gpc2-0
> [ 10.737803] samsung-pinctrl 13410000.pinctrl: found group selector
> 17 for gpc2-1
> [ 10.737899] samsung-pinctrl 13410000.pinctrl: found group selector
> 17 for gpc2-1
> [ 10.738001] samsung-pinctrl 13410000.pinctrl: found group selector
> 18 for gpc2-2
> [ 10.738095] samsung-pinctrl 13410000.pinctrl: found group selector
> 18 for gpc2-2
> [ 10.738196] samsung-pinctrl 13410000.pinctrl: found group selector
> 19 for gpc2-3
> [ 10.738289] samsung-pinctrl 13410000.pinctrl: found group selector
> 19 for gpc2-3
> [ 10.738389] samsung-pinctrl 13410000.pinctrl: found group selector
> 20 for gpc2-4
> [ 10.738481] samsung-pinctrl 13410000.pinctrl: found group selector
> 20 for gpc2-4
> [ 10.738642] samsung-pinctrl 13410000.pinctrl: found group selector
> 21 for gpc2-5
> [ 10.738749] samsung-pinctrl 13410000.pinctrl: found group selector
> 21 for gpc2-5
> [ 10.738863] samsung-pinctrl 13410000.pinctrl: found group selector
> 22 for gpc2-6
> [ 10.738968] samsung-pinctrl 13410000.pinctrl: found group selector
> 22 for gpc2-6
> [ 10.739022] samsung-pinctrl 13410000.pinctrl: request pin 56
> (gpc2-0) for 12220000.mmc
> [ 10.739078] samsung-pinctrl 13410000.pinctrl: request pin 57
> (gpc2-1) for 12220000.mmc
> [ 10.739127] samsung-pinctrl 13410000.pinctrl: request pin 58
> (gpc2-2) for 12220000.mmc
> [ 10.739175] samsung-pinctrl 13410000.pinctrl: request pin 59
> (gpc2-3) for 12220000.mmc
> [ 10.739224] samsung-pinctrl 13410000.pinctrl: request pin 60
> (gpc2-4) for 12220000.mmc
> [ 10.739272] samsung-pinctrl 13410000.pinctrl: request pin 61
> (gpc2-5) for 12220000.mmc
> [ 10.739320] samsung-pinctrl 13410000.pinctrl: request pin 62
> (gpc2-6) for 12220000.mmc
> [ 10.923667] mmcblk mmc1:0007: no of_node; not parsing pinctrl DT
> [ 11.140046] snd-soc-dummy snd-soc-dummy: no of_node; not parsing pinctrl DT
> [ 11.220467] usb 2-1: no of_node; not parsing pinctrl DT
> [ 11.626518] pinctrl core: add 2 pinctrl maps
> [ 11.626743] samsung-pinctrl 13400000.pinctrl: found group selector
> 39 for gpx3-7
> [ 11.626793] samsung-pinctrl 13400000.pinctrl: found group selector
> 39 for gpx3-7
> [ 11.626820] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for 14530000.hdmi
> [ 11.627809] samsung-pinctrl 13400000.pinctrl: request pin 39
> (gpx3-7) for gpx3:39
> [ 11.726818] xhci-hcd xhci-hcd.2.auto: no of_node; not parsing pinctrl DT
> [ 11.801452] usb usb3: no of_node; not parsing pinctrl DT
> [ 11.805471] hub 3-0:1.0: no of_node; not parsing pinctrl DT
> [ 11.883263] usb usb4: no of_node; not parsing pinctrl DT
> [ 11.887362] hub 4-0:1.0: no of_node; not parsing pinctrl DT
> [ 11.926683] xhci-hcd xhci-hcd.5.auto: no of_node; not parsing pinctrl DT
> [ 11.999588] usb usb5: no of_node; not parsing pinctrl DT
> [ 12.003208] hub 5-0:1.0: no of_node; not parsing pinctrl DT
> [ 12.085100] usb usb6: no of_node; not parsing pinctrl DT
> [ 12.088936] hub 6-0:1.0: no of_node; not parsing pinctrl DT
> [ 12.491299] usb 3-1: no of_node; not parsing pinctrl DT
> [ 12.528446] hub 3-1:1.0: no of_node; not parsing pinctrl DT
> [ 12.555071] usb 4-1: no of_node; not parsing pinctrl DT
> [ 12.611412] hub 4-1:1.0: no of_node; not parsing pinctrl DT
> [ 13.020668] usb 4-1.1: no of_node; not parsing pinctrl DT
> [ 13.081803] usb-storage 4-1.1:1.0: no of_node; not parsing pinctrl DT
> [ 13.091721] usb 5-1: no of_node; not parsing pinctrl DT
> [ 13.127124] r8152 5-1:2.0: no of_node; not parsing pinctrl DT
> [ 13.208321] r8152 5-1:1.0: no of_node; not parsing pinctrl DT
> [ 14.281196] sd 0:0:0:0: no of_node; not parsing pinctrl DT
> [ 16.057197] usb 4-1.2: no of_node; not parsing pinctrl DT
> [ 16.079507] usb-storage 4-1.2:1.0: no of_node; not parsing pinctrl DT
> [ 17.236626] sd 1:0:0:0: no of_node; not parsing pinctrl DT
> [ 17.612139] usbhid 2-1:1.0: no of_node; not parsing pinctrl DT
> [ 17.625511] usbhid 2-1:1.1: no of_node; not parsing pinctrl DT
> [ 17.755059] hid-generic 0003:24AE:1000.0001: no of_node; not
> parsing pinctrl DT
> [ 17.933665] hid-generic 0003:24AE:1000.0002: no of_node; not
> parsing pinctrl DT
> [ 1009.259380] usb 4-1.2: no of_node; not parsing pinctrl DT
> [ 1009.267240] usb-storage 4-1.2:1.0: no of_node; not parsing pinctrl DT
> [ 1010.311832] sd 1:0:0:0: no of_node; not parsing pinctrl DT
>
> Best Regards
> -Anand Moon
^ permalink raw reply
* [PATCH 3/4] iommu/arm-smmu: Add context save restore support
From: Robin Murphy @ 2016-10-26 16:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477070066-15044-4-git-send-email-sricharan@codeaurora.org>
On 21/10/16 18:14, Sricharan R wrote:
> The smes registers and the context bank registers are
> the ones that are needs to be saved and restored.
> Fortunately the smes are already stored as a part
"Fortunately"? Hey, that's by design! :P
I was actually planning to finish off suspend/resume beyond those
foundations laid by the big rework, so it's nice to see something already.
> of the smmu device structure. So just write that
> back. The data required to configure the context banks
> are the master's domain data and pgtable cfgs.
> So store them as a part of the context banks info
> and just reconfigure the context banks on the restore
> path.
>
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> ---
> drivers/iommu/arm-smmu.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 51 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
> index 45f2762..578cdc2 100644
> --- a/drivers/iommu/arm-smmu.c
> +++ b/drivers/iommu/arm-smmu.c
> @@ -328,6 +328,11 @@ struct arm_smmu_master_cfg {
> #define for_each_cfg_sme(fw, i, idx) \
> for (i = 0; idx = __fwspec_cfg(fw)->smendx[i], i < fw->num_ids; ++i)
>
> +struct cbinfo {
> + struct arm_smmu_domain *domain;
> + struct io_pgtable_cfg pgtbl_cfg;
> +};
> +
> struct arm_smmu_device {
> struct device *dev;
>
> @@ -378,6 +383,9 @@ struct arm_smmu_device {
> struct clk **clocks;
>
> u32 cavium_id_base; /* Specific to Cavium */
> +
> + /* For save/restore of context bank registers */
> + struct cbinfo *cb_saved_ctx;
I'd prefer to follow the same pattern for context banks as for the
stream map registers, i.e. keep just the smmu pointer and cbndx in the
arm_smmu_domain, and move the rest of the context bank state to the
arm_smmu_device. Yes, it requires rather more refactoring, but it's
going to result in cleaner and more obvious code in the end.
> };
>
> enum arm_smmu_context_fmt {
> @@ -972,6 +980,8 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
>
> /* Initialise the context bank with our page table cfg */
> arm_smmu_init_context_bank(smmu_domain, &pgtbl_cfg);
> + smmu->cb_saved_ctx[cfg->cbndx].domain = smmu_domain;
> + smmu->cb_saved_ctx[cfg->cbndx].pgtbl_cfg = pgtbl_cfg;
>
> /*
> * Request context fault interrupt. Do this last to avoid the
> @@ -1861,6 +1871,10 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
> }
> dev_notice(smmu->dev, "\t%u context banks (%u stage-2 only)\n",
> smmu->num_context_banks, smmu->num_s2_context_banks);
> +
> + smmu->cb_saved_ctx = devm_kzalloc(smmu->dev,
> + sizeof(struct cbinfo) * smmu->num_context_banks,
> + GFP_KERNEL);
> /*
> * Cavium CN88xx erratum #27704.
> * Ensure ASID and VMID allocation is unique across all SMMUs in
> @@ -2115,8 +2129,44 @@ static int arm_smmu_resume(struct device *dev)
> {
[...]
struct arm_smmu_device *smmu = dev_get_drvdata(dev);
[...]
int ret = arm_smmu_enable_clocks(smmu);
> + if (ret)
> + return ret;
> +
> + arm_smmu_device_reset(smmu);
For reference, what I'm aiming for is for that to be the entire resume
function.
> - return arm_smmu_enable_clocks(smmu);
> + /* Restore the smes and the context banks */
> + for (idx = 0; idx < smmu->num_mapping_groups; ++idx) {
> + mutex_lock(&smmu->stream_map_mutex);
What are we taking this lock to protect against - can we resume one SMMU
multiple times in parallel?
> + if (!smrs[idx].valid) {
> + mutex_unlock(&smmu->stream_map_mutex);
> + continue;
Nope, you can't skip anything, because there's no guarantee the SMRs (or
anything else) which are invalid in the saved state are also invalid in
the current hardware state. Consider the case of restoring from hibernate.
> + }
> +
> + arm_smmu_write_sme(smmu, idx);
arm_smmu_device_reset() already did that.
> + cb = smmu->s2crs[idx].cbndx;
> + mutex_unlock(&smmu->stream_map_mutex);
> +
> + if (!i || (cb != pcb)) {
This took a while to figure out, and it seems like an unnecessary
micro-optimisation since it still doesn't actually prevent initialising
the same context bank multiple times (there's no guarantee that all
s2crs targeting that context are consecutive).
> + domain = smmu->cb_saved_ctx[cb].domain;
> + pgtbl_cfg = &smmu->cb_saved_ctx[cb].pgtbl_cfg;
> +
> + if (domain) {
> + mutex_lock(&domain->init_mutex);
Assuming the device link stuff works as I would expect it to (I've not
looked in detail), then shouldn't the SMMU be resumed before any of its
masters are, so what are we taking this lock to protect against?
Robin.
> + arm_smmu_init_context_bank(domain, pgtbl_cfg);
> + mutex_unlock(&domain->init_mutex);
> + }
> + }
> + pcb = cb;
> + i++;
> + }
> +
> + return 0;
> }
>
> static int arm_smmu_suspend(struct device *dev)
>
^ permalink raw reply
* [PATCH v7] spi: sun4i: Allow transfers larger than FIFO size
From: Mark Brown @ 2016-10-26 16:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CADi83T55fLfiMs+z0R6tf=fcFmuPS0fDFKwtXy25AKiEP1DiXw@mail.gmail.com>
On Wed, Oct 26, 2016 at 09:06:31AM -0700, Alex Gagniuc wrote:
> Thanks for the heads up! Sorry about that. Do you want me to resend
> this as a single mail?
It's fine, no need.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161026/47c93815/attachment.sig>
^ permalink raw reply
* [RFC PATCH 4/5] w1: add a callback to call slave when a new device is connected
From: Mathieu Poirier @ 2016-10-26 16:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026145756.21689-5-antoine.tenart@free-electrons.com>
On 26 October 2016 at 08:57, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:
> This patch adds the possibility for slave drivers to register a
> callback, to be called whenever a new device matching the slave ID
> is connected.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> ---
> drivers/w1/w1.c | 10 ++++++++++
> drivers/w1/w1_family.h | 2 ++
> 2 files changed, 12 insertions(+)
>
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index 80d0cc4e6e7f..7010ffd1ea93 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -659,6 +659,16 @@ static int w1_family_notify(unsigned long action, struct w1_slave *sl)
> return err;
> }
> }
> + if (fops->callback) {
> + err = fops->callback(sl);
> + /*
> + * Do not return an error as the slave driver correctly
> + * probed.
> + */
I don't get this part. What's the point of calling a callback if a
failure is not important - maybe I'm just missing something.
> + if (err)
> + dev_err(&sl->dev,
> + "callback call failed. err=%d\n", err);
> + }
>
> break;
> case BUS_NOTIFY_DEL_DEVICE:
> diff --git a/drivers/w1/w1_family.h b/drivers/w1/w1_family.h
> index 10a7a0767187..5e165babc6f3 100644
> --- a/drivers/w1/w1_family.h
> +++ b/drivers/w1/w1_family.h
> @@ -55,11 +55,13 @@ struct w1_slave;
> * @add_slave: add_slave
> * @remove_slave: remove_slave
> * @groups: sysfs group
> + * @callback: called when a new device is discovered
> */
> struct w1_family_ops
> {
> int (* add_slave)(struct w1_slave *);
> void (* remove_slave)(struct w1_slave *);
> + int (* callback)(struct w1_slave *);
> const struct attribute_group **groups;
> };
>
> --
> 2.10.1
>
^ permalink raw reply
* [RFC PATCH 3/5] w1: report errors returned by w1_family_notify
From: Mathieu Poirier @ 2016-10-26 16:39 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026145756.21689-4-antoine.tenart@free-electrons.com>
On 26 October 2016 at 08:57, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:
GKH won't accept an empty commit log.
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> ---
> drivers/w1/w1.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
> index bb34362e930a..80d0cc4e6e7f 100644
> --- a/drivers/w1/w1.c
> +++ b/drivers/w1/w1.c
> @@ -702,7 +702,9 @@ static int __w1_attach_slave_device(struct w1_slave *sl)
> dev_name(&sl->dev), err);
> return err;
> }
> - w1_family_notify(BUS_NOTIFY_ADD_DEVICE, sl);
> + err = w1_family_notify(BUS_NOTIFY_ADD_DEVICE, sl);
> + if (err)
> + return err;
>
> dev_set_uevent_suppress(&sl->dev, false);
> kobject_uevent(&sl->dev.kobj, KOBJ_ADD);
> --
> 2.10.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 2/2] ARM: dts: uniphier: add CPU clocks and OPP table for PXs2 SoC
From: Masahiro Yamada @ 2016-10-26 16:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477499859-12415-1-git-send-email-yamada.masahiro@socionext.com>
Add a CPU clock to every CPU node and a CPU OPP table to use the
generic cpufreq driver.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/boot/dts/uniphier-pxs2.dtsi | 46 ++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/arch/arm/boot/dts/uniphier-pxs2.dtsi b/arch/arm/boot/dts/uniphier-pxs2.dtsi
index 950f07b..83ba3e6 100644
--- a/arch/arm/boot/dts/uniphier-pxs2.dtsi
+++ b/arch/arm/boot/dts/uniphier-pxs2.dtsi
@@ -56,32 +56,78 @@
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <0>;
+ clocks = <&sys_clk 32>;
enable-method = "psci";
next-level-cache = <&l2>;
+ operating-points-v2 = <&cpu_opp>;
};
cpu at 1 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <1>;
+ clocks = <&sys_clk 32>;
enable-method = "psci";
next-level-cache = <&l2>;
+ operating-points-v2 = <&cpu_opp>;
};
cpu at 2 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <2>;
+ clocks = <&sys_clk 32>;
enable-method = "psci";
next-level-cache = <&l2>;
+ operating-points-v2 = <&cpu_opp>;
};
cpu at 3 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <3>;
+ clocks = <&sys_clk 32>;
enable-method = "psci";
next-level-cache = <&l2>;
+ operating-points-v2 = <&cpu_opp>;
+ };
+ };
+
+ cpu_opp: opp_table {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp at 100000000 {
+ opp-hz = /bits/ 64 <100000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 150000000 {
+ opp-hz = /bits/ 64 <150000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 200000000 {
+ opp-hz = /bits/ 64 <200000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 300000000 {
+ opp-hz = /bits/ 64 <300000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 400000000 {
+ opp-hz = /bits/ 64 <400000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 600000000 {
+ opp-hz = /bits/ 64 <600000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 800000000 {
+ opp-hz = /bits/ 64 <800000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 1200000000 {
+ opp-hz = /bits/ 64 <1200000000>;
+ clock-latency-ns = <300>;
};
};
--
1.9.1
^ permalink raw reply related
* [PATCH 1/2] ARM: dts: uniphier: add CPU clocks and OPP table for Pro5 SoC
From: Masahiro Yamada @ 2016-10-26 16:37 UTC (permalink / raw)
To: linux-arm-kernel
Add a CPU clock to every CPU node and a CPU OPP table to use the
generic cpufreq driver.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/boot/dts/uniphier-pro5.dtsi | 74 ++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/arch/arm/boot/dts/uniphier-pro5.dtsi b/arch/arm/boot/dts/uniphier-pro5.dtsi
index 5357ea9..5bd6068 100644
--- a/arch/arm/boot/dts/uniphier-pro5.dtsi
+++ b/arch/arm/boot/dts/uniphier-pro5.dtsi
@@ -56,16 +56,90 @@
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <0>;
+ clocks = <&sys_clk 32>;
enable-method = "psci";
next-level-cache = <&l2>;
+ operating-points-v2 = <&cpu_opp>;
};
cpu at 1 {
device_type = "cpu";
compatible = "arm,cortex-a9";
reg = <1>;
+ clocks = <&sys_clk 32>;
enable-method = "psci";
next-level-cache = <&l2>;
+ operating-points-v2 = <&cpu_opp>;
+ };
+ };
+
+ cpu_opp: opp_table {
+ compatible = "operating-points-v2";
+ opp-shared;
+
+ opp at 100000000 {
+ opp-hz = /bits/ 64 <100000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 116667000 {
+ opp-hz = /bits/ 64 <116667000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 150000000 {
+ opp-hz = /bits/ 64 <150000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 175000000 {
+ opp-hz = /bits/ 64 <175000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 200000000 {
+ opp-hz = /bits/ 64 <200000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 233334000 {
+ opp-hz = /bits/ 64 <233334000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 300000000 {
+ opp-hz = /bits/ 64 <300000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 350000000 {
+ opp-hz = /bits/ 64 <350000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 400000000 {
+ opp-hz = /bits/ 64 <400000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 466667000 {
+ opp-hz = /bits/ 64 <466667000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 600000000 {
+ opp-hz = /bits/ 64 <600000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 700000000 {
+ opp-hz = /bits/ 64 <700000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 800000000 {
+ opp-hz = /bits/ 64 <800000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 933334000 {
+ opp-hz = /bits/ 64 <933334000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 1200000000 {
+ opp-hz = /bits/ 64 <1200000000>;
+ clock-latency-ns = <300>;
+ };
+ opp at 1400000000 {
+ opp-hz = /bits/ 64 <1400000000>;
+ clock-latency-ns = <300>;
};
};
--
1.9.1
^ permalink raw reply related
* [PATCH v6 1/5] ARM: davinci: da8xx: add usb phy clocks
From: David Lechner @ 2016-10-26 16:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <6bcc1ac1-446c-6191-1c63-e37ccfaf9556@ti.com>
On 10/26/2016 02:59 AM, Sekhar Nori wrote:
> On Wednesday 26 October 2016 08:36 AM, David Lechner wrote:
>> Up to this point, the USB phy clock configuration was handled manually in
>> the board files and in the usb drivers. This adds proper clocks so that
>> the usb drivers can use clk_get and clk_enable and not have to worry about
>> the details. Also, the related code is removed from the board files and
>> replaced with the new clock registration functions.
>>
>> Signed-off-by: David Lechner <david@lechnology.com>
>> Signed-off-by: Axel Haslam <ahaslam@baylibre.com>
>> ---
>>
>> I have added "ARM: davinci: da8xx: Enable the usb20 "per" clk on phy_clk_enable"
>> from Axel Haslam to this patch.
>>
>> In the review of Axel's patch, Sekhar said:
>>
>>> We should not be using a NULL device pointer here. Can you pass the musb
>>> device pointer available in the same file? Also, da850_clks[] in da850.c
>>> needs to be fixed to add the matching device name.
>>
>> However, the musb device may not be registered. The usb20_clk can be used to
>> supply a 48MHz clock to USB 1.1 (ohci) without using the musb device. So, I am
>> inclined to leave this as NULL.
>
> But clock look-up has nothing to do with device being registered AFAICT.
> It is used to identify the clock consumer. Passing NULL there means the
> clock is not associated with any device. Which is not correct as we are
> specifically looking at MUSB module clock.
>
> Thanks,
> Sekhar
>
FWIW, clk_get() uses dev_name() to get the device name, which will
return NULL until after the platform device is registered.
I can add the device references anyway. However, this is complicated by
the fact that the musb platform device declaration is inside of an #if
IS_ENABLED(CONFIG_USB_MUSB_HDRC). I can either remove the #if or add
more #if's. Do you have a preference on this?
^ permalink raw reply
* [RFC PATCH 1/5] of: introduce the overlay manager
From: Mathieu Poirier @ 2016-10-26 16:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026145756.21689-2-antoine.tenart@free-electrons.com>
Hi Antoine,
Please find my comments below.
On 26 October 2016 at 08:57, Antoine Tenart
<antoine.tenart@free-electrons.com> wrote:
> The overlay manager is an in-kernel library helping to handle dt overlay
> loading when using capes.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> ---
> drivers/of/Kconfig | 2 +
> drivers/of/Makefile | 1 +
> drivers/of/overlay-manager/Kconfig | 6 +
> drivers/of/overlay-manager/Makefile | 1 +
> drivers/of/overlay-manager/overlay-manager.c | 199 +++++++++++++++++++++++++++
> include/linux/overlay-manager.h | 38 +++++
> 6 files changed, 247 insertions(+)
> create mode 100644 drivers/of/overlay-manager/Kconfig
> create mode 100644 drivers/of/overlay-manager/Makefile
> create mode 100644 drivers/of/overlay-manager/overlay-manager.c
> create mode 100644 include/linux/overlay-manager.h
>
> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig
> index bc07ad30c9bf..e57aeaf0bf4f 100644
> --- a/drivers/of/Kconfig
> +++ b/drivers/of/Kconfig
> @@ -116,4 +116,6 @@ config OF_OVERLAY
> config OF_NUMA
> bool
>
> +source "drivers/of/overlay-manager/Kconfig"
> +
> endif # OF
> diff --git a/drivers/of/Makefile b/drivers/of/Makefile
> index d7efd9d458aa..d738fd41271f 100644
> --- a/drivers/of/Makefile
> +++ b/drivers/of/Makefile
> @@ -16,3 +16,4 @@ obj-$(CONFIG_OF_OVERLAY) += overlay.o
> obj-$(CONFIG_OF_NUMA) += of_numa.o
>
> obj-$(CONFIG_OF_UNITTEST) += unittest-data/
> +obj-y += overlay-manager/
> diff --git a/drivers/of/overlay-manager/Kconfig b/drivers/of/overlay-manager/Kconfig
> new file mode 100644
> index 000000000000..eeb76054dcb8
> --- /dev/null
> +++ b/drivers/of/overlay-manager/Kconfig
> @@ -0,0 +1,6 @@
> +config OF_OVERLAY_MGR
> + bool "Device Tree Overlay Manager"
> + depends on OF_OVERLAY
> + help
> + Enable the overlay manager to handle automatic overlay loading when
> + devices are detected.
> diff --git a/drivers/of/overlay-manager/Makefile b/drivers/of/overlay-manager/Makefile
> new file mode 100644
> index 000000000000..86d2b53950e7
> --- /dev/null
> +++ b/drivers/of/overlay-manager/Makefile
> @@ -0,0 +1 @@
> +obj-$(CONFIG_OF_OVERLAY_MGR) += overlay-manager.o
> diff --git a/drivers/of/overlay-manager/overlay-manager.c b/drivers/of/overlay-manager/overlay-manager.c
> new file mode 100644
> index 000000000000..a725d7e24d38
> --- /dev/null
> +++ b/drivers/of/overlay-manager/overlay-manager.c
> @@ -0,0 +1,199 @@
> +/*
> + * Copyright (C) 2016 - Antoine Tenart <antoine.tenart@free-electrons.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#include <linux/firmware.h>
> +#include <linux/list.h>
> +#include <linux/of.h>
> +#include <linux/of_fdt.h>
> +#include <linux/overlay-manager.h>
> +#include <linux/slab.h>
> +#include <linux/spinlock.h>
> +
> +struct overlay_mgr_overlay {
> + struct list_head list;
> + char *name;
> +};
Please use the proper documentation format for structures.
> +
> +LIST_HEAD(overlay_mgr_overlays);
> +LIST_HEAD(overlay_mgr_formats);
> +DEFINE_SPINLOCK(overlay_mgr_lock);
> +DEFINE_SPINLOCK(overlay_mgr_format_lock);
> +
> +/*
> + * overlay_mgr_register_format()
> + *
> + * Adds a new format candidate to the list of supported formats. The registered
> + * formats are used to parse the headers stored on the dips.
> + */
> +int overlay_mgr_register_format(struct overlay_mgr_format *candidate)
> +{
> + struct overlay_mgr_format *format;
> + int err = 0;
> +
> + spin_lock(&overlay_mgr_format_lock);
> +
> + /* Check if the format is already registered */
> + list_for_each_entry(format, &overlay_mgr_formats, list) {
> + if (!strcpy(format->name, candidate->name)) {
This function is public to the rest of the kernel - limiting the
lenght of ->name and using strncpy() is probably a good idea.
> + err = -EEXIST;
> + goto err;
> + }
> + }
> +
> + list_add_tail(&candidate->list, &overlay_mgr_formats);
> +
> +err:
> + spin_unlock(&overlay_mgr_format_lock);
> + return err;
> +}
> +EXPORT_SYMBOL_GPL(overlay_mgr_register_format);
> +
> +/*
> + * overlay_mgr_parse()
> + *
> + * Parse raw data with registered format parsers. Fills the candidate string if
> + * one parser understood the raw data format.
> + */
> +int overlay_mgr_parse(struct device *dev, void *data, char ***candidates,
I'm pretty sure there is another way to proceed than using 3 levels of
references. It makes the code hard to read and a prime candidate for
errors.
> + unsigned *n)
> +{
> + struct list_head *pos, *tmp;
> + struct overlay_mgr_format *format;
> +
> + list_for_each_safe(pos, tmp, &overlay_mgr_formats) {
> + format = list_entry(pos, struct overlay_mgr_format, list);
Can you use list_for_each_safe_entry() ?
> +
> + format->parse(dev, data, candidates, n);
->parse() returns an error code. It is probably a good idea to check
it. If it isn't needed then a comment explaining why it is the case
would be appreciated.
> + if (n > 0)
> + return 0;
> + }
> +
> + return -EINVAL;
> +}
> +EXPORT_SYMBOL_GPL(overlay_mgr_parse);
> +
> +static int overlay_mgr_check_overlay(struct device_node *node)
> +{
> + struct property *p;
> + const char *str = NULL;
> +
> + p = of_find_property(node, "compatible", NULL);
> + if (!p)
> + return -EINVAL;
> +
> + do {
> + str = of_prop_next_string(p, str);
> + if (of_machine_is_compatible(str))
> + return 0;
> + } while (str);
> +
> + return -EINVAL;
> +}
> +
> +/*
> + * _overlay_mgr_insert()
> + *
> + * Try to request and apply an overlay given a candidate name.
> + */
> +static int _overlay_mgr_apply(struct device *dev, char *candidate)
> +{
> + struct overlay_mgr_overlay *overlay;
> + struct device_node *node;
> + const struct firmware *firmware;
> + char *firmware_name;
> + int err = 0;
> +
> + spin_lock(&overlay_mgr_lock);
> +
> + list_for_each_entry(overlay, &overlay_mgr_overlays, list) {
> + if (!strcmp(overlay->name, candidate)) {
> + dev_err(dev, "overlay already loaded\n");
> + err = -EEXIST;
> + goto err_lock;
> + }
> + }
> +
> + overlay = devm_kzalloc(dev, sizeof(*overlay), GFP_KERNEL);
Function devm_kzalloc() can sleep but you're holding a spinlock - I'm
surprised the kernel didn't complain here. Allocate the memory before
holding the lock. If the overly is already loaded simply free it on
the error path.
> + if (!overlay) {
> + err = -ENOMEM;
> + goto err_lock;
> + }
> +
> + overlay->name = candidate;
> +
> + firmware_name = kasprintf(GFP_KERNEL, "overlay-%s.dtbo", candidate);
> + if (!firmware_name) {
> + err = -ENOMEM;
> + goto err_free;
> + }
> +
> + dev_info(dev, "requesting firmware '%s'\n", firmware_name);
> +
> + err = request_firmware_direct(&firmware, firmware_name, dev);
> + if (err) {
> + dev_info(dev, "failed to request firmware '%s'\n",
> + firmware_name);
> + goto err_free;
> + }
> +
> + of_fdt_unflatten_tree((unsigned long *)firmware->data, NULL, &node);
> + if (!node) {
> + dev_err(dev, "failed to unflatted tree\n");
> + err = -EINVAL;
> + goto err_fw;
> + }
> +
> + of_node_set_flag(node, OF_DETACHED);
> +
> + err = of_resolve_phandles(node);
> + if (err) {
> + dev_err(dev, "failed to resolve phandles: %d\n", err);
> + goto err_fw;
> + }
> +
> + err = overlay_mgr_check_overlay(node);
> + if (err) {
> + dev_err(dev, "overlay checks failed: %d\n", err);
> + goto err_fw;
> + }
> +
> + err = of_overlay_create(node);
> + if (err < 0) {
> + dev_err(dev, "failed to create overlay: %d\n", err);
> + goto err_fw;
> + }
> +
> + list_add_tail(&overlay->list, &overlay_mgr_overlays);
> +
> + dev_info(dev, "loaded firmware '%s'\n", firmware_name);
> +
out:
> + spin_unlock(&overlay_mgr_lock);
> + return 0;
return err;
> +
> +err_fw:
> + release_firmware(firmware);
> +err_free:
> + devm_kfree(dev, overlay);
goto out;
> +err_lock:
> + spin_unlock(&overlay_mgr_lock);
> + return err;
This code is repeated twice. See above corrections to fix the situation.
> +}
> +
> +int overlay_mgr_apply(struct device *dev, char **candidates, unsigned n)
> +{
> + int i, ret;
> +
> + for (i=0; i < n; i++) {
I'm surprised checkpatch.pl let you get away with this one.
> + ret = _overlay_mgr_apply(dev, candidates[i]);
> + if (!ret)
> + return 0;
> + }
> +
> + return -EINVAL;
> +}
> +EXPORT_SYMBOL_GPL(overlay_mgr_apply);
> diff --git a/include/linux/overlay-manager.h b/include/linux/overlay-manager.h
> new file mode 100644
> index 000000000000..8adcc4f5ddf6
> --- /dev/null
> +++ b/include/linux/overlay-manager.h
> @@ -0,0 +1,38 @@
> +/*
> + * Copyright (C) 2016 - Antoine Tenart <antoine.tenart@free-electrons.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +
> +#ifndef __OVERLAY_MGR_H__
> +#define __OVERLAY_MGR_H__
> +
> +#include <linux/device.h>
> +#include <linux/list.h>
> +#include <linux/sizes.h>
> +
> +#define OVERLAY_MGR_DIP_MAX_SZ SZ_128
> +
> +struct overlay_mgr_format {
> + struct list_head list;
> + char *name;
> + int (*parse)(struct device *dev, void *data, char ***candidates,
> + unsigned *n);
> +};
Please use the kernel documentation standard.
> +
> +int overlay_mgr_register_format(struct overlay_mgr_format *candidate);
> +int overlay_mgr_parse(struct device *dev, void *data, char ***candidates,
> + unsigned *n);
> +int overlay_mgr_apply(struct device *dev, char **candidates, unsigned n);
> +
> +#define dip_convert(field) \
> + ( \
> + (sizeof(field) == 1) ? field : \
> + (sizeof(field) == 2) ? be16_to_cpu(field) : \
> + (sizeof(field) == 4) ? be32_to_cpu(field) : \
> + -1 \
> + )
Please document your macro definition. Otherwise reviewers are left guessing...
> +
> +#endif /* __OVERLAY_MGR_H__ */
> --
> 2.10.1
>
^ permalink raw reply
* [PATCH] tty/serial: at91: fix hardware handshake on Atmel platforms
From: Alexandre Belloni @ 2016-10-26 16:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACQ1gAhfSQG1_otKjvQUiXCajfZvOM-=VqhyKs1D+fXEU9eCnw@mail.gmail.com>
On 26/10/2016 at 17:51:07 +0200, Richard Genoud wrote :
> 2016-10-26 17:35 GMT+02:00 Alexandre Belloni
> <alexandre.belloni@free-electrons.com>:
> > Richard,
> >
> > On 26/10/2016 at 16:55:02 +0200, Richard Genoud wrote :
> >> On 25/10/2016 19:17, Uwe Kleine-K?nig wrote:
> >> Quote from the commit message:
> >> " Commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when
> >> hardware handshake is enabled") actually allowed to enable hardware
> >> handshaking.
> >> Before, the CRTSCTS flags was silently ignored.
> >> "
> >> This wasn't true.
> >> This was a misunderstanding of the ATMEL_US_USMODE_HWHS flag:
> >> Commit 1cf6e8fc8341 didn't allowed to enable hardware handshaking, but
> >> introduced the ATMEL_US_USMODE_HWHS flag.
> >> And before 1cf6e8fc8341, the CRTSCTS flags wasn't silently ignored, it
> >> was perfectly respected.
> >>
> >
> > It was not really a misunderstanding, it is a difference in
> > expectations. There is one topic on which we don't agree and I'm fine
> > with your solution as long as I don't have to support people with the
> > failures (hence my ack). My (and Cyrille's) opinion is that CRTSCTS has
> > to be 100% reliable and this is only possible with assistance from the
> > hardware. That's why I wanted to report when HW didn't have proper
> > support to userspace.
> > On your side you are fine with software handling of RTS and CTS (which
> > is a feature that worked before our patches). You just have to remember
> > that at some point because of latencies and the way the IPs are clocked,
> > this will fail and you'll start losing bytes.
> >
> > Again, I'm fine with that but I won't handle people complaining about it
> > :)
>
> So you broke this on purpose ?
> Without saying so in the commit message ?
> Nice to know.
No, I didn't think about that use case at the time and I understood
after you explanations. I wouldn't have removed an existing
functionality like that.
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* [PATCH v6 4/5] ARM: DTS: da850: Add cfgchip syscon node
From: David Lechner @ 2016-10-26 16:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1477451211-31979-5-git-send-email-david@lechnology.com>
On 10/25/2016 10:06 PM, David Lechner wrote:
> Add a syscon node for the SoC CFGCHIPn registers. This is needed for
> the new usb phy driver.
>
> Signed-off-by: David Lechner <david@lechnology.com>
> ---
> arch/arm/boot/dts/da850.dtsi | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
> index f79e1b9..6bbf20d 100644
> --- a/arch/arm/boot/dts/da850.dtsi
> +++ b/arch/arm/boot/dts/da850.dtsi
> @@ -188,6 +188,10 @@
> };
>
> };
> + cfgchip: cfgchip at 1417c {
I wonder if there is a more generic name instead of cfgchip at . Is there a
preferred generic name for syscon nodes?
> + compatible = "ti,da830-cfgchip", "syscon";
> + reg = <0x1417c 0x14>;
> + };
> edma0: edma at 0 {
> compatible = "ti,edma3-tpcc";
> /* eDMA3 CC0: 0x01c0 0000 - 0x01c0 7fff */
>
^ permalink raw reply
* [PATCH v14 7/9] clocksource/drivers/arm_arch_timer: Refactor the timer init code to prepare for GTDT
From: Fu Wei @ 2016-10-26 16:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026154608.GB22713@leverpostej>
Hi Mark,
On 26 October 2016 at 23:46, Mark Rutland <mark.rutland@arm.com> wrote:
> On Wed, Oct 26, 2016 at 11:24:32PM +0800, Fu Wei wrote:
>> On 21 October 2016 at 19:32, Mark Rutland <mark.rutland@arm.com> wrote:
>> > On Thu, Sep 29, 2016 at 02:17:15AM +0800, fu.wei at linaro.org wrote:
>> >> +static int __init arch_timer_mem_register(struct device_node *np, void *frame)
>> >> {
>> >> - int ret;
>> >> - irq_handler_t func;
>> >> + struct device_node *frame_node = NULL;
>> >> struct arch_timer *t;
>> >> + void __iomem *base;
>> >> + irq_handler_t func;
>> >> + unsigned int irq;
>> >> + int ret;
>> >> +
>> >> + if (!frame)
>> >> + return -EINVAL;
>> >
>> > Why would we call this without a frame?
>>
>> Sorry, I just verify it , make sure frame is not NULL,
>> Because it is a "static" function, so we do need this check?
>
> I'd rather we simply don't call the function rather than passing a NULL
> frame in.
>
OK, NP, will do
>> >> +
>> >> + if (np) {
>> >
>> > ... or without a node?
>>
>> For "np", for now, we just just verify it, but it is just paperation
>> for GTDT support,
>> Because in next patch, if np == NULL, that means we call this function
>> from GTDT, but not DT.
>
> Please don't do that. More on that below.
>
>> > Please as Marc requested several versions ago: split the FW parsing
>> > (ACPI and DT) so that happens first, *then* once we have the data in a
>> > common format, use that to drive poking the HW, requesting IRQs, etc,
>> > completely independent of the source.
>> >
>> > In patches, do this by:
>> >
>> > (1) adding the data structures
>> > (2) splitting the existing DT probing to use them
>> > (3) Adding ACPI functionality atop
>>
>> this patch is a preparation for GTDT support, I have splitted some
>> functions for reusing them in next patch(GTDT support)
>>
>> if np == NULL, that means we call this function from GTDT, but
>> if np != NULL, that means we call this function from DT
>
> As above, please structure the patches such that that never happens.
>
> We currently have:
>
> +--------------------------+
> | DT Parsing + Common code |
> +--------------------------+
>
> Per (1 and 2) make this:
>
> +------------+ +-------------+
> | DT parsing |--(common structure)-->| Common code |
> +------------+ +-------------+
>
> Then per (3) make this:
>
> +------------+
> | DT parsing |--(common structure)------+
> +------------+ |
> v
> +-------------+
> | Common code |
> +-------------+
> ^
> +--------------+ |
> | ACPI parsing |--(common structure)----+
Thanks for your suggestion , I will do this way in my next patchset
Thanks :-)
> +--------------+
>
> Thanks,
> Mark.
--
Best regards,
Fu Wei
Software Engineer
Red Hat
^ permalink raw reply
* [PATCH v7] spi: sun4i: Allow transfers larger than FIFO size
From: Alex Gagniuc @ 2016-10-26 16:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026100743.GZ17252@sirena.org.uk>
On Wed, Oct 26, 2016 at 3:07 AM, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Oct 26, 2016 at 12:00:30AM -0700, Alexandru Gagniuc wrote:
>> This is the seventh attempt to get this patch in. I was prompted to look
>> into this again as someone recently remarked:
>
> Please don't send cover letters for single patches, if there is anything
> that needs saying put it in the changelog of the patch or after the ---
> if it's administrative stuff. This reduces mail volume and ensures that
> any important information is recorded in the changelog rather than being
> lost.
Thanks for the heads up! Sorry about that. Do you want me to resend
this as a single mail?
Alex
^ permalink raw reply
* [PATCH] ARM: davinci: da850: Fix pwm name matching
From: Kevin Hilman @ 2016-10-26 16:02 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <f423a705-5ae2-78cf-2b63-609dd4e2cdf6@ti.com>
Hi Sekhar,
Sekhar Nori <nsekhar@ti.com> writes:
> On Tuesday 25 October 2016 11:24 PM, David Lechner wrote:
>> This fixes pwm name matching for DA850 familiy devices. When using device
>> tree, the da850_auxdata_lookup[] table caused pwm devices to have the exact
>> same name, which caused errors when trying to register the devices.
>>
>> The names for clock matching in da850_clks[] also have to be updated to
>> to exactly match in order for the clock lookup to work correctly.
>>
>> Signed-off-by: David Lechner <david@lechnology.com>
>
> Applied to "fixes" branch. Will send upstream after testing a bit and
> also waiting to see if anyone else has any comments.
I'm not seeing a fixes branch in your tree. Did you push this out?
Similarily, I didn't see the updates in v4.10/defconfig either.
Kevin
^ permalink raw reply
* [PATCH] tty/serial: at91: fix hardware handshake on Atmel platforms
From: Richard Genoud @ 2016-10-26 15:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026153548.xxvciigcscrjb5uv@piout.net>
2016-10-26 17:35 GMT+02:00 Alexandre Belloni
<alexandre.belloni@free-electrons.com>:
> Richard,
>
> On 26/10/2016 at 16:55:02 +0200, Richard Genoud wrote :
>> On 25/10/2016 19:17, Uwe Kleine-K?nig wrote:
>> Quote from the commit message:
>> " Commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when
>> hardware handshake is enabled") actually allowed to enable hardware
>> handshaking.
>> Before, the CRTSCTS flags was silently ignored.
>> "
>> This wasn't true.
>> This was a misunderstanding of the ATMEL_US_USMODE_HWHS flag:
>> Commit 1cf6e8fc8341 didn't allowed to enable hardware handshaking, but
>> introduced the ATMEL_US_USMODE_HWHS flag.
>> And before 1cf6e8fc8341, the CRTSCTS flags wasn't silently ignored, it
>> was perfectly respected.
>>
>
> It was not really a misunderstanding, it is a difference in
> expectations. There is one topic on which we don't agree and I'm fine
> with your solution as long as I don't have to support people with the
> failures (hence my ack). My (and Cyrille's) opinion is that CRTSCTS has
> to be 100% reliable and this is only possible with assistance from the
> hardware. That's why I wanted to report when HW didn't have proper
> support to userspace.
> On your side you are fine with software handling of RTS and CTS (which
> is a feature that worked before our patches). You just have to remember
> that at some point because of latencies and the way the IPs are clocked,
> this will fail and you'll start losing bytes.
>
> Again, I'm fine with that but I won't handle people complaining about it
> :)
So you broke this on purpose ?
Without saying so in the commit message ?
Nice to know.
^ permalink raw reply
* [PATCH 4/9] pinctrl: meson: allow gpio to request irq
From: Kevin Hilman @ 2016-10-26 15:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACRpkdYqoU0foW1izcZapbgUm+NO4quz9AZZBmts4841BRcigA@mail.gmail.com>
Hi Linus,
Linus Walleij <linus.walleij@linaro.org> writes:
> On Wed, Oct 26, 2016 at 4:22 PM, Jerome Brunet <jbrunet@baylibre.com> wrote:
>> On Tue, 2016-10-25 at 20:20 +0200, Linus Walleij wrote:
>
>>> However the semantic is such, that it is not necessary to call
>>> to_irq()
>>> before using an IRQ: the irqchip and gpiochip abstractions should be
>>> orthogonal.
>>
>> Linus,
>>
>> They are orthogonal. You can request an irq from the irqchip controller
>> without the gpiochip, like any other irq controller.
>
> OK good, sorry if I'm stating the obvious.
>
>> irq_create_mapping (and irq_create_fwspec_mapping) internally calls
>> irq_find_mapping. So if the mapping already exist (the irq is already
>> used before calling to_irq), the existing mapping will be returned. The
>> mapping will be actually created only if needed. It seems to be in line
>> with your explanation, no ?
>
> Yes, but you want to call irq_create_mapping() in slowpath (irq setup)
> and irq_find_mapping() in fastpath (irq handler). Else the first IRQ
> may result in unwelcomed surprises.
>
>> There is really a *lot* of gpio drivers which use irq_create_mapping in
>> the to_irq callback, are these all wrong ?
>
> Yes they are all wrong. They should all be using irq_find_mapping().
So, dumb question from someone trying (but having a hard time) to follow
and understand the rationale...
If it's wrong enough to completely reject, why are changes still being
merged that are doing it so wrong? (e.g. like this one[1], just merged
for v4.9)
Kevin
[1] 0eb9f683336d pinctrl: Add IRQ support to STM32 gpios
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/pinctrl/stm32/pinctrl-stm32.c?id=0eb9f683336d7eb99a3b75987620417c574ffb57
^ permalink raw reply
* [PATCH RESEND 1/3] clk: imx6: Mask mmdc_ch1 handshake for periph2_sel and mmdc_ch1_axi_podf
From: Fabio Estevam @ 2016-10-26 15:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1476750554-21961-1-git-send-email-festevam@gmail.com>
Shawn,
Are you collecting the imx clk patches in this cycle?
I see no response from Stephen on this series from a long time.
We missed 4.9, so hopefully this can land in 4.10.
On Mon, Oct 17, 2016 at 10:29 PM, Fabio Estevam <festevam@gmail.com> wrote:
> From: Philipp Zabel <p.zabel@pengutronix.de>
>
> MMDC CH1 is not used on i.MX6Q, so the handshake needed to change the
> parent of periph2_sel or the divider of mmdc_ch1_axi_podf will never
> succeed.
> Disable the handshake mechanism to allow changing the frequency of
> mmdc_ch1_axi, allowing to use it as a possible source for the LDB DI
> clock.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
> drivers/clk/imx/clk-imx6q.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
> index ce8ea10..66825a8 100644
> --- a/drivers/clk/imx/clk-imx6q.c
> +++ b/drivers/clk/imx/clk-imx6q.c
> @@ -156,6 +156,19 @@ static struct clk ** const uart_clks[] __initconst = {
> NULL
> };
>
> +#define CCM_CCDR 0x04
> +
> +#define CCDR_MMDC_CH1_MASK BIT(16)
> +
> +static void __init imx6q_mmdc_ch1_mask_handshake(void __iomem *ccm_base)
> +{
> + unsigned int reg;
> +
> + reg = readl_relaxed(ccm_base + CCM_CCDR);
> + reg |= CCDR_MMDC_CH1_MASK;
> + writel_relaxed(reg, ccm_base + CCM_CCDR);
> +}
> +
> static void __init imx6q_clocks_init(struct device_node *ccm_node)
> {
> struct device_node *np;
> @@ -297,6 +310,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
> base = of_iomap(np, 0);
> WARN_ON(!base);
>
> + imx6q_mmdc_ch1_mask_handshake(base);
> +
> /* name reg shift width parent_names num_parents */
> clk[IMX6QDL_CLK_STEP] = imx_clk_mux("step", base + 0xc, 8, 1, step_sels, ARRAY_SIZE(step_sels));
> clk[IMX6QDL_CLK_PLL1_SW] = imx_clk_mux("pll1_sw", base + 0xc, 2, 1, pll1_sw_sels, ARRAY_SIZE(pll1_sw_sels));
> --
> 2.7.4
>
^ permalink raw reply
* [PATCH v14 7/9] clocksource/drivers/arm_arch_timer: Refactor the timer init code to prepare for GTDT
From: Mark Rutland @ 2016-10-26 15:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CADyBb7sJfY4=5NKKPGosOGv4sq4Tg2_TBW-XbWYoqfz4JNE-LA@mail.gmail.com>
On Wed, Oct 26, 2016 at 11:24:32PM +0800, Fu Wei wrote:
> On 21 October 2016 at 19:32, Mark Rutland <mark.rutland@arm.com> wrote:
> > On Thu, Sep 29, 2016 at 02:17:15AM +0800, fu.wei at linaro.org wrote:
> >> +static int __init arch_timer_mem_register(struct device_node *np, void *frame)
> >> {
> >> - int ret;
> >> - irq_handler_t func;
> >> + struct device_node *frame_node = NULL;
> >> struct arch_timer *t;
> >> + void __iomem *base;
> >> + irq_handler_t func;
> >> + unsigned int irq;
> >> + int ret;
> >> +
> >> + if (!frame)
> >> + return -EINVAL;
> >
> > Why would we call this without a frame?
>
> Sorry, I just verify it , make sure frame is not NULL,
> Because it is a "static" function, so we do need this check?
I'd rather we simply don't call the function rather than passing a NULL
frame in.
> >> +
> >> + if (np) {
> >
> > ... or without a node?
>
> For "np", for now, we just just verify it, but it is just paperation
> for GTDT support,
> Because in next patch, if np == NULL, that means we call this function
> from GTDT, but not DT.
Please don't do that. More on that below.
> > Please as Marc requested several versions ago: split the FW parsing
> > (ACPI and DT) so that happens first, *then* once we have the data in a
> > common format, use that to drive poking the HW, requesting IRQs, etc,
> > completely independent of the source.
> >
> > In patches, do this by:
> >
> > (1) adding the data structures
> > (2) splitting the existing DT probing to use them
> > (3) Adding ACPI functionality atop
>
> this patch is a preparation for GTDT support, I have splitted some
> functions for reusing them in next patch(GTDT support)
>
> if np == NULL, that means we call this function from GTDT, but
> if np != NULL, that means we call this function from DT
As above, please structure the patches such that that never happens.
We currently have:
+--------------------------+
| DT Parsing + Common code |
+--------------------------+
Per (1 and 2) make this:
+------------+ +-------------+
| DT parsing |--(common structure)-->| Common code |
+------------+ +-------------+
Then per (3) make this:
+------------+
| DT parsing |--(common structure)------+
+------------+ |
v
+-------------+
| Common code |
+-------------+
^
+--------------+ |
| ACPI parsing |--(common structure)----+
+--------------+
Thanks,
Mark.
^ permalink raw reply
* [PATCH 2/5] ARM: davinci: Don't append git rev to local version
From: David Lechner @ 2016-10-26 15:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <47ad8be9-54e0-4e0c-3ff5-31662e6ca4de@ti.com>
On 10/26/2016 05:54 AM, Sekhar Nori wrote:
> On Monday 24 October 2016 08:45 PM, David Lechner wrote:
>> On 10/24/2016 06:35 AM, Sekhar Nori wrote:
>>> On Saturday 22 October 2016 12:06 AM, David Lechner wrote:
>>>> In the davinci default configuration, don't append the git revision to
>>>> the local kernel version by. This seems like the more desirable default
>>>> value.
>>>
>>> Why? To the contrary I actually quite like the fact that the git commit
>>> is appended to version string. Makes it easy for me to cross-check that
>>> I am booting the right image.
>>>
>>>>
>>>> Signed-off-by: David Lechner <david@lechnology.com>
>>>
>>> Thanks,
>>> Sekhar
>>>
>>
>> Each time you make a commit, you get a new version, which installs
>> another copy of the kernel modules on the device. This will fill up the
>> SD card if you are making many commits.
>
> Right, but thats easily fixable by removing existing modules before
> installing new ones.
>
>> Also, if someone wants to build the mainline kernel using the default
>> configuration, it seems odd to have a git revision tacked on to the end
>> even though you made no revisions.
>
> If you checkout a tag and build, then no commit information is added.
> Which I guess is what most end users will do.
>
> I don't see this done in other defconfigs like omap2plus and multi_v7 as
> well. I would like to keep it similar for davinci.
>
> Thanks,
> Sekhar
>
OK, I will drop this patch.
^ permalink raw reply
* [PATCH] tty/serial: at91: fix hardware handshake on Atmel platforms
From: Alexandre Belloni @ 2016-10-26 15:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <f89c29e4-b68f-a8ea-cefb-e70dda6739a0@gmail.com>
Richard,
On 26/10/2016 at 16:55:02 +0200, Richard Genoud wrote :
> On 25/10/2016 19:17, Uwe Kleine-K?nig wrote:
> Quote from the commit message:
> " Commit 1cf6e8fc8341 ("tty/serial: at91: fix RTS line management when
> hardware handshake is enabled") actually allowed to enable hardware
> handshaking.
> Before, the CRTSCTS flags was silently ignored.
> "
> This wasn't true.
> This was a misunderstanding of the ATMEL_US_USMODE_HWHS flag:
> Commit 1cf6e8fc8341 didn't allowed to enable hardware handshaking, but
> introduced the ATMEL_US_USMODE_HWHS flag.
> And before 1cf6e8fc8341, the CRTSCTS flags wasn't silently ignored, it
> was perfectly respected.
>
It was not really a misunderstanding, it is a difference in
expectations. There is one topic on which we don't agree and I'm fine
with your solution as long as I don't have to support people with the
failures (hence my ack). My (and Cyrille's) opinion is that CRTSCTS has
to be 100% reliable and this is only possible with assistance from the
hardware. That's why I wanted to report when HW didn't have proper
support to userspace.
On your side you are fine with software handling of RTS and CTS (which
is a feature that worked before our patches). You just have to remember
that at some point because of latencies and the way the IPs are clocked,
this will fail and you'll start losing bytes.
Again, I'm fine with that but I won't handle people complaining about it
:)
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply
* [PATCH V3 8/8] arm64: dma-mapping: Remove the notifier trick to handle early setting of dma_ops
From: Robin Murphy @ 2016-10-26 15:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1475600632-21289-9-git-send-email-sricharan@codeaurora.org>
On 04/10/16 18:03, Sricharan R wrote:
> With arch_setup_dma_ops now being called late during device's probe after the
> device's iommu is probed, the notifier trick required to handle the early
> setup of dma_ops before the iommu group gets created is not required.
> So removing the notifier's here.
Hooray!
> Signed-off-by: Sricharan R <sricharan@codeaurora.org>
> ---
> arch/arm64/mm/dma-mapping.c | 100 ++------------------------------------------
> 1 file changed, 3 insertions(+), 97 deletions(-)
>
> diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
> index faf4b92..eb593af 100644
> --- a/arch/arm64/mm/dma-mapping.c
> +++ b/arch/arm64/mm/dma-mapping.c
> @@ -799,24 +799,6 @@ static struct dma_map_ops iommu_dma_ops = {
> .mapping_error = iommu_dma_mapping_error,
> };
>
> -/*
> - * TODO: Right now __iommu_setup_dma_ops() gets called too early to do
> - * everything it needs to - the device is only partially created and the
> - * IOMMU driver hasn't seen it yet, so it can't have a group. Thus we
> - * need this delayed attachment dance. Once IOMMU probe ordering is sorted
> - * to move the arch_setup_dma_ops() call later, all the notifier bits below
> - * become unnecessary, and will go away.
> - */
> -struct iommu_dma_notifier_data {
> - struct list_head list;
> - struct device *dev;
> - const struct iommu_ops *ops;
> - u64 dma_base;
> - u64 size;
> -};
> -static LIST_HEAD(iommu_dma_masters);
> -static DEFINE_MUTEX(iommu_dma_notifier_lock);
> -
> static bool do_iommu_attach(struct device *dev, const struct iommu_ops *ops,
> u64 dma_base, u64 size)
This should go as well...
> {
> @@ -837,79 +819,9 @@ static bool do_iommu_attach(struct device *dev, const struct iommu_ops *ops,
> return true;
> }
>
> -static void queue_iommu_attach(struct device *dev, const struct iommu_ops *ops,
> - u64 dma_base, u64 size)
> -{
> - struct iommu_dma_notifier_data *iommudata;
> -
> - iommudata = kzalloc(sizeof(*iommudata), GFP_KERNEL);
> - if (!iommudata)
> - return;
> -
> - iommudata->dev = dev;
> - iommudata->ops = ops;
> - iommudata->dma_base = dma_base;
> - iommudata->size = size;
> -
> - mutex_lock(&iommu_dma_notifier_lock);
> - list_add(&iommudata->list, &iommu_dma_masters);
> - mutex_unlock(&iommu_dma_notifier_lock);
> -}
> -
> -static int __iommu_attach_notifier(struct notifier_block *nb,
> - unsigned long action, void *data)
> -{
> - struct iommu_dma_notifier_data *master, *tmp;
> -
> - if (action != BUS_NOTIFY_BIND_DRIVER)
> - return 0;
> -
> - mutex_lock(&iommu_dma_notifier_lock);
> - list_for_each_entry_safe(master, tmp, &iommu_dma_masters, list) {
> - if (data == master->dev && do_iommu_attach(master->dev,
> - master->ops, master->dma_base, master->size)) {
> - list_del(&master->list);
> - kfree(master);
> - break;
> - }
> - }
> - mutex_unlock(&iommu_dma_notifier_lock);
> - return 0;
> -}
> -
> -static int __init register_iommu_dma_ops_notifier(struct bus_type *bus)
> -{
> - struct notifier_block *nb = kzalloc(sizeof(*nb), GFP_KERNEL);
> - int ret;
> -
> - if (!nb)
> - return -ENOMEM;
> -
> - nb->notifier_call = __iommu_attach_notifier;
> -
> - ret = bus_register_notifier(bus, nb);
> - if (ret) {
> - pr_warn("Failed to register DMA domain notifier; IOMMU DMA ops unavailable on bus '%s'\n",
> - bus->name);
> - kfree(nb);
> - }
> - return ret;
> -}
> -
> static int __init __iommu_dma_init(void)
> {
> - int ret;
> -
> - ret = iommu_dma_init();
> - if (!ret)
> - ret = register_iommu_dma_ops_notifier(&platform_bus_type);
> - if (!ret)
> - ret = register_iommu_dma_ops_notifier(&amba_bustype);
> -#ifdef CONFIG_PCI
> - if (!ret)
> - ret = register_iommu_dma_ops_notifier(&pci_bus_type);
> -#endif
> - return ret;
> + return iommu_dma_init();
> }
> arch_initcall(__iommu_dma_init);
>
> @@ -920,18 +832,12 @@ static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
>
> if (!ops)
> return;
> - /*
> - * TODO: As a concession to the future, we're ready to handle being
> - * called both early and late (i.e. after bus_add_device). Once all
> - * the platform bus code is reworked to call us late and the notifier
> - * junk above goes away, move the body of do_iommu_attach here.
...per this commment. It has no need to be a separate function once this
is the only call site (plus it has a misleadingly inaccurate name anyway).
> - */
> +
> group = iommu_group_get(dev);
> +
> if (group) {
> do_iommu_attach(dev, ops, dma_base, size);
> iommu_group_put(group);
> - } else {
> - queue_iommu_attach(dev, ops, dma_base, size);
> }
> }
I overlooked it in the last patch as the relevant context was in the
cover letter, so I'll just add the comment here; the domain check and
WARN_ON() in arch_teardown_dma_ops() is mostly a left-over from the
'fake default domain' bodge that was already gone from the final version
of the arm64 dma_ops series. It's based on the assumption that
arch_teardown_dma_ops() is called after the device is removed from the
bus - I'm not convinced that assumption was ever actually true, it now
doesn't necessarily do anything anyway (since detach_device is
deprecated). I'll spin a cleanup patch for that myself...
Robin.
^ permalink raw reply
* [PATCH v14 7/9] clocksource/drivers/arm_arch_timer: Refactor the timer init code to prepare for GTDT
From: Fu Wei @ 2016-10-26 15:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161021113213.GD16630@leverpostej>
Hi Mark,
On 21 October 2016 at 19:32, Mark Rutland <mark.rutland@arm.com> wrote:
> On Thu, Sep 29, 2016 at 02:17:15AM +0800, fu.wei at linaro.org wrote:
>> From: Fu Wei <fu.wei@linaro.org>
>>
>> The patch refactor original memory-mapped timer init code:
>> (1) extract some subfunction for reusing some common code
>> a. get_cnttidr
>> b. is_best_frame
>> (2) move base address and irq code for arch_timer_mem to
>> arch_timer_mem_register
>>
>> Signed-off-by: Fu Wei <fu.wei@linaro.org>
>> ---
>> drivers/clocksource/arm_arch_timer.c | 159 +++++++++++++++++++++--------------
>> 1 file changed, 96 insertions(+), 63 deletions(-)
>>
>> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
>> index c7b0040..e78095f 100644
>> --- a/drivers/clocksource/arm_arch_timer.c
>> +++ b/drivers/clocksource/arm_arch_timer.c
>> @@ -57,6 +57,7 @@
>> static unsigned arch_timers_present __initdata;
>>
>> static void __iomem *arch_counter_base;
>> +static void __iomem *cntctlbase __initdata;
>>
>> struct arch_timer {
>> void __iomem *base;
>> @@ -656,15 +657,49 @@ out:
>> return err;
>> }
>>
>> -static int __init arch_timer_mem_register(void __iomem *base, unsigned int irq)
>> +static int __init arch_timer_mem_register(struct device_node *np, void *frame)
>> {
>> - int ret;
>> - irq_handler_t func;
>> + struct device_node *frame_node = NULL;
>> struct arch_timer *t;
>> + void __iomem *base;
>> + irq_handler_t func;
>> + unsigned int irq;
>> + int ret;
>> +
>> + if (!frame)
>> + return -EINVAL;
>
> Why would we call this without a frame?
Sorry, I just verify it , make sure frame is not NULL,
Because it is a "static" function, so we do need this check?
>
>> +
>> + if (np) {
>
> ... or without a node?
For "np", for now, we just just verify it, but it is just paperation
for GTDT support,
Because in next patch, if np == NULL, that means we call this function
from GTDT, but not DT.
>
>> + frame_node = (struct device_node *)frame;
>> + base = of_iomap(frame_node, 0);
>> + arch_timer_detect_rate(base, np);
>
> ... BANG! (we check base too late, below).
>
> Please as Marc requested several versions ago: split the FW parsing
> (ACPI and DT) so that happens first, *then* once we have the data in a
> common format, use that to drive poking the HW, requesting IRQs, etc,
> completely independent of the source.
>
> In patches, do this by:
>
> (1) adding the data structures
> (2) splitting the existing DT probing to use them
> (3) Adding ACPI functionality atop
this patch is a preparation for GTDT support, I have splitted some
functions for reusing them in next patch(GTDT support)
if np == NULL, that means we call this function from GTDT, but
if np != NULL, that means we call this function from DT
>
>> -static int __init arch_timer_mem_init(struct device_node *np)
>> +static int __init get_cnttidr(struct device_node *np, u32 *cnttidr)
>> {
>> - struct device_node *frame, *best_frame = NULL;
>> - void __iomem *cntctlbase, *base;
>> - unsigned int irq, ret = -EINVAL;
>> - u32 cnttidr;
>> + if (!cnttidr)
>> + return -EINVAL;
>> +
>> + if (np)
>> + cntctlbase = of_iomap(np, 0);
>> + else
>> + return -EINVAL;
>
> We want to check this for ACPI too, no?
just like I said above, this is a preparation for GTDT support,
So please correct me if I am doing this in the wrong way, thanks :-)
>
> Thanks,
> Mark.
--
Best regards,
Fu Wei
Software Engineer
Red Hat
^ permalink raw reply
* [PATCH v2] clocksource/arm_arch_timer: Map frame with of_io_request_and_map()
From: Daniel Lezcano @ 2016-10-26 15:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026073550.22918-1-sboyd@codeaurora.org>
On 26/10/2016 09:35, Stephen Boyd wrote:
> Let's use the of_io_request_and_map() API so that the frame
> region is protected and shows up in /proc/iomem.
>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
Applied for 4.10.
Thanks!
-- Daniel
--
<http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply
* [PATCH v3] drivers: psci: PSCI checker module
From: Paul E. McKenney @ 2016-10-26 15:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026131752.GA15478@red-moon>
On Wed, Oct 26, 2016 at 02:17:52PM +0100, Lorenzo Pieralisi wrote:
> On Tue, Oct 25, 2016 at 11:34:36AM -0700, Paul E. McKenney wrote:
>
> [...]
>
> > > > +static int __init psci_checker(void)
> > > > +{
> > > > + int ret;
> > > > +
> > > > + /*
> > > > + * Since we're in an initcall, we assume that all the CPUs that all
> > > > + * CPUs that can be onlined have been onlined.
> > > > + *
> > > > + * The tests assume that hotplug is enabled but nobody else is using it,
> > > > + * otherwise the results will be unpredictable. However, since there
> > > > + * is no userspace yet in initcalls, that should be fine.
> > >
> > > I do not think it is. If you run a kernel with, say,
> > > CONFIG_LOCK_TORTURE_TEST, cpus may disappear from the radar while
> > > running the PSCI checker test itself; that at least would confuse the
> > > checker, and that's just an example.
> > >
> > > I added Paul to check what are the assumptions behind the torture test
> > > hotplug tests, in particular if there are any implicit assumptions for
> > > it to work (ie it is the only kernel test hotplugging cpus in and out
> > > (?)), what I know is that the PSCI checker assumptions are not correct.
> >
> > Both CONFIG_LOCK_TORTURE_TEST and CONFIG_RCU_TORTURE_TEST can and will
> > hotplug CPUs. The locktorture.onoff_holdoff and rcutorture.onoff_holdoff
> > kernel parameters can delay the start of CPU-hotplug testing, and in
> > my testing I set this delay to 30 seconds after boot.
> >
> > One approach would be to make your test refuse to run if either of
> > the lock/RCU torture tests was running. Or do what Lorenzo suggests
> > below. The torture tests aren't crazy enough to offline the last CPU.
> > Though they do try, just for effect, in cases where the last CPU is
> > marked cpu_is_hotpluggable(). ;-)
>
> Thank you Paul. I have an additional question though. Is there any
> implicit assumption in LOCK/RCU torture tests whereby nothing else
> in the kernel is hotplugging cpus in/out (through cpu_down()/up())
> while they are running ?
>
> I am asking because that's the main reason behind my query. Those tests
> hotplug cpus in and out through cpu_down/up() but AFAICS nothing
> prevents another piece of code in the kernel to call those functions and
> the tests may just fail in that case (ie trying to cpu_down() a cpu
> that is not online).
>
> Are false negatives contemplated (or I am missing something) ?
The current code assumes nothing else doing CPU-hotplug operations,
and will therefore print "RCU_HOTPLUG" error (or "LOCK_HOTPLUG" for
locktorture) if any of the hotplug operations failed.
> I just would like to understand if what this patch currently does
> is safe and sound. I think that calling cpu_down() and cpu_up()
> is always safe, but the test can result in false negatives if
> other kernel subsystems (eg LOCK torture test) are calling those
> APIs in parallel (because cpu_down()/cpu_up() calls can fail - eg
> trying to cpu_down() a cpu that is not online any longer, since it
> was taken down by another kernel control path), that's the question
> I have.
I am assuming that these added calls to cpu_down() and cpu_up() aren't
enabled by default. If they are, rcutorture and locktorture need some
way to turn the off.
So maybe we need to have some sort of API that detects concurrent
CPU-hotplug torturing? Maybe something like the following?
static atomic_t n_cpu_hotplug_torturers;
static atomic_t cpu_hotplug_concurrent_torture;
void torture_start_cpu_hotplug(void)
{
if (atomic_inc_return(&n_cpu_hotplug_torturers) > 1)
atomic_inc(&cpu_hotplug_concurrent_torture);
}
void torture_end_cpu_hotplug(void)
{
atomic_dec(&n_cpu_hotplug_torturers);
}
bool torture_cpu_hotplug_was_concurrent(void)
{
return !!atomic_read(&cpu_hotplug_concurrent_torture);
}
The locktorture and rcutorture code could then ignore CPU-hotplug
errors that could be caused by concurrent access. And complain
bitterly about the concurrent access, of course! ;-)
Or am I missing your point?
Thanx, Paul
> Thanks !
> Lorenzo
>
> >
> > Thanx, Paul
> >
> > > There is something simple you can do to get this "fixed".
> > >
> > > You can use the new API James implemented for hibernate,
> > > that allows you to disable (ie PSCI CPU OFF) all "secondary" cpus
> > > other than the primary one passed in as parameter:
> > >
> > > freeze_secondary_cpus(int primary);
> > >
> > > that function will _cpu_down() all online cpus other than "primary"
> > > in one go, without any interference allowed from other bits of the
> > > kernel. It requires an enable_nonboot_cpus() counterpart, and you
> > > can do that for every online cpus you detect (actually you can even
> > > avoid using the online cpu mask and use the present mask to carry
> > > out the test). If there is a resident trusted OS you can just
> > > trigger the test with primary == tos_resident_cpu, since all
> > > others are bound to fail (well, you can run them and check they
> > > do fail, it is a checker after all).
> > >
> > > You would lose the capability of hotplugging a "cluster" at a time, but
> > > I do not think it is a big problem, the test above would cover it
> > > and more importantly, it is safe to execute.
> > >
> > > Or we can augment the torture test API to restrict the cpumask
> > > it actually uses to offline/online cpus (I am referring to
> > > torture_onoff(), kernel/torture.c).
> > >
> > > Further comments appreciated since I am not sure I grokked the
> > > assumption the torture tests make about hotplugging cpus in and out,
> > > I will go through the commits logs again to find more info.
> > >
> > > Thanks !
> > > Lorenzo
> > >
> > > > + */
> > > > + nb_available_cpus = num_online_cpus();
> > > > +
> > > > + /* Check PSCI operations are set up and working. */
> > > > + ret = psci_ops_check();
> > > > + if (ret)
> > > > + return ret;
> > > > +
> > > > + pr_info("PSCI checker started using %u CPUs\n", nb_available_cpus);
> > > > +
> > > > + pr_info("Starting hotplug tests\n");
> > > > + ret = hotplug_tests();
> > > > + if (ret == 0)
> > > > + pr_info("Hotplug tests passed OK\n");
> > > > + else if (ret > 0)
> > > > + pr_err("%d error(s) encountered in hotplug tests\n", ret);
> > > > + else {
> > > > + pr_err("Out of memory\n");
> > > > + return ret;
> > > > + }
> > > > +
> > > > + pr_info("Starting suspend tests (%d cycles per state)\n",
> > > > + NUM_SUSPEND_CYCLE);
> > > > + ret = suspend_tests();
> > > > + if (ret == 0)
> > > > + pr_info("Suspend tests passed OK\n");
> > > > + else if (ret > 0)
> > > > + pr_err("%d error(s) encountered in suspend tests\n", ret);
> > > > + else {
> > > > + switch (ret) {
> > > > + case -ENOMEM:
> > > > + pr_err("Out of memory\n");
> > > > + break;
> > > > + case -ENODEV:
> > > > + pr_warn("Could not start suspend tests on any CPU\n");
> > > > + break;
> > > > + }
> > > > + }
> > > > +
> > > > + pr_info("PSCI checker completed\n");
> > > > + return ret < 0 ? ret : 0;
> > > > +}
> > > > +late_initcall(psci_checker);
> > > > --
> > > > 2.10.0
> > > >
> > >
> >
>
^ permalink raw reply
* [PATCH 3/4] mfd: altr-a10sr: Add Arria10 SR Monitor
From: Thor Thayer @ 2016-10-26 15:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161026125233.GL11267@dell>
On 10/26/2016 07:52 AM, Lee Jones wrote:
> On Thu, 13 Oct 2016, tthayer at opensource.altera.com wrote:
>
>> From: Thor Thayer <tthayer@opensource.altera.com>
>>
>> Add the Altera Arria10 DevKit System Resource Monitor functionality
>> to the MFD device.
>>
>> Signed-off-by: Thor Thayer <tthayer@opensource.altera.com>
>> ---
>> drivers/mfd/altera-a10sr.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c
>> index 06e1f7f..0942d7d 100644
>> --- a/drivers/mfd/altera-a10sr.c
>> +++ b/drivers/mfd/altera-a10sr.c
>> @@ -33,6 +33,10 @@
>> .name = "altr_a10sr_gpio",
>> .of_compatible = "altr,a10sr-gpio",
>> },
>> + {
>> + .name = "altr_a10sr_mon",
>> + .of_compatible = "altr,a10sr-mon",
>
> "-monitor" would be better in my opinion.
>
OK. I'm flexible and it is clearer. I'll make the changes and resubmit.
Thanks for reviewing!
>> + },
>> };
>>
>> static bool altr_a10sr_reg_readable(struct device *dev, unsigned int reg)
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox