All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: fix size in mtd_info_user to support 64-bit
@ 2021-07-08 13:13 ` Miaohe Lin
  0 siblings, 0 replies; 14+ messages in thread
From: Miaohe Lin @ 2021-07-08 13:13 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr
  Cc: David.Woodhouse, Artem.Bityutskiy, ext-adrian.hunter,
	linux-kernel, linux-mtd, linmiaohe, linfeilong

From: Feilong Lin <linfeilong@huawei.com>

The size in struct mtd_info_user is 32-bit, which will cause errors
when obtaining the size of large-capacity MTD devices, such as TLC
NAND FLASH-2048Gb.

Fixes: 69423d99fc18 ("[MTD] update internal API to support 64-bit device size")
Signed-off-by: Feilong Lin <linfeilong@huawei.com>
---
 include/uapi/mtd/mtd-abi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
index b869990c2db2..efe0b53b10c1 100644
--- a/include/uapi/mtd/mtd-abi.h
+++ b/include/uapi/mtd/mtd-abi.h
@@ -128,7 +128,7 @@ struct mtd_write_req {
 struct mtd_info_user {
 	__u8 type;
 	__u32 flags;
-	__u32 size;	/* Total size of the MTD */
+	__u64 size;	/* Total size of the MTD */
 	__u32 erasesize;
 	__u32 writesize;
 	__u32 oobsize;	/* Amount of OOB data per block (e.g. 16) */
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH] mtd: fix size in mtd_info_user to support 64-bit
@ 2021-07-08 13:13 ` Miaohe Lin
  0 siblings, 0 replies; 14+ messages in thread
From: Miaohe Lin @ 2021-07-08 13:13 UTC (permalink / raw)
  To: miquel.raynal, richard, vigneshr
  Cc: David.Woodhouse, Artem.Bityutskiy, ext-adrian.hunter,
	linux-kernel, linux-mtd, linmiaohe, linfeilong

From: Feilong Lin <linfeilong@huawei.com>

The size in struct mtd_info_user is 32-bit, which will cause errors
when obtaining the size of large-capacity MTD devices, such as TLC
NAND FLASH-2048Gb.

Fixes: 69423d99fc18 ("[MTD] update internal API to support 64-bit device size")
Signed-off-by: Feilong Lin <linfeilong@huawei.com>
---
 include/uapi/mtd/mtd-abi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
