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.MFC after: 3 daysReviewed by: impDifferential Revision: https://reviews.freebsd.org/D43538
show more ...
CAM: Replace random sbuf_printf() with cheaper cat/putc.
cam: Remove left-over sys/cdefs.h in sys/camThese weren't removed when $FreeBSD$ was removed. They aren't needed andnow are a style(9) nonconformity.Sponsored by: Netflix
cam: Minor opt_cam.h cleanupsys/cam/cam.h includes opt_cam.h, so none of the clients need to dothis. cam.h does all the right dancing to conditionally includeopt_cam.h only when it makes sense. I
cam: Minor opt_cam.h cleanupsys/cam/cam.h includes opt_cam.h, so none of the clients need to dothis. cam.h does all the right dancing to conditionally includeopt_cam.h only when it makes sense. It generally only matters whencam_debug.h is included (it must be included before that). Many of thestray opt_cam.h includes were after cam_debug.h which would be a problemwere it not included in cam/cam.h. The other users of CAM options thataren't debug all already include cam/cam.h.Also trim unneeded sys/cdefs.h files from the files touched.Sponsored by: Netflix
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
1234