{"action":"created","issue":{"url":"https://api.github.com/repos/raspberrypi/linux/issues/1076","labels_url":"https://api.github.com/repos/raspberrypi/linux/issues/1076/labels{/name}","comments_url":"https://api.github.com/repos/raspberrypi/linux/issues/1076/comments","events_url":"https://api.github.com/repos/raspberrypi/linux/issues/1076/events","html_url":"https://github.com/raspberrypi/linux/issues/1076","id":95869938,"number":1076,"title":"could you add \"MMC_CAP_ERASE\" to the bcm2835-sdhost driver mmc->caps initialization?","user":{"login":"rasmorthil","id":11828689,"avatar_url":"https://avatars.githubusercontent.com/u/11828689?v=3","gravatar_id":"","url":"https://api.github.com/users/rasmorthil","html_url":"https://github.com/rasmorthil","followers_url":"https://api.github.com/users/rasmorthil/followers","following_url":"https://api.github.com/users/rasmorthil/following{/other_user}","gists_url":"https://api.github.com/users/rasmorthil/gists{/gist_id}","starred_url":"https://api.github.com/users/rasmorthil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasmorthil/subscriptions","organizations_url":"https://api.github.com/users/rasmorthil/orgs","repos_url":"https://api.github.com/users/rasmorthil/repos","events_url":"https://api.github.com/users/rasmorthil/events{/privacy}","received_events_url":"https://api.github.com/users/rasmorthil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-19T00:01:15Z","updated_at":"2015-07-21T10:30:04Z","closed_at":null,"body":"I've been using the new \"sdhost\" driver, and it's overclocking abilities are amazing.  E.g., I can now run my card at 40MB/s read speeds (as compared to 18MB/s under the \"mmc\" driver).\r\n\r\nHowever the current implementation of this new driver in the \"rpi-4.0.y\" tree is missing the \"MMC_CAP_ERASE\" capability for the host controller configuration, and as such this prevents \"fstrim\" from working (\"fstrim\" gives an \"FITRIM ioctl failed: Operation not supported\" error).  Adding the MMC_CAP_ERASE capability fixes this issue, and the \"sdhost\" driver will then support the TRIM feature like the current \"bcm2835-mmc\" driver does.\r\n\r\nI've enabled this capability in my own kernel build, but it'd be great to get this in upstream so that I don't need to keep building my own kernel just for this simple change...\r\n\r\nThe patch to bcm2835-sdhost.c is really simple:\r\n\r\n    diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c\r\n    index d65870a..57a6ad3 100644\r\n    --- a/drivers/mmc/host/bcm2835-sdhost.c\r\n    +++ b/drivers/mmc/host/bcm2835-sdhost.c\r\n    @@ -1675,7 +1675,7 @@ int bcm2835_sdhost_add_host(struct bcm2835_host *host)\r\n            /* host controller capabilities */\r\n            mmc->caps |= /* MMC_CAP_SDIO_IRQ |*/ MMC_CAP_4_BIT_DATA |\r\n                    MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED |\r\n    -               MMC_CAP_NEEDS_POLL | MMC_CAP_HW_RESET |\r\n    +               MMC_CAP_NEEDS_POLL | MMC_CAP_HW_RESET | MMC_CAP_ERASE |\r\n                    (ALLOW_CMD23 * MMC_CAP_CMD23);\r\n    \r\n            spin_lock_init(&host->lock);\r\n\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/raspberrypi/linux/issues/comments/123257311","html_url":"https://github.com/raspberrypi/linux/issues/1076#issuecomment-123257311","issue_url":"https://api.github.com/repos/raspberrypi/linux/issues/1076","id":123257311,"user":{"login":"pelwell","id":8911409,"avatar_url":"https://avatars.githubusercontent.com/u/8911409?v=3","gravatar_id":"","url":"https://api.github.com/users/pelwell","html_url":"https://github.com/pelwell","followers_url":"https://api.github.com/users/pelwell/followers","following_url":"https://api.github.com/users/pelwell/following{/other_user}","gists_url":"https://api.github.com/users/pelwell/gists{/gist_id}","starred_url":"https://api.github.com/users/pelwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pelwell/subscriptions","organizations_url":"https://api.github.com/users/pelwell/orgs","repos_url":"https://api.github.com/users/pelwell/repos","events_url":"https://api.github.com/users/pelwell/events{/privacy}","received_events_url":"https://api.github.com/users/pelwell/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T10:30:04Z","updated_at":"2015-07-21T10:30:04Z","body":"I've added the ERASE capability to the sdhost driver - it will be in the next release."}}