mmccam: fix mmcsd disk aliasesFor EXT_CSD_PART_CONFIG_ACC_BOOT<n> and possibly others with suffixeswe fail to create proper disk aliases (symlinks), which shows up asg_dev_taste: make_dev_alias_p
mmccam: fix mmcsd disk aliasesFor EXT_CSD_PART_CONFIG_ACC_BOOT<n> and possibly others with suffixeswe fail to create proper disk aliases (symlinks), which shows up asg_dev_taste: make_dev_alias_p() failed (name=mmcsd0, error=17)In this case we ended up with the followng two: /dev/mmcsd0 -> sdda0 /dev/mmcsd1 -> sdda0boot1Note that (i) it should be mmcsd0boot1 and not mmcsd1 and that(ii) there is no mmcsd0boot0 (failed above as it tried to create asecond mmcsd0).Adjust the code (using a highly simplified version--compared to myoriginal approach--suggested by imp) using an extended format stringwith (sdda/mmcsd) prefix as first argument to create proper names.Reviewed by: impDifferential Revision: https://reviews.freebsd.org/D43538(cherry picked from commit a84d91d81a6f3eeb4949c4fb3440e0634f2b953a)
show more ...
sys: Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
sys: Remove $FreeBSD$: one-line .c patternRemove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
sys: Remove $FreeBSD$: one-line .h patternRemove /^\s*\*+\s*\$FreeBSD\$.*$\n/
sys: Remove $FreeBSD$: two-line .h patternRemove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
mmc_xpt: Update function name in debug traceReported by: mavFixes: 7eb538974c49 cam mmc_xpt/nvme_xpt: Add _sbuf variants of {an,de}nounce xport and proto ops
cam: Remove non-sbuf announce/denounce proto and xport opsReviewed by: mav, impSponsored by: Chelsio CommunicationsDifferential Revision: https://reviews.freebsd.org/D41264
cam mmc_xpt/nvme_xpt: Add _sbuf variants of {an,de}nounce xport and proto opsReviewed by: impSponsored by: Chelsio CommunicationsDifferential Revision: https://reviews.freebsd.org/D41261
mmc_xpt: Remove dubious end of mmc_print_identThe end of this function finishes the passed in sbuf, calls printfmanually on the contents, and then clears it. The caller then triesto print the re
mmc_xpt: Remove dubious end of mmc_print_identThe end of this function finishes the passed in sbuf, calls printfmanually on the contents, and then clears it. The caller then triesto print the resulting sbuf. This works currently but will not workfor future callers that pass in an external sbuf to be appended to.Reviewed by: mavSponsored by: Chelsio CommunicationsDifferential Revision: https://reviews.freebsd.org/D41260
cam/mmc: Migrate to modern uintXX_t from u_intXX_tAs per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.htmlmove to the modern uintXX_t.MFC After: 3 daysSponsored by: Netflix
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDThe SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catchup to that fact and revert to their recommended match of BSD-2-Clause.Discussed with: pfgMFC After: 3 daysSponsored by: Netflix
kerneldump: remove physical argument from d_dumperThe physical address argument is essentially ignored by every dumpermethod. In addition, the dump routines don't actually pass a realaddress; eve
kerneldump: remove physical argument from d_dumperThe physical address argument is essentially ignored by every dumpermethod. In addition, the dump routines don't actually pass a realaddress; every call to dump_append() passes a value of zero forphysical.Reviewed by: markjMFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D35173
mmc_da: create disk(9) for pre-2.0 SD cardsIt does not look like there is anything in mmc_da code that actuallyrequires protocol 2.0 or later. dev/mmc code also does not have such arestriction.
mmc_da: create disk(9) for pre-2.0 SD cardsIt does not look like there is anything in mmc_da code that actuallyrequires protocol 2.0 or later. dev/mmc code also does not have such arestriction.Tested with a very old 2GB mini-SD card. Prior to this change mmc_dawould claim the card but would not expose it to GEOM.Without MMCCAM: mmc0: <MMC/SD bus> on sdhci_pci0 mmc0: Probing bus mmc0: SD probe: OK (OCR: 0x00ff8000) mmc0: Current OCR: 0x00ff8000 mmc0: CMD8 failed, RESULT: 1 mmc0: Probing cards mmc0: New card detected (CID 1c53565344432020100002982e007600) mmc0: New card detected (CSD 005e00325f5a83d02db7ffbf96800000) mmc0: Card at relative address 0xb368 added: mmc0: card: SD SDC 1.0 SN 0002982E MFG 06/2007 by 28 SV mmc0: quirks: 0 mmc0: bus: 4bit, 50MHz (high speed timing) mmc0: memory: 3998720 blocks, erase sector 256 blocks mmc0: setting transfer rate to 50.000MHz (high speed timing) GEOM: new disk mmcsd0 mmcsd0: 2GB <SD SDC 1.0 SN 0002982E MFG 06/2007 by 28 SV> at mmc0 50.0MHz/4bit/65535-block mmc0: setting bus width to 4 bits high speed timingWith MMCCAM and this change: sdda0 at sdhci_slot0 bus 0 scbus2 target 0 lun 0 sdda0: Relative addr: 0000b368 Card features: <Memory> sdda0: Serial Number 0002982E sdda0: SD SDC 1.0 SN 0002982E MFG 06/2007 by 28 SV GEOM: new disk sdda0Reviewed by: manuMFC after: 3 weeks
mmc_da: remove write-only local variablesMFC after: 1 week
mmc_da: use MMC_SECTOR_SIZE constant in place of literalsSuggested by: manuMFC after: 2 weeks
mmc_da: implement d_dump method, sddadumpsddadump has been derived from sddastart.mmc_sim interface has grown a new method, cam_poll, to support polledoperation.mmc_sim code has been changed t
mmc_da: implement d_dump method, sddadumpsddadump has been derived from sddastart.mmc_sim interface has grown a new method, cam_poll, to support polledoperation.mmc_sim code has been changed to provide a sim_poll hook only if thecontroller implements the new method. The hooks is implemented in termsof the new mmc_sim_cam_poll method.Additionally, in-progress CCB-s now have CAM_REQ_INPROG status tosatisfy xpt_pollwait().mmc_sim_cam_poll method has been implemented in dwmmc host controller.Reviewed by: manu, mav, impMFC after: 2 weeksRelnotes: perhapsDifferential Revision: https://reviews.freebsd.org/D33843
follow up to 18679ab1, actually change size of mmc_sim::name to 16The change was made locally but was not squashed into the commit.Fixes: 18679ab1 mmc_sim: fix setting of the mutex nameMFC afte
follow up to 18679ab1, actually change size of mmc_sim::name to 16The change was made locally but was not squashed into the commit.Fixes: 18679ab1 mmc_sim: fix setting of the mutex nameMFC after: 8 days
mmc_sim: fix setting of the mutex nameTo quote the manual: The pointer passed in as name and type is saved rather than the data it points to. The data pointed to must remain stable until the mut
mmc_sim: fix setting of the mutex nameTo quote the manual: The pointer passed in as name and type is saved rather than the data it points to. The data pointed to must remain stable until the mutex is destroyed.It seems that the type is actually copied, but the name is stored asa pointer indeed.mmc_cam_sim_alloc used a name stored on stack.So, a corrupt mutex name would be reported.For example: lock order reversal: (sleepable after non-sleepable) 1st 0xd7285b20 <8A><C0><C0>P@<C1><D0>P@<C1>^D^A (aw_mmc_sim, sleep mutex) @ sys/cam/cam_xpt.c:2804This change moves the name to struct mmc_sim.Also, that name is used as the sim name as well.Unused mtx_name variable is removed too.The name buffer is reduced to 16 characters.Reviewed by: manu, bzMFC after: 10 daysDifferential Revision: https://reviews.freebsd.org/D33412
Revert "mmc_sim: fix setting of the mutex name"This reverts commit df472af034e7726dea533ac7f44440dad4ba6a34.The change hasn't been reviewed.
mmc_sim: fix setting of the mutex nameTo quote the manual: The pointer passed in as name and type is saved rather than the data it points to. The data pointed to must remain stable until the mutex is destroyed.It seems that the type is actually copied, but the name is stored asa pointer indeed.mmc_cam_sim_alloc used a name stored on stack.So, a corrupt mutex name would be reported.For example: lock order reversal: (sleepable after non-sleepable) 1st 0xd7285b20 <8A><C0><C0>P@<C1><D0>P@<C1>^D^A (aw_mmc_sim, sleep mutex) @ /usr/devel/git/orange/sys/cam/cam_xpt.c:2804This change moves the name to struct mmc_sim.Also, that name is used as the sim name as well.Unused mtx_name variable is removed too.
sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes MFC after: 2 weeks
Assert that invalid bus widths can't be passed to bus_width_str().This appeases a -Wreturn-type warning from GCC.Reviewed by: impDifferential Revision: https://reviews.freebsd.org/D31935
mmc_cam_sim_default_action: do not touch the ccb after dispatching itIf MMC_SIM_CAM_REQUEST() is successful the ccb could be running or beingcompleted as the method returns. Modifying the ccb sta
mmc_cam_sim_default_action: do not touch the ccb after dispatching itIf MMC_SIM_CAM_REQUEST() is successful the ccb could be running or beingcompleted as the method returns. Modifying the ccb status could overridewhatever status was already set by a MMC driver.I am not sure what was the purpose of setting the status to CAM_REQ_INVALIDin the success path. I assume that it was to catch a possibility that theccb could be completed without its status explicitly set. So, I am keepingthe code, it's just moved to before the MMC_SIM_CAM_REQUEST call.Without this change I was getting random and phantom EIO errors on Rock64running off an SD card (dwmmc driver) plus occasional panics like: Memory modified after free 0xffffa00003985800(2040) val=6 @ 0xffffa00003985854 panic: Most recently used by CAM CCBMFC after: 1 week
cam: drop unused 'saved_ccb' field from softcsNo functional changes. Do not MFC this, it changes kernel ABI.Sponsored by: NetApp, Inc.Sponsored by: Klara, Inc.Differential Revision: https://re
cam: drop unused 'saved_ccb' field from softcsNo functional changes. Do not MFC this, it changes kernel ABI.Sponsored by: NetApp, Inc.Sponsored by: Klara, Inc.Differential Revision: https://reviews.freebsd.org/D30698
cam: Fix GENERIC-MMCCAM buildFix forgotten argument and type error. MMCCAM isn't enabled by default,and I'd mistakenly thought it was, so these went undetected precommit.Sponsored by: Netflix
1234