diff for duplicates of <200807311251.02251.bzolnier@gmail.com> diff --git a/a/1.txt b/N1/1.txt index 0e59f82..478ae2a 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,16 +1,17 @@ On Thursday 31 July 2008, Benjamin Herrenschmidt wrote: -> +>=20 > > Is it actually caused by additional reference counting on drive->gendev? > > IOW if you reverse the patch below instead of applying the previous fix > > do things work OK again? -> > +> >=20 > > > Note that there shouldn't be anything fundamentally different from -> > > ide-pmac here vs. something like pcmcia IDE cards... do you have one of +> > > ide-pmac here vs. something like pcmcia IDE cards... do you have one = +of > > > these to test with ? -> > +> >=20 > > Nope and I really don't intend to have one. I count on other people > > to take some care of support for host drivers that they maintain/use. ;) -> +>=20 > Reverting the patch below does the job. Thanks. Thanks, this narrows down the problem pretty nicely. @@ -22,14 +23,14 @@ Thanks, this narrows down the problem pretty nicely. Lets get back to the oops: Vector: 300 (Data Access) at [c59dfdc0] - pc: c0211f78: ide_device_put+0x18/0x58 - lr: c0223c34: ide_cd_put+0x40/0x5c - sp: c59dfe70 - msr: 9032 - dar: 10 - dsisr: 40000000 - current = 0xc58a9880 - pid = 843, comm = media-bay +=C2=A0 =C2=A0 pc: c0211f78: ide_device_put+0x18/0x58 +=C2=A0 =C2=A0 lr: c0223c34: ide_cd_put+0x40/0x5c +=C2=A0 =C2=A0 sp: c59dfe70 +=C2=A0 =C2=A0msr: 9032 +=C2=A0 =C2=A0dar: 10 +=C2=A0dsisr: 40000000 +=C2=A0 current =3D 0xc58a9880 +=C2=A0 =C2=A0 pid =C2=A0 =3D 843, comm =3D media-bay enter ? for help [c59dfe80] c0223c34 ide_cd_put+0x40/0x5c [c59dfea0] c02114d4 generic_ide_remove+0x28/0x3c @@ -49,29 +50,30 @@ On a fresh look at ide_device_put(), ide_host_alloc() and pmac.c it may be that the above oops is actually media-bay specific. ide_device_put(): -... - struct device *host_dev = drive->hwif->host->dev[0]; - struct module *module = host_dev ? host_dev->driver->owner : NULL; -... +=2E.. + struct device *host_dev =3D drive->hwif->host->dev[0]; + struct module *module =3D host_dev ? host_dev->driver->owner : NULL; +=2E.. ide_host_alloc(): -... +=2E.. if (hws[0]) - host->dev[0] = hws[0]->dev; -... + host->dev[0] =3D hws[0]->dev; +=2E.. pmac.c: -... -pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match) -... +=2E.. +pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *ma= +tch) +=2E.. dev_set_drvdata(&mdev->ofdev.dev, pmif); memset(&hw, 0, sizeof(hw)); pmac_ide_init_ports(&hw, pmif->regbase); - hw.irq = irq; - hw.dev = &mdev->bus->pdev->dev; - hw.parent = &mdev->ofdev.dev; -... + hw.irq =3D irq; + hw.dev =3D &mdev->bus->pdev->dev; + hw.parent =3D &mdev->ofdev.dev; +=2E.. pmac macio is unique in using different devices for hwif->dev / host->dev (hw.dev) and hwif->gendev.parent / dev_set_drvdata() (hw.parent) @@ -82,10 +84,11 @@ Thus we may be hitting oops in ide_device_put() on host_dev->driver because hw.dev is used as host->dev for pmac macio in ide_device_put() while we really want to use hw.parent. -Fix should be as simple as: +=46ix should be as simple as: -- host->dev[0] = hws[0]->dev; -+ host->dev[0] = hws[0]->parent ? hws[0]->parent : hws[0]->dev; +=2D host->dev[0] =3D hws[0]->dev; ++ host->dev[0] =3D hws[0]->parent ? hws[0]->parent : hws[0]-= +>dev; Could you please try it together with my previous patch for ide_device_{get,put}()? diff --git a/a/content_digest b/N1/content_digest index 099c8d3..20cc550 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -7,23 +7,24 @@ "To\0benh@kernel.crashing.org\0" "Cc\0FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>" linux-ide@vger.kernel.org - linuxppc-dev@ozlabs.org - " petkovbb@gmail.com\0" + petkovbb@gmail.com + " linuxppc-dev@ozlabs.org\0" "\00:1\0" "b\0" "On Thursday 31 July 2008, Benjamin Herrenschmidt wrote:\n" - "> \n" + ">=20\n" "> > Is it actually caused by additional reference counting on drive->gendev?\n" "> > IOW if you reverse the patch below instead of applying the previous fix\n" "> > do things work OK again?\n" - "> > \n" + "> >=20\n" "> > > Note that there shouldn't be anything fundamentally different from\n" - "> > > ide-pmac here vs. something like pcmcia IDE cards... do you have one of\n" + "> > > ide-pmac here vs. something like pcmcia IDE cards... do you have one =\n" + "of\n" "> > > these to test with ?\n" - "> > \n" + "> >=20\n" "> > Nope and I really don't intend to have one. I count on other people\n" "> > to take some care of support for host drivers that they maintain/use. ;)\n" - "> \n" + ">=20\n" "> Reverting the patch below does the job. Thanks.\n" "\n" "Thanks, this narrows down the problem pretty nicely.\n" @@ -35,14 +36,14 @@ "Lets get back to the oops:\n" "\n" "Vector: 300 (Data Access) at [c59dfdc0]\n" - "\302\240 \302\240 pc: c0211f78: ide_device_put+0x18/0x58\n" - "\302\240 \302\240 lr: c0223c34: ide_cd_put+0x40/0x5c\n" - "\302\240 \302\240 sp: c59dfe70\n" - "\302\240 \302\240msr: 9032\n" - "\302\240 \302\240dar: 10\n" - "\302\240dsisr: 40000000\n" - "\302\240 current = 0xc58a9880\n" - "\302\240 \302\240 pid \302\240 = 843, comm = media-bay\n" + "=C2=A0 =C2=A0 pc: c0211f78: ide_device_put+0x18/0x58\n" + "=C2=A0 =C2=A0 lr: c0223c34: ide_cd_put+0x40/0x5c\n" + "=C2=A0 =C2=A0 sp: c59dfe70\n" + "=C2=A0 =C2=A0msr: 9032\n" + "=C2=A0 =C2=A0dar: 10\n" + "=C2=A0dsisr: 40000000\n" + "=C2=A0 current =3D 0xc58a9880\n" + "=C2=A0 =C2=A0 pid =C2=A0 =3D 843, comm =3D media-bay\n" "enter ? for help\n" "[c59dfe80] c0223c34 ide_cd_put+0x40/0x5c\n" "[c59dfea0] c02114d4 generic_ide_remove+0x28/0x3c\n" @@ -62,29 +63,30 @@ "it may be that the above oops is actually media-bay specific.\n" "\n" "ide_device_put():\n" - "...\n" - " struct device *host_dev = drive->hwif->host->dev[0];\n" - " struct module *module = host_dev ? host_dev->driver->owner : NULL;\n" - "...\n" + "=2E..\n" + " struct device *host_dev =3D drive->hwif->host->dev[0];\n" + " struct module *module =3D host_dev ? host_dev->driver->owner : NULL;\n" + "=2E..\n" "\n" "ide_host_alloc():\n" - "...\n" + "=2E..\n" " if (hws[0])\n" - " host->dev[0] = hws[0]->dev;\n" - "...\n" + " host->dev[0] =3D hws[0]->dev;\n" + "=2E..\n" "\n" "pmac.c:\n" - "...\n" - "pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)\n" - "...\n" + "=2E..\n" + "pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *ma=\n" + "tch)\n" + "=2E..\n" "\tdev_set_drvdata(&mdev->ofdev.dev, pmif);\n" "\n" "\tmemset(&hw, 0, sizeof(hw));\n" "\tpmac_ide_init_ports(&hw, pmif->regbase);\n" - "\thw.irq = irq;\n" - "\thw.dev = &mdev->bus->pdev->dev;\n" - "\thw.parent = &mdev->ofdev.dev;\n" - "...\n" + "\thw.irq =3D irq;\n" + "\thw.dev =3D &mdev->bus->pdev->dev;\n" + "\thw.parent =3D &mdev->ofdev.dev;\n" + "=2E..\n" "\n" "pmac macio is unique in using different devices for hwif->dev / host->dev\n" "(hw.dev) and hwif->gendev.parent / dev_set_drvdata() (hw.parent)\n" @@ -95,14 +97,15 @@ "because hw.dev is used as host->dev for pmac macio in ide_device_put()\n" "while we really want to use hw.parent.\n" "\n" - "Fix should be as simple as:\n" + "=46ix should be as simple as:\n" "\n" - "- host->dev[0] = hws[0]->dev;\n" - "+ host->dev[0] = hws[0]->parent ? hws[0]->parent : hws[0]->dev;\n" + "=2D host->dev[0] =3D hws[0]->dev;\n" + "+ host->dev[0] =3D hws[0]->parent ? hws[0]->parent : hws[0]-=\n" + ">dev;\n" "\n" "Could you please try it together with my previous patch for\n" "ide_device_{get,put}()?\n" "\n" Bart -0b67519a3fbac356e6720973a453a6b6c2f0a062e80dd7de057c923096a6f93b +88e2ac8b34908be18432d7138f6e11d90a88aa1d2df66b1134788cba14a98334
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.