From patchwork Tue Sep 3 11:04:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 2853183 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 09390C0AB5 for ; Tue, 3 Sep 2013 11:05:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD342203DF for ; Tue, 3 Sep 2013 11:05:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91177203B6 for ; Tue, 3 Sep 2013 11:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759923Ab3ICLE4 (ORCPT ); Tue, 3 Sep 2013 07:04:56 -0400 Received: from smtp6-v.fe.bosch.de ([139.15.237.11]:57804 "EHLO smtp6-v.fe.bosch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755920Ab3ICLE4 (ORCPT ); Tue, 3 Sep 2013 07:04:56 -0400 Received: from vsmta14.fe.internet.bosch.com (unknown [10.4.98.54]) by imta24.fe.bosch.de (Postfix) with ESMTP id 401A1D80079; Tue, 3 Sep 2013 13:04:54 +0200 (CEST) Received: from localhost (vsgw4.fe.internet.bosch.com [10.4.98.12]) by vsmta14.fe.internet.bosch.com (Postfix) with SMTP id 1CBDCA402C5; Tue, 3 Sep 2013 13:04:54 +0200 (CEST) Received: from SI-HUB1001.de.bosch.com (10.4.103.108) by si-hub02.de.bosch.com (10.3.144.67) with Microsoft SMTP Server (TLS) id 8.3.327.1; Tue, 3 Sep 2013 13:04:45 +0200 Received: from [10.34.211.22] (10.34.211.22) by SI-HUB1001.de.bosch.com (10.4.103.108) with Microsoft SMTP Server id 14.3.158.1; Tue, 3 Sep 2013 13:04:44 +0200 Message-ID: <5225C24B.9020705@de.bosch.com> Date: Tue, 3 Sep 2013 13:04:43 +0200 From: Dirk Behme Organization: Robert Bosch Car Multimedia GmbH User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Chris Ball , "linux-mmc@vger.kernel.org" Subject: MMC_SWITCH command doesn't update the ext_csd data structure X-Originating-IP: [10.34.211.22] Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, using the MMC_SWITCH command via the ioctl to write registers of the EXT_CSD, it looks to us that in this case the internal ext_csd data structure isn't updated. Resulting in a mismatch of what the ext_csd data structure contains and what's written to the real hardware. We are using the mmc utils [1] to e.g. enable the bootpart mmc bootpart enable 1 0 /dev/mmcblk1 This correctly writes to the EXT_CSD structure of the device, but doesn't update card->ext_csd.part_config Issuing additional MMC_SWITCH commands afterwards use the then (wrong) card->ext_csd.part_config. Resulting in a undo of the mmc bootpart enable. What we think might be necessary here is anything like Best regards Dirk [1] https://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git/ --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -542,11 +544,17 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev, __func__, status, err); } + if ((cmd.opcode == MMC_SWITCH) && ((cmd.arg >> 24) & 0x3)) { + /* In case the IOCTL has modified the EXT_CSD, update it, i.e. re-read the EXT_CSD */ + mmc_update_ext_csd(card->ext_csd); + } + cmd_rel_host: mmc_release_host(card->host); ? Opinions?