index b869990c2db2..efe0b53b10c1 100644
--- a/include/uapi/mtd/mtd-abi.h
+++ b/include/uapi/mtd/mtd-abi.h
@@ -128,7 +128,7 @@ struct mtd_write_req {
 struct mtd_info_user {
 	__u8 type;
 	__u32 flags;
-	__u32 size;	/* Total size of the MTD */
+	__u64 size;	/* Total size of the MTD */
 	__u32 erasesize;
 	__u32 writesize;
 	__u32 oobsize;	/* Amount of OOB data per block (e.g. 16) */
-- 
2.23.0


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
  2021-07-08 13:13 ` Miaohe Lin
@ 2021-07-15 23:02   ` Miquel Raynal
  -1 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2021-07-15 23:02 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

Hi Miaohe,

Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
+0800:

> From: Feilong Lin <linfeilong@huawei.com>
> 
> The size in struct mtd_info_user is 32-bit, which will cause errors
> when obtaining the size of large-capacity MTD devices, such as TLC
> NAND FLASH-2048Gb.

Besides the fact that such devices are far from being supported by the
Linux kernel, this change would basically break userspace, it cannot
enter as-is...

> Fixes: 69423d99fc18 ("[MTD] update internal API to support 64-bit device size")
> Signed-off-by: Feilong Lin <linfeilong@huawei.com>
> ---
>  include/uapi/mtd/mtd-abi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
> index b869990c2db2..efe0b53b10c1 100644
> --- a/include/uapi/mtd/mtd-abi.h
> +++ b/include/uapi/mtd/mtd-abi.h
> @@ -128,7 +128,7 @@ struct mtd_write_req {
>  struct mtd_info_user {
>  	__u8 type;
>  	__u32 flags;
> -	__u32 size;	/* Total size of the MTD */
> +	__u64 size;	/* Total size of the MTD */
>  	__u32 erasesize;
>  	__u32 writesize;
>  	__u32 oobsize;	/* Amount of OOB data per block (e.g. 16) */

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
@ 2021-07-15 23:02   ` Miquel Raynal
  0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2021-07-15 23:02 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

Hi Miaohe,

Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
+0800:

> From: Feilong Lin <linfeilong@huawei.com>
> 
> The size in struct mtd_info_user is 32-bit, which will cause errors
> when obtaining the size of large-capacity MTD devices, such as TLC
> NAND FLASH-2048Gb.

Besides the fact that such devices are far from being supported by the
Linux kernel, this change would basically break userspace, it cannot
enter as-is...

> Fixes: 69423d99fc18 ("[MTD] update internal API to support 64-bit device size")
> Signed-off-by: Feilong Lin <linfeilong@huawei.com>
> ---
>  include/uapi/mtd/mtd-abi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
> index b869990c2db2..efe0b53b10c1 100644
> --- a/include/uapi/mtd/mtd-abi.h
> +++ b/include/uapi/mtd/mtd-abi.h
> @@ -128,7 +128,7 @@ struct mtd_write_req {
>  struct mtd_info_user {
>  	__u8 type;
>  	__u32 flags;
> -	__u32 size;	/* Total size of the MTD */
> +	__u64 size;	/* Total size of the MTD */
>  	__u32 erasesize;
>  	__u32 writesize;
>  	__u32 oobsize;	/* Amount of OOB data per block (e.g. 16) */

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
  2021-07-15 23:02   ` Miquel Raynal
@ 2021-07-16  1:42     ` Miaohe Lin
  -1 siblings, 0 replies; 14+ messages in thread
From: Miaohe Lin @ 2021-07-16  1:42 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

On 2021/7/16 7:02, Miquel Raynal wrote:
> Hi Miaohe,
> 
> Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
> +0800:
> 
>> From: Feilong Lin <linfeilong@huawei.com>
>>
>> The size in struct mtd_info_user is 32-bit, which will cause errors
>> when obtaining the size of large-capacity MTD devices, such as TLC
>> NAND FLASH-2048Gb.
> 
> Besides the fact that such devices are far from being supported by the
> Linux kernel, this change would basically break userspace, it cannot
> enter as-is...
> 

I see. Many thanks for your reply! We're working with these large-capacity
MTD devices now, any suggestion to work around this?

Thanks again!

>> Fixes: 69423d99fc18 ("[MTD] update internal API to support 64-bit device size")
>> Signed-off-by: Feilong Lin <linfeilong@huawei.com>
>> ---
>>  include/uapi/mtd/mtd-abi.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
>> index b869990c2db2..efe0b53b10c1 100644
>> --- a/include/uapi/mtd/mtd-abi.h
>> +++ b/include/uapi/mtd/mtd-abi.h
>> @@ -128,7 +128,7 @@ struct mtd_write_req {
>>  struct mtd_info_user {
>>  	__u8 type;
>>  	__u32 flags;
>> -	__u32 size;	/* Total size of the MTD */
>> +	__u64 size;	/* Total size of the MTD */
>>  	__u32 erasesize;
>>  	__u32 writesize;
>>  	__u32 oobsize;	/* Amount of OOB data per block (e.g. 16) */
> 
> Thanks,
> Miquèl
> .
> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
@ 2021-07-16  1:42     ` Miaohe Lin
  0 siblings, 0 replies; 14+ messages in thread
From: Miaohe Lin @ 2021-07-16  1:42 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

On 2021/7/16 7:02, Miquel Raynal wrote:
> Hi Miaohe,
> 
> Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
> +0800:
> 
>> From: Feilong Lin <linfeilong@huawei.com>
>>
>> The size in struct mtd_info_user is 32-bit, which will cause errors
>> when obtaining the size of large-capacity MTD devices, such as TLC
>> NAND FLASH-2048Gb.
> 
> Besides the fact that such devices are far from being supported by the
> Linux kernel, this change would basically break userspace, it cannot
> enter as-is...
> 

I see. Many thanks for your reply! We're working with these large-capacity
MTD devices now, any suggestion to work around this?

Thanks again!

>> Fixes: 69423d99fc18 ("[MTD] update internal API to support 64-bit device size")
>> Signed-off-by: Feilong Lin <linfeilong@huawei.com>
>> ---
>>  include/uapi/mtd/mtd-abi.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
>> index b869990c2db2..efe0b53b10c1 100644
>> --- a/include/uapi/mtd/mtd-abi.h
>> +++ b/include/uapi/mtd/mtd-abi.h
>> @@ -128,7 +128,7 @@ struct mtd_write_req {
>>  struct mtd_info_user {
>>  	__u8 type;
>>  	__u32 flags;
>> -	__u32 size;	/* Total size of the MTD */
>> +	__u64 size;	/* Total size of the MTD */
>>  	__u32 erasesize;
>>  	__u32 writesize;
>>  	__u32 oobsize;	/* Amount of OOB data per block (e.g. 16) */
> 
> Thanks,
> Miquèl
> .
> 


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
  2021-07-16  1:42     ` Miaohe Lin
@ 2021-07-16  9:48       ` Miquel Raynal
  -1 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2021-07-16  9:48 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

Hi Miaohe,

Miaohe Lin <linmiaohe@huawei.com> wrote on Fri, 16 Jul 2021 09:42:19
+0800:

> On 2021/7/16 7:02, Miquel Raynal wrote:
> > Hi Miaohe,
> > 
> > Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
> > +0800:
> >   
> >> From: Feilong Lin <linfeilong@huawei.com>
> >>
> >> The size in struct mtd_info_user is 32-bit, which will cause errors
> >> when obtaining the size of large-capacity MTD devices, such as TLC
> >> NAND FLASH-2048Gb.  
> > 
> > Besides the fact that such devices are far from being supported by the
> > Linux kernel, this change would basically break userspace, it cannot
> > enter as-is...
> >   
> 
> I see. Many thanks for your reply! We're working with these large-capacity
> MTD devices now, any suggestion to work around this?

The only way is to create a second UAPI.

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
@ 2021-07-16  9:48       ` Miquel Raynal
  0 siblings, 0 replies; 14+ messages in thread
From: Miquel Raynal @ 2021-07-16  9:48 UTC (permalink / raw)
  To: Miaohe Lin
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

Hi Miaohe,

Miaohe Lin <linmiaohe@huawei.com> wrote on Fri, 16 Jul 2021 09:42:19
+0800:

> On 2021/7/16 7:02, Miquel Raynal wrote:
> > Hi Miaohe,
> > 
> > Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
> > +0800:
> >   
> >> From: Feilong Lin <linfeilong@huawei.com>
> >>
> >> The size in struct mtd_info_user is 32-bit, which will cause errors
> >> when obtaining the size of large-capacity MTD devices, such as TLC
> >> NAND FLASH-2048Gb.  
> > 
> > Besides the fact that such devices are far from being supported by the
> > Linux kernel, this change would basically break userspace, it cannot
> > enter as-is...
> >   
> 
> I see. Many thanks for your reply! We're working with these large-capacity
> MTD devices now, any suggestion to work around this?

The only way is to create a second UAPI.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
  2021-07-16  9:48       ` Miquel Raynal
@ 2021-07-16 13:34         ` Rob Landley
  -1 siblings, 0 replies; 14+ messages in thread
From: Rob Landley @ 2021-07-16 13:34 UTC (permalink / raw)
  To: Miquel Raynal, Miaohe Lin
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

On 7/16/21 4:48 AM, Miquel Raynal wrote:
> Hi Miaohe,
> 
> Miaohe Lin <linmiaohe@huawei.com> wrote on Fri, 16 Jul 2021 09:42:19
> +0800:
> 
>> On 2021/7/16 7:02, Miquel Raynal wrote:
>> > Hi Miaohe,
>> > 
>> > Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
>> > +0800:
>> >   
>> >> From: Feilong Lin <linfeilong@huawei.com>
>> >>
>> >> The size in struct mtd_info_user is 32-bit, which will cause errors
>> >> when obtaining the size of large-capacity MTD devices, such as TLC
>> >> NAND FLASH-2048Gb.  
>> > 
>> > Besides the fact that such devices are far from being supported by the
>> > Linux kernel, this change would basically break userspace, it cannot
>> > enter as-is...
>> >   
>> 
>> I see. Many thanks for your reply! We're working with these large-capacity
>> MTD devices now, any suggestion to work around this?
> 
> The only way is to create a second UAPI.

Twelve years ago a patch was submitted to add a 64 bit MTD api:

  https://lwn.net/Articles/326418/

But for some reason they only merged 64 bit erase:

  https://github.com/torvalds/linux/commit/0dc54e9f33e2

But NOT the rest of the 64 bit mtd API in the same patch. I've never understood why.

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
@ 2021-07-16 13:34         ` Rob Landley
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Landley @ 2021-07-16 13:34 UTC (permalink / raw)
  To: Miquel Raynal, Miaohe Lin
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

On 7/16/21 4:48 AM, Miquel Raynal wrote:
> Hi Miaohe,
> 
> Miaohe Lin <linmiaohe@huawei.com> wrote on Fri, 16 Jul 2021 09:42:19
> +0800:
> 
>> On 2021/7/16 7:02, Miquel Raynal wrote:
>> > Hi Miaohe,
>> > 
>> > Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
>> > +0800:
>> >   
>> >> From: Feilong Lin <linfeilong@huawei.com>
>> >>
>> >> The size in struct mtd_info_user is 32-bit, which will cause errors
>> >> when obtaining the size of large-capacity MTD devices, such as TLC
>> >> NAND FLASH-2048Gb.  
>> > 
>> > Besides the fact that such devices are far from being supported by the
>> > Linux kernel, this change would basically break userspace, it cannot
>> > enter as-is...
>> >   
>> 
>> I see. Many thanks for your reply! We're working with these large-capacity
>> MTD devices now, any suggestion to work around this?
> 
> The only way is to create a second UAPI.

Twelve years ago a patch was submitted to add a 64 bit MTD api:

  https://lwn.net/Articles/326418/

But for some reason they only merged 64 bit erase:

  https://github.com/torvalds/linux/commit/0dc54e9f33e2

But NOT the rest of the 64 bit mtd API in the same patch. I've never understood why.

Rob

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
  2021-07-16 13:34         ` Rob Landley
@ 2021-07-17  1:55           ` Miaohe Lin
  -1 siblings, 0 replies; 14+ messages in thread
From: Miaohe Lin @ 2021-07-17  1:55 UTC (permalink / raw)
  To: Rob Landley, Miquel Raynal
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

On 2021/7/16 21:34, Rob Landley wrote:
> On 7/16/21 4:48 AM, Miquel Raynal wrote:
>> Hi Miaohe,
>>
>> Miaohe Lin <linmiaohe@huawei.com> wrote on Fri, 16 Jul 2021 09:42:19
>> +0800:
>>
>>> On 2021/7/16 7:02, Miquel Raynal wrote:
>>>> Hi Miaohe,
>>>>
>>>> Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
>>>> +0800:
>>>>   
>>>>> From: Feilong Lin <linfeilong@huawei.com>
>>>>>
>>>>> The size in struct mtd_info_user is 32-bit, which will cause errors
>>>>> when obtaining the size of large-capacity MTD devices, such as TLC
>>>>> NAND FLASH-2048Gb.  
>>>>
>>>> Besides the fact that such devices are far from being supported by the
>>>> Linux kernel, this change would basically break userspace, it cannot
>>>> enter as-is...
>>>>   
>>>
>>> I see. Many thanks for your reply! We're working with these large-capacity
>>> MTD devices now, any suggestion to work around this?
>>
>> The only way is to create a second UAPI.
> 
> Twelve years ago a patch was submitted to add a 64 bit MTD api:
> 
>   https://lwn.net/Articles/326418/
> 
> But for some reason they only merged 64 bit erase:
> 
>   https://github.com/torvalds/linux/commit/0dc54e9f33e2
> 
> But NOT the rest of the 64 bit mtd API in the same patch. I've never understood why.
> 
> Rob
> .
> 

Many thanks for both of you! This really helps! :)

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
@ 2021-07-17  1:55           ` Miaohe Lin
  0 siblings, 0 replies; 14+ messages in thread
From: Miaohe Lin @ 2021-07-17  1:55 UTC (permalink / raw)
  To: Rob Landley, Miquel Raynal
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

On 2021/7/16 21:34, Rob Landley wrote:
> On 7/16/21 4:48 AM, Miquel Raynal wrote:
>> Hi Miaohe,
>>
>> Miaohe Lin <linmiaohe@huawei.com> wrote on Fri, 16 Jul 2021 09:42:19
>> +0800:
>>
>>> On 2021/7/16 7:02, Miquel Raynal wrote:
>>>> Hi Miaohe,
>>>>
>>>> Miaohe Lin <linmiaohe@huawei.com> wrote on Thu, 8 Jul 2021 21:13:59
>>>> +0800:
>>>>   
>>>>> From: Feilong Lin <linfeilong@huawei.com>
>>>>>
>>>>> The size in struct mtd_info_user is 32-bit, which will cause errors
>>>>> when obtaining the size of large-capacity MTD devices, such as TLC
>>>>> NAND FLASH-2048Gb.  
>>>>
>>>> Besides the fact that such devices are far from being supported by the
>>>> Linux kernel, this change would basically break userspace, it cannot
>>>> enter as-is...
>>>>   
>>>
>>> I see. Many thanks for your reply! We're working with these large-capacity
>>> MTD devices now, any suggestion to work around this?
>>
>> The only way is to create a second UAPI.
> 
> Twelve years ago a patch was submitted to add a 64 bit MTD api:
> 
>   https://lwn.net/Articles/326418/
> 
> But for some reason they only merged 64 bit erase:
> 
>   https://github.com/torvalds/linux/commit/0dc54e9f33e2
> 
> But NOT the rest of the 64 bit mtd API in the same patch. I've never understood why.
> 
> Rob
> .
> 

Many thanks for both of you! This really helps! :)

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
  2021-07-16 13:34         ` Rob Landley
@ 2021-07-22  8:47           ` Rob Landley
  -1 siblings, 0 replies; 14+ messages in thread
From: Rob Landley @ 2021-07-22  8:47 UTC (permalink / raw)
  To: Miquel Raynal, Miaohe Lin
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

On 7/16/21 8:34 AM, Rob Landley wrote:
>> The only way is to create a second UAPI.
> 
> Twelve years ago a patch was submitted to add a 64 bit MTD api:
> 
>   https://lwn.net/Articles/326418/
> 
> But for some reason they only merged 64 bit erase:
> 
>   https://github.com/torvalds/linux/commit/0dc54e9f33e2
> 
> But NOT the rest of the 64 bit mtd API in the same patch. I've never understood why.

That said, the workaround is to use the info api for erase size and use
lseek(SEEK_END) on the device to get the length.

Rob

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] mtd: fix size in mtd_info_user to support 64-bit
@ 2021-07-22  8:47           ` Rob Landley
  0 siblings, 0 replies; 14+ messages in thread
From: Rob Landley @ 2021-07-22  8:47 UTC (permalink / raw)
  To: Miquel Raynal, Miaohe Lin
  Cc: richard, vigneshr, David.Woodhouse, Artem.Bityutskiy,
	ext-adrian.hunter, linux-kernel, linux-mtd, linfeilong

On 7/16/21 8:34 AM, Rob Landley wrote:
>> The only way is to create a second UAPI.
> 
> Twelve years ago a patch was submitted to add a 64 bit MTD api:
> 
>   https://lwn.net/Articles/326418/
> 
> But for some reason they only merged 64 bit erase:
> 
>   https://github.com/torvalds/linux/commit/0dc54e9f33e2
> 
> But NOT the rest of the 64 bit mtd API in the same patch. I've never understood why.

That said, the workaround is to use the info api for erase size and use
lseek(SEEK_END) on the device to get the length.

Rob

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-07-22  8:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08 13:13 [PATCH] mtd: fix size in mtd_info_user to support 64-bit Miaohe Lin
2021-07-08 13:13 ` Miaohe Lin
2021-07-15 23:02 ` Miquel Raynal
2021-07-15 23:02   ` Miquel Raynal
2021-07-16  1:42   ` Miaohe Lin
2021-07-16  1:42     ` Miaohe Lin
2021-07-16  9:48     ` Miquel Raynal
2021-07-16  9:48       ` Miquel Raynal
2021-07-16 13:34       ` Rob Landley
2021-07-16 13:34         ` Rob Landley
2021-07-17  1:55         ` Miaohe Lin
2021-07-17  1:55           ` Miaohe Lin
2021-07-22  8:47         ` Rob Landley
2021-07-22  8:47           ` Rob Landley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.