Message ID | 20191003000310.17099-3-chris.packham@alliedtelesis.co.nz (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | pinctrl: iproc: improve error handling | expand |
looks fine On 2019-10-02 5:03 p.m., Chris Packham wrote: > Use the dev_name(dev) for the irqc->name so that we get unique names > when we have multiple instances of this driver. > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Acked-by: Scott Branden <scott.branden@broadcom.com> > --- > drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > index 8971fc54e974..c24d49d436ce 100644 > --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > @@ -858,7 +858,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) > struct gpio_irq_chip *girq; > > irqc = &chip->irqchip; > - irqc->name = "bcm-iproc-gpio"; > + irqc->name = dev_name(dev); > irqc->irq_ack = iproc_gpio_irq_ack; > irqc->irq_mask = iproc_gpio_irq_mask; > irqc->irq_unmask = iproc_gpio_irq_unmask;
On Thu, Oct 3, 2019 at 2:03 AM Chris Packham <chris.packham@alliedtelesis.co.nz> wrote: > Use the dev_name(dev) for the irqc->name so that we get unique names > when we have multiple instances of this driver. > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Patch applied. Yours, Linus Walleij
Hi Chris, CC MarcZ On Thu, Oct 3, 2019 at 2:03 AM Chris Packham <chris.packham@alliedtelesis.co.nz> wrote: > Use the dev_name(dev) for the irqc->name so that we get unique names > when we have multiple instances of this driver. > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> A while ago, Marc Zyngier pointed out that the irq_chip .name field should contain the device's class name, not the instance's name. Hence the current code is correct? See also "[PATCH 0/4] irqchip: renesas: Use proper irq_chip name and parent" (https://lore.kernel.org/lkml/20190607095858.10028-1-geert+renesas@glider.be/) Note that the irqchip patches in that series have been applied; the gpio patches haven't been applied yet. > --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > @@ -858,7 +858,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) > struct gpio_irq_chip *girq; > > irqc = &chip->irqchip; > - irqc->name = "bcm-iproc-gpio"; > + irqc->name = dev_name(dev); > irqc->irq_ack = iproc_gpio_irq_ack; > irqc->irq_mask = iproc_gpio_irq_mask; > irqc->irq_unmask = iproc_gpio_irq_unmask; Gr{oetje,eeting}s, Geert
On Mon, 07 Oct 2019 08:30:50 +0100, Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > Hi Chris, > > CC MarcZ > > On Thu, Oct 3, 2019 at 2:03 AM Chris Packham > <chris.packham@alliedtelesis.co.nz> wrote: > > Use the dev_name(dev) for the irqc->name so that we get unique names > > when we have multiple instances of this driver. > > > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> > > A while ago, Marc Zyngier pointed out that the irq_chip .name field > should contain the device's class name, not the instance's name. > Hence the current code is correct? Thanks Geert for looping me in. The main reasons why I oppose this kind of "let's show as much information as we can in /proc/interrupts" are: - It clutters the output badly: the formatting of this file, which is bad enough when you have a small number of CPUs, becomes unreadable when you have a large number of them *and* stupidly long strings that only make sense on a given platform. - Like it or not, /proc is ABI. We don't change things randomly there without a good reason, and debugging isn't one of them. - Debug information belongs to debugfs, where we already have plenty of stuff (see CONFIG_GENERIC_IRQ_DEBUGFS). I'd rather we improve this infrastructure if needed, rather than add platform specific hacks. </rant> Thanks, M. > > See also "[PATCH 0/4] irqchip: renesas: Use proper irq_chip name and parent" > (https://lore.kernel.org/lkml/20190607095858.10028-1-geert+renesas@glider.be/) > Note that the irqchip patches in that series have been applied; the gpio > patches haven't been applied yet. > > > --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > > +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > > @@ -858,7 +858,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) > > struct gpio_irq_chip *girq; > > > > irqc = &chip->irqchip; > > - irqc->name = "bcm-iproc-gpio"; > > + irqc->name = dev_name(dev); > > irqc->irq_ack = iproc_gpio_irq_ack; > > irqc->irq_mask = iproc_gpio_irq_mask; > > irqc->irq_unmask = iproc_gpio_irq_unmask; > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds >
On 2019-10-07 1:14 a.m., Marc Zyngier wrote: > On Mon, 07 Oct 2019 08:30:50 +0100, > Geert Uytterhoeven <geert@linux-m68k.org> wrote: >> Hi Chris, >> >> CC MarcZ >> >> On Thu, Oct 3, 2019 at 2:03 AM Chris Packham >> <chris.packham@alliedtelesis.co.nz> wrote: >>> Use the dev_name(dev) for the irqc->name so that we get unique names >>> when we have multiple instances of this driver. >>> >>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> >> A while ago, Marc Zyngier pointed out that the irq_chip .name field >> should contain the device's class name, not the instance's name. >> Hence the current code is correct? > Thanks Geert for looping me in. The main reasons why I oppose this > kind of "let's show as much information as we can in /proc/interrupts" > are: > > - It clutters the output badly: the formatting of this file, which is > bad enough when you have a small number of CPUs, becomes unreadable > when you have a large number of them *and* stupidly long strings > that only make sense on a given platform. > > - Like it or not, /proc is ABI. We don't change things randomly there > without a good reason, and debugging isn't one of them. > > - Debug information belongs to debugfs, where we already have plenty > of stuff (see CONFIG_GENERIC_IRQ_DEBUGFS). I'd rather we improve > this infrastructure if needed, rather than add platform specific > hacks. > > </rant> > > Thanks, > > M. Thanks Marc/Geert. Sounds like we should drop patch 2 from series. > >> See also "[PATCH 0/4] irqchip: renesas: Use proper irq_chip name and parent" >> (https://lore.kernel.org/lkml/20190607095858.10028-1-geert+renesas@glider.be/) >> Note that the irqchip patches in that series have been applied; the gpio >> patches haven't been applied yet. >> >>> --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c >>> +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c >>> @@ -858,7 +858,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) >>> struct gpio_irq_chip *girq; >>> >>> irqc = &chip->irqchip; >>> - irqc->name = "bcm-iproc-gpio"; >>> + irqc->name = dev_name(dev); >>> irqc->irq_ack = iproc_gpio_irq_ack; >>> irqc->irq_mask = iproc_gpio_irq_mask; >>> irqc->irq_unmask = iproc_gpio_irq_unmask; >> Gr{oetje,eeting}s, >> >> Geert >> >> -- >> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org >> >> In personal conversations with technical people, I call myself a hacker. But >> when I'm talking to journalists I just say "programmer" or something like that. >> -- Linus Torvalds >>
On Mon, Oct 7, 2019 at 10:14 AM Marc Zyngier <maz@kernel.org> wrote: > On Mon, 07 Oct 2019 08:30:50 +0100, > Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > > Hi Chris, > > > > CC MarcZ > > > > On Thu, Oct 3, 2019 at 2:03 AM Chris Packham > > <chris.packham@alliedtelesis.co.nz> wrote: > > > Use the dev_name(dev) for the irqc->name so that we get unique names > > > when we have multiple instances of this driver. > > > > > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> > > > > A while ago, Marc Zyngier pointed out that the irq_chip .name field > > should contain the device's class name, not the instance's name. > > Hence the current code is correct? > > Thanks Geert for looping me in. The main reasons why I oppose this > kind of "let's show as much information as we can in /proc/interrupts" > are: > > - It clutters the output badly: the formatting of this file, which is > bad enough when you have a small number of CPUs, becomes unreadable > when you have a large number of them *and* stupidly long strings > that only make sense on a given platform. > > - Like it or not, /proc is ABI. We don't change things randomly there > without a good reason, and debugging isn't one of them. > > - Debug information belongs to debugfs, where we already have plenty > of stuff (see CONFIG_GENERIC_IRQ_DEBUGFS). I'd rather we improve > this infrastructure if needed, rather than add platform specific > hacks. > > </rant> I have reverted the patch. Yours, Linus Walleij
Hi LinusW, Scott, Geert, MarcZ, On Mon, 2019-10-07 at 10:10 -0700, Scott Branden wrote: > > On 2019-10-07 1:14 a.m., Marc Zyngier wrote: > > On Mon, 07 Oct 2019 08:30:50 +0100, > > Geert Uytterhoeven <geert@linux-m68k.org> wrote: > > > Hi Chris, > > > > > > CC MarcZ > > > > > > On Thu, Oct 3, 2019 at 2:03 AM Chris Packham > > > <chris.packham@alliedtelesis.co.nz> wrote: > > > > Use the dev_name(dev) for the irqc->name so that we get unique names > > > > when we have multiple instances of this driver. > > > > > > > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> > > > > > > A while ago, Marc Zyngier pointed out that the irq_chip .name field > > > should contain the device's class name, not the instance's name. > > > Hence the current code is correct? > > > > Thanks Geert for looping me in. The main reasons why I oppose this > > kind of "let's show as much information as we can in /proc/interrupts" > > are: > > > > - It clutters the output badly: the formatting of this file, which is > > bad enough when you have a small number of CPUs, becomes unreadable > > when you have a large number of them *and* stupidly long strings > > that only make sense on a given platform. > > > > - Like it or not, /proc is ABI. We don't change things randomly there > > without a good reason, and debugging isn't one of them. > > > > - Debug information belongs to debugfs, where we already have plenty > > of stuff (see CONFIG_GENERIC_IRQ_DEBUGFS). I'd rather we improve > > this infrastructure if needed, rather than add platform specific > > hacks. > > > > </rant> > > > > Thanks, > > > > M. > > Thanks Marc/Geert. Sounds like we should drop patch 2 from series. Sorry for not responding earlier (I was on vacation for a week). I'm fine with dropping this patch. > > > > > See also "[PATCH 0/4] irqchip: renesas: Use proper irq_chip name and parent" > > > (https://lore.kernel.org/lkml/20190607095858.10028-1-geert+renesas@glider.be/) > > > Note that the irqchip patches in that series have been applied; the gpio > > > patches haven't been applied yet. > > > > > > > --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > > > > +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c > > > > @@ -858,7 +858,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) > > > > struct gpio_irq_chip *girq; > > > > > > > > irqc = &chip->irqchip; > > > > - irqc->name = "bcm-iproc-gpio"; > > > > + irqc->name = dev_name(dev); > > > > irqc->irq_ack = iproc_gpio_irq_ack; > > > > irqc->irq_mask = iproc_gpio_irq_mask; > > > > irqc->irq_unmask = iproc_gpio_irq_unmask; > > > > > > Gr{oetje,eeting}s, > > > > > > Geert > > > > > > -- > > > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > > > > > In personal conversations with technical people, I call myself a hacker. But > > > when I'm talking to journalists I just say "programmer" or something like that. > > > -- Linus Torvalds > > > > >
diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c index 8971fc54e974..c24d49d436ce 100644 --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c @@ -858,7 +858,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) struct gpio_irq_chip *girq; irqc = &chip->irqchip; - irqc->name = "bcm-iproc-gpio"; + irqc->name = dev_name(dev); irqc->irq_ack = iproc_gpio_irq_ack; irqc->irq_mask = iproc_gpio_irq_mask; irqc->irq_unmask = iproc_gpio_irq_unmask;
Use the dev_name(dev) for the irqc->name so that we get unique names when we have multiple instances of this driver. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> --- drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)