public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: "Rodríguez Barbarin, José Javier" <JoseJavier.Rodriguez@duagon.com>
Cc: "jirislaby@kernel.org" <jirislaby@kernel.org>,
	"morbidrsa@gmail.com" <morbidrsa@gmail.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jth@kernel.org" <jth@kernel.org>,
	"Sanjuán García, Jorge" <Jorge.SanjuanGarcia@duagon.com>
Subject: Re: [PATCH v2 1/1] mcb: create dedicated bus_type for mcb_bus and mcb_device
Date: Sat, 19 Aug 2023 11:56:33 +0200	[thread overview]
Message-ID: <2023081913-trifocals-flagpole-cdf7@gregkh> (raw)
In-Reply-To: <20230818110230.186700-2-JoseJavier.Rodriguez@duagon.com>

On Fri, Aug 18, 2023 at 11:03:03AM +0000, Rodríguez Barbarin, José Javier wrote:
> When allocating a new mcb_bus the bus_type is added to the mcb_bus
> itself, causing an issue when calling mcb_bus_add_devices().
> This function is not only called for each mcb_device under the
> mcb_bus but for the bus itself.
> 
> This causes a crash when freeing the ida resources as the bus numbering
> gets corrupted due to a wrong cast of structs mcb_bus and mcb_device.

Why not just fix this up and determine the "type" of the device before
you cast anything?

> Make the release of the mcb devices and their mcb bus explicit.

That's good, but now you have a new bus type which is a bit odd just for
the bus controller.  It's not necessarily bad, but not generally what
other busses do.  As an example, USB controllers are not their own bus
type, but rather, a different type of device on the same bus.  Same goes
for greybus devices/controllers.

So perhaps try doing that instead of creating a whole new bus here?

thanks,

greg k-h

  reply	other threads:[~2023-08-19 10:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 14:57 [PATCH 0/1] mcb patchses for v6.6 Johannes Thumshirn
2023-07-10 14:57 ` [PATCH 1/1] mcb: Do not add the mcb_bus_type to the mcb_bus itself Johannes Thumshirn
2023-07-10 15:05   ` Greg Kroah-Hartman
2023-08-18 11:02     ` [PATCH v2 0/1] mcb: Fix crash mcb-core module is removed Rodríguez Barbarin, José Javier
2023-08-18 11:03       ` [PATCH v2 1/1] mcb: create dedicated bus_type for mcb_bus and mcb_device Rodríguez Barbarin, José Javier
2023-08-19  9:56         ` gregkh [this message]
2023-08-23  8:07           ` Sanjuán García, Jorge

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=2023081913-trifocals-flagpole-cdf7@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=Jorge.SanjuanGarcia@duagon.com \
    --cc=JoseJavier.Rodriguez@duagon.com \
    --cc=jirislaby@kernel.org \
    --cc=jth@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=morbidrsa@gmail.com \
    /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