From nobody Sun Dec 26 21:00:38 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C2369190C8EB for ; Sun, 26 Dec 2021 21:00:49 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-55.consmr.mail.gq1.yahoo.com (sonic307-55.consmr.mail.gq1.yahoo.com [98.137.64.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4JMY9Y0Hjcz4XPl for ; Sun, 26 Dec 2021 21:00:48 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1640552528; bh=rMsNC8vE+dgO6VAN9H/E6GRCO80Sue9earSQA086fGE=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=GnyXwRtkfHr7V56L6NRTuGSFn4D2GRXU3tnh630wIeX6OuMvwl3juDrdJPapyGt4o3742nxNYw6hLnDRT2sKOd2qEl3R5a4Mwh2rkscSmQT2UyLKBwoGZ2nH0NrnOAEyASoXJ9oSsqNe3P7t8+JmvZv3Nr8YGGhuNMhyznF8shftJAY6dmy5kIBVDcaxnhjRGMf1C/f+uvmBAzxQ5s4SBSaIUSCxwq0PqGOUGA3+GPUQ1tBKbokzCl1m3Nz+cCKUnEzwxXX0nUFFvF6IvbM5wVvbRCnOJH0MHZUNMudzZQDim97yCEFSdWmW6qZWgwuuLhm5RyjD/y8/UHARJ9kT6Q== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1640552528; bh=wu9MeiD0mLmkd3+GuMDxwGgWU3OFH3Br4oyAnNQLzA1=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=g4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oPiZlpn8r5f1Pm55sdr.sxg FMzleyjTiD8om1r.qmTomehWQL.bHKqZ1eEMt15vXpbXKEwK6YpmIQispx8duQzFVQAatO1Pu5_C amEfN0kJs76B8j_ZFgYFyX_OT2zIyqNj2lM9lbFaENb3SoxRDRVR9SMjqgEa7UyTcU2qsqlCpnq. m2SkdS7ZdmieI3IZxOsDSYIygzhK478ROny2v0545V4OK4D.9H71HkV4lHXckF4Rd8SdNJCb3vfW bNR0X79rYwVFEPixuf_d3AB.V6ccsSFAOiZhWD0ISGRBoHW3hLdONGORXHyIsUF_XOjgFmCZl7w6 irnvWvxBbkkmep37bfjNULFwxB.MEWmH83_31PfsQ7VPb7jQerbXZFK8FzKflg9SVelpMGsXQuvu 7bCgsuT2E6ePiWZ7_jq7k6t069.zysd2YUpJkNmqdciA_epdPKgCxlfTbFt3LoN_iaA07k5InnJY 8wI_dnGs8E2ONt.umhQe5kOcNyHzq4asL7AtbD_LLVODIKv2no5.XcF5791T29QRaIg6jXdtOdIb GidDi2E7uENcl0XXyOw-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Sun, 26 Dec 2021 21:02:08 +0000 Received: by kubenode536.mail-prod1.omega.gq1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 82ed07590b77e0ee06c29858134227b9; Sun, 26 Dec 2021 21:00:39 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Hot-plugging microSD on Raspberry Pi under FreeBSD In-Reply-To: <20211226192338.GA16188@www.zefox.net> Date: Sun, 26 Dec 2021 13:00:38 -0800 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <91D4CF6B-5690-413D-A873-2DB50CAF9637@yahoo.com> References: <20211226192338.GA16188@www.zefox.net> To: bob prohaska X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4JMY9Y0Hjcz4XPl X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Reply-To: marklmi@yahoo.com From: Mark Millard via freebsd-arm X-Original-From: Mark Millard X-ThisMailContainsUnwantedMimeParts: N On 2021-Dec-26, at 11:23, bob prohaska wrote: > Are there any special protocols to observe when hot-plugging > microSD cards on Raspberry Pi when FreeBSD is up and running? > Electrically it's claimed to be ok in this thread by one "jdb": > https://forums.raspberrypi.com/viewtopic.php?t=3D281249 > so I'm asking about how the FreeBSD software might react.=20 >=20 > Obviously filesystems have to be gracefully unmounted, but is > that all? Can the kernel be "aware" of an unused device and > get confused if it goes away? As I remember, for FreeBSD, A) The built-in microsd card slot works fine for swapping media that are not mounted at the time. but, for example (no mounts involved, RPi4B 8GiByte test context), B.0) Plug-in the USB reader, no media present. (USB3 example here.) B.1) Insert a 128 GiByte media to the reader. B.2) Remove that media. B.3) Insert a 32 GiByte media to the reader (same slot in the reader). Result: (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af ff 00 00 01 00=20 (da4:umass-sim1:1:0:3): CAM status: SCSI Status Error (da4:umass-sim1:1:0:3): SCSI status: Check Condition (da4:umass-sim1:1:0:3): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical = block address out of range) (da4:umass-sim1:1:0:3): Error 22, Unretryable error (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af ff 00 00 01 00=20 (da4:umass-sim1:1:0:3): CAM status: SCSI Status Error (da4:umass-sim1:1:0:3): SCSI status: Check Condition (da4:umass-sim1:1:0:3): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical = block address out of range) (da4:umass-sim1:1:0:3): Error 22, Unretryable error (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af c1 00 00 04 00=20 (da4:umass-sim1:1:0:3): CAM status: SCSI Status Error (da4:umass-sim1:1:0:3): SCSI status: Check Condition (da4:umass-sim1:1:0:3): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical = block address out of range) (da4:umass-sim1:1:0:3): Error 22, Unretryable error (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af fe 00 00 01 00=20 (da4:umass-sim1:1:0:3): CAM status: SCSI Status Error (da4:umass-sim1:1:0:3): SCSI status: Check Condition (da4:umass-sim1:1:0:3): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical = block address out of range) (da4:umass-sim1:1:0:3): Error 22, Unretryable error (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af ff 00 00 01 00=20 (da4:umass-sim1:1:0:3): CAM status: SCSI Status Error (da4:umass-sim1:1:0:3): SCSI status: Check Condition (da4:umass-sim1:1:0:3): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical = block address out of range) (da4:umass-sim1:1:0:3): Error 22, Unretryable error (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af fe 00 00 01 00=20 (da4:umass-sim1:1:0:3): CAM status: SCSI Status Error (da4:umass-sim1:1:0:3): SCSI status: Check Condition (da4:umass-sim1:1:0:3): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical = block address out of range) (da4:umass-sim1:1:0:3): Error 22, Unretryable error (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af ff 00 00 01 00=20 (da4:umass-sim1:1:0:3): CAM status: SCSI Status Error (da4:umass-sim1:1:0:3): SCSI status: Check Condition (da4:umass-sim1:1:0:3): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical = block address out of range) (da4:umass-sim1:1:0:3): Error 22, Unretryable error (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af ff 00 00 01 00=20 (da4:umass-sim1:1:0:3): CAM status: SCSI Status Error (da4:umass-sim1:1:0:3): SCSI status: Check Condition (da4:umass-sim1:1:0:3): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical = block address out of range) (da4:umass-sim1:1:0:3): Error 22, Unretryable error GEOM_PART: da4 was automatically resized. Use `gpart commit da4` to save changes or `gpart undo da4` to revert = them. GEOM_PART: da4 was automatically resized. Use `gpart commit da4` to save changes or `gpart undo da4` to revert = them. GEOM_PART: da4 was automatically resized. Use `gpart commit da4` to save changes or `gpart undo da4` to revert = them. GEOM_PART: da4 was automatically resized. Use `gpart commit da4` to save changes or `gpart undo da4` to revert = them. GEOM_PART: da4 was automatically resized. Use `gpart commit da4` to save changes or `gpart undo da4` to revert = them. If you do the 32 GiByte first instead, then for the 128 GiByte you get notices from GEOM_PART about "was automatically resized" but it does not "address out of range". I expect that swapping two media of the same capacity would be less likely to generate any messages, but that does not mean that such a swap would be handled fully correctly. So I unplug the whole reader to swap media. This is messier if multiple slots are in use (more unmounts and later remounts). I expect that this is a FreeBSD issue, not a RPi4B issue. But I've not tested such under Fedora or the like or (recently) on a Rock64 or other such. =3D=3D=3D Mark Millard marklmi at yahoo.com