aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/masters
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 14:25:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 14:25:33 -0400
commitfa93669a1917f93b09142d4b2298329b82d7d36d (patch)
tree7f8d6dc9d1fbb086c59a799a3a7137c46fb9959e /drivers/w1/masters
parentb13bc8dda81c54a66a1c84e66f60b8feba659f28 (diff)
parent6791457a090d9a234a40b501c2536f0aefaeae4b (diff)
Merge tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core changes from Greg Kroah-Hartman: "Here's the big driver core pull request for 3.6-rc1. Unlike 3.5, this kernel should be a lot tamer, with the printk changes now settled down. All we have here is some extcon driver updates, w1 driver updates, a few printk cleanups that weren't needed for 3.5, but are good to have now, and some other minor fixes/changes in the driver core. All of these have been in the linux-next releases for a while now. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (38 commits) printk: Export struct log size and member offsets through vmcoreinfo Drivers: hv: Change the hex constant to a decimal constant driver core: don't trigger uevent after failure extcon: MAX77693: Add extcon-max77693 driver to support Maxim MAX77693 MUIC device sysfs: fail dentry revalidation after namespace change fix sysfs: fail dentry revalidation after namespace change extcon: spelling of detach in function doc extcon: arizona: Stop microphone detection if we give up on it extcon: arizona: Update cable reporting calls and split headset PM / Runtime: Do not increment device usage counts before probing kmsg - do not flush partial lines when the console is busy kmsg - export "continuation record" flag to /dev/kmsg kmsg - avoid warning for CONFIG_PRINTK=n compilations kmsg - properly print over-long continuation lines driver-core: Use kobj_to_dev instead of re-implementing it driver-core: Move kobj_to_dev from genhd.h to device.h driver core: Move deferred devices to the end of dpm_list before probing driver core: move uevent call to driver_register driver core: fix shutdown races with probe/remove(v3) Extcon: Arizona: Add driver for Wolfson Arizona class devices ...
Diffstat (limited to 'drivers/w1/masters')
-rw-r--r--drivers/w1/masters/ds1wm.c4
-rw-r--r--drivers/w1/masters/omap_hdq.c30
2 files changed, 18 insertions, 16 deletions
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index a0c8965c1a79..530a2d309063 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -334,7 +334,9 @@ static void ds1wm_search(void *data, struct w1_master *master_dev,
334 return; 334 return;
335 } 335 }
336 336
337 mutex_lock(&master_dev->bus_mutex);
337 if (ds1wm_reset(ds1wm_data)) { 338 if (ds1wm_reset(ds1wm_data)) {
339 mutex_unlock(&master_dev->bus_mutex);
338 dev_dbg(&ds1wm_data->pdev->dev, 340 dev_dbg(&ds1wm_data->pdev->dev,
339 "pass: %d reset error (or no slaves)\n", pass); 341 "pass: %d reset error (or no slaves)\n", pass);
340 break; 342 break;
@@ -387,6 +389,7 @@ static void ds1wm_search(void *data, struct w1_master *master_dev,
387 389
388 } 390 }
389 if (ds1wm_data->read_error) { 391 if (ds1wm_data->read_error) {
392 mutex_unlock(&master_dev->bus_mutex);
390 dev_err(&ds1wm_data->pdev->dev, 393 dev_err(&ds1wm_data->pdev->dev,
391 "pass: %d read error, retrying\n", pass); 394 "pass: %d read error, retrying\n", pass);
392 break; 395 break;
@@ -400,6 +403,7 @@ static void ds1wm_search(void *data, struct w1_master *master_dev,
400 dev_dbg(&ds1wm_data->pdev->dev, 403 dev_dbg(&ds1wm_data->pdev->dev,
401 "pass: %d resetting bus\n", pass); 404 "pass: %d resetting bus\n", pass);
402 ds1wm_reset(ds1wm_data); 405 ds1wm_reset(ds1wm_data);
406 mutex_unlock(&master_dev->bus_mutex);
403 if ((r_prime & ((u64)1 << 63)) && (d & ((u64)1 << 63))) { 407 if ((r_prime & ((u64)1 << 63)) && (d & ((u64)1 << 63))) {
404 dev_err(&ds1wm_data->pdev->dev, 408 dev_err(&ds1wm_data->pdev->dev,
405 "pass: %d bus error, retrying\n", pass); 409 "pass: %d bus error, retrying\n", pass);
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 291897c881be..4b0fcf3c2d03 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -178,6 +178,7 @@ static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
178 hdq_data->hdq_irqstatus, OMAP_HDQ_TIMEOUT); 178 hdq_data->hdq_irqstatus, OMAP_HDQ_TIMEOUT);
179 if (ret == 0) { 179 if (ret == 0) {
180 dev_dbg(hdq_data->dev, "TX wait elapsed\n"); 180 dev_dbg(hdq_data->dev, "TX wait elapsed\n");
181 ret = -ETIMEDOUT;
181 goto out; 182 goto out;
182 } 183 }
183 184
@@ -185,7 +186,7 @@ static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
185 /* check irqstatus */ 186 /* check irqstatus */
186 if (!(*status & OMAP_HDQ_INT_STATUS_TXCOMPLETE)) { 187 if (!(*status & OMAP_HDQ_INT_STATUS_TXCOMPLETE)) {
187 dev_dbg(hdq_data->dev, "timeout waiting for" 188 dev_dbg(hdq_data->dev, "timeout waiting for"
188 "TXCOMPLETE/RXCOMPLETE, %x", *status); 189 " TXCOMPLETE/RXCOMPLETE, %x", *status);
189 ret = -ETIMEDOUT; 190 ret = -ETIMEDOUT;
190 goto out; 191 goto out;
191 } 192 }
@@ -196,7 +197,7 @@ static int hdq_write_byte(struct hdq_data *hdq_data, u8 val, u8 *status)
196 OMAP_HDQ_FLAG_CLEAR, &tmp_status); 197 OMAP_HDQ_FLAG_CLEAR, &tmp_status);
197 if (ret) { 198 if (ret) {
198 dev_dbg(hdq_data->dev, "timeout waiting GO bit" 199 dev_dbg(hdq_data->dev, "timeout waiting GO bit"
199 "return to zero, %x", tmp_status); 200 " return to zero, %x", tmp_status);
200 } 201 }
201 202
202out: 203out:
@@ -339,7 +340,7 @@ static int omap_hdq_break(struct hdq_data *hdq_data)
339 &tmp_status); 340 &tmp_status);
340 if (ret) 341 if (ret)
341 dev_dbg(hdq_data->dev, "timeout waiting INIT&GO bits" 342 dev_dbg(hdq_data->dev, "timeout waiting INIT&GO bits"
342 "return to zero, %x", tmp_status); 343 " return to zero, %x", tmp_status);
343 344
344out: 345out:
345 mutex_unlock(&hdq_data->hdq_mutex); 346 mutex_unlock(&hdq_data->hdq_mutex);
@@ -351,7 +352,6 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
351{ 352{
352 int ret = 0; 353 int ret = 0;
353 u8 status; 354 u8 status;
354 unsigned long timeout = jiffies + OMAP_HDQ_TIMEOUT;
355 355
356 ret = mutex_lock_interruptible(&hdq_data->hdq_mutex); 356 ret = mutex_lock_interruptible(&hdq_data->hdq_mutex);
357 if (ret < 0) { 357 if (ret < 0) {
@@ -369,22 +369,20 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
369 OMAP_HDQ_CTRL_STATUS_DIR | OMAP_HDQ_CTRL_STATUS_GO, 369 OMAP_HDQ_CTRL_STATUS_DIR | OMAP_HDQ_CTRL_STATUS_GO,
370 OMAP_HDQ_CTRL_STATUS_DIR | OMAP_HDQ_CTRL_STATUS_GO); 370 OMAP_HDQ_CTRL_STATUS_DIR | OMAP_HDQ_CTRL_STATUS_GO);
371 /* 371 /*
372 * The RX comes immediately after TX. It 372 * The RX comes immediately after TX.
373 * triggers another interrupt before we
374 * sleep. So we have to wait for RXCOMPLETE bit.
375 */ 373 */
376 while (!(hdq_data->hdq_irqstatus 374 wait_event_timeout(hdq_wait_queue,
377 & OMAP_HDQ_INT_STATUS_RXCOMPLETE) 375 (hdq_data->hdq_irqstatus
378 && time_before(jiffies, timeout)) { 376 & OMAP_HDQ_INT_STATUS_RXCOMPLETE),
379 schedule_timeout_uninterruptible(1); 377 OMAP_HDQ_TIMEOUT);
380 } 378
381 hdq_reg_merge(hdq_data, OMAP_HDQ_CTRL_STATUS, 0, 379 hdq_reg_merge(hdq_data, OMAP_HDQ_CTRL_STATUS, 0,
382 OMAP_HDQ_CTRL_STATUS_DIR); 380 OMAP_HDQ_CTRL_STATUS_DIR);
383 status = hdq_data->hdq_irqstatus; 381 status = hdq_data->hdq_irqstatus;
384 /* check irqstatus */ 382 /* check irqstatus */
385 if (!(status & OMAP_HDQ_INT_STATUS_RXCOMPLETE)) { 383 if (!(status & OMAP_HDQ_INT_STATUS_RXCOMPLETE)) {
386 dev_dbg(hdq_data->dev, "timeout waiting for" 384 dev_dbg(hdq_data->dev, "timeout waiting for"
387 "RXCOMPLETE, %x", status); 385 " RXCOMPLETE, %x", status);
388 ret = -ETIMEDOUT; 386 ret = -ETIMEDOUT;
389 goto out; 387 goto out;
390 } 388 }
@@ -394,7 +392,7 @@ static int hdq_read_byte(struct hdq_data *hdq_data, u8 *val)
394out: 392out:
395 mutex_unlock(&hdq_data->hdq_mutex); 393 mutex_unlock(&hdq_data->hdq_mutex);
396rtn: 394rtn:
397 return 0; 395 return ret;
398 396
399} 397}
400 398
@@ -456,7 +454,7 @@ static int omap_hdq_put(struct hdq_data *hdq_data)
456 454
457 if (0 == hdq_data->hdq_usecount) { 455 if (0 == hdq_data->hdq_usecount) {
458 dev_dbg(hdq_data->dev, "attempt to decrement use count" 456 dev_dbg(hdq_data->dev, "attempt to decrement use count"
459 "when it is zero"); 457 " when it is zero");
460 ret = -EINVAL; 458 ret = -EINVAL;
461 } else { 459 } else {
462 hdq_data->hdq_usecount--; 460 hdq_data->hdq_usecount--;
@@ -524,7 +522,7 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
524 mutex_unlock(&hdq_data->hdq_mutex); 522 mutex_unlock(&hdq_data->hdq_mutex);
525 523
526 ret = hdq_write_byte(hdq_data, byte, &status); 524 ret = hdq_write_byte(hdq_data, byte, &status);
527 if (ret == 0) { 525 if (ret < 0) {
528 dev_dbg(hdq_data->dev, "TX failure:Ctrl status %x\n", status); 526 dev_dbg(hdq_data->dev, "TX failure:Ctrl status %x\n", status);
529 return; 527 return;
530 } 528 }