From nobody Mon Dec 27 00:40:23 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 98D4B190C89E for ; Mon, 27 Dec 2021 00:40:36 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-55.consmr.mail.gq1.yahoo.com (sonic316-55.consmr.mail.gq1.yahoo.com [98.137.69.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 4JMf382WBYz53KT for ; Mon, 27 Dec 2021 00:40:36 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1640565629; bh=p/aixQiPZmidCpIUtTZ4EqwH8FqoUkIJjDH3ZwnAI8E=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=Qt3FSpcdSd8g/DzLNAHexYTCbrlK8Abc8xPUfJmLc78kkkJ/Cmz6mlkahe1EFiFGbZZyJPHQgnHdDVp1w+iX94MMjZ1rrE6gnQZvZdWGZ3E9f/xEPoZrxS3phTM0hronNjEjjBDwb3BhdNDc98l5jT2xpXq7NH4GwojSf1Z5JiKCHsvLFVdHIFnrM/uVwntUUXB9AbSlmq7WZYo/15bqiRlH/GFVrjWRvGrfQl8R1hs5QBYYZ3jf5Qw5aBf7XLjCPFgRLV+8BBCb489kwdh8QhjTAms087gb20wiKJliElgW9HiPGq5UA7AqUs6TVECSvljDz8qFDfMW2jCSi/FZ4w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1640565629; bh=uKEthgV0WvTjxeFnAABz+rG02x2GjJlWoVcaEvZb0tx=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=r2+P/5ox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_CmSoZy 75Ox2Raajv6GAuiZ1K5E0DhtlHEWPUQ.yybOraq79fVaKHba1fQqhfn7ywnbmN5oPYpteYdHzoWG bv.twxG9GYGj4HCDHaWvzkK38pwjxWduw__K8aUHTy5pSAI4BiZs8aEarzlCBnVClR4mnD7uAKuy QtqcZwaVuLCIgUAC07Pq1ynF2ZswgeTVcnTYsrl0pAe.T6mic_Hw.NFXqe7CZtPPgOB_ZAEu5Gny IvW_9qrzCJP80bdefimHEcmBWXcZSeFGcAfKUYEi3e51WkjCDJM5tZiPn2NrrA7wGPSrdce7x.k_ dWVSv.yHYdeGrbVSemllo2njeukw8wcWAWftdeFc2xvojKaRT8hkEihJVL3xhjTLs9AN_8ohbTVM UK1XQmybXWWGNAPvgQvGrWPeKkb0A0IYtbpuGcn0kyrSGc7w7zsSag_OiUIXiOXb.7VQdB13Xtdr f.A4P1ouk638UfARBzv.HC3dipmdY23f50WOfhoA- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Mon, 27 Dec 2021 00:40:29 +0000 Received: by kubenode531.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 0b36ccde2af49b07ddd6506515ca7e25; Mon, 27 Dec 2021 00:40:25 +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: <20211226224709.GB16188@www.zefox.net> Date: Sun, 26 Dec 2021 16:40:23 -0800 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <1D17056C-AA76-4CF8-8A2C-C2908242AAFE@yahoo.com> References: <20211226192338.GA16188@www.zefox.net> <91D4CF6B-5690-413D-A873-2DB50CAF9637@yahoo.com> <20211226224709.GB16188@www.zefox.net> To: bob prohaska X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4JMf382WBYz53KT 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 14:47, bob prohaska wrote: > On Sun, Dec 26, 2021 at 01:00:38PM -0800, Mark Millard via freebsd-arm = wrote: >> On 2021-Dec-26, at 11:23, bob prohaska wrote: >>=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? >>=20 >> As I remember, for FreeBSD, >>=20 >> A) The built-in microsd card slot works fine for swapping >> media that are not mounted at the time. >=20 > Ok, that's reassuring. I observed corruption of microSD card FAT=20 > partitionss and wondered if hot-plugging might be the cause. I could do a similar check of this context later. >>=20 >> but, for example (no mounts involved, RPi4B 8GiByte test context), >>=20 >> 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). >>=20 >> Result: >>=20 >> (da4:umass-sim1:1:0:3): READ(10). CDB: 28 00 0e e2 af ff 00 00 01 00=20= >=20 > [...disk errors snipped....] >=20 > Was the Pi4 running from a USB hard disk? USB3 SSD. I do not have the marginal/insufficient power issues that you have. > I ask because plugging in a USB reader to my RasPiOS Pi4 while booted=20= > from a USB hard disk seems to disrupt communication with the boot = drive.=20 You have described having a marginal/insufficient power context in other messages. > It doesn't crash immediately but can't be gracefully rebooted. >=20 >> 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". >=20 > That seems like the "confusion" I was wondering about. The kernel > notices the first card insertion, fails to notice the removal and > then mis-attributes the change to a partition resize. I disconnect the reader, swap media, and reconnect. That handles things fine. >> 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. >>=20 >> So I unplug the whole reader to swap media. This is messier >> if multiple slots are in use (more unmounts and later >> remounts). >=20 > That chain of events crashes my RasPiOS Pi4, at least when it's also > booted from a USB drive.=20 >=20 You have described having a marginal/insufficient power context in other messages. =3D=3D=3D Mark Millard marklmi at yahoo.com