Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
"Here are three tiny driver fixes for 6.0-rc7. They include:

- phy driver reset bugfix

- fpga memleak bugfix

- counter irq config bugfix

The first two have been in linux-next for a while, the last one has
only been added to my tree in the past few days, but was in linux-next
under a different commit id. I couldn't pull directly from the counter
tree due to some gpg key propagation issue, so I took the commit
directly from email instead"

* tag 'char-misc-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
counter: 104-quad-8: Fix skipped IRQ lines during events configuration
fpga: m10bmc-sec: Fix possible memory leak of flash_buf
phy: marvell: phy-mvebu-a3700-comphy: Remove broken reset support

+24 -77
+3 -3
drivers/counter/104-quad-8.c
··· 449 449 return -EINVAL; 450 450 } 451 451 452 + /* Enable IRQ line */ 453 + irq_enabled |= BIT(event_node->channel); 454 + 452 455 /* Skip configuration if it is the same as previously set */ 453 456 if (priv->irq_trigger[event_node->channel] == next_irq_trigger) 454 457 continue; ··· 465 462 priv->irq_trigger[event_node->channel] << 3; 466 463 iowrite8(QUAD8_CTR_IOR | ior_cfg, 467 464 &priv->reg->channel[event_node->channel].control); 468 - 469 - /* Enable IRQ line */ 470 - irq_enabled |= BIT(event_node->channel); 471 465 } 472 466 473 467 iowrite8(irq_enabled, &priv->reg->index_interrupt);
+4 -4
drivers/fpga/intel-m10-bmc-sec-update.c
··· 148 148 stride = regmap_get_reg_stride(sec->m10bmc->regmap); 149 149 num_bits = FLASH_COUNT_SIZE * 8; 150 150 151 - flash_buf = kmalloc(FLASH_COUNT_SIZE, GFP_KERNEL); 152 - if (!flash_buf) 153 - return -ENOMEM; 154 - 155 151 if (FLASH_COUNT_SIZE % stride) { 156 152 dev_err(sec->dev, 157 153 "FLASH_COUNT_SIZE (0x%x) not aligned to stride (0x%x)\n", ··· 155 159 WARN_ON_ONCE(1); 156 160 return -EINVAL; 157 161 } 162 + 163 + flash_buf = kmalloc(FLASH_COUNT_SIZE, GFP_KERNEL); 164 + if (!flash_buf) 165 + return -ENOMEM; 158 166 159 167 ret = regmap_bulk_read(sec->m10bmc->regmap, STAGING_FLASH_COUNT, 160 168 flash_buf, FLASH_COUNT_SIZE / stride);
+17 -70
drivers/phy/marvell/phy-mvebu-a3700-comphy.c
··· 274 274 int submode; 275 275 bool invert_tx; 276 276 bool invert_rx; 277 - bool needs_reset; 278 277 }; 279 278 280 279 struct gbe_phy_init_data_fix { ··· 1096 1097 0x0, PU_PLL_BIT | PU_RX_BIT | PU_TX_BIT); 1097 1098 } 1098 1099 1099 - static int mvebu_a3700_comphy_reset(struct phy *phy) 1100 + static void mvebu_a3700_comphy_usb3_power_off(struct mvebu_a3700_comphy_lane *lane) 1100 1101 { 1101 - struct mvebu_a3700_comphy_lane *lane = phy_get_drvdata(phy); 1102 - u16 mask, data; 1103 - 1104 - dev_dbg(lane->dev, "resetting lane %d\n", lane->id); 1105 - 1106 - /* COMPHY reset for internal logic */ 1107 - comphy_lane_reg_set(lane, COMPHY_SFT_RESET, 1108 - SFT_RST_NO_REG, SFT_RST_NO_REG); 1109 - 1110 - /* COMPHY register reset (cleared automatically) */ 1111 - comphy_lane_reg_set(lane, COMPHY_SFT_RESET, SFT_RST, SFT_RST); 1112 - 1113 - /* PIPE soft and register reset */ 1114 - data = PIPE_SOFT_RESET | PIPE_REG_RESET; 1115 - mask = data; 1116 - comphy_lane_reg_set(lane, COMPHY_PIPE_RST_CLK_CTRL, data, mask); 1117 - 1118 - /* Release PIPE register reset */ 1119 - comphy_lane_reg_set(lane, COMPHY_PIPE_RST_CLK_CTRL, 1120 - 0x0, PIPE_REG_RESET); 1121 - 1122 - /* Reset SB configuration register (only for lanes 0 and 1) */ 1123 - if (lane->id == 0 || lane->id == 1) { 1124 - u32 mask, data; 1125 - 1126 - data = PIN_RESET_CORE_BIT | PIN_RESET_COMPHY_BIT | 1127 - PIN_PU_PLL_BIT | PIN_PU_RX_BIT | PIN_PU_TX_BIT; 1128 - mask = data | PIN_PU_IVREF_BIT | PIN_TX_IDLE_BIT; 1129 - comphy_periph_reg_set(lane, COMPHY_PHY_CFG1, data, mask); 1130 - } 1131 - 1132 - return 0; 1102 + /* 1103 + * The USB3 MAC sets the USB3 PHY to low state, so we do not 1104 + * need to power off USB3 PHY again. 1105 + */ 1133 1106 } 1134 1107 1135 1108 static bool mvebu_a3700_comphy_check_mode(int lane, ··· 1142 1171 (lane->mode != mode || lane->submode != submode)) 1143 1172 return -EBUSY; 1144 1173 1145 - /* If changing mode, ensure reset is called */ 1146 - if (lane->mode != PHY_MODE_INVALID && lane->mode != mode) 1147 - lane->needs_reset = true; 1148 - 1149 1174 /* Just remember the mode, ->power_on() will do the real setup */ 1150 1175 lane->mode = mode; 1151 1176 lane->submode = submode; ··· 1152 1185 static int mvebu_a3700_comphy_power_on(struct phy *phy) 1153 1186 { 1154 1187 struct mvebu_a3700_comphy_lane *lane = phy_get_drvdata(phy); 1155 - int ret; 1156 1188 1157 1189 if (!mvebu_a3700_comphy_check_mode(lane->id, lane->mode, 1158 1190 lane->submode)) { 1159 1191 dev_err(lane->dev, "invalid COMPHY mode\n"); 1160 1192 return -EINVAL; 1161 - } 1162 - 1163 - if (lane->needs_reset) { 1164 - ret = mvebu_a3700_comphy_reset(phy); 1165 - if (ret) 1166 - return ret; 1167 - 1168 - lane->needs_reset = false; 1169 1193 } 1170 1194 1171 1195 switch (lane->mode) { ··· 1182 1224 { 1183 1225 struct mvebu_a3700_comphy_lane *lane = phy_get_drvdata(phy); 1184 1226 1185 - switch (lane->mode) { 1186 - case PHY_MODE_USB_HOST_SS: 1187 - /* 1188 - * The USB3 MAC sets the USB3 PHY to low state, so we do not 1189 - * need to power off USB3 PHY again. 1190 - */ 1191 - break; 1192 - 1193 - case PHY_MODE_SATA: 1194 - mvebu_a3700_comphy_sata_power_off(lane); 1195 - break; 1196 - 1197 - case PHY_MODE_ETHERNET: 1227 + switch (lane->id) { 1228 + case 0: 1229 + mvebu_a3700_comphy_usb3_power_off(lane); 1198 1230 mvebu_a3700_comphy_ethernet_power_off(lane); 1199 - break; 1200 - 1201 - case PHY_MODE_PCIE: 1231 + return 0; 1232 + case 1: 1202 1233 mvebu_a3700_comphy_pcie_power_off(lane); 1203 - break; 1204 - 1234 + mvebu_a3700_comphy_ethernet_power_off(lane); 1235 + return 0; 1236 + case 2: 1237 + mvebu_a3700_comphy_usb3_power_off(lane); 1238 + mvebu_a3700_comphy_sata_power_off(lane); 1239 + return 0; 1205 1240 default: 1206 1241 dev_err(lane->dev, "invalid COMPHY mode\n"); 1207 1242 return -EINVAL; 1208 1243 } 1209 - 1210 - return 0; 1211 1244 } 1212 1245 1213 1246 static const struct phy_ops mvebu_a3700_comphy_ops = { 1214 1247 .power_on = mvebu_a3700_comphy_power_on, 1215 1248 .power_off = mvebu_a3700_comphy_power_off, 1216 - .reset = mvebu_a3700_comphy_reset, 1217 1249 .set_mode = mvebu_a3700_comphy_set_mode, 1218 1250 .owner = THIS_MODULE, 1219 1251 }; ··· 1341 1393 * To avoid relying on the bootloader/firmware configuration, 1342 1394 * power off all comphys. 1343 1395 */ 1344 - mvebu_a3700_comphy_reset(phy); 1345 - lane->needs_reset = false; 1396 + mvebu_a3700_comphy_power_off(phy); 1346 1397 } 1347 1398 1348 1399 provider = devm_of_phy_provider_register(&pdev->dev,