| @@ -1,41 +1,41 @@ | | | @@ -1,41 +1,41 @@ |
1 | /* $NetBSD: ata.c,v 1.141.6.12 2018/10/06 20:12:37 jdolecek Exp $ */ | | 1 | /* $NetBSD: ata.c,v 1.141.6.13 2018/10/06 20:13:12 jdolecek Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. | | 4 | * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | | 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | | 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | | 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | | 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 | */ | | 25 | */ |
26 | | | 26 | |
27 | #include <sys/cdefs.h> | | 27 | #include <sys/cdefs.h> |
28 | __KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.141.6.12 2018/10/06 20:12:37 jdolecek Exp $"); | | 28 | __KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.141.6.13 2018/10/06 20:13:12 jdolecek Exp $"); |
29 | | | 29 | |
30 | #include "opt_ata.h" | | 30 | #include "opt_ata.h" |
31 | | | 31 | |
32 | #include <sys/param.h> | | 32 | #include <sys/param.h> |
33 | #include <sys/systm.h> | | 33 | #include <sys/systm.h> |
34 | #include <sys/kernel.h> | | 34 | #include <sys/kernel.h> |
35 | #include <sys/device.h> | | 35 | #include <sys/device.h> |
36 | #include <sys/conf.h> | | 36 | #include <sys/conf.h> |
37 | #include <sys/fcntl.h> | | 37 | #include <sys/fcntl.h> |
38 | #include <sys/proc.h> | | 38 | #include <sys/proc.h> |
39 | #include <sys/kthread.h> | | 39 | #include <sys/kthread.h> |
40 | #include <sys/errno.h> | | 40 | #include <sys/errno.h> |
41 | #include <sys/ataio.h> | | 41 | #include <sys/ataio.h> |
| @@ -1666,27 +1666,26 @@ ata_thread_run(struct ata_channel *chp, | | | @@ -1666,27 +1666,26 @@ ata_thread_run(struct ata_channel *chp, |
1666 | break; | | 1666 | break; |
1667 | default: | | 1667 | default: |
1668 | panic("%s: unknown type: %x", __func__, type); | | 1668 | panic("%s: unknown type: %x", __func__, type); |
1669 | /* NOTREACHED */ | | 1669 | /* NOTREACHED */ |
1670 | } | | 1670 | } |
1671 | | | 1671 | |
1672 | /* | | 1672 | /* |
1673 | * Block execution of other commands while reset is scheduled | | 1673 | * Block execution of other commands while reset is scheduled |
1674 | * to a thread. | | 1674 | * to a thread. |
1675 | */ | | 1675 | */ |
1676 | ata_channel_freeze_locked(chp); | | 1676 | ata_channel_freeze_locked(chp); |
1677 | chp->ch_flags |= type; | | 1677 | chp->ch_flags |= type; |
1678 | | | 1678 | |
1679 | | | | |
1680 | cv_signal(&chp->ch_thr_idle); | | 1679 | cv_signal(&chp->ch_thr_idle); |
1681 | return; | | 1680 | return; |
1682 | } | | 1681 | } |
1683 | | | 1682 | |
1684 | /* Block execution of other commands during reset */ | | 1683 | /* Block execution of other commands during reset */ |
1685 | ata_channel_freeze_locked(chp); | | 1684 | ata_channel_freeze_locked(chp); |
1686 | | | 1685 | |
1687 | /* | | 1686 | /* |
1688 | * If reset has been scheduled to a thread, then clear | | 1687 | * If reset has been scheduled to a thread, then clear |
1689 | * the flag now so that the thread won't try to execute it if | | 1688 | * the flag now so that the thread won't try to execute it if |
1690 | * we happen to sleep, and thaw one more time after the reset. | | 1689 | * we happen to sleep, and thaw one more time after the reset. |
1691 | */ | | 1690 | */ |
1692 | if (chp->ch_flags & type) { | | 1691 | if (chp->ch_flags & type) { |