public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Prabu Thangamuthu <Prabu.T@synopsys.com>
Cc: Chris Ball <cjb@laptop.org>, Seungwon Jeon <tgih.jun@samsung.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Wei WANG <wei_wang@realsil.com.cn>,
	Ludovic Desroches <ludovic.desroches@atmel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Manjunath M Bettegowda <Manjunath.MB@synopsys.com>
Subject: Re: [PATCH v3 1/1] mmc: dw_mmc: Add IDMAC 64-bit address mode support
Date: Mon, 19 Aug 2013 20:39:00 +0200	[thread overview]
Message-ID: <201308192039.01098.arnd@arndb.de> (raw)
In-Reply-To: <705D14B1C7978B40A723277C067CEDE2CD7D78@IN01WEMBXB.internal.synopsys.com>

On Monday 19 August 2013, Prabu Thangamuthu wrote:
> 
> +#ifdef CONFIG_MMC_DW_IDMAC_64BIT_ADDRESS
> +       u32     des1;   /* Reserved */
> +
> +       u32     des2;   /* Buffer sizes */
> +#define IDMAC_SET_BUFFER1_SIZE(d, s) \
> +       ((d)->des2 = ((d)->des2 & 0x03ffe000) | ((s) & 0x1fff))
> +
> +       u32     des3;   /* Reserved */
> +
> +       u32     des4;   /* Lower 32-bits of Buffer Address Pointer 1*/
> +       u32     des5;   /* Upper 32-bits of Buffer Address Pointer 1*/
> +       u32     des6;   /* Lower 32-bits of Next Descriptor Address */
> +       u32     des7;   /* Upper 32-bits of Next Descriptor Address */
> +#else
>         u32             des1;   /* Buffer sizes */
>  #define IDMAC_SET_BUFFER1_SIZE(d, s) \
>         ((d)->des1 = ((d)->des1 & 0x03ffe000) | ((s) & 0x1fff))
> @@ -73,6 +86,7 @@ struct idmac_desc {
>         u32             des2;   /* buffer 1 physical address */
>  
>         u32             des3;   /* buffer 2 physical address */
> +#endif /* CONFIG_MMC_DW_IDMAC_64BIT_ADDRESS */

This is not a good idea: It means you cannot build the driver to support
both 32 and 64 bit at run-time. You have to remove all the #ifdef here
and replace it with runtime checks. You also need to update the binding
document to provide a way to detect which one is present in a given
system.

	Arnd

  reply	other threads:[~2013-08-19 18:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19 10:27 [PATCH v3 1/1] mmc: dw_mmc: Add IDMAC 64-bit address mode support Prabu Thangamuthu
2013-08-19 18:39 ` Arnd Bergmann [this message]
2013-08-20  7:55   ` Seungwon Jeon
2013-08-20  9:38     ` Prabu Thangamuthu
2013-08-20  9:56       ` Seungwon Jeon
2013-08-20 10:24         ` Prabu Thangamuthu
2013-08-21  9:33         ` Prabu Thangamuthu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201308192039.01098.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=Manjunath.MB@synopsys.com \
    --cc=Prabu.T@synopsys.com \
    --cc=cjb@laptop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jh80.chung@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    --cc=tgih.jun@samsung.com \
    --cc=wei_wang@realsil.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox