From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f226.google.com (mail-vk1-f226.google.com [209.85.221.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44D551F3D56 for ; Tue, 11 Aug 2026 16:47:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.226 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786466840; cv=none; b=Ec9Fr6Omihh7EUUP4a3XVCLxVbcBFhVpllL0G5FQzX0drHcIUURH8GEwZm4rqacNEstMxSiwylS/x17SMMLcafhb3o6uog8FONaPSwjh/gCDmJAx4B5RjORJR8WS/gGb7jDZjPAz+pF1yeyuubjt/QKSKd1uTyeIFhFGcp4EosY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786466840; c=relaxed/simple; bh=XeM5byNfDLFL9tAqAidxi3XPnNmpaOXG/kBp3I75TDQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HSFvm88cePGx54O0TBBXC8SEFF2vFqwxk8L4gTQBkSdKDDavbIx7nrtVB9ITXEPEd/tEI5/7DmGzVPan85kmz4MDmOtH3XVmma1ujDAJ6uqRxTjgSwGqSfNelCLmGrPLwzZ3qDDT9pGcmrEOIWMqlyRInN7UI+Zxk4A/FNkX6Fw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=CZqxBKot; arc=none smtp.client-ip=209.85.221.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="CZqxBKot" Received: by mail-vk1-f226.google.com with SMTP id 71dfb90a1353d-5c30d9adfa7so1047622e0c.3 for ; Tue, 11 Aug 2026 09:47:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786466838; x=1787071638; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=5hVUqKAq7+CGR3gV29vn5IOnGPr6UMObs1caCTW5v8Q=; b=oJWUk/Y2Z4lv/9P3uZoVjEiG1PyuR5bjW8cDcpeIqJi1pgEzXz8EjkT7STnM45lqQf dbGn0gbPyB4EPWZFkbuMakhaYG9sKzYRidOxrhEzB+cp7ott8pShxI2F2d0kKTHdygwX d/mBjXNmH3s0+SCeunnGYvXpmfLZe/3Y/9XEgrRnNf1axAEPXTDxsf1o7vdUWOdNEt7A 4BHsIqt+GSuC11p/qxfV12RgL12kGun+wnQutOhXW31IJDVjuKVd+f4K85yu4BnPMRdk dt4ZDq2AEKyVAK+rF0cgS3gcNROqD2XCSwNslHweIJnSO0GkWyUMF9+ZEF7YBvaMyRWa JTeg== X-Forwarded-Encrypted: i=1; AHgh+Rq1Ntjol/1ZU2ZaUhpbKho6kfudalG5bRjByiV+yNldoOZuDuLem3ZgZBbk0AeUJhXOs2muv0iDGt//sz8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3daN3EER72A5mITFYjucmg5088uNqt4+xma2nQftFPhC6xQzc tt0fwwkpwPkdzcYrXAoTAYNo1GCR9qPIbveDqGiHYLJ0yrK9Imk5IgIASdeBl2vdQfBSahYZ3Wd i8zKBpRlKWqUY8rBmvIEQdmyB5d0FzSoWtfOtzFVmzNB8+3argksyw7TzLrFsOa8T/KNh/e2//s a7NS4mGPsOTPCl1OjJnNl4MhZOItMn2fkzTFhgkdBf6cInO+LSUEg+ayLFFLH2WxPvPmEMl+nQl BrmYpZ70EVWOID3B02CrVD9 X-Gm-Gg: AR+sD13FXGhmx/DRSpL63g6j6cdEDvrjWg2+asT5VzIYhDthFk8mr6SEH1llRUgz46z WNW9p3TchLmndwDUFRcs+PlTO8qKsL6sdl1WWYIsDFpuMY14bbsB6NbeuVw4Vg2SMA9aVsgEhcq iOJFWtxL7kL55rewJr1oqt5yXNrCOtMmI+fZMZo+arDWC8wChuZjyQgTY8tyleGwSCynD6aQtDL gNRHM86PxPZrrT8icNGJfufyWwmjqISSMNqjYwQFIXH3ZoBrlOO278CCzA6Nb+8PrCsxHw56H6h RK6t66vONXdUJT8sSEgD7UEP8WHQJzRYdauUi3AVq4lje2UAnp8JoxiTZH+CJBZ6+zGD8xmq/Da Wr8jOJhdMXO/7ILXkQfVjdeN6drOYD0z6c5MMHdu4r+F4anu/2fj9fPYnu8XERdHHGsVHHa9BW+ jv36roSG1qfLRpHg9dSqHOog7LV0GpUCrnw4spz/yLF4U= X-Received: by 2002:a05:6122:daa:b0:5c4:1f03:a1fe with SMTP id 71dfb90a1353d-5c4503582dbmr539398e0c.1.1786466837850; Tue, 11 Aug 2026 09:47:17 -0700 (PDT) Received: from smtp-us-east1-p01-i01-si01.dlp.protect.broadcom.com (address-144-49-247-120.dlp.protect.broadcom.com. [144.49.247.120]) by smtp-relay.gmail.com with ESMTPS id 71dfb90a1353d-5c45b3d9972sm58108e0c.2.2026.08.11.09.47.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2026 09:47:17 -0700 (PDT) X-Relaying-Domain: broadcom.com X-CFilter-Loop: Reflected Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-84e048a801dso88876b3a.3 for ; Tue, 11 Aug 2026 09:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1786466836; x=1787071636; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=5hVUqKAq7+CGR3gV29vn5IOnGPr6UMObs1caCTW5v8Q=; b=CZqxBKotf22iWM54qPyC2u0YLg+fGWxM43gCXSIm/jizAjpwvcWC7UvUFFAFq8/6kp +YjXGcw1Oh1AtHBkOogpeHw/QDB4tpEwQUh8nE+SueSCVTjl1HFmv3jS4NYLXRLBo9eu RBF7pEcG3z1KFsck1nIEOH84/gvyY8uZZCHaM= X-Forwarded-Encrypted: i=1; AHgh+Rp6Xp9lVV+SRPTiJJm33pwsuLySnM+/YyQ33Z+KQS+S5HCCfdfg4c8XIOSGblZn1KCbTYTkWJsAWdwgGPQ=@vger.kernel.org X-Received: by 2002:a05:6a20:2d13:b0:3c4:1916:9d46 with SMTP id adf61e73a8af0-3cc2bac42a9mr6230602637.27.1786466836492; Tue, 11 Aug 2026 09:47:16 -0700 (PDT) X-Received: by 2002:a05:6a20:2d13:b0:3c4:1916:9d46 with SMTP id adf61e73a8af0-3cc2bac42a9mr6230508637.27.1786466835825; Tue, 11 Aug 2026 09:47:15 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-31cf6d7a366sm1085740eec.27.2026.08.11.09.47.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2026 09:47:15 -0700 (PDT) Message-ID: Date: Tue, 11 Aug 2026 09:47:13 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 0/4] mmc: Add pstore backend for crash dump storage on eMMC To: Kamal Dasu , Ulf Hansson Cc: Adrian Hunter , Kees Cook , Tony Luck , "Guilherme G . Piccoli" , Arend van Spriel , William Zhang , bcm-kernel-feedback-list@broadcom.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260422205053.3392395-1-kamal.dasu@broadcom.com> Content-Language: en-US, fr-FR From: Florian Fainelli Autocrypt: addr=florian.fainelli@broadcom.com; keydata= xsBNBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5gBBn3AdtALFyQj9DQ KQuc39/i/Kt6XLZ/RsBc6qLs+p+JnEuPJngTSfWvzGjpx0nkwCMi4yBb+xk7Hki4kEslABEB AAHNMEZsb3JpYW4gRmFpbmVsbGkgPGZsb3JpYW4uZmFpbmVsbGlAYnJvYWRjb20uY29tPsLB IQQQAQgAywUCZWl41AUJI+Jo+hcKAAG/SMv+fS3xUQWa0NryPuoRGjsA3SAUAAAAAAAWAAFr ZXktdXNhZ2UtbWFza0BwZ3AuY29tjDAUgAAAAAAgAAdwcmVmZXJyZWQtZW1haWwtZW5jb2Rp bmdAcGdwLmNvbXBncG1pbWUICwkIBwMCAQoFF4AAAAAZGGxkYXA6Ly9rZXlzLmJyb2FkY29t Lm5ldAUbAwAAAAMWAgEFHgEAAAAEFQgJChYhBNXZKpfnkVze1+R8aIExtcQpvGagAAoJEIEx tcQpvGagWPEH/2l0DNr9QkTwJUxOoP9wgHfmVhqc0ZlDsBFv91I3BbhGKI5UATbipKNqG13Z TsBrJHcrnCqnTRS+8n9/myOF0ng2A4YT0EJnayzHugXm+hrkO5O9UEPJ8a+0553VqyoFhHqA zjxj8fUu1px5cbb4R9G4UAySqyeLLeqnYLCKb4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0GWpadrDJUvUu3LEsunDCxdWrmbmwGRKqZraV2oG7YEddmDqOe0Xm/NxeSobc MIlnaE6V0U8f5zNHB7Y46yJjjYT/Ds1TJo3pvwevDWPvv6rdBeV07D9s43frUS6xYd1uFxHC 7dZYWJjZmyUf5evr1W1gCgwLXG0PEi9n3qmz1lelQ8lSocmvxBKtMbX/OKhAfuP/iIwnTsww 95A2SaPiQZA51NywV8OFgsN0ITl2PlZ4Tp9hHERDe6nQCsNI/Us= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-DetectorID-Processed: b00c1d49-9d2e-4205-b15f-d015386d3d5e Hi Ulf, On 6/10/26 10:01, Kamal Dasu wrote: > > > On Wed, Jun 10, 2026 at 12:53 PM Kamal Dasu > wrote: > > > > On Wed, Apr 22, 2026 at 4:51 PM Kamal Dasu > wrote: > > This series adds mmcpstore, a pstore backend driver that enables > persistent storage of kernel crash logs on eMMC devices. When the > kernel panics, pstore captures the kmsg dump and writes it directly > to a dedicated MMC partition using polled I/O with interrupts > disabled. > > Changes since v4 (addresses Ulf Hansson's feedback on the v4 panic > host path, linux-mmc): > - mmc_panic_claim_host(): log claimed, runtime suspend, and >   ongoing_mrq before claim; always call panic_prepare() when >   implemented so the host can drain or gracefully terminate >   in-flight requests, then force-claim. Vendor controllers may >   supply their own panic_prepare for platform-specific cases (1/4). > - SDHCI: reference panic_prepare implementation; longer drain/reset >   timeouts; document panic helper return values in kernel-doc > (2/4). > - mmcpstore: single prepare/claim path; panic_complete() after >   panic_poll_completion() on panic writes (4/4). > > Changes since v3: > - Fixed kernel-doc warnings reported by kernel test robot: >   - Added missing @param descriptions for sdhci_panic_prepare(), >     sdhci_panic_poll_completion(), sdhci_panic_complete() (patch 2) >   - Added missing @sect_offset param doc for >     mmcpstore_do_request_internal() (patch 4) >   - Fixed kernel-doc function name mismatch: mmcpstore_read() -> >     mmcpstore_read_zone() (patch 4) >   - Added missing @disk param doc for mmcpstore_card_add() > (patch 4) > - Removed unused 'offset_bytes' variable in >   mmcpstore_register_for_card() (patch 4) > > Changes since v2 (RFC): > - Rebased onto v7.0-rc — no longer reverts any existing MMC core >   or SDHCI changes (v1/v2 accidentally reverted recent upstream >   commits due to being based on an older tree) > - Removed all erase/bitmap tracking logic — MMC/eMMC is managed >   flash and does not need erase-before-write; the pstore_zone >   framework handles zone management internally > - Uses standard MMC core request path (mmc_start_request) instead >   of hand-building mmc_request structs; panic-context I/O is >   handled through proper mmc_host_ops callbacks rather than ad-hoc >   code in the driver > - Added panic-context ops to mmc_host_ops and sdhci_ops for clean >   separation of panic and normal I/O paths > - Fixed deadlocks caused by spinlock contention during panic >   (lockless mmc_panic_claim_host using WRITE_ONCE) > - Fixed data corruption in pstore recovery (zlib_inflate failures) >   by letting the normal sdhci_request() path run instead of a >   custom panic request handler > - Added PM suspend/resume support with eMMC re-initialization > - Supports module loading or builtin loading of the driver > - Added MAINTAINERS entry > - Split into 4-patch series for reviewability > > The series is structured as follows: > > Patch 1 adds panic-context operations to struct mmc_host_ops and a > lockless mmc_panic_claim_host() for use during kernel panic when > other CPUs are stopped and may hold locks. Host drivers may replace > panic_prepare with vendor-specific code where needed. > > Patch 2 implements the SDHCI reference panic_prepare (graceful > termination of in-flight work, then polled completion paths); other > MMC host drivers use the same mmc_host_ops hooks with their own > panic_prepare where the hardware differs. > > Patch 3 adds mmc_blk_get_card_by_name() helper to look up an > mmc_card from a block device name, used by the mmcpstore module > path for card discovery. > > Patch 4 adds the mmcpstore driver itself, which registers with the > pstore_blk framework and handles panic writes, PM suspend/resume, > and dual-path registration (direct probe hook for builtin, > mmc_blk_get_card_by_name() for module). Also adds probe/remove > hooks in block.c and declarations in block.h for the builtin path. > > Tested on Broadcom STB platforms (ARM64) with SDHCI controllers, > verified panic dump recovery across multiple panic/reboot cycles > with kmsg, pmsg, and console pstore; also tested with concurrent > I/O stress before panic. > > Previous submissions and related work: >   RFC v1: https://lore.kernel.org/linux- > mmc/20221216212738.7928-1-kdasu.kdev@gmail.com/ lore.kernel.org/linux-mmc/20221216212738.7928-1- > kdasu.kdev@gmail.com/> >   RFC v2: https://lore.kernel.org/linux- > mmc/20221222185948.12717-1-kdasu.kdev@gmail.com/ lore.kernel.org/linux-mmc/20221222185948.12717-1- > kdasu.kdev@gmail.com/> >   v3: https://lore.kernel.org/linux- > mmc/20260319185705.1516950-1-kamal.dasu@broadcom.com/ lore.kernel.org/linux-mmc/20260319185705.1516950-1- > kamal.dasu@broadcom.com/> >   v4: linux-mmc (same thread as v3; superseded by this v5) >   Marvell MMC pstore attempt (2020): > https://lore.kernel.org/linux-mmc/20201207115753.21728-1- > bbudiredla@marvell.com/ mmc/20201207115753.21728-1-bbudiredla@marvell.com/> >   pstore/blk documentation: > https://www.kernel.org/doc/html/latest/admin-guide/pstore- > blk.html pstore-blk.html> > > Kamal Dasu (4): >   mmc: core: Add panic-context host operations for pstore backends >   mmc: sdhci: Implement panic-context write support >   mmc: block: Add helper to look up mmc_card by device name >   mmc: core: Add MMC pstore backend driver > >  MAINTAINERS                  |    6 + >  drivers/mmc/core/Kconfig     |   12 + >  drivers/mmc/core/Makefile    |    1 + >  drivers/mmc/core/block.c     |   56 ++ >  drivers/mmc/core/block.h     |   18 + >  drivers/mmc/core/core.c      |   54 ++ >  drivers/mmc/core/mmcpstore.c | 1511 ++++++++++++++++++++++++++ > ++++++++ >  drivers/mmc/host/sdhci.c     |  173 +++- >  drivers/mmc/host/sdhci.h     |    6 + >  include/linux/mmc/host.h     |   12 + >  10 files changed, 1845 insertions(+), 4 deletions(-) >  create mode 100644 drivers/mmc/core/mmcpstore.c > > -- > 2.34.1 > > > > > Ulf, > > I'm resending a gentle reminder regarding the v5 patch series for mmcpstore. > > This version addresses your previous feedback on the v4 panic host path > and includes several key stability improvements: > > - Implements a lockless mmc_panic_claim_host using WRITE_ONCE to avoid > deadlocks during panic. > - Adds panic_prepare to the host ops to ensure in-flight requests are > drained and runtime PM states are handled before panic writes. > - Uses standard MMC core request paths with polling-based completion for > robust I/O during a crash. > - Includes full PM suspend/resume support with eMMC re-initialization. > > The series has been tested thoroughly on Broadcom STB platforms (ARM64), > verifying reliable recovery of kmsg, pmsg, and console logs across > multiple panic cycles. > > Please let me know if you need any further information or if there are > additional changes required for acceptance. Is there anything we could do here to move this forward? We have large number of devices in the field that make use of that feature and we would really like for this to be included upstream and usable by others as well. Thanks! -- Florian