aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2012-11-05 23:53:05 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-07 03:53:38 -0500
commit47bbea4171025c96e80f7ded7595697a2cb56552 (patch)
tree82cb71be89c16ac802e493aedecc381f401f7342 /drivers
parent0547fad2dd7ccaaf3c914ba49073fa37e4e241eb (diff)
usbnet: smsc75xx: apply the introduced usbnet_{read|write}_cmd_nopm
This patch applies the introduced usbnet_read_cmd_nopm() and usbnet_write_cmd_nopm() in the callback of resume and suspend to avoid deadlock if USB runtime PM is considered into usbnet_read_cmd() and usbnet_write_cmd(). Cc: Steve Glendinning <steve.glendinning@shawell.net> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/smsc75xx.c147
1 files changed, 90 insertions, 57 deletions
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 85d70c2dd397..c5353cfc9c8c 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -85,18 +85,23 @@ static bool turbo_mode = true;
85module_param(turbo_mode, bool, 0644); 85module_param(turbo_mode, bool, 0644);
86MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); 86MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
87 87
88static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index, 88static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index,
89 u32 *data) 89 u32 *data, int in_pm)
90{ 90{
91 u32 buf; 91 u32 buf;
92 int ret; 92 int ret;
93 int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
93 94
94 BUG_ON(!dev); 95 BUG_ON(!dev);
95 96
96 ret = usbnet_read_cmd(dev, USB_VENDOR_REQUEST_READ_REGISTER, 97 if (!in_pm)
97 USB_DIR_IN | USB_TYPE_VENDOR | 98 fn = usbnet_read_cmd;
98 USB_RECIP_DEVICE, 99 else
99 0, index, &buf, 4); 100 fn = usbnet_read_cmd_nopm;
101
102 ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
103 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
104 0, index, &buf, 4);
100 if (unlikely(ret < 0)) 105 if (unlikely(ret < 0))
101 netdev_warn(dev->net, 106 netdev_warn(dev->net,
102 "Failed to read reg index 0x%08x: %d", index, ret); 107 "Failed to read reg index 0x%08x: %d", index, ret);
@@ -107,21 +112,26 @@ static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index,
107 return ret; 112 return ret;
108} 113}
109 114
110static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index, 115static int __must_check __smsc75xx_write_reg(struct usbnet *dev, u32 index,
111 u32 data) 116 u32 data, int in_pm)
112{ 117{
113 u32 buf; 118 u32 buf;
114 int ret; 119 int ret;
120 int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
115 121
116 BUG_ON(!dev); 122 BUG_ON(!dev);
117 123
124 if (!in_pm)
125 fn = usbnet_write_cmd;
126 else
127 fn = usbnet_write_cmd_nopm;
128
118 buf = data; 129 buf = data;
119 cpu_to_le32s(&buf); 130 cpu_to_le32s(&buf);
120 131
121 ret = usbnet_write_cmd(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, 132 ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
122 USB_DIR_OUT | USB_TYPE_VENDOR | 133 | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
123 USB_RECIP_DEVICE, 134 0, index, &buf, 4);
124 0, index, &buf, 4);
125 if (unlikely(ret < 0)) 135 if (unlikely(ret < 0))
126 netdev_warn(dev->net, 136 netdev_warn(dev->net,
127 "Failed to write reg index 0x%08x: %d", index, ret); 137 "Failed to write reg index 0x%08x: %d", index, ret);
@@ -129,16 +139,38 @@ static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index,
129 return ret; 139 return ret;
130} 140}
131 141
142static int __must_check smsc75xx_read_reg_nopm(struct usbnet *dev, u32 index,
143 u32 *data)
144{
145 return __smsc75xx_read_reg(dev, index, data, 1);
146}
147
148static int __must_check smsc75xx_write_reg_nopm(struct usbnet *dev, u32 index,
149 u32 data)
150{
151 return __smsc75xx_write_reg(dev, index, data, 1);
152}
153
154static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index,
155 u32 *data)
156{
157 return __smsc75xx_read_reg(dev, index, data, 0);
158}
159
160static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index,
161 u32 data)
162{
163 return __smsc75xx_write_reg(dev, index, data, 0);
164}
165
132static int smsc75xx_set_feature(struct usbnet *dev, u32 feature) 166static int smsc75xx_set_feature(struct usbnet *dev, u32 feature)
133{ 167{
134 if (WARN_ON_ONCE(!dev)) 168 if (WARN_ON_ONCE(!dev))
135 return -EINVAL; 169 return -EINVAL;
136 170
137 cpu_to_le32s(&feature); 171 return usbnet_write_cmd_nopm(dev, USB_REQ_SET_FEATURE,
138 172 USB_DIR_OUT | USB_RECIP_DEVICE,
139 return usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), 173 feature, 0, NULL, 0);
140 USB_REQ_SET_FEATURE, USB_RECIP_DEVICE, feature, 0, NULL, 0,
141 USB_CTRL_SET_TIMEOUT);
142} 174}
143 175
144static int smsc75xx_clear_feature(struct usbnet *dev, u32 feature) 176static int smsc75xx_clear_feature(struct usbnet *dev, u32 feature)
@@ -146,11 +178,9 @@ static int smsc75xx_clear_feature(struct usbnet *dev, u32 feature)
146 if (WARN_ON_ONCE(!dev)) 178 if (WARN_ON_ONCE(!dev))
147 return -EINVAL; 179 return -EINVAL;
148 180
149 cpu_to_le32s(&feature); 181 return usbnet_write_cmd_nopm(dev, USB_REQ_CLEAR_FEATURE,
150 182 USB_DIR_OUT | USB_RECIP_DEVICE,
151 return usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), 183 feature, 0, NULL, 0);
152 USB_REQ_CLEAR_FEATURE, USB_RECIP_DEVICE, feature, 0, NULL, 0,
153 USB_CTRL_SET_TIMEOUT);
154} 184}
155 185
156/* Loop until the read is completed with timeout 186/* Loop until the read is completed with timeout
@@ -796,13 +826,16 @@ static int smsc75xx_set_features(struct net_device *netdev,
796 return 0; 826 return 0;
797} 827}
798 828
799static int smsc75xx_wait_ready(struct usbnet *dev) 829static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
800{ 830{
801 int timeout = 0; 831 int timeout = 0;
802 832
803 do { 833 do {
804 u32 buf; 834 u32 buf;
805 int ret = smsc75xx_read_reg(dev, PMT_CTL, &buf); 835 int ret;
836
837 ret = __smsc75xx_read_reg(dev, PMT_CTL, &buf, in_pm);
838
806 check_warn_return(ret, "Failed to read PMT_CTL: %d", ret); 839 check_warn_return(ret, "Failed to read PMT_CTL: %d", ret);
807 840
808 if (buf & PMT_CTL_DEV_RDY) 841 if (buf & PMT_CTL_DEV_RDY)
@@ -824,7 +857,7 @@ static int smsc75xx_reset(struct usbnet *dev)
824 857
825 netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset"); 858 netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset");
826 859
827 ret = smsc75xx_wait_ready(dev); 860 ret = smsc75xx_wait_ready(dev, 0);
828 check_warn_return(ret, "device not ready in smsc75xx_reset"); 861 check_warn_return(ret, "device not ready in smsc75xx_reset");
829 862
830 ret = smsc75xx_read_reg(dev, HW_CFG, &buf); 863 ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
@@ -1191,30 +1224,30 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
1191 netdev_info(dev->net, "entering SUSPEND2 mode"); 1224 netdev_info(dev->net, "entering SUSPEND2 mode");
1192 1225
1193 /* disable energy detect (link up) & wake up events */ 1226 /* disable energy detect (link up) & wake up events */
1194 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1227 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1195 check_warn_return(ret, "Error reading WUCSR"); 1228 check_warn_return(ret, "Error reading WUCSR");
1196 1229
1197 val &= ~(WUCSR_MPEN | WUCSR_WUEN); 1230 val &= ~(WUCSR_MPEN | WUCSR_WUEN);
1198 1231
1199 ret = smsc75xx_write_reg(dev, WUCSR, val); 1232 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1200 check_warn_return(ret, "Error writing WUCSR"); 1233 check_warn_return(ret, "Error writing WUCSR");
1201 1234
1202 ret = smsc75xx_read_reg(dev, PMT_CTL, &val); 1235 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
1203 check_warn_return(ret, "Error reading PMT_CTL"); 1236 check_warn_return(ret, "Error reading PMT_CTL");
1204 1237
1205 val &= ~(PMT_CTL_ED_EN | PMT_CTL_WOL_EN); 1238 val &= ~(PMT_CTL_ED_EN | PMT_CTL_WOL_EN);
1206 1239
1207 ret = smsc75xx_write_reg(dev, PMT_CTL, val); 1240 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
1208 check_warn_return(ret, "Error writing PMT_CTL"); 1241 check_warn_return(ret, "Error writing PMT_CTL");
1209 1242
1210 /* enter suspend2 mode */ 1243 /* enter suspend2 mode */
1211 ret = smsc75xx_read_reg(dev, PMT_CTL, &val); 1244 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
1212 check_warn_return(ret, "Error reading PMT_CTL"); 1245 check_warn_return(ret, "Error reading PMT_CTL");
1213 1246
1214 val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST); 1247 val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST);
1215 val |= PMT_CTL_SUS_MODE_2; 1248 val |= PMT_CTL_SUS_MODE_2;
1216 1249
1217 ret = smsc75xx_write_reg(dev, PMT_CTL, val); 1250 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
1218 check_warn_return(ret, "Error writing PMT_CTL"); 1251 check_warn_return(ret, "Error writing PMT_CTL");
1219 1252
1220 return 0; 1253 return 0;
@@ -1225,7 +1258,7 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
1225 1258
1226 /* disable all filters */ 1259 /* disable all filters */
1227 for (i = 0; i < WUF_NUM; i++) { 1260 for (i = 0; i < WUF_NUM; i++) {
1228 ret = smsc75xx_write_reg(dev, WUF_CFGX + i * 4, 0); 1261 ret = smsc75xx_write_reg_nopm(dev, WUF_CFGX + i * 4, 0);
1229 check_warn_return(ret, "Error writing WUF_CFGX"); 1262 check_warn_return(ret, "Error writing WUF_CFGX");
1230 } 1263 }
1231 1264
@@ -1250,95 +1283,95 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
1250 } 1283 }
1251 1284
1252 /* clear any pending pattern match packet status */ 1285 /* clear any pending pattern match packet status */
1253 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1286 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1254 check_warn_return(ret, "Error reading WUCSR"); 1287 check_warn_return(ret, "Error reading WUCSR");
1255 1288
1256 val |= WUCSR_WUFR; 1289 val |= WUCSR_WUFR;
1257 1290
1258 ret = smsc75xx_write_reg(dev, WUCSR, val); 1291 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1259 check_warn_return(ret, "Error writing WUCSR"); 1292 check_warn_return(ret, "Error writing WUCSR");
1260 1293
1261 netdev_info(dev->net, "enabling packet match detection"); 1294 netdev_info(dev->net, "enabling packet match detection");
1262 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1295 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1263 check_warn_return(ret, "Error reading WUCSR"); 1296 check_warn_return(ret, "Error reading WUCSR");
1264 1297
1265 val |= WUCSR_WUEN; 1298 val |= WUCSR_WUEN;
1266 1299
1267 ret = smsc75xx_write_reg(dev, WUCSR, val); 1300 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1268 check_warn_return(ret, "Error writing WUCSR"); 1301 check_warn_return(ret, "Error writing WUCSR");
1269 } else { 1302 } else {
1270 netdev_info(dev->net, "disabling packet match detection"); 1303 netdev_info(dev->net, "disabling packet match detection");
1271 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1304 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1272 check_warn_return(ret, "Error reading WUCSR"); 1305 check_warn_return(ret, "Error reading WUCSR");
1273 1306
1274 val &= ~WUCSR_WUEN; 1307 val &= ~WUCSR_WUEN;
1275 1308
1276 ret = smsc75xx_write_reg(dev, WUCSR, val); 1309 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1277 check_warn_return(ret, "Error writing WUCSR"); 1310 check_warn_return(ret, "Error writing WUCSR");
1278 } 1311 }
1279 1312
1280 /* disable magic, bcast & unicast wakeup sources */ 1313 /* disable magic, bcast & unicast wakeup sources */
1281 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1314 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1282 check_warn_return(ret, "Error reading WUCSR"); 1315 check_warn_return(ret, "Error reading WUCSR");
1283 1316
1284 val &= ~(WUCSR_MPEN | WUCSR_BCST_EN | WUCSR_PFDA_EN); 1317 val &= ~(WUCSR_MPEN | WUCSR_BCST_EN | WUCSR_PFDA_EN);
1285 1318
1286 ret = smsc75xx_write_reg(dev, WUCSR, val); 1319 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1287 check_warn_return(ret, "Error writing WUCSR"); 1320 check_warn_return(ret, "Error writing WUCSR");
1288 1321
1289 if (pdata->wolopts & WAKE_MAGIC) { 1322 if (pdata->wolopts & WAKE_MAGIC) {
1290 netdev_info(dev->net, "enabling magic packet wakeup"); 1323 netdev_info(dev->net, "enabling magic packet wakeup");
1291 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1324 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1292 check_warn_return(ret, "Error reading WUCSR"); 1325 check_warn_return(ret, "Error reading WUCSR");
1293 1326
1294 /* clear any pending magic packet status */ 1327 /* clear any pending magic packet status */
1295 val |= WUCSR_MPR | WUCSR_MPEN; 1328 val |= WUCSR_MPR | WUCSR_MPEN;
1296 1329
1297 ret = smsc75xx_write_reg(dev, WUCSR, val); 1330 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1298 check_warn_return(ret, "Error writing WUCSR"); 1331 check_warn_return(ret, "Error writing WUCSR");
1299 } 1332 }
1300 1333
1301 if (pdata->wolopts & WAKE_BCAST) { 1334 if (pdata->wolopts & WAKE_BCAST) {
1302 netdev_info(dev->net, "enabling broadcast detection"); 1335 netdev_info(dev->net, "enabling broadcast detection");
1303 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1336 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1304 check_warn_return(ret, "Error reading WUCSR"); 1337 check_warn_return(ret, "Error reading WUCSR");
1305 1338
1306 val |= WUCSR_BCAST_FR | WUCSR_BCST_EN; 1339 val |= WUCSR_BCAST_FR | WUCSR_BCST_EN;
1307 1340
1308 ret = smsc75xx_write_reg(dev, WUCSR, val); 1341 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1309 check_warn_return(ret, "Error writing WUCSR"); 1342 check_warn_return(ret, "Error writing WUCSR");
1310 } 1343 }
1311 1344
1312 if (pdata->wolopts & WAKE_UCAST) { 1345 if (pdata->wolopts & WAKE_UCAST) {
1313 netdev_info(dev->net, "enabling unicast detection"); 1346 netdev_info(dev->net, "enabling unicast detection");
1314 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1347 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1315 check_warn_return(ret, "Error reading WUCSR"); 1348 check_warn_return(ret, "Error reading WUCSR");
1316 1349
1317 val |= WUCSR_WUFR | WUCSR_PFDA_EN; 1350 val |= WUCSR_WUFR | WUCSR_PFDA_EN;
1318 1351
1319 ret = smsc75xx_write_reg(dev, WUCSR, val); 1352 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1320 check_warn_return(ret, "Error writing WUCSR"); 1353 check_warn_return(ret, "Error writing WUCSR");
1321 } 1354 }
1322 1355
1323 /* enable receiver to enable frame reception */ 1356 /* enable receiver to enable frame reception */
1324 ret = smsc75xx_read_reg(dev, MAC_RX, &val); 1357 ret = smsc75xx_read_reg_nopm(dev, MAC_RX, &val);
1325 check_warn_return(ret, "Failed to read MAC_RX: %d", ret); 1358 check_warn_return(ret, "Failed to read MAC_RX: %d", ret);
1326 1359
1327 val |= MAC_RX_RXEN; 1360 val |= MAC_RX_RXEN;
1328 1361
1329 ret = smsc75xx_write_reg(dev, MAC_RX, val); 1362 ret = smsc75xx_write_reg_nopm(dev, MAC_RX, val);
1330 check_warn_return(ret, "Failed to write MAC_RX: %d", ret); 1363 check_warn_return(ret, "Failed to write MAC_RX: %d", ret);
1331 1364
1332 /* some wol options are enabled, so enter SUSPEND0 */ 1365 /* some wol options are enabled, so enter SUSPEND0 */
1333 netdev_info(dev->net, "entering SUSPEND0 mode"); 1366 netdev_info(dev->net, "entering SUSPEND0 mode");
1334 1367
1335 ret = smsc75xx_read_reg(dev, PMT_CTL, &val); 1368 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
1336 check_warn_return(ret, "Error reading PMT_CTL"); 1369 check_warn_return(ret, "Error reading PMT_CTL");
1337 1370
1338 val &= (~(PMT_CTL_SUS_MODE | PMT_CTL_PHY_RST)); 1371 val &= (~(PMT_CTL_SUS_MODE | PMT_CTL_PHY_RST));
1339 val |= PMT_CTL_SUS_MODE_0 | PMT_CTL_WOL_EN | PMT_CTL_WUPS; 1372 val |= PMT_CTL_SUS_MODE_0 | PMT_CTL_WOL_EN | PMT_CTL_WUPS;
1340 1373
1341 ret = smsc75xx_write_reg(dev, PMT_CTL, val); 1374 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
1342 check_warn_return(ret, "Error writing PMT_CTL"); 1375 check_warn_return(ret, "Error writing PMT_CTL");
1343 1376
1344 smsc75xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP); 1377 smsc75xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
@@ -1359,37 +1392,37 @@ static int smsc75xx_resume(struct usb_interface *intf)
1359 smsc75xx_clear_feature(dev, USB_DEVICE_REMOTE_WAKEUP); 1392 smsc75xx_clear_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
1360 1393
1361 /* Disable wakeup sources */ 1394 /* Disable wakeup sources */
1362 ret = smsc75xx_read_reg(dev, WUCSR, &val); 1395 ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
1363 check_warn_return(ret, "Error reading WUCSR"); 1396 check_warn_return(ret, "Error reading WUCSR");
1364 1397
1365 val &= ~(WUCSR_WUEN | WUCSR_MPEN | WUCSR_PFDA_EN 1398 val &= ~(WUCSR_WUEN | WUCSR_MPEN | WUCSR_PFDA_EN
1366 | WUCSR_BCST_EN); 1399 | WUCSR_BCST_EN);
1367 1400
1368 ret = smsc75xx_write_reg(dev, WUCSR, val); 1401 ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
1369 check_warn_return(ret, "Error writing WUCSR"); 1402 check_warn_return(ret, "Error writing WUCSR");
1370 1403
1371 /* clear wake-up status */ 1404 /* clear wake-up status */
1372 ret = smsc75xx_read_reg(dev, PMT_CTL, &val); 1405 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
1373 check_warn_return(ret, "Error reading PMT_CTL"); 1406 check_warn_return(ret, "Error reading PMT_CTL");
1374 1407
1375 val &= ~PMT_CTL_WOL_EN; 1408 val &= ~PMT_CTL_WOL_EN;
1376 val |= PMT_CTL_WUPS; 1409 val |= PMT_CTL_WUPS;
1377 1410
1378 ret = smsc75xx_write_reg(dev, PMT_CTL, val); 1411 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
1379 check_warn_return(ret, "Error writing PMT_CTL"); 1412 check_warn_return(ret, "Error writing PMT_CTL");
1380 } else { 1413 } else {
1381 netdev_info(dev->net, "resuming from SUSPEND2"); 1414 netdev_info(dev->net, "resuming from SUSPEND2");
1382 1415
1383 ret = smsc75xx_read_reg(dev, PMT_CTL, &val); 1416 ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
1384 check_warn_return(ret, "Error reading PMT_CTL"); 1417 check_warn_return(ret, "Error reading PMT_CTL");
1385 1418
1386 val |= PMT_CTL_PHY_PWRUP; 1419 val |= PMT_CTL_PHY_PWRUP;
1387 1420
1388 ret = smsc75xx_write_reg(dev, PMT_CTL, val); 1421 ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
1389 check_warn_return(ret, "Error writing PMT_CTL"); 1422 check_warn_return(ret, "Error writing PMT_CTL");
1390 } 1423 }
1391 1424
1392 ret = smsc75xx_wait_ready(dev); 1425 ret = smsc75xx_wait_ready(dev, 1);
1393 check_warn_return(ret, "device not ready in smsc75xx_resume"); 1426 check_warn_return(ret, "device not ready in smsc75xx_resume");
1394 1427
1395 return usbnet_resume(intf); 1428 return usbnet_resume(intf);