The branch main has been updated by imp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ae1955cd67c293dd402d9d007b368ef88c6eb1d9

commit ae1955cd67c293dd402d9d007b368ef88c6eb1d9
Author:     Warner Losh <i...@freebsd.org>
AuthorDate: 2022-04-26 17:01:06 +0000
Commit:     Warner Losh <i...@freebsd.org>
CommitDate: 2022-04-26 17:01:39 +0000

    adaasync: Harmonize with daasync
    
    We should call cam_periph_async() always, like SCSI does. This routine
    is supposed to be more of a catch-all.
    
    cam_periph_async() only does actions for AC_LOST_DEVICE. It ignores all
    other events (today), but this may not always be true. So this is a nop
    change.
    
    Drop in a 'break' so we don't fall through unnecessarily.
    
    Sponsored by:           Netflix
    Reviewed by:            mav
    Differential Revision:  https://reviews.freebsd.org/D35057
---
 sys/cam/ata/ata_da.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index a83c5a50c5f3..b82671315138 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -1352,8 +1352,6 @@ adaasync(void *callback_arg, u_int32_t code,
                adasetflags(softc, &cgd);
                adasetgeom(softc, &cgd);
                disk_resize(softc->disk, M_NOWAIT);
-
-               cam_periph_async(periph, code, path, arg);
                break;
        }
        case AC_ADVINFO_CHANGED:
@@ -1374,7 +1372,6 @@ adaasync(void *callback_arg, u_int32_t code,
        case AC_BUS_RESET:
        {
                softc = (struct ada_softc *)periph->softc;
-               cam_periph_async(periph, code, path, arg);
                if (softc->state != ADA_STATE_NORMAL)
                        break;
                if (ADA_RA >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD)
@@ -1385,16 +1382,17 @@ adaasync(void *callback_arg, u_int32_t code,
                      && (softc->zone_mode != ADA_ZONE_NONE))
                        softc->state = ADA_STATE_LOGDIR;
                else
-                   break;
+                       break;
                if (cam_periph_acquire(periph) != 0)
                        softc->state = ADA_STATE_NORMAL;
                else
                        xpt_schedule(periph, CAM_PRIORITY_DEV);
+               break;
        }
        default:
-               cam_periph_async(periph, code, path, arg);
                break;
        }
+       cam_periph_async(periph, code, path, arg);
 }
 
 static int

Reply via email to