From patchwork Wed Mar 29 20:17:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9652479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA4DF60113 for ; Wed, 29 Mar 2017 20:17:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9701328354 for ; Wed, 29 Mar 2017 20:17:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 884592845B; Wed, 29 Mar 2017 20:17:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C356728354 for ; Wed, 29 Mar 2017 20:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932783AbdC2URg (ORCPT ); Wed, 29 Mar 2017 16:17:36 -0400 Received: from mail-pg0-f44.google.com ([74.125.83.44]:33116 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932763AbdC2URf (ORCPT ); Wed, 29 Mar 2017 16:17:35 -0400 Received: by mail-pg0-f44.google.com with SMTP id x125so17424023pgb.0 for ; Wed, 29 Mar 2017 13:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version; bh=8ZgRn4xmlNNlkaV4Esz2wS1ofOBBZT6QLeAeS5J9vGg=; b=WGc8oHEB7gqtYHfwQBVy5dnK9Uiq2wEDTqpVS+3QT+nMxl/nBcMDy8F4oTuStdmuzg N50wA8sGxYXYUXBogEFyHfNk7SUpa/ee2XXtHmUHgiO6Hjn+hXEzR0kCRuCkoUhQRaGm Jpd8bVAiYUUPNEKov0uZEcF1H2fx9tBHJE9T3RG0/ZO7/CmJp9ax5Mnz6kh5gj0wRXuO Bar65YOxmcoESHuEu2Wb66YLy3hfRwQXADugBJ0NRGzd/u9HBLpjYYvKIWydAnYbJGFS 0sPHk7fLL7I26OCrouvMcowbnm0gYECNh1lu+KevP0Ii2eQierxWPMw/F/r8e+4OLo0+ a0Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version; bh=8ZgRn4xmlNNlkaV4Esz2wS1ofOBBZT6QLeAeS5J9vGg=; b=WGpnsbyoGQXn3PMGmkdhSn4MjjZWkqMA1prQfCbMWptbFWL9lmscujrvWN1O/aAEWZ 2i8w6qJ5D/HqPf67cY3PF9naU9prhScjTK1wyBxRcIQhfBtygRrvBH56YPnVMt0j29fY Hh3bgSVFtqLqc2TqgJwqFQnrlIhcPJxnbSGve6fQiT2R5Q7Yyp6x0ocysNatVRBPWUic TdC5VQ/+O3HNqJu3ip5ipt7Sf7LVAQYIM49sHW6ujt0Sg0/iBqsFofCe70XwUr6S5fSb FNzOYkDqDpoWsh+epOdDYZBaepk+sTiQpCdIGLApqLxk+Pw36t77pcXk+SZtK2TNZ80C piFA== X-Gm-Message-State: AFeK/H1OECHGCi/pvTRPWxLPhxpMifAJ0d/H7RgL5QCHlnJhIoXXQU28wiIgPzBQ051r+jAr X-Received: by 10.99.176.5 with SMTP id h5mr2357304pgf.179.1490818653551; Wed, 29 Mar 2017 13:17:33 -0700 (PDT) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id c75sm15153331pga.22.2017.03.29.13.17.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 13:17:33 -0700 (PDT) From: Kevin Hilman To: Heiner Kallweit Cc: Ulf Hansson , linux-amlogic@lists.infradead.org, Helmut Klein , "linux-mmc\@vger.kernel.org" Subject: Re: [PATCH] mmc: sdio: fix alignment issue in struct sdio_func Organization: BayLibre References: Date: Wed, 29 Mar 2017 13:17:32 -0700 In-Reply-To: (Heiner Kallweit's message of "Wed, 29 Mar 2017 20:54:37 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Heiner Kallweit writes: > Certain 64-bit systems (e.g. Amlogic Meson GX) require buffers to be > used for DMA to be 8-byte-aligned. struct sdio_func has an embedded > small DMA buffer not meeting this requirement. > When testing switching to descriptor chain mode in meson-gx driver > SDIO is broken therefore. Fix this by allocating the small DMA buffer > separately as kmalloc ensures that the returned memory area is > properly aligned for every basic data type. > > Signed-off-by: Heiner Kallweit > Tested-by: Helmut Klein This should work too, without the need to do a tiny kmalloc. Kevin --- 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 diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index aab032a6ae61..071addf23931 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h @@ -53,7 +53,7 @@ struct sdio_func { unsigned int state; /* function state */ #define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */ - u8 tmpbuf[4]; /* DMA:able scratch buffer */ + u8 tmpbuf[4] __aligned(8); /* DMA:able scratch buffer */ unsigned num_info; /* number of info strings */ const char **info; /* info strings */