[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFqh9tUrNGRj3xnRGtT=YxX5XhhMcWPCTATdon_joVHqAw@mail.gmail.com>
Date: Thu, 3 Jul 2025 16:17:42 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Sarthak Garg <quic_sartgarg@...cinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>,
Konrad Dybcio <konrad.dybcio@....qualcomm.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>, linux-arm-msm@...r.kernel.org,
linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
quic_cang@...cinc.com, quic_nguyenb@...cinc.com, quic_rampraka@...cinc.com,
quic_pragalla@...cinc.com, quic_sayalil@...cinc.com,
quic_nitirawa@...cinc.com, quic_bhaskarv@...cinc.com, kernel@....qualcomm.com
Subject: Re: [PATCH V3] mmc: sdhci-msm: Ensure SD card power isn't ON when
card removed
On Tue, 1 Jul 2025 at 14:09, Konrad Dybcio
<konrad.dybcio@....qualcomm.com> wrote:
>
>
>
> On 01-Jul-25 12:27, Dmitry Baryshkov wrote:
> > On Tue, Jul 01, 2025 at 03:36:59PM +0530, Sarthak Garg wrote:
> >> Many mobile phones feature multi-card tray designs, where the same
> >> tray is used for both SD and SIM cards. If the SD card is placed
> >> at the outermost location in the tray, the SIM card may come in
> >> contact with SD card power-supply while removing the tray, possibly
> >> resulting in SIM damage.
> >>
> >> To prevent that, make sure the SD card is really inserted by reading
> >> the Card Detect pin state. If it's not, turn off the power in
> >> sdhci_msm_check_power_status() and also set the BUS_FAIL power state
> >> on the controller as part of pwr_irq handling for BUS_ON request.
> >>
> >> Signed-off-by: Sarthak Garg <quic_sartgarg@...cinc.com>
> >> Acked-by: Adrian Hunter <adrian.hunter@...el.com>
> >
> > Should this be handled by the MMC core instead?
Ideally, yes, but honestly I am not sure how.
The current support by the core, detects that cards are being removed
and then it schedules the actual removal/power-off to be managed from
a punted work. This seems too slow for this kind of use-case.
If the core would try to inform the host at an earlier stage, as soon
as the mmc core detects that the card is being removed, would that be
soon enough?
>
> If possible, yes, but if it only works because our hw-specific
> sdhci_msm_check_power_status() behaves a certain way, it's good
> to go as is. I have no clue if that's the case.
>
> Konrad
I agree, sdhci_msm_check_power_status() is certainly HW specific.
That said, I decided to apply this as is, for next, thanks!
Kind regards
Uffe
Powered by blists - more mailing lists