Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Am 08.08.2014 20:11, schrieb Ezequiel Garcia: On 08 Aug 10:16 AM, Brian Norris wrote: On Fri, Aug 08, 2014 at 02:04:28PM -0300, Ezequiel Garcia wrote: If there's anything left to fix for this driver, please let me know. pxa3xx_nand is still missing a parent for its MTD's (mtd->dev.parent). I have a follow-up patch queued up locally that I need to send out sometime. Maybe we can trade... you provide the reason for such parent, and I'll cook a patch in exchange :) Just read the subject.and the introductory mail to the simple 20+ pathches I wasted my time with. Regards, Alexander Holler -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
On 08 Aug 10:16 AM, Brian Norris wrote: > On Fri, Aug 08, 2014 at 02:04:28PM -0300, Ezequiel Garcia wrote: > > If there's anything left to fix for this driver, please let me know. > > pxa3xx_nand is still missing a parent for its MTD's (mtd->dev.parent). I > have a follow-up patch queued up locally that I need to send out > sometime. > Maybe we can trade... you provide the reason for such parent, and I'll cook a patch in exchange :) -- Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
On Fri, Aug 08, 2014 at 02:04:28PM -0300, Ezequiel Garcia wrote: > Picking on this old thread... > > On 27 May 07:12 AM, Alexander Shiyan wrote: > > > diff --git a/drivers/mtd/nand/pxa3xx_nand.c > > > b/drivers/mtd/nand/pxa3xx_nand.c > > > index 7588fe2..7f62e7c 100644 > > > --- a/drivers/mtd/nand/pxa3xx_nand.c > > > +++ b/drivers/mtd/nand/pxa3xx_nand.c > > > @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct > > > platform_device *pdev) > > > host->mtd = mtd; > > > host->cs = cs; > > > host->info_data = info; > > > - mtd->priv = host; > > > - mtd->owner = THIS_MODULE; > > > + mtd_setup_common_members(mtd, host, pdev); > > > > > > chip->ecc.read_page = pxa3xx_nand_read_page_hwecc; > > > chip->ecc.write_page= pxa3xx_nand_write_page_hwecc; > > > -- > > > > Should we add "driver.owner = THIS_MODULE" field for struct platform_driver > > in this case? > > > > As far as I can see, for platform drivers, the owner of the driver is fixed to > THIS_MODULE in __platform_driver_register(). Looks like it. So any driver using module_platform_driver() or platform_driver_register() and also initializes platform_driver.driver.owner is just being redundant. Maybe another "cleanup" project for Jingoo Han? ;) > If there's anything left to fix for this driver, please let me know. pxa3xx_nand is still missing a parent for its MTD's (mtd->dev.parent). I have a follow-up patch queued up locally that I need to send out sometime. Brian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Picking on this old thread... On 27 May 07:12 AM, Alexander Shiyan wrote: > > diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c > > index 7588fe2..7f62e7c 100644 > > --- a/drivers/mtd/nand/pxa3xx_nand.c > > +++ b/drivers/mtd/nand/pxa3xx_nand.c > > @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device > > *pdev) > > host->mtd = mtd; > > host->cs = cs; > > host->info_data = info; > > - mtd->priv = host; > > - mtd->owner = THIS_MODULE; > > + mtd_setup_common_members(mtd, host, pdev); > > > > chip->ecc.read_page = pxa3xx_nand_read_page_hwecc; > > chip->ecc.write_page= pxa3xx_nand_write_page_hwecc; > > -- > > Should we add "driver.owner = THIS_MODULE" field for struct platform_driver > in this case? > As far as I can see, for platform drivers, the owner of the driver is fixed to THIS_MODULE in __platform_driver_register(). If there's anything left to fix for this driver, please let me know. Thanks, -- Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Picking on this old thread... On 27 May 07:12 AM, Alexander Shiyan wrote: diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 7588fe2..7f62e7c 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device *pdev) host-mtd = mtd; host-cs = cs; host-info_data = info; - mtd-priv = host; - mtd-owner = THIS_MODULE; + mtd_setup_common_members(mtd, host, pdev); chip-ecc.read_page = pxa3xx_nand_read_page_hwecc; chip-ecc.write_page= pxa3xx_nand_write_page_hwecc; -- Should we add driver.owner = THIS_MODULE field for struct platform_driver in this case? As far as I can see, for platform drivers, the owner of the driver is fixed to THIS_MODULE in __platform_driver_register(). If there's anything left to fix for this driver, please let me know. Thanks, -- Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
On Fri, Aug 08, 2014 at 02:04:28PM -0300, Ezequiel Garcia wrote: Picking on this old thread... On 27 May 07:12 AM, Alexander Shiyan wrote: diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 7588fe2..7f62e7c 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device *pdev) host-mtd = mtd; host-cs = cs; host-info_data = info; - mtd-priv = host; - mtd-owner = THIS_MODULE; + mtd_setup_common_members(mtd, host, pdev); chip-ecc.read_page = pxa3xx_nand_read_page_hwecc; chip-ecc.write_page= pxa3xx_nand_write_page_hwecc; -- Should we add driver.owner = THIS_MODULE field for struct platform_driver in this case? As far as I can see, for platform drivers, the owner of the driver is fixed to THIS_MODULE in __platform_driver_register(). Looks like it. So any driver using module_platform_driver() or platform_driver_register() and also initializes platform_driver.driver.owner is just being redundant. Maybe another cleanup project for Jingoo Han? ;) If there's anything left to fix for this driver, please let me know. pxa3xx_nand is still missing a parent for its MTD's (mtd-dev.parent). I have a follow-up patch queued up locally that I need to send out sometime. Brian -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
On 08 Aug 10:16 AM, Brian Norris wrote: On Fri, Aug 08, 2014 at 02:04:28PM -0300, Ezequiel Garcia wrote: If there's anything left to fix for this driver, please let me know. pxa3xx_nand is still missing a parent for its MTD's (mtd-dev.parent). I have a follow-up patch queued up locally that I need to send out sometime. Maybe we can trade... you provide the reason for such parent, and I'll cook a patch in exchange :) -- Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Am 08.08.2014 20:11, schrieb Ezequiel Garcia: On 08 Aug 10:16 AM, Brian Norris wrote: On Fri, Aug 08, 2014 at 02:04:28PM -0300, Ezequiel Garcia wrote: If there's anything left to fix for this driver, please let me know. pxa3xx_nand is still missing a parent for its MTD's (mtd-dev.parent). I have a follow-up patch queued up locally that I need to send out sometime. Maybe we can trade... you provide the reason for such parent, and I'll cook a patch in exchange :) Just read the subject.and the introductory mail to the simple 20+ pathches I wasted my time with. Regards, Alexander Holler -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
On Tue, May 27, 2014 at 08:01:55AM +0200, Alexander Holler wrote: > Am 27.05.2014 05:12, schrieb Alexander Shiyan: > >Should we add "driver.owner = THIS_MODULE" field for struct platform_driver > >in this case? > > Yes. I assumed all drivers/modules already had an owner. I will > check them all and will send a v2 for those which don't have one. I > wonder what this field is used for if it works without. ;) Looks like the mtd->owner essentially filters down to a try_module_get() (called in the get_mtd_device() API) which ensures that MTD users (e.g., mtdblock, UBI, etc.) hold a refcount on the driver module. If the owner is not set properly by a driver, then try_module_get() just does a silent no-op, so the user is none the wiser... until they try to rmmod their MTD driver while it's being used by UBI/UBIFS! Regards, Brian -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
On Tue, May 27, 2014 at 08:01:55AM +0200, Alexander Holler wrote: Am 27.05.2014 05:12, schrieb Alexander Shiyan: Should we add driver.owner = THIS_MODULE field for struct platform_driver in this case? Yes. I assumed all drivers/modules already had an owner. I will check them all and will send a v2 for those which don't have one. I wonder what this field is used for if it works without. ;) Looks like the mtd-owner essentially filters down to a try_module_get() (called in the get_mtd_device() API) which ensures that MTD users (e.g., mtdblock, UBI, etc.) hold a refcount on the driver module. If the owner is not set properly by a driver, then try_module_get() just does a silent no-op, so the user is none the wiser... until they try to rmmod their MTD driver while it's being used by UBI/UBIFS! Regards, Brian -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Am 27.05.2014 05:12, schrieb Alexander Shiyan: Tue, 27 May 2014 00:12:34 +0200 от Alexander Holler : Fix a common error in nand-drivers which do not set up a parent devicefor the mtd-device by using a new inline function. Signed-off-by: Alexander Holler --- drivers/mtd/nand/pxa3xx_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 7588fe2..7f62e7c 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device *pdev) host->mtd = mtd; host->cs = cs; host->info_data = info; - mtd->priv = host; - mtd->owner = THIS_MODULE; + mtd_setup_common_members(mtd, host, pdev); chip->ecc.read_page = pxa3xx_nand_read_page_hwecc; chip->ecc.write_page = pxa3xx_nand_write_page_hwecc; -- Should we add "driver.owner = THIS_MODULE" field for struct platform_driver in this case? Yes. I assumed all drivers/modules already had an owner. I will check them all and will send a v2 for those which don't have one. I wonder what this field is used for if it works without. ;) Regards, Alexander Holler -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Am 27.05.2014 05:12, schrieb Alexander Shiyan: Tue, 27 May 2014 00:12:34 +0200 от Alexander Holler hol...@ahsoftware.de: Fix a common error in nand-drivers which do not set up a parent devicefor the mtd-device by using a new inline function. Signed-off-by: Alexander Holler hol...@ahsoftware.de --- drivers/mtd/nand/pxa3xx_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 7588fe2..7f62e7c 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device *pdev) host-mtd = mtd; host-cs = cs; host-info_data = info; - mtd-priv = host; - mtd-owner = THIS_MODULE; + mtd_setup_common_members(mtd, host, pdev); chip-ecc.read_page = pxa3xx_nand_read_page_hwecc; chip-ecc.write_page = pxa3xx_nand_write_page_hwecc; -- Should we add driver.owner = THIS_MODULE field for struct platform_driver in this case? Yes. I assumed all drivers/modules already had an owner. I will check them all and will send a v2 for those which don't have one. I wonder what this field is used for if it works without. ;) Regards, Alexander Holler -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Tue, 27 May 2014 00:12:34 +0200 от Alexander Holler : > Fix a common error in nand-drivers which do not set up a parent device for > the mtd-device by using a new inline function. > > Signed-off-by: Alexander Holler > --- > drivers/mtd/nand/pxa3xx_nand.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c > index 7588fe2..7f62e7c 100644 > --- a/drivers/mtd/nand/pxa3xx_nand.c > +++ b/drivers/mtd/nand/pxa3xx_nand.c > @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device > *pdev) > host->mtd = mtd; > host->cs = cs; > host->info_data = info; > - mtd->priv = host; > - mtd->owner = THIS_MODULE; > + mtd_setup_common_members(mtd, host, pdev); > > chip->ecc.read_page = pxa3xx_nand_read_page_hwecc; > chip->ecc.write_page= pxa3xx_nand_write_page_hwecc; > -- Should we add "driver.owner = THIS_MODULE" field for struct platform_driver in this case? ---
[PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Fix a common error in nand-drivers which do not set up a parent device for the mtd-device by using a new inline function. Signed-off-by: Alexander Holler --- drivers/mtd/nand/pxa3xx_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 7588fe2..7f62e7c 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device *pdev) host->mtd = mtd; host->cs = cs; host->info_data = info; - mtd->priv = host; - mtd->owner = THIS_MODULE; + mtd_setup_common_members(mtd, host, pdev); chip->ecc.read_page = pxa3xx_nand_read_page_hwecc; chip->ecc.write_page= pxa3xx_nand_write_page_hwecc; -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Fix a common error in nand-drivers which do not set up a parent device for the mtd-device by using a new inline function. Signed-off-by: Alexander Holler hol...@ahsoftware.de --- drivers/mtd/nand/pxa3xx_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 7588fe2..7f62e7c 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device *pdev) host-mtd = mtd; host-cs = cs; host-info_data = info; - mtd-priv = host; - mtd-owner = THIS_MODULE; + mtd_setup_common_members(mtd, host, pdev); chip-ecc.read_page = pxa3xx_nand_read_page_hwecc; chip-ecc.write_page= pxa3xx_nand_write_page_hwecc; -- 1.8.3.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/27] mtd: nand: pxa3xx: show device structure in sysfs
Tue, 27 May 2014 00:12:34 +0200 от Alexander Holler hol...@ahsoftware.de: Fix a common error in nand-drivers which do not set up a parent device for the mtd-device by using a new inline function. Signed-off-by: Alexander Holler hol...@ahsoftware.de --- drivers/mtd/nand/pxa3xx_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index 7588fe2..7f62e7c 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1584,8 +1584,7 @@ static int alloc_nand_resource(struct platform_device *pdev) host-mtd = mtd; host-cs = cs; host-info_data = info; - mtd-priv = host; - mtd-owner = THIS_MODULE; + mtd_setup_common_members(mtd, host, pdev); chip-ecc.read_page = pxa3xx_nand_read_page_hwecc; chip-ecc.write_page= pxa3xx_nand_write_page_hwecc; -- Should we add driver.owner = THIS_MODULE field for struct platform_driver in this case? ---